vendor: 4,561 bytes, lines 1-110
1var __defProp = Object.defineProperty; 2var __defProps = Object.defineProperties; 3var __getOwnPropDescs = Object.getOwnPropertyDescriptors; 4var __getOwnPropNames = Object.getOwnPropertyNames; 5var __getOwnPropSymbols = Object.getOwnPropertySymbols; 6var __hasOwnProp = Object.prototype.hasOwnProperty; 7var __propIsEnum = Object.prototype.propertyIsEnumerable; 8var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); 9var __typeError = (msg) => { 10 throw TypeError(msg); 11}; 12var __pow = Math.pow; 13var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 14var __spreadValues = (a, b) => { 15 for (var prop in b || (b = {})) 16 if (__hasOwnProp.call(b, prop)) 17 __defNormalProp(a, prop, b[prop]); 18 if (__getOwnPropSymbols) 19 for (var prop of __getOwnPropSymbols(b)) { 20 if (__propIsEnum.call(b, prop)) 21 __defNormalProp(a, prop, b[prop]); 22 } 23 return a; 24}; 25var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); 26var __restKey = (key) => typeof key === "symbol" ? key : key + ""; 27var __objRest = (source, exclude) => { 28 var target = {}; 29 for (var prop in source) 30 if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) 31 target[prop] = source[prop]; 32 if (source != null && __getOwnPropSymbols) 33 for (var prop of __getOwnPropSymbols(source)) { 34 if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) 35 target[prop] = source[prop]; 36 } 37 return target; 38}; 39var __commonJS = (cb, mod) => function __require() { 40 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 41}; 42var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); 43var __async = (__this, __arguments, generator) => { 44 return new Promise((resolve, reject) => { 45 var fulfilled = (value) => { 46 try { 47 step(generator.next(value)); 48 } catch (e) { 49 reject(e); 50 } 51 }; 52 var rejected = (value) => { 53 try { 54 step(generator.throw(value)); 55 } catch (e) { 56 reject(e); 57 } 58 }; 59 var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); 60 step((generator = generator.apply(__this, __arguments)).next()); 61 }); 62}; 63var __await = function(promise, isYieldStar) { 64 this[0] = promise; 65 this[1] = isYieldStar; 66}; 67var __asyncGenerator = (__this, __arguments, generator) => { 68 var resume = (k, v, yes, no) => { 69 try { 70 var x = generator[k](v), isAwait = (v = x.value) instanceof __await, done = x.done; 71 Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume("throw", e, yes, no)); 72 } catch (e) { 73 no(e); 74 } 75 }, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {}; 76 return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it; 77}; 78var __yieldStar = (value) => { 79 var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {}; 80 if (obj == null) { 81 obj = value[__knownSymbol("iterator")](); 82 method = (k) => it[k] = (x) => obj[k](x); 83 } else { 84 obj = obj.call(value); 85 method = (k) => it[k] = (v) => { 86 if (isAwait) { 87 isAwait = false; 88 if (k === "throw") throw v; 89 return v; 90 } 91 isAwait = true; 92 return { 93 done: false, 94 value: new __await(new Promise((resolve) => { 95 var x = obj[k](v); 96 if (!(x instanceof Object)) __typeError("Object expected"); 97 resolve(x); 98 }), 1) 99 }; 100 }; 101 } 102 return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { 103 throw x; 104 }, "return" in obj && method("return"), it; 105}; 106var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it); 107var require_index_001 = __commonJS({ 108 "assets/index-DEp0NvQu.js"(exports, module) { 109 ; 110 {
111 try { 112 let e2 = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n2 = new e2.Error().stack; 113 n2 && (e2._sentryDebugIds = e2._sentryDebugIds || {}, e2._sentryDebugIds[n2] = "f388482f-4770-4191-a4d9-ac5c6ea60761", e2._sentryDebugIdIdentifier = "sentry-dbid-f388482f-4770-4191-a4d9-ac5c6ea60761"); 114 } catch (e2) { 115 } 116 } 117 ; 118 function _mergeNamespaces(n2, m2) { 119 for (var i2 = 0; i2 < m2.length; i2++) { 120 const e2 = m2[i2]; 121 if (typeof e2 !== "string" && !Array.isArray(e2)) { 122 for (const k2 in e2) { 123 if (k2 !== "default" && !(k2 in n2)) { 124 const d2 = Object.getOwnPropertyDescriptor(e2, k2); 125 if (d2) { 126 Object.defineProperty(n2, k2, d2.get ? d2 : { 127 enumerable: true, 128 get: () => e2[k2] 129 }); 130 } 131 } 132 } 133 } 134 } 135 return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" })); 136 } 137 (function polyfill() { 138 const relList = document.createElement("link").relList; 139 if (relList && relList.supports && relList.supports("modulepreload")) return; 140 for (const link of document.querySelectorAll('link[rel="modulepreload"]')) processPreload(link); 141 new MutationObserver((mutations) => { 142 for (const mutation of mutations) { 143 if (mutation.type !== "childList") continue; 144 for (const node2 of mutation.addedNodes) if (node2.tagName === "LINK" && node2.rel === "modulepreload") processPreload(node2); 145 } 146 }).observe(document, { 147 childList: true, 148 subtree: true 149 }); 150 function getFetchOpts(link) { 151 const fetchOpts = {}; 152 if (link.integrity) fetchOpts.integrity = link.integrity; 153 if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy; 154 if (link.crossOrigin === "use-credentials") fetchOpts.credentials = "include"; 155 else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; 156 else fetchOpts.credentials = "same-origin"; 157 return fetchOpts; 158 } 159 function processPreload(link) { 160 if (link.ep) return; 161 link.ep = true; 162 const fetchOpts = getFetchOpts(link); 163 fetch(link.href, fetchOpts); 164 } 165 })(); 166 if (typeof globalThis.__fw_env__ === "string") { 167 globalThis.__fw_env__ = { 168 FW_ENV: void 0, 169 FW_BASE_URL: void 0, 170 FW_BASE_API_URL: void 0, 171 FW_MEMBERSHIPS_API_URL: void 0, 172 FW_AUTH_URL: void 0, 173 FW_SHOP_RENDERER_API_URL: void 0, 174 FW_HERO_URL: void 0, 175 FW_OMNI_URL: void 0 176 }; 177 } 178 function getDefaultExportFromCjs(x2) { 179 return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2; 180 } 181 function getAugmentedNamespace(n2) { 182 if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2; 183 var f2 = n2.default; 184 if (typeof f2 == "function") { 185 var a2 = function a3() { 186 var isInstance = false; 187 try { 188 isInstance = this instanceof a3; 189 } catch (e2) { 190 } 191 if (isInstance) { 192 return Reflect.construct(f2, arguments, this.constructor); 193 } 194 return f2.apply(this, arguments); 195 }; 196 a2.prototype = f2.prototype; 197 } else a2 = {}; 198 Object.defineProperty(a2, "__esModule", { value: true }); 199 Object.keys(n2).forEach(function(k2) { 200 var d2 = Object.getOwnPropertyDescriptor(n2, k2); 201 Object.defineProperty(a2, k2, d2.get ? d2 : { 202 enumerable: true, 203 get: function() { 204 return n2[k2]; 205 } 206 }); 207 }); 208 return a2; 209 } 210 var jsxRuntime = { exports: {} }; 211 var reactJsxRuntime_production_min = {}; 212 var react = { exports: {} }; 213 var react_production_min = {}; 214 /** 215 * @license React 216 * react.production.min.js 217 * 218 * Copyright (c) Facebook, Inc. and its affiliates. 219 * 220 * This source code is licensed under the MIT license found in the 221 * LICENSE file in the root directory of this source tree. 222 */ 223 var hasRequiredReact_production_min; 224 function requireReact_production_min() { 225 if (hasRequiredReact_production_min) return react_production_min; 226 hasRequiredReact_production_min = 1; 227 var l2 = Symbol.for("react.element"), n2 = Symbol.for("react.portal"), p2 =
vendor: 11,706 bytes, lines 227-499
227Symbol.for("react.fragment"), q2 = Symbol.for("react.strict_mode"), r2 = Symbol.for("react.profiler"), t2 = Symbol.for("react.provider"), u2 = Symbol.for("react.context"), v2 = Symbol.for("react.forward_ref"), w2 = Symbol.for("react.suspense"), x2 = Symbol.for("react.memo"), y2 = Symbol.for("react.lazy"), z2 = Symbol.iterator; 228 function A2(a2) { 229 if (null === a2 || "object" !== typeof a2) return null; 230 a2 = z2 && a2[z2] || a2["@@iterator"]; 231 return "function" === typeof a2 ? a2 : null; 232 } 233 var B2 = { isMounted: function() { 234 return false; 235 }, enqueueForceUpdate: function() { 236 }, enqueueReplaceState: function() { 237 }, enqueueSetState: function() { 238 } }, C2 = Object.assign, D2 = {}; 239 function E2(a2, b2, e2) { 240 this.props = a2; 241 this.context = b2; 242 this.refs = D2; 243 this.updater = e2 || B2; 244 } 245 E2.prototype.isReactComponent = {}; 246 E2.prototype.setState = function(a2, b2) { 247 if ("object" !== typeof a2 && "function" !== typeof a2 && null != a2) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); 248 this.updater.enqueueSetState(this, a2, b2, "setState"); 249 }; 250 E2.prototype.forceUpdate = function(a2) { 251 this.updater.enqueueForceUpdate(this, a2, "forceUpdate"); 252 }; 253 function F2() { 254 } 255 F2.prototype = E2.prototype; 256 function G2(a2, b2, e2) { 257 this.props = a2; 258 this.context = b2; 259 this.refs = D2; 260 this.updater = e2 || B2; 261 } 262 var H2 = G2.prototype = new F2(); 263 H2.constructor = G2; 264 C2(H2, E2.prototype); 265 H2.isPureReactComponent = true; 266 var I2 = Array.isArray, J2 = Object.prototype.hasOwnProperty, K2 = { current: null }, L2 = { key: true, ref: true, __self: true, __source: true }; 267 function M2(a2, b2, e2) { 268 var d2, c2 = {}, k2 = null, h2 = null; 269 if (null != b2) for (d2 in void 0 !== b2.ref && (h2 = b2.ref), void 0 !== b2.key && (k2 = "" + b2.key), b2) J2.call(b2, d2) && !L2.hasOwnProperty(d2) && (c2[d2] = b2[d2]); 270 var g2 = arguments.length - 2; 271 if (1 === g2) c2.children = e2; 272 else if (1 < g2) { 273 for (var f2 = Array(g2), m2 = 0; m2 < g2; m2++) f2[m2] = arguments[m2 + 2]; 274 c2.children = f2; 275 } 276 if (a2 && a2.defaultProps) for (d2 in g2 = a2.defaultProps, g2) void 0 === c2[d2] && (c2[d2] = g2[d2]); 277 return { $$typeof: l2, type: a2, key: k2, ref: h2, props: c2, _owner: K2.current }; 278 } 279 function N2(a2, b2) { 280 return { $$typeof: l2, type: a2.type, key: b2, ref: a2.ref, props: a2.props, _owner: a2._owner }; 281 } 282 function O2(a2) { 283 return "object" === typeof a2 && null !== a2 && a2.$$typeof === l2; 284 } 285 function escape2(a2) { 286 var b2 = { "=": "=0", ":": "=2" }; 287 return "$" + a2.replace(/[=:]/g, function(a3) { 288 return b2[a3]; 289 }); 290 } 291 var P2 = /\/+/g; 292 function Q2(a2, b2) { 293 return "object" === typeof a2 && null !== a2 && null != a2.key ? escape2("" + a2.key) : b2.toString(36); 294 } 295 function R2(a2, b2, e2, d2, c2) { 296 var k2 = typeof a2; 297 if ("undefined" === k2 || "boolean" === k2) a2 = null; 298 var h2 = false; 299 if (null === a2) h2 = true; 300 else switch (k2) { 301 case "string": 302 case "number": 303 h2 = true; 304 break; 305 case "object": 306 switch (a2.$$typeof) { 307 case l2: 308 case n2: 309 h2 = true; 310 } 311 } 312 if (h2) return h2 = a2, c2 = c2(h2), a2 = "" === d2 ? "." + Q2(h2, 0) : d2, I2(c2) ? (e2 = "", null != a2 && (e2 = a2.replace(P2, "$&/") + "/"), R2(c2, b2, e2, "", function(a3) { 313 return a3; 314 })) : null != c2 && (O2(c2) && (c2 = N2(c2, e2 + (!c2.key || h2 && h2.key === c2.key ? "" : ("" + c2.key).replace(P2, "$&/") + "/") + a2)), b2.push(c2)), 1; 315 h2 = 0; 316 d2 = "" === d2 ? "." : d2 + ":"; 317 if (I2(a2)) for (var g2 = 0; g2 < a2.length; g2++) { 318 k2 = a2[g2]; 319 var f2 = d2 + Q2(k2, g2); 320 h2 += R2(k2, b2, e2, f2, c2); 321 } 322 else if (f2 = A2(a2), "function" === typeof f2) for (a2 = f2.call(a2), g2 = 0; !(k2 = a2.next()).done; ) k2 = k2.value, f2 = d2 + Q2(k2, g2++), h2 += R2(k2, b2, e2, f2, c2); 323 else if ("object" === k2) throw b2 = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b2 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead."); 324 return h2; 325 } 326 function S2(a2, b2, e2) { 327 if (null == a2) return a2; 328 var d2 = [], c2 = 0; 329 R2(a2, d2, "", "", function(a3) { 330 return b2.call(e2, a3, c2++); 331 }); 332 return d2; 333 } 334 function T2(a2) { 335 if (-1 === a2._status) { 336 var b2 = a2._result; 337 b2 = b2(); 338 b2.then(function(b3) { 339 if (0 === a2._status || -1 === a2._status) a2._status = 1, a2._result = b3; 340 }, function(b3) { 341 if (0 === a2._status || -1 === a2._status) a2._status = 2, a2._result = b3; 342 }); 343 -1 === a2._status && (a2._status = 0, a2._result = b2); 344 } 345 if (1 === a2._status) return a2._result.default; 346 throw a2._result; 347 } 348 var U2 = { current: null }, V2 = { transition: null }, W2 = { ReactCurrentDispatcher: U2, ReactCurrentBatchConfig: V2, ReactCurrentOwner: K2 }; 349 function X2() { 350 throw Error("act(...) is not supported in production builds of React."); 351 } 352 react_production_min.Children = { map: S2, forEach: function(a2, b2, e2) { 353 S2(a2, function() { 354 b2.apply(this, arguments); 355 }, e2); 356 }, count: function(a2) { 357 var b2 = 0; 358 S2(a2, function() { 359 b2++; 360 }); 361 return b2; 362 }, toArray: function(a2) { 363 return S2(a2, function(a3) { 364 return a3; 365 }) || []; 366 }, only: function(a2) { 367 if (!O2(a2)) throw Error("React.Children.only expected to receive a single React element child."); 368 return a2; 369 } }; 370 react_production_min.Component = E2; 371 react_production_min.Fragment = p2; 372 react_production_min.Profiler = r2; 373 react_production_min.PureComponent = G2; 374 react_production_min.StrictMode = q2; 375 react_production_min.Suspense = w2; 376 react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W2; 377 react_production_min.act = X2; 378 react_production_min.cloneElement = function(a2, b2, e2) { 379 if (null === a2 || void 0 === a2) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a2 + "."); 380 var d2 = C2({}, a2.props), c2 = a2.key, k2 = a2.ref, h2 = a2._owner; 381 if (null != b2) { 382 void 0 !== b2.ref && (k2 = b2.ref, h2 = K2.current); 383 void 0 !== b2.key && (c2 = "" + b2.key); 384 if (a2.type && a2.type.defaultProps) var g2 = a2.type.defaultProps; 385 for (f2 in b2) J2.call(b2, f2) && !L2.hasOwnProperty(f2) && (d2[f2] = void 0 === b2[f2] && void 0 !== g2 ? g2[f2] : b2[f2]); 386 } 387 var f2 = arguments.length - 2; 388 if (1 === f2) d2.children = e2; 389 else if (1 < f2) { 390 g2 = Array(f2); 391 for (var m2 = 0; m2 < f2; m2++) g2[m2] = arguments[m2 + 2]; 392 d2.children = g2; 393 } 394 return { $$typeof: l2, type: a2.type, key: c2, ref: k2, props: d2, _owner: h2 }; 395 }; 396 react_production_min.createContext = function(a2) { 397 a2 = { $$typeof: u2, _currentValue: a2, _currentValue2: a2, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; 398 a2.Provider = { $$typeof: t2, _context: a2 }; 399 return a2.Consumer = a2; 400 }; 401 react_production_min.createElement = M2; 402 react_production_min.createFactory = function(a2) { 403 var b2 = M2.bind(null, a2); 404 b2.type = a2; 405 return b2; 406 }; 407 react_production_min.createRef = function() { 408 return { current: null }; 409 }; 410 react_production_min.forwardRef = function(a2) { 411 return { $$typeof: v2, render: a2 }; 412 }; 413 react_production_min.isValidElement = O2; 414 react_production_min.lazy = function(a2) { 415 return { $$typeof: y2, _payload: { _status: -1, _result: a2 }, _init: T2 }; 416 }; 417 react_production_min.memo = function(a2, b2) { 418 return { $$typeof: x2, type: a2, compare: void 0 === b2 ? null : b2 }; 419 }; 420 react_production_min.startTransition = function(a2) { 421 var b2 = V2.transition; 422 V2.transition = {}; 423 try { 424 a2(); 425 } finally { 426 V2.transition = b2; 427 } 428 }; 429 react_production_min.unstable_act = X2; 430 react_production_min.useCallback = function(a2, b2) { 431 return U2.current.useCallback(a2, b2); 432 }; 433 react_production_min.useContext = function(a2) { 434 return U2.current.useContext(a2); 435 }; 436 react_production_min.useDebugValue = function() { 437 }; 438 react_production_min.useDeferredValue = function(a2) { 439 return U2.current.useDeferredValue(a2); 440 }; 441 react_production_min.useEffect = function(a2, b2) { 442 return U2.current.useEffect(a2, b2); 443 }; 444 react_production_min.useId = function() { 445 return U2.current.useId(); 446 }; 447 react_production_min.useImperativeHandle = function(a2, b2, e2) { 448 return U2.current.useImperativeHandle(a2, b2, e2); 449 }; 450 react_production_min.useInsertionEffect = function(a2, b2) { 451 return U2.current.useInsertionEffect(a2, b2); 452 }; 453 react_production_min.useLayoutEffect = function(a2, b2) { 454 return U2.current.useLayoutEffect(a2, b2); 455 }; 456 react_production_min.useMemo = function(a2, b2) { 457 return U2.current.useMemo(a2, b2); 458 }; 459 react_production_min.useReducer = function(a2, b2, e2) { 460 return U2.current.useReducer(a2, b2, e2); 461 }; 462 react_production_min.useRef = function(a2) { 463 return U2.current.useRef(a2); 464 }; 465 react_production_min.useState = function(a2) { 466 return U2.current.useState(a2); 467 }; 468 react_production_min.useSyncExternalStore = function(a2, b2, e2) { 469 return U2.current.useSyncExternalStore(a2, b2, e2); 470 }; 471 react_production_min.useTransition = function() { 472 return U2.current.useTransition(); 473 }; 474 react_production_min.version = "18.3.1"; 475 return react_production_min; 476 } 477 var hasRequiredReact; 478 function requireReact() { 479 if (hasRequiredReact) return react.exports; 480 hasRequiredReact = 1; 481 { 482 react.exports = requireReact_production_min(); 483 } 484 return react.exports; 485 } 486 /** 487 * @license React 488 * react-jsx-runtime.production.min.js 489 * 490 * Copyright (c) Facebook, Inc. and its affiliates. 491 * 492 * This source code is licensed under the MIT license found in the 493 * LICENSE file in the root directory of this source tree. 494 */ 495 var hasRequiredReactJsxRuntime_production_min; 496 function requireReactJsxRuntime_production_min() { 497 if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; 498 hasRequiredReactJsxRuntime_production_min = 1; 499 var f2 = requireReact(), k2 = Symbol.for("react.element"), l2 = Symbol.for("react.fragment"), m2 = Object.prototype.hasOwnProperty, n2 = f2.__SECRET_INT
499ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p2 = { key: true, ref: true, __self: true, __source: true }; 500 function q2(c2, a2, g2) { 501 var b2, d2 = {}, e2 = null, h2 = null; 502 void 0 !== g2 && (e2 = "" + g2); 503 void 0 !== a2.key && (e2 = "" + a2.key); 504 void 0 !== a2.ref && (h2 = a2.ref); 505 for (b2 in a2) m2.call(a2, b2) && !p2.hasOwnProperty(b2) && (d2[b2] = a2[b2]); 506 if (c2 && c2.defaultProps) for (b2 in a2 = c2.defaultProps, a2) void 0 === d2[b2] && (d2[b2] = a2[b2]); 507 return { $$typeof: k2, type: c2, key: e2, ref: h2, props: d2, _owner: n2.current }; 508 } 509 reactJsxRuntime_production_min.Fragment = l2; 510 reactJsxRuntime_production_min.jsx = q2; 511 reactJsxRuntime_production_min.jsxs = q2; 512 return reactJsxRuntime_production_min; 513 } 514 var hasRequiredJsxRuntime; 515 function requireJsxRuntime() { 516 if (hasRequiredJsxRuntime) return jsxRuntime.exports; 517 hasRequiredJsxRuntime = 1; 518 { 519 jsxRuntime.exports = requireReactJsxRuntime_production_min(); 520 } 521 return jsxRuntime.exports; 522 } 523 var jsxRuntimeExports = requireJsxRuntime(); 524 const isString$4 = (obj) => typeof obj === "string"; 525 const defer = () => { 526 let res; 527 let rej; 528 const promise = new Promise((resolve, reject) => { 529 res = resolve; 530 rej = reject; 531 }); 532 promise.resolve = res; 533 promise.reject = rej; 534 return promise; 535 }; 536 const makeString = (object2) => { 537 if (object2 == null) return ""; 538 return "" + object2; 539 }; 540 const copy$1 = (a2, s2, t2) => { 541 a2.forEach((m2) => { 542 if (s2[m2]) t2[m2] = s2[m2]; 543 }); 544 }; 545 const lastOfPathSeparatorRegExp = /###/g; 546 const cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key; 547 const canNotTraverseDeeper = (object2) => !object2 || isString$4(object2); 548 const getLastOfPath = (object2, path, Empty) => { 549 const stack = !isString$4(path) ? path : path.split("."); 550 let stackIndex = 0; 551 while (stackIndex < stack.length - 1) { 552 if (canNotTraverseDeeper(object2)) return {}; 553 const key = cleanKey(stack[stackIndex]); 554 if (!object2[key] && Empty) object2[key] = new Empty(); 555 if (Object.prototype.hasOwnProperty.call(object2, key)) { 556 object2 = object2[key]; 557 } else { 558 object2 = {}; 559 } 560 ++stackIndex; 561 } 562 if (canNotTraverseDeeper(object2)) return {}; 563 return { 564 obj: object2, 565 k: cleanKey(stack[stackIndex]) 566 }; 567 }; 568 const setPath = (object2, path, newValue) => { 569 const { 570 obj, 571 k: k2 572 } = getLastOfPath(object2, path, Object); 573 if (obj !== void 0 || path.length === 1) { 574 obj[k2] = newValue; 575 return; 576 } 577 let e2 = path[path.length - 1]; 578 let p2 = path.slice(0, path.length - 1); 579 let last = getLastOfPath(object2, p2, Object); 580 while (last.obj === void 0 && p2.length) { 581 e2 = `${p2[p2.length - 1]}.${e2}`; 582 p2 = p2.slice(0, p2.length - 1); 583 last = getLastOfPath(object2, p2, Object); 584 if ((last == null ? void 0 : last.obj) && typeof last.obj[`${last.k}.${e2}`] !== "undefined") { 585 last.obj = void 0; 586 } 587 } 588 last.obj[`${last.k}.${e2}`] = newValue; 589 }; 590 const pushPath = (object2, path, newValue, concat) => { 591 const { 592 obj, 593 k: k2 594 } = getLastOfPath(object2, path, Object); 595 obj[k2] = obj[k2] || []; 596 obj[k2].push(newValue); 597 }; 598 const getPath = (object2, path) => { 599 const { 600 obj, 601 k: k2 602 } = getLastOfPath(object2, path); 603 if (!obj) return void 0; 604 if (!Object.prototype.hasOwnProperty.call(obj, k2)) return void 0; 605 return obj[k2]; 606 }; 607 const getPathWithDefaults = (data, defaultData, key) => { 608 const value = getPath(data, key); 609 if (value !== void 0) { 610 return value; 611 } 612 return getPath(defaultData, key); 613 }; 614 const deepExtend = (target, source, overwrite) => { 615 for (const prop in source) { 616 if (prop !== "__proto__" && prop !== "constructor") { 617 if (prop in target) { 618 if (isString$4(target[prop]) || target[prop] instanceof String || isString$4(source[prop]) || source[prop] instanceof String) { 619 if (overwrite) target[prop] = source[prop]; 620 } else { 621 deepExtend(target[prop], source[prop], overwrite); 622 } 623 } else { 624 target[prop] = source[prop]; 625 } 626 } 627 } 628 return target; 629 }; 630 const regexEscape = (str) => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 631 var _entityMap = { 632 "&": "&", 633 "<": "<", 634 ">": ">", 635 '"': """, 636 "'": "'", 637 "/": "/" 638 }; 639 const escape$1 = (data) => { 640 if (isString$4(data)) { 641 return data.replace(/[&<>
641"'\/]/g, (s2) => _entityMap[s2]); 642 } 643 return data; 644 }; 645 class RegExpCache { 646 constructor(capacity) { 647 this.capacity = capacity; 648 this.regExpMap = /* @__PURE__ */ new Map(); 649 this.regExpQueue = []; 650 } 651 getRegExp(pattern) { 652 const regExpFromCache = this.regExpMap.get(pattern); 653 if (regExpFromCache !== void 0) { 654 return regExpFromCache; 655 } 656 const regExpNew = new RegExp(pattern); 657 if (this.regExpQueue.length === this.capacity) { 658 this.regExpMap.delete(this.regExpQueue.shift()); 659 } 660 this.regExpMap.set(pattern, regExpNew); 661 this.regExpQueue.push(pattern); 662 return regExpNew; 663 } 664 } 665 const chars = [" ", ",", "?", "!", ";"]; 666 const looksLikeObjectPathRegExpCache = new RegExpCache(20); 667 const looksLikeObjectPath = (key, nsSeparator, keySeparator) => { 668 nsSeparator = nsSeparator || ""; 669 keySeparator = keySeparator || ""; 670 const possibleChars = chars.filter((c2) => nsSeparator.indexOf(c2) < 0 && keySeparator.indexOf(c2) < 0); 671 if (possibleChars.length === 0) return true; 672 const r2 = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c2) => c2 === "?" ? "\\?" : c2).join("|")})`); 673 let matched = !r2.test(key); 674 if (!matched) {
675 const ki2 = key.indexOf(keySeparator); 676 if (ki2 > 0 && !r2.test(key.substring(0, ki2))) { 677 matched = true; 678 } 679 } 680 return matched; 681 }; 682 const deepFind = (obj, path, keySeparator = ".") => { 683 if (!obj) return void 0; 684 if (obj[path]) { 685 if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0; 686 return obj[path]; 687 } 688 const tokens = path.split(keySeparator); 689 let current = obj; 690 for (let i2 = 0; i2 < tokens.length; ) { 691 if (!current || typeof current !== "object") { 692 return void 0; 693 } 694 let next2; 695 let nextPath = ""; 696 for (let j2 = i2; j2 < tokens.length; ++j2) { 697 if (j2 !== i2) { 698 nextPath += keySeparator; 699 } 700 nextPath += tokens[j2]; 701 next2 = current[nextPath]; 702 if (next2 !== void 0) { 703 if (["string", "number", "boolean"].indexOf(typeof next2) > -1 && j2 < tokens.length - 1) { 704 continue; 705 } 706 i2 += j2 - i2 + 1; 707 break; 708 } 709 } 710 current = next2; 711 } 712 return current; 713 }; 714 const getCleanedCode = (code) => code == null ? void 0 : code.replace("_", "-"); 715 const consoleLogger = { 716 type: "logger", 717 log(args) { 718 this.output("log", args); 719 }, 720 warn(args) { 721 this.output("warn", args); 722 }, 723 error(args) { 724 this.output("error", args); 725 }, 726 output(type, args) { 727 var _a, _b; 728 (_b = (_a = console == null ? void 0 : console[type]) == null ? void 0 : _a.apply) == null ? void 0 : _b.call(_a, console, args); 729 } 730 }; 731 class Logger { 732 constructor(concreteLogger, options2 = {}) { 733 this.init(concreteLogger, options2); 734 } 735 init(concreteLogger, options2 = {}) { 736 this.prefix = options2.prefix || "i18next:"; 737 this.logger = concreteLogger || consoleLogger; 738 this.options = options2; 739 this.debug = options2.debug; 740 } 741 log(...args) { 742 return this.forward(args, "log", "", true); 743 } 744 warn(...args) { 745 return this.forward(args, "warn", "", true); 746 } 747 error(...args) { 748 return this.forward(args, "error", ""); 749 } 750 deprecate(...args) { 751 return this.forward(args, "warn", "WARNING DEPRECATED: ", true); 752 } 753 forward(args, lvl, prefix2, debugOnly) { 754 if (debugOnly && !this.debug) return null; 755 if (isString$4(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`; 756 return this.logger[lvl](args); 757 } 758 create(moduleName) { 759 return new Logger(this.logger, __spreadValues(__spreadValues({}, { 760 prefix: `${this.prefix}:${moduleName}:` 761 }), this.options)); 762 } 763 clone(options2) { 764 options2 = options2 || this.options; 765 options2.prefix = options2.prefix || this.prefix; 766 return new Logger(this.logger, options2); 767 } 768 } 769 var baseLogger = new Logger(); 770 class EventEmitter { 771 constructor() { 772 this.observers = {}; 773 } 774 on(events, listener) { 775 events.split(" ").forEach((event) => { 776 if (!this.observers[event]) this.observers[event] = /* @__PURE__ */ new Map(); 777 const numListeners = this.observers[event].get(listener) || 0; 778 this.observers[event].set(listener, numListeners + 1); 779 }); 780 return this; 781 } 782 off(event, listener) { 783 if (!this.observers[event]) return; 784 if (!listener) { 785 delete this.observers[event]; 786 return; 787 } 788 this.observers[event].delete(listener); 789 } 790 emit(event, ...args) { 791 if (this.observers[event]) { 792 const cloned = Array.from(this.observers[event].entries()); 793 cloned.forEach(([observer, numTimesAdded]) => { 794 for (let i2 = 0; i2 < numTimesAdded; i2++) { 795 observer(...args); 796 } 797 }); 798 } 799 if (this.observers["*"]) { 800 const cloned = Array.from(this.observers["*"].entries()); 801 cloned.forEach(([observer, numTimesAdded]) => { 802 for (let i2 = 0; i2 < numTimesAdded; i2++) { 803 observer.apply(observer, [event, ...args]); 804 } 805 }); 806 } 807 } 808 }
vendor: 4,673 bytes, lines 809-941
809 class ResourceStore extends EventEmitter { 810 constructor(data, options2 = { 811 ns: ["translation"], 812 defaultNS: "translation" 813 }) { 814 super(); 815 this.data = data || {}; 816 this.options = options2; 817 if (this.options.keySeparator === void 0) { 818 this.options.keySeparator = "."; 819 } 820 if (this.options.ignoreJSONStructure === void 0) { 821 this.options.ignoreJSONStructure = true; 822 } 823 } 824 addNamespaces(ns) { 825 if (this.options.ns.indexOf(ns) < 0) { 826 this.options.ns.push(ns); 827 } 828 } 829 removeNamespaces(ns) { 830 const index2 = this.options.ns.indexOf(ns); 831 if (index2 > -1) { 832 this.options.ns.splice(index2, 1); 833 } 834 } 835 getResource(lng, ns, key, options2 = {}) { 836 var _a, _b; 837 const keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator; 838 const ignoreJSONStructure = options2.ignoreJSONStructure !== void 0 ? options2.ignoreJSONStructure : this.options.ignoreJSONStructure; 839 let path; 840 if (lng.indexOf(".") > -1) { 841 path = lng.split("."); 842 } else { 843 path = [lng, ns]; 844 if (key) { 845 if (Array.isArray(key)) { 846 path.push(...key); 847 } else if (isString$4(key) && keySeparator) { 848 path.push(...key.split(keySeparator)); 849 } else { 850 path.push(key); 851 } 852 } 853 } 854 const result = getPath(this.data, path); 855 if (!result && !ns && !key && lng.indexOf(".") > -1) { 856 lng = path[0]; 857 ns = path[1]; 858 key = path.slice(2).join("."); 859 } 860 if (result || !ignoreJSONStructure || !isString$4(key)) return result; 861 return deepFind((_b = (_a = this.data) == null ? void 0 : _a[lng]) == null ? void 0 : _b[ns], key, keySeparator); 862 } 863 addResource(lng, ns, key, value, options2 = { 864 silent: false 865 }) { 866 const keySeparator = options2.keySeparator !== void 0 ? options2.keySeparator : this.options.keySeparator; 867 let path = [lng, ns]; 868 if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key); 869 if (lng.indexOf(".") > -1) { 870 path = lng.split("."); 871 value = ns; 872 ns = path[1]; 873 } 874 this.addNamespaces(ns); 875 setPath(this.data, path, value); 876 if (!options2.silent) this.emit("added", lng, ns, key, value); 877 } 878 addResources(lng, ns, resources, options2 = { 879 silent: false 880 }) { 881 for (const m2 in resources) { 882 if (isString$4(resources[m2]) || Array.isArray(resources[m2])) this.addResource(lng, ns, m2, resources[m2], { 883 silent: true 884 }); 885 } 886 if (!options2.silent) this.emit("added", lng, ns, resources); 887 } 888 addResourceBundle(lng, ns, resources, deep, overwrite, options2 = { 889 silent: false, 890 skipCopy: false 891 }) { 892 let path = [lng, ns]; 893 if (lng.indexOf(".") > -1) { 894 path = lng.split("."); 895 deep = resources; 896 resources = ns; 897 ns = path[1]; 898 } 899 this.addNamespaces(ns); 900 let pack = getPath(this.data, path) || {}; 901 if (!options2.skipCopy) resources = JSON.parse(JSON.stringify(resources)); 902 if (deep) { 903 deepExtend(pack, resources, overwrite); 904 } else { 905 pack = __spreadValues(__spreadValues({}, pack), resources); 906 } 907 setPath(this.data, path, pack); 908 if (!options2.silent) this.emit("added", lng, ns, resources); 909 } 910 removeResourceBundle(lng, ns) { 911 if (this.hasResourceBundle(lng, ns)) { 912 delete this.data[lng][ns]; 913 } 914 this.removeNamespaces(ns); 915 this.emit("removed", lng, ns); 916 } 917 hasResourceBundle(lng, ns) { 918 return this.getResource(lng, ns) !== void 0; 919 } 920 getResourceBundle(lng, ns) { 921 if (!ns) ns = this.options.defaultNS; 922 return this.getResource(lng, ns); 923 } 924 getDataByLanguage(lng) { 925 return this.data[lng]; 926 } 927 hasLanguageSomeTranslations(lng) { 928 const data = this.getDataByLanguage(lng); 929 const n2 = data && Object.keys(data) || []; 930 return !!n2.find((v2) => data[v2] && Object.keys(data[v2]).length > 0); 931 } 932 toJSON() { 933 return this.data; 934 } 935 } 936 var postProcessor = { 937 processors: {}, 938 addPostProcessor(module2) { 939 this.processors[module2.name] = module2; 940 }, 941 handle(processors, value, key, options2, translator) {
942 processors.forEach((processor) => { 943 var _a, _b; 944 value = (_b = (_a = this.processors[processor]) == null ? void 0 : _a.process(value, key, options2, translator)) != null ? _b : value; 945 }); 946 return value; 947 } 948 }; 949 const PATH_KEY = Symbol("i18next/PATH_KEY"); 950 function createProxy() { 951 const state = []; 952 const handler = /* @__PURE__ */ Object.create(null); 953 let proxy; 954 handler.get = (target, key) => { 955 var _a; 956 (_a = proxy == null ? void 0 : proxy.revoke) == null ? void 0 : _a.call(proxy); 957 if (key === PATH_KEY) return state; 958 state.push(key); 959 proxy = Proxy.revocable(target, handler); 960 return proxy.proxy; 961 }; 962 return Proxy.revocable(/* @__PURE__ */ Object.create(null), handler).proxy; 963 } 964 function keysFromSelector(selector, opts) { 965 var _a; 966 const { 967 [PATH_KEY]: path 968 } = selector(createProxy()); 969 return path.join((_a = opts == null ? void 0 : opts.keySeparator) != null ? _a : "."); 970 } 971 const checkedLoadedFor = {}; 972 const shouldHandleAsObject = (res) => !isString$4(res) && typeof res !== "boolean" && typeof res !== "number"; 973 class Translator extends EventEmitter { 974 constructor(services, options2 = {}) { 975 super(); 976 copy$1(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], services, this); 977 this.options = options2; 978 if (this.options.keySeparator === void 0) { 979 this.options.keySeparator = "."; 980 } 981 this.logger = baseLogger.create("translator"); 982 } 983 changeLanguage(lng) { 984 if (lng) this.language = lng; 985 } 986 exists(key, o2 = { 987 interpolation: {} 988 }) { 989 const opt = __spreadValues({}, o2); 990 if (key == null) return false; 991 const resolved = this.resolve(key, opt); 992 if ((resolved == null ? void 0 : resolved.res) === void 0) return false; 993 const isObject2 = shouldHandleAsObject(resolved.res); 994 if (opt.returnObjects === false && isObject2) { 995 return false; 996 } 997 return true; 998 } 999 extractFromKey(key, opt) { 1000 let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator; 1001 if (nsSeparator === void 0) nsSeparator = ":"; 1002 const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator; 1003 let namespaces = opt.ns || this.options.defaultNS || []; 1004 const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1; 1005 const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator); 1006 if (wouldCheckForNsInKey && !seemsNaturalLanguage) { 1007 const m2 = key.match(this.interpolator.nestingRegexp); 1008 if (m2 && m2.length > 0) { 1009 return { 1010 key, 1011 namespaces: isString$4(namespaces) ? [namespaces] : namespaces 1012 }; 1013 } 1014 const parts = key.split(nsSeparator); 1015 if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); 1016 key = parts.join(keySeparator); 1017 } 1018 return { 1019 key, 1020 namespaces: isString$4(namespaces) ? [namespaces] : namespaces 1021 }; 1022 } 1023 translate(keys2, o2, lastKey) { 1024 let opt = typeof o2 === "object" ? __spreadValues({}, o2) : o2; 1025 if (typeof opt !== "object" && this.options.overloadTranslationOptionHandler) { 1026 opt = this.options.overloadTranslationOptionHandler(arguments); 1027 } 1028 if (typeof opt === "object") opt = __spreadValues({}, opt); 1029 if (!opt) opt = {}; 1030 if (keys2 == null) return ""; 1031 if (typeof keys2 === "function") keys2 = keysFromSelector(keys2, __spreadValues(__spreadValues({}, this.options), opt)); 1032 if (!Array.isArray(keys2)) keys2 = [String(keys2)]; 1033 const returnDetails = opt.returnDetails !== void 0 ? opt.returnDetails : this.options.returnDetails;
1034 const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator; 1035 const { 1036 key, 1037 namespaces 1038 } = this.extractFromKey(keys2[keys2.length - 1], opt); 1039 const namespace = namespaces[namespaces.length - 1]; 1040 let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator; 1041 if (nsSeparator === void 0) nsSeparator = ":"; 1042 const lng = opt.lng || this.language; 1043 const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; 1044 if ((lng == null ? void 0 : lng.toLowerCase()) === "cimode") { 1045 if (appendNamespaceToCIMode) { 1046 if (returnDetails) { 1047 return { 1048 res: `${namespace}${nsSeparator}${key}`, 1049 usedKey: key, 1050 exactUsedKey: key, 1051 usedLng: lng, 1052 usedNS: namespace, 1053 usedParams: this.getUsedParamsDetails(opt) 1054 }; 1055 } 1056 return `${namespace}${nsSeparator}${key}`; 1057 } 1058 if (returnDetails) { 1059 return { 1060 res: key, 1061 usedKey: key, 1062 exactUsedKey: key, 1063 usedLng: lng, 1064 usedNS: namespace, 1065 usedParams: this.getUsedParamsDetails(opt) 1066 }; 1067 } 1068 return key; 1069 } 1070 const resolved = this.resolve(keys2, opt); 1071 let res = resolved == null ? void 0 : resolved.res; 1072 const resUsedKey = (resolved == null ? void 0 : resolved.usedKey) || key; 1073 const resExactUsedKey = (resolved == null ? void 0 : resolved.exactUsedKey) || key; 1074 const noObject = ["[object Number]", "[object Function]", "[object RegExp]"]; 1075 const joinArrays = opt.joinArrays !== void 0 ? opt.joinArrays : this.options.joinArrays; 1076 const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; 1077 const needsPluralHandling = opt.count !== void 0 && !isString$4(opt.count); 1078 const hasDefaultValue = Translator.hasDefaultValue(opt); 1079 const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : ""; 1080 const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, { 1081 ordinal: false 1082 }) : ""; 1083 const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; 1084 const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue; 1085 let resForObjHndl = res; 1086 if (handleAsObjectInI18nFormat && !res && hasDefaultValue) { 1087 resForObjHndl = defaultValue; 1088 } 1089 const handleAsObject = shouldHandleAsObject(resForObjHndl); 1090 const resType = Object.prototype.toString.apply(resForObjHndl); 1091 if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString$4(joinArrays) && Array.isArray(resForObjHndl))) { 1092 if (!opt.returnObjects && !this.options.returnObjects) { 1093 if (!this.options.returnedObjectHandler) { 1094 this.logger.warn("accessing an object - but returnObjects options is not enabled!"); 1095 } 1096 const r2 = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, __spreadProps(__spreadValues({}, opt), { 1097 ns: namespaces 1098 })) : `key '${key} (${this.language})' returned an object instead of string.`; 1099 if (returnDetails) { 1100 resolved.res = r2; 1101 resolved.usedParams = this.getUsedParamsDetails(opt); 1102 return resolved; 1103 } 1104 return r2; 1105 } 1106 if (keySeparator) { 1107 const resTypeIsArray = Array.isArray(resForObjHndl); 1108 const copy2 = resTypeIsArray ? [] : {}; 1109 const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; 1110 for (const m2 in resForObjHndl) { 1111 if (Object.prototype.hasOwnProperty.call(resForObjHndl, m2)) { 1112 const deepKey = `${newKeyToUse}${keySeparator}${m2}`; 1113 if (hasDefaultValue && !res) { 1114 copy2[m2] = this.translate(deepKey, __spreadValues(__spreadProps(__spreadValues({}, opt), { 1115 defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m2] : void 0 1116 }), {
1117 joinArrays: false, 1118 ns: namespaces 1119 })); 1120 } else { 1121 copy2[m2] = this.translate(deepKey, __spreadValues(__spreadValues({}, opt), { 1122 joinArrays: false, 1123 ns: namespaces 1124 })); 1125 } 1126 if (copy2[m2] === deepKey) copy2[m2] = resForObjHndl[m2]; 1127 } 1128 } 1129 res = copy2; 1130 } 1131 } else if (handleAsObjectInI18nFormat && isString$4(joinArrays) && Array.isArray(res)) { 1132 res = res.join(joinArrays); 1133 if (res) res = this.extendTranslation(res, keys2, opt, lastKey); 1134 } else { 1135 let usedDefault = false; 1136 let usedKey = false; 1137 if (!this.isValidLookup(res) && hasDefaultValue) { 1138 usedDefault = true; 1139 res = defaultValue; 1140 } 1141 if (!this.isValidLookup(res)) { 1142 usedKey = true; 1143 res = key; 1144 } 1145 const missingKeyNoValueFallbackToKey = opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey; 1146 const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? void 0 : res; 1147 const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing; 1148 if (usedKey || usedDefault || updateMissing) { 1149 this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key, updateMissing ? defaultValue : res); 1150 if (keySeparator) { 1151 const fk = this.resolve(key, __spreadProps(__spreadValues({}, opt), { 1152 keySeparator: false 1153 })); 1154 if (fk && fk.res) this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."); 1155 } 1156 let lngs = []; 1157 const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language); 1158 if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) { 1159 for (let i2 = 0; i2 < fallbackLngs.length; i2++) { 1160 lngs.push(fallbackLngs[i2]); 1161 } 1162 } else if (this.options.saveMissingTo === "all") { 1163 lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language); 1164 } else { 1165 lngs.push(opt.lng || this.language); 1166 } 1167 const send = (l2, k2, specificDefaultValue) => { 1168 var _a; 1169 const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing; 1170 if (this.options.missingKeyHandler) { 1171 this.options.missingKeyHandler(l2, namespace, k2, defaultForMissing, updateMissing, opt); 1172 } else if ((_a = this.backendConnector) == null ? void 0 : _a.saveMissing) { 1173 this.backendConnector.saveMissing(l2, namespace, k2, defaultForMissing, updateMissing, opt); 1174 } 1175 this.emit("missingKey", l2, namespace, k2, res); 1176 }; 1177 if (this.options.saveMissing) { 1178 if (this.options.saveMissingPlurals && needsPluralHandling) { 1179 lngs.forEach((language) => { 1180 const suffixes = this.pluralResolver.getSuffixes(language, opt); 1181 if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) { 1182 suffixes.push(`${this.options.pluralSeparator}zero`); 1183 } 1184 suffixes.forEach((suffix) => { 1185 send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue); 1186 }); 1187 }); 1188 } else { 1189 send(lngs, key, defaultValue); 1190 } 1191 } 1192 } 1193 res = this.extendTranslation(res, keys2, opt, resolved, lastKey); 1194 if (usedKey && res === key && this.options.appendNamespaceToMissingKey) { 1195 res = `${namespace}${nsSeparator}${key}`; 1196 } 1197 if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) { 1198 res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : void 0, opt); 1199 } 1200 } 1201 if (returnDetails) { 1202 resolved.res = res; 1203 resolved.usedParams = this.getUsedParamsDetails(opt); 1204 return resolved; 1205 } 1206 return res; 1207 } 1208 extendTranslation(res, key, opt, resolved, lastKey) { 1209 var _a, _b; 1210 if ((_a = this.i18nFormat) == null ? void 0 : _a.parse) { 1211 res = this.i18nFormat.parse(res, __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), opt), opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, { 1212 resolved 1213 }); 1214 } else if (!opt.skipInterpolation) { 1215 if (opt.interpolation) this.interpolator.init(__spreadValues(__spreadValues({}, opt), { 1216 interpolation: __spreadValues(__spreadValues({}, this.options.interpolation), opt.interpolation) 1217 })); 1218 const skipOnVariables = isString$4(res) && (((_b = opt == null ? void 0 : opt.interpolation) == null ? void 0 : _b.skipOnVariables) !== void 0 ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); 1219 let nestBef; 1220 if (skipOnVariables) { 1221 const nb = res.match(this.interpolator.nestingRegexp); 1222 nestBef = nb && nb.length; 1223 } 1224 let data = opt.replace && !isString$4(opt.replace) ? opt.replace : opt; 1225 if (this.options.interpolation.defaultVariables) data = __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), data); 1226 res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt); 1227 if (skipOnVariables) { 1228 const na2 = res.match(this.interpolator.nestingRegexp); 1229 const nestAft = na2 && na2.length; 1230 if (nestBef < nestAft) opt.nest = false;
1231 } 1232 if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng; 1233 if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => { 1234 if ((lastKey == null ? void 0 : lastKey[0]) === args[0] && !opt.context) { 1235 this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`); 1236 return null; 1237 } 1238 return this.translate(...args, key); 1239 }, opt); 1240 if (opt.interpolation) this.interpolator.reset(); 1241 } 1242 const postProcess = opt.postProcess || this.options.postProcess; 1243 const postProcessorNames = isString$4(postProcess) ? [postProcess] : postProcess; 1244 if (res != null && (postProcessorNames == null ? void 0 : postProcessorNames.length) && opt.applyPostProcessor !== false) { 1245 res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? __spreadValues({ 1246 i18nResolved: __spreadProps(__spreadValues({}, resolved), { 1247 usedParams: this.getUsedParamsDetails(opt) 1248 }) 1249 }, opt) : opt, this); 1250 } 1251 return res; 1252 } 1253 resolve(keys2, opt = {}) { 1254 let found; 1255 let usedKey; 1256 let exactUsedKey; 1257 let usedLng; 1258 let usedNS; 1259 if (isString$4(keys2)) keys2 = [keys2]; 1260 keys2.forEach((k2) => { 1261 if (this.isValidLookup(found)) return; 1262 const extracted = this.extractFromKey(k2, opt); 1263 const key = extracted.key; 1264 usedKey = key; 1265 let namespaces = extracted.namespaces; 1266 if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS); 1267 const needsPluralHandling = opt.count !== void 0 && !isString$4(opt.count); 1268 const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0; 1269 const needsContextHandling = opt.context !== void 0 && (isString$4(opt.context) || typeof opt.context === "number") && opt.context !== ""; 1270 const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng); 1271 namespaces.forEach((ns) => { 1272 var _a, _b; 1273 if (this.isValidLookup(found)) return; 1274 usedNS = ns; 1275 if (!checkedLoadedFor[`${codes[0]}-${ns}`] && ((_a = this.utils) == null ? void 0 : _a.hasLoadedNamespace) && !((_b = this.utils) == null ? void 0 : _b.hasLoadedNamespace(usedNS))) { 1276 checkedLoadedFor[`${codes[0]}-${ns}`] = true; 1277 this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 1278 } 1279 codes.forEach((code) => { 1280 var _a2; 1281 if (this.isValidLookup(found)) return; 1282 usedLng = code; 1283 const finalKeys = [key]; 1284 if ((_a2 = this.i18nFormat) == null ? void 0 : _a2.addLookupKeys) { 1285 this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt); 1286 } else { 1287 let pluralSuffix; 1288 if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt); 1289 const zeroSuffix = `${this.options.pluralSeparator}zero`; 1290 const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`; 1291 if (needsPluralHandling) { 1292 if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) { 1293 finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); 1294 } 1295 finalKeys.push(key + pluralSuffix); 1296 if (needsZeroSuffixLookup) { 1297 finalKeys.push(key + zeroSuffix); 1298 } 1299 } 1300 if (needsContextHandling) { 1301 const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`; 1302 finalKeys.push(contextKey); 1303 if (needsPluralHandling) { 1304 if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) { 1305 finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator)); 1306 } 1307 finalKeys.push(contextKey + pluralSuffix); 1308 if (needsZeroSuffixLookup) { 1309 finalKeys.push(contextKey + zeroSuffix); 1310 } 1311 } 1312 } 1313 } 1314 let possibleKey; 1315 while (possibleKey = finalKeys.pop()) { 1316 if (!this.isValidLookup(found)) { 1317 exactUsedKey = possibleKey; 1318 found = this.getResource(code, ns, possibleKey, opt); 1319 } 1320 } 1321 }); 1322 }); 1323 }); 1324 return { 1325 res: found, 1326 usedKey, 1327 exactUsedKey, 1328 usedLng, 1329 usedNS 1330 }; 1331 } 1332 isValidLookup(res) { 1333 return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ""); 1334 } 1335 getResource(code, ns, key, options2 = {}) { 1336 var _a; 1337 if ((_a = this.i18nFormat) == null ? void 0 : _a.getResource) return this.i18nFormat.getResource(code, ns, key, options2); 1338 return this.resourceStore.getResource(code, ns, key, options2); 1339 } 1340 getUsedParamsDetails(options2 = {}) { 1341 const optionsKeys = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"]; 1342 const useOptionsReplaceForData = options2.replace && !isString$4(options2.replace); 1343 let data = useOptionsReplaceForData ? options2.replace : options2; 1344 if (useOptionsReplaceForData && typeof options2.count !== "undefined") { 1345 data.count = options2.count; 1346 } 1347 if (this.options.interpolation.defaultVariables) { 1348 data = __spreadValues(__spreadValues({}, this.options.interpolation.defaultVariables), data); 1349 } 1350 if (!useOptionsReplaceForData) { 1351 data = __spreadValues({}, data); 1352 for (const key of optionsKeys) { 1353 delete data[key]; 1354 } 1355 } 1356 return data; 1357 } 1358 static hasDefaultValue(options2) { 1359 const prefix2 = "defaultValue"; 1360 for (const option in options2) { 1361 if (Object.prototype.hasOwnProperty.call(options2, option) && prefix2 === option.substring(0, prefix2.length) && void 0 !== options2[option]) { 1362 return true; 1363 } 1364 } 1365 return false;
vendor: 4,750 bytes, lines 1366-1469
1366 } 1367 } 1368 class LanguageUtil { 1369 constructor(options2) { 1370 this.options = options2; 1371 this.supportedLngs = this.options.supportedLngs || false; 1372 this.logger = baseLogger.create("languageUtils"); 1373 } 1374 getScriptPartFromCode(code) { 1375 code = getCleanedCode(code); 1376 if (!code || code.indexOf("-") < 0) return null; 1377 const p2 = code.split("-"); 1378 if (p2.length === 2) return null; 1379 p2.pop(); 1380 if (p2[p2.length - 1].toLowerCase() === "x") return null; 1381 return this.formatLanguageCode(p2.join("-")); 1382 } 1383 getLanguagePartFromCode(code) { 1384 code = getCleanedCode(code); 1385 if (!code || code.indexOf("-") < 0) return code; 1386 const p2 = code.split("-"); 1387 return this.formatLanguageCode(p2[0]); 1388 } 1389 formatLanguageCode(code) { 1390 if (isString$4(code) && code.indexOf("-") > -1) { 1391 let formattedCode; 1392 try { 1393 formattedCode = Intl.getCanonicalLocales(code)[0]; 1394 } catch (e2) { 1395 } 1396 if (formattedCode && this.options.lowerCaseLng) { 1397 formattedCode = formattedCode.toLowerCase(); 1398 } 1399 if (formattedCode) return formattedCode; 1400 if (this.options.lowerCaseLng) { 1401 return code.toLowerCase(); 1402 } 1403 return code; 1404 } 1405 return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; 1406 } 1407 isSupportedCode(code) { 1408 if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) { 1409 code = this.getLanguagePartFromCode(code); 1410 } 1411 return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1; 1412 } 1413 getBestMatchFromCodes(codes) { 1414 if (!codes) return null; 1415 let found; 1416 codes.forEach((code) => { 1417 if (found) return; 1418 const cleanedLng = this.formatLanguageCode(code); 1419 if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng; 1420 }); 1421 if (!found && this.options.supportedLngs) { 1422 codes.forEach((code) => { 1423 if (found) return; 1424 const lngScOnly = this.getScriptPartFromCode(code); 1425 if (this.isSupportedCode(lngScOnly)) return found = lngScOnly; 1426 const lngOnly = this.getLanguagePartFromCode(code); 1427 if (this.isSupportedCode(lngOnly)) return found = lngOnly; 1428 found = this.options.supportedLngs.find((supportedLng) => { 1429 if (supportedLng === lngOnly) return supportedLng; 1430 if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0) return; 1431 if (supportedLng.indexOf("-") > 0 && lngOnly.indexOf("-") < 0 && supportedLng.substring(0, supportedLng.indexOf("-")) === lngOnly) return supportedLng; 1432 if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng; 1433 }); 1434 }); 1435 } 1436 if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0]; 1437 return found; 1438 } 1439 getFallbackCodes(fallbacks, code) { 1440 if (!fallbacks) return []; 1441 if (typeof fallbacks === "function") fallbacks = fallbacks(code); 1442 if (isString$4(fallbacks)) fallbacks = [fallbacks]; 1443 if (Array.isArray(fallbacks)) return fallbacks; 1444 if (!code) return fallbacks.default || []; 1445 let found = fallbacks[code]; 1446 if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; 1447 if (!found) found = fallbacks[this.formatLanguageCode(code)]; 1448 if (!found) found = fallbacks[this.getLanguagePartFromCode(code)]; 1449 if (!found) found = fallbacks.default; 1450 return found || []; 1451 } 1452 toResolveHierarchy(code, fallbackCode) { 1453 const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code); 1454 const codes = []; 1455 const addCode = (c2) => { 1456 if (!c2) return; 1457 if (this.isSupportedCode(c2)) { 1458 codes.push(c2); 1459 } else { 1460 this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`); 1461 } 1462 }; 1463 if (isString$4(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) { 1464 if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code)); 1465 if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code)); 1466 if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code)); 1467 } else if (isString$4(code)) { 1468 addCode(this.formatLanguageCode(code)); 1469 }
1470 fallbackCodes.forEach((fc) => { 1471 if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc)); 1472 }); 1473 return codes; 1474 } 1475 } 1476 const suffixesOrder = { 1477 zero: 0, 1478 one: 1, 1479 two: 2, 1480 few: 3, 1481 many: 4, 1482 other: 5 1483 }; 1484 const dummyRule = { 1485 select: (count2) => count2 === 1 ? "one" : "other", 1486 resolvedOptions: () => ({ 1487 pluralCategories: ["one", "other"] 1488 }) 1489 }; 1490 class PluralResolver { 1491 constructor(languageUtils, options2 = {}) { 1492 this.languageUtils = languageUtils; 1493 this.options = options2; 1494 this.logger = baseLogger.create("pluralResolver"); 1495 this.pluralRulesCache = {}; 1496 } 1497 addRule(lng, obj) { 1498 this.rules[lng] = obj; 1499 } 1500 clearCache() { 1501 this.pluralRulesCache = {}; 1502 } 1503 getRule(code, options2 = {}) { 1504 const cleanedCode = getCleanedCode(code === "dev" ? "en" : code); 1505 const type = options2.ordinal ? "ordinal" : "cardinal"; 1506 const cacheKey = JSON.stringify({ 1507 cleanedCode, 1508 type 1509 }); 1510 if (cacheKey in this.pluralRulesCache) { 1511 return this.pluralRulesCache[cacheKey]; 1512 } 1513 let rule; 1514 try { 1515 rule = new Intl.PluralRules(cleanedCode, { 1516 type 1517 }); 1518 } catch (err) { 1519 if (!Intl) { 1520 this.logger.error("No Intl support, please use an Intl polyfill!"); 1521 return dummyRule; 1522 } 1523 if (!code.match(/-|_/)) return dummyRule; 1524 const lngPart = this.languageUtils.getLanguagePartFromCode(code); 1525 rule = this.getRule(lngPart, options2); 1526 } 1527 this.pluralRulesCache[cacheKey] = rule; 1528 return rule; 1529 } 1530 needsPlural(code, options2 = {}) { 1531 let rule = this.getRule(code, options2); 1532 if (!rule) rule = this.getRule("dev", options2); 1533 return (rule == null ? void 0 : rule.resolvedOptions().pluralCategories.length) > 1; 1534 } 1535 getPluralFormsOfKey(code, key, options2 = {}) { 1536 return this.getSuffixes(code, options2).map((suffix) => `${key}${suffix}`); 1537 } 1538 getSuffixes(code, options2 = {}) { 1539 let rule = this.getRule(code, options2); 1540 if (!rule) rule = this.getRule("dev", options2); 1541 if (!rule) return []; 1542 return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options2.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`); 1543 } 1544 getSuffix(code, count2, options2 = {}) { 1545 const rule = this.getRule(code, options2); 1546 if (rule) { 1547 return `${this.options.prepend}${options2.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count2)}`; 1548 } 1549 this.logger.warn(`no plural rule found for: ${code}`); 1550 return this.getSuffix("dev", count2, options2); 1551 } 1552 } 1553 const deepFindWithDefaults = (data, defaultData, key, keySeparator = ".", ignoreJSONStructure = true) => { 1554 let path = getPathWithDefaults(data, defaultData, key); 1555 if (!path && ignoreJSONStructure && isString$4(key)) {
1556 path = deepFind(data, key, keySeparator); 1557 if (path === void 0) path = deepFind(defaultData, key, keySeparator); 1558 } 1559 return path; 1560 }; 1561 const regexSafe = (val) => val.replace(/\$/g, "$$$$"); 1562 class Interpolator { 1563 constructor(options2 = {}) { 1564 var _a; 1565 this.logger = baseLogger.create("interpolator"); 1566 this.options = options2; 1567 this.format = ((_a = options2 == null ? void 0 : options2.interpolation) == null ? void 0 : _a.format) || ((value) => value); 1568 this.init(options2); 1569 } 1570 init(options2 = {}) { 1571 if (!options2.interpolation) options2.interpolation = { 1572 escapeValue: true 1573 }; 1574 const { 1575 escape: escape$1$1, 1576 escapeValue, 1577 useRawValueToEscape, 1578 prefix: prefix2, 1579 prefixEscaped, 1580 suffix, 1581 suffixEscaped, 1582 formatSeparator, 1583 unescapeSuffix, 1584 unescapePrefix, 1585 nestingPrefix, 1586 nestingPrefixEscaped, 1587 nestingSuffix, 1588 nestingSuffixEscaped, 1589 nestingOptionsSeparator, 1590 maxReplaces, 1591 alwaysFormat 1592 } = options2.interpolation; 1593 this.escape = escape$1$1 !== void 0 ? escape$1$1 : escape$1; 1594 this.escapeValue = escapeValue !== void 0 ? escapeValue : true; 1595 this.useRawValueToEscape = useRawValueToEscape !== void 0 ? useRawValueToEscape : false;
1596 this.prefix = prefix2 ? regexEscape(prefix2) : prefixEscaped || "{{"; 1597 this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || "}}"; 1598 this.formatSeparator = formatSeparator || ","; 1599 this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix || "-"; 1600 this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix || ""; 1601 this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape("$t("); 1602 this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(")"); 1603 this.nestingOptionsSeparator = nestingOptionsSeparator || ","; 1604 this.maxReplaces = maxReplaces || 1e3; 1605 this.alwaysFormat = alwaysFormat !== void 0 ? alwaysFormat : false; 1606 this.resetRegExp(); 1607 } 1608 reset() { 1609 if (this.options) this.init(this.options); 1610 } 1611 resetRegExp() { 1612 const getOrResetRegExp = (existingRegExp, pattern) => { 1613 if ((existingRegExp == null ? void 0 : existingRegExp.source) === pattern) { 1614 existingRegExp.lastIndex = 0; 1615 return existingRegExp; 1616 } 1617 return new RegExp(pattern, "g"); 1618 }; 1619 this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`); 1620 this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`); 1621 this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`); 1622 } 1623 interpolate(str, data, lng, options2) { 1624 var _a; 1625 let match2; 1626 let value; 1627 let replaces; 1628 const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}; 1629 const handleFormat = (key) => { 1630 if (key.indexOf(this.formatSeparator) < 0) { 1631 const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure); 1632 return this.alwaysFormat ? this.format(path, void 0, lng, __spreadProps(__spreadValues(__spreadValues({}, options2), data), { 1633 interpolationkey: key 1634 })) : path; 1635 } 1636 const p2 = key.split(this.formatSeparator); 1637 const k2 = p2.shift().trim(); 1638 const f2 = p2.join(this.formatSeparator).trim(); 1639 return this.format(deepFindWithDefaults(data, defaultData, k2, this.options.keySeparator, this.options.ignoreJSONStructure), f2, lng, __spreadProps(__spreadValues(__spreadValues({}, options2), data), { 1640 interpolationkey: k2 1641 })); 1642 }; 1643 this.resetRegExp(); 1644 const missingInterpolationHandler = (options2 == null ? void 0 : options2.missingInterpolationHandler) || this.options.missingInterpolationHandler; 1645 const skipOnVariables = ((_a = options2 == null ? void 0 : options2.interpolation) == null ? void 0 : _a.skipOnVariables) !== void 0 ? options2.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; 1646 const todos = [{ 1647 regex: this.regexpUnescape, 1648 safeValue: (val) => regexSafe(val) 1649 }, { 1650 regex: this.regexp, 1651 safeValue: (val) => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val) 1652 }]; 1653 todos.forEach((todo) => { 1654 replaces = 0; 1655 while (match2 = todo.regex.exec(str)) { 1656 const matchedVar = match2[1].trim(); 1657 value = handleFormat(matchedVar); 1658 if (value === void 0) { 1659 if (typeof missingInterpolationHandler === "function") { 1660 const temp = missingInterpolationHandler(str, match2, options2); 1661 value = isString$4(temp) ? temp : ""; 1662 } else if (options2 && Object.prototype.hasOwnProperty.call(options2, matchedVar)) { 1663 value = ""; 1664 } else if (skipOnVariables) { 1665 value = match2[0]; 1666 continue; 1667 } else { 1668 this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`); 1669 value = ""; 1670 } 1671 } else if (!isString$4(value) && !this.useRawValueToEscape) { 1672 value = makeString(value); 1673 } 1674 const safeValue = todo.safeValue(value); 1675 str = str.replace(match2[0], safeValue); 1676 if (skipOnVariables) { 1677 todo.regex.lastIndex += value.length; 1678 todo.regex.lastIndex -= match2[0].length; 1679 } else { 1680 todo.regex.lastIndex = 0; 1681 } 1682 replaces++; 1683 if (replaces >= this.maxReplaces) { 1684 break; 1685 } 1686 } 1687 }); 1688 return str; 1689 } 1690 nest(str, fc, options2 = {}) { 1691 let match2; 1692 let value; 1693 let clonedOptions; 1694 const handleHasOptions = (key, inheritedOptions) => { 1695 var _a; 1696 const sep = this.nestingOptionsSeparator; 1697 if (key.indexOf(sep) < 0) return key; 1698 const c2 = key.split(new RegExp(`${sep}[ ]*{`)); 1699 let optionsString = `{${c2[1]}`; 1700 key = c2[0]; 1701 optionsString = this.interpolate(optionsString, clonedOptions); 1702 const matchedSingleQuotes = optionsString.match(/'/g); 1703 const matchedDoubleQuotes = optionsString.match(/"/g); 1704 if (((_a = matchedSingleQuotes == null ? void 0 : matchedSingleQuotes.length) != null ? _a : 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) { 1705 optionsString = optionsString.replace(/'/g, '"'); 1706 } 1707 try { 1708 clonedOptions = JSON.parse(optionsString); 1709 if (inheritedOptions) clonedOptions = __spreadValues(__spreadValues({}, inheritedOptions), clonedOptions); 1710 } catch (e2) { 1711 this.logger.warn(`failed parsing options string in nesting for key ${key}`, e2); 1712 return `${key}${sep}${optionsString}`; 1713 } 1714 if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue; 1715 return key; 1716 }; 1717 while (match2 = this.nestingRegexp.exec(str)) { 1718 let formatters = []; 1719 clonedOptions = __spreadValues({}, options2); 1720 clonedOptions = clonedOptions.replace && !isString$4(clonedOptions.replace) ? clonedOptions.replace : clonedOptions; 1721 clonedOptions.applyPostProcessor = false;
1722 delete clonedOptions.defaultValue; 1723 const keyEndIndex = /{.*}/.test(match2[1]) ? match2[1].lastIndexOf("}") + 1 : match2[1].indexOf(this.formatSeparator); 1724 if (keyEndIndex !== -1) { 1725 formatters = match2[1].slice(keyEndIndex).split(this.formatSeparator).map((elem) => elem.trim()).filter(Boolean); 1726 match2[1] = match2[1].slice(0, keyEndIndex); 1727 } 1728 value = fc(handleHasOptions.call(this, match2[1].trim(), clonedOptions), clonedOptions); 1729 if (value && match2[0] === str && !isString$4(value)) return value; 1730 if (!isString$4(value)) value = makeString(value); 1731 if (!value) { 1732 this.logger.warn(`missed to resolve ${match2[1]} for nesting ${str}`); 1733 value = ""; 1734 } 1735 if (formatters.length) { 1736 value = formatters.reduce((v2, f2) => this.format(v2, f2, options2.lng, __spreadProps(__spreadValues({}, options2), { 1737 interpolationkey: match2[1].trim() 1738 })), value.trim()); 1739 } 1740 str = str.replace(match2[0], value); 1741 this.regexp.lastIndex = 0; 1742 } 1743 return str; 1744 } 1745 } 1746 const parseFormatStr = (formatStr) => { 1747 let formatName = formatStr.toLowerCase().trim(); 1748 const formatOptions = {}; 1749 if (formatStr.indexOf("(") > -1) { 1750 const p2 = formatStr.split("("); 1751 formatName = p2[0].toLowerCase().trim(); 1752 const optStr = p2[1].substring(0, p2[1].length - 1); 1753 if (formatName === "currency" && optStr.indexOf(":") < 0) { 1754 if (!formatOptions.currency) formatOptions.currency = optStr.trim(); 1755 } else if (formatName === "relativetime" && optStr.indexOf(":") < 0) { 1756 if (!formatOptions.range) formatOptions.range = optStr.trim(); 1757 } else { 1758 const opts = optStr.split(";"); 1759 opts.forEach((opt) => { 1760 if (opt) { 1761 const [key, ...rest] = opt.split(":"); 1762 const val = rest.join(":").trim().replace(/^'+|'+$/g, ""); 1763 const trimmedKey = key.trim(); 1764 if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val; 1765 if (val === "false") formatOptions[trimmedKey] = false; 1766 if (val === "true") formatOptions[trimmedKey] = true; 1767 if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10); 1768 } 1769 }); 1770 } 1771 } 1772 return { 1773 formatName, 1774 formatOptions 1775 }; 1776 }; 1777 const createCachedFormatter = (fn2) => { 1778 const cache = {}; 1779 return (v2, l2, o2) => { 1780 let optForCache = o2; 1781 if (o2 && o2.interpolationkey && o2.formatParams && o2.formatParams[o2.interpolationkey] && o2[o2.interpolationkey]) { 1782 optForCache = __spreadProps(__spreadValues({}, optForCache), { 1783 [o2.interpolationkey]: void 0 1784 }); 1785 } 1786 const key = l2 + JSON.stringify(optForCache); 1787 let frm = cache[key]; 1788 if (!frm) { 1789 frm = fn2(getCleanedCode(l2), o2); 1790 cache[key] = frm; 1791 } 1792 return frm(v2); 1793 }; 1794 }; 1795 const createNonCachedFormatter = (fn2) => (v2, l2, o2) => fn2(getCleanedCode(l2), o2)(v2); 1796 class Formatter { 1797 constructor(options2 = {}) { 1798 this.logger = baseLogger.create("formatter"); 1799 this.options = options2; 1800 this.init(options2); 1801 } 1802 init(services, options2 = { 1803 interpolation: {} 1804 }) { 1805 this.formatSeparator = options2.interpolation.formatSeparator || ","; 1806 const cf = options2.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter; 1807 this.formats = { 1808 number: cf((lng, opt) => { 1809 const formatter = new Intl.NumberFormat(lng, __spreadValues({}, opt)); 1810 return (val) => formatter.format(val); 1811 }), 1812 currency: cf((lng, opt) => { 1813 const formatter = new Intl.NumberFormat(lng, __spreadProps(__spreadValues({}, opt), { 1814 style: "currency" 1815 })); 1816 return (val) => formatter.format(val); 1817 }), 1818 datetime: cf((lng, opt) => { 1819 const formatter = new Intl.DateTimeFormat(lng, __spreadValues({}, opt)); 1820 return (val) => formatter.format(val); 1821 }), 1822 relativetime: cf((lng, opt) => { 1823 const formatter = new Intl.RelativeTimeFormat(lng, __spreadValues({}, opt)); 1824 return (val) => formatter.format(val, opt.range || "day"); 1825 }), 1826 list: cf((lng, opt) => { 1827 const formatter = new Intl.ListFormat(lng, __spreadValues({}, opt)); 1828 return (val) => formatter.format(val); 1829 }) 1830 }; 1831 } 1832 add(name, fc) { 1833 this.formats[name.toLowerCase().trim()] = fc; 1834 } 1835 addCached(name, fc) { 1836 this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc); 1837 } 1838 format(value, format, lng, options2 = {}) { 1839 const formats = format.split(this.formatSeparator); 1840 if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].indexOf(")") < 0 && formats.find((f2) => f2.indexOf(")") > -1)) { 1841 const lastIndex = formats.findIndex((f2) => f2.indexOf(")") > -1); 1842 formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator); 1843 } 1844 const result = formats.reduce((mem, f2) => { 1845 var _a; 1846 const { 1847 formatName, 1848 formatOptions 1849 } = parseFormatStr(f2); 1850 if (this.formats[formatName]) { 1851 let formatted = mem; 1852 try { 1853 const valOptions = ((_a = options2 == null ? void 0 : options2.formatParams) == null ? void 0 : _a[options2.interpolationkey]) || {}; 1854 const l2 = valOptions.locale || valOptions.lng || options2.locale || options2.lng || lng; 1855 formatted = this.formats[formatName](mem, l2, __spreadValues(__spreadValues(__spreadValues({}, formatOptions), options2), valOptions)); 1856 } catch (error) { 1857 this.logger.warn(error); 1858 } 1859 return formatted; 1860 } else { 1861 this.logger.warn(`there was no format function for ${formatName}`); 1862 } 1863 return mem; 1864 }, value); 1865 return result; 1866 } 1867 } 1868 const removePending = (q2, name) => { 1869 if (q2.pending[name] !== void 0) { 1870 delete q2.pending[name]; 1871 q2.pendingCount--; 1872 } 1873 };
1874 class Connector extends EventEmitter { 1875 constructor(backend, store, services, options2 = {}) { 1876 var _a, _b; 1877 super(); 1878 this.backend = backend; 1879 this.store = store; 1880 this.services = services; 1881 this.languageUtils = services.languageUtils; 1882 this.options = options2; 1883 this.logger = baseLogger.create("backendConnector"); 1884 this.waitingReads = []; 1885 this.maxParallelReads = options2.maxParallelReads || 10; 1886 this.readingCalls = 0; 1887 this.maxRetries = options2.maxRetries >= 0 ? options2.maxRetries : 5; 1888 this.retryTimeout = options2.retryTimeout >= 1 ? options2.retryTimeout : 350; 1889 this.state = {}; 1890 this.queue = []; 1891 (_b = (_a = this.backend) == null ? void 0 : _a.init) == null ? void 0 : _b.call(_a, services, options2.backend, options2); 1892 } 1893 queueLoad(languages, namespaces, options2, callback) { 1894 const toLoad = {}; 1895 const pending = {}; 1896 const toLoadLanguages = {}; 1897 const toLoadNamespaces = {};
1898 languages.forEach((lng) => { 1899 let hasAllNamespaces = true; 1900 namespaces.forEach((ns) => { 1901 const name = `${lng}|${ns}`; 1902 if (!options2.reload && this.store.hasResourceBundle(lng, ns)) { 1903 this.state[name] = 2; 1904 } else if (this.state[name] < 0) ; 1905 else if (this.state[name] === 1) { 1906 if (pending[name] === void 0) pending[name] = true; 1907 } else { 1908 this.state[name] = 1; 1909 hasAllNamespaces = false; 1910 if (pending[name] === void 0) pending[name] = true; 1911 if (toLoad[name] === void 0) toLoad[name] = true; 1912 if (toLoadNamespaces[ns] === void 0) toLoadNamespaces[ns] = true; 1913 } 1914 }); 1915 if (!hasAllNamespaces) toLoadLanguages[lng] = true; 1916 }); 1917 if (Object.keys(toLoad).length || Object.keys(pending).length) { 1918 this.queue.push({ 1919 pending, 1920 pendingCount: Object.keys(pending).length, 1921 loaded: {}, 1922 errors: [], 1923 callback 1924 }); 1925 } 1926 return { 1927 toLoad: Object.keys(toLoad), 1928 pending: Object.keys(pending), 1929 toLoadLanguages: Object.keys(toLoadLanguages), 1930 toLoadNamespaces: Object.keys(toLoadNamespaces) 1931 }; 1932 } 1933 loaded(name, err, data) { 1934 const s2 = name.split("|"); 1935 const lng = s2[0]; 1936 const ns = s2[1]; 1937 if (err) this.emit("failedLoading", lng, ns, err); 1938 if (!err && data) { 1939 this.store.addResourceBundle(lng, ns, data, void 0, void 0, { 1940 skipCopy: true 1941 }); 1942 } 1943 this.state[name] = err ? -1 : 2; 1944 if (err && data) this.state[name] = 0; 1945 const loaded = {}; 1946 this.queue.forEach((q2) => { 1947 pushPath(q2.loaded, [lng], ns); 1948 removePending(q2, name); 1949 if (err) q2.errors.push(err); 1950 if (q2.pendingCount === 0 && !q2.done) { 1951 Object.keys(q2.loaded).forEach((l2) => { 1952 if (!loaded[l2]) loaded[l2] = {}; 1953 const loadedKeys = q2.loaded[l2]; 1954 if (loadedKeys.length) { 1955 loadedKeys.forEach((n2) => { 1956 if (loaded[l2][n2] === void 0) loaded[l2][n2] = true; 1957 }); 1958 } 1959 }); 1960 q2.done = true; 1961 if (q2.errors.length) { 1962 q2.callback(q2.errors); 1963 } else { 1964 q2.callback(); 1965 } 1966 } 1967 }); 1968 this.emit("loaded", loaded); 1969 this.queue = this.queue.filter((q2) => !q2.done); 1970 } 1971 read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) { 1972 if (!lng.length) return callback(null, {}); 1973 if (this.readingCalls >= this.maxParallelReads) { 1974 this.waitingReads.push({ 1975 lng, 1976 ns, 1977 fcName, 1978 tried, 1979 wait, 1980 callback 1981 }); 1982 return; 1983 } 1984 this.readingCalls++; 1985 const resolver = (err, data) => { 1986 this.readingCalls--; 1987 if (this.waitingReads.length > 0) { 1988 const next2 = this.waitingReads.shift(); 1989 this.read(next2.lng, next2.ns, next2.fcName, next2.tried, next2.wait, next2.callback); 1990 } 1991 if (err && data && tried < this.maxRetries) { 1992 setTimeout(() => { 1993 this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback); 1994 }, wait); 1995 return; 1996 } 1997 callback(err, data); 1998 }; 1999 const fc = this.backend[fcName].bind(this.backend); 2000 if (fc.length === 2) { 2001 try { 2002 const r2 = fc(lng, ns); 2003 if (r2 && typeof r2.then === "function") { 2004 r2.then((data) => resolver(null, data)).catch(resolver); 2005 } else { 2006 resolver(null, r2); 2007 } 2008 } catch (err) { 2009 resolver(err); 2010 } 2011 return; 2012 } 2013 return fc(lng, ns, resolver); 2014 } 2015 prepareLoading(languages, namespaces, options2 = {}, callback) { 2016 if (!this.backend) { 2017 this.logger.warn("No backend was added via i18next.use. Will not load resources."); 2018 return callback && callback(); 2019 }
2020 if (isString$4(languages)) languages = this.languageUtils.toResolveHierarchy(languages); 2021 if (isString$4(namespaces)) namespaces = [namespaces]; 2022 const toLoad = this.queueLoad(languages, namespaces, options2, callback); 2023 if (!toLoad.toLoad.length) { 2024 if (!toLoad.pending.length) callback(); 2025 return null; 2026 } 2027 toLoad.toLoad.forEach((name) => { 2028 this.loadOne(name); 2029 }); 2030 } 2031 load(languages, namespaces, callback) { 2032 this.prepareLoading(languages, namespaces, {}, callback); 2033 } 2034 reload(languages, namespaces, callback) { 2035 this.prepareLoading(languages, namespaces, { 2036 reload: true 2037 }, callback); 2038 } 2039 loadOne(name, prefix2 = "") { 2040 const s2 = name.split("|"); 2041 const lng = s2[0]; 2042 const ns = s2[1]; 2043 this.read(lng, ns, "read", void 0, void 0, (err, data) => { 2044 if (err) this.logger.warn(`${prefix2}loading namespace ${ns} for language ${lng} failed`, err); 2045 if (!err && data) this.logger.log(`${prefix2}loaded namespace ${ns} for language ${lng}`, data); 2046 this.loaded(name, err, data); 2047 }); 2048 } 2049 saveMissing(languages, namespace, key, fallbackValue, isUpdate, options2 = {}, clb = () => { 2050 }) { 2051 var _a, _b, _c, _d, _e2; 2052 if (((_b = (_a = this.services) == null ? void 0 : _a.utils) == null ? void 0 : _b.hasLoadedNamespace) && !((_d = (_c = this.services) == null ? void 0 : _c.utils) == null ? void 0 : _d.hasLoadedNamespace(namespace))) { 2053 this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 2054 return; 2055 } 2056 if (key === void 0 || key === null || key === "") return; 2057 if ((_e2 = this.backend) == null ? void 0 : _e2.create) { 2058 const opts = __spreadProps(__spreadValues({}, options2), { 2059 isUpdate 2060 }); 2061 const fc = this.backend.create.bind(this.backend); 2062 if (fc.length < 6) { 2063 try { 2064 let r2; 2065 if (fc.length === 5) { 2066 r2 = fc(languages, namespace, key, fallbackValue, opts); 2067 } else { 2068 r2 = fc(languages, namespace, key, fallbackValue); 2069 } 2070 if (r2 && typeof r2.then === "function") { 2071 r2.then((data) => clb(null, data)).catch(clb); 2072 } else { 2073 clb(null, r2); 2074 } 2075 } catch (err) { 2076 clb(err); 2077 } 2078 } else { 2079 fc(languages, namespace, key, fallbackValue, clb, opts); 2080 } 2081 } 2082 if (!languages || !languages[0]) return; 2083 this.store.addResource(languages[0], namespace, key, fallbackValue); 2084 } 2085 } 2086 const get$1 = () => ({ 2087 debug: false, 2088 initAsync: true, 2089 ns: ["translation"], 2090 defaultNS: ["translation"], 2091 fallbackLng: ["dev"], 2092 fallbackNS: false, 2093 supportedLngs: false, 2094 nonExplicitSupportedLngs: false, 2095 load: "all", 2096 preload: false, 2097 simplifyPluralSuffix: true, 2098 keySeparator: ".", 2099 nsSeparator: ":", 2100 pluralSeparator: "_", 2101 contextSeparator: "_", 2102 partialBundledLanguages: false, 2103 saveMissing: false, 2104 updateMissing: false, 2105 saveMissingTo: "fallback", 2106 saveMissingPlurals: true, 2107 missingKeyHandler: false, 2108 missingInterpolationHandler: false, 2109 postProcess: false, 2110 postProcessPassResolved: false, 2111 returnNull: false, 2112 returnEmptyString: true, 2113 returnObjects: false, 2114 joinArrays: false, 2115 returnedObjectHandler: false, 2116 parseMissingKeyHandler: false, 2117 appendNamespaceToMissingKey: false, 2118 appendNamespaceToCIMode: false, 2119 overloadTranslationOptionHandler: (args) => { 2120 let ret = {}; 2121 if (typeof args[1] === "object") ret = args[1]; 2122 if (isString$4(args[1])) ret.defaultValue = args[1]; 2123 if (isString$4(args[2])) ret.tDescription = args[2]; 2124 if (typeof args[2] === "object" || typeof args[3] === "object") { 2125 const options2 = args[3] || args[2]; 2126 Object.keys(options2).forEach((key) => { 2127 ret[key] = options2[key]; 2128 }); 2129 } 2130 return ret; 2131 }, 2132 interpolation: { 2133 escapeValue: true, 2134 format: (value) => value, 2135 prefix: "{{", 2136 suffix: "}}", 2137 formatSeparator: ",", 2138 unescapePrefix: "-", 2139 nestingPrefix: "$t(", 2140 nestingSuffix: ")", 2141 nestingOptionsSeparator: ",", 2142 maxReplaces: 1e3, 2143 skipOnVariables: true 2144 }, 2145 cacheInBuiltFormats: true 2146 }); 2147 const transformOptions = (options2) => { 2148 var _a, _b; 2149 if (isString$4(options2.ns)) options2.ns = [options2.ns]; 2150 if (isString$4(options2.fallbackLng)) options2.fallbackLng = [options2.fallbackLng]; 2151 if (isString$4(options2.fallbackNS)) options2.fallbackNS = [options2.fallbackNS]; 2152 if (((_b = (_a = options2.supportedLngs) == null ? void 0 : _a.indexOf) == null ? void 0 : _b.call(_a, "cimode")) < 0) { 2153 options2.supportedLngs = options2.supportedLngs.concat(["cimode"]); 2154 } 2155 if (typeof options2.initImmediate === "boolean") options2.initAsync = options2.initImmediate; 2156 return options2; 2157 }; 2158 const noop$8 = () => { 2159 }; 2160 const bindMemberFunctions = (inst) => { 2161 const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
vendor: 4,151 bytes, lines 2162-2254
2162 mems.forEach((mem) => { 2163 if (typeof inst[mem] === "function") { 2164 inst[mem] = inst[mem].bind(inst); 2165 } 2166 }); 2167 }; 2168 class I18n extends EventEmitter { 2169 constructor(options2 = {}, callback) { 2170 super(); 2171 this.options = transformOptions(options2); 2172 this.services = {}; 2173 this.logger = baseLogger; 2174 this.modules = { 2175 external: [] 2176 }; 2177 bindMemberFunctions(this); 2178 if (callback && !this.isInitialized && !options2.isClone) { 2179 if (!this.options.initAsync) { 2180 this.init(options2, callback); 2181 return this; 2182 } 2183 setTimeout(() => { 2184 this.init(options2, callback); 2185 }, 0); 2186 } 2187 } 2188 init(options2 = {}, callback) { 2189 this.isInitializing = true; 2190 if (typeof options2 === "function") { 2191 callback = options2; 2192 options2 = {}; 2193 } 2194 if (options2.defaultNS == null && options2.ns) { 2195 if (isString$4(options2.ns)) { 2196 options2.defaultNS = options2.ns; 2197 } else if (options2.ns.indexOf("translation") < 0) { 2198 options2.defaultNS = options2.ns[0]; 2199 } 2200 } 2201 const defOpts = get$1(); 2202 this.options = __spreadValues(__spreadValues(__spreadValues({}, defOpts), this.options), transformOptions(options2)); 2203 this.options.interpolation = __spreadValues(__spreadValues({}, defOpts.interpolation), this.options.interpolation); 2204 if (options2.keySeparator !== void 0) { 2205 this.options.userDefinedKeySeparator = options2.keySeparator; 2206 } 2207 if (options2.nsSeparator !== void 0) { 2208 this.options.userDefinedNsSeparator = options2.nsSeparator; 2209 } 2210 if (typeof this.options.overloadTranslationOptionHandler !== "function") { 2211 this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler; 2212 } 2213 const createClassOnDemand = (ClassOrObject) => { 2214 if (!ClassOrObject) return null; 2215 if (typeof ClassOrObject === "function") return new ClassOrObject(); 2216 return ClassOrObject; 2217 }; 2218 if (!this.options.isClone) { 2219 if (this.modules.logger) { 2220 baseLogger.init(createClassOnDemand(this.modules.logger), this.options); 2221 } else { 2222 baseLogger.init(null, this.options); 2223 } 2224 let formatter; 2225 if (this.modules.formatter) { 2226 formatter = this.modules.formatter; 2227 } else { 2228 formatter = Formatter; 2229 } 2230 const lu = new LanguageUtil(this.options); 2231 this.store = new ResourceStore(this.options.resources, this.options); 2232 const s2 = this.services; 2233 s2.logger = baseLogger; 2234 s2.resourceStore = this.store; 2235 s2.languageUtils = lu; 2236 s2.pluralResolver = new PluralResolver(lu, { 2237 prepend: this.options.pluralSeparator, 2238 simplifyPluralSuffix: this.options.simplifyPluralSuffix 2239 }); 2240 const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format; 2241 if (usingLegacyFormatFunction) { 2242 this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`); 2243 } 2244 if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) { 2245 s2.formatter = createClassOnDemand(formatter); 2246 if (s2.formatter.init) s2.formatter.init(s2, this.options); 2247 this.options.interpolation.format = s2.formatter.format.bind(s2.formatter); 2248 } 2249 s2.interpolator = new Interpolator(this.options); 2250 s2.utils = { 2251 hasLoadedNamespace: this.hasLoadedNamespace.bind(this) 2252 }; 2253 s2.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s2.resourceStore, s2, this.options); 2254 s2.backendConnector.on("*", (event, ...args) => {
vendor: 6,720 bytes, lines 2255-2409
2255 this.emit(event, ...args); 2256 }); 2257 if (this.modules.languageDetector) { 2258 s2.languageDetector = createClassOnDemand(this.modules.languageDetector); 2259 if (s2.languageDetector.init) s2.languageDetector.init(s2, this.options.detection, this.options); 2260 } 2261 if (this.modules.i18nFormat) { 2262 s2.i18nFormat = createClassOnDemand(this.modules.i18nFormat); 2263 if (s2.i18nFormat.init) s2.i18nFormat.init(this); 2264 } 2265 this.translator = new Translator(this.services, this.options); 2266 this.translator.on("*", (event, ...args) => { 2267 this.emit(event, ...args); 2268 }); 2269 this.modules.external.forEach((m2) => { 2270 if (m2.init) m2.init(this); 2271 }); 2272 } 2273 this.format = this.options.interpolation.format; 2274 if (!callback) callback = noop$8; 2275 if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { 2276 const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 2277 if (codes.length > 0 && codes[0] !== "dev") this.options.lng = codes[0]; 2278 } 2279 if (!this.services.languageDetector && !this.options.lng) { 2280 this.logger.warn("init: no languageDetector is used and no lng is defined"); 2281 } 2282 const storeApi = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"]; 2283 storeApi.forEach((fcName) => { 2284 this[fcName] = (...args) => this.store[fcName](...args); 2285 }); 2286 const storeApiChained = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"]; 2287 storeApiChained.forEach((fcName) => { 2288 this[fcName] = (...args) => { 2289 this.store[fcName](...args); 2290 return this; 2291 }; 2292 }); 2293 const deferred = defer(); 2294 const load = () => { 2295 const finish = (err, t2) => { 2296 this.isInitializing = false; 2297 if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn("init: i18next is already initialized. You should call init just once!"); 2298 this.isInitialized = true; 2299 if (!this.options.isClone) this.logger.log("initialized", this.options); 2300 this.emit("initialized", this.options); 2301 deferred.resolve(t2); 2302 callback(err, t2); 2303 }; 2304 if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this)); 2305 this.changeLanguage(this.options.lng, finish); 2306 }; 2307 if (this.options.resources || !this.options.initAsync) { 2308 load(); 2309 } else { 2310 setTimeout(load, 0); 2311 } 2312 return deferred; 2313 } 2314 loadResources(language, callback = noop$8) { 2315 var _a, _b; 2316 let usedCallback = callback; 2317 const usedLng = isString$4(language) ? language : this.language; 2318 if (typeof language === "function") usedCallback = language; 2319 if (!this.options.resources || this.options.partialBundledLanguages) { 2320 if ((usedLng == null ? void 0 : usedLng.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback(); 2321 const toLoad = []; 2322 const append2 = (lng) => { 2323 if (!lng) return; 2324 if (lng === "cimode") return; 2325 const lngs = this.services.languageUtils.toResolveHierarchy(lng); 2326 lngs.forEach((l2) => { 2327 if (l2 === "cimode") return; 2328 if (toLoad.indexOf(l2) < 0) toLoad.push(l2); 2329 }); 2330 }; 2331 if (!usedLng) { 2332 const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 2333 fallbacks.forEach((l2) => append2(l2)); 2334 } else { 2335 append2(usedLng); 2336 } 2337 (_b = (_a = this.options.preload) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (l2) => append2(l2)); 2338 this.services.backendConnector.load(toLoad, this.options.ns, (e2) => { 2339 if (!e2 && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language); 2340 usedCallback(e2); 2341 }); 2342 } else { 2343 usedCallback(null); 2344 } 2345 } 2346 reloadResources(lngs, ns, callback) { 2347 const deferred = defer(); 2348 if (typeof lngs === "function") { 2349 callback = lngs; 2350 lngs = void 0; 2351 } 2352 if (typeof ns === "function") { 2353 callback = ns; 2354 ns = void 0; 2355 } 2356 if (!lngs) lngs = this.languages; 2357 if (!ns) ns = this.options.ns; 2358 if (!callback) callback = noop$8; 2359 this.services.backendConnector.reload(lngs, ns, (err) => { 2360 deferred.resolve(); 2361 callback(err); 2362 }); 2363 return deferred; 2364 } 2365 use(module2) { 2366 if (!module2) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()"); 2367 if (!module2.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()"); 2368 if (module2.type === "backend") { 2369 this.modules.backend = module2; 2370 } 2371 if (module2.type === "logger" || module2.log && module2.warn && module2.error) { 2372 this.modules.logger = module2; 2373 } 2374 if (module2.type === "languageDetector") { 2375 this.modules.languageDetector = module2; 2376 } 2377 if (module2.type === "i18nFormat") { 2378 this.modules.i18nFormat = module2; 2379 } 2380 if (module2.type === "postProcessor") { 2381 postProcessor.addPostProcessor(module2); 2382 } 2383 if (module2.type === "formatter") { 2384 this.modules.formatter = module2; 2385 } 2386 if (module2.type === "3rdParty") { 2387 this.modules.external.push(module2); 2388 } 2389 return this; 2390 } 2391 setResolvedLanguage(l2) { 2392 if (!l2 || !this.languages) return; 2393 if (["cimode", "dev"].indexOf(l2) > -1) return; 2394 for (let li2 = 0; li2 < this.languages.length; li2++) { 2395 const lngInLngs = this.languages[li2]; 2396 if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue; 2397 if (this.store.hasLanguageSomeTranslations(lngInLngs)) { 2398 this.resolvedLanguage = lngInLngs; 2399 break; 2400 } 2401 } 2402 if (!this.resolvedLanguage && this.languages.indexOf(l2) < 0 && this.store.hasLanguageSomeTranslations(l2)) { 2403 this.resolvedLanguage = l2; 2404 this.languages.unshift(l2); 2405 } 2406 } 2407 changeLanguage(lng, callback) { 2408 this.isLanguageChangingTo = lng; 2409 const deferred = defer();
2410 this.emit("languageChanging", lng); 2411 const setLngProps = (l2) => { 2412 this.language = l2; 2413 this.languages = this.services.languageUtils.toResolveHierarchy(l2); 2414 this.resolvedLanguage = void 0; 2415 this.setResolvedLanguage(l2); 2416 }; 2417 const done = (err, l2) => { 2418 if (l2) { 2419 if (this.isLanguageChangingTo === lng) { 2420 setLngProps(l2); 2421 this.translator.changeLanguage(l2); 2422 this.isLanguageChangingTo = void 0; 2423 this.emit("languageChanged", l2); 2424 this.logger.log("languageChanged", l2); 2425 } 2426 } else { 2427 this.isLanguageChangingTo = void 0; 2428 } 2429 deferred.resolve((...args) => this.t(...args)); 2430 if (callback) callback(err, (...args) => this.t(...args)); 2431 }; 2432 const setLng = (lngs) => { 2433 var _a, _b; 2434 if (!lng && !lngs && this.services.languageDetector) lngs = []; 2435 const fl = isString$4(lngs) ? lngs : lngs && lngs[0]; 2436 const l2 = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString$4(lngs) ? [lngs] : lngs); 2437 if (l2) { 2438 if (!this.language) { 2439 setLngProps(l2); 2440 } 2441 if (!this.translator.language) this.translator.changeLanguage(l2); 2442 (_b = (_a = this.services.languageDetector) == null ? void 0 : _a.cacheUserLanguage) == null ? void 0 : _b.call(_a, l2); 2443 } 2444 this.loadResources(l2, (err) => { 2445 done(err, l2); 2446 }); 2447 }; 2448 if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { 2449 setLng(this.services.languageDetector.detect()); 2450 } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { 2451 if (this.services.languageDetector.detect.length === 0) { 2452 this.services.languageDetector.detect().then(setLng); 2453 } else { 2454 this.services.languageDetector.detect(setLng); 2455 } 2456 } else { 2457 setLng(lng); 2458 } 2459 return deferred; 2460 } 2461 getFixedT(lng, ns, keyPrefix) { 2462 const fixedT = (key, opts, ...rest) => { 2463 let o2; 2464 if (typeof opts !== "object") { 2465 o2 = this.options.overloadTranslationOptionHandler([key, opts].concat(rest)); 2466 } else { 2467 o2 = __spreadValues({}, opts); 2468 } 2469 o2.lng = o2.lng || fixedT.lng; 2470 o2.lngs = o2.lngs || fixedT.lngs; 2471 o2.ns = o2.ns || fixedT.ns; 2472 if (o2.keyPrefix !== "") o2.keyPrefix = o2.keyPrefix || keyPrefix || fixedT.keyPrefix; 2473 const keySeparator = this.options.keySeparator || "."; 2474 let resultKey; 2475 if (o2.keyPrefix && Array.isArray(key)) { 2476 resultKey = key.map((k2) => { 2477 if (typeof k2 === "function") k2 = keysFromSelector(k2, __spreadValues(__spreadValues({}, this.options), opts)); 2478 return `${o2.keyPrefix}${keySeparator}${k2}`; 2479 }); 2480 } else { 2481 if (typeof key === "function") key = keysFromSelector(key, __spreadValues(__spreadValues({}, this.options), opts)); 2482 resultKey = o2.keyPrefix ? `${o2.keyPrefix}${keySeparator}${key}` : key; 2483 } 2484 return this.t(resultKey, o2); 2485 }; 2486 if (isString$4(lng)) { 2487 fixedT.lng = lng; 2488 } else { 2489 fixedT.lngs = lng; 2490 } 2491 fixedT.ns = ns; 2492 fixedT.keyPrefix = keyPrefix; 2493 return fixedT; 2494 } 2495 t(...args) { 2496 var _a; 2497 return (_a = this.translator) == null ? void 0 : _a.translate(...args); 2498 } 2499 exists(...args) { 2500 var _a; 2501 return (_a = this.translator) == null ? void 0 : _a.exists(...args); 2502 } 2503 setDefaultNamespace(ns) { 2504 this.options.defaultNS = ns; 2505 } 2506 hasLoadedNamespace(ns, options2 = {}) { 2507 if (!this.isInitialized) { 2508 this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages); 2509 return false;
2510 } 2511 if (!this.languages || !this.languages.length) { 2512 this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages); 2513 return false; 2514 } 2515 const lng = options2.lng || this.resolvedLanguage || this.languages[0]; 2516 const fallbackLng = this.options ? this.options.fallbackLng : false; 2517 const lastLng = this.languages[this.languages.length - 1]; 2518 if (lng.toLowerCase() === "cimode") return true; 2519 const loadNotPending = (l2, n2) => { 2520 const loadState = this.services.backendConnector.state[`${l2}|${n2}`]; 2521 return loadState === -1 || loadState === 0 || loadState === 2; 2522 }; 2523 if (options2.precheck) { 2524 const preResult = options2.precheck(this, loadNotPending); 2525 if (preResult !== void 0) return preResult; 2526 } 2527 if (this.hasResourceBundle(lng, ns)) return true; 2528 if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true; 2529 if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; 2530 return false; 2531 } 2532 loadNamespaces(ns, callback) { 2533 const deferred = defer(); 2534 if (!this.options.ns) { 2535 if (callback) callback(); 2536 return Promise.resolve(); 2537 } 2538 if (isString$4(ns)) ns = [ns]; 2539 ns.forEach((n2) => { 2540 if (this.options.ns.indexOf(n2) < 0) this.options.ns.push(n2); 2541 }); 2542 this.loadResources((err) => { 2543 deferred.resolve(); 2544 if (callback) callback(err); 2545 }); 2546 return deferred; 2547 } 2548 loadLanguages(lngs, callback) { 2549 const deferred = defer(); 2550 if (isString$4(lngs)) lngs = [lngs]; 2551 const preloaded = this.options.preload || []; 2552 const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng)); 2553 if (!newLngs.length) { 2554 if (callback) callback(); 2555 return Promise.resolve(); 2556 } 2557 this.options.preload = preloaded.concat(newLngs); 2558 this.loadResources((err) => { 2559 deferred.resolve(); 2560 if (callback) callback(err); 2561 }); 2562 return deferred; 2563 } 2564 dir(lng) { 2565 var _a, _b; 2566 if (!lng) lng = this.resolvedLanguage || (((_a = this.languages) == null ? void 0 : _a.length) > 0 ? this.languages[0] : this.language); 2567 if (!lng) return "rtl"; 2568 try { 2569 const l2 = new Intl.Locale(lng); 2570 if (l2 && l2.getTextInfo) { 2571 const ti2 = l2.getTextInfo(); 2572 if (ti2 && ti2.direction) return ti2.direction; 2573 } 2574 } catch (e2) { 2575 } 2576 const rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"]; 2577 const languageUtils = ((_b = this.services) == null ? void 0 : _b.languageUtils) || new LanguageUtil(get$1()); 2578 if (lng.toLowerCase().indexOf("-latn") > 1) return "ltr"; 2579 return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr"; 2580 } 2581 static createInstance(options2 = {}, callback) { 2582 const instance2 = new I18n(options2, callback); 2583 instance2.createInstance = I18n.createInstance; 2584 return instance2; 2585 } 2586 cloneInstance(options2 = {}, callback = noop$8) { 2587 const forkResourceStore = options2.forkResourceStore; 2588 if (forkResourceStore) delete options2.forkResourceStore; 2589 const mergedOptions = __spreadValues(__spreadValues(__spreadValues({}, this.options), options2), { 2590 isClone: true 2591 }); 2592 const clone2 = new I18n(mergedOptions); 2593 if (options2.debug !== void 0 || options2.prefix !== void 0) { 2594 clone2.logger = clone2.logger.clone(options2); 2595 } 2596 const membersToCopy = ["store", "services", "language"]; 2597 membersToCopy.forEach((m2) => { 2598 clone2[m2] = this[m2]; 2599 }); 2600 clone2.services = __spreadValues({}, this.services); 2601 clone2.services.utils = { 2602 hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2) 2603 }; 2604 if (forkResourceStore) { 2605 const clonedData = Object.keys(this.store.data).reduce((prev2, l2) => { 2606 prev2[l2] = __spreadValues({}, this.store.data[l2]); 2607 prev2[l2] = Object.keys(prev2[l2]).reduce((acc, n2) => { 2608 acc[n2] = __spreadValues({}, prev2[l2][n2]); 2609 return acc; 2610 }, prev2[l2]); 2611 return prev2; 2612 }, {}); 2613 clone2.store = new ResourceStore(clonedData, mergedOptions); 2614 clone2.services.resourceStore = clone2.store; 2615 } 2616 if (options2.interpolation) clone2.services.interpolator = new Interpolator(mergedOptions); 2617 clone2.translator = new Translator(clone2.services, mergedOptions); 2618 clone2.translator.on("*", (event, ...args) => { 2619 clone2.emit(event, ...args); 2620 }); 2621 clone2.init(mergedOptions, callback); 2622 clone2.translator.options = mergedOptions; 2623 clone2.translator.backendConnector.services.utils = { 2624 hasLoadedNamespace: clone2.hasLoadedNamespace.bind(clone2) 2625 }; 2626 return clone2; 2627 } 2628 toJSON() { 2629 return { 2630 options: this.options, 2631 store: this.store, 2632 language: this.language, 2633 languages: this.languages, 2634 resolvedLanguage: this.resolvedLanguage 2635 }; 2636 } 2637 } 2638 const instance = I18n.createInstance(); 2639 instance.createInstance; 2640 instance.dir; 2641 instance.init; 2642 instance.loadResources; 2643 instance.reloadResources; 2644 instance.use; 2645 instance.changeLanguage; 2646 instance.getFixedT; 2647 instance.t; 2648 instance.exists; 2649 instance.setDefaultNamespace; 2650 instance.hasLoadedNamespace; 2651 instance.loadNamespaces; 2652 instance.loadLanguages; 2653 var reactExports = requireReact(); 2654 const e$3 = /* @__PURE__ */ getDefaultExportFromCjs(reactExports); 2655 const React = /* @__PURE__ */ _mergeNamespaces({ 2656 __proto__: null, 2657 default: e$3 2658 }, [reactExports]); 2659 var voidElements; 2660 var hasRequiredVoidElements; 2661 function requireVoidElements() { 2662 if (hasRequiredVoidElements) return voidElements; 2663 hasRequiredVoidElements = 1; 2664 voidElements = { 2665 "area": true, 2666 "base": true, 2667 "br": true, 2668 "col": true, 2669 "embed": true, 2670 "hr": true, 2671 "img": true, 2672 "input": true, 2673 "link": true, 2674 "meta": true, 2675 "param": true, 2676 "source": true, 2677 "track": true, 2678 "wbr": true 2679 }; 2680 return voidElements; 2681 } 2682 var voidElementsExports = requireVoidElements(); 2683 const e$2 = /* @__PURE__ */ getDefaultExportFromCjs(voidElementsExports); 2684 var t$2 = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g; 2685 function n$2(n2) { 2686 var r2 = { type: "tag", name: "", voidElement: false, attrs: {}, children: [] }, i2 = n2.match(/<\/?([^\s]+?)[/\s>]/); 2687 if (i2 && (r2.name = i2[1], (e$2[i2[1]] || "/" === n2.charAt(n2.length - 2)) && (r2.voidElement = true), r2.name.startsWith("!--"))) { 2688 var s2 = n2.indexOf("-->"); 2689 return { type: "comment", comment: -1 !== s2 ? n2.slice(4, s2) : "" }; 2690 } 2691 for (var a2 = new RegExp(t$2), c2 = null; null !== (c2 = a2.exec(n2)); ) if (c2[0].trim()) if (c2[1]) { 2692 var o2 = c2[1].trim(), l2 = [o2, ""]; 2693 o2.indexOf("=") > -1 && (l2 = o2.split("=")), r2.attrs[l2[0]] = l2[1], a2.lastIndex--; 2694 } else c2[2] && (r2.attrs[c2[2]] = c2[3].trim().substring(1, c2[3].length - 1)); 2695 return r2; 2696 } 2697 var r$2 = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, i$1 = /^\s*$/, s$6 = /* @__PURE__ */ Object.create(null); 2698 function a$1(e2, t2) { 2699 switch (t2.type) { 2700 case "text": 2701 return e2 + t2.content; 2702 case "tag": 2703 return e2 += "<" + t2.name + (t2.attrs ? (function(e3) { 2704 var t3 = []; 2705 for (var n2 in e3) t3.push(n2 + '="' + e3[n2] + '"'); 2706 return t3.length ? " " + t3.join(" ") : ""; 2707 })(t2.attrs) : "") + (t2.voidElement ? "/>" : ">"), t2.voidElement ? e2 : e2 + t2.children.reduce(a$1, "") + "</" + t2.name + ">"; 2708 case "comment": 2709 return e2 + "<!--" + t2.comment + "-->"; 2710 } 2711 } 2712 var c$5 = { parse: function(e2, t2) { 2713 t2 || (t2 = {}), t2.components || (t2.components = s$6); 2714 var a2, c2 = [], o2 = [], l2 = -1, m2 = false;
2715 if (0 !== e2.indexOf("<")) { 2716 var u2 = e2.indexOf("<"); 2717 c2.push({ type: "text", content: -1 === u2 ? e2 : e2.substring(0, u2) }); 2718 } 2719 return e2.replace(r$2, function(r2, s2) { 2720 if (m2) { 2721 if (r2 !== "</" + a2.name + ">") return; 2722 m2 = false; 2723 } 2724 var u3, f2 = "/" !== r2.charAt(1), h2 = r2.startsWith("<!--"), p2 = s2 + r2.length, d2 = e2.charAt(p2); 2725 if (h2) { 2726 var v2 = n$2(r2); 2727 return l2 < 0 ? (c2.push(v2), c2) : ((u3 = o2[l2]).children.push(v2), c2); 2728 } 2729 if (f2 && (l2++, "tag" === (a2 = n$2(r2)).type && t2.components[a2.name] && (a2.type = "component", m2 = true), a2.voidElement || m2 || !d2 || "<" === d2 || a2.children.push({ type: "text", content: e2.slice(p2, e2.indexOf("<", p2)) }), 0 === l2 && c2.push(a2), (u3 = o2[l2 - 1]) && u3.children.push(a2), o2[l2] = a2), (!f2 || a2.voidElement) && (l2 > -1 && (a2.voidElement || a2.name === r2.slice(2, -1)) && (l2--, a2 = -1 === l2 ? c2 : o2[l2]), !m2 && "<" !== d2 && d2)) { 2730 u3 = -1 === l2 ? c2 : o2[l2].children; 2731 var x2 = e2.indexOf("<", p2), g2 = e2.slice(p2, -1 === x2 ? void 0 : x2); 2732 i$1.test(g2) && (g2 = " "), (x2 > -1 && l2 + u3.length >= 0 || " " !== g2) && u3.push({ type: "text", content: g2 }); 2733 } 2734 }), c2; 2735 }, stringify: function(e2) { 2736 return e2.reduce(function(e3, t2) { 2737 return e3 + a$1("", t2); 2738 }, ""); 2739 } }; 2740 const warn$2 = (i18n, code, msg, rest) => { 2741 var _a, _b, _c, _d; 2742 const args = [msg, __spreadValues({ 2743 code 2744 }, rest || {})]; 2745 if ((_b = (_a = i18n == null ? void 0 : i18n.services) == null ? void 0 : _a.logger) == null ? void 0 : _b.forward) { 2746 return i18n.services.logger.forward(args, "warn", "react-i18next::", true); 2747 } 2748 if (isString$3(args[0])) args[0] = `react-i18next:: ${args[0]}`; 2749 if ((_d = (_c = i18n == null ? void 0 : i18n.services) == null ? void 0 : _c.logger) == null ? void 0 : _d.warn) { 2750 i18n.services.logger.warn(...args); 2751 } else if (console == null ? void 0 : console.warn) { 2752 console.warn(...args); 2753 } 2754 }; 2755 const alreadyWarned = {}; 2756 const warnOnce = (i18n, code, msg, rest) => { 2757 if (isString$3(msg) && alreadyWarned[msg]) return; 2758 if (isString$3(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date(); 2759 warn$2(i18n, code, msg, rest); 2760 }; 2761 const loadedClb = (i18n, cb) => () => { 2762 if (i18n.isInitialized) { 2763 cb(); 2764 } else { 2765 const initialized = () => { 2766 setTimeout(() => { 2767 i18n.off("initialized", initialized); 2768 }, 0); 2769 cb(); 2770 }; 2771 i18n.on("initialized", initialized); 2772 } 2773 }; 2774 const loadNamespaces = (i18n, ns, cb) => { 2775 i18n.loadNamespaces(ns, loadedClb(i18n, cb)); 2776 }; 2777 const loadLanguages = (i18n, lng, ns, cb) => { 2778 if (isString$3(ns)) ns = [ns]; 2779 if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb); 2780 ns.forEach((n2) => { 2781 if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2); 2782 }); 2783 i18n.loadLanguages(lng, loadedClb(i18n, cb)); 2784 }; 2785 const hasLoadedNamespace = (ns, i18n, options2 = {}) => { 2786 if (!i18n.languages || !i18n.languages.length) { 2787 warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", { 2788 languages: i18n.languages 2789 }); 2790 return true; 2791 } 2792 return i18n.hasLoadedNamespace(ns, { 2793 lng: options2.lng, 2794 precheck: (i18nInstance2, loadNotPending) => { 2795 if (options2.bindI18n && options2.bindI18n.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false; 2796 } 2797 }); 2798 }; 2799 const isString$3 = (obj) => typeof obj === "string"; 2800 const isObject$5 = (obj) => typeof obj === "object" && obj !== null; 2801 const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g; 2802 const htmlEntities = { 2803 "&": "&", 2804 "&": "&", 2805 "<": "<", 2806 "<": "<", 2807 ">": ">", 2808 ">": ">", 2809 "'": "'", 2810 "'": "'", 2811 """: '"', 2812 """: '"', 2813 " ": " ", 2814 " ": " ", 2815 "©": "©", 2816 "©": "©", 2817 "®": "®", 2818 "®": "®", 2819 "…": "â¦", 2820 "…": "â¦", 2821 "/": "/", 2822 "/": "/" 2823 }; 2824 const unescapeHtmlEntity = (m2) => htmlEntities[m2]; 2825 const unescape$1 = (text2) => text2.replace(matchHtmlEntity, unescapeHtmlEntity); 2826 let defaultOptions = { 2827 bindI18n: "languageChanged", 2828 bindI18nStore: "", 2829 transEmptyNodeValue: "", 2830 transSupportBasicHtmlNodes: true, 2831 transWrapTextNodes: "", 2832 transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"], 2833 useSuspense: true, 2834 unescape: unescape$1 2835 }; 2836 const setDefaults = (options2 = {}) => { 2837 defaultOptions = __spreadValues(__spreadValues({}, defaultOptions), options2); 2838 }; 2839 const getDefaults = () => defaultOptions; 2840 let i18nInstance; 2841 const setI18n = (instance2) => { 2842 i18nInstance = instance2; 2843 }; 2844 const getI18n = () => i18nInstance; 2845 const hasChildren = (node2, checkLength) => { 2846 var _a, _b; 2847 if (!node2) return false;
2848 const base = (_b = (_a = node2.props) == null ? void 0 : _a.children) != null ? _b : node2.children; 2849 if (checkLength) return base.length > 0; 2850 return !!base; 2851 }; 2852 const getChildren = (node2) => { 2853 var _a, _b, _c; 2854 if (!node2) return []; 2855 const children = (_b = (_a = node2.props) == null ? void 0 : _a.children) != null ? _b : node2.children; 2856 return ((_c = node2.props) == null ? void 0 : _c.i18nIsDynamicList) ? getAsArray(children) : children; 2857 }; 2858 const hasValidReactChildren = (children) => Array.isArray(children) && children.every(reactExports.isValidElement); 2859 const getAsArray = (data) => Array.isArray(data) ? data : [data]; 2860 const mergeProps$1 = (source, target) => { 2861 const newTarget = __spreadValues({}, target); 2862 newTarget.props = Object.assign(source.props, target.props); 2863 return newTarget; 2864 }; 2865 const getValuesFromChildren = (children) => { 2866 const values = {}; 2867 if (!children) return values; 2868 const getData = (childs) => { 2869 const childrenArray = getAsArray(childs); 2870 childrenArray.forEach((child) => { 2871 if (isString$3(child)) return; 2872 if (hasChildren(child)) getData(getChildren(child)); 2873 else if (isObject$5(child) && !reactExports.isValidElement(child)) Object.assign(values, child); 2874 }); 2875 }; 2876 getData(children); 2877 return values; 2878 }; 2879 const nodesToString = (children, i18nOptions, i18n, i18nKey) => { 2880 var _a; 2881 if (!children) return ""; 2882 let stringNode = ""; 2883 const childrenArray = getAsArray(children); 2884 const keepArray = (i18nOptions == null ? void 0 : i18nOptions.transSupportBasicHtmlNodes) ? (_a = i18nOptions.transKeepBasicHtmlNodesFor) != null ? _a : [] : []; 2885 childrenArray.forEach((child, childIndex) => { 2886 if (isString$3(child)) { 2887 stringNode += `${child}`; 2888 return; 2889 } 2890 if (reactExports.isValidElement(child)) { 2891 const { 2892 props, 2893 type 2894 } = child; 2895 const childPropsCount = Object.keys(props).length; 2896 const shouldKeepChild = keepArray.indexOf(type) > -1; 2897 const childChildren = props.children; 2898 if (!childChildren && shouldKeepChild && !childPropsCount) { 2899 stringNode += `<${type}/>`; 2900 return; 2901 } 2902 if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) { 2903 stringNode += `<${childIndex}></${childIndex}>`; 2904 return; 2905 } 2906 if (shouldKeepChild && childPropsCount === 1 && isString$3(childChildren)) { 2907 stringNode += `<${type}>${childChildren}</${type}>`; 2908 return; 2909 } 2910 const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey); 2911 stringNode += `<${childIndex}>${content}</${childIndex}>`; 2912 return; 2913 } 2914 if (child === null) { 2915 warn$2(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, { 2916 i18nKey 2917 }); 2918 return; 2919 } 2920 if (isObject$5(child)) { 2921 const _a2 = child, { 2922 format 2923 } = _a2, clone2 = __objRest(_a2, [ 2924 "format" 2925 ]); 2926 const keys2 = Object.keys(clone2); 2927 if (keys2.length === 1) { 2928 const value = format ? `${keys2[0]}, ${format}` : keys2[0]; 2929 stringNode += `{{${value}}}`; 2930 return; 2931 } 2932 warn$2(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, { 2933 i18nKey, 2934 child 2935 }); 2936 return; 2937 } 2938 warn$2(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, { 2939 i18nKey, 2940 child 2941 }); 2942 }); 2943 return stringNode; 2944 }; 2945 const escapeLiteralLessThan = (str, keepArray = [], knownComponentsMap = {}) => { 2946 if (!str) return str; 2947 const knownNames = Object.keys(knownComponentsMap); 2948 const allValidNames = [...keepArray, ...knownNames]; 2949 let result = ""; 2950 let i2 = 0; 2951 while (i2 < str.length) { 2952 if (str[i2] === "<") { 2953 let isValidTag = false;
2954 const closingMatch = str.slice(i2).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/); 2955 if (closingMatch) { 2956 const tagName = closingMatch[1]; 2957 if (/^\d+$/.test(tagName) || allValidNames.includes(tagName)) { 2958 isValidTag = true; 2959 result += closingMatch[0]; 2960 i2 += closingMatch[0].length; 2961 } 2962 } 2963 if (!isValidTag) { 2964 const openingMatch = str.slice(i2).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/); 2965 if (openingMatch) { 2966 const tagName = openingMatch[1]; 2967 if (/^\d+$/.test(tagName) || allValidNames.includes(tagName)) { 2968 isValidTag = true; 2969 result += openingMatch[0]; 2970 i2 += openingMatch[0].length; 2971 } 2972 } 2973 } 2974 if (!isValidTag) { 2975 result += "<"; 2976 i2 += 1; 2977 } 2978 } else { 2979 result += str[i2]; 2980 i2 += 1; 2981 } 2982 } 2983 return result; 2984 }; 2985 const renderNodes = (children, knownComponentsMap, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => { 2986 if (targetString === "") return []; 2987 const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || []; 2988 const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map((keep) => `<${keep}
2988`).join("|")).test(targetString); 2989 if (!children && !knownComponentsMap && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString]; 2990 const data = knownComponentsMap != null ? knownComponentsMap : {}; 2991 const getData = (childs) => { 2992 const childrenArray = getAsArray(childs); 2993 childrenArray.forEach((child) => { 2994 if (isString$3(child)) return; 2995 if (hasChildren(child)) getData(getChildren(child)); 2996 else if (isObject$5(child) && !reactExports.isValidElement(child)) Object.assign(data, child); 2997 }); 2998 }; 2999 getData(children); 3000 const escapedString = escapeLiteralLessThan(targetString, keepArray, data); 3001 const ast = c$5.parse(`<0>${escapedString}</0>`); 3002 const opts = __spreadValues(__spreadValues({}, data), combinedTOpts); 3003 const renderInner = (child, node2, rootReactNode) => { 3004 var _a; 3005 const childs = getChildren(child); 3006 const mappedChildren = mapAST(childs, node2.children, rootReactNode); 3007 return hasValidReactChildren(childs) && mappedChildren.length === 0 || ((_a = child.props) == null ? void 0 : _a.i18nIsDynamicList) ? childs : mappedChildren; 3008 }; 3009 const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => { 3010 if (child.dummy) { 3011 child.children = inner; 3012 mem.push(reactExports.cloneElement(child, { 3013 key: i2 3014 }, isVoid ? void 0 : inner)); 3015 } else { 3016 mem.push(...reactExports.Children.map([child], (c2) => { 3017 const INTERNAL_DYNAMIC_MARKER = "data-i18n-is-dynamic-list"; 3018 const override = { 3019 key: i2, 3020 [INTERNAL_DYNAMIC_MARKER]: void 0 3021 }; 3022 if (c2 && c2.props) { 3023 Object.keys(c2.props).forEach((k2) => { 3024 if (k2 === "ref" || k2 === "children" || k2 === "i18nIsDynamicList" || k2 === INTERNAL_DYNAMIC_MARKER) return; 3025 override[k2] = c2.props[k2]; 3026 }); 3027 } 3028 return reactExports.cloneElement(c2, override, isVoid ? null : inner); 3029 })); 3030 } 3031 }; 3032 const mapAST = (reactNode, astNode, rootReactNode) => { 3033 const reactNodes = getAsArray(reactNode); 3034 const astNodes = getAsArray(astNode); 3035 return astNodes.reduce((mem, node2, i2) => { 3036 var _a, _b; 3037 const translationContent = ((_b = (_a = node2.children) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) && i18n.services.interpolator.interpolate(node2.children[0].content, opts, i18n.language); 3038 if (node2.type === "tag") { 3039 let tmp = reactNodes[parseInt(node2.name, 10)]; 3040 if (!tmp && knownComponentsMap) tmp = knownComponentsMap[node2.name]; 3041 if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node2.name]; 3042 if (!tmp) tmp = {}; 3043 const props = __spreadValues({}, node2.attrs); 3044 if (shouldUnescape) { 3045 Object.keys(props).forEach((p2) => { 3046 const val = props[p2]; 3047 if (isString$3(val)) { 3048 props[p2] = unescape$1(val); 3049 } 3050 }); 3051 } 3052 const child = Object.keys(props).length !== 0 ? mergeProps$1({ 3053 props 3054 }, tmp) : tmp; 3055 const isElement2 = reactExports.isValidElement(child); 3056 const isValidTranslationWithChildren = isElement2 && hasChildren(node2, true) && !node2.voidElement; 3057 const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject$5(child) && child.dummy && !isElement2; 3058 const isKnownComponent = isObject$5(knownComponentsMap) && Object.hasOwnProperty.call(knownComponentsMap, node2.name); 3059 if (isString$3(child)) { 3060 const value = i18n.services.interpolator.interpolate(child, opts, i18n.language); 3061 mem.push(value); 3062 } else if (hasChildren(child) || isValidTranslationWithChildren) { 3063 const inner = renderInner(child, node2, rootReactNode); 3064 pushTranslatedJSX(child, inner, mem, i2); 3065 } else if (isEmptyTransWithHTML) { 3066 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3067 pushTranslatedJSX(child, inner, mem, i2); 3068 } else if (Number.isNaN(parseFloat(node2.name))) { 3069 if (isKnownComponent) { 3070 const inner = renderInner(child, node2, rootReactNode); 3071 pushTranslatedJSX(child, inner, mem, i2, node2.voidElement); 3072 } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node2.name) > -1) { 3073 if (node2.voidElement) { 3074 mem.push(reactExports.createElement(node2.name, { 3075 key: `${node2.name}-${i2}` 3076 })); 3077 } else { 3078 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3079 mem.push(reactExports.createElement(node2.name, { 3080 key: `${node2.name}-${i2}` 3081 }, inner)); 3082 } 3083 } else if (node2.voidElement) { 3084 mem.push(`<${node2.name} />`); 3085 } else { 3086 const inner = mapAST(reactNodes, node2.children, rootReactNode); 3087 mem.push(`<${node2.name}>${inner}</${node2.name}>`); 3088 } 3089 } else if (isObject$5(child) && !isElement2) { 3090 const content = node2.children[0] ? translationContent : null; 3091 if (content) mem.push(content); 3092 } else { 3093 pushTranslatedJSX(child, translationContent, mem, i2, node2.children.length !== 1 || !translationContent); 3094 } 3095 } else if (node2.type === "text") { 3096 const wrapTextNodes = i18nOptions.transWrapTextNodes; 3097 const unescapeFn = typeof i18nOptions.unescape === "function" ? i18nOptions.unescape : getDefaults().unescape;
3098 const content = shouldUnescape ? unescapeFn(i18n.services.interpolator.interpolate(node2.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node2.content, opts, i18n.language); 3099 if (wrapTextNodes) { 3100 mem.push(reactExports.createElement(wrapTextNodes, { 3101 key: `${node2.name}-${i2}` 3102 }, content)); 3103 } else { 3104 mem.push(content); 3105 } 3106 } 3107 return mem; 3108 }, []); 3109 }; 3110 const result = mapAST([{ 3111 dummy: true, 3112 children: children || [] 3113 }], ast, getAsArray(children || [])); 3114 return getChildren(result[0]); 3115 }; 3116 const fixComponentProps = (component, index2, translation) => { 3117 const componentKey = component.key || index2; 3118 const comp = reactExports.cloneElement(component, { 3119 key: componentKey 3120 }); 3121 if (!comp.props || !comp.props.children || translation.indexOf(`${index2}/>`) < 0 && translation.indexOf(`${index2} />`) < 0) { 3122 return comp; 3123 } 3124 function Componentized() { 3125 return reactExports.createElement(reactExports.Fragment, null, comp); 3126 } 3127 return reactExports.createElement(Componentized, { 3128 key: componentKey 3129 }); 3130 }; 3131 const generateArrayComponents = (components2, translation) => components2.map((c2, index2) => fixComponentProps(c2, index2, translation)); 3132 const generateObjectComponents = (components2, translation) => { 3133 const componentMap = {}; 3134 Object.keys(components2).forEach((c2) => { 3135 Object.assign(componentMap, { 3136 [c2]: fixComponentProps(components2[c2], c2, translation) 3137 }); 3138 }); 3139 return componentMap; 3140 }; 3141 const generateComponents = (components2, translation, i18n, i18nKey) => { 3142 if (!components2) return null; 3143 if (Array.isArray(components2)) { 3144 return generateArrayComponents(components2, translation); 3145 } 3146 if (isObject$5(components2)) { 3147 return generateObjectComponents(components2, translation); 3148 } 3149 warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, { 3150 i18nKey 3151 }); 3152 return null; 3153 }; 3154 const isComponentsMap = (object2) => { 3155 if (!isObject$5(object2)) return false; 3156 if (Array.isArray(object2)) return false; 3157 return Object.keys(object2).reduce((acc, key) => acc && Number.isNaN(Number.parseFloat(key)), true); 3158 }; 3159 function Trans$1(_a) { 3160 var _b = _a, { 3161 children, 3162 count: count2, 3163 parent, 3164 i18nKey, 3165 context, 3166 tOptions = {}, 3167 values, 3168 defaults: defaults2, 3169 components: components2, 3170 ns, 3171 i18n: i18nFromProps, 3172 t: tFromProps, 3173 shouldUnescape 3174 } = _b, additionalProps = __objRest(_b, [ 3175 "children", 3176 "count", 3177 "parent", 3178 "i18nKey", 3179 "context", 3180 "tOptions", 3181 "values", 3182 "defaults", 3183 "components", 3184 "ns", 3185 "i18n", 3186 "t", 3187 "shouldUnescape" 3188 ]); 3189 var _a2, _b2, _c, _d, _e2, _f; 3190 const i18n = i18nFromProps || getI18n(); 3191 if (!i18n) { 3192 warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, { 3193 i18nKey 3194 }); 3195 return children; 3196 } 3197 const t2 = tFromProps || i18n.t.bind(i18n) || ((k2) => k2); 3198 const reactI18nextOptions = __spreadValues(__spreadValues({}, getDefaults()), (_a2 = i18n.options) == null ? void 0 : _a2.react); 3199 let namespaces = ns || t2.ns || ((_b2 = i18n.options) == null ? void 0 : _b2.defaultNS); 3200 namespaces = isString$3(namespaces) ? [namespaces] : namespaces || ["translation"]; 3201 const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey); 3202 const defaultValue = defaults2 || (tOptions == null ? void 0 : tOptions.defaultValue) || nodeAsString || reactI18nextOptions.transEmptyNodeValue || (typeof i18nKey === "function" ? keysFromSelector(i18nKey) : i18nKey); 3203 const { 3204 hashTransKey 3205 }
3205 = reactI18nextOptions; 3206 const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue); 3207 if ((_d = (_c = i18n.options) == null ? void 0 : _c.interpolation) == null ? void 0 : _d.defaultVariables) { 3208 values = values && Object.keys(values).length > 0 ? __spreadValues(__spreadValues({}, values), i18n.options.interpolation.defaultVariables) : __spreadValues({}, i18n.options.interpolation.defaultVariables); 3209 } 3210 const valuesFromChildren = getValuesFromChildren(children); 3211 if (valuesFromChildren && typeof valuesFromChildren.count === "number" && count2 === void 0) { 3212 count2 = valuesFromChildren.count; 3213 } 3214 const interpolationOverride = values || count2 !== void 0 && !((_f = (_e2 = i18n.options) == null ? void 0 : _e2.interpolation) == null ? void 0 : _f.alwaysFormat) || !children ? tOptions.interpolation : { 3215 interpolation: __spreadProps(__spreadValues({}, tOptions.interpolation), { 3216 prefix: "#$?", 3217 suffix: "?$#" 3218 }) 3219 }; 3220 const combinedTOpts = __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, tOptions), { 3221 context: context || tOptions.context, 3222 count: count2 3223 }), values), interpolationOverride), { 3224 defaultValue, 3225 ns: namespaces 3226 }); 3227 let translation = key ? t2(key, combinedTOpts) : defaultValue; 3228 if (translation === key && defaultValue) translation = defaultValue; 3229 const generatedComponents = generateComponents(components2, translation, i18n, i18nKey); 3230 let indexedChildren = generatedComponents || children; 3231 let componentsMap = null; 3232 if (isComponentsMap(generatedComponents)) { 3233 componentsMap = generatedComponents; 3234 indexedChildren = children; 3235 } 3236 const content = renderNodes(indexedChildren, componentsMap, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape); 3237 const useAsParent = parent != null ? parent : reactI18nextOptions.defaultTransParent; 3238 return useAsParent ? reactExports.createElement(useAsParent, additionalProps, content) : content; 3239 } 3240 const initReactI18next = { 3241 type: "3rdParty", 3242 init(instance2) { 3243 setDefaults(instance2.options.react); 3244 setI18n(instance2); 3245 } 3246 }; 3247 const I18nContext = reactExports.createContext(); 3248 class ReportNamespaces { 3249 constructor() { 3250 this.usedNamespaces = {}; 3251 } 3252 addUsedNamespaces(namespaces) { 3253 namespaces.forEach((ns) => { 3254 if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true; 3255 }); 3256 } 3257 getUsedNamespaces() { 3258 return Object.keys(this.usedNamespaces); 3259 } 3260 } 3261 function Trans(_c) { 3262 var _d = _c, { 3263 children, 3264 count: count2, 3265 parent, 3266 i18nKey, 3267 context, 3268 tOptions = {}, 3269 values, 3270 defaults: defaults2, 3271 components: components2, 3272 ns, 3273 i18n: i18nFromProps, 3274 t: tFromProps, 3275 shouldUnescape 3276 } = _d, additionalProps = __objRest(_d, [ 3277 "children", 3278 "count", 3279 "parent", 3280 "i18nKey", 3281 "context", 3282 "tOptions", 3283 "values", 3284 "defaults", 3285 "components", 3286 "ns", 3287 "i18n", 3288 "t", 3289 "shouldUnescape" 3290 ]); 3291 var _a; 3292 const { 3293 i18n: i18nFromContext, 3294 defaultNS: defaultNSFromContext 3295 } = reactExports.useContext(I18nContext) || {}; 3296 const i18n = i18nFromProps || i18nFromContext || getI18n(); 3297 const t2 = tFromProps || (i18n == null ? void 0 : i18n.t.bind(i18n)); 3298 return Trans$1(__spreadValues({ 3299 children, 3300 count: count2, 3301 parent, 3302 i18nKey, 3303 context, 3304 tOptions, 3305 values, 3306 defaults: defaults2, 3307 components: components2, 3308 ns: ns || (t2 == null ? void 0 : t2.ns) || defaultNSFromContext || ((_a = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a.defaultNS), 3309 i18n, 3310 t: tFromProps, 3311 shouldUnescape 3312 }, additionalProps)); 3313 } 3314 var shim = { exports: {} }; 3315 var useSyncExternalStoreShim_production = {}; 3316 /** 3317 * @license React 3318 * use-sync-external-store-shim.production.js 3319 * 3320 * Copyright (c) Meta Platforms, Inc. and affiliates. 3321 * 3322 * This source code is licensed under the MIT license found in the 3323 * LICENSE file in the root directory of this source tree. 3324 */ 3325 var hasRequiredUseSyncExternalStoreShim_production; 3326 function requireUseSyncExternalStoreShim_production() { 3327 if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production; 3328 hasRequiredUseSyncExternalStoreShim_production = 1; 3329 var React2 = requireReact(); 3330 function is(x2, y2) { 3331 return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; 3332 } 3333 var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React2.useState, useEffect = React2.useEffect, useLayoutEffect = React2.useLayoutEffect, useDebugValue = React2.useDebugValue; 3334 function useSyncExternalStore$2(subscribe, getSnapshot) { 3335 var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1]; 3336 useLayoutEffect( 3337 function() { 3338 inst.value = value; 3339 inst.getSnapshot = getSnapshot;
3340 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3341 }, 3342 [subscribe, value, getSnapshot] 3343 ); 3344 useEffect( 3345 function() { 3346 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3347 return subscribe(function() { 3348 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 3349 }); 3350 }, 3351 [subscribe] 3352 ); 3353 useDebugValue(value); 3354 return value; 3355 } 3356 function checkIfSnapshotChanged(inst) { 3357 var latestGetSnapshot = inst.getSnapshot; 3358 inst = inst.value; 3359 try { 3360 var nextValue = latestGetSnapshot(); 3361 return !objectIs(inst, nextValue); 3362 } catch (error) { 3363 return true; 3364 } 3365 } 3366 function useSyncExternalStore$1(subscribe, getSnapshot) { 3367 return getSnapshot(); 3368 } 3369 var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 3370 useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim2; 3371 return useSyncExternalStoreShim_production; 3372 } 3373 var hasRequiredShim; 3374 function requireShim() { 3375 if (hasRequiredShim) return shim.exports; 3376 hasRequiredShim = 1; 3377 { 3378 shim.exports = requireUseSyncExternalStoreShim_production(); 3379 } 3380 return shim.exports; 3381 } 3382 var shimExports = requireShim(); 3383 const notReadyT = (k2, optsOrDefaultValue) => { 3384 if (isString$3(optsOrDefaultValue)) return optsOrDefaultValue; 3385 if (isObject$5(optsOrDefaultValue) && isString$3(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue; 3386 return Array.isArray(k2) ? k2[k2.length - 1] : k2; 3387 }; 3388 const notReadySnapshot = { 3389 t: notReadyT, 3390 ready: false 3391 }; 3392 const dummySubscribe = () => () => { 3393 }; 3394 const useTranslation = (ns, props = {}) => { 3395 var _a, _b, _c; 3396 const { 3397 i18n: i18nFromProps 3398 } = props; 3399 const { 3400 i18n: i18nFromContext, 3401 defaultNS: defaultNSFromContext 3402 } = reactExports.useContext(I18nContext) || {}; 3403 const i18n = i18nFromProps || i18nFromContext || getI18n(); 3404 if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces(); 3405 if (!i18n) { 3406 warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next"); 3407 } 3408 const i18nOptions = reactExports.useMemo(() => { 3409 var _a2; 3410 return __spreadValues(__spreadValues(__spreadValues({}, getDefaults()), (_a2 = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a2.react), props); 3411 }, [i18n, props]); 3412 const { 3413 useSuspense, 3414 keyPrefix 3415 } = i18nOptions; 3416 const nsOrContext = ns || defaultNSFromContext || ((_a = i18n == null ? void 0 : i18n.options) == null ? void 0 : _a.defaultNS); 3417 const unstableNamespaces = isString$3(nsOrContext) ? [nsOrContext] : nsOrContext || ["translation"]; 3418 const namespaces = reactExports.useMemo(() => unstableNamespaces, unstableNamespaces); 3419 (_c = (_b = i18n == null ? void 0 : i18n.reportNamespaces) == null ? void 0 : _b.addUsedNamespaces) == null ? void 0 : _c.call(_b, namespaces); 3420 const revisionRef = reactExports.useRef(0); 3421 const subscribe = reactExports.useCallback((callback) => { 3422 if (!i18n) return dummySubscribe; 3423 const { 3424 bindI18n, 3425 bindI18nStore 3426 } = i18nOptions; 3427 const wrappedCallback = () => { 3428 revisionRef.current += 1; 3429 callback(); 3430 }; 3431 if (bindI18n) i18n.on(bindI18n, wrappedCallback); 3432 if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback); 3433 return () => { 3434 if (bindI18n) bindI18n.split(" ").forEach((e2) => i18n.off(e2, wrappedCallback)); 3435 if (bindI18nStore) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, wrappedCallback)); 3436 }; 3437 }, [i18n, i18nOptions]); 3438 const snapshotRef = reactExports.useRef(); 3439 const getSnapshot = reactExports.useCallback(() => { 3440 if (!i18n) { 3441 return notReadySnapshot; 3442 } 3443 const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions)); 3444 const currentLng = props.lng || i18n.language; 3445 const currentRevision = revisionRef.current; 3446 const lastSnapshot = snapshotRef.current; 3447 if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) { 3448 return lastSnapshot; 3449 } 3450 const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
3451 const newSnapshot = { 3452 t: calculatedT, 3453 ready: calculatedReady, 3454 lng: currentLng, 3455 keyPrefix, 3456 revision: currentRevision 3457 }; 3458 snapshotRef.current = newSnapshot; 3459 return newSnapshot; 3460 }, [i18n, namespaces, keyPrefix, i18nOptions, props.lng]); 3461 const [loadCount, setLoadCount] = reactExports.useState(0); 3462 const { 3463 t: t2, 3464 ready 3465 } = shimExports.useSyncExternalStore(subscribe, getSnapshot, getSnapshot); 3466 reactExports.useEffect(() => { 3467 if (i18n && !ready && !useSuspense) { 3468 const onLoaded = () => setLoadCount((c2) => c2 + 1); 3469 if (props.lng) { 3470 loadLanguages(i18n, props.lng, namespaces, onLoaded); 3471 } else { 3472 loadNamespaces(i18n, namespaces, onLoaded); 3473 } 3474 } 3475 }, [i18n, props.lng, namespaces, ready, useSuspense, loadCount]); 3476 const finalI18n = i18n || {}; 3477 const wrapperRef = reactExports.useRef(null); 3478 const wrapperLangRef = reactExports.useRef(); 3479 const createI18nWrapper = (original) => { 3480 const descriptors2 = Object.getOwnPropertyDescriptors(original); 3481 if (descriptors2.__original) delete descriptors2.__original; 3482 const wrapper = Object.create(Object.getPrototypeOf(original), descriptors2); 3483 if (!Object.prototype.hasOwnProperty.call(wrapper, "__original")) { 3484 try { 3485 Object.defineProperty(wrapper, "__original", { 3486 value: original, 3487 writable: false, 3488 enumerable: false, 3489 configurable: false 3490 }); 3491 } catch (_2) { 3492 } 3493 } 3494 return wrapper; 3495 }; 3496 const ret = reactExports.useMemo(() => { 3497 const original = finalI18n; 3498 const lang = original == null ? void 0 : original.language; 3499 let i18nWrapper = original; 3500 if (original) { 3501 if (wrapperRef.current && wrapperRef.current.__original === original) { 3502 if (wrapperLangRef.current !== lang) { 3503 i18nWrapper = createI18nWrapper(original); 3504 wrapperRef.current = i18nWrapper; 3505 wrapperLangRef.current = lang; 3506 } else { 3507 i18nWrapper = wrapperRef.current; 3508 } 3509 } else { 3510 i18nWrapper = createI18nWrapper(original); 3511 wrapperRef.current = i18nWrapper; 3512 wrapperLangRef.current = lang; 3513 } 3514 } 3515 const arr = [t2, i18nWrapper, ready]; 3516 arr.t = t2; 3517 arr.i18n = i18nWrapper; 3518 arr.ready = ready; 3519 return arr; 3520 }, [t2, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages]); 3521 if (i18n && useSuspense && !ready) { 3522 throw new Promise((resolve) => { 3523 const onLoaded = () => resolve(); 3524 if (props.lng) { 3525 loadLanguages(i18n, props.lng, namespaces, onLoaded); 3526 } else { 3527 loadNamespaces(i18n, namespaces, onLoaded); 3528 } 3529 }); 3530 } 3531 return ret; 3532 }; 3533 const components = { "layout": { "logo_title": "Back to store", "back_label": "Back" } }; 3534 const modules = { "contact": { "page_title": "Contact", "meta_description": "Contact {{shopName}} for help with an order you placed or any other question." }, "orderDetails": { "title": "Help with selected items" }, "orderLogin": { "title": "What can we help with?", "primary_tab_button_label": "Order I placed", "secondary_tab_button_label": "Something else", "instructions": "Please enter your order number and the email you used to place your order:", "friendly_id_label": "Your order number", "friendly_id_suggestion": "I canât find my order number", "friendly_id_required_error": "Order number is required", "friendly_id_invalid_error": "Order number is invalid", "email_label": "Email used when placing the order", "email_required_error": "Email is required", "email_invalid_error": "Email is invalid", "submit_label": "Continue", "invalid_order_error": "Invalid order number and/or email address", "order_number_suggestion_modal_title": "Can't find your order number?", "order_number_suggestion_modal_paragraph_1": 'Check your Inbox, Spam or Promotions folders. Look for an email with the subject: <strong>"Your order #... is confirmed"</strong>', "order_number_suggestion_modal_paragraph_2": "Your order number is the 8-digit code (e.g., #B2A99TF9) foun
3534d in that subject line or at the top of the message.", "order_number_suggestion_modal_support_button": "I still can't find it, let me talk to support", "order_number_suggestion_modal_close_button": "Close" }, "orderVariants": { "title": "Contact support", "primary_tab_button_label": "Help with selected items", "secondary_tab_button_label": "Something else", "submit_label_empty": "Select items you need help with", "submit_label": "Continue", "shipment_subheader": "Shipment {{current}} of {{total}}", "digital_shipment_title": "Digital files", "gift_cards_shipment_title": "Gift cards", "download_limit_exceeded_error": "Download limit has been exceeded and download is no longer available.", "download_expired_error": "This product was cancelled and download is no longer available.", "download_pending_info": "Your download is still being prepared. We will email you when it's ready", "view_gift_card": "View gift card", "digital_refund_banner": "Digital products cannot be refunded once downloaded.", "components": { "shipmentCarrier": { "shipped_via": "Shipped via {{carrier}}", "track_shipment": "Track shipment" }, "shipmentTitle": { "status_delivered_on": "Delivered on ", "status_estimated_delivery": "Estimated delivery ", "status_shipped_on": "Shipped on ", "status_arrives_on": "Arrives on ", "status_arrives": "Arrives ", "status_order_placed": "Order placed" }, "timelineEvents": { "order_placed": "Placed", "label_created": "Shipped", "delivered": "Delivered" } } }, "reportForm": { "email_label": "Your email address", "email_required_error": "Email is required", "email_invalid_error": "Email is invalid", "full_name_label": "Your name", "full_name_required_error": "Your name is required", "topic_label": "Select topic", "topic_required_error": "Please select a topic", "sub_topic_label": "Provide more context", "sub_topic_required_error": "Please select a topic", "message_label": "Add message", "message_required_error": "Message is required", "message_min_length_error": "Message must be at least {{count}} characters", "submit_label": "Submit message", "submit_error": "Something went wrong. Please try again or contact us at <emailLink />.", "submit_error_no_email": "Something went wrong. Please try again later.", "attachments": { "add_button_label": "Upload attachment (optional)", "remove_file_label": "Remove file" } }, "somethingElse": { "order_placed_title": "Contact support", "title": "What can we help with?", "order_placed_primary_tab_button_label": "Help with selected items", "primary_tab_button_label": "Order I placed", "secondary_tab_button_label": "Something else" }, "success": { "title": "Thank you for contacting us", "subtitle": "Weâre reviewing your email and will get back to you as soon as possible! You can expect a response within 2 to 3 business days.", "back_label": "Go to homepage" } }; 3535 const en$1 = { 3536 components, 3537 modules 3538 }; 3539 const defaultNS = "translation"; 3540 instance.use(initReactI18next).init({ 3541 debug: true, 3542 fallbackLng: "en", 3543 defaultNS, 3544 resources: { 3545 en: __spreadValues({}, en$1) 3546 } 3547 }); 3548 var client = {}; 3549 var reactDom = { exports: {} }; 3550 var reactDom_production_min = {}; 3551 var scheduler = { exports: {} }; 3552 var scheduler_production_min = {}; 3553 /** 3554 * @license React 3555 * scheduler.production.min.js 3556 * 3557 * Copyright (c) Facebook, Inc. and its affiliates. 3558 * 3559 * This source code is licensed under the MIT license found in the 3560 * LICENSE file in the root directory of this source tree. 3561 */ 3562 var hasRequiredScheduler_production_min; 3563 function requireScheduler_production_min() { 3564 if (hasRequiredScheduler_production_min) return scheduler_production_min; 3565 hasRequiredScheduler_production_min = 1; 3566 (function(exports$1) { 3567 function f2(a2, b2) { 3568 var c2 = a2.length; 3569 a2.push(b2); 3570 a: for (; 0 < c2; ) { 3571 var d2 = c2 - 1 >>> 1, e2 = a2[d2]; 3572 if (0 < g2(e2, b2)) a2[d2] = b2, a2[c2] = e2, c2 = d2; 3573 else break a; 3574 } 3575 } 3576 function h2(a2) { 3577 return 0 === a2.length ? null : a2[0]; 3578 } 3579 function k2(a2) { 3580 if (0 === a2.length) return null; 3581 var b2 = a2[0], c2 = a2.pop(); 3582 if (c2 !== b2) { 3583 a2[0] = c2; 3584 a: for (var d2 = 0, e2 = a2.length, w2 = e2 >>> 1; d2 < w2; ) { 3585 var m2 = 2 * (d2 + 1) - 1, C2 = a2[m2], n2 = m2 + 1, x2 = a2[n2]; 3586 if (0 > g2(C2, c2)) n2 < e2 && 0 > g2(x2, C2) ? (a2[d2] = x2, a2[n2] = c2, d2 = n2) : (a2[d2] = C2, a2[m2] = c2, d2 = m2); 3587 else if (n2 < e2 && 0 > g2(x2, c2)) a2[d2] = x2, a2[n2] = c2, d2 = n2; 3588 else break a; 3589 } 3590 } 3591 return b2; 3592 } 3593 function g2(a2, b2) { 3594 var c2 = a2.sortIndex - b2.sortIndex; 3595 return 0 !== c2 ? c2 : a2.id - b2.id; 3596 } 3597 if ("object" === typeof performance && "function" === typeof performance.now) { 3598 var l2 = performance; 3599 exports$1.unstable_now = function() { 3600 return l2.now(); 3601 }; 3602 } else { 3603 var p2 = Date, q2 = p2.now(); 3604 exports$1.unstable_now = function() { 3605 return p2.now() - q2; 3606 }; 3607 } 3608 var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = false, A2 = false, B2 = false, D2 = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F2 = "undefined" !== typeof setImmediate ? setImmediate : null; 3609 "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); 3610 function G2(a2) { 3611 for (var b2 = h2(t2); null !== b2; ) { 3612 if (null === b2.callback) k2(t2); 3613 else if (b2.startTime <= a2) k2(t2), b2.sortIndex = b2.expirationTime, f2(r2, b2); 3614 else break; 3615 b2 = h2(t2); 3616 } 3617 } 3618 function H2(a2) { 3619 B2 = false;
vendor: 48,826 bytes, lines 3620-4965
3620 G2(a2); 3621 if (!A2) if (null !== h2(r2)) A2 = true, I2(J2); 3622 else { 3623 var b2 = h2(t2); 3624 null !== b2 && K2(H2, b2.startTime - a2); 3625 } 3626 } 3627 function J2(a2, b2) { 3628 A2 = false; 3629 B2 && (B2 = false, E2(L2), L2 = -1); 3630 z2 = true; 3631 var c2 = y2; 3632 try { 3633 G2(b2); 3634 for (v2 = h2(r2); null !== v2 && (!(v2.expirationTime > b2) || a2 && !M2()); ) { 3635 var d2 = v2.callback; 3636 if ("function" === typeof d2) { 3637 v2.callback = null; 3638 y2 = v2.priorityLevel; 3639 var e2 = d2(v2.expirationTime <= b2); 3640 b2 = exports$1.unstable_now(); 3641 "function" === typeof e2 ? v2.callback = e2 : v2 === h2(r2) && k2(r2); 3642 G2(b2); 3643 } else k2(r2); 3644 v2 = h2(r2); 3645 } 3646 if (null !== v2) var w2 = true; 3647 else { 3648 var m2 = h2(t2); 3649 null !== m2 && K2(H2, m2.startTime - b2); 3650 w2 = false; 3651 } 3652 return w2; 3653 } finally { 3654 v2 = null, y2 = c2, z2 = false; 3655 } 3656 } 3657 var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1; 3658 function M2() { 3659 return exports$1.unstable_now() - Q2 < P2 ? false : true; 3660 } 3661 function R2() { 3662 if (null !== O2) { 3663 var a2 = exports$1.unstable_now(); 3664 Q2 = a2; 3665 var b2 = true; 3666 try { 3667 b2 = O2(true, a2); 3668 } finally { 3669 b2 ? S2() : (N2 = false, O2 = null); 3670 } 3671 } else N2 = false; 3672 } 3673 var S2; 3674 if ("function" === typeof F2) S2 = function() { 3675 F2(R2); 3676 }; 3677 else if ("undefined" !== typeof MessageChannel) { 3678 var T2 = new MessageChannel(), U2 = T2.port2; 3679 T2.port1.onmessage = R2; 3680 S2 = function() { 3681 U2.postMessage(null); 3682 }; 3683 } else S2 = function() { 3684 D2(R2, 0); 3685 }; 3686 function I2(a2) { 3687 O2 = a2; 3688 N2 || (N2 = true, S2()); 3689 } 3690 function K2(a2, b2) { 3691 L2 = D2(function() { 3692 a2(exports$1.unstable_now()); 3693 }, b2); 3694 } 3695 exports$1.unstable_IdlePriority = 5; 3696 exports$1.unstable_ImmediatePriority = 1; 3697 exports$1.unstable_LowPriority = 4; 3698 exports$1.unstable_NormalPriority = 3; 3699 exports$1.unstable_Profiling = null; 3700 exports$1.unstable_UserBlockingPriority = 2; 3701 exports$1.unstable_cancelCallback = function(a2) { 3702 a2.callback = null; 3703 }; 3704 exports$1.unstable_continueExecution = function() { 3705 A2 || z2 || (A2 = true, I2(J2)); 3706 }; 3707 exports$1.unstable_forceFrameRate = function(a2) { 3708 0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a2 ? Math.floor(1e3 / a2) : 5; 3709 }; 3710 exports$1.unstable_getCurrentPriorityLevel = function() { 3711 return y2; 3712 }; 3713 exports$1.unstable_getFirstCallbackNode = function() { 3714 return h2(r2); 3715 }; 3716 exports$1.unstable_next = function(a2) { 3717 switch (y2) { 3718 case 1: 3719 case 2: 3720 case 3: 3721 var b2 = 3; 3722 break; 3723 default: 3724 b2 = y2; 3725 } 3726 var c2 = y2; 3727 y2 = b2; 3728 try { 3729 return a2(); 3730 } finally { 3731 y2 = c2; 3732 } 3733 }; 3734 exports$1.unstable_pauseExecution = function() { 3735 }; 3736 exports$1.unstable_requestPaint = function() { 3737 }; 3738 exports$1.unstable_runWithPriority = function(a2, b2) { 3739 switch (a2) { 3740 case 1: 3741 case 2: 3742 case 3: 3743 case 4: 3744 case 5: 3745 break; 3746 default: 3747 a2 = 3; 3748 } 3749 var c2 = y2; 3750 y2 = a2; 3751 try { 3752 return b2(); 3753 } finally { 3754 y2 = c2; 3755 } 3756 }; 3757 exports$1.unstable_scheduleCallback = function(a2, b2, c2) { 3758 var d2 = exports$1.unstable_now(); 3759 "object" === typeof c2 && null !== c2 ? (c2 = c2.delay, c2 = "number" === typeof c2 && 0 < c2 ? d2 + c2 : d2) : c2 = d2; 3760 switch (a2) { 3761 case 1: 3762 var e2 = -1; 3763 break; 3764 case 2: 3765 e2 = 250; 3766 break; 3767 case 5: 3768 e2 = 1073741823; 3769 break; 3770 case 4: 3771 e2 = 1e4; 3772 break; 3773 default: 3774 e2 = 5e3; 3775 } 3776 e2 = c2 + e2; 3777 a2 = { id: u2++, callback: b2, priorityLevel: a2, startTime: c2, expirationTime: e2, sortIndex: -1 }; 3778 c2 > d2 ? (a2.sortIndex = c2, f2(t2, a2), null === h2(r2) && a2 === h2(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c2 - d2))) : (a2.sortIndex = e2, f2(r2, a2), A2 || z2 || (A2 = true, I2(J2))); 3779 return a2; 3780 }; 3781 exports$1.unstable_shouldYield = M2; 3782 exports$1.unstable_wrapCallback = function(a2) { 3783 var b2 = y2; 3784 return function() { 3785 var c2 = y2; 3786 y2 = b2; 3787 try { 3788 return a2.apply(this, arguments); 3789 } finally { 3790 y2 = c2; 3791 } 3792 }; 3793 }; 3794 })(scheduler_production_min); 3795 return scheduler_production_min; 3796 } 3797 var hasRequiredScheduler; 3798 function requireScheduler() { 3799 if (hasRequiredScheduler) return scheduler.exports; 3800 hasRequiredScheduler = 1; 3801 { 3802 scheduler.exports = requireScheduler_production_min(); 3803 } 3804 return scheduler.exports; 3805 } 3806 /** 3807 * @license React 3808 * react-dom.production.min.js 3809 * 3810 * Copyright (c) Facebook, Inc. and its affiliates. 3811 * 3812 * This source code is licensed under the MIT license found in the 3813 * LICENSE file in the root directory of this source tree. 3814 */ 3815 var hasRequiredReactDom_production_min; 3816 function requireReactDom_production_min() { 3817 if (hasRequiredReactDom_production_min) return reactDom_production_min; 3818 hasRequiredReactDom_production_min = 1; 3819 var aa2 = requireReact(), ca2 = requireScheduler(); 3820 function p2(a2) { 3821 for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a2, c2 = 1; c2 < arguments.length; c2++) b2 += "&args[]=" + encodeURIComponent(arguments[c2]); 3822 return "Minified React error #" + a2 + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; 3823 } 3824 var da2 = /* @__PURE__ */ new Set(), ea2 = {}; 3825 function fa2(a2, b2) { 3826 ha2(a2, b2); 3827 ha2(a2 + "Capture", b2); 3828 } 3829 function ha2(a2, b2) { 3830 ea2[a2] = b2; 3831 for (a2 = 0; a2 < b2.length; a2++) da2.add(b2[a2]); 3832 } 3833 var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ja2 = Object.prototype.hasOwnProperty, ka2 = /^[: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]*$/, la2 = {}, ma2 = {}; 3834 function oa2(a2) { 3835 if (ja2.call(ma2, a2)) return true; 3836 if (ja2.call(la2, a2)) return false; 3837 if (ka2.test(a2)) return ma2[a2] = true; 3838 la2[a2] = true; 3839 return false; 3840 } 3841 function pa2(a2, b2, c2, d2) { 3842 if (null !== c2 && 0 === c2.type) return false; 3843 switch (typeof b2) { 3844 case "function": 3845 case "symbol": 3846 return true; 3847 case "boolean": 3848 if (d2) return false; 3849 if (null !== c2) return !c2.acceptsBooleans; 3850 a2 = a2.toLowerCase().slice(0, 5); 3851 return "data-" !== a2 && "aria-" !== a2; 3852 default: 3853 return false; 3854 } 3855 } 3856 function qa2(a2, b2, c2, d2) { 3857 if (null === b2 || "undefined" === typeof b2 || pa2(a2, b2, c2, d2)) return true; 3858 if (d2) return false; 3859 if (null !== c2) switch (c2.type) { 3860 case 3: 3861 return !b2; 3862 case 4: 3863 return false === b2; 3864 case 5: 3865 return isNaN(b2); 3866 case 6: 3867 return isNaN(b2) || 1 > b2; 3868 } 3869 return false; 3870 } 3871 function v2(a2, b2, c2, d2, e2, f2, g2) { 3872 this.acceptsBooleans = 2 === b2 || 3 === b2 || 4 === b2; 3873 this.attributeName = d2; 3874 this.attributeNamespace = e2; 3875 this.mustUseProperty = c2; 3876 this.propertyName = a2; 3877 this.type = b2; 3878 this.sanitizeURL = f2; 3879 this.removeEmptyString = g2; 3880 } 3881 var z2 = {}; 3882 "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a2) { 3883 z2[a2] = new v2(a2, 0, false, a2, null, false, false); 3884 }); 3885 [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a2) { 3886 var b2 = a2[0]; 3887 z2[b2] = new v2(b2, 1, false, a2[1], null, false, false); 3888 }); 3889 ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a2) { 3890 z2[a2] = new v2(a2, 2, false, a2.toLowerCase(), null, false, false); 3891 }); 3892 ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a2) { 3893 z2[a2] = new v2(a2, 2, false, a2, null, false, false); 3894 }); 3895 "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a2) { 3896 z2[a2] = new v2(a2, 3, false, a2.toLowerCase(), null, false, false); 3897 }); 3898 ["checked", "multiple", "muted", "selected"].forEach(function(a2) { 3899 z2[a2] = new v2(a2, 3, true, a2, null, false, false); 3900 }); 3901 ["capture", "download"].forEach(function(a2) { 3902 z2[a2] = new v2(a2, 4, false, a2, null, false, false); 3903 }); 3904 ["cols", "rows", "size", "span"].forEach(function(a2) { 3905 z2[a2] = new v2(a2, 6, false, a2, null, false, false); 3906 }); 3907 ["rowSpan", "start"].forEach(function(a2) { 3908 z2[a2] = new v2(a2, 5, false, a2.toLowerCase(), null, false, false); 3909 }); 3910 var ra2 = /[\-:]([a-z])/g; 3911 function sa2(a2) { 3912 return a2[1].toUpperCase(); 3913 } 3914 "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a2) { 3915 var b2 = a2.replace( 3916 ra2, 3917 sa2 3918 ); 3919 z2[b2] = new v2(b2, 1, false, a2, null, false, false); 3920 }); 3921 "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a2) { 3922 var b2 = a2.replace(ra2, sa2); 3923 z2[b2] = new v2(b2, 1, false, a2, "http://www.w3.org/1999/xlink", false, false); 3924 }); 3925 ["xml:base", "xml:lang", "xml:space"].forEach(function(a2) { 3926 var b2 = a2.replace(ra2, sa2); 3927 z2[b2] = new v2(b2, 1, false, a2, "http://www.w3.org/XML/1998/namespace", false, false); 3928 }); 3929 ["tabIndex", "crossOrigin"].forEach(function(a2) { 3930 z2[a2] = new v2(a2, 1, false, a2.toLowerCase(), null, false, false); 3931 }); 3932 z2.xlinkHref = new v2("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); 3933 ["src", "href", "action", "formAction"].forEach(function(a2) { 3934 z2[a2] = new v2(a2, 1, false, a2.toLowerCase(), null, true, true); 3935 }); 3936 function ta(a2, b2, c2, d2) { 3937 var e2 = z2.hasOwnProperty(b2) ? z2[b2] : null; 3938 if (null !== e2 ? 0 !== e2.type : d2 || !(2 < b2.length) || "o" !== b2[0] && "O" !== b2[0] || "n" !== b2[1] && "N" !== b2[1]) qa2(b2, c2, e2, d2) && (c2 = null), d2 || null === e2 ? oa2(b2) && (null === c2 ? a2.removeAttribute(b2) : a2.setAttribute(b2, "" + c2)) : e2.mustUseProperty ? a2[e2.propertyName] = null === c2 ? 3 === e2.type ? false : "" : c2 : (b2 = e2.attributeName, d2 = e2.attributeNamespace, null === c2 ? a2.removeAttribute(b2) : (e2 = e2.type, c2 = 3 === e2 || 4 === e2 && true === c2 ? "" : "" + c2, d2 ? a2.setAttributeNS(d2, b2, c2) : a2.setAttribute(b2, c2))); 3939 } 3940 var ua2 = aa2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va2 = Symbol.for("react.element"), wa2 = Symbol.for("react.portal"), ya2 = Symbol.for("react.fragment"), za2 = Symbol.for("react.strict_mode"), Aa2 = Symbol.for("react.profiler"), Ba2 = Symbol.for("react.provider"), Ca2 = Symbol.for("react.context"), Da2 = Symbol.for("react.forward_ref"), Ea2 = Symbol.for("react.suspense"), Fa2 = Symbol.for("react.suspense_list"), Ga2 = Symbol.for("react.memo"), Ha2 = Symbol.for("react.lazy"); 3941 var Ia2 = Symbol.for("react.offscreen"); 3942 var Ja2 = Symbol.iterator; 3943 function Ka2(a2) { 3944 if (null === a2 || "object" !== typeof a2) return null; 3945 a2 = Ja2 && a2[Ja2] || a2["@@iterator"]; 3946 return "function" === typeof a2 ? a2 : null; 3947 } 3948 var A2 = Object.assign, La2; 3949 function Ma2(a2) { 3950 if (void 0 === La2) try { 3951 throw Error(); 3952 } catch (c2) { 3953 var b2 = c2.stack.trim().match(/\n( *(at )?)/); 3954 La2 = b2 && b2[1] || ""; 3955 } 3956 return "\n" + La2 + a2; 3957 } 3958 var Na2 = false; 3959 function Oa2(a2, b2) { 3960 if (!a2 || Na2) return ""; 3961 Na2 = true; 3962 var c2 = Error.prepareStackTrace; 3963 Error.prepareStackTrace = void 0; 3964 try { 3965 if (b2) if (b2 = function() { 3966 throw Error(); 3967 }, Object.defineProperty(b2.prototype, "props", { set: function() { 3968 throw Error(); 3969 } }), "object" === typeof Reflect && Reflect.construct) { 3970 try { 3971 Reflect.construct(b2, []); 3972 } catch (l2) { 3973 var d2 = l2; 3974 } 3975 Reflect.construct(a2, [], b2); 3976 } else { 3977 try { 3978 b2.call(); 3979 } catch (l2) { 3980 d2 = l2; 3981 } 3982 a2.call(b2.prototype); 3983 } 3984 else { 3985 try { 3986 throw Error(); 3987 } catch (l2) { 3988 d2 = l2; 3989 } 3990 a2(); 3991 } 3992 } catch (l2) { 3993 if (l2 && d2 && "string" === typeof l2.stack) { 3994 for (var e2 = l2.stack.split("\n"), f2 = d2.stack.split("\n"), g2 = e2.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e2[g2] !== f2[h2]; ) h2--; 3995 for (; 1 <= g2 && 0 <= h2; g2--, h2--) if (e2[g2] !== f2[h2]) { 3996 if (1 !== g2 || 1 !== h2) { 3997 do 3998 if (g2--, h2--, 0 > h2 || e2[g2] !== f2[h2]) { 3999 var k2 = "\n" + e2[g2].replace(" at new ", " at "); 4000 a2.displayName && k2.includes("<anonymous>") && (k2 = k2.replace("<anonymous>", a2.displayName)); 4001 return k2; 4002 } 4003 while (1 <= g2 && 0 <= h2); 4004 } 4005 break; 4006 } 4007 } 4008 } finally { 4009 Na2 = false, Error.prepareStackTrace = c2; 4010 } 4011 return (a2 = a2 ? a2.displayName || a2.name : "") ? Ma2(a2) : ""; 4012 } 4013 function Pa2(a2) { 4014 switch (a2.tag) { 4015 case 5: 4016 return Ma2(a2.type); 4017 case 16: 4018 return Ma2("Lazy"); 4019 case 13: 4020 return Ma2("Suspense"); 4021 case 19: 4022 return Ma2("SuspenseList"); 4023 case 0: 4024 case 2: 4025 case 15: 4026 return a2 = Oa2(a2.type, false), a2; 4027 case 11: 4028 return a2 = Oa2(a2.type.render, false), a2; 4029 case 1: 4030 return a2 = Oa2(a2.type, true), a2; 4031 default: 4032 return ""; 4033 } 4034 } 4035 function Qa2(a2) { 4036 if (null == a2) return null; 4037 if ("function" === typeof a2) return a2.displayName || a2.name || null; 4038 if ("string" === typeof a2) return a2; 4039 switch (a2) { 4040 case ya2: 4041 return "Fragment"; 4042 case wa2: 4043 return "Portal"; 4044 case Aa2: 4045 return "Profiler"; 4046 case za2: 4047 return "StrictMode"; 4048 case Ea2: 4049 return "Suspense"; 4050 case Fa2: 4051 return "SuspenseList"; 4052 } 4053 if ("object" === typeof a2) switch (a2.$$typeof) { 4054 case Ca2: 4055 return (a2.displayName || "Context") + ".Consumer"; 4056 case Ba2: 4057 return (a2._context.displayName || "Context") + ".Provider"; 4058 case Da2: 4059 var b2 = a2.render; 4060 a2 = a2.displayName; 4061 a2 || (a2 = b2.displayName || b2.name || "", a2 = "" !== a2 ? "ForwardRef(" + a2 + ")" : "ForwardRef"); 4062 return a2; 4063 case Ga2: 4064 return b2 = a2.displayName || null, null !== b2 ? b2 : Qa2(a2.type) || "Memo"; 4065 case Ha2: 4066 b2 = a2._payload; 4067 a2 = a2._init; 4068 try { 4069 return Qa2(a2(b2)); 4070 } catch (c2) { 4071 } 4072 } 4073 return null; 4074 } 4075 function Ra2(a2) { 4076 var b2 = a2.type; 4077 switch (a2.tag) { 4078 case 24: 4079 return "Cache"; 4080 case 9: 4081 return (b2.displayName || "Context") + ".Consumer"; 4082 case 10: 4083 return (b2._context.displayName || "Context") + ".Provider"; 4084 case 18: 4085 return "DehydratedFragment"; 4086 case 11: 4087 return a2 = b2.render, a2 = a2.displayName || a2.name || "", b2.displayName || ("" !== a2 ? "ForwardRef(" + a2 + ")" : "ForwardRef"); 4088 case 7: 4089 return "Fragment"; 4090 case 5: 4091 return b2; 4092 case 4: 4093 return "Portal"; 4094 case 3: 4095 return "Root"; 4096 case 6: 4097 return "Text"; 4098 case 16: 4099 return Qa2(b2); 4100 case 8: 4101 return b2 === za2 ? "StrictMode" : "Mode"; 4102 case 22: 4103 return "Offscreen"; 4104 case 12: 4105 return "Profiler"; 4106 case 21: 4107 return "Scope"; 4108 case 13: 4109 return "Suspense"; 4110 case 19: 4111 return "SuspenseList"; 4112 case 25: 4113 return "TracingMarker"; 4114 case 1: 4115 case 0: 4116 case 17: 4117 case 2: 4118 case 14: 4119 case 15: 4120 if ("function" === typeof b2) return b2.displayName || b2.name || null; 4121 if ("string" === typeof b2) return b2; 4122 } 4123 return null; 4124 } 4125 function Sa2(a2) { 4126 switch (typeof a2) { 4127 case "boolean": 4128 case "number": 4129 case "string": 4130 case "undefined": 4131 return a2; 4132 case "object": 4133 return a2; 4134 default: 4135 return ""; 4136 } 4137 } 4138 function Ta2(a2) { 4139 var b2 = a2.type; 4140 return (a2 = a2.nodeName) && "input" === a2.toLowerCase() && ("checkbox" === b2 || "radio" === b2); 4141 } 4142 function Ua2(a2) { 4143 var b2 = Ta2(a2) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a2.constructor.prototype, b2), d2 = "" + a2[b2]; 4144 if (!a2.hasOwnProperty(b2) && "undefined" !== typeof c2 && "function" === typeof c2.get && "function" === typeof c2.set) { 4145 var e2 = c2.get, f2 = c2.set; 4146 Object.defineProperty(a2, b2, { configurable: true, get: function() { 4147 return e2.call(this); 4148 }, set: function(a3) { 4149 d2 = "" + a3; 4150 f2.call(this, a3); 4151 } }); 4152 Object.defineProperty(a2, b2, { enumerable: c2.enumerable }); 4153 return { getValue: function() { 4154 return d2; 4155 }, setValue: function(a3) { 4156 d2 = "" + a3; 4157 }, stopTracking: function() { 4158 a2._valueTracker = null; 4159 delete a2[b2]; 4160 } }; 4161 } 4162 } 4163 function Va2(a2) { 4164 a2._valueTracker || (a2._valueTracker = Ua2(a2)); 4165 } 4166 function Wa2(a2) { 4167 if (!a2) return false; 4168 var b2 = a2._valueTracker; 4169 if (!b2) return true; 4170 var c2 = b2.getValue(); 4171 var d2 = ""; 4172 a2 && (d2 = Ta2(a2) ? a2.checked ? "true" : "false" : a2.value); 4173 a2 = d2; 4174 return a2 !== c2 ? (b2.setValue(a2), true) : false; 4175 } 4176 function Xa2(a2) { 4177 a2 = a2 || ("undefined" !== typeof document ? document : void 0); 4178 if ("undefined" === typeof a2) return null; 4179 try { 4180 return a2.activeElement || a2.body; 4181 } catch (b2) { 4182 return a2.body; 4183 } 4184 } 4185 function Ya2(a2, b2) { 4186 var c2 = b2.checked; 4187 return A2({}, b2, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c2 ? c2 : a2._wrapperState.initialChecked }); 4188 } 4189 function Za2(a2, b2) { 4190 var c2 = null == b2.defaultValue ? "" : b2.defaultValue, d2 = null != b2.checked ? b2.checked : b2.defaultChecked; 4191 c2 = Sa2(null != b2.value ? b2.value : c2); 4192 a2._wrapperState = { initialChecked: d2, initialValue: c2, controlled: "checkbox" === b2.type || "radio" === b2.type ? null != b2.checked : null != b2.value }; 4193 } 4194 function ab(a2, b2) { 4195 b2 = b2.checked; 4196 null != b2 && ta(a2, "checked", b2, false); 4197 } 4198 function bb(a2, b2) { 4199 ab(a2, b2); 4200 var c2 = Sa2(b2.value), d2 = b2.type; 4201 if (null != c2) if ("number" === d2) { 4202 if (0 === c2 && "" === a2.value || a2.value != c2) a2.value = "" + c2; 4203 } else a2.value !== "" + c2 && (a2.value = "" + c2); 4204 else if ("submit" === d2 || "reset" === d2) { 4205 a2.removeAttribute("value"); 4206 return; 4207 } 4208 b2.hasOwnProperty("value") ? cb(a2, b2.type, c2) : b2.hasOwnProperty("defaultValue") && cb(a2, b2.type, Sa2(b2.defaultValue)); 4209 null == b2.checked && null != b2.defaultChecked && (a2.defaultChecked = !!b2.defaultChecked); 4210 } 4211 function db(a2, b2, c2) { 4212 if (b2.hasOwnProperty("value") || b2.hasOwnProperty("defaultValue")) { 4213 var d2 = b2.type; 4214 if (!("submit" !== d2 && "reset" !== d2 || void 0 !== b2.value && null !== b2.value)) return; 4215 b2 = "" + a2._wrapperState.initialValue; 4216 c2 || b2 === a2.value || (a2.value = b2); 4217 a2.defaultValue = b2; 4218 } 4219 c2 = a2.name; 4220 "" !== c2 && (a2.name = ""); 4221 a2.defaultChecked = !!a2._wrapperState.initialChecked; 4222 "" !== c2 && (a2.name = c2); 4223 } 4224 function cb(a2, b2, c2) { 4225 if ("number" !== b2 || Xa2(a2.ownerDocument) !== a2) null == c2 ? a2.defaultValue = "" + a2._wrapperState.initialValue : a2.defaultValue !== "" + c2 && (a2.defaultValue = "" + c2); 4226 } 4227 var eb = Array.isArray; 4228 function fb(a2, b2, c2, d2) { 4229 a2 = a2.options; 4230 if (b2) { 4231 b2 = {}; 4232 for (var e2 = 0; e2 < c2.length; e2++) b2["$" + c2[e2]] = true; 4233 for (c2 = 0; c2 < a2.length; c2++) e2 = b2.hasOwnProperty("$" + a2[c2].value), a2[c2].selected !== e2 && (a2[c2].selected = e2), e2 && d2 && (a2[c2].defaultSelected = true); 4234 } else { 4235 c2 = "" + Sa2(c2); 4236 b2 = null; 4237 for (e2 = 0; e2 < a2.length; e2++) { 4238 if (a2[e2].value === c2) { 4239 a2[e2].selected = true; 4240 d2 && (a2[e2].defaultSelected = true); 4241 return; 4242 } 4243 null !== b2 || a2[e2].disabled || (b2 = a2[e2]); 4244 } 4245 null !== b2 && (b2.selected = true); 4246 } 4247 } 4248 function gb(a2, b2) { 4249 if (null != b2.dangerouslySetInnerHTML) throw Error(p2(91)); 4250 return A2({}, b2, { value: void 0, defaultValue: void 0, children: "" + a2._wrapperState.initialValue }); 4251 } 4252 function hb(a2, b2) { 4253 var c2 = b2.value; 4254 if (null == c2) { 4255 c2 = b2.children; 4256 b2 = b2.defaultValue; 4257 if (null != c2) { 4258 if (null != b2) throw Error(p2(92)); 4259 if (eb(c2)) { 4260 if (1 < c2.length) throw Error(p2(93)); 4261 c2 = c2[0]; 4262 } 4263 b2 = c2; 4264 } 4265 null == b2 && (b2 = ""); 4266 c2 = b2; 4267 } 4268 a2._wrapperState = { initialValue: Sa2(c2) }; 4269 } 4270 function ib(a2, b2) { 4271 var c2 = Sa2(b2.value), d2 = Sa2(b2.defaultValue); 4272 null != c2 && (c2 = "" + c2, c2 !== a2.value && (a2.value = c2), null == b2.defaultValue && a2.defaultValue !== c2 && (a2.defaultValue = c2)); 4273 null != d2 && (a2.defaultValue = "" + d2); 4274 } 4275 function jb(a2) { 4276 var b2 = a2.textContent; 4277 b2 === a2._wrapperState.initialValue && "" !== b2 && null !== b2 && (a2.value = b2); 4278 } 4279 function kb(a2) { 4280 switch (a2) { 4281 case "svg": 4282 return "http://www.w3.org/2000/svg"; 4283 case "math": 4284 return "http://www.w3.org/1998/Math/MathML"; 4285 default: 4286 return "http://www.w3.org/1999/xhtml"; 4287 } 4288 } 4289 function lb(a2, b2) { 4290 return null == a2 || "http://www.w3.org/1999/xhtml" === a2 ? kb(b2) : "http://www.w3.org/2000/svg" === a2 && "foreignObject" === b2 ? "http://www.w3.org/1999/xhtml" : a2; 4291 } 4292 var mb, nb = (function(a2) { 4293 return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b2, c2, d2, e2) { 4294 MSApp.execUnsafeLocalFunction(function() { 4295 return a2(b2, c2, d2, e2); 4296 }); 4297 } : a2; 4298 })(function(a2, b2) { 4299 if ("http://www.w3.org/2000/svg" !== a2.namespaceURI || "innerHTML" in a2) a2.innerHTML = b2; 4300 else { 4301 mb = mb || document.createElement("div"); 4302 mb.innerHTML = "<svg>" + b2.valueOf().toString() + "</svg>"; 4303 for (b2 = mb.firstChild; a2.firstChild; ) a2.removeChild(a2.firstChild); 4304 for (; b2.firstChild; ) a2.appendChild(b2.firstChild); 4305 } 4306 }); 4307 function ob(a2, b2) { 4308 if (b2) { 4309 var c2 = a2.firstChild; 4310 if (c2 && c2 === a2.lastChild && 3 === c2.nodeType) { 4311 c2.nodeValue = b2; 4312 return; 4313 } 4314 } 4315 a2.textContent = b2; 4316 } 4317 var pb = { 4318 animationIterationCount: true, 4319 aspectRatio: true, 4320 borderImageOutset: true, 4321 borderImageSlice: true, 4322 borderImageWidth: true, 4323 boxFlex: true, 4324 boxFlexGroup: true, 4325 boxOrdinalGroup: true, 4326 columnCount: true, 4327 columns: true, 4328 flex: true, 4329 flexGrow: true, 4330 flexPositive: true, 4331 flexShrink: true, 4332 flexNegative: true, 4333 flexOrder: true, 4334 gridArea: true, 4335 gridRow: true, 4336 gridRowEnd: true, 4337 gridRowSpan: true, 4338 gridRowStart: true, 4339 gridColumn: true, 4340 gridColumnEnd: true, 4341 gridColumnSpan: true, 4342 gridColumnStart: true, 4343 fontWeight: true, 4344 lineClamp: true, 4345 lineHeight: true, 4346 opacity: true, 4347 order: true, 4348 orphans: true, 4349 tabSize: true, 4350 widows: true, 4351 zIndex: true, 4352 zoom: true, 4353 fillOpacity: true, 4354 floodOpacity: true, 4355 stopOpacity: true, 4356 strokeDasharray: true, 4357 strokeDashoffset: true, 4358 strokeMiterlimit: true, 4359 strokeOpacity: true, 4360 strokeWidth: true 4361 }, qb = ["Webkit", "ms", "Moz", "O"]; 4362 Object.keys(pb).forEach(function(a2) { 4363 qb.forEach(function(b2) { 4364 b2 = b2 + a2.charAt(0).toUpperCase() + a2.substring(1); 4365 pb[b2] = pb[a2]; 4366 }); 4367 }); 4368 function rb(a2, b2, c2) { 4369 return null == b2 || "boolean" === typeof b2 || "" === b2 ? "" : c2 || "number" !== typeof b2 || 0 === b2 || pb.hasOwnProperty(a2) && pb[a2] ? ("" + b2).trim() : b2 + "px"; 4370 } 4371 function sb(a2, b2) { 4372 a2 = a2.style; 4373 for (var c2 in b2) if (b2.hasOwnProperty(c2)) { 4374 var d2 = 0 === c2.indexOf("--"), e2 = rb(c2, b2[c2], d2); 4375 "float" === c2 && (c2 = "cssFloat"); 4376 d2 ? a2.setProperty(c2, e2) : a2[c2] = e2; 4377 } 4378 } 4379 var tb = A2({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); 4380 function ub(a2, b2) { 4381 if (b2) { 4382 if (tb[a2] && (null != b2.children || null != b2.dangerouslySetInnerHTML)) throw Error(p2(137, a2)); 4383 if (null != b2.dangerouslySetInnerHTML) { 4384 if (null != b2.children) throw Error(p2(60)); 4385 if ("object" !== typeof b2.dangerouslySetInnerHTML || !("__html" in b2.dangerouslySetInnerHTML)) throw Error(p2(61)); 4386 } 4387 if (null != b2.style && "object" !== typeof b2.style) throw Error(p2(62)); 4388 } 4389 } 4390 function vb(a2, b2) { 4391 if (-1 === a2.indexOf("-")) return "string" === typeof b2.is; 4392 switch (a2) { 4393 case "annotation-xml": 4394 case "color-profile": 4395 case "font-face": 4396 case "font-face-src": 4397 case "font-face-uri": 4398 case "font-face-format": 4399 case "font-face-name": 4400 case "missing-glyph": 4401 return false; 4402 default: 4403 return true; 4404 } 4405 } 4406 var wb = null; 4407 function xb(a2) { 4408 a2 = a2.target || a2.srcElement || window; 4409 a2.correspondingUseElement && (a2 = a2.correspondingUseElement); 4410 return 3 === a2.nodeType ? a2.parentNode : a2; 4411 } 4412 var yb = null, zb = null, Ab = null; 4413 function Bb(a2) { 4414 if (a2 = Cb(a2)) { 4415 if ("function" !== typeof yb) throw Error(p2(280)); 4416 var b2 = a2.stateNode; 4417 b2 && (b2 = Db(b2), yb(a2.stateNode, a2.type, b2)); 4418 } 4419 } 4420 function Eb(a2) { 4421 zb ? Ab ? Ab.push(a2) : Ab = [a2] : zb = a2; 4422 } 4423 function Fb() { 4424 if (zb) { 4425 var a2 = zb, b2 = Ab; 4426 Ab = zb = null; 4427 Bb(a2); 4428 if (b2) for (a2 = 0; a2 < b2.length; a2++) Bb(b2[a2]); 4429 } 4430 } 4431 function Gb(a2, b2) { 4432 return a2(b2); 4433 } 4434 function Hb() { 4435 } 4436 var Ib = false; 4437 function Jb(a2, b2, c2) { 4438 if (Ib) return a2(b2, c2); 4439 Ib = true; 4440 try { 4441 return Gb(a2, b2, c2); 4442 } finally { 4443 if (Ib = false, null !== zb || null !== Ab) Hb(), Fb(); 4444 } 4445 } 4446 function Kb(a2, b2) { 4447 var c2 = a2.stateNode; 4448 if (null === c2) return null; 4449 var d2 = Db(c2); 4450 if (null === d2) return null; 4451 c2 = d2[b2]; 4452 a: switch (b2) { 4453 case "onClick": 4454 case "onClickCapture": 4455 case "onDoubleClick": 4456 case "onDoubleClickCapture": 4457 case "onMouseDown": 4458 case "onMouseDownCapture": 4459 case "onMouseMove": 4460 case "onMouseMoveCapture": 4461 case "onMouseUp": 4462 case "onMouseUpCapture": 4463 case "onMouseEnter": 4464 (d2 = !d2.disabled) || (a2 = a2.type, d2 = !("button" === a2 || "input" === a2 || "select" === a2 || "textarea" === a2)); 4465 a2 = !d2; 4466 break a; 4467 default: 4468 a2 = false; 4469 } 4470 if (a2) return null; 4471 if (c2 && "function" !== typeof c2) throw Error(p2(231, b2, typeof c2)); 4472 return c2; 4473 } 4474 var Lb = false; 4475 if (ia) try { 4476 var Mb = {}; 4477 Object.defineProperty(Mb, "passive", { get: function() { 4478 Lb = true; 4479 } }); 4480 window.addEventListener("test", Mb, Mb); 4481 window.removeEventListener("test", Mb, Mb); 4482 } catch (a2) { 4483 Lb = false; 4484 } 4485 function Nb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4486 var l2 = Array.prototype.slice.call(arguments, 3); 4487 try { 4488 b2.apply(c2, l2); 4489 } catch (m2) { 4490 this.onError(m2); 4491 } 4492 } 4493 var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a2) { 4494 Ob = true; 4495 Pb = a2; 4496 } }; 4497 function Tb(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4498 Ob = false; 4499 Pb = null; 4500 Nb.apply(Sb, arguments); 4501 } 4502 function Ub(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 4503 Tb.apply(this, arguments); 4504 if (Ob) { 4505 if (Ob) { 4506 var l2 = Pb; 4507 Ob = false; 4508 Pb = null; 4509 } else throw Error(p2(198)); 4510 Qb || (Qb = true, Rb = l2); 4511 } 4512 } 4513 function Vb(a2) { 4514 var b2 = a2, c2 = a2; 4515 if (a2.alternate) for (; b2.return; ) b2 = b2.return; 4516 else { 4517 a2 = b2; 4518 do 4519 b2 = a2, 0 !== (b2.flags & 4098) && (c2 = b2.return), a2 = b2.return; 4520 while (a2); 4521 } 4522 return 3 === b2.tag ? c2 : null; 4523 } 4524 function Wb(a2) { 4525 if (13 === a2.tag) { 4526 var b2 = a2.memoizedState; 4527 null === b2 && (a2 = a2.alternate, null !== a2 && (b2 = a2.memoizedState)); 4528 if (null !== b2) return b2.dehydrated; 4529 } 4530 return null; 4531 } 4532 function Xb(a2) { 4533 if (Vb(a2) !== a2) throw Error(p2(188)); 4534 } 4535 function Yb(a2) { 4536 var b2 = a2.alternate; 4537 if (!b2) { 4538 b2 = Vb(a2); 4539 if (null === b2) throw Error(p2(188)); 4540 return b2 !== a2 ? null : a2; 4541 } 4542 for (var c2 = a2, d2 = b2; ; ) { 4543 var e2 = c2.return; 4544 if (null === e2) break; 4545 var f2 = e2.alternate; 4546 if (null === f2) { 4547 d2 = e2.return; 4548 if (null !== d2) { 4549 c2 = d2; 4550 continue; 4551 } 4552 break; 4553 } 4554 if (e2.child === f2.child) { 4555 for (f2 = e2.child; f2; ) { 4556 if (f2 === c2) return Xb(e2), a2; 4557 if (f2 === d2) return Xb(e2), b2; 4558 f2 = f2.sibling; 4559 } 4560 throw Error(p2(188)); 4561 } 4562 if (c2.return !== d2.return) c2 = e2, d2 = f2; 4563 else { 4564 for (var g2 = false, h2 = e2.child; h2; ) { 4565 if (h2 === c2) { 4566 g2 = true; 4567 c2 = e2; 4568 d2 = f2; 4569 break; 4570 } 4571 if (h2 === d2) { 4572 g2 = true; 4573 d2 = e2; 4574 c2 = f2; 4575 break; 4576 } 4577 h2 = h2.sibling; 4578 } 4579 if (!g2) { 4580 for (h2 = f2.child; h2; ) { 4581 if (h2 === c2) { 4582 g2 = true; 4583 c2 = f2; 4584 d2 = e2; 4585 break; 4586 } 4587 if (h2 === d2) { 4588 g2 = true; 4589 d2 = f2; 4590 c2 = e2; 4591 break; 4592 } 4593 h2 = h2.sibling; 4594 } 4595 if (!g2) throw Error(p2(189)); 4596 } 4597 } 4598 if (c2.alternate !== d2) throw Error(p2(190)); 4599 } 4600 if (3 !== c2.tag) throw Error(p2(188)); 4601 return c2.stateNode.current === c2 ? a2 : b2; 4602 } 4603 function Zb(a2) { 4604 a2 = Yb(a2); 4605 return null !== a2 ? $b(a2) : null; 4606 } 4607 function $b(a2) { 4608 if (5 === a2.tag || 6 === a2.tag) return a2; 4609 for (a2 = a2.child; null !== a2; ) { 4610 var b2 = $b(a2); 4611 if (null !== b2) return b2; 4612 a2 = a2.sibling; 4613 } 4614 return null; 4615 } 4616 var ac = ca2.unstable_scheduleCallback, bc = ca2.unstable_cancelCallback, cc = ca2.unstable_shouldYield, dc = ca2.unstable_requestPaint, B2 = ca2.unstable_now, ec = ca2.unstable_getCurrentPriorityLevel, fc = ca2.unstable_ImmediatePriority, gc = ca2.unstable_UserBlockingPriority, hc = ca2.unstable_NormalPriority, ic = ca2.unstable_LowPriority, jc = ca2.unstable_IdlePriority, kc = null, lc = null; 4617 function mc(a2) { 4618 if (lc && "function" === typeof lc.onCommitFiberRoot) try { 4619 lc.onCommitFiberRoot(kc, a2, void 0, 128 === (a2.current.flags & 128)); 4620 } catch (b2) { 4621 } 4622 } 4623 var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2; 4624 function nc(a2) { 4625 a2 >>>= 0; 4626 return 0 === a2 ? 32 : 31 - (pc(a2) / qc | 0) | 0; 4627 } 4628 var rc = 64, sc = 4194304; 4629 function tc(a2) { 4630 switch (a2 & -a2) { 4631 case 1: 4632 return 1; 4633 case 2: 4634 return 2; 4635 case 4: 4636 return 4; 4637 case 8: 4638 return 8; 4639 case 16: 4640 return 16; 4641 case 32: 4642 return 32; 4643 case 64: 4644 case 128: 4645 case 256: 4646 case 512: 4647 case 1024: 4648 case 2048: 4649 case 4096: 4650 case 8192: 4651 case 16384: 4652 case 32768: 4653 case 65536: 4654 case 131072: 4655 case 262144: 4656 case 524288: 4657 case 1048576: 4658 case 2097152: 4659 return a2 & 4194240; 4660 case 4194304: 4661 case 8388608: 4662 case 16777216: 4663 case 33554432: 4664 case 67108864: 4665 return a2 & 130023424; 4666 case 134217728: 4667 return 134217728; 4668 case 268435456: 4669 return 268435456; 4670 case 536870912: 4671 return 536870912; 4672 case 1073741824: 4673 return 1073741824; 4674 default: 4675 return a2; 4676 } 4677 } 4678 function uc(a2, b2) { 4679 var c2 = a2.pendingLanes; 4680 if (0 === c2) return 0; 4681 var d2 = 0, e2 = a2.suspendedLanes, f2 = a2.pingedLanes, g2 = c2 & 268435455; 4682 if (0 !== g2) { 4683 var h2 = g2 & ~e2; 4684 0 !== h2 ? d2 = tc(h2) : (f2 &= g2, 0 !== f2 && (d2 = tc(f2))); 4685 } else g2 = c2 & ~e2, 0 !== g2 ? d2 = tc(g2) : 0 !== f2 && (d2 = tc(f2)); 4686 if (0 === d2) return 0; 4687 if (0 !== b2 && b2 !== d2 && 0 === (b2 & e2) && (e2 = d2 & -d2, f2 = b2 & -b2, e2 >= f2 || 16 === e2 && 0 !== (f2 & 4194240))) return b2; 4688 0 !== (d2 & 4) && (d2 |= c2 & 16); 4689 b2 = a2.entangledLanes; 4690 if (0 !== b2) for (a2 = a2.entanglements, b2 &= d2; 0 < b2; ) c2 = 31 - oc(b2), e2 = 1 << c2, d2 |= a2[c2], b2 &= ~e2; 4691 return d2; 4692 } 4693 function vc(a2, b2) { 4694 switch (a2) { 4695 case 1: 4696 case 2: 4697 case 4: 4698 return b2 + 250; 4699 case 8: 4700 case 16: 4701 case 32: 4702 case 64: 4703 case 128: 4704 case 256: 4705 case 512: 4706 case 1024: 4707 case 2048: 4708 case 4096: 4709 case 8192: 4710 case 16384: 4711 case 32768: 4712 case 65536: 4713 case 131072: 4714 case 262144: 4715 case 524288: 4716 case 1048576: 4717 case 2097152: 4718 return b2 + 5e3; 4719 case 4194304: 4720 case 8388608: 4721 case 16777216: 4722 case 33554432: 4723 case 67108864: 4724 return -1; 4725 case 134217728: 4726 case 268435456: 4727 case 536870912: 4728 case 1073741824: 4729 return -1; 4730 default: 4731 return -1; 4732 } 4733 } 4734 function wc(a2, b2) { 4735 for (var c2 = a2.suspendedLanes, d2 = a2.pingedLanes, e2 = a2.expirationTimes, f2 = a2.pendingLanes; 0 < f2; ) { 4736 var g2 = 31 - oc(f2), h2 = 1 << g2, k2 = e2[g2]; 4737 if (-1 === k2) { 4738 if (0 === (h2 & c2) || 0 !== (h2 & d2)) e2[g2] = vc(h2, b2); 4739 } else k2 <= b2 && (a2.expiredLanes |= h2); 4740 f2 &= ~h2; 4741 } 4742 } 4743 function xc(a2) { 4744 a2 = a2.pendingLanes & -1073741825; 4745 return 0 !== a2 ? a2 : a2 & 1073741824 ? 1073741824 : 0; 4746 } 4747 function yc2() { 4748 var a2 = rc; 4749 rc <<= 1; 4750 0 === (rc & 4194240) && (rc = 64); 4751 return a2; 4752 } 4753 function zc(a2) { 4754 for (var b2 = [], c2 = 0; 31 > c2; c2++) b2.push(a2); 4755 return b2; 4756 } 4757 function Ac(a2, b2, c2) { 4758 a2.pendingLanes |= b2; 4759 536870912 !== b2 && (a2.suspendedLanes = 0, a2.pingedLanes = 0); 4760 a2 = a2.eventTimes; 4761 b2 = 31 - oc(b2); 4762 a2[b2] = c2; 4763 } 4764 function Bc2(a2, b2) { 4765 var c2 = a2.pendingLanes & ~b2; 4766 a2.pendingLanes = b2; 4767 a2.suspendedLanes = 0; 4768 a2.pingedLanes = 0; 4769 a2.expiredLanes &= b2; 4770 a2.mutableReadLanes &= b2; 4771 a2.entangledLanes &= b2; 4772 b2 = a2.entanglements; 4773 var d2 = a2.eventTimes; 4774 for (a2 = a2.expirationTimes; 0 < c2; ) { 4775 var e2 = 31 - oc(c2), f2 = 1 << e2; 4776 b2[e2] = 0; 4777 d2[e2] = -1; 4778 a2[e2] = -1; 4779 c2 &= ~f2; 4780 } 4781 } 4782 function Cc(a2, b2) { 4783 var c2 = a2.entangledLanes |= b2; 4784 for (a2 = a2.entanglements; c2; ) { 4785 var d2 = 31 - oc(c2), e2 = 1 << d2; 4786 e2 & b2 | a2[d2] & b2 && (a2[d2] |= b2); 4787 c2 &= ~e2; 4788 } 4789 } 4790 var C2 = 0; 4791 function Dc(a2) { 4792 a2 &= -a2; 4793 return 1 < a2 ? 4 < a2 ? 0 !== (a2 & 268435455) ? 16 : 536870912 : 4 : 1; 4794 } 4795 var Ec, Fc, Gc, Hc, Ic, Jc = false, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "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 submit".split(" "); 4796 function Sc(a2, b2) { 4797 switch (a2) { 4798 case "focusin": 4799 case "focusout": 4800 Lc = null; 4801 break; 4802 case "dragenter": 4803 case "dragleave": 4804 Mc = null; 4805 break; 4806 case "mouseover": 4807 case "mouseout": 4808 Nc = null; 4809 break; 4810 case "pointerover": 4811 case "pointerout": 4812 Oc.delete(b2.pointerId); 4813 break; 4814 case "gotpointercapture": 4815 case "lostpointercapture": 4816 Pc.delete(b2.pointerId); 4817 } 4818 } 4819 function Tc(a2, b2, c2, d2, e2, f2) { 4820 if (null === a2 || a2.nativeEvent !== f2) return a2 = { blockedOn: b2, domEventName: c2, eventSystemFlags: d2, nativeEvent: f2, targetContainers: [e2] }, null !== b2 && (b2 = Cb(b2), null !== b2 && Fc(b2)), a2; 4821 a2.eventSystemFlags |= d2; 4822 b2 = a2.targetContainers; 4823 null !== e2 && -1 === b2.indexOf(e2) && b2.push(e2); 4824 return a2; 4825 } 4826 function Uc(a2, b2, c2, d2, e2) { 4827 switch (b2) { 4828 case "focusin": 4829 return Lc = Tc(Lc, a2, b2, c2, d2, e2), true; 4830 case "dragenter": 4831 return Mc = Tc(Mc, a2, b2, c2, d2, e2), true; 4832 case "mouseover": 4833 return Nc = Tc(Nc, a2, b2, c2, d2, e2), true; 4834 case "pointerover": 4835 var f2 = e2.pointerId; 4836 Oc.set(f2, Tc(Oc.get(f2) || null, a2, b2, c2, d2, e2)); 4837 return true; 4838 case "gotpointercapture": 4839 return f2 = e2.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a2, b2, c2, d2, e2)), true; 4840 } 4841 return false; 4842 } 4843 function Vc(a2) { 4844 var b2 = Wc(a2.target); 4845 if (null !== b2) { 4846 var c2 = Vb(b2); 4847 if (null !== c2) { 4848 if (b2 = c2.tag, 13 === b2) { 4849 if (b2 = Wb(c2), null !== b2) { 4850 a2.blockedOn = b2; 4851 Ic(a2.priority, function() { 4852 Gc(c2); 4853 }); 4854 return; 4855 } 4856 } else if (3 === b2 && c2.stateNode.current.memoizedState.isDehydrated) { 4857 a2.blockedOn = 3 === c2.tag ? c2.stateNode.containerInfo : null; 4858 return; 4859 } 4860 } 4861 } 4862 a2.blockedOn = null; 4863 } 4864 function Xc(a2) { 4865 if (null !== a2.blockedOn) return false; 4866 for (var b2 = a2.targetContainers; 0 < b2.length; ) { 4867 var c2 = Yc(a2.domEventName, a2.eventSystemFlags, b2[0], a2.nativeEvent); 4868 if (null === c2) { 4869 c2 = a2.nativeEvent; 4870 var d2 = new c2.constructor(c2.type, c2); 4871 wb = d2; 4872 c2.target.dispatchEvent(d2); 4873 wb = null; 4874 } else return b2 = Cb(c2), null !== b2 && Fc(b2), a2.blockedOn = c2, false; 4875 b2.shift(); 4876 } 4877 return true; 4878 } 4879 function Zc(a2, b2, c2) { 4880 Xc(a2) && c2.delete(b2); 4881 } 4882 function $c() { 4883 Jc = false; 4884 null !== Lc && Xc(Lc) && (Lc = null); 4885 null !== Mc && Xc(Mc) && (Mc = null); 4886 null !== Nc && Xc(Nc) && (Nc = null); 4887 Oc.forEach(Zc); 4888 Pc.forEach(Zc); 4889 } 4890 function ad(a2, b2) { 4891 a2.blockedOn === b2 && (a2.blockedOn = null, Jc || (Jc = true, ca2.unstable_scheduleCallback(ca2.unstable_NormalPriority, $c))); 4892 } 4893 function bd(a2) { 4894 function b2(b3) { 4895 return ad(b3, a2); 4896 } 4897 if (0 < Kc.length) { 4898 ad(Kc[0], a2); 4899 for (var c2 = 1; c2 < Kc.length; c2++) { 4900 var d2 = Kc[c2]; 4901 d2.blockedOn === a2 && (d2.blockedOn = null); 4902 } 4903 } 4904 null !== Lc && ad(Lc, a2); 4905 null !== Mc && ad(Mc, a2); 4906 null !== Nc && ad(Nc, a2); 4907 Oc.forEach(b2); 4908 Pc.forEach(b2); 4909 for (c2 = 0; c2 < Qc.length; c2++) d2 = Qc[c2], d2.blockedOn === a2 && (d2.blockedOn = null); 4910 for (; 0 < Qc.length && (c2 = Qc[0], null === c2.blockedOn); ) Vc(c2), null === c2.blockedOn && Qc.shift(); 4911 } 4912 var cd = ua2.ReactCurrentBatchConfig, dd = true; 4913 function ed(a2, b2, c2, d2) { 4914 var e2 = C2, f2 = cd.transition; 4915 cd.transition = null; 4916 try { 4917 C2 = 1, fd(a2, b2, c2, d2); 4918 } finally { 4919 C2 = e2, cd.transition = f2; 4920 } 4921 } 4922 function gd(a2, b2, c2, d2) { 4923 var e2 = C2, f2 = cd.transition; 4924 cd.transition = null; 4925 try { 4926 C2 = 4, fd(a2, b2, c2, d2); 4927 } finally { 4928 C2 = e2, cd.transition = f2; 4929 } 4930 } 4931 function fd(a2, b2, c2, d2) { 4932 if (dd) { 4933 var e2 = Yc(a2, b2, c2, d2); 4934 if (null === e2) hd(a2, b2, d2, id2, c2), Sc(a2, d2); 4935 else if (Uc(e2, a2, b2, c2, d2)) d2.stopPropagation(); 4936 else if (Sc(a2, d2), b2 & 4 && -1 < Rc.indexOf(a2)) { 4937 for (; null !== e2; ) { 4938 var f2 = Cb(e2); 4939 null !== f2 && Ec(f2); 4940 f2 = Yc(a2, b2, c2, d2); 4941 null === f2 && hd(a2, b2, d2, id2, c2); 4942 if (f2 === e2) break; 4943 e2 = f2; 4944 } 4945 null !== e2 && d2.stopPropagation(); 4946 } else hd(a2, b2, d2, null, c2); 4947 } 4948 } 4949 var id2 = null; 4950 function Yc(a2, b2, c2, d2) { 4951 id2 = null; 4952 a2 = xb(d2); 4953 a2 = Wc(a2); 4954 if (null !== a2) if (b2 = Vb(a2), null === b2) a2 = null; 4955 else if (c2 = b2.tag, 13 === c2) { 4956 a2 = Wb(b2); 4957 if (null !== a2) return a2; 4958 a2 = null; 4959 } else if (3 === c2) { 4960 if (b2.stateNode.current.memoizedState.isDehydrated) return 3 === b2.tag ? b2.stateNode.containerInfo : null; 4961 a2 = null; 4962 } else b2 !== a2 && (a2 = null); 4963 id2 = a2; 4964 return null; 4965 }
4966 function jd(a2) { 4967 switch (a2) { 4968 case "cancel": 4969 case "click": 4970 case "close": 4971 case "contextmenu": 4972 case "copy": 4973 case "cut": 4974 case "auxclick": 4975 case "dblclick": 4976 case "dragend": 4977 case "dragstart": 4978 case "drop": 4979 case "focusin": 4980 case "focusout": 4981 case "input": 4982 case "invalid": 4983 case "keydown": 4984 case "keypress": 4985 case "keyup": 4986 case "mousedown": 4987 case "mouseup": 4988 case "paste": 4989 case "pause": 4990 case "play": 4991 case "pointercancel": 4992 case "pointerdown": 4993 case "pointerup": 4994 case "ratechange": 4995 case "reset": 4996 case "resize": 4997 case "seeked": 4998 case "submit": 4999 case "touchcancel": 5000 case "touchend": 5001 case "touchstart": 5002 case "volumechange": 5003 case "change": 5004 case "selectionchange": 5005 case "textInput": 5006 case "compositionstart": 5007 case "compositionend": 5008 case "compositionupdate": 5009 case "beforeblur": 5010 case "afterblur": 5011 case "beforeinput": 5012 case "blur": 5013 case "fullscreenchange": 5014 case "focus": 5015 case "hashchange": 5016 case "popstate": 5017 case "select": 5018 case "selectstart": 5019 return 1; 5020 case "drag": 5021 case "dragenter": 5022 case "dragexit": 5023 case "dragleave": 5024 case "dragover": 5025 case "mousemove": 5026 case "mouseout": 5027 case "mouseover": 5028 case "pointermove": 5029 case "pointerout": 5030 case "pointerover": 5031 case "scroll": 5032 case "toggle": 5033 case "touchmove": 5034 case "wheel": 5035 case "mouseenter": 5036 case "mouseleave": 5037 case "pointerenter": 5038 case "pointerleave": 5039 return 4; 5040 case "message": 5041 switch (ec()) { 5042 case fc: 5043 return 1; 5044 case gc: 5045 return 4; 5046 case hc: 5047 case ic: 5048 return 16; 5049 case jc: 5050 return 536870912; 5051 default: 5052 return 16; 5053 } 5054 default: 5055 return 16; 5056 } 5057 } 5058 var kd = null, ld = null, md = null;
vendor: 113,308 bytes, lines 5059-7846
5059 function nd() { 5060 if (md) return md; 5061 var a2, b2 = ld, c2 = b2.length, d2, e2 = "value" in kd ? kd.value : kd.textContent, f2 = e2.length; 5062 for (a2 = 0; a2 < c2 && b2[a2] === e2[a2]; a2++) ; 5063 var g2 = c2 - a2; 5064 for (d2 = 1; d2 <= g2 && b2[c2 - d2] === e2[f2 - d2]; d2++) ; 5065 return md = e2.slice(a2, 1 < d2 ? 1 - d2 : void 0); 5066 } 5067 function od(a2) { 5068 var b2 = a2.keyCode; 5069 "charCode" in a2 ? (a2 = a2.charCode, 0 === a2 && 13 === b2 && (a2 = 13)) : a2 = b2; 5070 10 === a2 && (a2 = 13); 5071 return 32 <= a2 || 13 === a2 ? a2 : 0; 5072 } 5073 function pd() { 5074 return true; 5075 } 5076 function qd() { 5077 return false; 5078 } 5079 function rd(a2) { 5080 function b2(b3, d2, e2, f2, g2) { 5081 this._reactName = b3; 5082 this._targetInst = e2; 5083 this.type = d2; 5084 this.nativeEvent = f2; 5085 this.target = g2; 5086 this.currentTarget = null; 5087 for (var c2 in a2) a2.hasOwnProperty(c2) && (b3 = a2[c2], this[c2] = b3 ? b3(f2) : f2[c2]); 5088 this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd; 5089 this.isPropagationStopped = qd; 5090 return this; 5091 } 5092 A2(b2.prototype, { preventDefault: function() { 5093 this.defaultPrevented = true; 5094 var a3 = this.nativeEvent; 5095 a3 && (a3.preventDefault ? a3.preventDefault() : "unknown" !== typeof a3.returnValue && (a3.returnValue = false), this.isDefaultPrevented = pd); 5096 }, stopPropagation: function() { 5097 var a3 = this.nativeEvent; 5098 a3 && (a3.stopPropagation ? a3.stopPropagation() : "unknown" !== typeof a3.cancelBubble && (a3.cancelBubble = true), this.isPropagationStopped = pd); 5099 }, persist: function() { 5100 }, isPersistent: pd }); 5101 return b2; 5102 } 5103 var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a2) { 5104 return a2.timeStamp || Date.now(); 5105 }, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A2({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A2({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a2) { 5106 return void 0 === a2.relatedTarget ? a2.fromElement === a2.srcElement ? a2.toElement : a2.fromElement : a2.relatedTarget; 5107 }, movementX: function(a2) { 5108 if ("movementX" in a2) return a2.movementX; 5109 a2 !== yd && (yd && "mousemove" === a2.type ? (wd = a2.screenX - yd.screenX, xd = a2.screenY - yd.screenY) : xd = wd = 0, yd = a2); 5110 return wd; 5111 }, movementY: function(a2) { 5112 return "movementY" in a2 ? a2.movementY : xd; 5113 } }), Bd = rd(Ad), Cd = A2({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A2({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A2({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A2({}, sd, { clipboardData: function(a2) { 5114 return "clipboardData" in a2 ? a2.clipboardData : window.clipboardData; 5115 } }), Jd = rd(Id), Kd = A2({}, sd, { data: 0 }), Ld = rd(Kd), Md = { 5116 Esc: "Escape", 5117 Spacebar: " ", 5118 Left: "ArrowLeft", 5119 Up: "ArrowUp", 5120 Right: "ArrowRight", 5121 Down: "ArrowDown", 5122 Del: "Delete", 5123 Win: "OS", 5124 Menu: "ContextMenu", 5125 Apps: "ContextMenu", 5126 Scroll: "ScrollLock", 5127 MozPrintableKey: "Unidentified" 5128 }, Nd = { 5129 8: "Backspace", 5130 9: "Tab", 5131 12: "Clear", 5132 13: "Enter", 5133 16: "Shift", 5134 17: "Control", 5135 18: "Alt", 5136 19: "Pause", 5137 20: "CapsLock", 5138 27: "Escape", 5139 32: " ", 5140 33: "PageUp", 5141 34: "PageDown", 5142 35: "End", 5143 36: "Home", 5144 37: "ArrowLeft", 5145 38: "ArrowUp", 5146 39: "ArrowRight", 5147 40: "ArrowDown", 5148 45: "Insert", 5149 46: "Delete", 5150 112: "F1", 5151 113: "F2", 5152 114: "F3", 5153 115: "F4", 5154 116: "F5", 5155 117: "F6", 5156 118: "F7", 5157 119: "F8", 5158 120: "F9", 5159 121: "F10", 5160 122: "F11", 5161 123: "F12", 5162 144: "NumLock", 5163 145: "ScrollLock", 5164 224: "Meta" 5165 }, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; 5166 function Pd(a2) { 5167 var b2 = this.nativeEvent; 5168 return b2.getModifierState ? b2.getModifierState(a2) : (a2 = Od[a2]) ? !!b2[a2] : false; 5169 } 5170 function zd() { 5171 return Pd; 5172 } 5173 var Qd = A2({}, ud, { key: function(a2) { 5174 if (a2.key) { 5175 var b2 = Md[a2.key] || a2.key; 5176 if ("Unidentified" !== b2) return b2; 5177 } 5178 return "keypress" === a2.type ? (a2 = od(a2), 13 === a2 ? "Enter" : String.fromCharCode(a2)) : "keydown" === a2.type || "keyup" === a2.type ? Nd[a2.keyCode] || "Unidentified" : ""; 5179 }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a2) { 5180 return "keypress" === a2.type ? od(a2) : 0; 5181 }, keyCode: function(a2) { 5182 return "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0; 5183 }, which: function(a2) { 5184 return "keypress" === a2.type ? od(a2) : "keydown" === a2.type || "keyup" === a2.type ? a2.keyCode : 0; 5185 } }), Rd = rd(Qd), Sd = A2({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A2({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A2({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A2({}, Ad, { 5186 deltaX: function(a2) { 5187 return "deltaX" in a2 ? a2.deltaX : "wheelDeltaX" in a2 ? -a2.wheelDeltaX : 0; 5188 }, 5189 deltaY: function(a2) { 5190 return "deltaY" in a2 ? a2.deltaY : "wheelDeltaY" in a2 ? -a2.wheelDeltaY : "wheelDelta" in a2 ? -a2.wheelDelta : 0; 5191 }, 5192 deltaZ: 0, 5193 deltaMode: 0 5194 }), Zd = rd(Yd), $d = [9, 13, 27, 32], ae2 = ia && "CompositionEvent" in window, be2 = null; 5195 ia && "documentMode" in document && (be2 = document.documentMode); 5196 var ce2 = ia && "TextEvent" in window && !be2, de2 = ia && (!ae2 || be2 && 8 < be2 && 11 >= be2), ee2 = String.fromCharCode(32), fe2 = false; 5197 function ge2(a2, b2) { 5198 switch (a2) { 5199 case "keyup": 5200 return -1 !== $d.indexOf(b2.keyCode); 5201 case "keydown": 5202 return 229 !== b2.keyCode; 5203 case "keypress": 5204 case "mousedown": 5205 case "focusout": 5206 return true; 5207 default: 5208 return false; 5209 } 5210 } 5211 function he2(a2) { 5212 a2 = a2.detail; 5213 return "object" === typeof a2 && "data" in a2 ? a2.data : null; 5214 } 5215 var ie2 = false; 5216 function je2(a2, b2) { 5217 switch (a2) { 5218 case "compositionend": 5219 return he2(b2); 5220 case "keypress": 5221 if (32 !== b2.which) return null; 5222 fe2 = true; 5223 return ee2; 5224 case "textInput": 5225 return a2 = b2.data, a2 === ee2 && fe2 ? null : a2; 5226 default: 5227 return null; 5228 } 5229 } 5230 function ke2(a2, b2) { 5231 if (ie2) return "compositionend" === a2 || !ae2 && ge2(a2, b2) ? (a2 = nd(), md = ld = kd = null, ie2 = false, a2) : null; 5232 switch (a2) { 5233 case "paste": 5234 return null; 5235 case "keypress": 5236 if (!(b2.ctrlKey || b2.altKey || b2.metaKey) || b2.ctrlKey && b2.altKey) { 5237 if (b2.char && 1 < b2.char.length) return b2.char; 5238 if (b2.which) return String.fromCharCode(b2.which); 5239 } 5240 return null; 5241 case "compositionend": 5242 return de2 && "ko" !== b2.locale ? null : b2.data; 5243 default: 5244 return null; 5245 } 5246 } 5247 var le2 = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; 5248 function me2(a2) { 5249 var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); 5250 return "input" === b2 ? !!le2[a2.type] : "textarea" === b2 ? true : false; 5251 } 5252 function ne2(a2, b2, c2, d2) { 5253 Eb(d2); 5254 b2 = oe2(b2, "onChange"); 5255 0 < b2.length && (c2 = new td("onChange", "change", null, c2, d2), a2.push({ event: c2, listeners: b2 })); 5256 } 5257 var pe2 = null, qe2 = null; 5258 function re2(a2) { 5259 se2(a2, 0); 5260 } 5261 function te2(a2) { 5262 var b2 = ue2(a2); 5263 if (Wa2(b2)) return a2; 5264 } 5265 function ve2(a2, b2) { 5266 if ("change" === a2) return b2; 5267 } 5268 var we2 = false; 5269 if (ia) { 5270 var xe2; 5271 if (ia) { 5272 var ye2 = "oninput" in document; 5273 if (!ye2) { 5274 var ze2 = document.createElement("div"); 5275 ze2.setAttribute("oninput", "return;"); 5276 ye2 = "function" === typeof ze2.oninput; 5277 } 5278 xe2 = ye2; 5279 } else xe2 = false; 5280 we2 = xe2 && (!document.documentMode || 9 < document.documentMode); 5281 } 5282 function Ae2() { 5283 pe2 && (pe2.detachEvent("onpropertychange", Be2), qe2 = pe2 = null); 5284 } 5285 function Be2(a2) { 5286 if ("value" === a2.propertyName && te2(qe2)) { 5287 var b2 = []; 5288 ne2(b2, qe2, a2, xb(a2)); 5289 Jb(re2, b2); 5290 } 5291 } 5292 function Ce2(a2, b2, c2) { 5293 "focusin" === a2 ? (Ae2(), pe2 = b2, qe2 = c2, pe2.attachEvent("onpropertychange", Be2)) : "focusout" === a2 && Ae2(); 5294 } 5295 function De2(a2) { 5296 if ("selectionchange" === a2 || "keyup" === a2 || "keydown" === a2) return te2(qe2); 5297 } 5298 function Ee2(a2, b2) { 5299 if ("click" === a2) return te2(b2); 5300 } 5301 function Fe2(a2, b2) { 5302 if ("input" === a2 || "change" === a2) return te2(b2); 5303 } 5304 function Ge2(a2, b2) { 5305 return a2 === b2 && (0 !== a2 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2; 5306 } 5307 var He2 = "function" === typeof Object.is ? Object.is : Ge2; 5308 function Ie2(a2, b2) { 5309 if (He2(a2, b2)) return true; 5310 if ("object" !== typeof a2 || null === a2 || "object" !== typeof b2 || null === b2) return false; 5311 var c2 = Object.keys(a2), d2 = Object.keys(b2); 5312 if (c2.length !== d2.length) return false; 5313 for (d2 = 0; d2 < c2.length; d2++) { 5314 var e2 = c2[d2]; 5315 if (!ja2.call(b2, e2) || !He2(a2[e2], b2[e2])) return false; 5316 } 5317 return true; 5318 } 5319 function Je2(a2) { 5320 for (; a2 && a2.firstChild; ) a2 = a2.firstChild; 5321 return a2; 5322 } 5323 function Ke2(a2, b2) { 5324 var c2 = Je2(a2); 5325 a2 = 0; 5326 for (var d2; c2; ) { 5327 if (3 === c2.nodeType) { 5328 d2 = a2 + c2.textContent.length; 5329 if (a2 <= b2 && d2 >= b2) return { node: c2, offset: b2 - a2 }; 5330 a2 = d2; 5331 } 5332 a: { 5333 for (; c2; ) { 5334 if (c2.nextSibling) { 5335 c2 = c2.nextSibling; 5336 break a; 5337 } 5338 c2 = c2.parentNode; 5339 } 5340 c2 = void 0; 5341 } 5342 c2 = Je2(c2); 5343 } 5344 } 5345 function Le2(a2, b2) { 5346 return a2 && b2 ? a2 === b2 ? true : a2 && 3 === a2.nodeType ? false : b2 && 3 === b2.nodeType ? Le2(a2, b2.parentNode) : "contains" in a2 ? a2.contains(b2) : a2.compareDocumentPosition ? !!(a2.compareDocumentPosition(b2) & 16) : false : false; 5347 } 5348 function Me2() { 5349 for (var a2 = window, b2 = Xa2(); b2 instanceof a2.HTMLIFrameElement; ) { 5350 try { 5351 var c2 = "string" === typeof b2.contentWindow.location.href; 5352 } catch (d2) { 5353 c2 = false; 5354 } 5355 if (c2) a2 = b2.contentWindow; 5356 else break; 5357 b2 = Xa2(a2.document); 5358 } 5359 return b2; 5360 } 5361 function Ne2(a2) { 5362 var b2 = a2 && a2.nodeName && a2.nodeName.toLowerCase(); 5363 return b2 && ("input" === b2 && ("text" === a2.type || "search" === a2.type || "tel" === a2.type || "url" === a2.type || "password" === a2.type) || "textarea" === b2 || "true" === a2.contentEditable); 5364 } 5365 function Oe2(a2) { 5366 var b2 = Me2(), c2 = a2.focusedElem, d2 = a2.selectionRange; 5367 if (b2 !== c2 && c2 && c2.ownerDocument && Le2(c2.ownerDocument.documentElement, c2)) { 5368 if (null !== d2 && Ne2(c2)) { 5369 if (b2 = d2.start, a2 = d2.end, void 0 === a2 && (a2 = b2), "selectionStart" in c2) c2.selectionStart = b2, c2.selectionEnd = Math.min(a2, c2.value.length); 5370 else if (a2 = (b2 = c2.ownerDocument || document) && b2.defaultView || window, a2.getSelection) { 5371 a2 = a2.getSelection(); 5372 var e2 = c2.textContent.length, f2 = Math.min(d2.start, e2); 5373 d2 = void 0 === d2.end ? f2 : Math.min(d2.end, e2); 5374 !a2.extend && f2 > d2 && (e2 = d2, d2 = f2, f2 = e2); 5375 e2 = Ke2(c2, f2); 5376 var g2 = Ke2( 5377 c2, 5378 d2 5379 ); 5380 e2 && g2 && (1 !== a2.rangeCount || a2.anchorNode !== e2.node || a2.anchorOffset !== e2.offset || a2.focusNode !== g2.node || a2.focusOffset !== g2.offset) && (b2 = b2.createRange(), b2.setStart(e2.node, e2.offset), a2.removeAllRanges(), f2 > d2 ? (a2.addRange(b2), a2.extend(g2.node, g2.offset)) : (b2.setEnd(g2.node, g2.offset), a2.addRange(b2))); 5381 } 5382 } 5383 b2 = []; 5384 for (a2 = c2; a2 = a2.parentNode; ) 1 === a2.nodeType && b2.push({ element: a2, left: a2.scrollLeft, top: a2.scrollTop }); 5385 "function" === typeof c2.focus && c2.focus(); 5386 for (c2 = 0; c2 < b2.length; c2++) a2 = b2[c2], a2.element.scrollLeft = a2.left, a2.element.scrollTop = a2.top; 5387 } 5388 } 5389 var Pe2 = ia && "documentMode" in document && 11 >= document.documentMode, Qe2 = null, Re2 = null, Se2 = null, Te2 = false; 5390 function Ue2(a2, b2, c2) { 5391 var d2 = c2.window === c2 ? c2.document : 9 === c2.nodeType ? c2 : c2.ownerDocument; 5392 Te2 || null == Qe2 || Qe2 !== Xa2(d2) || (d2 = Qe2, "selectionStart" in d2 && Ne2(d2) ? d2 = { start: d2.selectionStart, end: d2.selectionEnd } : (d2 = (d2.ownerDocument && d2.ownerDocument.defaultView || window).getSelection(), d2 = { anchorNode: d2.anchorNode, anchorOffset: d2.anchorOffset, focusNode: d2.focusNode, focusOffset: d2.focusOffset }), Se2 && Ie2(Se2, d2) || (Se2 = d2, d2 = oe2(Re2, "onSelect"), 0 < d2.length && (b2 = new td("onSelect", "select", null, b2, c2), a2.push({ event: b2, listeners: d2 }), b2.target = Qe2))); 5393 } 5394 function Ve2(a2, b2) { 5395 var c2 = {}; 5396 c2[a2.toLowerCase()] = b2.toLowerCase(); 5397 c2["Webkit" + a2] = "webkit" + b2; 5398 c2["Moz" + a2] = "moz" + b2; 5399 return c2; 5400 } 5401 var We2 = { animationend: Ve2("Animation", "AnimationEnd"), animationiteration: Ve2("Animation", "AnimationIteration"), animationstart: Ve2("Animation", "AnimationStart"), transitionend: Ve2("Transition", "TransitionEnd") }, Xe2 = {}, Ye2 = {}; 5402 ia && (Ye2 = document.createElement("div").style, "AnimationEvent" in window || (delete We2.animationend.animation, delete We2.animationiteration.animation, delete We2.animationstart.animation), "TransitionEvent" in window || delete We2.transitionend.transition); 5403 function Ze2(a2) { 5404 if (Xe2[a2]) return Xe2[a2]; 5405 if (!We2[a2]) return a2; 5406 var b2 = We2[a2], c2; 5407 for (c2 in b2) if (b2.hasOwnProperty(c2) && c2 in Ye2) return Xe2[a2] = b2[c2]; 5408 return a2; 5409 } 5410 var $e2 = Ze2("animationend"), af = Ze2("animationiteration"), bf = Ze2("animationstart"), cf = Ze2("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick 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(" "); 5411 function ff(a2, b2) { 5412 df.set(a2, b2); 5413 fa2(b2, [a2]); 5414 } 5415 for (var gf = 0; gf < ef.length; gf++) { 5416 var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); 5417 ff(jf, "on" + kf); 5418 } 5419 ff($e2, "onAnimationEnd"); 5420 ff(af, "onAnimationIteration"); 5421 ff(bf, "onAnimationStart"); 5422 ff("dblclick", "onDoubleClick"); 5423 ff("focusin", "onFocus"); 5424 ff("focusout", "onBlur"); 5425 ff(cf, "onTransitionEnd"); 5426 ha2("onMouseEnter", ["mouseout", "mouseover"]); 5427 ha2("onMouseLeave", ["mouseout", "mouseover"]); 5428 ha2("onPointerEnter", ["pointerout", "pointerover"]); 5429 ha2("onPointerLeave", ["pointerout", "pointerover"]); 5430 fa2("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); 5431 fa2("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); 5432 fa2("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); 5433 fa2("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); 5434 fa2("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); 5435 fa2("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); 5436 var lf = "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(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); 5437 function nf(a2, b2, c2) { 5438 var d2 = a2.type || "unknown-event"; 5439 a2.currentTarget = c2; 5440 Ub(d2, b2, void 0, a2); 5441 a2.currentTarget = null; 5442 } 5443 function se2(a2, b2) { 5444 b2 = 0 !== (b2 & 4); 5445 for (var c2 = 0; c2 < a2.length; c2++) { 5446 var d2 = a2[c2], e2 = d2.event; 5447 d2 = d2.listeners; 5448 a: { 5449 var f2 = void 0; 5450 if (b2) for (var g2 = d2.length - 1; 0 <= g2; g2--) { 5451 var h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget; 5452 h2 = h2.listener; 5453 if (k2 !== f2 && e2.isPropagationStopped()) break a; 5454 nf(e2, h2, l2); 5455 f2 = k2; 5456 } 5457 else for (g2 = 0; g2 < d2.length; g2++) { 5458 h2 = d2[g2]; 5459 k2 = h2.instance; 5460 l2 = h2.currentTarget; 5461 h2 = h2.listener; 5462 if (k2 !== f2 && e2.isPropagationStopped()) break a; 5463 nf(e2, h2, l2); 5464 f2 = k2; 5465 } 5466 } 5467 } 5468 if (Qb) throw a2 = Rb, Qb = false, Rb = null, a2; 5469 } 5470 function D2(a2, b2) { 5471 var c2 = b2[of]; 5472 void 0 === c2 && (c2 = b2[of] = /* @__PURE__ */ new Set()); 5473 var d2 = a2 + "__bubble"; 5474 c2.has(d2) || (pf(b2, a2, 2, false), c2.add(d2)); 5475 } 5476 function qf(a2, b2, c2) { 5477 var d2 = 0; 5478 b2 && (d2 |= 4); 5479 pf(c2, a2, d2, b2); 5480 } 5481 var rf = "_reactListening" + Math.random().toString(36).slice(2); 5482 function sf(a2) { 5483 if (!a2[rf]) { 5484 a2[rf] = true; 5485 da2.forEach(function(b3) { 5486 "selectionchange" !== b3 && (mf.has(b3) || qf(b3, false, a2), qf(b3, true, a2)); 5487 }); 5488 var b2 = 9 === a2.nodeType ? a2 : a2.ownerDocument; 5489 null === b2 || b2[rf] || (b2[rf] = true, qf("selectionchange", false, b2)); 5490 } 5491 } 5492 function pf(a2, b2, c2, d2) { 5493 switch (jd(b2)) { 5494 case 1: 5495 var e2 = ed; 5496 break; 5497 case 4: 5498 e2 = gd; 5499 break; 5500 default: 5501 e2 = fd; 5502 } 5503 c2 = e2.bind(null, b2, c2, a2); 5504 e2 = void 0; 5505 !Lb || "touchstart" !== b2 && "touchmove" !== b2 && "wheel" !== b2 || (e2 = true); 5506 d2 ? void 0 !== e2 ? a2.addEventListener(b2, c2, { capture: true, passive: e2 }) : a2.addEventListener(b2, c2, true) : void 0 !== e2 ? a2.addEventListener(b2, c2, { passive: e2 }) : a2.addEventListener(b2, c2, false); 5507 } 5508 function hd(a2, b2, c2, d2, e2) { 5509 var f2 = d2; 5510 if (0 === (b2 & 1) && 0 === (b2 & 2) && null !== d2) a: for (; ; ) { 5511 if (null === d2) return; 5512 var g2 = d2.tag; 5513 if (3 === g2 || 4 === g2) { 5514 var h2 = d2.stateNode.containerInfo; 5515 if (h2 === e2 || 8 === h2.nodeType && h2.parentNode === e2) break; 5516 if (4 === g2) for (g2 = d2.return; null !== g2; ) { 5517 var k2 = g2.tag; 5518 if (3 === k2 || 4 === k2) { 5519 if (k2 = g2.stateNode.containerInfo, k2 === e2 || 8 === k2.nodeType && k2.parentNode === e2) return; 5520 } 5521 g2 = g2.return; 5522 } 5523 for (; null !== h2; ) { 5524 g2 = Wc(h2); 5525 if (null === g2) return; 5526 k2 = g2.tag; 5527 if (5 === k2 || 6 === k2) { 5528 d2 = f2 = g2; 5529 continue a; 5530 } 5531 h2 = h2.parentNode; 5532 } 5533 } 5534 d2 = d2.return; 5535 } 5536 Jb(function() { 5537 var d3 = f2, e3 = xb(c2), g3 = []; 5538 a: { 5539 var h3 = df.get(a2); 5540 if (void 0 !== h3) { 5541 var k3 = td, n2 = a2; 5542 switch (a2) { 5543 case "keypress": 5544 if (0 === od(c2)) break a; 5545 case "keydown": 5546 case "keyup": 5547 k3 = Rd; 5548 break; 5549 case "focusin": 5550 n2 = "focus"; 5551 k3 = Fd; 5552 break; 5553 case "focusout": 5554 n2 = "blur"; 5555 k3 = Fd; 5556 break; 5557 case "beforeblur": 5558 case "afterblur": 5559 k3 = Fd; 5560 break; 5561 case "click": 5562 if (2 === c2.button) break a; 5563 case "auxclick": 5564 case "dblclick": 5565 case "mousedown": 5566 case "mousemove": 5567 case "mouseup": 5568 case "mouseout": 5569 case "mouseover": 5570 case "contextmenu": 5571 k3 = Bd; 5572 break; 5573 case "drag": 5574 case "dragend": 5575 case "dragenter": 5576 case "dragexit": 5577 case "dragleave": 5578 case "dragover": 5579 case "dragstart": 5580 case "drop": 5581 k3 = Dd; 5582 break; 5583 case "touchcancel": 5584 case "touchend": 5585 case "touchmove": 5586 case "touchstart": 5587 k3 = Vd; 5588 break; 5589 case $e2: 5590 case af: 5591 case bf: 5592 k3 = Hd; 5593 break; 5594 case cf: 5595 k3 = Xd; 5596 break; 5597 case "scroll": 5598 k3 = vd; 5599 break; 5600 case "wheel": 5601 k3 = Zd; 5602 break; 5603 case "copy": 5604 case "cut": 5605 case "paste": 5606 k3 = Jd; 5607 break; 5608 case "gotpointercapture": 5609 case "lostpointercapture": 5610 case "pointercancel": 5611 case "pointerdown": 5612 case "pointermove": 5613 case "pointerout": 5614 case "pointerover": 5615 case "pointerup": 5616 k3 = Td; 5617 } 5618 var t2 = 0 !== (b2 & 4), J2 = !t2 && "scroll" === a2, x2 = t2 ? null !== h3 ? h3 + "Capture" : null : h3; 5619 t2 = []; 5620 for (var w2 = d3, u2; null !== w2; ) { 5621 u2 = w2; 5622 var F2 = u2.stateNode; 5623 5 === u2.tag && null !== F2 && (u2 = F2, null !== x2 && (F2 = Kb(w2, x2), null != F2 && t2.push(tf(w2, F2, u2)))); 5624 if (J2) break; 5625 w2 = w2.return; 5626 } 5627 0 < t2.length && (h3 = new k3(h3, n2, null, c2, e3), g3.push({ event: h3, listeners: t2 })); 5628 } 5629 } 5630 if (0 === (b2 & 7)) { 5631 a: { 5632 h3 = "mouseover" === a2 || "pointerover" === a2; 5633 k3 = "mouseout" === a2 || "pointerout" === a2; 5634 if (h3 && c2 !== wb && (n2 = c2.relatedTarget || c2.fromElement) && (Wc(n2) || n2[uf])) break a; 5635 if (k3 || h3) { 5636 h3 = e3.window === e3 ? e3 : (h3 = e3.ownerDocument) ? h3.defaultView || h3.parentWindow : window; 5637 if (k3) { 5638 if (n2 = c2.relatedTarget || c2.toElement, k3 = d3, n2 = n2 ? Wc(n2) : null, null !== n2 && (J2 = Vb(n2), n2 !== J2 || 5 !== n2.tag && 6 !== n2.tag)) n2 = null; 5639 } else k3 = null, n2 = d3; 5640 if (k3 !== n2) { 5641 t2 = Bd; 5642 F2 = "onMouseLeave"; 5643 x2 = "onMouseEnter"; 5644 w2 = "mouse"; 5645 if ("pointerout" === a2 || "pointerover" === a2) t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer"; 5646 J2 = null == k3 ? h3 : ue2(k3); 5647 u2 = null == n2 ? h3 : ue2(n2); 5648 h3 = new t2(F2, w2 + "leave", k3, c2, e3); 5649 h3.target = J2; 5650 h3.relatedTarget = u2; 5651 F2 = null; 5652 Wc(e3) === d3 && (t2 = new t2(x2, w2 + "enter", n2, c2, e3), t2.target = u2, t2.relatedTarget = J2, F2 = t2); 5653 J2 = F2; 5654 if (k3 && n2) b: { 5655 t2 = k3; 5656 x2 = n2; 5657 w2 = 0; 5658 for (u2 = t2; u2; u2 = vf(u2)) w2++; 5659 u2 = 0; 5660 for (F2 = x2; F2; F2 = vf(F2)) u2++; 5661 for (; 0 < w2 - u2; ) t2 = vf(t2), w2--; 5662 for (; 0 < u2 - w2; ) x2 = vf(x2), u2--; 5663 for (; w2--; ) { 5664 if (t2 === x2 || null !== x2 && t2 === x2.alternate) break b; 5665 t2 = vf(t2); 5666 x2 = vf(x2); 5667 } 5668 t2 = null; 5669 } 5670 else t2 = null; 5671 null !== k3 && wf(g3, h3, k3, t2, false); 5672 null !== n2 && null !== J2 && wf(g3, J2, n2, t2, true); 5673 } 5674 } 5675 } 5676 a: { 5677 h3 = d3 ? ue2(d3) : window; 5678 k3 = h3.nodeName && h3.nodeName.toLowerCase(); 5679 if ("select" === k3 || "input" === k3 && "file" === h3.type) var na2 = ve2; 5680 else if (me2(h3)) if (we2) na2 = Fe2; 5681 else { 5682 na2 = De2; 5683 var xa2 = Ce2; 5684 } 5685 else (k3 = h3.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h3.type || "radio" === h3.type) && (na2 = Ee2); 5686 if (na2 && (na2 = na2(a2, d3))) { 5687 ne2(g3, na2, c2, e3); 5688 break a; 5689 } 5690 xa2 && xa2(a2, h3, d3); 5691 "focusout" === a2 && (xa2 = h3._wrapperState) && xa2.controlled && "number" === h3.type && cb(h3, "number", h3.value); 5692 } 5693 xa2 = d3 ? ue2(d3) : window; 5694 switch (a2) { 5695 case "focusin": 5696 if (me2(xa2) || "true" === xa2.contentEditable) Qe2 = xa2, Re2 = d3, Se2 = null; 5697 break; 5698 case "focusout": 5699 Se2 = Re2 = Qe2 = null; 5700 break; 5701 case "mousedown": 5702 Te2 = true; 5703 break; 5704 case "contextmenu": 5705 case "mouseup": 5706 case "dragend": 5707 Te2 = false; 5708 Ue2(g3, c2, e3); 5709 break; 5710 case "selectionchange": 5711 if (Pe2) break; 5712 case "keydown": 5713 case "keyup": 5714 Ue2(g3, c2, e3); 5715 } 5716 var $a2; 5717 if (ae2) b: { 5718 switch (a2) { 5719 case "compositionstart": 5720 var ba2 = "onCompositionStart"; 5721 break b; 5722 case "compositionend": 5723 ba2 = "onCompositionEnd"; 5724 break b; 5725 case "compositionupdate": 5726 ba2 = "onCompositionUpdate"; 5727 break b; 5728 } 5729 ba2 = void 0; 5730 } 5731 else ie2 ? ge2(a2, c2) && (ba2 = "onCompositionEnd") : "keydown" === a2 && 229 === c2.keyCode && (ba2 = "onCompositionStart"); 5732 ba2 && (de2 && "ko" !== c2.locale && (ie2 || "onCompositionStart" !== ba2 ? "onCompositionEnd" === ba2 && ie2 && ($a2 = nd()) : (kd = e3, ld = "value" in kd ? kd.value : kd.textContent, ie2 = true)), xa2 = oe2(d3, ba2), 0 < xa2.length && (ba2 = new Ld(ba2, a2, null, c2, e3), g3.push({ event: ba2, listeners: xa2 }), $a2 ? ba2.data = $a2 : ($a2 = he2(c2), null !== $a2 && (ba2.data = $a2)))); 5733 if ($a2 = ce2 ? je2(a2, c2) : ke2(a2, c2)) d3 = oe2(d3, "onBeforeInput"), 0 < d3.length && (e3 = new Ld("onBeforeInput", "beforeinput", null, c2, e3), g3.push({ event: e3, listeners: d3 }), e3.data = $a2); 5734 } 5735 se2(g3, b2); 5736 }); 5737 } 5738 function tf(a2, b2, c2) { 5739 return { instance: a2, listener: b2, currentTarget: c2 }; 5740 } 5741 function oe2(a2, b2) { 5742 for (var c2 = b2 + "Capture", d2 = []; null !== a2; ) { 5743 var e2 = a2, f2 = e2.stateNode; 5744 5 === e2.tag && null !== f2 && (e2 = f2, f2 = Kb(a2, c2), null != f2 && d2.unshift(tf(a2, f2, e2)), f2 = Kb(a2, b2), null != f2 && d2.push(tf(a2, f2, e2))); 5745 a2 = a2.return; 5746 } 5747 return d2; 5748 } 5749 function vf(a2) { 5750 if (null === a2) return null; 5751 do 5752 a2 = a2.return; 5753 while (a2 && 5 !== a2.tag); 5754 return a2 ? a2 : null; 5755 } 5756 function wf(a2, b2, c2, d2, e2) { 5757 for (var f2 = b2._reactName, g2 = []; null !== c2 && c2 !== d2; ) { 5758 var h2 = c2, k2 = h2.alternate, l2 = h2.stateNode; 5759 if (null !== k2 && k2 === d2) break; 5760 5 === h2.tag && null !== l2 && (h2 = l2, e2 ? (k2 = Kb(c2, f2), null != k2 && g2.unshift(tf(c2, k2, h2))) : e2 || (k2 = Kb(c2, f2), null != k2 && g2.push(tf(c2, k2, h2)))); 5761 c2 = c2.return; 5762 } 5763 0 !== g2.length && a2.push({ event: b2, listeners: g2 }); 5764 } 5765 var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g; 5766 function zf(a2) { 5767 return ("string" === typeof a2 ? a2 : "" + a2).replace(xf, "\n").replace(yf, ""); 5768 } 5769 function Af(a2, b2, c2) { 5770 b2 = zf(b2); 5771 if (zf(a2) !== b2 && c2) throw Error(p2(425)); 5772 } 5773 function Bf() { 5774 } 5775 var Cf = null, Df = null; 5776 function Ef(a2, b2) { 5777 return "textarea" === a2 || "noscript" === a2 || "string" === typeof b2.children || "number" === typeof b2.children || "object" === typeof b2.dangerouslySetInnerHTML && null !== b2.dangerouslySetInnerHTML && null != b2.dangerouslySetInnerHTML.__html; 5778 } 5779 var Ff = "function" === typeof setTimeout ? setTimeout : void 0, Gf = "function" === typeof clearTimeout ? clearTimeout : void 0, Hf = "function" === typeof Promise ? Promise : void 0, Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a2) { 5780 return Hf.resolve(null).then(a2).catch(If); 5781 } : Ff; 5782 function If(a2) { 5783 setTimeout(function() { 5784 throw a2; 5785 }); 5786 } 5787 function Kf(a2, b2) { 5788 var c2 = b2, d2 = 0; 5789 do { 5790 var e2 = c2.nextSibling; 5791 a2.removeChild(c2); 5792 if (e2 && 8 === e2.nodeType) if (c2 = e2.data, "/$" === c2) { 5793 if (0 === d2) { 5794 a2.removeChild(e2); 5795 bd(b2); 5796 return; 5797 } 5798 d2--; 5799 } else "$" !== c2 && "$?" !== c2 && "$!" !== c2 || d2++; 5800 c2 = e2; 5801 } while (c2); 5802 bd(b2); 5803 } 5804 function Lf(a2) { 5805 for (; null != a2; a2 = a2.nextSibling) { 5806 var b2 = a2.nodeType; 5807 if (1 === b2 || 3 === b2) break; 5808 if (8 === b2) { 5809 b2 = a2.data; 5810 if ("$" === b2 || "$!" === b2 || "$?" === b2) break; 5811 if ("/$" === b2) return null; 5812 } 5813 } 5814 return a2; 5815 } 5816 function Mf(a2) { 5817 a2 = a2.previousSibling; 5818 for (var b2 = 0; a2; ) { 5819 if (8 === a2.nodeType) { 5820 var c2 = a2.data; 5821 if ("$" === c2 || "$!" === c2 || "$?" === c2) { 5822 if (0 === b2) return a2; 5823 b2--; 5824 } else "/$" === c2 && b2++; 5825 } 5826 a2 = a2.previousSibling; 5827 } 5828 return null; 5829 } 5830 var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf; 5831 function Wc(a2) { 5832 var b2 = a2[Of]; 5833 if (b2) return b2; 5834 for (var c2 = a2.parentNode; c2; ) { 5835 if (b2 = c2[uf] || c2[Of]) { 5836 c2 = b2.alternate; 5837 if (null !== b2.child || null !== c2 && null !== c2.child) for (a2 = Mf(a2); null !== a2; ) { 5838 if (c2 = a2[Of]) return c2; 5839 a2 = Mf(a2); 5840 } 5841 return b2; 5842 } 5843 a2 = c2; 5844 c2 = a2.parentNode; 5845 } 5846 return null; 5847 } 5848 function Cb(a2) { 5849 a2 = a2[Of] || a2[uf]; 5850 return !a2 || 5 !== a2.tag && 6 !== a2.tag && 13 !== a2.tag && 3 !== a2.tag ? null : a2; 5851 } 5852 function ue2(a2) { 5853 if (5 === a2.tag || 6 === a2.tag) return a2.stateNode; 5854 throw Error(p2(33)); 5855 } 5856 function Db(a2) { 5857 return a2[Pf] || null; 5858 } 5859 var Sf = [], Tf = -1; 5860 function Uf(a2) { 5861 return { current: a2 }; 5862 } 5863 function E2(a2) { 5864 0 > Tf || (a2.current = Sf[Tf], Sf[Tf] = null, Tf--); 5865 } 5866 function G2(a2, b2) { 5867 Tf++; 5868 Sf[Tf] = a2.current; 5869 a2.current = b2; 5870 } 5871 var Vf = {}, H2 = Uf(Vf), Wf = Uf(false), Xf = Vf; 5872 function Yf(a2, b2) { 5873 var c2 = a2.type.contextTypes; 5874 if (!c2) return Vf; 5875 var d2 = a2.stateNode; 5876 if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2) return d2.__reactInternalMemoizedMaskedChildContext; 5877 var e2 = {}, f2; 5878 for (f2 in c2) e2[f2] = b2[f2]; 5879 d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = b2, a2.__reactInternalMemoizedMaskedChildContext = e2); 5880 return e2; 5881 } 5882 function Zf(a2) { 5883 a2 = a2.childContextTypes; 5884 return null !== a2 && void 0 !== a2; 5885 } 5886 function $f() { 5887 E2(Wf); 5888 E2(H2); 5889 } 5890 function ag(a2, b2, c2) { 5891 if (H2.current !== Vf) throw Error(p2(168)); 5892 G2(H2, b2); 5893 G2(Wf, c2); 5894 } 5895 function bg(a2, b2, c2) { 5896 var d2 = a2.stateNode; 5897 b2 = b2.childContextTypes; 5898 if ("function" !== typeof d2.getChildContext) return c2; 5899 d2 = d2.getChildContext(); 5900 for (var e2 in d2) if (!(e2 in b2)) throw Error(p2(108, Ra2(a2) || "Unknown", e2)); 5901 return A2({}, c2, d2); 5902 } 5903 function cg(a2) { 5904 a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || Vf; 5905 Xf = H2.current; 5906 G2(H2, a2); 5907 G2(Wf, Wf.current); 5908 return true; 5909 } 5910 function dg(a2, b2, c2) { 5911 var d2 = a2.stateNode; 5912 if (!d2) throw Error(p2(169)); 5913 c2 ? (a2 = bg(a2, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a2, E2(Wf), E2(H2), G2(H2, a2)) : E2(Wf); 5914 G2(Wf, c2); 5915 } 5916 var eg = null, fg = false, gg = false; 5917 function hg(a2) { 5918 null === eg ? eg = [a2] : eg.push(a2); 5919 } 5920 function ig(a2) { 5921 fg = true; 5922 hg(a2); 5923 } 5924 function jg() { 5925 if (!gg && null !== eg) { 5926 gg = true; 5927 var a2 = 0, b2 = C2; 5928 try { 5929 var c2 = eg; 5930 for (C2 = 1; a2 < c2.length; a2++) { 5931 var d2 = c2[a2]; 5932 do 5933 d2 = d2(true); 5934 while (null !== d2); 5935 } 5936 eg = null; 5937 fg = false; 5938 } catch (e2) { 5939 throw null !== eg && (eg = eg.slice(a2 + 1)), ac(fc, jg), e2; 5940 } finally { 5941 C2 = b2, gg = false; 5942 } 5943 } 5944 return null; 5945 } 5946 var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = ""; 5947 function tg(a2, b2) { 5948 kg[lg++] = ng; 5949 kg[lg++] = mg; 5950 mg = a2; 5951 ng = b2; 5952 } 5953 function ug(a2, b2, c2) { 5954 og[pg++] = rg; 5955 og[pg++] = sg; 5956 og[pg++] = qg; 5957 qg = a2; 5958 var d2 = rg; 5959 a2 = sg; 5960 var e2 = 32 - oc(d2) - 1; 5961 d2 &= ~(1 << e2); 5962 c2 += 1; 5963 var f2 = 32 - oc(b2) + e2; 5964 if (30 < f2) { 5965 var g2 = e2 - e2 % 5; 5966 f2 = (d2 & (1 << g2) - 1).toString(32); 5967 d2 >>= g2; 5968 e2 -= g2; 5969 rg = 1 << 32 - oc(b2) + e2 | c2 << e2 | d2; 5970 sg = f2 + a2; 5971 } else rg = 1 << f2 | c2 << e2 | d2, sg = a2; 5972 } 5973 function vg(a2) { 5974 null !== a2.return && (tg(a2, 1), ug(a2, 1, 0)); 5975 } 5976 function wg(a2) { 5977 for (; a2 === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; 5978 for (; a2 === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; 5979 } 5980 var xg = null, yg = null, I2 = false, zg = null; 5981 function Ag(a2, b2) { 5982 var c2 = Bg(5, null, null, 0); 5983 c2.elementType = "DELETED"; 5984 c2.stateNode = b2; 5985 c2.return = a2; 5986 b2 = a2.deletions; 5987 null === b2 ? (a2.deletions = [c2], a2.flags |= 16) : b2.push(c2); 5988 } 5989 function Cg(a2, b2) { 5990 switch (a2.tag) { 5991 case 5: 5992 var c2 = a2.type; 5993 b2 = 1 !== b2.nodeType || c2.toLowerCase() !== b2.nodeName.toLowerCase() ? null : b2; 5994 return null !== b2 ? (a2.stateNode = b2, xg = a2, yg = Lf(b2.firstChild), true) : false; 5995 case 6: 5996 return b2 = "" === a2.pendingProps || 3 !== b2.nodeType ? null : b2, null !== b2 ? (a2.stateNode = b2, xg = a2, yg = null, true) : false; 5997 case 13: 5998 return b2 = 8 !== b2.nodeType ? null : b2, null !== b2 ? (c2 = null !== qg ? { id: rg, overflow: sg } : null, a2.memoizedState = { dehydrated: b2, treeContext: c2, retryLane: 1073741824 }, c2 = Bg(18, null, null, 0), c2.stateNode = b2, c2.return = a2, a2.child = c2, xg = a2, yg = null, true) : false; 5999 default: 6000 return false; 6001 } 6002 } 6003 function Dg(a2) { 6004 return 0 !== (a2.mode & 1) && 0 === (a2.flags & 128); 6005 } 6006 function Eg(a2) { 6007 if (I2) { 6008 var b2 = yg; 6009 if (b2) { 6010 var c2 = b2; 6011 if (!Cg(a2, b2)) { 6012 if (Dg(a2)) throw Error(p2(418)); 6013 b2 = Lf(c2.nextSibling); 6014 var d2 = xg; 6015 b2 && Cg(a2, b2) ? Ag(d2, c2) : (a2.flags = a2.flags & -4097 | 2, I2 = false, xg = a2); 6016 } 6017 } else { 6018 if (Dg(a2)) throw Error(p2(418)); 6019 a2.flags = a2.flags & -4097 | 2; 6020 I2 = false; 6021 xg = a2; 6022 } 6023 } 6024 } 6025 function Fg(a2) { 6026 for (a2 = a2.return; null !== a2 && 5 !== a2.tag && 3 !== a2.tag && 13 !== a2.tag; ) a2 = a2.return; 6027 xg = a2; 6028 } 6029 function Gg(a2) { 6030 if (a2 !== xg) return false; 6031 if (!I2) return Fg(a2), I2 = true, false; 6032 var b2; 6033 (b2 = 3 !== a2.tag) && !(b2 = 5 !== a2.tag) && (b2 = a2.type, b2 = "head" !== b2 && "body" !== b2 && !Ef(a2.type, a2.memoizedProps)); 6034 if (b2 && (b2 = yg)) { 6035 if (Dg(a2)) throw Hg(), Error(p2(418)); 6036 for (; b2; ) Ag(a2, b2), b2 = Lf(b2.nextSibling); 6037 } 6038 Fg(a2); 6039 if (13 === a2.tag) { 6040 a2 = a2.memoizedState; 6041 a2 = null !== a2 ? a2.dehydrated : null; 6042 if (!a2) throw Error(p2(317)); 6043 a: { 6044 a2 = a2.nextSibling; 6045 for (b2 = 0; a2; ) { 6046 if (8 === a2.nodeType) { 6047 var c2 = a2.data; 6048 if ("/$" === c2) { 6049 if (0 === b2) { 6050 yg = Lf(a2.nextSibling); 6051 break a; 6052 } 6053 b2--; 6054 } else "$" !== c2 && "$!" !== c2 && "$?" !== c2 || b2++; 6055 } 6056 a2 = a2.nextSibling; 6057 } 6058 yg = null; 6059 } 6060 } else yg = xg ? Lf(a2.stateNode.nextSibling) : null; 6061 return true; 6062 } 6063 function Hg() { 6064 for (var a2 = yg; a2; ) a2 = Lf(a2.nextSibling); 6065 } 6066 function Ig() { 6067 yg = xg = null; 6068 I2 = false; 6069 } 6070 function Jg(a2) { 6071 null === zg ? zg = [a2] : zg.push(a2); 6072 } 6073 var Kg = ua2.ReactCurrentBatchConfig; 6074 function Lg(a2, b2, c2) { 6075 a2 = c2.ref; 6076 if (null !== a2 && "function" !== typeof a2 && "object" !== typeof a2) { 6077 if (c2._owner) { 6078 c2 = c2._owner; 6079 if (c2) { 6080 if (1 !== c2.tag) throw Error(p2(309)); 6081 var d2 = c2.stateNode; 6082 } 6083 if (!d2) throw Error(p2(147, a2)); 6084 var e2 = d2, f2 = "" + a2; 6085 if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f2) return b2.ref; 6086 b2 = function(a3) { 6087 var b3 = e2.refs; 6088 null === a3 ? delete b3[f2] : b3[f2] = a3; 6089 }; 6090 b2._stringRef = f2; 6091 return b2; 6092 } 6093 if ("string" !== typeof a2) throw Error(p2(284)); 6094 if (!c2._owner) throw Error(p2(290, a2)); 6095 } 6096 return a2; 6097 } 6098 function Mg(a2, b2) { 6099 a2 = Object.prototype.toString.call(b2); 6100 throw Error(p2(31, "[object Object]" === a2 ? "object with keys {" + Object.keys(b2).join(", ") + "}" : a2)); 6101 } 6102 function Ng(a2) { 6103 var b2 = a2._init; 6104 return b2(a2._payload); 6105 } 6106 function Og(a2) { 6107 function b2(b3, c3) { 6108 if (a2) { 6109 var d3 = b3.deletions; 6110 null === d3 ? (b3.deletions = [c3], b3.flags |= 16) : d3.push(c3); 6111 } 6112 } 6113 function c2(c3, d3) { 6114 if (!a2) return null; 6115 for (; null !== d3; ) b2(c3, d3), d3 = d3.sibling; 6116 return null; 6117 } 6118 function d2(a3, b3) { 6119 for (a3 = /* @__PURE__ */ new Map(); null !== b3; ) null !== b3.key ? a3.set(b3.key, b3) : a3.set(b3.index, b3), b3 = b3.sibling; 6120 return a3; 6121 } 6122 function e2(a3, b3) { 6123 a3 = Pg(a3, b3); 6124 a3.index = 0; 6125 a3.sibling = null; 6126 return a3; 6127 } 6128 function f2(b3, c3, d3) { 6129 b3.index = d3; 6130 if (!a2) return b3.flags |= 1048576, c3; 6131 d3 = b3.alternate; 6132 if (null !== d3) return d3 = d3.index, d3 < c3 ? (b3.flags |= 2, c3) : d3; 6133 b3.flags |= 2; 6134 return c3; 6135 } 6136 function g2(b3) { 6137 a2 && null === b3.alternate && (b3.flags |= 2); 6138 return b3; 6139 } 6140 function h2(a3, b3, c3, d3) { 6141 if (null === b3 || 6 !== b3.tag) return b3 = Qg(c3, a3.mode, d3), b3.return = a3, b3; 6142 b3 = e2(b3, c3); 6143 b3.return = a3; 6144 return b3; 6145 } 6146 function k2(a3, b3, c3, d3) { 6147 var f3 = c3.type; 6148 if (f3 === ya2) return m2(a3, b3, c3.props.children, d3, c3.key); 6149 if (null !== b3 && (b3.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === Ha2 && Ng(f3) === b3.type)) return d3 = e2(b3, c3.props), d3.ref = Lg(a3, b3, c3), d3.return = a3, d3; 6150 d3 = Rg(c3.type, c3.key, c3.props, null, a3.mode, d3); 6151 d3.ref = Lg(a3, b3, c3); 6152 d3.return = a3; 6153 return d3; 6154 } 6155 function l2(a3, b3, c3, d3) { 6156 if (null === b3 || 4 !== b3.tag || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation) return b3 = Sg(c3, a3.mode, d3), b3.return = a3, b3; 6157 b3 = e2(b3, c3.children || []); 6158 b3.return = a3; 6159 return b3; 6160 } 6161 function m2(a3, b3, c3, d3, f3) { 6162 if (null === b3 || 7 !== b3.tag) return b3 = Tg(c3, a3.mode, d3, f3), b3.return = a3, b3; 6163 b3 = e2(b3, c3); 6164 b3.return = a3; 6165 return b3; 6166 } 6167 function q2(a3, b3, c3) { 6168 if ("string" === typeof b3 && "" !== b3 || "number" === typeof b3) return b3 = Qg("" + b3, a3.mode, c3), b3.return = a3, b3; 6169 if ("object" === typeof b3 && null !== b3) { 6170 switch (b3.$$typeof) { 6171 case va2: 6172 return c3 = Rg(b3.type, b3.key, b3.props, null, a3.mode, c3), c3.ref = Lg(a3, null, b3), c3.return = a3, c3; 6173 case wa2: 6174 return b3 = Sg(b3, a3.mode, c3), b3.return = a3, b3; 6175 case Ha2: 6176 var d3 = b3._init; 6177 return q2(a3, d3(b3._payload), c3); 6178 } 6179 if (eb(b3) || Ka2(b3)) return b3 = Tg(b3, a3.mode, c3, null), b3.return = a3, b3; 6180 Mg(a3, b3); 6181 } 6182 return null; 6183 } 6184 function r2(a3, b3, c3, d3) { 6185 var e3 = null !== b3 ? b3.key : null; 6186 if ("string" === typeof c3 && "" !== c3 || "number" === typeof c3) return null !== e3 ? null : h2(a3, b3, "" + c3, d3); 6187 if ("object" === typeof c3 && null !== c3) { 6188 switch (c3.$$typeof) { 6189 case va2: 6190 return c3.key === e3 ? k2(a3, b3, c3, d3) : null; 6191 case wa2: 6192 return c3.key === e3 ? l2(a3, b3, c3, d3) : null; 6193 case Ha2: 6194 return e3 = c3._init, r2( 6195 a3, 6196 b3, 6197 e3(c3._payload), 6198 d3 6199 ); 6200 } 6201 if (eb(c3) || Ka2(c3)) return null !== e3 ? null : m2(a3, b3, c3, d3, null); 6202 Mg(a3, c3); 6203 } 6204 return null; 6205 } 6206 function y2(a3, b3, c3, d3, e3) { 6207 if ("string" === typeof d3 && "" !== d3 || "number" === typeof d3) return a3 = a3.get(c3) || null, h2(b3, a3, "" + d3, e3); 6208 if ("object" === typeof d3 && null !== d3) { 6209 switch (d3.$$typeof) { 6210 case va2: 6211 return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, k2(b3, a3, d3, e3); 6212 case wa2: 6213 return a3 = a3.get(null === d3.key ? c3 : d3.key) || null, l2(b3, a3, d3, e3); 6214 case Ha2: 6215 var f3 = d3._init; 6216 return y2(a3, b3, c3, f3(d3._payload), e3); 6217 } 6218 if (eb(d3) || Ka2(d3)) return a3 = a3.get(c3) || null, m2(b3, a3, d3, e3, null); 6219 Mg(b3, d3); 6220 } 6221 return null; 6222 } 6223 function n2(e3, g3, h3, k3) { 6224 for (var l3 = null, m3 = null, u2 = g3, w2 = g3 = 0, x2 = null; null !== u2 && w2 < h3.length; w2++) { 6225 u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling; 6226 var n3 = r2(e3, u2, h3[w2], k3); 6227 if (null === n3) { 6228 null === u2 && (u2 = x2); 6229 break; 6230 } 6231 a2 && u2 && null === n3.alternate && b2(e3, u2); 6232 g3 = f2(n3, g3, w2); 6233 null === m3 ? l3 = n3 : m3.sibling = n3; 6234 m3 = n3; 6235 u2 = x2; 6236 } 6237 if (w2 === h3.length) return c2(e3, u2), I2 && tg(e3, w2), l3; 6238 if (null === u2) { 6239 for (; w2 < h3.length; w2++) u2 = q2(e3, h3[w2], k3), null !== u2 && (g3 = f2(u2, g3, w2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2); 6240 I2 && tg(e3, w2); 6241 return l3; 6242 } 6243 for (u2 = d2(e3, u2); w2 < h3.length; w2++) x2 = y2(u2, e3, w2, h3[w2], k3), null !== x2 && (a2 && null !== x2.alternate && u2.delete(null === x2.key ? w2 : x2.key), g3 = f2(x2, g3, w2), null === m3 ? l3 = x2 : m3.sibling = x2, m3 = x2); 6244 a2 && u2.forEach(function(a3) { 6245 return b2(e3, a3); 6246 }); 6247 I2 && tg(e3, w2); 6248 return l3; 6249 } 6250 function t2(e3, g3, h3, k3) { 6251 var l3 = Ka2(h3); 6252 if ("function" !== typeof l3) throw Error(p2(150)); 6253 h3 = l3.call(h3); 6254 if (null == h3) throw Error(p2(151)); 6255 for (var u2 = l3 = null, m3 = g3, w2 = g3 = 0, x2 = null, n3 = h3.next(); null !== m3 && !n3.done; w2++, n3 = h3.next()) { 6256 m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling; 6257 var t3 = r2(e3, m3, n3.value, k3); 6258 if (null === t3) { 6259 null === m3 && (m3 = x2); 6260 break; 6261 } 6262 a2 && m3 && null === t3.alternate && b2(e3, m3); 6263 g3 = f2(t3, g3, w2); 6264 null === u2 ? l3 = t3 : u2.sibling = t3; 6265 u2 = t3; 6266 m3 = x2; 6267 } 6268 if (n3.done) return c2( 6269 e3, 6270 m3 6271 ), I2 && tg(e3, w2), l3; 6272 if (null === m3) { 6273 for (; !n3.done; w2++, n3 = h3.next()) n3 = q2(e3, n3.value, k3), null !== n3 && (g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); 6274 I2 && tg(e3, w2); 6275 return l3; 6276 } 6277 for (m3 = d2(e3, m3); !n3.done; w2++, n3 = h3.next()) n3 = y2(m3, e3, w2, n3.value, k3), null !== n3 && (a2 && null !== n3.alternate && m3.delete(null === n3.key ? w2 : n3.key), g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3); 6278 a2 && m3.forEach(function(a3) { 6279 return b2(e3, a3); 6280 }); 6281 I2 && tg(e3, w2); 6282 return l3; 6283 } 6284 function J2(a3, d3, f3, h3) { 6285 "object" === typeof f3 && null !== f3 && f3.type === ya2 && null === f3.key && (f3 = f3.props.children); 6286 if ("object" === typeof f3 && null !== f3) { 6287 switch (f3.$$typeof) { 6288 case va2: 6289 a: { 6290 for (var k3 = f3.key, l3 = d3; null !== l3; ) { 6291 if (l3.key === k3) { 6292 k3 = f3.type; 6293 if (k3 === ya2) { 6294 if (7 === l3.tag) { 6295 c2(a3, l3.sibling); 6296 d3 = e2(l3, f3.props.children); 6297 d3.return = a3; 6298 a3 = d3; 6299 break a; 6300 } 6301 } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha2 && Ng(k3) === l3.type) { 6302 c2(a3, l3.sibling); 6303 d3 = e2(l3, f3.props); 6304 d3.ref = Lg(a3, l3, f3); 6305 d3.return = a3; 6306 a3 = d3; 6307 break a; 6308 } 6309 c2(a3, l3); 6310 break; 6311 } else b2(a3, l3); 6312 l3 = l3.sibling; 6313 } 6314 f3.type === ya2 ? (d3 = Tg(f3.props.children, a3.mode, h3, f3.key), d3.return = a3, a3 = d3) : (h3 = Rg(f3.type, f3.key, f3.props, null, a3.mode, h3), h3.ref = Lg(a3, d3, f3), h3.return = a3, a3 = h3); 6315 } 6316 return g2(a3); 6317 case wa2: 6318 a: { 6319 for (l3 = f3.key; null !== d3; ) { 6320 if (d3.key === l3) if (4 === d3.tag && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) { 6321 c2(a3, d3.sibling); 6322 d3 = e2(d3, f3.children || []); 6323 d3.return = a3; 6324 a3 = d3; 6325 break a; 6326 } else { 6327 c2(a3, d3); 6328 break; 6329 } 6330 else b2(a3, d3); 6331 d3 = d3.sibling; 6332 } 6333 d3 = Sg(f3, a3.mode, h3); 6334 d3.return = a3; 6335 a3 = d3; 6336 } 6337 return g2(a3); 6338 case Ha2: 6339 return l3 = f3._init, J2(a3, d3, l3(f3._payload), h3); 6340 } 6341 if (eb(f3)) return n2(a3, d3, f3, h3); 6342 if (Ka2(f3)) return t2(a3, d3, f3, h3); 6343 Mg(a3, f3); 6344 } 6345 return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d3 && 6 === d3.tag ? (c2(a3, d3.sibling), d3 = e2(d3, f3), d3.return = a3, a3 = d3) : (c2(a3, d3), d3 = Qg(f3, a3.mode, h3), d3.return = a3, a3 = d3), g2(a3)) : c2(a3, d3); 6346 } 6347 return J2; 6348 } 6349 var Ug = Og(true), Vg = Og(false), Wg = Uf(null), Xg = null, Yg = null, Zg = null; 6350 function $g() { 6351 Zg = Yg = Xg = null; 6352 } 6353 function ah(a2) { 6354 var b2 = Wg.current; 6355 E2(Wg); 6356 a2._currentValue = b2; 6357 } 6358 function bh(a2, b2, c2) { 6359 for (; null !== a2; ) { 6360 var d2 = a2.alternate; 6361 (a2.childLanes & b2) !== b2 ? (a2.childLanes |= b2, null !== d2 && (d2.childLanes |= b2)) : null !== d2 && (d2.childLanes & b2) !== b2 && (d2.childLanes |= b2); 6362 if (a2 === c2) break; 6363 a2 = a2.return; 6364 } 6365 } 6366 function ch(a2, b2) { 6367 Xg = a2; 6368 Zg = Yg = null; 6369 a2 = a2.dependencies; 6370 null !== a2 && null !== a2.firstContext && (0 !== (a2.lanes & b2) && (dh = true), a2.firstContext = null); 6371 } 6372 function eh(a2) { 6373 var b2 = a2._currentValue; 6374 if (Zg !== a2) if (a2 = { context: a2, memoizedValue: b2, next: null }, null === Yg) { 6375 if (null === Xg) throw Error(p2(308)); 6376 Yg = a2; 6377 Xg.dependencies = { lanes: 0, firstContext: a2 }; 6378 } else Yg = Yg.next = a2; 6379 return b2; 6380 } 6381 var fh = null; 6382 function gh(a2) { 6383 null === fh ? fh = [a2] : fh.push(a2); 6384 } 6385 function hh(a2, b2, c2, d2) { 6386 var e2 = b2.interleaved; 6387 null === e2 ? (c2.next = c2, gh(b2)) : (c2.next = e2.next, e2.next = c2); 6388 b2.interleaved = c2; 6389 return ih(a2, d2); 6390 } 6391 function ih(a2, b2) { 6392 a2.lanes |= b2; 6393 var c2 = a2.alternate; 6394 null !== c2 && (c2.lanes |= b2); 6395 c2 = a2; 6396 for (a2 = a2.return; null !== a2; ) a2.childLanes |= b2, c2 = a2.alternate, null !== c2 && (c2.childLanes |= b2), c2 = a2, a2 = a2.return; 6397 return 3 === c2.tag ? c2.stateNode : null; 6398 } 6399 var jh = false; 6400 function kh(a2) { 6401 a2.updateQueue = { baseState: a2.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; 6402 } 6403 function lh(a2, b2) { 6404 a2 = a2.updateQueue; 6405 b2.updateQueue === a2 && (b2.updateQueue = { baseState: a2.baseState, firstBaseUpdate: a2.firstBaseUpdate, lastBaseUpdate: a2.lastBaseUpdate, shared: a2.shared, effects: a2.effects }); 6406 } 6407 function mh(a2, b2) { 6408 return { eventTime: a2, lane: b2, tag: 0, payload: null, callback: null, next: null }; 6409 } 6410 function nh(a2, b2, c2) { 6411 var d2 = a2.updateQueue; 6412 if (null === d2) return null; 6413 d2 = d2.shared; 6414 if (0 !== (K2 & 2)) { 6415 var e2 = d2.pending; 6416 null === e2 ? b2.next = b2 : (b2.next = e2.next, e2.next = b2); 6417 d2.pending = b2; 6418 return ih(a2, c2); 6419 } 6420 e2 = d2.interleaved; 6421 null === e2 ? (b2.next = b2, gh(d2)) : (b2.next = e2.next, e2.next = b2); 6422 d2.interleaved = b2; 6423 return ih(a2, c2); 6424 } 6425 function oh(a2, b2, c2) { 6426 b2 = b2.updateQueue; 6427 if (null !== b2 && (b2 = b2.shared, 0 !== (c2 & 4194240))) { 6428 var d2 = b2.lanes; 6429 d2 &= a2.pendingLanes; 6430 c2 |= d2; 6431 b2.lanes = c2; 6432 Cc(a2, c2); 6433 } 6434 } 6435 function ph(a2, b2) { 6436 var c2 = a2.updateQueue, d2 = a2.alternate; 6437 if (null !== d2 && (d2 = d2.updateQueue, c2 === d2)) { 6438 var e2 = null, f2 = null; 6439 c2 = c2.firstBaseUpdate; 6440 if (null !== c2) { 6441 do { 6442 var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null }; 6443 null === f2 ? e2 = f2 = g2 : f2 = f2.next = g2; 6444 c2 = c2.next; 6445 } while (null !== c2); 6446 null === f2 ? e2 = f2 = b2 : f2 = f2.next = b2; 6447 } else e2 = f2 = b2; 6448 c2 = { baseState: d2.baseState, firstBaseUpdate: e2, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects }; 6449 a2.updateQueue = c2; 6450 return; 6451 } 6452 a2 = c2.lastBaseUpdate; 6453 null === a2 ? c2.firstBaseUpdate = b2 : a2.next = b2; 6454 c2.lastBaseUpdate = b2; 6455 } 6456 function qh(a2, b2, c2, d2) { 6457 var e2 = a2.updateQueue; 6458 jh = false; 6459 var f2 = e2.firstBaseUpdate, g2 = e2.lastBaseUpdate, h2 = e2.shared.pending; 6460 if (null !== h2) { 6461 e2.shared.pending = null; 6462 var k2 = h2, l2 = k2.next; 6463 k2.next = null; 6464 null === g2 ? f2 = l2 : g2.next = l2; 6465 g2 = k2; 6466 var m2 = a2.alternate; 6467 null !== m2 && (m2 = m2.updateQueue, h2 = m2.lastBaseUpdate, h2 !== g2 && (null === h2 ? m2.firstBaseUpdate = l2 : h2.next = l2, m2.lastBaseUpdate = k2)); 6468 } 6469 if (null !== f2) { 6470 var q2 = e2.baseState; 6471 g2 = 0; 6472 m2 = l2 = k2 = null; 6473 h2 = f2; 6474 do { 6475 var r2 = h2.lane, y2 = h2.eventTime; 6476 if ((d2 & r2) === r2) { 6477 null !== m2 && (m2 = m2.next = { 6478 eventTime: y2, 6479 lane: 0, 6480 tag: h2.tag, 6481 payload: h2.payload, 6482 callback: h2.callback, 6483 next: null 6484 }); 6485 a: { 6486 var n2 = a2, t2 = h2; 6487 r2 = b2; 6488 y2 = c2; 6489 switch (t2.tag) { 6490 case 1: 6491 n2 = t2.payload; 6492 if ("function" === typeof n2) { 6493 q2 = n2.call(y2, q2, r2); 6494 break a; 6495 } 6496 q2 = n2; 6497 break a; 6498 case 3: 6499 n2.flags = n2.flags & -65537 | 128; 6500 case 0: 6501 n2 = t2.payload; 6502 r2 = "function" === typeof n2 ? n2.call(y2, q2, r2) : n2; 6503 if (null === r2 || void 0 === r2) break a; 6504 q2 = A2({}, q2, r2); 6505 break a; 6506 case 2: 6507 jh = true; 6508 } 6509 } 6510 null !== h2.callback && 0 !== h2.lane && (a2.flags |= 64, r2 = e2.effects, null === r2 ? e2.effects = [h2] : r2.push(h2)); 6511 } else y2 = { eventTime: y2, lane: r2, tag: h2.tag, payload: h2.payload, callback: h2.callback, next: null }, null === m2 ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g2 |= r2; 6512 h2 = h2.next; 6513 if (null === h2) if (h2 = e2.shared.pending, null === h2) break; 6514 else r2 = h2, h2 = r2.next, r2.next = null, e2.lastBaseUpdate = r2, e2.shared.pending = null; 6515 } while (1); 6516 null === m2 && (k2 = q2); 6517 e2.baseState = k2; 6518 e2.firstBaseUpdate = l2; 6519 e2.lastBaseUpdate = m2; 6520 b2 = e2.shared.interleaved; 6521 if (null !== b2) { 6522 e2 = b2; 6523 do 6524 g2 |= e2.lane, e2 = e2.next; 6525 while (e2 !== b2); 6526 } else null === f2 && (e2.shared.lanes = 0); 6527 rh |= g2; 6528 a2.lanes = g2; 6529 a2.memoizedState = q2; 6530 } 6531 } 6532 function sh(a2, b2, c2) { 6533 a2 = b2.effects; 6534 b2.effects = null; 6535 if (null !== a2) for (b2 = 0; b2 < a2.length; b2++) { 6536 var d2 = a2[b2], e2 = d2.callback; 6537 if (null !== e2) { 6538 d2.callback = null; 6539 d2 = c2; 6540 if ("function" !== typeof e2) throw Error(p2(191, e2)); 6541 e2.call(d2); 6542 } 6543 } 6544 } 6545 var th = {}, uh = Uf(th), vh2 = Uf(th), wh = Uf(th); 6546 function xh(a2) { 6547 if (a2 === th) throw Error(p2(174)); 6548 return a2; 6549 } 6550 function yh(a2, b2) { 6551 G2(wh, b2); 6552 G2(vh2, a2); 6553 G2(uh, th); 6554 a2 = b2.nodeType; 6555 switch (a2) { 6556 case 9: 6557 case 11: 6558 b2 = (b2 = b2.documentElement) ? b2.namespaceURI : lb(null, ""); 6559 break; 6560 default: 6561 a2 = 8 === a2 ? b2.parentNode : b2, b2 = a2.namespaceURI || null, a2 = a2.tagName, b2 = lb(b2, a2); 6562 } 6563 E2(uh); 6564 G2(uh, b2); 6565 } 6566 function zh() { 6567 E2(uh); 6568 E2(vh2); 6569 E2(wh); 6570 } 6571 function Ah(a2) { 6572 xh(wh.current); 6573 var b2 = xh(uh.current); 6574 var c2 = lb(b2, a2.type); 6575 b2 !== c2 && (G2(vh2, a2), G2(uh, c2)); 6576 } 6577 function Bh(a2) { 6578 vh2.current === a2 && (E2(uh), E2(vh2)); 6579 } 6580 var L2 = Uf(0); 6581 function Ch(a2) { 6582 for (var b2 = a2; null !== b2; ) { 6583 if (13 === b2.tag) { 6584 var c2 = b2.memoizedState; 6585 if (null !== c2 && (c2 = c2.dehydrated, null === c2 || "$?" === c2.data || "$!" === c2.data)) return b2; 6586 } else if (19 === b2.tag && void 0 !== b2.memoizedProps.revealOrder) { 6587 if (0 !== (b2.flags & 128)) return b2; 6588 } else if (null !== b2.child) { 6589 b2.child.return = b2; 6590 b2 = b2.child; 6591 continue; 6592 } 6593 if (b2 === a2) break; 6594 for (; null === b2.sibling; ) { 6595 if (null === b2.return || b2.return === a2) return null; 6596 b2 = b2.return; 6597 } 6598 b2.sibling.return = b2.return; 6599 b2 = b2.sibling; 6600 } 6601 return null; 6602 } 6603 var Dh = []; 6604 function Eh() { 6605 for (var a2 = 0; a2 < Dh.length; a2++) Dh[a2]._workInProgressVersionPrimary = null; 6606 Dh.length = 0; 6607 } 6608 var Fh = ua2.ReactCurrentDispatcher, Gh = ua2.ReactCurrentBatchConfig, Hh = 0, M2 = null, N2 = null, O2 = null, Ih = false, Jh = false, Kh = 0, Lh = 0; 6609 function P2() { 6610 throw Error(p2(321)); 6611 } 6612 function Mh(a2, b2) { 6613 if (null === b2) return false; 6614 for (var c2 = 0; c2 < b2.length && c2 < a2.length; c2++) if (!He2(a2[c2], b2[c2])) return false; 6615 return true; 6616 } 6617 function Nh(a2, b2, c2, d2, e2, f2) { 6618 Hh = f2; 6619 M2 = b2; 6620 b2.memoizedState = null; 6621 b2.updateQueue = null; 6622 b2.lanes = 0; 6623 Fh.current = null === a2 || null === a2.memoizedState ? Oh : Ph; 6624 a2 = c2(d2, e2); 6625 if (Jh) { 6626 f2 = 0; 6627 do { 6628 Jh = false; 6629 Kh = 0; 6630 if (25 <= f2) throw Error(p2(301)); 6631 f2 += 1; 6632 O2 = N2 = null; 6633 b2.updateQueue = null; 6634 Fh.current = Qh; 6635 a2 = c2(d2, e2); 6636 } while (Jh); 6637 } 6638 Fh.current = Rh; 6639 b2 = null !== N2 && null !== N2.next; 6640 Hh = 0; 6641 O2 = N2 = M2 = null; 6642 Ih = false; 6643 if (b2) throw Error(p2(300)); 6644 return a2; 6645 } 6646 function Sh() { 6647 var a2 = 0 !== Kh; 6648 Kh = 0; 6649 return a2; 6650 } 6651 function Th() { 6652 var a2 = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; 6653 null === O2 ? M2.memoizedState = O2 = a2 : O2 = O2.next = a2; 6654 return O2; 6655 } 6656 function Uh() { 6657 if (null === N2) { 6658 var a2 = M2.alternate; 6659 a2 = null !== a2 ? a2.memoizedState : null; 6660 } else a2 = N2.next; 6661 var b2 = null === O2 ? M2.memoizedState : O2.next; 6662 if (null !== b2) O2 = b2, N2 = a2; 6663 else { 6664 if (null === a2) throw Error(p2(310)); 6665 N2 = a2; 6666 a2 = { memoizedState: N2.memoizedState, baseState: N2.baseState, baseQueue: N2.baseQueue, queue: N2.queue, next: null }; 6667 null === O2 ? M2.memoizedState = O2 = a2 : O2 = O2.next = a2; 6668 } 6669 return O2; 6670 } 6671 function Vh(a2, b2) { 6672 return "function" === typeof b2 ? b2(a2) : b2; 6673 } 6674 function Wh(a2) { 6675 var b2 = Uh(), c2 = b2.queue; 6676 if (null === c2) throw Error(p2(311)); 6677 c2.lastRenderedReducer = a2; 6678 var d2 = N2, e2 = d2.baseQueue, f2 = c2.pending; 6679 if (null !== f2) { 6680 if (null !== e2) { 6681 var g2 = e2.next; 6682 e2.next = f2.next; 6683 f2.next = g2; 6684 } 6685 d2.baseQueue = e2 = f2; 6686 c2.pending = null; 6687 } 6688 if (null !== e2) { 6689 f2 = e2.next; 6690 d2 = d2.baseState; 6691 var h2 = g2 = null, k2 = null, l2 = f2; 6692 do { 6693 var m2 = l2.lane; 6694 if ((Hh & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d2 = l2.hasEagerState ? l2.eagerState : a2(d2, l2.action); 6695 else { 6696 var q2 = { 6697 lane: m2, 6698 action: l2.action, 6699 hasEagerState: l2.hasEagerState, 6700 eagerState: l2.eagerState, 6701 next: null 6702 }; 6703 null === k2 ? (h2 = k2 = q2, g2 = d2) : k2 = k2.next = q2; 6704 M2.lanes |= m2; 6705 rh |= m2; 6706 } 6707 l2 = l2.next; 6708 } while (null !== l2 && l2 !== f2); 6709 null === k2 ? g2 = d2 : k2.next = h2; 6710 He2(d2, b2.memoizedState) || (dh = true); 6711 b2.memoizedState = d2; 6712 b2.baseState = g2; 6713 b2.baseQueue = k2; 6714 c2.lastRenderedState = d2; 6715 } 6716 a2 = c2.interleaved; 6717 if (null !== a2) { 6718 e2 = a2; 6719 do 6720 f2 = e2.lane, M2.lanes |= f2, rh |= f2, e2 = e2.next; 6721 while (e2 !== a2); 6722 } else null === e2 && (c2.lanes = 0); 6723 return [b2.memoizedState, c2.dispatch]; 6724 } 6725 function Xh(a2) { 6726 var b2 = Uh(), c2 = b2.queue; 6727 if (null === c2) throw Error(p2(311)); 6728 c2.lastRenderedReducer = a2; 6729 var d2 = c2.dispatch, e2 = c2.pending, f2 = b2.memoizedState; 6730 if (null !== e2) { 6731 c2.pending = null; 6732 var g2 = e2 = e2.next; 6733 do 6734 f2 = a2(f2, g2.action), g2 = g2.next; 6735 while (g2 !== e2); 6736 He2(f2, b2.memoizedState) || (dh = true); 6737 b2.memoizedState = f2; 6738 null === b2.baseQueue && (b2.baseState = f2); 6739 c2.lastRenderedState = f2; 6740 } 6741 return [f2, d2]; 6742 } 6743 function Yh() { 6744 } 6745 function Zh(a2, b2) { 6746 var c2 = M2, d2 = Uh(), e2 = b2(), f2 = !He2(d2.memoizedState, e2); 6747 f2 && (d2.memoizedState = e2, dh = true); 6748 d2 = d2.queue; 6749 $h(ai2.bind(null, c2, d2, a2), [a2]); 6750 if (d2.getSnapshot !== b2 || f2 || null !== O2 && O2.memoizedState.tag & 1) { 6751 c2.flags |= 2048; 6752 bi2(9, ci2.bind(null, c2, d2, e2, b2), void 0, null); 6753 if (null === Q2) throw Error(p2(349)); 6754 0 !== (Hh & 30) || di2(c2, b2, e2); 6755 } 6756 return e2; 6757 } 6758 function di2(a2, b2, c2) { 6759 a2.flags |= 16384; 6760 a2 = { getSnapshot: b2, value: c2 }; 6761 b2 = M2.updateQueue; 6762 null === b2 ? (b2 = { lastEffect: null, stores: null }, M2.updateQueue = b2, b2.stores = [a2]) : (c2 = b2.stores, null === c2 ? b2.stores = [a2] : c2.push(a2)); 6763 } 6764 function ci2(a2, b2, c2, d2) { 6765 b2.value = c2; 6766 b2.getSnapshot = d2; 6767 ei2(b2) && fi2(a2); 6768 } 6769 function ai2(a2, b2, c2) { 6770 return c2(function() { 6771 ei2(b2) && fi2(a2); 6772 }); 6773 } 6774 function ei2(a2) { 6775 var b2 = a2.getSnapshot; 6776 a2 = a2.value; 6777 try { 6778 var c2 = b2(); 6779 return !He2(a2, c2); 6780 } catch (d2) { 6781 return true; 6782 } 6783 } 6784 function fi2(a2) { 6785 var b2 = ih(a2, 1); 6786 null !== b2 && gi2(b2, a2, 1, -1); 6787 } 6788 function hi(a2) { 6789 var b2 = Th(); 6790 "function" === typeof a2 && (a2 = a2()); 6791 b2.memoizedState = b2.baseState = a2; 6792 a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a2 }; 6793 b2.queue = a2; 6794 a2 = a2.dispatch = ii2.bind(null, M2, a2); 6795 return [b2.memoizedState, a2]; 6796 } 6797 function bi2(a2, b2, c2, d2) { 6798 a2 = { tag: a2, create: b2, destroy: c2, deps: d2, next: null }; 6799 b2 = M2.updateQueue; 6800 null === b2 ? (b2 = { lastEffect: null, stores: null }, M2.updateQueue = b2, b2.lastEffect = a2.next = a2) : (c2 = b2.lastEffect, null === c2 ? b2.lastEffect = a2.next = a2 : (d2 = c2.next, c2.next = a2, a2.next = d2, b2.lastEffect = a2)); 6801 return a2; 6802 } 6803 function ji2() { 6804 return Uh().memoizedState; 6805 } 6806 function ki2(a2, b2, c2, d2) { 6807 var e2 = Th(); 6808 M2.flags |= a2; 6809 e2.memoizedState = bi2(1 | b2, c2, void 0, void 0 === d2 ? null : d2); 6810 } 6811 function li2(a2, b2, c2, d2) { 6812 var e2 = Uh(); 6813 d2 = void 0 === d2 ? null : d2; 6814 var f2 = void 0; 6815 if (null !== N2) { 6816 var g2 = N2.memoizedState; 6817 f2 = g2.destroy; 6818 if (null !== d2 && Mh(d2, g2.deps)) { 6819 e2.memoizedState = bi2(b2, c2, f2, d2); 6820 return; 6821 } 6822 } 6823 M2.flags |= a2; 6824 e2.memoizedState = bi2(1 | b2, c2, f2, d2); 6825 } 6826 function mi2(a2, b2) { 6827 return ki2(8390656, 8, a2, b2); 6828 } 6829 function $h(a2, b2) { 6830 return li2(2048, 8, a2, b2); 6831 } 6832 function ni2(a2, b2) { 6833 return li2(4, 2, a2, b2); 6834 } 6835 function oi2(a2, b2) { 6836 return li2(4, 4, a2, b2); 6837 } 6838 function pi2(a2, b2) { 6839 if ("function" === typeof b2) return a2 = a2(), b2(a2), function() { 6840 b2(null); 6841 }; 6842 if (null !== b2 && void 0 !== b2) return a2 = a2(), b2.current = a2, function() { 6843 b2.current = null; 6844 }; 6845 } 6846 function qi2(a2, b2, c2) { 6847 c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null; 6848 return li2(4, 4, pi2.bind(null, b2, a2), c2); 6849 } 6850 function ri2() { 6851 } 6852 function si2(a2, b2) { 6853 var c2 = Uh(); 6854 b2 = void 0 === b2 ? null : b2; 6855 var d2 = c2.memoizedState; 6856 if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0]; 6857 c2.memoizedState = [a2, b2]; 6858 return a2; 6859 } 6860 function ti2(a2, b2) { 6861 var c2 = Uh(); 6862 b2 = void 0 === b2 ? null : b2; 6863 var d2 = c2.memoizedState; 6864 if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0]; 6865 a2 = a2(); 6866 c2.memoizedState = [a2, b2]; 6867 return a2; 6868 } 6869 function ui2(a2, b2, c2) { 6870 if (0 === (Hh & 21)) return a2.baseState && (a2.baseState = false, dh = true), a2.memoizedState = c2; 6871 He2(c2, b2) || (c2 = yc2(), M2.lanes |= c2, rh |= c2, a2.baseState = true); 6872 return b2; 6873 } 6874 function vi(a2, b2) { 6875 var c2 = C2; 6876 C2 = 0 !== c2 && 4 > c2 ? c2 : 4; 6877 a2(true); 6878 var d2 = Gh.transition; 6879 Gh.transition = {}; 6880 try { 6881 a2(false), b2(); 6882 } finally { 6883 C2 = c2, Gh.transition = d2; 6884 } 6885 } 6886 function wi2() { 6887 return Uh().memoizedState; 6888 } 6889 function xi2(a2, b2, c2) { 6890 var d2 = yi2(a2); 6891 c2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null }; 6892 if (zi2(a2)) Ai2(b2, c2); 6893 else if (c2 = hh(a2, b2, c2, d2), null !== c2) { 6894 var e2 = R2(); 6895 gi2(c2, a2, d2, e2); 6896 Bi2(c2, b2, d2); 6897 } 6898 } 6899 function ii2(a2, b2, c2) { 6900 var d2 = yi2(a2), e2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null }; 6901 if (zi2(a2)) Ai2(b2, e2); 6902 else { 6903 var f2 = a2.alternate; 6904 if (0 === a2.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b2.lastRenderedReducer, null !== f2)) try { 6905 var g2 = b2.lastRenderedState, h2 = f2(g2, c2); 6906 e2.hasEagerState = true; 6907 e2.eagerState = h2; 6908 if (He2(h2, g2)) { 6909 var k2 = b2.interleaved; 6910 null === k2 ? (e2.next = e2, gh(b2)) : (e2.next = k2.next, k2.next = e2); 6911 b2.interleaved = e2; 6912 return; 6913 } 6914 } catch (l2) { 6915 } finally { 6916 } 6917 c2 = hh(a2, b2, e2, d2); 6918 null !== c2 && (e2 = R2(), gi2(c2, a2, d2, e2), Bi2(c2, b2, d2)); 6919 } 6920 } 6921 function zi2(a2) { 6922 var b2 = a2.alternate; 6923 return a2 === M2 || null !== b2 && b2 === M2; 6924 } 6925 function Ai2(a2, b2) { 6926 Jh = Ih = true; 6927 var c2 = a2.pending; 6928 null === c2 ? b2.next = b2 : (b2.next = c2.next, c2.next = b2); 6929 a2.pending = b2; 6930 } 6931 function Bi2(a2, b2, c2) { 6932 if (0 !== (c2 & 4194240)) { 6933 var d2 = b2.lanes; 6934 d2 &= a2.pendingLanes; 6935 c2 |= d2; 6936 b2.lanes = c2; 6937 Cc(a2, c2); 6938 } 6939 } 6940 var Rh = { readContext: eh, useCallback: P2, useContext: P2, useEffect: P2, useImperativeHandle: P2, useInsertionEffect: P2, useLayoutEffect: P2, useMemo: P2, useReducer: P2, useRef: P2, useState: P2, useDebugValue: P2, useDeferredValue: P2, useTransition: P2, useMutableSource: P2, useSyncExternalStore: P2, useId: P2, unstable_isNewReconciler: false }, Oh = { readContext: eh, useCallback: function(a2, b2) { 6941 Th().memoizedState = [a2, void 0 === b2 ? null : b2]; 6942 return a2; 6943 }, useContext: eh, useEffect: mi2, useImperativeHandle: function(a2, b2, c2) { 6944 c2 = null !== c2 && void 0 !== c2 ? c2.concat([a2]) : null; 6945 return ki2( 6946 4194308, 6947 4, 6948 pi2.bind(null, b2, a2), 6949 c2 6950 ); 6951 }, useLayoutEffect: function(a2, b2) { 6952 return ki2(4194308, 4, a2, b2); 6953 }, useInsertionEffect: function(a2, b2) { 6954 return ki2(4, 2, a2, b2); 6955 }, useMemo: function(a2, b2) { 6956 var c2 = Th(); 6957 b2 = void 0 === b2 ? null : b2; 6958 a2 = a2(); 6959 c2.memoizedState = [a2, b2]; 6960 return a2; 6961 }, useReducer: function(a2, b2, c2) { 6962 var d2 = Th(); 6963 b2 = void 0 !== c2 ? c2(b2) : b2; 6964 d2.memoizedState = d2.baseState = b2; 6965 a2 = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a2, lastRenderedState: b2 }; 6966 d2.queue = a2; 6967 a2 = a2.dispatch = xi2.bind(null, M2, a2); 6968 return [d2.memoizedState, a2]; 6969 }, useRef: function(a2) { 6970 var b2 = Th(); 6971 a2 = { current: a2 }; 6972 return b2.memoizedState = a2; 6973 }, useState: hi, useDebugValue: ri2, useDeferredValue: function(a2) { 6974 return Th().memoizedState = a2; 6975 }, useTransition: function() { 6976 var a2 = hi(false), b2 = a2[0]; 6977 a2 = vi.bind(null, a2[1]); 6978 Th().memoizedState = a2; 6979 return [b2, a2]; 6980 }, useMutableSource: function() { 6981 }, useSyncExternalStore: function(a2, b2, c2) { 6982 var d2 = M2, e2 = Th(); 6983 if (I2) { 6984 if (void 0 === c2) throw Error(p2(407)); 6985 c2 = c2(); 6986 } else { 6987 c2 = b2(); 6988 if (null === Q2) throw Error(p2(349)); 6989 0 !== (Hh & 30) || di2(d2, b2, c2); 6990 } 6991 e2.memoizedState = c2; 6992 var f2 = { value: c2, getSnapshot: b2 }; 6993 e2.queue = f2; 6994 mi2(ai2.bind( 6995 null, 6996 d2, 6997 f2, 6998 a2 6999 ), [a2]); 7000 d2.flags |= 2048; 7001 bi2(9, ci2.bind(null, d2, f2, c2, b2), void 0, null); 7002 return c2; 7003 }, useId: function() { 7004 var a2 = Th(), b2 = Q2.identifierPrefix; 7005 if (I2) { 7006 var c2 = sg; 7007 var d2 = rg; 7008 c2 = (d2 & ~(1 << 32 - oc(d2) - 1)).toString(32) + c2; 7009 b2 = ":" + b2 + "R" + c2; 7010 c2 = Kh++; 7011 0 < c2 && (b2 += "H" + c2.toString(32)); 7012 b2 += ":"; 7013 } else c2 = Lh++, b2 = ":" + b2 + "r" + c2.toString(32) + ":"; 7014 return a2.memoizedState = b2; 7015 }, unstable_isNewReconciler: false }, Ph = { 7016 readContext: eh, 7017 useCallback: si2, 7018 useContext: eh, 7019 useEffect: $h, 7020 useImperativeHandle: qi2, 7021 useInsertionEffect: ni2, 7022 useLayoutEffect: oi2, 7023 useMemo: ti2, 7024 useReducer: Wh, 7025 useRef: ji2, 7026 useState: function() { 7027 return Wh(Vh); 7028 }, 7029 useDebugValue: ri2, 7030 useDeferredValue: function(a2) { 7031 var b2 = Uh(); 7032 return ui2(b2, N2.memoizedState, a2); 7033 }, 7034 useTransition: function() { 7035 var a2 = Wh(Vh)[0], b2 = Uh().memoizedState; 7036 return [a2, b2]; 7037 }, 7038 useMutableSource: Yh, 7039 useSyncExternalStore: Zh, 7040 useId: wi2, 7041 unstable_isNewReconciler: false 7042 }, Qh = { readContext: eh, useCallback: si2, useContext: eh, useEffect: $h, useImperativeHandle: qi2, useInsertionEffect: ni2, useLayoutEffect: oi2, useMemo: ti2, useReducer: Xh, useRef: ji2, useState: function() { 7043 return Xh(Vh); 7044 }, useDebugValue: ri2, useDeferredValue: function(a2) { 7045 var b2 = Uh(); 7046 return null === N2 ? b2.memoizedState = a2 : ui2(b2, N2.memoizedState, a2); 7047 }, useTransition: function() { 7048 var a2 = Xh(Vh)[0], b2 = Uh().memoizedState; 7049 return [a2, b2]; 7050 }, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi2, unstable_isNewReconciler: false }; 7051 function Ci2(a2, b2) { 7052 if (a2 && a2.defaultProps) { 7053 b2 = A2({}, b2); 7054 a2 = a2.defaultProps; 7055 for (var c2 in a2) void 0 === b2[c2] && (b2[c2] = a2[c2]); 7056 return b2; 7057 } 7058 return b2; 7059 } 7060 function Di2(a2, b2, c2, d2) { 7061 b2 = a2.memoizedState; 7062 c2 = c2(d2, b2); 7063 c2 = null === c2 || void 0 === c2 ? b2 : A2({}, b2, c2); 7064 a2.memoizedState = c2; 7065 0 === a2.lanes && (a2.updateQueue.baseState = c2); 7066 } 7067 var Ei2 = { isMounted: function(a2) { 7068 return (a2 = a2._reactInternals) ? Vb(a2) === a2 : false; 7069 }, enqueueSetState: function(a2, b2, c2) { 7070 a2 = a2._reactInternals; 7071 var d2 = R2(), e2 = yi2(a2), f2 = mh(d2, e2); 7072 f2.payload = b2; 7073 void 0 !== c2 && null !== c2 && (f2.callback = c2); 7074 b2 = nh(a2, f2, e2); 7075 null !== b2 && (gi2(b2, a2, e2, d2), oh(b2, a2, e2)); 7076 }, enqueueReplaceState: function(a2, b2, c2) { 7077 a2 = a2._reactInternals; 7078 var d2 = R2(), e2 = yi2(a2), f2 = mh(d2, e2); 7079 f2.tag = 1; 7080 f2.payload = b2; 7081 void 0 !== c2 && null !== c2 && (f2.callback = c2); 7082 b2 = nh(a2, f2, e2); 7083 null !== b2 && (gi2(b2, a2, e2, d2), oh(b2, a2, e2)); 7084 }, enqueueForceUpdate: function(a2, b2) { 7085 a2 = a2._reactInternals; 7086 var c2 = R2(), d2 = yi2(a2), e2 = mh(c2, d2); 7087 e2.tag = 2; 7088 void 0 !== b2 && null !== b2 && (e2.callback = b2); 7089 b2 = nh(a2, e2, d2); 7090 null !== b2 && (gi2(b2, a2, d2, c2), oh(b2, a2, d2)); 7091 } }; 7092 function Fi2(a2, b2, c2, d2, e2, f2, g2) { 7093 a2 = a2.stateNode; 7094 return "function" === typeof a2.shouldComponentUpdate ? a2.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie2(c2, d2) || !Ie2(e2, f2) : true; 7095 } 7096 function Gi2(a2, b2, c2) { 7097 var d2 = false, e2 = Vf; 7098 var f2 = b2.contextType; 7099 "object" === typeof f2 && null !== f2 ? f2 = eh(f2) : (e2 = Zf(b2) ? Xf : H2.current, d2 = b2.contextTypes, f2 = (d2 = null !== d2 && void 0 !== d2) ? Yf(a2, e2) : Vf); 7100 b2 = new b2(c2, f2); 7101 a2.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null; 7102 b2.updater = Ei2; 7103 a2.stateNode = b2; 7104 b2._reactInternals = a2; 7105 d2 && (a2 = a2.stateNode, a2.__reactInternalMemoizedUnmaskedChildContext = e2, a2.__reactInternalMemoizedMaskedChildContext = f2); 7106 return b2; 7107 } 7108 function Hi2(a2, b2, c2, d2) { 7109 a2 = b2.state; 7110 "function" === typeof b2.componentWillReceiveProps && b2.componentWillReceiveProps(c2, d2); 7111 "function" === typeof b2.UNSAFE_componentWillReceiveProps && b2.UNSAFE_componentWillReceiveProps(c2, d2); 7112 b2.state !== a2 && Ei2.enqueueReplaceState(b2, b2.state, null); 7113 } 7114 function Ii2(a2, b2, c2, d2) { 7115 var e2 = a2.stateNode; 7116 e2.props = c2; 7117 e2.state = a2.memoizedState; 7118 e2.refs = {}; 7119 kh(a2); 7120 var f2 = b2.contextType; 7121 "object" === typeof f2 && null !== f2 ? e2.context = eh(f2) : (f2 = Zf(b2) ? Xf : H2.current, e2.context = Yf(a2, f2)); 7122 e2.state = a2.memoizedState; 7123 f2 = b2.getDerivedStateFromProps; 7124 "function" === typeof f2 && (Di2(a2, b2, f2, c2), e2.state = a2.memoizedState); 7125 "function" === typeof b2.getDerivedStateFromProps || "function" === typeof e2.getSnapshotBeforeUpdate || "function" !== typeof e2.UNSAFE_componentWillMount && "function" !== typeof e2.componentWillMount || (b2 = e2.state, "function" === typeof e2.componentWillMount && e2.componentWillMount(), "function" === typeof e2.UNSAFE_componentWillMount && e2.UNSAFE_componentWillMount(), b2 !== e2.state && Ei2.enqueueReplaceState(e2, e2.state, null), qh(a2, c2, e2, d2), e2.state = a2.memoizedState); 7126 "function" === typeof e2.componentDidMount && (a2.flags |= 4194308); 7127 } 7128 function Ji2(a2, b2) { 7129 try { 7130 var c2 = "", d2 = b2; 7131 do 7132 c2 += Pa2(d2), d2 = d2.return; 7133 while (d2); 7134 var e2 = c2; 7135 } catch (f2) { 7136 e2 = "\nError generating stack: " + f2.message + "\n" + f2.stack; 7137 } 7138 return { value: a2, source: b2, stack: e2, digest: null }; 7139 } 7140 function Ki2(a2, b2, c2) { 7141 return { value: a2, source: null, stack: null != c2 ? c2 : null, digest: null != b2 ? b2 : null }; 7142 } 7143 function Li2(a2, b2) { 7144 try { 7145 console.error(b2.value); 7146 } catch (c2) { 7147 setTimeout(function() { 7148 throw c2; 7149 }); 7150 } 7151 } 7152 var Mi2 = "function" === typeof WeakMap ? WeakMap : Map; 7153 function Ni2(a2, b2, c2) { 7154 c2 = mh(-1, c2); 7155 c2.tag = 3; 7156 c2.payload = { element: null }; 7157 var d2 = b2.value; 7158 c2.callback = function() { 7159 Oi2 || (Oi2 = true, Pi2 = d2); 7160 Li2(a2, b2); 7161 }; 7162 return c2; 7163 } 7164 function Qi2(a2, b2, c2) { 7165 c2 = mh(-1, c2); 7166 c2.tag = 3; 7167 var d2 = a2.type.getDerivedStateFromError; 7168 if ("function" === typeof d2) { 7169 var e2 = b2.value; 7170 c2.payload = function() { 7171 return d2(e2); 7172 }; 7173 c2.callback = function() { 7174 Li2(a2, b2); 7175 }; 7176 } 7177 var f2 = a2.stateNode; 7178 null !== f2 && "function" === typeof f2.componentDidCatch && (c2.callback = function() { 7179 Li2(a2, b2); 7180 "function" !== typeof d2 && (null === Ri2 ? Ri2 = /* @__PURE__ */ new Set([this]) : Ri2.add(this)); 7181 var c3 = b2.stack; 7182 this.componentDidCatch(b2.value, { componentStack: null !== c3 ? c3 : "" }); 7183 }); 7184 return c2; 7185 } 7186 function Si2(a2, b2, c2) { 7187 var d2 = a2.pingCache; 7188 if (null === d2) { 7189 d2 = a2.pingCache = new Mi2(); 7190 var e2 = /* @__PURE__ */ new Set(); 7191 d2.set(b2, e2); 7192 } else e2 = d2.get(b2), void 0 === e2 && (e2 = /* @__PURE__ */ new Set(), d2.set(b2, e2)); 7193 e2.has(c2) || (e2.add(c2), a2 = Ti2.bind(null, a2, b2, c2), b2.then(a2, a2)); 7194 } 7195 function Ui2(a2) { 7196 do { 7197 var b2; 7198 if (b2 = 13 === a2.tag) b2 = a2.memoizedState, b2 = null !== b2 ? null !== b2.dehydrated ? true : false : true; 7199 if (b2) return a2; 7200 a2 = a2.return; 7201 } while (null !== a2); 7202 return null; 7203 } 7204 function Vi2(a2, b2, c2, d2, e2) { 7205 if (0 === (a2.mode & 1)) return a2 === b2 ? a2.flags |= 65536 : (a2.flags |= 128, c2.flags |= 131072, c2.flags &= -52805, 1 === c2.tag && (null === c2.alternate ? c2.tag = 17 : (b2 = mh(-1, 1), b2.tag = 2, nh(c2, b2, 1))), c2.lanes |= 1), a2; 7206 a2.flags |= 65536; 7207 a2.lanes = e2; 7208 return a2; 7209 } 7210 var Wi2 = ua2.ReactCurrentOwner, dh = false; 7211 function Xi2(a2, b2, c2, d2) { 7212 b2.child = null === a2 ? Vg(b2, null, c2, d2) : Ug(b2, a2.child, c2, d2); 7213 } 7214 function Yi2(a2, b2, c2, d2, e2) { 7215 c2 = c2.render; 7216 var f2 = b2.ref; 7217 ch(b2, e2); 7218 d2 = Nh(a2, b2, c2, d2, f2, e2); 7219 c2 = Sh(); 7220 if (null !== a2 && !dh) return b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, Zi2(a2, b2, e2); 7221 I2 && c2 && vg(b2); 7222 b2.flags |= 1; 7223 Xi2(a2, b2, d2, e2); 7224 return b2.child; 7225 } 7226 function $i2(a2, b2, c2, d2, e2) { 7227 if (null === a2) { 7228 var f2 = c2.type; 7229 if ("function" === typeof f2 && !aj(f2) && void 0 === f2.defaultProps && null === c2.compare && void 0 === c2.defaultProps) return b2.tag = 15, b2.type = f2, bj(a2, b2, f2, d2, e2); 7230 a2 = Rg(c2.type, null, d2, b2, b2.mode, e2); 7231 a2.ref = b2.ref; 7232 a2.return = b2; 7233 return b2.child = a2; 7234 } 7235 f2 = a2.child; 7236 if (0 === (a2.lanes & e2)) { 7237 var g2 = f2.memoizedProps; 7238 c2 = c2.compare; 7239 c2 = null !== c2 ? c2 : Ie2; 7240 if (c2(g2, d2) && a2.ref === b2.ref) return Zi2(a2, b2, e2); 7241 } 7242 b2.flags |= 1; 7243 a2 = Pg(f2, d2); 7244 a2.ref = b2.ref; 7245 a2.return = b2; 7246 return b2.child = a2; 7247 } 7248 function bj(a2, b2, c2, d2, e2) { 7249 if (null !== a2) { 7250 var f2 = a2.memoizedProps; 7251 if (Ie2(f2, d2) && a2.ref === b2.ref) if (dh = false, b2.pendingProps = d2 = f2, 0 !== (a2.lanes & e2)) 0 !== (a2.flags & 131072) && (dh = true); 7252 else return b2.lanes = a2.lanes, Zi2(a2, b2, e2); 7253 } 7254 return cj(a2, b2, c2, d2, e2); 7255 } 7256 function dj(a2, b2, c2) { 7257 var d2 = b2.pendingProps, e2 = d2.children, f2 = null !== a2 ? a2.memoizedState : null; 7258 if ("hidden" === d2.mode) if (0 === (b2.mode & 1)) b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G2(ej, fj), fj |= c2; 7259 else { 7260 if (0 === (c2 & 1073741824)) return a2 = null !== f2 ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a2, cachePool: null, transitions: null }, b2.updateQueue = null, G2(ej, fj), fj |= a2, null; 7261 b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; 7262 d2 = null !== f2 ? f2.baseLanes : c2; 7263 G2(ej, fj); 7264 fj |= d2; 7265 } 7266 else null !== f2 ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, G2(ej, fj), fj |= d2; 7267 Xi2(a2, b2, e2, c2); 7268 return b2.child; 7269 } 7270 function gj(a2, b2) { 7271 var c2 = b2.ref; 7272 if (null === a2 && null !== c2 || null !== a2 && a2.ref !== c2) b2.flags |= 512, b2.flags |= 2097152; 7273 } 7274 function cj(a2, b2, c2, d2, e2) { 7275 var f2 = Zf(c2) ? Xf : H2.current; 7276 f2 = Yf(b2, f2); 7277 ch(b2, e2); 7278 c2 = Nh(a2, b2, c2, d2, f2, e2); 7279 d2 = Sh(); 7280 if (null !== a2 && !dh) return b2.updateQueue = a2.updateQueue, b2.flags &= -2053, a2.lanes &= ~e2, Zi2(a2, b2, e2); 7281 I2 && d2 && vg(b2); 7282 b2.flags |= 1; 7283 Xi2(a2, b2, c2, e2); 7284 return b2.child; 7285 } 7286 function hj(a2, b2, c2, d2, e2) { 7287 if (Zf(c2)) { 7288 var f2 = true; 7289 cg(b2); 7290 } else f2 = false; 7291 ch(b2, e2); 7292 if (null === b2.stateNode) ij(a2, b2), Gi2(b2, c2, d2), Ii2(b2, c2, d2, e2), d2 = true; 7293 else if (null === a2) { 7294 var g2 = b2.stateNode, h2 = b2.memoizedProps; 7295 g2.props = h2; 7296 var k2 = g2.context, l2 = c2.contextType; 7297 "object" === typeof l2 && null !== l2 ? l2 = eh(l2) : (l2 = Zf(c2) ? Xf : H2.current, l2 = Yf(b2, l2)); 7298 var m2 = c2.getDerivedStateFromProps, q2 = "function" === typeof m2 || "function" === typeof g2.getSnapshotBeforeUpdate; 7299 q2 || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== d2 || k2 !== l2) && Hi2(b2, g2, d2, l2); 7300 jh = false; 7301 var r2 = b2.memoizedState; 7302 g2.state = r2; 7303 qh(b2, d2, g2, e2); 7304 k2 = b2.memoizedState; 7305 h2 !== d2 || r2 !== k2 || Wf.current || jh ? ("function" === typeof m2 && (Di2(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = jh || Fi2(b2, c2, h2, d2, r2, k2, l2)) ? (q2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), d2 = false); 7306 } else { 7307 g2 = b2.stateNode; 7308 lh(a2, b2); 7309 h2 = b2.memoizedProps; 7310 l2 = b2.type === b2.elementType ? h2 : Ci2(b2.type, h2); 7311 g2.props = l2; 7312 q2 = b2.pendingProps; 7313 r2 = g2.context; 7314 k2 = c2.contextType; 7315 "object" === typeof k2 && null !== k2 ? k2 = eh(k2) : (k2 = Zf(c2) ? Xf : H2.current, k2 = Yf(b2, k2)); 7316 var y2 = c2.getDerivedStateFromProps; 7317 (m2 = "function" === typeof y2 || "function" === typeof g2.getSnapshotBeforeUpdate) || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== q2 || r2 !== k2) && Hi2(b2, g2, d2, k2); 7318 jh = false; 7319 r2 = b2.memoizedState; 7320 g2.state = r2; 7321 qh(b2, d2, g2, e2); 7322 var n2 = b2.memoizedState; 7323 h2 !== q2 || r2 !== n2 || Wf.current || jh ? ("function" === typeof y2 && (Di2(b2, c2, y2, d2), n2 = b2.memoizedState), (l2 = jh || Fi2(b2, c2, l2, d2, r2, n2, k2) || false) ? (m2 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, n2, k2), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, n2, k2)), "function" === typeof g2.componentDidUpdate && (b2.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d2, b2.memoizedState = n2), g2.props = d2, g2.state = n2, g2.context = k2, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a2.memoizedProps && r2 === a2.memoizedState || (b2.flags |= 1024), d2 = false); 7324 } 7325 return jj(a2, b2, c2, d2, f2, e2); 7326 } 7327 function jj(a2, b2, c2, d2, e2, f2) { 7328 gj(a2, b2); 7329 var g2 = 0 !== (b2.flags & 128); 7330 if (!d2 && !g2) return e2 && dg(b2, c2, false), Zi2(a2, b2, f2); 7331 d2 = b2.stateNode; 7332 Wi2.current = b2; 7333 var h2 = g2 && "function" !== typeof c2.getDerivedStateFromError ? null : d2.render(); 7334 b2.flags |= 1; 7335 null !== a2 && g2 ? (b2.child = Ug(b2, a2.child, null, f2), b2.child = Ug(b2, null, h2, f2)) : Xi2(a2, b2, h2, f2); 7336 b2.memoizedState = d2.state; 7337 e2 && dg(b2, c2, true); 7338 return b2.child; 7339 } 7340 function kj(a2) { 7341 var b2 = a2.stateNode; 7342 b2.pendingContext ? ag(a2, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && ag(a2, b2.context, false); 7343 yh(a2, b2.containerInfo); 7344 } 7345 function lj(a2, b2, c2, d2, e2) { 7346 Ig(); 7347 Jg(e2); 7348 b2.flags |= 256; 7349 Xi2(a2, b2, c2, d2); 7350 return b2.child; 7351 } 7352 var mj = { dehydrated: null, treeContext: null, retryLane: 0 }; 7353 function nj(a2) { 7354 return { baseLanes: a2, cachePool: null, transitions: null }; 7355 } 7356 function oj(a2, b2, c2) { 7357 var d2 = b2.pendingProps, e2 = L2.current, f2 = false, g2 = 0 !== (b2.flags & 128), h2; 7358 (h2 = g2) || (h2 = null !== a2 && null === a2.memoizedState ? false : 0 !== (e2 & 2)); 7359 if (h2) f2 = true, b2.flags &= -129; 7360 else if (null === a2 || null !== a2.memoizedState) e2 |= 1; 7361 G2(L2, e2 & 1); 7362 if (null === a2) { 7363 Eg(b2); 7364 a2 = b2.memoizedState; 7365 if (null !== a2 && (a2 = a2.dehydrated, null !== a2)) return 0 === (b2.mode & 1) ? b2.lanes = 1 : "$!" === a2.data ? b2.lanes = 8 : b2.lanes = 1073741824, null; 7366 g2 = d2.children; 7367 a2 = d2.fallback; 7368 return f2 ? (d2 = b2.mode, f2 = b2.child, g2 = { mode: "hidden", children: g2 }, 0 === (d2 & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g2) : f2 = pj(g2, d2, 0, null), a2 = Tg(a2, d2, c2, null), f2.return = b2, a2.return = b2, f2.sibling = a2, b2.child = f2, b2.child.memoizedState = nj(c2), b2.memoizedState = mj, a2) : qj(b2, g2); 7369 } 7370 e2 = a2.memoizedState; 7371 if (null !== e2 && (h2 = e2.dehydrated, null !== h2)) return rj(a2, b2, g2, d2, h2, e2, c2); 7372 if (f2) { 7373 f2 = d2.fallback; 7374 g2 = b2.mode; 7375 e2 = a2.child; 7376 h2 = e2.sibling; 7377 var k2 = { mode: "hidden", children: d2.children }; 7378 0 === (g2 & 1) && b2.child !== e2 ? (d2 = b2.child, d2.childLanes = 0, d2.pendingProps = k2, b2.deletions = null) : (d2 = Pg(e2, k2), d2.subtreeFlags = e2.subtreeFlags & 14680064); 7379 null !== h2 ? f2 = Pg(h2, f2) : (f2 = Tg(f2, g2, c2, null), f2.flags |= 2); 7380 f2.return = b2; 7381 d2.return = b2; 7382 d2.sibling = f2; 7383 b2.child = d2; 7384 d2 = f2; 7385 f2 = b2.child; 7386 g2 = a2.child.memoizedState; 7387 g2 = null === g2 ? nj(c2) : { baseLanes: g2.baseLanes | c2, cachePool: null, transitions: g2.transitions }; 7388 f2.memoizedState = g2; 7389 f2.childLanes = a2.childLanes & ~c2; 7390 b2.memoizedState = mj; 7391 return d2; 7392 } 7393 f2 = a2.child; 7394 a2 = f2.sibling; 7395 d2 = Pg(f2, { mode: "visible", children: d2.children }); 7396 0 === (b2.mode & 1) && (d2.lanes = c2); 7397 d2.return = b2; 7398 d2.sibling = null; 7399 null !== a2 && (c2 = b2.deletions, null === c2 ? (b2.deletions = [a2], b2.flags |= 16) : c2.push(a2)); 7400 b2.child = d2; 7401 b2.memoizedState = null; 7402 return d2; 7403 } 7404 function qj(a2, b2) { 7405 b2 = pj({ mode: "visible", children: b2 }, a2.mode, 0, null); 7406 b2.return = a2; 7407 return a2.child = b2; 7408 } 7409 function sj(a2, b2, c2, d2) { 7410 null !== d2 && Jg(d2); 7411 Ug(b2, a2.child, null, c2); 7412 a2 = qj(b2, b2.pendingProps.children); 7413 a2.flags |= 2; 7414 b2.memoizedState = null; 7415 return a2; 7416 } 7417 function rj(a2, b2, c2, d2, e2, f2, g2) { 7418 if (c2) { 7419 if (b2.flags & 256) return b2.flags &= -257, d2 = Ki2(Error(p2(422))), sj(a2, b2, g2, d2); 7420 if (null !== b2.memoizedState) return b2.child = a2.child, b2.flags |= 128, null; 7421 f2 = d2.fallback; 7422 e2 = b2.mode; 7423 d2 = pj({ mode: "visible", children: d2.children }, e2, 0, null); 7424 f2 = Tg(f2, e2, g2, null); 7425 f2.flags |= 2; 7426 d2.return = b2; 7427 f2.return = b2; 7428 d2.sibling = f2; 7429 b2.child = d2; 7430 0 !== (b2.mode & 1) && Ug(b2, a2.child, null, g2); 7431 b2.child.memoizedState = nj(g2); 7432 b2.memoizedState = mj; 7433 return f2; 7434 } 7435 if (0 === (b2.mode & 1)) return sj(a2, b2, g2, null); 7436 if ("$!" === e2.data) { 7437 d2 = e2.nextSibling && e2.nextSibling.dataset; 7438 if (d2) var h2 = d2.dgst; 7439 d2 = h2; 7440 f2 = Error(p2(419)); 7441 d2 = Ki2(f2, d2, void 0); 7442 return sj(a2, b2, g2, d2); 7443 } 7444 h2 = 0 !== (g2 & a2.childLanes); 7445 if (dh || h2) { 7446 d2 = Q2; 7447 if (null !== d2) { 7448 switch (g2 & -g2) { 7449 case 4: 7450 e2 = 2; 7451 break; 7452 case 16: 7453 e2 = 8; 7454 break; 7455 case 64: 7456 case 128: 7457 case 256: 7458 case 512: 7459 case 1024: 7460 case 2048: 7461 case 4096: 7462 case 8192: 7463 case 16384: 7464 case 32768: 7465 case 65536: 7466 case 131072: 7467 case 262144: 7468 case 524288: 7469 case 1048576: 7470 case 2097152: 7471 case 4194304: 7472 case 8388608: 7473 case 16777216: 7474 case 33554432: 7475 case 67108864: 7476 e2 = 32; 7477 break; 7478 case 536870912: 7479 e2 = 268435456; 7480 break; 7481 default: 7482 e2 = 0; 7483 } 7484 e2 = 0 !== (e2 & (d2.suspendedLanes | g2)) ? 0 : e2; 7485 0 !== e2 && e2 !== f2.retryLane && (f2.retryLane = e2, ih(a2, e2), gi2(d2, a2, e2, -1)); 7486 } 7487 tj(); 7488 d2 = Ki2(Error(p2(421))); 7489 return sj(a2, b2, g2, d2); 7490 } 7491 if ("$?" === e2.data) return b2.flags |= 128, b2.child = a2.child, b2 = uj.bind(null, a2), e2._reactRetry = b2, null; 7492 a2 = f2.treeContext; 7493 yg = Lf(e2.nextSibling); 7494 xg = b2; 7495 I2 = true; 7496 zg = null; 7497 null !== a2 && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a2.id, sg = a2.overflow, qg = b2); 7498 b2 = qj(b2, d2.children); 7499 b2.flags |= 4096; 7500 return b2; 7501 } 7502 function vj(a2, b2, c2) { 7503 a2.lanes |= b2; 7504 var d2 = a2.alternate; 7505 null !== d2 && (d2.lanes |= b2); 7506 bh(a2.return, b2, c2); 7507 } 7508 function wj(a2, b2, c2, d2, e2) { 7509 var f2 = a2.memoizedState; 7510 null === f2 ? a2.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e2 } : (f2.isBackwards = b2, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d2, f2.tail = c2, f2.tailMode = e2); 7511 } 7512 function xj(a2, b2, c2) { 7513 var d2 = b2.pendingProps, e2 = d2.revealOrder, f2 = d2.tail; 7514 Xi2(a2, b2, d2.children, c2); 7515 d2 = L2.current; 7516 if (0 !== (d2 & 2)) d2 = d2 & 1 | 2, b2.flags |= 128; 7517 else { 7518 if (null !== a2 && 0 !== (a2.flags & 128)) a: for (a2 = b2.child; null !== a2; ) { 7519 if (13 === a2.tag) null !== a2.memoizedState && vj(a2, c2, b2); 7520 else if (19 === a2.tag) vj(a2, c2, b2); 7521 else if (null !== a2.child) { 7522 a2.child.return = a2; 7523 a2 = a2.child; 7524 continue; 7525 } 7526 if (a2 === b2) break a; 7527 for (; null === a2.sibling; ) { 7528 if (null === a2.return || a2.return === b2) break a; 7529 a2 = a2.return; 7530 } 7531 a2.sibling.return = a2.return; 7532 a2 = a2.sibling; 7533 } 7534 d2 &= 1; 7535 } 7536 G2(L2, d2); 7537 if (0 === (b2.mode & 1)) b2.memoizedState = null; 7538 else switch (e2) { 7539 case "forwards": 7540 c2 = b2.child; 7541 for (e2 = null; null !== c2; ) a2 = c2.alternate, null !== a2 && null === Ch(a2) && (e2 = c2), c2 = c2.sibling; 7542 c2 = e2; 7543 null === c2 ? (e2 = b2.child, b2.child = null) : (e2 = c2.sibling, c2.sibling = null); 7544 wj(b2, false, e2, c2, f2); 7545 break; 7546 case "backwards": 7547 c2 = null; 7548 e2 = b2.child; 7549 for (b2.child = null; null !== e2; ) { 7550 a2 = e2.alternate; 7551 if (null !== a2 && null === Ch(a2)) { 7552 b2.child = e2; 7553 break; 7554 } 7555 a2 = e2.sibling; 7556 e2.sibling = c2; 7557 c2 = e2; 7558 e2 = a2; 7559 } 7560 wj(b2, true, c2, null, f2); 7561 break; 7562 case "together": 7563 wj(b2, false, null, null, void 0); 7564 break; 7565 default: 7566 b2.memoizedState = null; 7567 } 7568 return b2.child; 7569 } 7570 function ij(a2, b2) { 7571 0 === (b2.mode & 1) && null !== a2 && (a2.alternate = null, b2.alternate = null, b2.flags |= 2); 7572 } 7573 function Zi2(a2, b2, c2) { 7574 null !== a2 && (b2.dependencies = a2.dependencies); 7575 rh |= b2.lanes; 7576 if (0 === (c2 & b2.childLanes)) return null; 7577 if (null !== a2 && b2.child !== a2.child) throw Error(p2(153)); 7578 if (null !== b2.child) { 7579 a2 = b2.child; 7580 c2 = Pg(a2, a2.pendingProps); 7581 b2.child = c2; 7582 for (c2.return = b2; null !== a2.sibling; ) a2 = a2.sibling, c2 = c2.sibling = Pg(a2, a2.pendingProps), c2.return = b2; 7583 c2.sibling = null; 7584 } 7585 return b2.child; 7586 } 7587 function yj(a2, b2, c2) { 7588 switch (b2.tag) { 7589 case 3: 7590 kj(b2); 7591 Ig(); 7592 break; 7593 case 5: 7594 Ah(b2); 7595 break; 7596 case 1: 7597 Zf(b2.type) && cg(b2); 7598 break; 7599 case 4: 7600 yh(b2, b2.stateNode.containerInfo); 7601 break; 7602 case 10: 7603 var d2 = b2.type._context, e2 = b2.memoizedProps.value; 7604 G2(Wg, d2._currentValue); 7605 d2._currentValue = e2; 7606 break; 7607 case 13: 7608 d2 = b2.memoizedState; 7609 if (null !== d2) { 7610 if (null !== d2.dehydrated) return G2(L2, L2.current & 1), b2.flags |= 128, null; 7611 if (0 !== (c2 & b2.child.childLanes)) return oj(a2, b2, c2); 7612 G2(L2, L2.current & 1); 7613 a2 = Zi2(a2, b2, c2); 7614 return null !== a2 ? a2.sibling : null; 7615 } 7616 G2(L2, L2.current & 1); 7617 break; 7618 case 19: 7619 d2 = 0 !== (c2 & b2.childLanes); 7620 if (0 !== (a2.flags & 128)) { 7621 if (d2) return xj(a2, b2, c2); 7622 b2.flags |= 128; 7623 } 7624 e2 = b2.memoizedState; 7625 null !== e2 && (e2.rendering = null, e2.tail = null, e2.lastEffect = null); 7626 G2(L2, L2.current); 7627 if (d2) break; 7628 else return null; 7629 case 22: 7630 case 23: 7631 return b2.lanes = 0, dj(a2, b2, c2); 7632 } 7633 return Zi2(a2, b2, c2); 7634 } 7635 var zj, Aj, Bj, Cj; 7636 zj = function(a2, b2) { 7637 for (var c2 = b2.child; null !== c2; ) { 7638 if (5 === c2.tag || 6 === c2.tag) a2.appendChild(c2.stateNode); 7639 else if (4 !== c2.tag && null !== c2.child) { 7640 c2.child.return = c2; 7641 c2 = c2.child; 7642 continue; 7643 } 7644 if (c2 === b2) break; 7645 for (; null === c2.sibling; ) { 7646 if (null === c2.return || c2.return === b2) return; 7647 c2 = c2.return; 7648 } 7649 c2.sibling.return = c2.return; 7650 c2 = c2.sibling; 7651 } 7652 }; 7653 Aj = function() { 7654 }; 7655 Bj = function(a2, b2, c2, d2) { 7656 var e2 = a2.memoizedProps; 7657 if (e2 !== d2) { 7658 a2 = b2.stateNode; 7659 xh(uh.current); 7660 var f2 = null; 7661 switch (c2) { 7662 case "input": 7663 e2 = Ya2(a2, e2); 7664 d2 = Ya2(a2, d2); 7665 f2 = []; 7666 break; 7667 case "select": 7668 e2 = A2({}, e2, { value: void 0 }); 7669 d2 = A2({}, d2, { value: void 0 }); 7670 f2 = []; 7671 break; 7672 case "textarea": 7673 e2 = gb(a2, e2); 7674 d2 = gb(a2, d2); 7675 f2 = []; 7676 break; 7677 default: 7678 "function" !== typeof e2.onClick && "function" === typeof d2.onClick && (a2.onclick = Bf); 7679 } 7680 ub(c2, d2); 7681 var g2; 7682 c2 = null; 7683 for (l2 in e2) if (!d2.hasOwnProperty(l2) && e2.hasOwnProperty(l2) && null != e2[l2]) if ("style" === l2) { 7684 var h2 = e2[l2]; 7685 for (g2 in h2) h2.hasOwnProperty(g2) && (c2 || (c2 = {}), c2[g2] = ""); 7686 } else "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea2.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null)); 7687 for (l2 in d2) { 7688 var k2 = d2[l2]; 7689 h2 = null != e2 ? e2[l2] : void 0; 7690 if (d2.hasOwnProperty(l2) && k2 !== h2 && (null != k2 || null != h2)) if ("style" === l2) if (h2) { 7691 for (g2 in h2) !h2.hasOwnProperty(g2) || k2 && k2.hasOwnProperty(g2) || (c2 || (c2 = {}), c2[g2] = ""); 7692 for (g2 in k2) k2.hasOwnProperty(g2) && h2[g2] !== k2[g2] && (c2 || (c2 = {}), c2[g2] = k2[g2]); 7693 } else c2 || (f2 || (f2 = []), f2.push( 7694 l2, 7695 c2 7696 )), c2 = k2; 7697 else "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h2 = h2 ? h2.__html : void 0, null != k2 && h2 !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea2.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D2("scroll", a2), f2 || h2 === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2)); 7698 } 7699 c2 && (f2 = f2 || []).push("style", c2); 7700 var l2 = f2; 7701 if (b2.updateQueue = l2) b2.flags |= 4; 7702 } 7703 }; 7704 Cj = function(a2, b2, c2, d2) { 7705 c2 !== d2 && (b2.flags |= 4); 7706 }; 7707 function Dj(a2, b2) { 7708 if (!I2) switch (a2.tailMode) { 7709 case "hidden": 7710 b2 = a2.tail; 7711 for (var c2 = null; null !== b2; ) null !== b2.alternate && (c2 = b2), b2 = b2.sibling; 7712 null === c2 ? a2.tail = null : c2.sibling = null; 7713 break; 7714 case "collapsed": 7715 c2 = a2.tail; 7716 for (var d2 = null; null !== c2; ) null !== c2.alternate && (d2 = c2), c2 = c2.sibling; 7717 null === d2 ? b2 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null; 7718 } 7719 } 7720 function S2(a2) { 7721 var b2 = null !== a2.alternate && a2.alternate.child === a2.child, c2 = 0, d2 = 0; 7722 if (b2) for (var e2 = a2.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags & 14680064, d2 |= e2.flags & 14680064, e2.return = a2, e2 = e2.sibling; 7723 else for (e2 = a2.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags, d2 |= e2.flags, e2.return = a2, e2 = e2.sibling; 7724 a2.subtreeFlags |= d2; 7725 a2.childLanes = c2; 7726 return b2; 7727 } 7728 function Ej(a2, b2, c2) { 7729 var d2 = b2.pendingProps; 7730 wg(b2); 7731 switch (b2.tag) { 7732 case 2: 7733 case 16: 7734 case 15: 7735 case 0: 7736 case 11: 7737 case 7: 7738 case 8: 7739 case 12: 7740 case 9: 7741 case 14: 7742 return S2(b2), null; 7743 case 1: 7744 return Zf(b2.type) && $f(), S2(b2), null; 7745 case 3: 7746 d2 = b2.stateNode; 7747 zh(); 7748 E2(Wf); 7749 E2(H2); 7750 Eh(); 7751 d2.pendingContext && (d2.context = d2.pendingContext, d2.pendingContext = null); 7752 if (null === a2 || null === a2.child) Gg(b2) ? b2.flags |= 4 : null === a2 || a2.memoizedState.isDehydrated && 0 === (b2.flags & 256) || (b2.flags |= 1024, null !== zg && (Fj(zg), zg = null)); 7753 Aj(a2, b2); 7754 S2(b2); 7755 return null; 7756 case 5: 7757 Bh(b2); 7758 var e2 = xh(wh.current); 7759 c2 = b2.type; 7760 if (null !== a2 && null != b2.stateNode) Bj(a2, b2, c2, d2, e2), a2.ref !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152); 7761 else { 7762 if (!d2) { 7763 if (null === b2.stateNode) throw Error(p2(166)); 7764 S2(b2); 7765 return null; 7766 } 7767 a2 = xh(uh.current); 7768 if (Gg(b2)) { 7769 d2 = b2.stateNode; 7770 c2 = b2.type; 7771 var f2 = b2.memoizedProps; 7772 d2[Of] = b2; 7773 d2[Pf] = f2; 7774 a2 = 0 !== (b2.mode & 1); 7775 switch (c2) { 7776 case "dialog": 7777 D2("cancel", d2); 7778 D2("close", d2); 7779 break; 7780 case "iframe": 7781 case "object": 7782 case "embed": 7783 D2("load", d2); 7784 break; 7785 case "video": 7786 case "audio": 7787 for (e2 = 0; e2 < lf.length; e2++) D2(lf[e2], d2); 7788 break; 7789 case "source": 7790 D2("error", d2); 7791 break; 7792 case "img": 7793 case "image": 7794 case "link": 7795 D2( 7796 "error", 7797 d2 7798 ); 7799 D2("load", d2); 7800 break; 7801 case "details": 7802 D2("toggle", d2); 7803 break; 7804 case "input": 7805 Za2(d2, f2); 7806 D2("invalid", d2); 7807 break; 7808 case "select": 7809 d2._wrapperState = { wasMultiple: !!f2.multiple }; 7810 D2("invalid", d2); 7811 break; 7812 case "textarea": 7813 hb(d2, f2), D2("invalid", d2); 7814 } 7815 ub(c2, f2); 7816 e2 = null; 7817 for (var g2 in f2) if (f2.hasOwnProperty(g2)) { 7818 var h2 = f2[g2]; 7819 "children" === g2 ? "string" === typeof h2 ? d2.textContent !== h2 && (true !== f2.suppressHydrationWarning && Af(d2.textContent, h2, a2), e2 = ["children", h2]) : "number" === typeof h2 && d2.textContent !== "" + h2 && (true !== f2.suppressHydrationWarning && Af( 7820 d2.textContent, 7821 h2, 7822 a2 7823 ), e2 = ["children", "" + h2]) : ea2.hasOwnProperty(g2) && null != h2 && "onScroll" === g2 && D2("scroll", d2); 7824 } 7825 switch (c2) { 7826 case "input": 7827 Va2(d2); 7828 db(d2, f2, true); 7829 break; 7830 case "textarea": 7831 Va2(d2); 7832 jb(d2); 7833 break; 7834 case "select": 7835 case "option": 7836 break; 7837 default: 7838 "function" === typeof f2.onClick && (d2.onclick = Bf); 7839 } 7840 d2 = e2; 7841 b2.updateQueue = d2; 7842 null !== d2 && (b2.flags |= 4); 7843 } else { 7844 g2 = 9 === e2.nodeType ? e2 : e2.ownerDocument; 7845 "http://www.w3.org/1999/xhtml" === a2 && (a2 = kb(c2)); 7846 "http://www.w3.org/1999/xhtml" === a2 ? "script" === c2 ? (a2 = g2.createElement("div"), a2.innerHTML = "<script><\/script>", a2 = a2.removeChild(a2.firstChild)) : "string" === typeof d2.
vendor: 4,424 bytes, lines 7846-7951
7846is ? a2 = g2.createElement(c2, { is: d2.is }) : (a2 = g2.createElement(c2), "select" === c2 && (g2 = a2, d2.multiple ? g2.multiple = true : d2.size && (g2.size = d2.size))) : a2 = g2.createElementNS(a2, c2); 7847 a2[Of] = b2; 7848 a2[Pf] = d2; 7849 zj(a2, b2, false, false); 7850 b2.stateNode = a2; 7851 a: { 7852 g2 = vb(c2, d2); 7853 switch (c2) { 7854 case "dialog": 7855 D2("cancel", a2); 7856 D2("close", a2); 7857 e2 = d2; 7858 break; 7859 case "iframe": 7860 case "object": 7861 case "embed": 7862 D2("load", a2); 7863 e2 = d2; 7864 break; 7865 case "video": 7866 case "audio": 7867 for (e2 = 0; e2 < lf.length; e2++) D2(lf[e2], a2); 7868 e2 = d2; 7869 break; 7870 case "source": 7871 D2("error", a2); 7872 e2 = d2; 7873 break; 7874 case "img": 7875 case "image": 7876 case "link": 7877 D2( 7878 "error", 7879 a2 7880 ); 7881 D2("load", a2); 7882 e2 = d2; 7883 break; 7884 case "details": 7885 D2("toggle", a2); 7886 e2 = d2; 7887 break; 7888 case "input": 7889 Za2(a2, d2); 7890 e2 = Ya2(a2, d2); 7891 D2("invalid", a2); 7892 break; 7893 case "option": 7894 e2 = d2; 7895 break; 7896 case "select": 7897 a2._wrapperState = { wasMultiple: !!d2.multiple }; 7898 e2 = A2({}, d2, { value: void 0 }); 7899 D2("invalid", a2); 7900 break; 7901 case "textarea": 7902 hb(a2, d2); 7903 e2 = gb(a2, d2); 7904 D2("invalid", a2); 7905 break; 7906 default: 7907 e2 = d2; 7908 } 7909 ub(c2, e2); 7910 h2 = e2; 7911 for (f2 in h2) if (h2.hasOwnProperty(f2)) { 7912 var k2 = h2[f2]; 7913 "style" === f2 ? sb(a2, k2) : "dangerouslySetInnerHTML" === f2 ? (k2 = k2 ? k2.__html : void 0, null != k2 && nb(a2, k2)) : "children" === f2 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && ob(a2, k2) : "number" === typeof k2 && ob(a2, "" + k2) : "suppressContentEditableWarning" !== f2 && "suppressHydrationWarning" !== f2 && "autoFocus" !== f2 && (ea2.hasOwnProperty(f2) ? null != k2 && "onScroll" === f2 && D2("scroll", a2) : null != k2 && ta(a2, f2, k2, g2)); 7914 } 7915 switch (c2) { 7916 case "input": 7917 Va2(a2); 7918 db(a2, d2, false); 7919 break; 7920 case "textarea": 7921 Va2(a2); 7922 jb(a2); 7923 break; 7924 case "option": 7925 null != d2.value && a2.setAttribute("value", "" + Sa2(d2.value)); 7926 break; 7927 case "select": 7928 a2.multiple = !!d2.multiple; 7929 f2 = d2.value; 7930 null != f2 ? fb(a2, !!d2.multiple, f2, false) : null != d2.defaultValue && fb( 7931 a2, 7932 !!d2.multiple, 7933 d2.defaultValue, 7934 true 7935 ); 7936 break; 7937 default: 7938 "function" === typeof e2.onClick && (a2.onclick = Bf); 7939 } 7940 switch (c2) { 7941 case "button": 7942 case "input": 7943 case "select": 7944 case "textarea": 7945 d2 = !!d2.autoFocus; 7946 break a; 7947 case "img": 7948 d2 = true; 7949 break a; 7950 default: 7951 d2 = false;
vendor: 81,012 bytes, lines 7952-10207
7952 } 7953 } 7954 d2 && (b2.flags |= 4); 7955 } 7956 null !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152); 7957 } 7958 S2(b2); 7959 return null; 7960 case 6: 7961 if (a2 && null != b2.stateNode) Cj(a2, b2, a2.memoizedProps, d2); 7962 else { 7963 if ("string" !== typeof d2 && null === b2.stateNode) throw Error(p2(166)); 7964 c2 = xh(wh.current); 7965 xh(uh.current); 7966 if (Gg(b2)) { 7967 d2 = b2.stateNode; 7968 c2 = b2.memoizedProps; 7969 d2[Of] = b2; 7970 if (f2 = d2.nodeValue !== c2) { 7971 if (a2 = xg, null !== a2) switch (a2.tag) { 7972 case 3: 7973 Af(d2.nodeValue, c2, 0 !== (a2.mode & 1)); 7974 break; 7975 case 5: 7976 true !== a2.memoizedProps.suppressHydrationWarning && Af(d2.nodeValue, c2, 0 !== (a2.mode & 1)); 7977 } 7978 } 7979 f2 && (b2.flags |= 4); 7980 } else d2 = (9 === c2.nodeType ? c2 : c2.ownerDocument).createTextNode(d2), d2[Of] = b2, b2.stateNode = d2; 7981 } 7982 S2(b2); 7983 return null; 7984 case 13: 7985 E2(L2); 7986 d2 = b2.memoizedState; 7987 if (null === a2 || null !== a2.memoizedState && null !== a2.memoizedState.dehydrated) { 7988 if (I2 && null !== yg && 0 !== (b2.mode & 1) && 0 === (b2.flags & 128)) Hg(), Ig(), b2.flags |= 98560, f2 = false; 7989 else if (f2 = Gg(b2), null !== d2 && null !== d2.dehydrated) { 7990 if (null === a2) { 7991 if (!f2) throw Error(p2(318)); 7992 f2 = b2.memoizedState; 7993 f2 = null !== f2 ? f2.dehydrated : null; 7994 if (!f2) throw Error(p2(317)); 7995 f2[Of] = b2; 7996 } else Ig(), 0 === (b2.flags & 128) && (b2.memoizedState = null), b2.flags |= 4; 7997 S2(b2); 7998 f2 = false; 7999 } else null !== zg && (Fj(zg), zg = null), f2 = true; 8000 if (!f2) return b2.flags & 65536 ? b2 : null; 8001 } 8002 if (0 !== (b2.flags & 128)) return b2.lanes = c2, b2; 8003 d2 = null !== d2; 8004 d2 !== (null !== a2 && null !== a2.memoizedState) && d2 && (b2.child.flags |= 8192, 0 !== (b2.mode & 1) && (null === a2 || 0 !== (L2.current & 1) ? 0 === T2 && (T2 = 3) : tj())); 8005 null !== b2.updateQueue && (b2.flags |= 4); 8006 S2(b2); 8007 return null; 8008 case 4: 8009 return zh(), Aj(a2, b2), null === a2 && sf(b2.stateNode.containerInfo), S2(b2), null; 8010 case 10: 8011 return ah(b2.type._context), S2(b2), null; 8012 case 17: 8013 return Zf(b2.type) && $f(), S2(b2), null; 8014 case 19: 8015 E2(L2); 8016 f2 = b2.memoizedState; 8017 if (null === f2) return S2(b2), null; 8018 d2 = 0 !== (b2.flags & 128); 8019 g2 = f2.rendering; 8020 if (null === g2) if (d2) Dj(f2, false); 8021 else { 8022 if (0 !== T2 || null !== a2 && 0 !== (a2.flags & 128)) for (a2 = b2.child; null !== a2; ) { 8023 g2 = Ch(a2); 8024 if (null !== g2) { 8025 b2.flags |= 128; 8026 Dj(f2, false); 8027 d2 = g2.updateQueue; 8028 null !== d2 && (b2.updateQueue = d2, b2.flags |= 4); 8029 b2.subtreeFlags = 0; 8030 d2 = c2; 8031 for (c2 = b2.child; null !== c2; ) f2 = c2, a2 = d2, f2.flags &= 14680066, g2 = f2.alternate, null === g2 ? (f2.childLanes = 0, f2.lanes = a2, f2.child = null, f2.subtreeFlags = 0, f2.memoizedProps = null, f2.memoizedState = null, f2.updateQueue = null, f2.dependencies = null, f2.stateNode = null) : (f2.childLanes = g2.childLanes, f2.lanes = g2.lanes, f2.child = g2.child, f2.subtreeFlags = 0, f2.deletions = null, f2.memoizedProps = g2.memoizedProps, f2.memoizedState = g2.memoizedState, f2.updateQueue = g2.updateQueue, f2.type = g2.type, a2 = g2.dependencies, f2.dependencies = null === a2 ? null : { lanes: a2.lanes, firstContext: a2.firstContext }), c2 = c2.sibling; 8032 G2(L2, L2.current & 1 | 2); 8033 return b2.child; 8034 } 8035 a2 = a2.sibling; 8036 } 8037 null !== f2.tail && B2() > Gj && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304); 8038 } 8039 else { 8040 if (!d2) if (a2 = Ch(g2), null !== a2) { 8041 if (b2.flags |= 128, d2 = true, c2 = a2.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Dj(f2, true), null === f2.tail && "hidden" === f2.tailMode && !g2.alternate && !I2) return S2(b2), null; 8042 } else 2 * B2() - f2.renderingStartTime > Gj && 1073741824 !== c2 && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304); 8043 f2.isBackwards ? (g2.sibling = b2.child, b2.child = g2) : (c2 = f2.last, null !== c2 ? c2.sibling = g2 : b2.child = g2, f2.last = g2); 8044 } 8045 if (null !== f2.tail) return b2 = f2.tail, f2.rendering = b2, f2.tail = b2.sibling, f2.renderingStartTime = B2(), b2.sibling = null, c2 = L2.current, G2(L2, d2 ? c2 & 1 | 2 : c2 & 1), b2; 8046 S2(b2); 8047 return null; 8048 case 22: 8049 case 23: 8050 return Hj(), d2 = null !== b2.memoizedState, null !== a2 && null !== a2.memoizedState !== d2 && (b2.flags |= 8192), d2 && 0 !== (b2.mode & 1) ? 0 !== (fj & 1073741824) && (S2(b2), b2.subtreeFlags & 6 && (b2.flags |= 8192)) : S2(b2), null; 8051 case 24: 8052 return null; 8053 case 25: 8054 return null; 8055 } 8056 throw Error(p2(156, b2.tag)); 8057 } 8058 function Ij(a2, b2) { 8059 wg(b2); 8060 switch (b2.tag) { 8061 case 1: 8062 return Zf(b2.type) && $f(), a2 = b2.flags, a2 & 65536 ? (b2.flags = a2 & -65537 | 128, b2) : null; 8063 case 3: 8064 return zh(), E2(Wf), E2(H2), Eh(), a2 = b2.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b2.flags = a2 & -65537 | 128, b2) : null; 8065 case 5: 8066 return Bh(b2), null; 8067 case 13: 8068 E2(L2); 8069 a2 = b2.memoizedState; 8070 if (null !== a2 && null !== a2.dehydrated) { 8071 if (null === b2.alternate) throw Error(p2(340)); 8072 Ig(); 8073 } 8074 a2 = b2.flags; 8075 return a2 & 65536 ? (b2.flags = a2 & -65537 | 128, b2) : null; 8076 case 19: 8077 return E2(L2), null; 8078 case 4: 8079 return zh(), null; 8080 case 10: 8081 return ah(b2.type._context), null; 8082 case 22: 8083 case 23: 8084 return Hj(), null; 8085 case 24: 8086 return null; 8087 default: 8088 return null; 8089 } 8090 } 8091 var Jj = false, U2 = false, Kj = "function" === typeof WeakSet ? WeakSet : Set, V2 = null; 8092 function Lj(a2, b2) { 8093 var c2 = a2.ref; 8094 if (null !== c2) if ("function" === typeof c2) try { 8095 c2(null); 8096 } catch (d2) { 8097 W2(a2, b2, d2); 8098 } 8099 else c2.current = null; 8100 } 8101 function Mj(a2, b2, c2) { 8102 try { 8103 c2(); 8104 } catch (d2) { 8105 W2(a2, b2, d2); 8106 } 8107 } 8108 var Nj = false; 8109 function Oj(a2, b2) { 8110 Cf = dd; 8111 a2 = Me2(); 8112 if (Ne2(a2)) { 8113 if ("selectionStart" in a2) var c2 = { start: a2.selectionStart, end: a2.selectionEnd }; 8114 else a: { 8115 c2 = (c2 = a2.ownerDocument) && c2.defaultView || window; 8116 var d2 = c2.getSelection && c2.getSelection(); 8117 if (d2 && 0 !== d2.rangeCount) { 8118 c2 = d2.anchorNode; 8119 var e2 = d2.anchorOffset, f2 = d2.focusNode; 8120 d2 = d2.focusOffset; 8121 try { 8122 c2.nodeType, f2.nodeType; 8123 } catch (F2) { 8124 c2 = null; 8125 break a; 8126 } 8127 var g2 = 0, h2 = -1, k2 = -1, l2 = 0, m2 = 0, q2 = a2, r2 = null; 8128 b: for (; ; ) { 8129 for (var y2; ; ) { 8130 q2 !== c2 || 0 !== e2 && 3 !== q2.nodeType || (h2 = g2 + e2); 8131 q2 !== f2 || 0 !== d2 && 3 !== q2.nodeType || (k2 = g2 + d2); 8132 3 === q2.nodeType && (g2 += q2.nodeValue.length); 8133 if (null === (y2 = q2.firstChild)) break; 8134 r2 = q2; 8135 q2 = y2; 8136 } 8137 for (; ; ) { 8138 if (q2 === a2) break b; 8139 r2 === c2 && ++l2 === e2 && (h2 = g2); 8140 r2 === f2 && ++m2 === d2 && (k2 = g2); 8141 if (null !== (y2 = q2.nextSibling)) break; 8142 q2 = r2; 8143 r2 = q2.parentNode; 8144 } 8145 q2 = y2; 8146 } 8147 c2 = -1 === h2 || -1 === k2 ? null : { start: h2, end: k2 }; 8148 } else c2 = null; 8149 } 8150 c2 = c2 || { start: 0, end: 0 }; 8151 } else c2 = null; 8152 Df = { focusedElem: a2, selectionRange: c2 }; 8153 dd = false; 8154 for (V2 = b2; null !== V2; ) if (b2 = V2, a2 = b2.child, 0 !== (b2.subtreeFlags & 1028) && null !== a2) a2.return = b2, V2 = a2; 8155 else for (; null !== V2; ) { 8156 b2 = V2; 8157 try { 8158 var n2 = b2.alternate; 8159 if (0 !== (b2.flags & 1024)) switch (b2.tag) { 8160 case 0: 8161 case 11: 8162 case 15: 8163 break; 8164 case 1: 8165 if (null !== n2) { 8166 var t2 = n2.memoizedProps, J2 = n2.memoizedState, x2 = b2.stateNode, w2 = x2.getSnapshotBeforeUpdate(b2.elementType === b2.type ? t2 : Ci2(b2.type, t2), J2); 8167 x2.__reactInternalSnapshotBeforeUpdate = w2; 8168 } 8169 break; 8170 case 3: 8171 var u2 = b2.stateNode.containerInfo; 8172 1 === u2.nodeType ? u2.textContent = "" : 9 === u2.nodeType && u2.documentElement && u2.removeChild(u2.documentElement); 8173 break; 8174 case 5: 8175 case 6: 8176 case 4: 8177 case 17: 8178 break; 8179 default: 8180 throw Error(p2(163)); 8181 } 8182 } catch (F2) { 8183 W2(b2, b2.return, F2); 8184 } 8185 a2 = b2.sibling; 8186 if (null !== a2) { 8187 a2.return = b2.return; 8188 V2 = a2; 8189 break; 8190 } 8191 V2 = b2.return; 8192 } 8193 n2 = Nj; 8194 Nj = false; 8195 return n2; 8196 } 8197 function Pj(a2, b2, c2) { 8198 var d2 = b2.updateQueue; 8199 d2 = null !== d2 ? d2.lastEffect : null; 8200 if (null !== d2) { 8201 var e2 = d2 = d2.next; 8202 do { 8203 if ((e2.tag & a2) === a2) { 8204 var f2 = e2.destroy; 8205 e2.destroy = void 0; 8206 void 0 !== f2 && Mj(b2, c2, f2); 8207 } 8208 e2 = e2.next; 8209 } while (e2 !== d2); 8210 } 8211 } 8212 function Qj(a2, b2) { 8213 b2 = b2.updateQueue; 8214 b2 = null !== b2 ? b2.lastEffect : null; 8215 if (null !== b2) { 8216 var c2 = b2 = b2.next; 8217 do { 8218 if ((c2.tag & a2) === a2) { 8219 var d2 = c2.create; 8220 c2.destroy = d2(); 8221 } 8222 c2 = c2.next; 8223 } while (c2 !== b2); 8224 } 8225 } 8226 function Rj(a2) { 8227 var b2 = a2.ref; 8228 if (null !== b2) { 8229 var c2 = a2.stateNode; 8230 switch (a2.tag) { 8231 case 5: 8232 a2 = c2; 8233 break; 8234 default: 8235 a2 = c2; 8236 } 8237 "function" === typeof b2 ? b2(a2) : b2.current = a2; 8238 } 8239 } 8240 function Sj(a2) { 8241 var b2 = a2.alternate; 8242 null !== b2 && (a2.alternate = null, Sj(b2)); 8243 a2.child = null; 8244 a2.deletions = null; 8245 a2.sibling = null; 8246 5 === a2.tag && (b2 = a2.stateNode, null !== b2 && (delete b2[Of], delete b2[Pf], delete b2[of], delete b2[Qf], delete b2[Rf])); 8247 a2.stateNode = null; 8248 a2.return = null; 8249 a2.dependencies = null; 8250 a2.memoizedProps = null; 8251 a2.memoizedState = null; 8252 a2.pendingProps = null; 8253 a2.stateNode = null; 8254 a2.updateQueue = null; 8255 } 8256 function Tj(a2) { 8257 return 5 === a2.tag || 3 === a2.tag || 4 === a2.tag; 8258 } 8259 function Uj(a2) { 8260 a: for (; ; ) { 8261 for (; null === a2.sibling; ) { 8262 if (null === a2.return || Tj(a2.return)) return null; 8263 a2 = a2.return; 8264 } 8265 a2.sibling.return = a2.return; 8266 for (a2 = a2.sibling; 5 !== a2.tag && 6 !== a2.tag && 18 !== a2.tag; ) { 8267 if (a2.flags & 2) continue a; 8268 if (null === a2.child || 4 === a2.tag) continue a; 8269 else a2.child.return = a2, a2 = a2.child; 8270 } 8271 if (!(a2.flags & 2)) return a2.stateNode; 8272 } 8273 } 8274 function Vj(a2, b2, c2) { 8275 var d2 = a2.tag; 8276 if (5 === d2 || 6 === d2) a2 = a2.stateNode, b2 ? 8 === c2.nodeType ? c2.parentNode.insertBefore(a2, b2) : c2.insertBefore(a2, b2) : (8 === c2.nodeType ? (b2 = c2.parentNode, b2.insertBefore(a2, c2)) : (b2 = c2, b2.appendChild(a2)), c2 = c2._reactRootContainer, null !== c2 && void 0 !== c2 || null !== b2.onclick || (b2.onclick = Bf)); 8277 else if (4 !== d2 && (a2 = a2.child, null !== a2)) for (Vj(a2, b2, c2), a2 = a2.sibling; null !== a2; ) Vj(a2, b2, c2), a2 = a2.sibling; 8278 } 8279 function Wj(a2, b2, c2) { 8280 var d2 = a2.tag; 8281 if (5 === d2 || 6 === d2) a2 = a2.stateNode, b2 ? c2.insertBefore(a2, b2) : c2.appendChild(a2); 8282 else if (4 !== d2 && (a2 = a2.child, null !== a2)) for (Wj(a2, b2, c2), a2 = a2.sibling; null !== a2; ) Wj(a2, b2, c2), a2 = a2.sibling; 8283 } 8284 var X2 = null, Xj = false; 8285 function Yj(a2, b2, c2) { 8286 for (c2 = c2.child; null !== c2; ) Zj(a2, b2, c2), c2 = c2.sibling; 8287 } 8288 function Zj(a2, b2, c2) { 8289 if (lc && "function" === typeof lc.onCommitFiberUnmount) try { 8290 lc.onCommitFiberUnmount(kc, c2); 8291 } catch (h2) { 8292 } 8293 switch (c2.tag) { 8294 case 5: 8295 U2 || Lj(c2, b2); 8296 case 6: 8297 var d2 = X2, e2 = Xj; 8298 X2 = null; 8299 Yj(a2, b2, c2); 8300 X2 = d2; 8301 Xj = e2; 8302 null !== X2 && (Xj ? (a2 = X2, c2 = c2.stateNode, 8 === a2.nodeType ? a2.parentNode.removeChild(c2) : a2.removeChild(c2)) : X2.removeChild(c2.stateNode)); 8303 break; 8304 case 18: 8305 null !== X2 && (Xj ? (a2 = X2, c2 = c2.stateNode, 8 === a2.nodeType ? Kf(a2.parentNode, c2) : 1 === a2.nodeType && Kf(a2, c2), bd(a2)) : Kf(X2, c2.stateNode)); 8306 break; 8307 case 4: 8308 d2 = X2; 8309 e2 = Xj; 8310 X2 = c2.stateNode.containerInfo; 8311 Xj = true; 8312 Yj(a2, b2, c2); 8313 X2 = d2; 8314 Xj = e2; 8315 break; 8316 case 0: 8317 case 11: 8318 case 14: 8319 case 15: 8320 if (!U2 && (d2 = c2.updateQueue, null !== d2 && (d2 = d2.lastEffect, null !== d2))) { 8321 e2 = d2 = d2.next; 8322 do { 8323 var f2 = e2, g2 = f2.destroy; 8324 f2 = f2.tag; 8325 void 0 !== g2 && (0 !== (f2 & 2) ? Mj(c2, b2, g2) : 0 !== (f2 & 4) && Mj(c2, b2, g2)); 8326 e2 = e2.next; 8327 } while (e2 !== d2); 8328 } 8329 Yj(a2, b2, c2); 8330 break; 8331 case 1: 8332 if (!U2 && (Lj(c2, b2), d2 = c2.stateNode, "function" === typeof d2.componentWillUnmount)) try { 8333 d2.props = c2.memoizedProps, d2.state = c2.memoizedState, d2.componentWillUnmount(); 8334 } catch (h2) { 8335 W2(c2, b2, h2); 8336 } 8337 Yj(a2, b2, c2); 8338 break; 8339 case 21: 8340 Yj(a2, b2, c2); 8341 break; 8342 case 22: 8343 c2.mode & 1 ? (U2 = (d2 = U2) || null !== c2.memoizedState, Yj(a2, b2, c2), U2 = d2) : Yj(a2, b2, c2); 8344 break; 8345 default: 8346 Yj(a2, b2, c2); 8347 } 8348 } 8349 function ak(a2) { 8350 var b2 = a2.updateQueue; 8351 if (null !== b2) { 8352 a2.updateQueue = null; 8353 var c2 = a2.stateNode; 8354 null === c2 && (c2 = a2.stateNode = new Kj()); 8355 b2.forEach(function(b3) { 8356 var d2 = bk.bind(null, a2, b3); 8357 c2.has(b3) || (c2.add(b3), b3.then(d2, d2)); 8358 }); 8359 } 8360 } 8361 function ck(a2, b2) { 8362 var c2 = b2.deletions; 8363 if (null !== c2) for (var d2 = 0; d2 < c2.length; d2++) { 8364 var e2 = c2[d2]; 8365 try { 8366 var f2 = a2, g2 = b2, h2 = g2; 8367 a: for (; null !== h2; ) { 8368 switch (h2.tag) { 8369 case 5: 8370 X2 = h2.stateNode; 8371 Xj = false; 8372 break a; 8373 case 3: 8374 X2 = h2.stateNode.containerInfo; 8375 Xj = true; 8376 break a; 8377 case 4: 8378 X2 = h2.stateNode.containerInfo; 8379 Xj = true; 8380 break a; 8381 } 8382 h2 = h2.return; 8383 } 8384 if (null === X2) throw Error(p2(160)); 8385 Zj(f2, g2, e2); 8386 X2 = null; 8387 Xj = false; 8388 var k2 = e2.alternate; 8389 null !== k2 && (k2.return = null); 8390 e2.return = null; 8391 } catch (l2) { 8392 W2(e2, b2, l2); 8393 } 8394 } 8395 if (b2.subtreeFlags & 12854) for (b2 = b2.child; null !== b2; ) dk(b2, a2), b2 = b2.sibling; 8396 } 8397 function dk(a2, b2) { 8398 var c2 = a2.alternate, d2 = a2.flags; 8399 switch (a2.tag) { 8400 case 0: 8401 case 11: 8402 case 14: 8403 case 15: 8404 ck(b2, a2); 8405 ek(a2); 8406 if (d2 & 4) { 8407 try { 8408 Pj(3, a2, a2.return), Qj(3, a2); 8409 } catch (t2) { 8410 W2(a2, a2.return, t2); 8411 } 8412 try { 8413 Pj(5, a2, a2.return); 8414 } catch (t2) { 8415 W2(a2, a2.return, t2); 8416 } 8417 } 8418 break; 8419 case 1: 8420 ck(b2, a2); 8421 ek(a2); 8422 d2 & 512 && null !== c2 && Lj(c2, c2.return); 8423 break; 8424 case 5: 8425 ck(b2, a2); 8426 ek(a2); 8427 d2 & 512 && null !== c2 && Lj(c2, c2.return); 8428 if (a2.flags & 32) { 8429 var e2 = a2.stateNode; 8430 try { 8431 ob(e2, ""); 8432 } catch (t2) { 8433 W2(a2, a2.return, t2); 8434 } 8435 } 8436 if (d2 & 4 && (e2 = a2.stateNode, null != e2)) { 8437 var f2 = a2.memoizedProps, g2 = null !== c2 ? c2.memoizedProps : f2, h2 = a2.type, k2 = a2.updateQueue; 8438 a2.updateQueue = null; 8439 if (null !== k2) try { 8440 "input" === h2 && "radio" === f2.type && null != f2.name && ab(e2, f2); 8441 vb(h2, g2); 8442 var l2 = vb(h2, f2); 8443 for (g2 = 0; g2 < k2.length; g2 += 2) { 8444 var m2 = k2[g2], q2 = k2[g2 + 1]; 8445 "style" === m2 ? sb(e2, q2) : "dangerouslySetInnerHTML" === m2 ? nb(e2, q2) : "children" === m2 ? ob(e2, q2) : ta(e2, m2, q2, l2); 8446 } 8447 switch (h2) { 8448 case "input": 8449 bb(e2, f2); 8450 break; 8451 case "textarea": 8452 ib(e2, f2); 8453 break; 8454 case "select": 8455 var r2 = e2._wrapperState.wasMultiple; 8456 e2._wrapperState.wasMultiple = !!f2.multiple; 8457 var y2 = f2.value; 8458 null != y2 ? fb(e2, !!f2.multiple, y2, false) : r2 !== !!f2.multiple && (null != f2.defaultValue ? fb( 8459 e2, 8460 !!f2.multiple, 8461 f2.defaultValue, 8462 true 8463 ) : fb(e2, !!f2.multiple, f2.multiple ? [] : "", false)); 8464 } 8465 e2[Pf] = f2; 8466 } catch (t2) { 8467 W2(a2, a2.return, t2); 8468 } 8469 } 8470 break; 8471 case 6: 8472 ck(b2, a2); 8473 ek(a2); 8474 if (d2 & 4) { 8475 if (null === a2.stateNode) throw Error(p2(162)); 8476 e2 = a2.stateNode; 8477 f2 = a2.memoizedProps; 8478 try { 8479 e2.nodeValue = f2; 8480 } catch (t2) { 8481 W2(a2, a2.return, t2); 8482 } 8483 } 8484 break; 8485 case 3: 8486 ck(b2, a2); 8487 ek(a2); 8488 if (d2 & 4 && null !== c2 && c2.memoizedState.isDehydrated) try { 8489 bd(b2.containerInfo); 8490 } catch (t2) { 8491 W2(a2, a2.return, t2); 8492 } 8493 break; 8494 case 4: 8495 ck(b2, a2); 8496 ek(a2); 8497 break; 8498 case 13: 8499 ck(b2, a2); 8500 ek(a2); 8501 e2 = a2.child; 8502 e2.flags & 8192 && (f2 = null !== e2.memoizedState, e2.stateNode.isHidden = f2, !f2 || null !== e2.alternate && null !== e2.alternate.memoizedState || (fk = B2())); 8503 d2 & 4 && ak(a2); 8504 break; 8505 case 22: 8506 m2 = null !== c2 && null !== c2.memoizedState; 8507 a2.mode & 1 ? (U2 = (l2 = U2) || m2, ck(b2, a2), U2 = l2) : ck(b2, a2); 8508 ek(a2); 8509 if (d2 & 8192) { 8510 l2 = null !== a2.memoizedState; 8511 if ((a2.stateNode.isHidden = l2) && !m2 && 0 !== (a2.mode & 1)) for (V2 = a2, m2 = a2.child; null !== m2; ) { 8512 for (q2 = V2 = m2; null !== V2; ) { 8513 r2 = V2; 8514 y2 = r2.child; 8515 switch (r2.tag) { 8516 case 0: 8517 case 11: 8518 case 14: 8519 case 15: 8520 Pj(4, r2, r2.return); 8521 break; 8522 case 1: 8523 Lj(r2, r2.return); 8524 var n2 = r2.stateNode; 8525 if ("function" === typeof n2.componentWillUnmount) { 8526 d2 = r2; 8527 c2 = r2.return; 8528 try { 8529 b2 = d2, n2.props = b2.memoizedProps, n2.state = b2.memoizedState, n2.componentWillUnmount(); 8530 } catch (t2) { 8531 W2(d2, c2, t2); 8532 } 8533 } 8534 break; 8535 case 5: 8536 Lj(r2, r2.return); 8537 break; 8538 case 22: 8539 if (null !== r2.memoizedState) { 8540 gk(q2); 8541 continue; 8542 } 8543 } 8544 null !== y2 ? (y2.return = r2, V2 = y2) : gk(q2); 8545 } 8546 m2 = m2.sibling; 8547 } 8548 a: for (m2 = null, q2 = a2; ; ) { 8549 if (5 === q2.tag) { 8550 if (null === m2) { 8551 m2 = q2; 8552 try { 8553 e2 = q2.stateNode, l2 ? (f2 = e2.style, "function" === typeof f2.setProperty ? f2.setProperty("display", "none", "important") : f2.display = "none") : (h2 = q2.stateNode, k2 = q2.memoizedProps.style, g2 = void 0 !== k2 && null !== k2 && k2.hasOwnProperty("display") ? k2.display : null, h2.style.display = rb("display", g2)); 8554 } catch (t2) { 8555 W2(a2, a2.return, t2); 8556 } 8557 } 8558 } else if (6 === q2.tag) { 8559 if (null === m2) try { 8560 q2.stateNode.nodeValue = l2 ? "" : q2.memoizedProps; 8561 } catch (t2) { 8562 W2(a2, a2.return, t2); 8563 } 8564 } else if ((22 !== q2.tag && 23 !== q2.tag || null === q2.memoizedState || q2 === a2) && null !== q2.child) { 8565 q2.child.return = q2; 8566 q2 = q2.child; 8567 continue; 8568 } 8569 if (q2 === a2) break a; 8570 for (; null === q2.sibling; ) { 8571 if (null === q2.return || q2.return === a2) break a; 8572 m2 === q2 && (m2 = null); 8573 q2 = q2.return; 8574 } 8575 m2 === q2 && (m2 = null); 8576 q2.sibling.return = q2.return; 8577 q2 = q2.sibling; 8578 } 8579 } 8580 break; 8581 case 19: 8582 ck(b2, a2); 8583 ek(a2); 8584 d2 & 4 && ak(a2); 8585 break; 8586 case 21: 8587 break; 8588 default: 8589 ck( 8590 b2, 8591 a2 8592 ), ek(a2); 8593 } 8594 } 8595 function ek(a2) { 8596 var b2 = a2.flags; 8597 if (b2 & 2) { 8598 try { 8599 a: { 8600 for (var c2 = a2.return; null !== c2; ) { 8601 if (Tj(c2)) { 8602 var d2 = c2; 8603 break a; 8604 } 8605 c2 = c2.return; 8606 } 8607 throw Error(p2(160)); 8608 } 8609 switch (d2.tag) { 8610 case 5: 8611 var e2 = d2.stateNode; 8612 d2.flags & 32 && (ob(e2, ""), d2.flags &= -33); 8613 var f2 = Uj(a2); 8614 Wj(a2, f2, e2); 8615 break; 8616 case 3: 8617 case 4: 8618 var g2 = d2.stateNode.containerInfo, h2 = Uj(a2); 8619 Vj(a2, h2, g2); 8620 break; 8621 default: 8622 throw Error(p2(161)); 8623 } 8624 } catch (k2) { 8625 W2(a2, a2.return, k2); 8626 } 8627 a2.flags &= -3; 8628 } 8629 b2 & 4096 && (a2.flags &= -4097); 8630 } 8631 function hk(a2, b2, c2) { 8632 V2 = a2; 8633 ik(a2); 8634 } 8635 function ik(a2, b2, c2) { 8636 for (var d2 = 0 !== (a2.mode & 1); null !== V2; ) { 8637 var e2 = V2, f2 = e2.child; 8638 if (22 === e2.tag && d2) { 8639 var g2 = null !== e2.memoizedState || Jj; 8640 if (!g2) { 8641 var h2 = e2.alternate, k2 = null !== h2 && null !== h2.memoizedState || U2; 8642 h2 = Jj; 8643 var l2 = U2; 8644 Jj = g2; 8645 if ((U2 = k2) && !l2) for (V2 = e2; null !== V2; ) g2 = V2, k2 = g2.child, 22 === g2.tag && null !== g2.memoizedState ? jk(e2) : null !== k2 ? (k2.return = g2, V2 = k2) : jk(e2); 8646 for (; null !== f2; ) V2 = f2, ik(f2), f2 = f2.sibling; 8647 V2 = e2; 8648 Jj = h2; 8649 U2 = l2; 8650 } 8651 kk(a2); 8652 } else 0 !== (e2.subtreeFlags & 8772) && null !== f2 ? (f2.return = e2, V2 = f2) : kk(a2); 8653 } 8654 } 8655 function kk(a2) { 8656 for (; null !== V2; ) { 8657 var b2 = V2; 8658 if (0 !== (b2.flags & 8772)) { 8659 var c2 = b2.alternate; 8660 try { 8661 if (0 !== (b2.flags & 8772)) switch (b2.tag) { 8662 case 0: 8663 case 11: 8664 case 15: 8665 U2 || Qj(5, b2); 8666 break; 8667 case 1: 8668 var d2 = b2.stateNode; 8669 if (b2.flags & 4 && !U2) if (null === c2) d2.componentDidMount(); 8670 else { 8671 var e2 = b2.elementType === b2.type ? c2.memoizedProps : Ci2(b2.type, c2.memoizedProps); 8672 d2.componentDidUpdate(e2, c2.memoizedState, d2.__reactInternalSnapshotBeforeUpdate); 8673 } 8674 var f2 = b2.updateQueue; 8675 null !== f2 && sh(b2, f2, d2); 8676 break; 8677 case 3: 8678 var g2 = b2.updateQueue; 8679 if (null !== g2) { 8680 c2 = null; 8681 if (null !== b2.child) switch (b2.child.tag) { 8682 case 5: 8683 c2 = b2.child.stateNode; 8684 break; 8685 case 1: 8686 c2 = b2.child.stateNode; 8687 } 8688 sh(b2, g2, c2); 8689 } 8690 break; 8691 case 5: 8692 var h2 = b2.stateNode; 8693 if (null === c2 && b2.flags & 4) { 8694 c2 = h2; 8695 var k2 = b2.memoizedProps; 8696 switch (b2.type) { 8697 case "button": 8698 case "input": 8699 case "select": 8700 case "textarea": 8701 k2.autoFocus && c2.focus(); 8702 break; 8703 case "img": 8704 k2.src && (c2.src = k2.src); 8705 } 8706 } 8707 break; 8708 case 6: 8709 break; 8710 case 4: 8711 break; 8712 case 12: 8713 break; 8714 case 13: 8715 if (null === b2.memoizedState) { 8716 var l2 = b2.alternate; 8717 if (null !== l2) { 8718 var m2 = l2.memoizedState; 8719 if (null !== m2) { 8720 var q2 = m2.dehydrated; 8721 null !== q2 && bd(q2); 8722 } 8723 } 8724 } 8725 break; 8726 case 19: 8727 case 17: 8728 case 21: 8729 case 22: 8730 case 23: 8731 case 25: 8732 break; 8733 default: 8734 throw Error(p2(163)); 8735 } 8736 U2 || b2.flags & 512 && Rj(b2); 8737 } catch (r2) { 8738 W2(b2, b2.return, r2); 8739 } 8740 } 8741 if (b2 === a2) { 8742 V2 = null; 8743 break; 8744 } 8745 c2 = b2.sibling; 8746 if (null !== c2) { 8747 c2.return = b2.return; 8748 V2 = c2; 8749 break; 8750 } 8751 V2 = b2.return; 8752 } 8753 } 8754 function gk(a2) { 8755 for (; null !== V2; ) { 8756 var b2 = V2; 8757 if (b2 === a2) { 8758 V2 = null; 8759 break; 8760 } 8761 var c2 = b2.sibling; 8762 if (null !== c2) { 8763 c2.return = b2.return; 8764 V2 = c2; 8765 break; 8766 } 8767 V2 = b2.return; 8768 } 8769 } 8770 function jk(a2) { 8771 for (; null !== V2; ) { 8772 var b2 = V2; 8773 try { 8774 switch (b2.tag) { 8775 case 0: 8776 case 11: 8777 case 15: 8778 var c2 = b2.return; 8779 try { 8780 Qj(4, b2); 8781 } catch (k2) { 8782 W2(b2, c2, k2); 8783 } 8784 break; 8785 case 1: 8786 var d2 = b2.stateNode; 8787 if ("function" === typeof d2.componentDidMount) { 8788 var e2 = b2.return; 8789 try { 8790 d2.componentDidMount(); 8791 } catch (k2) { 8792 W2(b2, e2, k2); 8793 } 8794 } 8795 var f2 = b2.return; 8796 try { 8797 Rj(b2); 8798 } catch (k2) { 8799 W2(b2, f2, k2); 8800 } 8801 break; 8802 case 5: 8803 var g2 = b2.return; 8804 try { 8805 Rj(b2); 8806 } catch (k2) { 8807 W2(b2, g2, k2); 8808 } 8809 } 8810 } catch (k2) { 8811 W2(b2, b2.return, k2); 8812 } 8813 if (b2 === a2) { 8814 V2 = null; 8815 break; 8816 } 8817 var h2 = b2.sibling; 8818 if (null !== h2) { 8819 h2.return = b2.return; 8820 V2 = h2; 8821 break; 8822 } 8823 V2 = b2.return; 8824 } 8825 } 8826 var lk = Math.ceil, mk = ua2.ReactCurrentDispatcher, nk = ua2.ReactCurrentOwner, ok = ua2.ReactCurrentBatchConfig, K2 = 0, Q2 = null, Y2 = null, Z2 = 0, fj = 0, ej = Uf(0), T2 = 0, pk = null, rh = 0, qk = 0, rk = 0, sk = null, tk = null, fk = 0, Gj = Infinity, uk = null, Oi2 = false, Pi2 = null, Ri2 = null, vk = false, wk = null, xk = 0, yk = 0, zk = null, Ak = -1, Bk = 0; 8827 function R2() { 8828 return 0 !== (K2 & 6) ? B2() : -1 !== Ak ? Ak : Ak = B2(); 8829 } 8830 function yi2(a2) { 8831 if (0 === (a2.mode & 1)) return 1; 8832 if (0 !== (K2 & 2) && 0 !== Z2) return Z2 & -Z2; 8833 if (null !== Kg.transition) return 0 === Bk && (Bk = yc2()), Bk; 8834 a2 = C2; 8835 if (0 !== a2) return a2; 8836 a2 = window.event; 8837 a2 = void 0 === a2 ? 16 : jd(a2.type); 8838 return a2; 8839 } 8840 function gi2(a2, b2, c2, d2) { 8841 if (50 < yk) throw yk = 0, zk = null, Error(p2(185)); 8842 Ac(a2, c2, d2); 8843 if (0 === (K2 & 2) || a2 !== Q2) a2 === Q2 && (0 === (K2 & 2) && (qk |= c2), 4 === T2 && Ck(a2, Z2)), Dk(a2, d2), 1 === c2 && 0 === K2 && 0 === (b2.mode & 1) && (Gj = B2() + 500, fg && jg()); 8844 } 8845 function Dk(a2, b2) { 8846 var c2 = a2.callbackNode; 8847 wc(a2, b2); 8848 var d2 = uc(a2, a2 === Q2 ? Z2 : 0); 8849 if (0 === d2) null !== c2 && bc(c2), a2.callbackNode = null, a2.callbackPriority = 0; 8850 else if (b2 = d2 & -d2, a2.callbackPriority !== b2) { 8851 null != c2 && bc(c2); 8852 if (1 === b2) 0 === a2.tag ? ig(Ek.bind(null, a2)) : hg(Ek.bind(null, a2)), Jf(function() { 8853 0 === (K2 & 6) && jg(); 8854 }), c2 = null; 8855 else { 8856 switch (Dc(d2)) { 8857 case 1: 8858 c2 = fc; 8859 break; 8860 case 4: 8861 c2 = gc; 8862 break; 8863 case 16: 8864 c2 = hc; 8865 break; 8866 case 536870912: 8867 c2 = jc; 8868 break; 8869 default: 8870 c2 = hc; 8871 } 8872 c2 = Fk(c2, Gk.bind(null, a2)); 8873 } 8874 a2.callbackPriority = b2; 8875 a2.callbackNode = c2; 8876 } 8877 } 8878 function Gk(a2, b2) { 8879 Ak = -1; 8880 Bk = 0; 8881 if (0 !== (K2 & 6)) throw Error(p2(327)); 8882 var c2 = a2.callbackNode; 8883 if (Hk() && a2.callbackNode !== c2) return null; 8884 var d2 = uc(a2, a2 === Q2 ? Z2 : 0); 8885 if (0 === d2) return null; 8886 if (0 !== (d2 & 30) || 0 !== (d2 & a2.expiredLanes) || b2) b2 = Ik(a2, d2); 8887 else { 8888 b2 = d2; 8889 var e2 = K2; 8890 K2 |= 2; 8891 var f2 = Jk(); 8892 if (Q2 !== a2 || Z2 !== b2) uk = null, Gj = B2() + 500, Kk(a2, b2); 8893 do 8894 try { 8895 Lk(); 8896 break; 8897 } catch (h2) { 8898 Mk(a2, h2); 8899 } 8900 while (1); 8901 $g(); 8902 mk.current = f2; 8903 K2 = e2; 8904 null !== Y2 ? b2 = 0 : (Q2 = null, Z2 = 0, b2 = T2); 8905 } 8906 if (0 !== b2) { 8907 2 === b2 && (e2 = xc(a2), 0 !== e2 && (d2 = e2, b2 = Nk(a2, e2))); 8908 if (1 === b2) throw c2 = pk, Kk(a2, 0), Ck(a2, d2), Dk(a2, B2()), c2; 8909 if (6 === b2) Ck(a2, d2); 8910 else { 8911 e2 = a2.current.alternate; 8912 if (0 === (d2 & 30) && !Ok(e2) && (b2 = Ik(a2, d2), 2 === b2 && (f2 = xc(a2), 0 !== f2 && (d2 = f2, b2 = Nk(a2, f2))), 1 === b2)) throw c2 = pk, Kk(a2, 0), Ck(a2, d2), Dk(a2, B2()), c2; 8913 a2.finishedWork = e2; 8914 a2.finishedLanes = d2; 8915 switch (b2) { 8916 case 0: 8917 case 1: 8918 throw Error(p2(345)); 8919 case 2: 8920 Pk(a2, tk, uk); 8921 break; 8922 case 3: 8923 Ck(a2, d2); 8924 if ((d2 & 130023424) === d2 && (b2 = fk + 500 - B2(), 10 < b2)) { 8925 if (0 !== uc(a2, 0)) break; 8926 e2 = a2.suspendedLanes; 8927 if ((e2 & d2) !== d2) { 8928 R2(); 8929 a2.pingedLanes |= a2.suspendedLanes & e2; 8930 break; 8931 } 8932 a2.timeoutHandle = Ff(Pk.bind(null, a2, tk, uk), b2); 8933 break; 8934 } 8935 Pk(a2, tk, uk); 8936 break; 8937 case 4: 8938 Ck(a2, d2); 8939 if ((d2 & 4194240) === d2) break; 8940 b2 = a2.eventTimes; 8941 for (e2 = -1; 0 < d2; ) { 8942 var g2 = 31 - oc(d2); 8943 f2 = 1 << g2; 8944 g2 = b2[g2]; 8945 g2 > e2 && (e2 = g2); 8946 d2 &= ~f2; 8947 } 8948 d2 = e2; 8949 d2 = B2() - d2; 8950 d2 = (120 > d2 ? 120 : 480 > d2 ? 480 : 1080 > d2 ? 1080 : 1920 > d2 ? 1920 : 3e3 > d2 ? 3e3 : 4320 > d2 ? 4320 : 1960 * lk(d2 / 1960)) - d2; 8951 if (10 < d2) { 8952 a2.timeoutHandle = Ff(Pk.bind(null, a2, tk, uk), d2); 8953 break; 8954 } 8955 Pk(a2, tk, uk); 8956 break; 8957 case 5: 8958 Pk(a2, tk, uk); 8959 break; 8960 default: 8961 throw Error(p2(329)); 8962 } 8963 } 8964 } 8965 Dk(a2, B2()); 8966 return a2.callbackNode === c2 ? Gk.bind(null, a2) : null; 8967 } 8968 function Nk(a2, b2) { 8969 var c2 = sk; 8970 a2.current.memoizedState.isDehydrated && (Kk(a2, b2).flags |= 256); 8971 a2 = Ik(a2, b2); 8972 2 !== a2 && (b2 = tk, tk = c2, null !== b2 && Fj(b2)); 8973 return a2; 8974 } 8975 function Fj(a2) { 8976 null === tk ? tk = a2 : tk.push.apply(tk, a2); 8977 } 8978 function Ok(a2) { 8979 for (var b2 = a2; ; ) { 8980 if (b2.flags & 16384) { 8981 var c2 = b2.updateQueue; 8982 if (null !== c2 && (c2 = c2.stores, null !== c2)) for (var d2 = 0; d2 < c2.length; d2++) { 8983 var e2 = c2[d2], f2 = e2.getSnapshot; 8984 e2 = e2.value; 8985 try { 8986 if (!He2(f2(), e2)) return false; 8987 } catch (g2) { 8988 return false; 8989 } 8990 } 8991 } 8992 c2 = b2.child; 8993 if (b2.subtreeFlags & 16384 && null !== c2) c2.return = b2, b2 = c2; 8994 else { 8995 if (b2 === a2) break; 8996 for (; null === b2.sibling; ) { 8997 if (null === b2.return || b2.return === a2) return true; 8998 b2 = b2.return; 8999 } 9000 b2.sibling.return = b2.return; 9001 b2 = b2.sibling; 9002 } 9003 } 9004 return true; 9005 } 9006 function Ck(a2, b2) { 9007 b2 &= ~rk; 9008 b2 &= ~qk; 9009 a2.suspendedLanes |= b2; 9010 a2.pingedLanes &= ~b2; 9011 for (a2 = a2.expirationTimes; 0 < b2; ) { 9012 var c2 = 31 - oc(b2), d2 = 1 << c2; 9013 a2[c2] = -1; 9014 b2 &= ~d2; 9015 } 9016 } 9017 function Ek(a2) { 9018 if (0 !== (K2 & 6)) throw Error(p2(327)); 9019 Hk(); 9020 var b2 = uc(a2, 0); 9021 if (0 === (b2 & 1)) return Dk(a2, B2()), null; 9022 var c2 = Ik(a2, b2); 9023 if (0 !== a2.tag && 2 === c2) { 9024 var d2 = xc(a2); 9025 0 !== d2 && (b2 = d2, c2 = Nk(a2, d2)); 9026 } 9027 if (1 === c2) throw c2 = pk, Kk(a2, 0), Ck(a2, b2), Dk(a2, B2()), c2; 9028 if (6 === c2) throw Error(p2(345)); 9029 a2.finishedWork = a2.current.alternate; 9030 a2.finishedLanes = b2; 9031 Pk(a2, tk, uk); 9032 Dk(a2, B2()); 9033 return null; 9034 } 9035 function Qk(a2, b2) { 9036 var c2 = K2; 9037 K2 |= 1; 9038 try { 9039 return a2(b2); 9040 } finally { 9041 K2 = c2, 0 === K2 && (Gj = B2() + 500, fg && jg()); 9042 } 9043 } 9044 function Rk(a2) { 9045 null !== wk && 0 === wk.tag && 0 === (K2 & 6) && Hk(); 9046 var b2 = K2; 9047 K2 |= 1; 9048 var c2 = ok.transition, d2 = C2; 9049 try { 9050 if (ok.transition = null, C2 = 1, a2) return a2(); 9051 } finally { 9052 C2 = d2, ok.transition = c2, K2 = b2, 0 === (K2 & 6) && jg(); 9053 } 9054 } 9055 function Hj() { 9056 fj = ej.current; 9057 E2(ej); 9058 } 9059 function Kk(a2, b2) { 9060 a2.finishedWork = null; 9061 a2.finishedLanes = 0; 9062 var c2 = a2.timeoutHandle; 9063 -1 !== c2 && (a2.timeoutHandle = -1, Gf(c2)); 9064 if (null !== Y2) for (c2 = Y2.return; null !== c2; ) { 9065 var d2 = c2; 9066 wg(d2); 9067 switch (d2.tag) { 9068 case 1: 9069 d2 = d2.type.childContextTypes; 9070 null !== d2 && void 0 !== d2 && $f(); 9071 break; 9072 case 3: 9073 zh(); 9074 E2(Wf); 9075 E2(H2); 9076 Eh(); 9077 break; 9078 case 5: 9079 Bh(d2); 9080 break; 9081 case 4: 9082 zh(); 9083 break; 9084 case 13: 9085 E2(L2); 9086 break; 9087 case 19: 9088 E2(L2); 9089 break; 9090 case 10: 9091 ah(d2.type._context); 9092 break; 9093 case 22: 9094 case 23: 9095 Hj(); 9096 } 9097 c2 = c2.return; 9098 } 9099 Q2 = a2; 9100 Y2 = a2 = Pg(a2.current, null); 9101 Z2 = fj = b2; 9102 T2 = 0; 9103 pk = null; 9104 rk = qk = rh = 0; 9105 tk = sk = null; 9106 if (null !== fh) { 9107 for (b2 = 0; b2 < fh.length; b2++) if (c2 = fh[b2], d2 = c2.interleaved, null !== d2) { 9108 c2.interleaved = null; 9109 var e2 = d2.next, f2 = c2.pending; 9110 if (null !== f2) { 9111 var g2 = f2.next; 9112 f2.next = e2; 9113 d2.next = g2; 9114 } 9115 c2.pending = d2; 9116 } 9117 fh = null; 9118 } 9119 return a2; 9120 } 9121 function Mk(a2, b2) { 9122 do { 9123 var c2 = Y2; 9124 try { 9125 $g(); 9126 Fh.current = Rh; 9127 if (Ih) { 9128 for (var d2 = M2.memoizedState; null !== d2; ) { 9129 var e2 = d2.queue; 9130 null !== e2 && (e2.pending = null); 9131 d2 = d2.next; 9132 } 9133 Ih = false; 9134 } 9135 Hh = 0; 9136 O2 = N2 = M2 = null; 9137 Jh = false; 9138 Kh = 0; 9139 nk.current = null; 9140 if (null === c2 || null === c2.return) { 9141 T2 = 1; 9142 pk = b2; 9143 Y2 = null; 9144 break; 9145 } 9146 a: { 9147 var f2 = a2, g2 = c2.return, h2 = c2, k2 = b2; 9148 b2 = Z2; 9149 h2.flags |= 32768; 9150 if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) { 9151 var l2 = k2, m2 = h2, q2 = m2.tag; 9152 if (0 === (m2.mode & 1) && (0 === q2 || 11 === q2 || 15 === q2)) { 9153 var r2 = m2.alternate; 9154 r2 ? (m2.updateQueue = r2.updateQueue, m2.memoizedState = r2.memoizedState, m2.lanes = r2.lanes) : (m2.updateQueue = null, m2.memoizedState = null); 9155 } 9156 var y2 = Ui2(g2); 9157 if (null !== y2) { 9158 y2.flags &= -257; 9159 Vi2(y2, g2, h2, f2, b2); 9160 y2.mode & 1 && Si2(f2, l2, b2); 9161 b2 = y2; 9162 k2 = l2; 9163 var n2 = b2.updateQueue; 9164 if (null === n2) { 9165 var t2 = /* @__PURE__ */ new Set(); 9166 t2.add(k2); 9167 b2.updateQueue = t2; 9168 } else n2.add(k2); 9169 break a; 9170 } else { 9171 if (0 === (b2 & 1)) { 9172 Si2(f2, l2, b2); 9173 tj(); 9174 break a; 9175 } 9176 k2 = Error(p2(426)); 9177 } 9178 } else if (I2 && h2.mode & 1) { 9179 var J2 = Ui2(g2); 9180 if (null !== J2) { 9181 0 === (J2.flags & 65536) && (J2.flags |= 256); 9182 Vi2(J2, g2, h2, f2, b2); 9183 Jg(Ji2(k2, h2)); 9184 break a; 9185 } 9186 } 9187 f2 = k2 = Ji2(k2, h2); 9188 4 !== T2 && (T2 = 2); 9189 null === sk ? sk = [f2] : sk.push(f2); 9190 f2 = g2; 9191 do { 9192 switch (f2.tag) { 9193 case 3: 9194 f2.flags |= 65536; 9195 b2 &= -b2; 9196 f2.lanes |= b2; 9197 var x2 = Ni2(f2, k2, b2); 9198 ph(f2, x2); 9199 break a; 9200 case 1: 9201 h2 = k2; 9202 var w2 = f2.type, u2 = f2.stateNode; 9203 if (0 === (f2.flags & 128) && ("function" === typeof w2.getDerivedStateFromError || null !== u2 && "function" === typeof u2.componentDidCatch && (null === Ri2 || !Ri2.has(u2)))) { 9204 f2.flags |= 65536; 9205 b2 &= -b2; 9206 f2.lanes |= b2; 9207 var F2 = Qi2(f2, h2, b2); 9208 ph(f2, F2); 9209 break a; 9210 } 9211 } 9212 f2 = f2.return; 9213 } while (null !== f2); 9214 } 9215 Sk(c2); 9216 } catch (na2) { 9217 b2 = na2; 9218 Y2 === c2 && null !== c2 && (Y2 = c2 = c2.return); 9219 continue; 9220 } 9221 break; 9222 } while (1); 9223 } 9224 function Jk() { 9225 var a2 = mk.current; 9226 mk.current = Rh; 9227 return null === a2 ? Rh : a2; 9228 } 9229 function tj() { 9230 if (0 === T2 || 3 === T2 || 2 === T2) T2 = 4; 9231 null === Q2 || 0 === (rh & 268435455) && 0 === (qk & 268435455) || Ck(Q2, Z2); 9232 } 9233 function Ik(a2, b2) { 9234 var c2 = K2; 9235 K2 |= 2; 9236 var d2 = Jk(); 9237 if (Q2 !== a2 || Z2 !== b2) uk = null, Kk(a2, b2); 9238 do 9239 try { 9240 Tk(); 9241 break; 9242 } catch (e2) { 9243 Mk(a2, e2); 9244 } 9245 while (1); 9246 $g(); 9247 K2 = c2; 9248 mk.current = d2; 9249 if (null !== Y2) throw Error(p2(261)); 9250 Q2 = null; 9251 Z2 = 0; 9252 return T2; 9253 } 9254 function Tk() { 9255 for (; null !== Y2; ) Uk(Y2); 9256 } 9257 function Lk() { 9258 for (; null !== Y2 && !cc(); ) Uk(Y2); 9259 } 9260 function Uk(a2) { 9261 var b2 = Vk(a2.alternate, a2, fj); 9262 a2.memoizedProps = a2.pendingProps; 9263 null === b2 ? Sk(a2) : Y2 = b2; 9264 nk.current = null; 9265 } 9266 function Sk(a2) { 9267 var b2 = a2; 9268 do { 9269 var c2 = b2.alternate; 9270 a2 = b2.return; 9271 if (0 === (b2.flags & 32768)) { 9272 if (c2 = Ej(c2, b2, fj), null !== c2) { 9273 Y2 = c2; 9274 return; 9275 } 9276 } else { 9277 c2 = Ij(c2, b2); 9278 if (null !== c2) { 9279 c2.flags &= 32767; 9280 Y2 = c2; 9281 return; 9282 } 9283 if (null !== a2) a2.flags |= 32768, a2.subtreeFlags = 0, a2.deletions = null; 9284 else { 9285 T2 = 6; 9286 Y2 = null; 9287 return; 9288 } 9289 } 9290 b2 = b2.sibling; 9291 if (null !== b2) { 9292 Y2 = b2; 9293 return; 9294 } 9295 Y2 = b2 = a2; 9296 } while (null !== b2); 9297 0 === T2 && (T2 = 5); 9298 } 9299 function Pk(a2, b2, c2) { 9300 var d2 = C2, e2 = ok.transition; 9301 try { 9302 ok.transition = null, C2 = 1, Wk(a2, b2, c2, d2); 9303 } finally { 9304 ok.transition = e2, C2 = d2; 9305 } 9306 return null; 9307 } 9308 function Wk(a2, b2, c2, d2) { 9309 do 9310 Hk(); 9311 while (null !== wk); 9312 if (0 !== (K2 & 6)) throw Error(p2(327)); 9313 c2 = a2.finishedWork; 9314 var e2 = a2.finishedLanes; 9315 if (null === c2) return null; 9316 a2.finishedWork = null; 9317 a2.finishedLanes = 0; 9318 if (c2 === a2.current) throw Error(p2(177)); 9319 a2.callbackNode = null; 9320 a2.callbackPriority = 0; 9321 var f2 = c2.lanes | c2.childLanes; 9322 Bc2(a2, f2); 9323 a2 === Q2 && (Y2 = Q2 = null, Z2 = 0); 9324 0 === (c2.subtreeFlags & 2064) && 0 === (c2.flags & 2064) || vk || (vk = true, Fk(hc, function() { 9325 Hk(); 9326 return null; 9327 })); 9328 f2 = 0 !== (c2.flags & 15990); 9329 if (0 !== (c2.subtreeFlags & 15990) || f2) { 9330 f2 = ok.transition; 9331 ok.transition = null; 9332 var g2 = C2; 9333 C2 = 1; 9334 var h2 = K2; 9335 K2 |= 4; 9336 nk.current = null; 9337 Oj(a2, c2); 9338 dk(c2, a2); 9339 Oe2(Df); 9340 dd = !!Cf; 9341 Df = Cf = null; 9342 a2.current = c2; 9343 hk(c2); 9344 dc(); 9345 K2 = h2; 9346 C2 = g2; 9347 ok.transition = f2; 9348 } else a2.current = c2; 9349 vk && (vk = false, wk = a2, xk = e2); 9350 f2 = a2.pendingLanes; 9351 0 === f2 && (Ri2 = null); 9352 mc(c2.stateNode); 9353 Dk(a2, B2()); 9354 if (null !== b2) for (d2 = a2.onRecoverableError, c2 = 0; c2 < b2.length; c2++) e2 = b2[c2], d2(e2.value, { componentStack: e2.stack, digest: e2.digest }); 9355 if (Oi2) throw Oi2 = false, a2 = Pi2, Pi2 = null, a2; 9356 0 !== (xk & 1) && 0 !== a2.tag && Hk(); 9357 f2 = a2.pendingLanes; 9358 0 !== (f2 & 1) ? a2 === zk ? yk++ : (yk = 0, zk = a2) : yk = 0; 9359 jg(); 9360 return null; 9361 } 9362 function Hk() { 9363 if (null !== wk) { 9364 var a2 = Dc(xk), b2 = ok.transition, c2 = C2; 9365 try { 9366 ok.transition = null; 9367 C2 = 16 > a2 ? 16 : a2; 9368 if (null === wk) var d2 = false; 9369 else { 9370 a2 = wk; 9371 wk = null; 9372 xk = 0; 9373 if (0 !== (K2 & 6)) throw Error(p2(331)); 9374 var e2 = K2; 9375 K2 |= 4; 9376 for (V2 = a2.current; null !== V2; ) { 9377 var f2 = V2, g2 = f2.child; 9378 if (0 !== (V2.flags & 16)) { 9379 var h2 = f2.deletions; 9380 if (null !== h2) { 9381 for (var k2 = 0; k2 < h2.length; k2++) { 9382 var l2 = h2[k2]; 9383 for (V2 = l2; null !== V2; ) { 9384 var m2 = V2; 9385 switch (m2.tag) { 9386 case 0: 9387 case 11: 9388 case 15: 9389 Pj(8, m2, f2); 9390 } 9391 var q2 = m2.child; 9392 if (null !== q2) q2.return = m2, V2 = q2; 9393 else for (; null !== V2; ) { 9394 m2 = V2; 9395 var r2 = m2.sibling, y2 = m2.return; 9396 Sj(m2); 9397 if (m2 === l2) { 9398 V2 = null; 9399 break; 9400 } 9401 if (null !== r2) { 9402 r2.return = y2; 9403 V2 = r2; 9404 break; 9405 } 9406 V2 = y2; 9407 } 9408 } 9409 } 9410 var n2 = f2.alternate; 9411 if (null !== n2) { 9412 var t2 = n2.child; 9413 if (null !== t2) { 9414 n2.child = null; 9415 do { 9416 var J2 = t2.sibling; 9417 t2.sibling = null; 9418 t2 = J2; 9419 } while (null !== t2); 9420 } 9421 } 9422 V2 = f2; 9423 } 9424 } 9425 if (0 !== (f2.subtreeFlags & 2064) && null !== g2) g2.return = f2, V2 = g2; 9426 else b: for (; null !== V2; ) { 9427 f2 = V2; 9428 if (0 !== (f2.flags & 2048)) switch (f2.tag) { 9429 case 0: 9430 case 11: 9431 case 15: 9432 Pj(9, f2, f2.return); 9433 } 9434 var x2 = f2.sibling; 9435 if (null !== x2) { 9436 x2.return = f2.return; 9437 V2 = x2; 9438 break b; 9439 } 9440 V2 = f2.return; 9441 } 9442 } 9443 var w2 = a2.current; 9444 for (V2 = w2; null !== V2; ) { 9445 g2 = V2; 9446 var u2 = g2.child; 9447 if (0 !== (g2.subtreeFlags & 2064) && null !== u2) u2.return = g2, V2 = u2; 9448 else b: for (g2 = w2; null !== V2; ) { 9449 h2 = V2; 9450 if (0 !== (h2.flags & 2048)) try { 9451 switch (h2.tag) { 9452 case 0: 9453 case 11: 9454 case 15: 9455 Qj(9, h2); 9456 } 9457 } catch (na2) { 9458 W2(h2, h2.return, na2); 9459 } 9460 if (h2 === g2) { 9461 V2 = null; 9462 break b; 9463 } 9464 var F2 = h2.sibling; 9465 if (null !== F2) { 9466 F2.return = h2.return; 9467 V2 = F2; 9468 break b; 9469 } 9470 V2 = h2.return; 9471 } 9472 } 9473 K2 = e2; 9474 jg(); 9475 if (lc && "function" === typeof lc.onPostCommitFiberRoot) try { 9476 lc.onPostCommitFiberRoot(kc, a2); 9477 } catch (na2) { 9478 } 9479 d2 = true; 9480 } 9481 return d2; 9482 } finally { 9483 C2 = c2, ok.transition = b2; 9484 } 9485 } 9486 return false; 9487 } 9488 function Xk(a2, b2, c2) { 9489 b2 = Ji2(c2, b2); 9490 b2 = Ni2(a2, b2, 1); 9491 a2 = nh(a2, b2, 1); 9492 b2 = R2(); 9493 null !== a2 && (Ac(a2, 1, b2), Dk(a2, b2)); 9494 } 9495 function W2(a2, b2, c2) { 9496 if (3 === a2.tag) Xk(a2, a2, c2); 9497 else for (; null !== b2; ) { 9498 if (3 === b2.tag) { 9499 Xk(b2, a2, c2); 9500 break; 9501 } else if (1 === b2.tag) { 9502 var d2 = b2.stateNode; 9503 if ("function" === typeof b2.type.getDerivedStateFromError || "function" === typeof d2.componentDidCatch && (null === Ri2 || !Ri2.has(d2))) { 9504 a2 = Ji2(c2, a2); 9505 a2 = Qi2(b2, a2, 1); 9506 b2 = nh(b2, a2, 1); 9507 a2 = R2(); 9508 null !== b2 && (Ac(b2, 1, a2), Dk(b2, a2)); 9509 break; 9510 } 9511 } 9512 b2 = b2.return; 9513 } 9514 } 9515 function Ti2(a2, b2, c2) { 9516 var d2 = a2.pingCache; 9517 null !== d2 && d2.delete(b2); 9518 b2 = R2(); 9519 a2.pingedLanes |= a2.suspendedLanes & c2; 9520 Q2 === a2 && (Z2 & c2) === c2 && (4 === T2 || 3 === T2 && (Z2 & 130023424) === Z2 && 500 > B2() - fk ? Kk(a2, 0) : rk |= c2); 9521 Dk(a2, b2); 9522 } 9523 function Yk(a2, b2) { 9524 0 === b2 && (0 === (a2.mode & 1) ? b2 = 1 : (b2 = sc, sc <<= 1, 0 === (sc & 130023424) && (sc = 4194304))); 9525 var c2 = R2(); 9526 a2 = ih(a2, b2); 9527 null !== a2 && (Ac(a2, b2, c2), Dk(a2, c2)); 9528 } 9529 function uj(a2) { 9530 var b2 = a2.memoizedState, c2 = 0; 9531 null !== b2 && (c2 = b2.retryLane); 9532 Yk(a2, c2); 9533 } 9534 function bk(a2, b2) { 9535 var c2 = 0; 9536 switch (a2.tag) { 9537 case 13: 9538 var d2 = a2.stateNode; 9539 var e2 = a2.memoizedState; 9540 null !== e2 && (c2 = e2.retryLane); 9541 break; 9542 case 19: 9543 d2 = a2.stateNode; 9544 break; 9545 default: 9546 throw Error(p2(314)); 9547 } 9548 null !== d2 && d2.delete(b2); 9549 Yk(a2, c2); 9550 } 9551 var Vk; 9552 Vk = function(a2, b2, c2) { 9553 if (null !== a2) if (a2.memoizedProps !== b2.pendingProps || Wf.current) dh = true; 9554 else { 9555 if (0 === (a2.lanes & c2) && 0 === (b2.flags & 128)) return dh = false, yj(a2, b2, c2); 9556 dh = 0 !== (a2.flags & 131072) ? true : false; 9557 } 9558 else dh = false, I2 && 0 !== (b2.flags & 1048576) && ug(b2, ng, b2.index); 9559 b2.lanes = 0; 9560 switch (b2.tag) { 9561 case 2: 9562 var d2 = b2.type; 9563 ij(a2, b2); 9564 a2 = b2.pendingProps; 9565 var e2 = Yf(b2, H2.current); 9566 ch(b2, c2); 9567 e2 = Nh(null, b2, d2, a2, e2, c2); 9568 var f2 = Sh(); 9569 b2.flags |= 1; 9570 "object" === typeof e2 && null !== e2 && "function" === typeof e2.render && void 0 === e2.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, Zf(d2) ? (f2 = true, cg(b2)) : f2 = false, b2.memoizedState = null !== e2.state && void 0 !== e2.state ? e2.state : null, kh(b2), e2.updater = Ei2, b2.stateNode = e2, e2._reactInternals = b2, Ii2(b2, d2, a2, c2), b2 = jj(null, b2, d2, true, f2, c2)) : (b2.tag = 0, I2 && f2 && vg(b2), Xi2(null, b2, e2, c2), b2 = b2.child); 9571 return b2; 9572 case 16: 9573 d2 = b2.elementType; 9574 a: { 9575 ij(a2, b2); 9576 a2 = b2.pendingProps; 9577 e2 = d2._init; 9578 d2 = e2(d2._payload); 9579 b2.type = d2; 9580 e2 = b2.tag = Zk(d2); 9581 a2 = Ci2(d2, a2); 9582 switch (e2) { 9583 case 0: 9584 b2 = cj(null, b2, d2, a2, c2); 9585 break a; 9586 case 1: 9587 b2 = hj(null, b2, d2, a2, c2); 9588 break a; 9589 case 11: 9590 b2 = Yi2(null, b2, d2, a2, c2); 9591 break a; 9592 case 14: 9593 b2 = $i2(null, b2, d2, Ci2(d2.type, a2), c2); 9594 break a; 9595 } 9596 throw Error(p2( 9597 306, 9598 d2, 9599 "" 9600 )); 9601 } 9602 return b2; 9603 case 0: 9604 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), cj(a2, b2, d2, e2, c2); 9605 case 1: 9606 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), hj(a2, b2, d2, e2, c2); 9607 case 3: 9608 a: { 9609 kj(b2); 9610 if (null === a2) throw Error(p2(387)); 9611 d2 = b2.pendingProps; 9612 f2 = b2.memoizedState; 9613 e2 = f2.element; 9614 lh(a2, b2); 9615 qh(b2, d2, null, c2); 9616 var g2 = b2.memoizedState; 9617 d2 = g2.element; 9618 if (f2.isDehydrated) if (f2 = { element: d2, isDehydrated: false, cache: g2.cache, pendingSuspenseBoundaries: g2.pendingSuspenseBoundaries, transitions: g2.transitions }, b2.updateQueue.baseState = f2, b2.memoizedState = f2, b2.flags & 256) { 9619 e2 = Ji2(Error(p2(423)), b2); 9620 b2 = lj(a2, b2, d2, c2, e2); 9621 break a; 9622 } else if (d2 !== e2) { 9623 e2 = Ji2(Error(p2(424)), b2); 9624 b2 = lj(a2, b2, d2, c2, e2); 9625 break a; 9626 } else for (yg = Lf(b2.stateNode.containerInfo.firstChild), xg = b2, I2 = true, zg = null, c2 = Vg(b2, null, d2, c2), b2.child = c2; c2; ) c2.flags = c2.flags & -3 | 4096, c2 = c2.sibling; 9627 else { 9628 Ig(); 9629 if (d2 === e2) { 9630 b2 = Zi2(a2, b2, c2); 9631 break a; 9632 } 9633 Xi2(a2, b2, d2, c2); 9634 } 9635 b2 = b2.child; 9636 } 9637 return b2; 9638 case 5: 9639 return Ah(b2), null === a2 && Eg(b2), d2 = b2.type, e2 = b2.pendingProps, f2 = null !== a2 ? a2.memoizedProps : null, g2 = e2.children, Ef(d2, e2) ? g2 = null : null !== f2 && Ef(d2, f2) && (b2.flags |= 32), gj(a2, b2), Xi2(a2, b2, g2, c2), b2.child; 9640 case 6: 9641 return null === a2 && Eg(b2), null; 9642 case 13: 9643 return oj(a2, b2, c2); 9644 case 4: 9645 return yh(b2, b2.stateNode.containerInfo), d2 = b2.pendingProps, null === a2 ? b2.child = Ug(b2, null, d2, c2) : Xi2(a2, b2, d2, c2), b2.child; 9646 case 11: 9647 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), Yi2(a2, b2, d2, e2, c2); 9648 case 7: 9649 return Xi2(a2, b2, b2.pendingProps, c2), b2.child; 9650 case 8: 9651 return Xi2(a2, b2, b2.pendingProps.children, c2), b2.child; 9652 case 12: 9653 return Xi2(a2, b2, b2.pendingProps.children, c2), b2.child; 9654 case 10: 9655 a: { 9656 d2 = b2.type._context; 9657 e2 = b2.pendingProps; 9658 f2 = b2.memoizedProps; 9659 g2 = e2.value; 9660 G2(Wg, d2._currentValue); 9661 d2._currentValue = g2; 9662 if (null !== f2) if (He2(f2.value, g2)) { 9663 if (f2.children === e2.children && !Wf.current) { 9664 b2 = Zi2(a2, b2, c2); 9665 break a; 9666 } 9667 } else for (f2 = b2.child, null !== f2 && (f2.return = b2); null !== f2; ) { 9668 var h2 = f2.dependencies; 9669 if (null !== h2) { 9670 g2 = f2.child; 9671 for (var k2 = h2.firstContext; null !== k2; ) { 9672 if (k2.context === d2) { 9673 if (1 === f2.tag) { 9674 k2 = mh(-1, c2 & -c2); 9675 k2.tag = 2; 9676 var l2 = f2.updateQueue; 9677 if (null !== l2) { 9678 l2 = l2.shared; 9679 var m2 = l2.pending; 9680 null === m2 ? k2.next = k2 : (k2.next = m2.next, m2.next = k2); 9681 l2.pending = k2; 9682 } 9683 } 9684 f2.lanes |= c2; 9685 k2 = f2.alternate; 9686 null !== k2 && (k2.lanes |= c2); 9687 bh( 9688 f2.return, 9689 c2, 9690 b2 9691 ); 9692 h2.lanes |= c2; 9693 break; 9694 } 9695 k2 = k2.next; 9696 } 9697 } else if (10 === f2.tag) g2 = f2.type === b2.type ? null : f2.child; 9698 else if (18 === f2.tag) { 9699 g2 = f2.return; 9700 if (null === g2) throw Error(p2(341)); 9701 g2.lanes |= c2; 9702 h2 = g2.alternate; 9703 null !== h2 && (h2.lanes |= c2); 9704 bh(g2, c2, b2); 9705 g2 = f2.sibling; 9706 } else g2 = f2.child; 9707 if (null !== g2) g2.return = f2; 9708 else for (g2 = f2; null !== g2; ) { 9709 if (g2 === b2) { 9710 g2 = null; 9711 break; 9712 } 9713 f2 = g2.sibling; 9714 if (null !== f2) { 9715 f2.return = g2.return; 9716 g2 = f2; 9717 break; 9718 } 9719 g2 = g2.return; 9720 } 9721 f2 = g2; 9722 } 9723 Xi2(a2, b2, e2.children, c2); 9724 b2 = b2.child; 9725 } 9726 return b2; 9727 case 9: 9728 return e2 = b2.type, d2 = b2.pendingProps.children, ch(b2, c2), e2 = eh(e2), d2 = d2(e2), b2.flags |= 1, Xi2(a2, b2, d2, c2), b2.child; 9729 case 14: 9730 return d2 = b2.type, e2 = Ci2(d2, b2.pendingProps), e2 = Ci2(d2.type, e2), $i2(a2, b2, d2, e2, c2); 9731 case 15: 9732 return bj(a2, b2, b2.type, b2.pendingProps, c2); 9733 case 17: 9734 return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci2(d2, e2), ij(a2, b2), b2.tag = 1, Zf(d2) ? (a2 = true, cg(b2)) : a2 = false, ch(b2, c2), Gi2(b2, d2, e2), Ii2(b2, d2, e2, c2), jj(null, b2, d2, true, a2, c2); 9735 case 19: 9736 return xj(a2, b2, c2); 9737 case 22: 9738 return dj(a2, b2, c2); 9739 } 9740 throw Error(p2(156, b2.tag)); 9741 }; 9742 function Fk(a2, b2) { 9743 return ac(a2, b2); 9744 } 9745 function $k(a2, b2, c2, d2) { 9746 this.tag = a2; 9747 this.key = c2; 9748 this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null; 9749 this.index = 0; 9750 this.ref = null; 9751 this.pendingProps = b2; 9752 this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null; 9753 this.mode = d2; 9754 this.subtreeFlags = this.flags = 0; 9755 this.deletions = null; 9756 this.childLanes = this.lanes = 0; 9757 this.alternate = null; 9758 } 9759 function Bg(a2, b2, c2, d2) { 9760 return new $k(a2, b2, c2, d2); 9761 } 9762 function aj(a2) { 9763 a2 = a2.prototype; 9764 return !(!a2 || !a2.isReactComponent); 9765 } 9766 function Zk(a2) { 9767 if ("function" === typeof a2) return aj(a2) ? 1 : 0; 9768 if (void 0 !== a2 && null !== a2) { 9769 a2 = a2.$$typeof; 9770 if (a2 === Da2) return 11; 9771 if (a2 === Ga2) return 14; 9772 } 9773 return 2; 9774 } 9775 function Pg(a2, b2) { 9776 var c2 = a2.alternate; 9777 null === c2 ? (c2 = Bg(a2.tag, b2, a2.key, a2.mode), c2.elementType = a2.elementType, c2.type = a2.type, c2.stateNode = a2.stateNode, c2.alternate = a2, a2.alternate = c2) : (c2.pendingProps = b2, c2.type = a2.type, c2.flags = 0, c2.subtreeFlags = 0, c2.deletions = null); 9778 c2.flags = a2.flags & 14680064; 9779 c2.childLanes = a2.childLanes; 9780 c2.lanes = a2.lanes; 9781 c2.child = a2.child; 9782 c2.memoizedProps = a2.memoizedProps; 9783 c2.memoizedState = a2.memoizedState; 9784 c2.updateQueue = a2.updateQueue; 9785 b2 = a2.dependencies; 9786 c2.dependencies = null === b2 ? null : { lanes: b2.lanes, firstContext: b2.firstContext }; 9787 c2.sibling = a2.sibling; 9788 c2.index = a2.index; 9789 c2.ref = a2.ref; 9790 return c2; 9791 } 9792 function Rg(a2, b2, c2, d2, e2, f2) { 9793 var g2 = 2; 9794 d2 = a2; 9795 if ("function" === typeof a2) aj(a2) && (g2 = 1); 9796 else if ("string" === typeof a2) g2 = 5; 9797 else a: switch (a2) { 9798 case ya2: 9799 return Tg(c2.children, e2, f2, b2); 9800 case za2: 9801 g2 = 8; 9802 e2 |= 8; 9803 break; 9804 case Aa2: 9805 return a2 = Bg(12, c2, b2, e2 | 2), a2.elementType = Aa2, a2.lanes = f2, a2; 9806 case Ea2: 9807 return a2 = Bg(13, c2, b2, e2), a2.elementType = Ea2, a2.lanes = f2, a2; 9808 case Fa2: 9809 return a2 = Bg(19, c2, b2, e2), a2.elementType = Fa2, a2.lanes = f2, a2; 9810 case Ia2: 9811 return pj(c2, e2, f2, b2); 9812 default: 9813 if ("object" === typeof a2 && null !== a2) switch (a2.$$typeof) { 9814 case Ba2: 9815 g2 = 10; 9816 break a; 9817 case Ca2: 9818 g2 = 9; 9819 break a; 9820 case Da2: 9821 g2 = 11; 9822 break a; 9823 case Ga2: 9824 g2 = 14; 9825 break a; 9826 case Ha2: 9827 g2 = 16; 9828 d2 = null; 9829 break a; 9830 } 9831 throw Error(p2(130, null == a2 ? a2 : typeof a2, "")); 9832 } 9833 b2 = Bg(g2, c2, b2, e2); 9834 b2.elementType = a2; 9835 b2.type = d2; 9836 b2.lanes = f2; 9837 return b2; 9838 } 9839 function Tg(a2, b2, c2, d2) { 9840 a2 = Bg(7, a2, d2, b2); 9841 a2.lanes = c2; 9842 return a2; 9843 } 9844 function pj(a2, b2, c2, d2) { 9845 a2 = Bg(22, a2, d2, b2); 9846 a2.elementType = Ia2; 9847 a2.lanes = c2; 9848 a2.stateNode = { isHidden: false }; 9849 return a2; 9850 } 9851 function Qg(a2, b2, c2) { 9852 a2 = Bg(6, a2, null, b2); 9853 a2.lanes = c2; 9854 return a2; 9855 } 9856 function Sg(a2, b2, c2) { 9857 b2 = Bg(4, null !== a2.children ? a2.children : [], a2.key, b2); 9858 b2.lanes = c2; 9859 b2.stateNode = { containerInfo: a2.containerInfo, pendingChildren: null, implementation: a2.implementation }; 9860 return b2; 9861 } 9862 function al(a2, b2, c2, d2, e2) { 9863 this.tag = b2; 9864 this.containerInfo = a2; 9865 this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; 9866 this.timeoutHandle = -1; 9867 this.callbackNode = this.pendingContext = this.context = null; 9868 this.callbackPriority = 0; 9869 this.eventTimes = zc(0); 9870 this.expirationTimes = zc(-1); 9871 this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; 9872 this.entanglements = zc(0); 9873 this.identifierPrefix = d2; 9874 this.onRecoverableError = e2; 9875 this.mutableSourceEagerHydrationData = null; 9876 } 9877 function bl(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 9878 a2 = new al(a2, b2, c2, h2, k2); 9879 1 === b2 ? (b2 = 1, true === f2 && (b2 |= 8)) : b2 = 0; 9880 f2 = Bg(3, null, null, b2); 9881 a2.current = f2; 9882 f2.stateNode = a2; 9883 f2.memoizedState = { element: d2, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null }; 9884 kh(f2); 9885 return a2; 9886 } 9887 function cl(a2, b2, c2) { 9888 var d2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; 9889 return { $$typeof: wa2, key: null == d2 ? null : "" + d2, children: a2, containerInfo: b2, implementation: c2 }; 9890 } 9891 function dl(a2) { 9892 if (!a2) return Vf; 9893 a2 = a2._reactInternals; 9894 a: { 9895 if (Vb(a2) !== a2 || 1 !== a2.tag) throw Error(p2(170)); 9896 var b2 = a2; 9897 do { 9898 switch (b2.tag) { 9899 case 3: 9900 b2 = b2.stateNode.context; 9901 break a; 9902 case 1: 9903 if (Zf(b2.type)) { 9904 b2 = b2.stateNode.__reactInternalMemoizedMergedChildContext; 9905 break a; 9906 } 9907 } 9908 b2 = b2.return; 9909 } while (null !== b2); 9910 throw Error(p2(171)); 9911 } 9912 if (1 === a2.tag) { 9913 var c2 = a2.type; 9914 if (Zf(c2)) return bg(a2, c2, b2); 9915 } 9916 return b2; 9917 } 9918 function el(a2, b2, c2, d2, e2, f2, g2, h2, k2) { 9919 a2 = bl(c2, d2, true, a2, e2, f2, g2, h2, k2); 9920 a2.context = dl(null); 9921 c2 = a2.current; 9922 d2 = R2(); 9923 e2 = yi2(c2); 9924 f2 = mh(d2, e2); 9925 f2.callback = void 0 !== b2 && null !== b2 ? b2 : null; 9926 nh(c2, f2, e2); 9927 a2.current.lanes = e2; 9928 Ac(a2, e2, d2); 9929 Dk(a2, d2); 9930 return a2; 9931 } 9932 function fl(a2, b2, c2, d2) { 9933 var e2 = b2.current, f2 = R2(), g2 = yi2(e2); 9934 c2 = dl(c2); 9935 null === b2.context ? b2.context = c2 : b2.pendingContext = c2; 9936 b2 = mh(f2, g2); 9937 b2.payload = { element: a2 }; 9938 d2 = void 0 === d2 ? null : d2; 9939 null !== d2 && (b2.callback = d2); 9940 a2 = nh(e2, b2, g2); 9941 null !== a2 && (gi2(a2, e2, g2, f2), oh(a2, e2, g2)); 9942 return g2; 9943 } 9944 function gl(a2) { 9945 a2 = a2.current; 9946 if (!a2.child) return null; 9947 switch (a2.child.tag) { 9948 case 5: 9949 return a2.child.stateNode; 9950 default: 9951 return a2.child.stateNode; 9952 } 9953 } 9954 function hl(a2, b2) { 9955 a2 = a2.memoizedState; 9956 if (null !== a2 && null !== a2.dehydrated) { 9957 var c2 = a2.retryLane; 9958 a2.retryLane = 0 !== c2 && c2 < b2 ? c2 : b2; 9959 } 9960 } 9961 function il(a2, b2) { 9962 hl(a2, b2); 9963 (a2 = a2.alternate) && hl(a2, b2); 9964 } 9965 function jl() { 9966 return null; 9967 } 9968 var kl = "function" === typeof reportError ? reportError : function(a2) { 9969 console.error(a2); 9970 }; 9971 function ll(a2) { 9972 this._internalRoot = a2; 9973 } 9974 ml.prototype.render = ll.prototype.render = function(a2) { 9975 var b2 = this._internalRoot; 9976 if (null === b2) throw Error(p2(409)); 9977 fl(a2, b2, null, null); 9978 }; 9979 ml.prototype.unmount = ll.prototype.unmount = function() { 9980 var a2 = this._internalRoot; 9981 if (null !== a2) { 9982 this._internalRoot = null; 9983 var b2 = a2.containerInfo; 9984 Rk(function() { 9985 fl(null, a2, null, null); 9986 }); 9987 b2[uf] = null; 9988 } 9989 }; 9990 function ml(a2) { 9991 this._internalRoot = a2; 9992 } 9993 ml.prototype.unstable_scheduleHydration = function(a2) { 9994 if (a2) { 9995 var b2 = Hc(); 9996 a2 = { blockedOn: null, target: a2, priority: b2 }; 9997 for (var c2 = 0; c2 < Qc.length && 0 !== b2 && b2 < Qc[c2].priority; c2++) ; 9998 Qc.splice(c2, 0, a2); 9999 0 === c2 && Vc(a2); 10000 } 10001 }; 10002 function nl(a2) { 10003 return !(!a2 || 1 !== a2.nodeType && 9 !== a2.nodeType && 11 !== a2.nodeType); 10004 } 10005 function ol(a2) { 10006 return !(!a2 || 1 !== a2.nodeType && 9 !== a2.nodeType && 11 !== a2.nodeType && (8 !== a2.nodeType || " react-mount-point-unstable " !== a2.nodeValue)); 10007 } 10008 function pl() { 10009 } 10010 function ql(a2, b2, c2, d2, e2) { 10011 if (e2) { 10012 if ("function" === typeof d2) { 10013 var f2 = d2; 10014 d2 = function() { 10015 var a3 = gl(g2); 10016 f2.call(a3); 10017 }; 10018 } 10019 var g2 = el(b2, d2, a2, 0, null, false, false, "", pl); 10020 a2._reactRootContainer = g2; 10021 a2[uf] = g2.current; 10022 sf(8 === a2.nodeType ? a2.parentNode : a2); 10023 Rk(); 10024 return g2; 10025 } 10026 for (; e2 = a2.lastChild; ) a2.removeChild(e2); 10027 if ("function" === typeof d2) { 10028 var h2 = d2; 10029 d2 = function() { 10030 var a3 = gl(k2); 10031 h2.call(a3); 10032 }; 10033 } 10034 var k2 = bl(a2, 0, false, null, null, false, false, "", pl); 10035 a2._reactRootContainer = k2; 10036 a2[uf] = k2.current; 10037 sf(8 === a2.nodeType ? a2.parentNode : a2); 10038 Rk(function() { 10039 fl(b2, k2, c2, d2); 10040 }); 10041 return k2; 10042 } 10043 function rl(a2, b2, c2, d2, e2) { 10044 var f2 = c2._reactRootContainer; 10045 if (f2) { 10046 var g2 = f2; 10047 if ("function" === typeof e2) { 10048 var h2 = e2; 10049 e2 = function() { 10050 var a3 = gl(g2); 10051 h2.call(a3); 10052 }; 10053 } 10054 fl(b2, g2, a2, e2); 10055 } else g2 = ql(c2, b2, a2, e2, d2); 10056 return gl(g2); 10057 } 10058 Ec = function(a2) { 10059 switch (a2.tag) { 10060 case 3: 10061 var b2 = a2.stateNode; 10062 if (b2.current.memoizedState.isDehydrated) { 10063 var c2 = tc(b2.pendingLanes); 10064 0 !== c2 && (Cc(b2, c2 | 1), Dk(b2, B2()), 0 === (K2 & 6) && (Gj = B2() + 500, jg())); 10065 } 10066 break; 10067 case 13: 10068 Rk(function() { 10069 var b3 = ih(a2, 1); 10070 if (null !== b3) { 10071 var c3 = R2(); 10072 gi2(b3, a2, 1, c3); 10073 } 10074 }), il(a2, 1); 10075 } 10076 }; 10077 Fc = function(a2) { 10078 if (13 === a2.tag) { 10079 var b2 = ih(a2, 134217728); 10080 if (null !== b2) { 10081 var c2 = R2(); 10082 gi2(b2, a2, 134217728, c2); 10083 } 10084 il(a2, 134217728); 10085 } 10086 }; 10087 Gc = function(a2) { 10088 if (13 === a2.tag) { 10089 var b2 = yi2(a2), c2 = ih(a2, b2); 10090 if (null !== c2) { 10091 var d2 = R2(); 10092 gi2(c2, a2, b2, d2); 10093 } 10094 il(a2, b2); 10095 } 10096 }; 10097 Hc = function() { 10098 return C2; 10099 }; 10100 Ic = function(a2, b2) { 10101 var c2 = C2; 10102 try { 10103 return C2 = a2, b2(); 10104 } finally { 10105 C2 = c2; 10106 } 10107 }; 10108 yb = function(a2, b2, c2) { 10109 switch (b2) { 10110 case "input": 10111 bb(a2, c2); 10112 b2 = c2.name; 10113 if ("radio" === c2.type && null != b2) { 10114 for (c2 = a2; c2.parentNode; ) c2 = c2.parentNode; 10115 c2 = c2.querySelectorAll("input[name=" + JSON.stringify("" + b2) + '][type="radio"]'); 10116 for (b2 = 0; b2 < c2.length; b2++) { 10117 var d2 = c2[b2]; 10118 if (d2 !== a2 && d2.form === a2.form) { 10119 var e2 = Db(d2); 10120 if (!e2) throw Error(p2(90)); 10121 Wa2(d2); 10122 bb(d2, e2); 10123 } 10124 } 10125 } 10126 break; 10127 case "textarea": 10128 ib(a2, c2); 10129 break; 10130 case "select": 10131 b2 = c2.value, null != b2 && fb(a2, !!c2.multiple, b2, false); 10132 } 10133 }; 10134 Gb = Qk; 10135 Hb = Rk; 10136 var sl = { usingClientEntryPoint: false, Events: [Cb, ue2, Db, Eb, Fb, Qk] }, tl = { findFiberByHostInstance: Wc, bundleType: 0, version: "18.3.1", rendererPackageName: "react-dom" }; 10137 var ul = { bundleType: tl.bundleType, version: tl.version, rendererPackageName: tl.rendererPackageName, rendererConfig: tl.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: ua2.ReactCurrentDispatcher, findHostInstanceByFiber: function(a2) { 10138 a2 = Zb(a2); 10139 return null === a2 ? null : a2.stateNode; 10140 }, findFiberByHostInstance: tl.findFiberByHostInstance || jl, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1-next-f1338f8080-20240426" }; 10141 if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { 10142 var vl = __REACT_DEVTOOLS_GLOBAL_HOOK__; 10143 if (!vl.isDisabled && vl.supportsFiber) try { 10144 kc = vl.inject(ul), lc = vl; 10145 } catch (a2) { 10146 } 10147 } 10148 reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sl; 10149 reactDom_production_min.createPortal = function(a2, b2) { 10150 var c2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; 10151 if (!nl(b2)) throw Error(p2(200)); 10152 return cl(a2, b2, null, c2); 10153 }; 10154 reactDom_production_min.createRoot = function(a2, b2) { 10155 if (!nl(a2)) throw Error(p2(299)); 10156 var c2 = false, d2 = "", e2 = kl; 10157 null !== b2 && void 0 !== b2 && (true === b2.unstable_strictMode && (c2 = true), void 0 !== b2.identifierPrefix && (d2 = b2.identifierPrefix), void 0 !== b2.onRecoverableError && (e2 = b2.onRecoverableError)); 10158 b2 = bl(a2, 1, false, null, null, c2, false, d2, e2); 10159 a2[uf] = b2.current; 10160 sf(8 === a2.nodeType ? a2.parentNode : a2); 10161 return new ll(b2); 10162 }; 10163 reactDom_production_min.findDOMNode = function(a2) { 10164 if (null == a2) return null; 10165 if (1 === a2.nodeType) return a2; 10166 var b2 = a2._reactInternals; 10167 if (void 0 === b2) { 10168 if ("function" === typeof a2.render) throw Error(p2(188)); 10169 a2 = Object.keys(a2).join(","); 10170 throw Error(p2(268, a2)); 10171 } 10172 a2 = Zb(b2); 10173 a2 = null === a2 ? null : a2.stateNode; 10174 return a2; 10175 }; 10176 reactDom_production_min.flushSync = function(a2) { 10177 return Rk(a2); 10178 }; 10179 reactDom_production_min.hydrate = function(a2, b2, c2) { 10180 if (!ol(b2)) throw Error(p2(200)); 10181 return rl(null, a2, b2, true, c2); 10182 }; 10183 reactDom_production_min.hydrateRoot = function(a2, b2, c2) { 10184 if (!nl(a2)) throw Error(p2(405)); 10185 var d2 = null != c2 && c2.hydratedSources || null, e2 = false, f2 = "", g2 = kl; 10186 null !== c2 && void 0 !== c2 && (true === c2.unstable_strictMode && (e2 = true), void 0 !== c2.identifierPrefix && (f2 = c2.identifierPrefix), void 0 !== c2.onRecoverableError && (g2 = c2.onRecoverableError)); 10187 b2 = el(b2, null, a2, 1, null != c2 ? c2 : null, e2, false, f2, g2); 10188 a2[uf] = b2.current; 10189 sf(a2); 10190 if (d2) for (a2 = 0; a2 < d2.length; a2++) c2 = d2[a2], e2 = c2._getVersion, e2 = e2(c2._source), null == b2.mutableSourceEagerHydrationData ? b2.mutableSourceEagerHydrationData = [c2, e2] : b2.mutableSourceEagerHydrationData.push( 10191 c2, 10192 e2 10193 ); 10194 return new ml(b2); 10195 }; 10196 reactDom_production_min.render = function(a2, b2, c2) { 10197 if (!ol(b2)) throw Error(p2(200)); 10198 return rl(null, a2, b2, false, c2); 10199 }; 10200 reactDom_production_min.unmountComponentAtNode = function(a2) { 10201 if (!ol(a2)) throw Error(p2(40)); 10202 return a2._reactRootContainer ? (Rk(function() { 10203 rl(null, null, a2, false, function() { 10204 a2._reactRootContainer = null; 10205 a2[uf] = null; 10206 }); 10207 }), true) : false;
10208 }; 10209 reactDom_production_min.unstable_batchedUpdates = Qk; 10210 reactDom_production_min.unstable_renderSubtreeIntoContainer = function(a2, b2, c2, d2) { 10211 if (!ol(c2)) throw Error(p2(200)); 10212 if (null == a2 || void 0 === a2._reactInternals) throw Error(p2(38)); 10213 return rl(a2, b2, c2, false, d2); 10214 }; 10215 reactDom_production_min.version = "18.3.1-next-f1338f8080-20240426"; 10216 return reactDom_production_min; 10217 } 10218 var hasRequiredReactDom; 10219 function requireReactDom() { 10220 if (hasRequiredReactDom) return reactDom.exports; 10221 hasRequiredReactDom = 1; 10222 function checkDCE() { 10223 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") { 10224 return; 10225 } 10226 try { 10227 __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); 10228 } catch (err) { 10229 console.error(err); 10230 } 10231 } 10232 { 10233 checkDCE(); 10234 reactDom.exports = requireReactDom_production_min(); 10235 } 10236 return reactDom.exports; 10237 } 10238 var hasRequiredClient; 10239 function requireClient() { 10240 if (hasRequiredClient) return client; 10241 hasRequiredClient = 1; 10242 var m2 = requireReactDom(); 10243 { 10244 client.createRoot = m2.createRoot; 10245 client.hydrateRoot = m2.hydrateRoot; 10246 } 10247 return client; 10248 } 10249 var clientExports = requireClient(); 10250 var reactDomExports = requireReactDom(); 10251 /** 10252 * @remix-run/router v1.22.0 10253 * 10254 * Copyright (c) Remix Software Inc. 10255 * 10256 * This source code is licensed under the MIT license found in the 10257 * LICENSE.md file in the root directory of this source tree. 10258 * 10259 * @license MIT 10260 */ 10261 function _extends$9() { 10262 _extends$9 = Object.assign ? Object.assign.bind() : function(target) { 10263 for (var i2 = 1; i2 < arguments.length; i2++) { 10264 var source = arguments[i2]; 10265 for (var key in source) { 10266 if (Object.prototype.hasOwnProperty.call(source, key)) { 10267 target[key] = source[key]; 10268 } 10269 } 10270 } 10271 return target; 10272 }; 10273 return _extends$9.apply(this, arguments); 10274 } 10275 var Action; 10276 (function(Action2) { 10277 Action2["Pop"] = "POP"; 10278 Action2["Push"] = "PUSH"; 10279 Action2["Replace"] = "REPLACE"; 10280 })(Action || (Action = {})); 10281 const PopStateEventType = "popstate"; 10282 function createBrowserHistory(options2) { 10283 if (options2 === void 0) { 10284 options2 = {}; 10285 } 10286 function createBrowserLocation(window2, globalHistory) { 10287 let { 10288 pathname, 10289 search, 10290 hash: hash2 10291 } = window2.location; 10292 return createLocation( 10293 "", 10294 { 10295 pathname, 10296 search, 10297 hash: hash2 10298 }, 10299 // state defaults to `null` because `window.history.state` does 10300 globalHistory.state && globalHistory.state.usr || null, 10301 globalHistory.state && globalHistory.state.key || "default" 10302 ); 10303 } 10304 function createBrowserHref(window2, to2) { 10305 return typeof to2 === "string" ? to2 : createPath(to2); 10306 } 10307 return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options2); 10308 } 10309 function invariant$1(value, message) { 10310 if (value === false || value === null || typeof value === "undefined") { 10311 throw new Error(message); 10312 } 10313 } 10314 function warning(cond, message) { 10315 if (!cond) { 10316 if (typeof console !== "undefined") console.warn(message); 10317 try { 10318 throw new Error(message); 10319 } catch (e2) { 10320 } 10321 } 10322 } 10323 function createKey() { 10324 return Math.random().toString(36).substr(2, 8); 10325 } 10326 function getHistoryState(location, index2) { 10327 return { 10328 usr: location.state, 10329 key: location.key, 10330 idx: index2 10331 }; 10332 } 10333 function createLocation(current, to2, state, key) { 10334 if (state === void 0) { 10335 state = null; 10336 } 10337 let location = _extends$9({ 10338 pathname: typeof current === "string" ? current : current.pathname, 10339 search: "", 10340 hash: "" 10341 }, typeof to2 === "string" ? parsePath(to2) : to2, { 10342 state, 10343 // TODO: This could be cleaned up. push/replace should probably just take 10344 // full Locations now and avoid the need to run through this flow at all 10345 // But that's a pretty big refactor to the current test suite so going to 10346 // keep as is for the time being and just let any incoming keys take precedence 10347 key: to2 && to2.key || key || createKey() 10348 }); 10349 return location; 10350 } 10351 function createPath(_ref2) { 10352 let { 10353 pathname = "/", 10354 search = "", 10355 hash: hash2 = "" 10356 } = _ref2; 10357 if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; 10358 if (hash2 && hash2 !== "#") pathname += hash2.charAt(0) === "#" ? hash2 : "#" + hash2; 10359 return pathname; 10360 } 10361 function parsePath(path) { 10362 let parsedPath = {}; 10363 if (path) { 10364 let hashIndex = path.indexOf("#"); 10365 if (hashIndex >= 0) { 10366 parsedPath.hash = path.substr(hashIndex); 10367 path = path.substr(0, hashIndex); 10368 } 10369 let searchIndex = path.indexOf("?"); 10370 if (searchIndex >= 0) { 10371 parsedPath.search = path.substr(searchIndex); 10372 path = path.substr(0, searchIndex); 10373 } 10374 if (path) { 10375 parsedPath.pathname = path; 10376 } 10377 } 10378 return parsedPath; 10379 } 10380 function getUrlBasedHistory(getLocation, createHref, validateLocation, options2) { 10381 if (options2 === void 0) { 10382 options2 = {}; 10383 } 10384 let { 10385 window: window2 = document.defaultView, 10386 v5Compat = false 10387 } = options2; 10388 let globalHistory = window2.history; 10389 let action = Action.Pop; 10390 let listener = null; 10391 let index2 = getIndex(); 10392 if (index2 == null) { 10393 index2 = 0; 10394 globalHistory.replaceState(_extends$9({}, globalHistory.state, { 10395 idx: index2 10396 }), ""); 10397 } 10398 function getIndex() { 10399 let state = globalHistory.state || { 10400 idx: null 10401 }; 10402 return state.idx; 10403 } 10404 function handlePop() { 10405 action = Action.Pop; 10406 let nextIndex = getIndex(); 10407 let delta = nextIndex == null ? null : nextIndex - index2; 10408 index2 = nextIndex; 10409 if (listener) { 10410 listener({ 10411 action, 10412 location: history.location, 10413 delta 10414 }); 10415 } 10416 } 10417 function push(to2, state) { 10418 action = Action.Push; 10419 let location = createLocation(history.location, to2, state); 10420 index2 = getIndex() + 1; 10421 let historyState = getHistoryState(location, index2); 10422 let url = history.createHref(location); 10423 try { 10424 globalHistory.pushState(historyState, "", url); 10425 } catch (error) {
vendor: 5,773 bytes, lines 10426-10588
10426 if (error instanceof DOMException && error.name === "DataCloneError") { 10427 throw error; 10428 } 10429 window2.location.assign(url); 10430 } 10431 if (v5Compat && listener) { 10432 listener({ 10433 action, 10434 location: history.location, 10435 delta: 1 10436 }); 10437 } 10438 } 10439 function replace2(to2, state) { 10440 action = Action.Replace; 10441 let location = createLocation(history.location, to2, state); 10442 index2 = getIndex(); 10443 let historyState = getHistoryState(location, index2); 10444 let url = history.createHref(location); 10445 globalHistory.replaceState(historyState, "", url); 10446 if (v5Compat && listener) { 10447 listener({ 10448 action, 10449 location: history.location, 10450 delta: 0 10451 }); 10452 } 10453 } 10454 function createURL(to2) { 10455 let base = window2.location.origin !== "null" ? window2.location.origin : window2.location.href; 10456 let href = typeof to2 === "string" ? to2 : createPath(to2); 10457 href = href.replace(/ $/, "%20"); 10458 invariant$1(base, "No window.location.(origin|href) available to create URL for href: " + href); 10459 return new URL(href, base); 10460 } 10461 let history = { 10462 get action() { 10463 return action; 10464 }, 10465 get location() { 10466 return getLocation(window2, globalHistory); 10467 }, 10468 listen(fn2) { 10469 if (listener) { 10470 throw new Error("A history only accepts one active listener"); 10471 } 10472 window2.addEventListener(PopStateEventType, handlePop); 10473 listener = fn2; 10474 return () => { 10475 window2.removeEventListener(PopStateEventType, handlePop); 10476 listener = null; 10477 }; 10478 }, 10479 createHref(to2) { 10480 return createHref(window2, to2); 10481 }, 10482 createURL, 10483 encodeLocation(to2) { 10484 let url = createURL(to2); 10485 return { 10486 pathname: url.pathname, 10487 search: url.search, 10488 hash: url.hash 10489 }; 10490 }, 10491 push, 10492 replace: replace2, 10493 go(n2) { 10494 return globalHistory.go(n2); 10495 } 10496 }; 10497 return history; 10498 } 10499 var ResultType; 10500 (function(ResultType2) { 10501 ResultType2["data"] = "data"; 10502 ResultType2["deferred"] = "deferred"; 10503 ResultType2["redirect"] = "redirect"; 10504 ResultType2["error"] = "error"; 10505 })(ResultType || (ResultType = {})); 10506 function matchRoutes(routes2, locationArg, basename) { 10507 if (basename === void 0) { 10508 basename = "/"; 10509 } 10510 return matchRoutesImpl(routes2, locationArg, basename); 10511 } 10512 function matchRoutesImpl(routes2, locationArg, basename, allowPartial) { 10513 let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; 10514 let pathname = stripBasename(location.pathname || "/", basename); 10515 if (pathname == null) { 10516 return null; 10517 } 10518 let branches = flattenRoutes(routes2); 10519 rankRouteBranches(branches); 10520 let matches2 = null; 10521 for (let i2 = 0; matches2 == null && i2 < branches.length; ++i2) { 10522 let decoded = decodePath(pathname); 10523 matches2 = matchRouteBranch(branches[i2], decoded); 10524 } 10525 return matches2; 10526 } 10527 function flattenRoutes(routes2, branches, parentsMeta, parentPath) { 10528 if (branches === void 0) { 10529 branches = []; 10530 } 10531 if (parentsMeta === void 0) { 10532 parentsMeta = []; 10533 } 10534 if (parentPath === void 0) { 10535 parentPath = ""; 10536 } 10537 let flattenRoute = (route, index2, relativePath) => { 10538 let meta = { 10539 relativePath: relativePath === void 0 ? route.path || "" : relativePath, 10540 caseSensitive: route.caseSensitive === true, 10541 childrenIndex: index2, 10542 route 10543 }; 10544 if (meta.relativePath.startsWith("/")) { 10545 invariant$1(meta.relativePath.startsWith(parentPath), 'Absolute route path "' + meta.relativePath + '" nested under path ' + ('"' + parentPath + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes."); 10546 meta.relativePath = meta.relativePath.slice(parentPath.length); 10547 } 10548 let path = joinPaths([parentPath, meta.relativePath]); 10549 let routesMeta = parentsMeta.concat(meta); 10550 if (route.children && route.children.length > 0) { 10551 invariant$1( 10552 // Our types know better, but runtime JS may not! 10553 // @ts-expect-error 10554 route.index !== true, 10555 "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + path + '".') 10556 ); 10557 flattenRoutes(route.children, branches, routesMeta, path); 10558 } 10559 if (route.path == null && !route.index) { 10560 return; 10561 } 10562 branches.push({ 10563 path, 10564 score: computeScore(path, route.index), 10565 routesMeta 10566 }); 10567 }; 10568 routes2.forEach((route, index2) => { 10569 var _route$path; 10570 if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) { 10571 flattenRoute(route, index2); 10572 } else { 10573 for (let exploded of explodeOptionalSegments(route.path)) { 10574 flattenRoute(route, index2, exploded); 10575 } 10576 } 10577 }); 10578 return branches; 10579 } 10580 function explodeOptionalSegments(path) { 10581 let segments = path.split("/"); 10582 if (segments.length === 0) return []; 10583 let [first, ...rest] = segments; 10584 let isOptional = first.endsWith("?"); 10585 let required = first.replace(/\?$/, ""); 10586 if (rest.length === 0) { 10587 return isOptional ? [required, ""] : [required]; 10588 }
10589 let restExploded = explodeOptionalSegments(rest.join("/")); 10590 let result = []; 10591 result.push(...restExploded.map((subpath) => subpath === "" ? required : [required, subpath].join("/"))); 10592 if (isOptional) { 10593 result.push(...restExploded); 10594 } 10595 return result.map((exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded); 10596 } 10597 function rankRouteBranches(branches) { 10598 branches.sort((a2, b2) => a2.score !== b2.score ? b2.score - a2.score : compareIndexes(a2.routesMeta.map((meta) => meta.childrenIndex), b2.routesMeta.map((meta) => meta.childrenIndex))); 10599 } 10600 const paramRe = /^:[\w-]+$/; 10601 const dynamicSegmentValue = 3; 10602 const indexRouteValue = 2; 10603 const emptySegmentValue = 1; 10604 const staticSegmentValue = 10; 10605 const splatPenalty = -2; 10606 const isSplat = (s2) => s2 === "*"; 10607 function computeScore(path, index2) { 10608 let segments = path.split("/"); 10609 let initialScore = segments.length; 10610 if (segments.some(isSplat)) { 10611 initialScore += splatPenalty; 10612 } 10613 if (index2) { 10614 initialScore += indexRouteValue; 10615 } 10616 return segments.filter((s2) => !isSplat(s2)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); 10617 } 10618 function compareIndexes(a2, b2) { 10619 let siblings = a2.length === b2.length && a2.slice(0, -1).every((n2, i2) => n2 === b2[i2]); 10620 return siblings ? ( 10621 // If two routes are siblings, we should try to match the earlier sibling 10622 // first. This allows people to have fine-grained control over the matching 10623 // behavior by simply putting routes with identical paths in the order they 10624 // want them tried. 10625 a2[a2.length - 1] - b2[b2.length - 1] 10626 ) : ( 10627 // Otherwise, it doesn't really make sense to rank non-siblings by index, 10628 // so they sort equally. 10629 0 10630 ); 10631 } 10632 function matchRouteBranch(branch, pathname, allowPartial) { 10633 let { 10634 routesMeta 10635 } = branch; 10636 let matchedParams = {}; 10637 let matchedPathname = "/"; 10638 let matches2 = []; 10639 for (let i2 = 0; i2 < routesMeta.length; ++i2) { 10640 let meta = routesMeta[i2]; 10641 let end = i2 === routesMeta.length - 1; 10642 let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; 10643 let match2 = matchPath({ 10644 path: meta.relativePath, 10645 caseSensitive: meta.caseSensitive, 10646 end 10647 }, remainingPathname); 10648 let route = meta.route; 10649 if (!match2) { 10650 return null; 10651 } 10652 Object.assign(matchedParams, match2.params); 10653 matches2.push({ 10654 // TODO: Can this as be avoided? 10655 params: matchedParams, 10656 pathname: joinPaths([matchedPathname, match2.pathname]), 10657 pathnameBase: normalizePathname(joinPaths([matchedPathname, match2.pathnameBase])), 10658 route 10659 }); 10660 if (match2.pathnameBase !== "/") { 10661 matchedPathname = joinPaths([matchedPathname, match2.pathnameBase]); 10662 } 10663 } 10664 return matches2; 10665 } 10666 function matchPath(pattern, pathname) { 10667 if (typeof pattern === "string") { 10668 pattern = { 10669 path: pattern, 10670 caseSensitive: false, 10671 end: true 10672 }; 10673 } 10674 let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); 10675 let match2 = pathname.match(matcher); 10676 if (!match2) return null; 10677 let matchedPathname = match2[0]; 10678 let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); 10679 let captureGroups = match2.slice(1); 10680 let params = compiledParams.reduce((memo2, _ref2, index2) => { 10681 let { 10682 paramName, 10683 isOptional 10684 } = _ref2; 10685 if (paramName === "*") { 10686 let splatValue = captureGroups[index2] || ""; 10687 pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); 10688 } 10689 const value = captureGroups[index2]; 10690 if (isOptional && !value) { 10691 memo2[paramName] = void 0; 10692 } else { 10693 memo2[paramName] = (value || "").replace(/%2F/g, "/"); 10694 } 10695 return memo2; 10696 }, {}); 10697 return { 10698 params, 10699 pathname: matchedPathname, 10700 pathnameBase, 10701 pattern 10702 }; 10703 } 10704 function compilePath(path, caseSensitive, end) { 10705 if (caseSensitive === void 0) { 10706 caseSensitive = false;
10707 } 10708 if (end === void 0) { 10709 end = true; 10710 } 10711 warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), 'Route path "' + path + '" will be treated as if it were ' + ('"' + path.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + path.replace(/\*$/, "/*") + '".')); 10712 let params = []; 10713 let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (_2, paramName, isOptional) => { 10714 params.push({ 10715 paramName, 10716 isOptional: isOptional != null 10717 }); 10718 return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; 10719 }); 10720 if (path.endsWith("*")) { 10721 params.push({ 10722 paramName: "*" 10723 }); 10724 regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$"; 10725 } else if (end) { 10726 regexpSource += "\\/*$"; 10727 } else if (path !== "" && path !== "/") { 10728 regexpSource += "(?:(?=\\/|$))"; 10729 } else ; 10730 let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i"); 10731 return [matcher, params]; 10732 } 10733 function decodePath(value) { 10734 try { 10735 return value.split("/").map((v2) => decodeURIComponent(v2).replace(/\//g, "%2F")).join("/"); 10736 } catch (error) { 10737 warning(false, 'The URL path "' + value + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + error + ").")); 10738 return value; 10739 } 10740 } 10741 function stripBasename(pathname, basename) { 10742 if (basename === "/") return pathname; 10743 if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { 10744 return null; 10745 } 10746 let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; 10747 let nextChar = pathname.charAt(startIndex); 10748 if (nextChar && nextChar !== "/") { 10749 return null; 10750 } 10751 return pathname.slice(startIndex) || "/"; 10752 } 10753 function resolvePath(to2, fromPathname) { 10754 if (fromPathname === void 0) { 10755 fromPathname = "/"; 10756 } 10757 let { 10758 pathname: toPathname, 10759 search = "", 10760 hash: hash2 = "" 10761 } = typeof to2 === "string" ? parsePath(to2) : to2; 10762 let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname; 10763 return { 10764 pathname, 10765 search: normalizeSearch(search), 10766 hash: normalizeHash(hash2) 10767 }; 10768 } 10769 function resolvePathname(relativePath, fromPathname) { 10770 let segments = fromPathname.replace(/\/+$/, "").split("/"); 10771 let relativeSegments = relativePath.split("/"); 10772 relativeSegments.forEach((segment) => { 10773 if (segment === "..") { 10774 if (segments.length > 1) segments.pop(); 10775 } else if (segment !== ".") { 10776 segments.push(segment); 10777 } 10778 }); 10779 return segments.length > 1 ? segments.join("/") : "/"; 10780 } 10781 function getInvalidPathError(char2, field, dest, path) { 10782 return "Cannot include a '" + char2 + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.'; 10783 } 10784 function getPathContributingMatches(matches2) { 10785 return matches2.filter((match2, index2) => index2 === 0 || match2.route.path && match2.route.path.length > 0); 10786 } 10787 function getResolveToMatches(matches2, v7_relativeSplatPath) { 10788 let pathMatches = getPathContributingMatches(matches2); 10789 if (v7_relativeSplatPath) { 10790 return pathMatches.map((match2, idx) => idx === pathMatches.length - 1 ? match2.pathname : match2.pathnameBase); 10791 } 10792 return pathMatches.map((match2) => match2.pathnameBase); 10793 } 10794 function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { 10795 if (isPathRelative === void 0) { 10796 isPathRelative = false;
10797 } 10798 let to2; 10799 if (typeof toArg === "string") { 10800 to2 = parsePath(toArg); 10801 } else { 10802 to2 = _extends$9({}, toArg); 10803 invariant$1(!to2.pathname || !to2.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to2)); 10804 invariant$1(!to2.pathname || !to2.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to2)); 10805 invariant$1(!to2.search || !to2.search.includes("#"), getInvalidPathError("#", "search", "hash", to2)); 10806 } 10807 let isEmptyPath = toArg === "" || to2.pathname === ""; 10808 let toPathname = isEmptyPath ? "/" : to2.pathname; 10809 let from2; 10810 if (toPathname == null) { 10811 from2 = locationPathname; 10812 } else { 10813 let routePathnameIndex = routePathnames.length - 1; 10814 if (!isPathRelative && toPathname.startsWith("..")) { 10815 let toSegments = toPathname.split("/"); 10816 while (toSegments[0] === "..") { 10817 toSegments.shift(); 10818 routePathnameIndex -= 1; 10819 } 10820 to2.pathname = toSegments.join("/"); 10821 } 10822 from2 = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; 10823 } 10824 let path = resolvePath(to2, from2); 10825 let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); 10826 let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); 10827 if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { 10828 path.pathname += "/"; 10829 } 10830 return path; 10831 } 10832 const joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/"); 10833 const normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); 10834 const normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; 10835 const normalizeHash = (hash2) => !hash2 || hash2 === "#" ? "" : hash2.startsWith("#") ? hash2 : "#" + hash2; 10836 function isRouteErrorResponse(error) { 10837 return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; 10838 } 10839 const validMutationMethodsArr = ["post", "put", "patch", "delete"]; 10840 new Set(validMutationMethodsArr); 10841 const validRequestMethodsArr = ["get", ...validMutationMethodsArr]; 10842 new Set(validRequestMethodsArr); 10843 /** 10844 * React Router v6.29.0 10845 * 10846 * Copyright (c) Remix Software Inc. 10847 * 10848 * This source code is licensed under the MIT license found in the 10849 * LICENSE.md file in the root directory of this source tree. 10850 * 10851 * @license MIT 10852 */ 10853 function _extends$8() { 10854 _extends$8 = Object.assign ? Object.assign.bind() : function(target) { 10855 for (var i2 = 1; i2 < arguments.length; i2++) { 10856 var source = arguments[i2]; 10857 for (var key in source) { 10858 if (Object.prototype.hasOwnProperty.call(source, key)) { 10859 target[key] = source[key]; 10860 } 10861 } 10862 } 10863 return target; 10864 }; 10865 return _extends$8.apply(this, arguments); 10866 } 10867 const DataRouterContext = /* @__PURE__ */ reactExports.createContext(null); 10868 const DataRouterStateContext = /* @__PURE__ */ reactExports.createContext(null); 10869 const NavigationContext = /* @__PURE__ */ reactExports.createContext(null); 10870 const LocationContext = /* @__PURE__ */ reactExports.createContext(null); 10871 const RouteContext = /* @__PURE__ */ reactExports.createContext({ 10872 outlet: null, 10873 matches: [], 10874 isDataRoute: false 10875 }); 10876 const RouteErrorContext = /* @__PURE__ */ reactExports.createContext(null); 10877 function useHref(to2, _temp) { 10878 let { 10879 relative 10880 } = _temp === void 0 ? {} : _temp; 10881 !useInRouterContext() ? invariant$1(false) : void 0; 10882 let { 10883 basename, 10884 navigator: navigator2 10885 } = reactExports.useContext(NavigationContext); 10886 let { 10887 hash: hash2, 10888 pathname, 10889 search 10890 } = useResolvedPath(to2, { 10891 relative 10892 }); 10893 let joinedPathname = pathname; 10894 if (basename !== "/") { 10895 joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]); 10896 } 10897 return navigator2.createHref({ 10898 pathname: joinedPathname, 10899 search, 10900 hash: hash2 10901 }); 10902 } 10903 function useInRouterContext() { 10904 return reactExports.useContext(LocationContext) != null; 10905 } 10906 function useLocation() { 10907 !useInRouterContext() ? invariant$1(false) : void 0; 10908 return reactExports.useContext(LocationContext).location; 10909 } 10910 function useNavigationType() { 10911 return reactExports.useContext(LocationContext).navigationType; 10912 } 10913 function useIsomorphicLayoutEffect$4(cb) { 10914 let isStatic = reactExports.useContext(NavigationContext).static; 10915 if (!isStatic) { 10916 reactExports.useLayoutEffect(cb); 10917 } 10918 } 10919 function useNavigate() { 10920 let { 10921 isDataRoute 10922 } = reactExports.useContext(RouteContext); 10923 return isDataRoute ? useNavigateStable() : useNavigateUnstable(); 10924 } 10925 function useNavigateUnstable() { 10926 !useInRouterContext() ? invariant$1(false) : void 0; 10927 let dataRouterContext = reactExports.useContext(DataRouterContext); 10928 let { 10929 basename, 10930 future, 10931 navigator: navigator2 10932 } = reactExports.useContext(NavigationContext); 10933 let { 10934 matches: matches2 10935 } = reactExports.useContext(RouteContext); 10936 let { 10937 pathname: locationPathname 10938 } = useLocation(); 10939 let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2, future.v7_relativeSplatPath)); 10940 let activeRef = reactExports.useRef(false); 10941 useIsomorphicLayoutEffect$4(() => { 10942 activeRef.current = true; 10943 }); 10944 let navigate = reactExports.useCallback(function(to2, options2) { 10945 if (options2 === void 0) { 10946 options2 = {}; 10947 } 10948 if (!activeRef.current) return; 10949 if (typeof to2 === "number") { 10950 navigator2.go(to2); 10951 return; 10952 } 10953 let path = resolveTo(to2, JSON.parse(routePathnamesJson), locationPathname, options2.relative === "path"); 10954 if (dataRouterContext == null && basename !== "/") { 10955 path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); 10956 } 10957 (!!options2.replace ? navigator2.replace : navigator2.push)(path, options2.state, options2); 10958 }, [basename, navigator2, routePathnamesJson, locationPathname, dataRouterContext]); 10959 return navigate; 10960 } 10961 const OutletContext = /* @__PURE__ */ reactExports.createContext(null); 10962 function useOutlet(context) { 10963 let outlet = reactExports.useContext(RouteContext).outlet; 10964 if (outlet) { 10965 return /* @__PURE__ */ reactExports.createElement(OutletContext.Provider, { 10966 value: context 10967 }, outlet); 10968 } 10969 return outlet; 10970 } 10971 function useResolvedPath(to2, _temp2) { 10972 let { 10973 relative 10974 } = _temp2 === void 0 ? {}
10974 : _temp2; 10975 let { 10976 future 10977 } = reactExports.useContext(NavigationContext); 10978 let { 10979 matches: matches2 10980 } = reactExports.useContext(RouteContext); 10981 let { 10982 pathname: locationPathname 10983 } = useLocation(); 10984 let routePathnamesJson = JSON.stringify(getResolveToMatches(matches2, future.v7_relativeSplatPath)); 10985 return reactExports.useMemo(() => resolveTo(to2, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to2, routePathnamesJson, locationPathname, relative]); 10986 } 10987 function useRoutes(routes2, locationArg) { 10988 return useRoutesImpl(routes2, locationArg); 10989 } 10990 function useRoutesImpl(routes2, locationArg, dataRouterState, future) { 10991 !useInRouterContext() ? invariant$1(false) : void 0; 10992 let { 10993 navigator: navigator2, 10994 static: isStatic 10995 } = reactExports.useContext(NavigationContext); 10996 let { 10997 matches: parentMatches 10998 } = reactExports.useContext(RouteContext); 10999 let routeMatch = parentMatches[parentMatches.length - 1]; 11000 let parentParams = routeMatch ? routeMatch.params : {}; 11001 routeMatch ? routeMatch.pathname : "/"; 11002 let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; 11003 routeMatch && routeMatch.route; 11004 let locationFromContext = useLocation(); 11005 let location; 11006 if (locationArg) { 11007 var _parsedLocationArg$pa; 11008 let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; 11009 !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? invariant$1(false) : void 0; 11010 location = parsedLocationArg; 11011 } else { 11012 location = locationFromContext; 11013 } 11014 let pathname = location.pathname || "/"; 11015 let remainingPathname = pathname; 11016 if (parentPathnameBase !== "/") { 11017 let parentSegments = parentPathnameBase.replace(/^\//, "").split("/"); 11018 let segments = pathname.replace(/^\//, "").split("/"); 11019 remainingPathname = "/" + segments.slice(parentSegments.length).join("/"); 11020 } 11021 let matches2 = matchRoutes(routes2, { 11022 pathname: remainingPathname 11023 }); 11024 let renderedMatches = _renderMatches(matches2 && matches2.map((match2) => Object.assign({}, match2, { 11025 params: Object.assign({}, parentParams, match2.params), 11026 pathname: joinPaths([ 11027 parentPathnameBase, 11028 // Re-encode pathnames that were decoded inside matchRoutes 11029 navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathname).pathname : match2.pathname 11030 ]), 11031 pathnameBase: match2.pathnameBase === "/" ? parentPathnameBase : joinPaths([ 11032 parentPathnameBase, 11033 // Re-encode pathnames that were decoded inside matchRoutes 11034 navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathnameBase).pathname : match2.pathnameBase 11035 ]) 11036 })), parentMatches, dataRouterState, future); 11037 if (locationArg && renderedMatches) { 11038 return /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { 11039 value: { 11040 location: _extends$8({ 11041 pathname: "/", 11042 search: "", 11043 hash: "", 11044 state: null, 11045 key: "default" 11046 }, location), 11047 navigationType: Action.Pop 11048 } 11049 }, renderedMatches); 11050 } 11051 return renderedMatches; 11052 } 11053 function DefaultErrorComponent() { 11054 let error = useRouteError(); 11055 let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error); 11056 let stack = error instanceof Error ? error.stack : null; 11057 let lightgrey = "rgba(200,200,200, 0.5)"; 11058 let preStyles = { 11059 padding: "0.5rem", 11060 backgroundColor: lightgrey 11061 }; 11062 let devInfo = null; 11063 return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, /* @__PURE__ */ reactExports.createElement("h2", null, "Unexpected Application
11063Error!"), /* @__PURE__ */ reactExports.createElement("h3", { 11064 style: { 11065 fontStyle: "italic" 11066 } 11067 }, message), stack ? /* @__PURE__ */ reactExports.createElement("pre", { 11068 style: preStyles 11069 }, stack) : null, devInfo); 11070 } 11071 const defaultErrorElement = /* @__PURE__ */ reactExports.createElement(DefaultErrorComponent, null); 11072 class RenderErrorBoundary extends reactExports.Component { 11073 constructor(props) { 11074 super(props); 11075 this.state = { 11076 location: props.location, 11077 revalidation: props.revalidation, 11078 error: props.error 11079 }; 11080 } 11081 static getDerivedStateFromError(error) { 11082 return { 11083 error 11084 }; 11085 } 11086 static getDerivedStateFromProps(props, state) { 11087 if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") { 11088 return { 11089 error: props.error, 11090 location: props.location, 11091 revalidation: props.revalidation 11092 }; 11093 } 11094 return { 11095 error: props.error !== void 0 ? props.error : state.error, 11096 location: state.location, 11097 revalidation: props.revalidation || state.revalidation 11098 }; 11099 } 11100 componentDidCatch(error, errorInfo) { 11101 console.error("React Router caught the following error during render", error, errorInfo); 11102 } 11103 render() { 11104 return this.state.error !== void 0 ? /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { 11105 value: this.props.routeContext 11106 }, /* @__PURE__ */ reactExports.createElement(RouteErrorContext.Provider, { 11107 value: this.state.error, 11108 children: this.props.component 11109 })) : this.props.children; 11110 } 11111 }
11112 function RenderedRoute(_ref2) { 11113 let { 11114 routeContext, 11115 match: match2, 11116 children 11117 } = _ref2; 11118 let dataRouterContext = reactExports.useContext(DataRouterContext); 11119 if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match2.route.errorElement || match2.route.ErrorBoundary)) { 11120 dataRouterContext.staticContext._deepestRenderedBoundaryId = match2.route.id; 11121 } 11122 return /* @__PURE__ */ reactExports.createElement(RouteContext.Provider, { 11123 value: routeContext 11124 }, children); 11125 } 11126 function _renderMatches(matches2, parentMatches, dataRouterState, future) { 11127 var _dataRouterState; 11128 if (parentMatches === void 0) { 11129 parentMatches = []; 11130 } 11131 if (dataRouterState === void 0) { 11132 dataRouterState = null; 11133 } 11134 if (future === void 0) { 11135 future = null; 11136 } 11137 if (matches2 == null) { 11138 var _future; 11139 if (!dataRouterState) { 11140 return null; 11141 } 11142 if (dataRouterState.errors) { 11143 matches2 = dataRouterState.matches; 11144 } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) { 11145 matches2 = dataRouterState.matches; 11146 } else { 11147 return null; 11148 } 11149 } 11150 let renderedMatches = matches2; 11151 let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors; 11152 if (errors != null) { 11153 let errorIndex = renderedMatches.findIndex((m2) => m2.route.id && (errors == null ? void 0 : errors[m2.route.id]) !== void 0); 11154 !(errorIndex >= 0) ? invariant$1(false) : void 0; 11155 renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1)); 11156 } 11157 let renderFallback = false; 11158 let fallbackIndex = -1; 11159 if (dataRouterState && future && future.v7_partialHydration) { 11160 for (let i2 = 0; i2 < renderedMatches.length; i2++) { 11161 let match2 = renderedMatches[i2]; 11162 if (match2.route.HydrateFallback || match2.route.hydrateFallbackElement) { 11163 fallbackIndex = i2; 11164 } 11165 if (match2.route.id) { 11166 let { 11167 loaderData, 11168 errors: errors2 11169 } = dataRouterState; 11170 let needsToRunLoader = match2.route.loader && loaderData[match2.route.id] === void 0 && (!errors2 || errors2[match2.route.id] === void 0); 11171 if (match2.route.lazy || needsToRunLoader) { 11172 renderFallback = true; 11173 if (fallbackIndex >= 0) { 11174 renderedMatches = renderedMatches.slice(0, fallbackIndex + 1); 11175 } else { 11176 renderedMatches = [renderedMatches[0]]; 11177 } 11178 break; 11179 } 11180 } 11181 } 11182 } 11183 return renderedMatches.reduceRight((outlet, match2, index2) => { 11184 let error; 11185 let shouldRenderHydrateFallback = false; 11186 let errorElement = null; 11187 let hydrateFallbackElement = null; 11188 if (dataRouterState) { 11189 error = errors && match2.route.id ? errors[match2.route.id] : void 0; 11190 errorElement = match2.route.errorElement || defaultErrorElement; 11191 if (renderFallback) { 11192 if (fallbackIndex < 0 && index2 === 0) { 11193 warningOnce("route-fallback"); 11194 shouldRenderHydrateFallback = true; 11195 hydrateFallbackElement = null; 11196 } else if (fallbackIndex === index2) { 11197 shouldRenderHydrateFallback = true; 11198 hydrateFallbackElement = match2.route.hydrateFallbackElement || null; 11199 } 11200 } 11201 } 11202 let matches22 = parentMatches.concat(renderedMatches.slice(0, index2 + 1)); 11203 let getChildren2 = () => { 11204 let children; 11205 if (error) { 11206 children = errorElement; 11207 } else if (shouldRenderHydrateFallback) { 11208 children = hydrateFallbackElement; 11209 } else if (match2.route.Component) { 11210 children = /* @__PURE__ */ reactExports.createElement(match2.route.Component, null); 11211 } else if (match2.route.element) { 11212 children = match2.route.element; 11213 } else { 11214 children = outlet; 11215 } 11216 return /* @__PURE__ */ reactExports.createElement(RenderedRoute, { 11217 match: match2,
11218 routeContext: { 11219 outlet, 11220 matches: matches22, 11221 isDataRoute: dataRouterState != null 11222 }, 11223 children 11224 }); 11225 }; 11226 return dataRouterState && (match2.route.ErrorBoundary || match2.route.errorElement || index2 === 0) ? /* @__PURE__ */ reactExports.createElement(RenderErrorBoundary, { 11227 location: dataRouterState.location, 11228 revalidation: dataRouterState.revalidation, 11229 component: errorElement, 11230 error, 11231 children: getChildren2(), 11232 routeContext: { 11233 outlet: null, 11234 matches: matches22, 11235 isDataRoute: true 11236 } 11237 }) : getChildren2(); 11238 }, null); 11239 } 11240 var DataRouterHook$1 = /* @__PURE__ */ (function(DataRouterHook2) { 11241 DataRouterHook2["UseBlocker"] = "useBlocker"; 11242 DataRouterHook2["UseRevalidator"] = "useRevalidator"; 11243 DataRouterHook2["UseNavigateStable"] = "useNavigate"; 11244 return DataRouterHook2; 11245 })(DataRouterHook$1 || {}); 11246 var DataRouterStateHook$1 = /* @__PURE__ */ (function(DataRouterStateHook2) { 11247 DataRouterStateHook2["UseBlocker"] = "useBlocker"; 11248 DataRouterStateHook2["UseLoaderData"] = "useLoaderData"; 11249 DataRouterStateHook2["UseActionData"] = "useActionData"; 11250 DataRouterStateHook2["UseRouteError"] = "useRouteError"; 11251 DataRouterStateHook2["UseNavigation"] = "useNavigation"; 11252 DataRouterStateHook2["UseRouteLoaderData"] = "useRouteLoaderData"; 11253 DataRouterStateHook2["UseMatches"] = "useMatches"; 11254 DataRouterStateHook2["UseRevalidator"] = "useRevalidator"; 11255 DataRouterStateHook2["UseNavigateStable"] = "useNavigate"; 11256 DataRouterStateHook2["UseRouteId"] = "useRouteId"; 11257 return DataRouterStateHook2; 11258 })(DataRouterStateHook$1 || {}); 11259 function useDataRouterContext(hookName) { 11260 let ctx = reactExports.useContext(DataRouterContext); 11261 !ctx ? invariant$1(false) : void 0; 11262 return ctx; 11263 } 11264 function useDataRouterState(hookName) { 11265 let state = reactExports.useContext(DataRouterStateContext); 11266 !state ? invariant$1(false) : void 0; 11267 return state; 11268 } 11269 function useRouteContext(hookName) { 11270 let route = reactExports.useContext(RouteContext); 11271 !route ? invariant$1(false) : void 0; 11272 return route; 11273 } 11274 function useCurrentRouteId(hookName) { 11275 let route = useRouteContext(); 11276 let thisRoute = route.matches[route.matches.length - 1]; 11277 !thisRoute.route.id ? invariant$1(false) : void 0; 11278 return thisRoute.route.id; 11279 } 11280 function useRouteError() { 11281 var _state$errors; 11282 let error = reactExports.useContext(RouteErrorContext); 11283 let state = useDataRouterState(); 11284 let routeId = useCurrentRouteId(); 11285 if (error !== void 0) { 11286 return error; 11287 } 11288 return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId]; 11289 } 11290 function useNavigateStable() { 11291 let { 11292 router 11293 } = useDataRouterContext(DataRouterHook$1.UseNavigateStable); 11294 let id2 = useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable); 11295 let activeRef = reactExports.useRef(false); 11296 useIsomorphicLayoutEffect$4(() => { 11297 activeRef.current = true; 11298 }); 11299 let navigate = reactExports.useCallback(function(to2, options2) { 11300 if (options2 === void 0) { 11301 options2 = {}; 11302 } 11303 if (!activeRef.current) return; 11304 if (typeof to2 === "number") { 11305 router.navigate(to2); 11306 } else { 11307 router.navigate(to2, _extends$8({ 11308 fromRouteId: id2 11309 }, options2)); 11310 } 11311 }, [router, id2]); 11312 return navigate; 11313 } 11314 const alreadyWarned$1 = {}; 11315 function warningOnce(key, cond, message) { 11316 if (!alreadyWarned$1[key]) { 11317 alreadyWarned$1[key] = true; 11318 } 11319 } 11320 function logV6DeprecationWarnings(renderFuture, routerFuture) { 11321 if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === void 0) ; 11322 if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === void 0 && true) ; 11323 } 11324 function Navigate(_ref4) { 11325 let { 11326 to: to2, 11327 replace: replace2, 11328 state, 11329 relative 11330 } = _ref4; 11331 !useInRouterContext() ? invariant$1(false) : void 0; 11332 let { 11333 future, 11334 static: isStatic 11335 } = reactExports.useContext(NavigationContext); 11336 let { 11337 matches: matches2 11338 } = reactExports.useContext(RouteContext); 11339 let { 11340 pathname: locationPathname 11341 } = useLocation(); 11342 let navigate = useNavigate(); 11343 let path = resolveTo(to2, getResolveToMatches(matches2, future.v7_relativeSplatPath), locationPathname, relative === "path"); 11344 let jsonPath = JSON.stringify(path); 11345 reactExports.useEffect(() => navigate(JSON.parse(jsonPath), { 11346 replace: replace2, 11347 state, 11348 relative 11349 }), [navigate, jsonPath, relative, replace2, state]); 11350 return null; 11351 } 11352 function Outlet(props) { 11353 return useOutlet(props.context); 11354 } 11355 function Route(_props) { 11356 invariant$1(false); 11357 } 11358 function Router(_ref5) { 11359 let { 11360 basename: basenameProp = "/", 11361 children = null, 11362 location: locationProp, 11363 navigationType = Action.Pop, 11364 navigator: navigator2, 11365 static: staticProp = false, 11366 future 11367 } = _ref5; 11368 !!useInRouterContext() ? invariant$1(false) : void 0; 11369 let basename = basenameProp.replace(/^\/*/, "/"); 11370 let navigationContext = reactExports.useMemo(() => ({ 11371 basename, 11372 navigator: navigator2, 11373 static: staticProp, 11374 future: _extends$8({
11375 v7_relativeSplatPath: false 11376 }, future) 11377 }), [basename, future, navigator2, staticProp]); 11378 if (typeof locationProp === "string") { 11379 locationProp = parsePath(locationProp); 11380 } 11381 let { 11382 pathname = "/", 11383 search = "", 11384 hash: hash2 = "", 11385 state = null, 11386 key = "default" 11387 } = locationProp; 11388 let locationContext = reactExports.useMemo(() => { 11389 let trailingPathname = stripBasename(pathname, basename); 11390 if (trailingPathname == null) { 11391 return null; 11392 } 11393 return { 11394 location: { 11395 pathname: trailingPathname, 11396 search, 11397 hash: hash2, 11398 state, 11399 key 11400 }, 11401 navigationType 11402 }; 11403 }, [basename, pathname, search, hash2, state, key, navigationType]); 11404 if (locationContext == null) { 11405 return null; 11406 } 11407 return /* @__PURE__ */ reactExports.createElement(NavigationContext.Provider, { 11408 value: navigationContext 11409 }, /* @__PURE__ */ reactExports.createElement(LocationContext.Provider, { 11410 children, 11411 value: locationContext 11412 })); 11413 } 11414 function Routes(_ref6) { 11415 let { 11416 children, 11417 location 11418 } = _ref6; 11419 return useRoutes(createRoutesFromChildren(children), location); 11420 } 11421 new Promise(() => { 11422 }); 11423 function createRoutesFromChildren(children, parentPath) { 11424 if (parentPath === void 0) { 11425 parentPath = []; 11426 } 11427 let routes2 = []; 11428 reactExports.Children.forEach(children, (element, index2) => { 11429 if (!/* @__PURE__ */ reactExports.isValidElement(element)) { 11430 return; 11431 } 11432 let treePath = [...parentPath, index2]; 11433 if (element.type === reactExports.Fragment) { 11434 routes2.push.apply(routes2, createRoutesFromChildren(element.props.children, treePath)); 11435 return; 11436 } 11437 !(element.type === Route) ? invariant$1(false) : void 0; 11438 !(!element.props.index || !element.props.children) ? invariant$1(false) : void 0; 11439 let route = { 11440 id: element.props.id || treePath.join("-"), 11441 caseSensitive: element.props.caseSensitive, 11442 element: element.props.element, 11443 Component: element.props.Component, 11444 index: element.props.index, 11445 path: element.props.path, 11446 loader: element.props.loader, 11447 action: element.props.action, 11448 errorElement: element.props.errorElement, 11449 ErrorBoundary: element.props.ErrorBoundary, 11450 hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null, 11451 shouldRevalidate: element.props.shouldRevalidate, 11452 handle: element.props.handle, 11453 lazy: element.props.lazy 11454 }; 11455 if (element.props.children) { 11456 route.children = createRoutesFromChildren(element.props.children, treePath); 11457 } 11458 routes2.push(route); 11459 }); 11460 return routes2; 11461 } 11462 /** 11463 * React Router DOM v6.29.0 11464 * 11465 * Copyright (c) Remix Software Inc. 11466 * 11467 * This source code is licensed under the MIT license found in the 11468 * LICENSE.md file in the root directory of this source tree. 11469 * 11470 * @license MIT 11471 */ 11472 function _extends$7() { 11473 _extends$7 = Object.assign ? Object.assign.bind() : function(target) { 11474 for (var i2 = 1; i2 < arguments.length; i2++) { 11475 var source = arguments[i2]; 11476 for (var key in source) { 11477 if (Object.prototype.hasOwnProperty.call(source, key)) { 11478 target[key] = source[key]; 11479 } 11480 } 11481 } 11482 return target; 11483 }; 11484 return _extends$7.apply(this, arguments); 11485 } 11486 function _objectWithoutPropertiesLoose$3(source, excluded) { 11487 if (source == null) return {}; 11488 var target = {}; 11489 var sourceKeys = Object.keys(source); 11490 var key, i2; 11491 for (i2 = 0; i2 < sourceKeys.length; i2++) { 11492 key = sourceKeys[i2]; 11493 if (excluded.indexOf(key) >= 0) continue; 11494 target[key] = source[key]; 11495 } 11496 return target; 11497 } 11498 function isModifiedEvent(event) { 11499 return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); 11500 } 11501 function shouldProcessLinkClick(event, target) { 11502 return event.button === 0 && // Ignore everything but left clicks 11503 (!target || target === "_self") && // Let browser handle "target=_blank" etc. 11504 !isModifiedEvent(event); 11505 } 11506 function createSearchParams(init2) { 11507 if (init2 === void 0) { 11508 init2 = ""; 11509 } 11510 return new URLSearchParams(typeof init2 === "string" || Array.isArray(init2) || init2 instanceof URLSearchParams ? init2 : Object.keys(init2).reduce((memo2, key) => { 11511 let value = init2[key]; 11512 return memo2.concat(Array.isArray(value) ? value.map((v2) => [key, v2]) : [[key, value]]); 11513 }, [])); 11514 } 11515 function getSearchParamsForLocation(locationSearch, defaultSearchParams) { 11516 let searchParams = createSearchParams(locationSearch); 11517 if (defaultSearchParams) {
11518 defaultSearchParams.forEach((_2, key) => { 11519 if (!searchParams.has(key)) { 11520 defaultSearchParams.getAll(key).forEach((value) => { 11521 searchParams.append(key, value); 11522 }); 11523 } 11524 }); 11525 } 11526 return searchParams; 11527 } 11528 const _excluded$1 = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"]; 11529 const REACT_ROUTER_VERSION = "6"; 11530 try { 11531 window.__reactRouterVersion = REACT_ROUTER_VERSION; 11532 } catch (e2) { 11533 } 11534 const START_TRANSITION = "startTransition"; 11535 const startTransitionImpl = React[START_TRANSITION]; 11536 function BrowserRouter(_ref4) { 11537 let { 11538 basename, 11539 children, 11540 future, 11541 window: window2 11542 } = _ref4; 11543 let historyRef = reactExports.useRef(); 11544 if (historyRef.current == null) { 11545 historyRef.current = createBrowserHistory({ 11546 window: window2, 11547 v5Compat: true 11548 }); 11549 } 11550 let history = historyRef.current; 11551 let [state, setStateImpl] = reactExports.useState({ 11552 action: history.action, 11553 location: history.location 11554 }); 11555 let { 11556 v7_startTransition 11557 } = future || {}; 11558 let setState = reactExports.useCallback((newState) => { 11559 v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); 11560 }, [setStateImpl, v7_startTransition]); 11561 reactExports.useLayoutEffect(() => history.listen(setState), [history, setState]); 11562 reactExports.useEffect(() => logV6DeprecationWarnings(future), [future]); 11563 return /* @__PURE__ */ reactExports.createElement(Router, { 11564 basename, 11565 children, 11566 location: state.location, 11567 navigationType: state.action, 11568 navigator: history, 11569 future 11570 }); 11571 } 11572 const isBrowser$1 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; 11573 const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; 11574 const Link = /* @__PURE__ */ reactExports.forwardRef(function LinkWithRef(_ref7, ref) { 11575 let { 11576 onClick, 11577 relative, 11578 reloadDocument, 11579 replace: replace2, 11580 state, 11581 target, 11582 to: to2, 11583 preventScrollReset, 11584 viewTransition 11585 } = _ref7, rest = _objectWithoutPropertiesLoose$3(_ref7, _excluded$1); 11586 let { 11587 basename 11588 } = reactExports.useContext(NavigationContext); 11589 let absoluteHref; 11590 let isExternal = false; 11591 if (typeof to2 === "string" && ABSOLUTE_URL_REGEX.test(to2)) { 11592 absoluteHref = to2; 11593 if (isBrowser$1) { 11594 try { 11595 let currentUrl = new URL(window.location.href); 11596 let targetUrl = to2.startsWith("//") ? new URL(currentUrl.protocol + to2) : new URL(to2); 11597 let path = stripBasename(targetUrl.pathname, basename); 11598 if (targetUrl.origin === currentUrl.origin && path != null) { 11599 to2 = path + targetUrl.search + targetUrl.hash; 11600 } else { 11601 isExternal = true; 11602 } 11603 } catch (e2) { 11604 } 11605 } 11606 } 11607 let href = useHref(to2, { 11608 relative 11609 }); 11610 let internalOnClick = useLinkClickHandler(to2, { 11611 replace: replace2, 11612 state, 11613 target, 11614 preventScrollReset, 11615 relative, 11616 viewTransition 11617 }); 11618 function handleClick(event) { 11619 if (onClick) onClick(event); 11620 if (!event.defaultPrevented) { 11621 internalOnClick(event); 11622 } 11623 } 11624 return ( 11625 // eslint-disable-next-line jsx-a11y/anchor-has-content
11626 /* @__PURE__ */ reactExports.createElement("a", _extends$7({}, rest, { 11627 href: absoluteHref || href, 11628 onClick: isExternal || reloadDocument ? onClick : handleClick, 11629 ref, 11630 target 11631 })) 11632 ); 11633 }); 11634 var DataRouterHook; 11635 (function(DataRouterHook2) { 11636 DataRouterHook2["UseScrollRestoration"] = "useScrollRestoration"; 11637 DataRouterHook2["UseSubmit"] = "useSubmit"; 11638 DataRouterHook2["UseSubmitFetcher"] = "useSubmitFetcher"; 11639 DataRouterHook2["UseFetcher"] = "useFetcher"; 11640 DataRouterHook2["useViewTransitionState"] = "useViewTransitionState"; 11641 })(DataRouterHook || (DataRouterHook = {})); 11642 var DataRouterStateHook; 11643 (function(DataRouterStateHook2) { 11644 DataRouterStateHook2["UseFetcher"] = "useFetcher"; 11645 DataRouterStateHook2["UseFetchers"] = "useFetchers"; 11646 DataRouterStateHook2["UseScrollRestoration"] = "useScrollRestoration"; 11647 })(DataRouterStateHook || (DataRouterStateHook = {})); 11648 function useLinkClickHandler(to2, _temp) { 11649 let { 11650 target, 11651 replace: replaceProp, 11652 state, 11653 preventScrollReset, 11654 relative, 11655 viewTransition 11656 } = _temp === void 0 ? {} : _temp; 11657 let navigate = useNavigate(); 11658 let location = useLocation(); 11659 let path = useResolvedPath(to2, { 11660 relative 11661 }); 11662 return reactExports.useCallback((event) => { 11663 if (shouldProcessLinkClick(event, target)) { 11664 event.preventDefault(); 11665 let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location) === createPath(path); 11666 navigate(to2, { 11667 replace: replace2, 11668 state, 11669 preventScrollReset, 11670 relative, 11671 viewTransition 11672 }); 11673 } 11674 }, [location, navigate, path, replaceProp, state, target, to2, preventScrollReset, relative, viewTransition]); 11675 } 11676 function useSearchParams(defaultInit) { 11677 let defaultSearchParamsRef = reactExports.useRef(createSearchParams(defaultInit)); 11678 let hasSetSearchParamsRef = reactExports.useRef(false); 11679 let location = useLocation(); 11680 let searchParams = reactExports.useMemo(() => ( 11681 // Only merge in the defaults if we haven't yet called setSearchParams. 11682 // Once we call that we want those to take precedence, otherwise you can't 11683 // remove a param with setSearchParams({}) if it has an initial value 11684 getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current) 11685 ), [location.search]); 11686 let navigate = useNavigate(); 11687 let setSearchParams = reactExports.useCallback((nextInit, navigateOptions) => { 11688 const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit); 11689 hasSetSearchParamsRef.current = true; 11690 navigate("?" + newSearchParams, navigateOptions); 11691 }, [navigate, searchParams]); 11692 return [searchParams, setSearchParams]; 11693 } 11694 const isNode$1 = () => typeof process !== "undefined" && !!process.versions && !!process.versions.node; 11695 var define_process_env_default$2 = {}; 11696 const getAdminOrigin = () => { 11697 var _a; 11698 const adminOrigin = isNode$1() ? define_process_env_default$2 == null ? void 0 : define_process_env_default$2.FW_ADMIN_ORIGIN : (_a = globalThis.__fw_env__) == null ? void 0 : _a.FW_ADMIN_ORIGIN; 11699 return adminOrigin || void 0; 11700 }; 11701 const isServedFromAdminOrigin = () => { 11702 var _a; 11703 const adminOrigin = getAdminOrigin(); 11704 return adminOrigin !== void 0 && ((_a = globalThis.location) == null ? void 0 : _a.origin) === adminOrigin; 11705 }; 11706 const getStoreBasePath = () => { 11707 var _a, _b, _c, _d; 11708 return (_d = (_c = /^\/store\/[a-z0-9][a-z0-9-]{0,62}(?=\/|$)/.exec((_b = (_a = globalThis.location) == null ? void 0 : _a.pathname) != null ? _b : "")) == null ? void 0 : _c[0]) != null ? _d : ""; 11709 }; 11710 const isHeadlessRenderingSurface = () => { 11711 var _a, _b; 11712 return ((_b = (_a = globalThis.location) == null ? void 0 : _a.pathname) != null ? _b : "").startsWith("/admin/v3/designer/rendering/"); 11713 }; 11714 const withAdminOriginBase = (getter, adminBase) => (suffix) => { 11715 if (!isServedFromAdminOrigin() || isHeadlessRenderingSurface()) { 11716 return getter(suffix); 11717 } 11718 const base = adminBase(); 11719 return suffix ? `${base}/${suffix}` : base; 11720 }; 11721 var define_process_env_default$1 = {}; 11722 const createEnvGetter = (key, options2 = { 11723 suffixAble: true 11724 }) => { 11725 const getValue2 = () => { 11726 var _a; 11727 if (isNode$1()) { 11728 const serverEnv = define_process_env_default$1 == null ? void 0 : define_process_env_default$1[`SERVER_${key}`]; 11729 return serverEnv || (define_process_env_default$1 == null ? void 0 : define_process_env_default$1[key]); 11730 } 11731 return (_a = globalThis.__fw_env__) == null ? void 0 : _a[key]; 11732 }; 11733 if (options2.suffixAble) { 11734 return (suffix) => { 11735 const value = getValue2(); 11736 if (!value) { 11737 throw new Error(`Missing variable [${key}]`); 11738 } 11739 if (suffix) { 11740 return `${value}/${suffix}`; 11741 } 11742 return value; 11743 }; 11744 } 11745 return () => { 11746 const value = getValue2(); 11747 if (!value) { 11748 throw new Error(`Missing variable [${key}]`); 11749 } 11750 return value; 11751 }; 11752 }; 11753 const getCsrfCookieName = () => { 11754 var _a; 11755 return ((_a = globalThis.location) == null ? void 0 : _a.protocol) === "http:" ? "XSRF-TOKEN" : "__Host-XSRF-TOKEN"; 11756 }; 11757 createEnvGetter("FW_BASE_URL"); 11758 const getBaseApiUrl = withAdminOriginBase(createEnvGetter("FW_BASE_API_URL"), getStoreBasePath); 11759 withAdminOriginBase(createEnvGetter("FW_BASE_API_URL"), () => ""); 11760 createEnvGetter("FW_BASE_API_URL"); 11761 withAdminOriginBase(createEnvGetter("FW_MEMBERSHIPS_API_URL"), () => `${getStoreBasePath()}/membership`); 11762 createEnvGetter("FW_RENDERING_API_URL"); 11763 createEnvGetter("FW_HERO_URL"); 11764 withAdminOriginBase(createEnvGetter("FW_SHOP_RENDERER_API_URL"), () => `${getStoreBasePath()}/sr`); 11765 createEnvGetter("FW_AUTH_URL"); 11766 withAdminOriginBase(createEnvGetter("FW_CHATBOT_URL"), () => `${getStoreBasePath()}/chatbot`); 11767 withAdminOriginBase(createEnvGetter("FW_OMNI_URL"), () => `${getStoreBasePath()}/omni`); 11768 createEnvGetter("FW_UPSCALER_URL"); 11769 const getCurrentEnvironment = createEnvGetter("FW_ENV", { suffixAble: false }); 11770 const getSentryDsn = createEnvGetter("FW_SENTRY_DSN"); 11771 const getCommitHash = createEnvGetter("FW_COMMIT_HASH"); 11772 createEnvGetter("FW_MY_SHOP_URL"); 11773 createEnvGetter("FW_REGISTER_URL"); 11774 createEnvGetter("FW_PRODUCT_CATALOG_URL"); 11775 const DEBUG_BUILD$3 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 11776 const SDK_VERSION = "8.55.0"; 11777 const GLOBAL_OBJ = globalThis; 11778 function getGlobalSingleton(name, creator, obj) { 11779 const gbl = obj || GLOBAL_OBJ; 11780 const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {}; 11781 const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; 11782 return versionedCarrier[name] || (versionedCarrier[name] = creator()); 11783 } 11784 const DEBUG_BUILD$2 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 11785 const PREFIX = "Sentry Logger "; 11786 const CONSOLE_LEVELS = [ 11787 "debug", 11788 "info", 11789 "warn", 11790 "error", 11791 "log", 11792 "assert", 11793 "trace" 11794 ]; 11795 const originalConsoleMethods = {}; 11796 function consoleSandbox(callback) { 11797 if (!("console" in GLOBAL_OBJ)) { 11798 return callback(); 11799 } 11800 const console2 = GLOBAL_OBJ.console; 11801 const wrappedFuncs = {}; 11802 const wrappedLevels = Object.keys(originalConsoleMethods);
11803 wrappedLevels.forEach((level) => { 11804 const originalConsoleMethod = originalConsoleMethods[level]; 11805 wrappedFuncs[level] = console2[level]; 11806 console2[level] = originalConsoleMethod; 11807 }); 11808 try { 11809 return callback(); 11810 } finally { 11811 wrappedLevels.forEach((level) => { 11812 console2[level] = wrappedFuncs[level]; 11813 }); 11814 } 11815 } 11816 function makeLogger() { 11817 let enabled = false; 11818 const logger2 = { 11819 enable: () => { 11820 enabled = true; 11821 }, 11822 disable: () => { 11823 enabled = false; 11824 }, 11825 isEnabled: () => enabled 11826 }; 11827 if (DEBUG_BUILD$2) { 11828 CONSOLE_LEVELS.forEach((name) => { 11829 logger2[name] = (...args) => { 11830 if (enabled) { 11831 consoleSandbox(() => { 11832 GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); 11833 }); 11834 } 11835 }; 11836 }); 11837 } else { 11838 CONSOLE_LEVELS.forEach((name) => { 11839 logger2[name] = () => void 0; 11840 }); 11841 } 11842 return logger2; 11843 } 11844 const logger = getGlobalSingleton("logger", makeLogger); 11845 const STACKTRACE_FRAME_LIMIT = 50; 11846 const UNKNOWN_FUNCTION = "?"; 11847 const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; 11848 const STRIP_FRAME_REGEXP = /captureMessage|captureException/; 11849 function createStackParser(...parsers) { 11850 const sortedParsers = parsers.sort((a2, b2) => a2[0] - b2[0]).map((p2) => p2[1]); 11851 return (stack, skipFirstLines = 0, framesToPop = 0) => { 11852 const frames = []; 11853 const lines = stack.split("\n"); 11854 for (let i2 = skipFirstLines; i2 < lines.length; i2++) { 11855 const line2 = lines[i2]; 11856 if (line2.length > 1024) { 11857 continue; 11858 } 11859 const cleanedLine = WEBPACK_ERROR_REGEXP.test(line2) ? line2.replace(WEBPACK_ERROR_REGEXP, "$1") : line2; 11860 if (cleanedLine.match(/\S*Error: /)) { 11861 continue; 11862 } 11863 for (const parser of sortedParsers) { 11864 const frame2 = parser(cleanedLine); 11865 if (frame2) { 11866 frames.push(frame2); 11867 break; 11868 } 11869 } 11870 if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { 11871 break; 11872 } 11873 } 11874 return stripSentryFramesAndReverse(frames.slice(framesToPop)); 11875 }; 11876 } 11877 function stackParserFromStackParserOptions(stackParser) { 11878 if (Array.isArray(stackParser)) { 11879 return createStackParser(...stackParser); 11880 } 11881 return stackParser; 11882 } 11883 function stripSentryFramesAndReverse(stack) { 11884 if (!stack.length) { 11885 return []; 11886 } 11887 const localStack = Array.from(stack); 11888 if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) { 11889 localStack.pop(); 11890 } 11891 localStack.reverse(); 11892 if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { 11893 localStack.pop(); 11894 if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { 11895 localStack.pop(); 11896 } 11897 } 11898 return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame2) => __spreadProps(__spreadValues({}, frame2), { 11899 filename: frame2.filename || getLastStackFrame(localStack).filename, 11900 function: frame2.function || UNKNOWN_FUNCTION 11901 })); 11902 } 11903 function getLastStackFrame(arr) { 11904 return arr[arr.length - 1] || {}; 11905 } 11906 const defaultFunctionName = "<anonymous>"; 11907 function getFunctionName(fn2) { 11908 try { 11909 if (!fn2 || typeof fn2 !== "function") { 11910 return defaultFunctionName; 11911 } 11912 return fn2.name || defaultFunctionName; 11913 } catch (e2) { 11914 return defaultFunctionName; 11915 } 11916 } 11917 function getFramesFromEvent(event) { 11918 const exception = event.exception; 11919 if (exception) { 11920 const frames = []; 11921 try { 11922 exception.values.forEach((value) => { 11923 if (value.stacktrace.frames) { 11924 frames.push(...value.stacktrace.frames); 11925 } 11926 }); 11927 return frames; 11928 } catch (_oO) { 11929 return void 0; 11930 } 11931 } 11932 return void 0; 11933 } 11934 const handlers$1 = {}; 11935 const instrumented$1 = {}; 11936 function addHandler$1(type, handler) { 11937 handlers$1[type] = handlers$1[type] || []; 11938 handlers$1[type].push(handler); 11939 } 11940 function maybeInstrument(type, instrumentFn) { 11941 if (!instrumented$1[type]) { 11942 instrumented$1[type] = true; 11943 try { 11944 instrumentFn(); 11945 } catch (e2) { 11946 DEBUG_BUILD$2 && logger.error(`Error while instrumenting ${type}`, e2); 11947 } 11948 } 11949 } 11950 function triggerHandlers$1(type, data) { 11951 const typeHandlers = type && handlers$1[type]; 11952 if (!typeHandlers) { 11953 return; 11954 } 11955 for (const handler of typeHandlers) { 11956 try { 11957 handler(data); 11958 } catch (e2) { 11959 DEBUG_BUILD$2 && logger.error( 11960 `Error while triggering instrumentation handler. 11961Type: ${type} 11962Name: ${getFunctionName(handler)} 11963Error:`, 11964 e2 11965 ); 11966 } 11967 } 11968 } 11969 let _oldOnErrorHandler = null; 11970 function addGlobalErrorInstrumentationHandler(handler) { 11971 const type = "error"; 11972 addHandler$1(type, handler); 11973 maybeInstrument(type, instrumentError); 11974 } 11975 function instrumentError() { 11976 _oldOnErrorHandler = GLOBAL_OBJ.onerror;
11977 GLOBAL_OBJ.onerror = function(msg, url, line2, column2, error) { 11978 const handlerData = { 11979 column: column2, 11980 error, 11981 line: line2, 11982 msg, 11983 url 11984 }; 11985 triggerHandlers$1("error", handlerData); 11986 if (_oldOnErrorHandler) { 11987 return _oldOnErrorHandler.apply(this, arguments); 11988 } 11989 return false; 11990 }; 11991 GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; 11992 } 11993 let _oldOnUnhandledRejectionHandler = null; 11994 function addGlobalUnhandledRejectionInstrumentationHandler(handler) { 11995 const type = "unhandledrejection"; 11996 addHandler$1(type, handler); 11997 maybeInstrument(type, instrumentUnhandledRejection); 11998 } 11999 function instrumentUnhandledRejection() { 12000 _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection; 12001 GLOBAL_OBJ.onunhandledrejection = function(e2) { 12002 const handlerData = e2; 12003 triggerHandlers$1("unhandledrejection", handlerData); 12004 if (_oldOnUnhandledRejectionHandler) { 12005 return _oldOnUnhandledRejectionHandler.apply(this, arguments); 12006 } 12007 return true; 12008 }; 12009 GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; 12010 } 12011 function getMainCarrier() { 12012 getSentryCarrier(GLOBAL_OBJ); 12013 return GLOBAL_OBJ; 12014 } 12015 function getSentryCarrier(carrier) { 12016 const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {}; 12017 __SENTRY__.version = __SENTRY__.version || SDK_VERSION; 12018 return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; 12019 } 12020 const objectToString$2 = Object.prototype.toString; 12021 function isError(wat) { 12022 switch (objectToString$2.call(wat)) { 12023 case "[object Error]":
12024 case "[object Exception]": 12025 case "[object DOMException]": 12026 case "[object WebAssembly.Exception]": 12027 return true; 12028 default: 12029 return isInstanceOf(wat, Error); 12030 } 12031 } 12032 function isBuiltin(wat, className) { 12033 return objectToString$2.call(wat) === `[object ${className}]`; 12034 } 12035 function isErrorEvent$1(wat) { 12036 return isBuiltin(wat, "ErrorEvent"); 12037 } 12038 function isDOMError(wat) { 12039 return isBuiltin(wat, "DOMError"); 12040 } 12041 function isDOMException(wat) { 12042 return isBuiltin(wat, "DOMException"); 12043 } 12044 function isString$2(wat) { 12045 return isBuiltin(wat, "String"); 12046 } 12047 function isParameterizedString(wat) { 12048 return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; 12049 } 12050 function isPrimitive(wat) { 12051 return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; 12052 } 12053 function isPlainObject$3(wat) { 12054 return isBuiltin(wat, "Object"); 12055 } 12056 function isEvent(wat) { 12057 return typeof Event !== "undefined" && isInstanceOf(wat, Event); 12058 } 12059 function isElement$1(wat) { 12060 return typeof Element !== "undefined" && isInstanceOf(wat, Element); 12061 } 12062 function isRegExp$1(wat) { 12063 return isBuiltin(wat, "RegExp"); 12064 } 12065 function isThenable$1(wat) { 12066 return Boolean(wat && wat.then && typeof wat.then === "function"); 12067 } 12068 function isSyntheticEvent(wat) { 12069 return isPlainObject$3(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; 12070 } 12071 function isInstanceOf(wat, base) { 12072 try { 12073 return wat instanceof base; 12074 } catch (_e2) { 12075 return false; 12076 } 12077 } 12078 function isVueViewModel(wat) { 12079 return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue)); 12080 } 12081 const WINDOW$4 = GLOBAL_OBJ; 12082 const DEFAULT_MAX_STRING_LENGTH = 80; 12083 function htmlTreeAsString(elem, options2 = {}) { 12084 if (!elem) { 12085 return "<unknown>"; 12086 } 12087 try { 12088 let currentElem = elem; 12089 const MAX_TRAVERSE_HEIGHT = 5; 12090 const out = []; 12091 let height = 0; 12092 let len = 0; 12093 const separator = " > "; 12094 const sepLength = separator.length; 12095 let nextStr; 12096 const keyAttrs = Array.isArray(options2) ? options2 : options2.keyAttrs; 12097 const maxStringLength = !Array.isArray(options2) && options2.maxStringLength || DEFAULT_MAX_STRING_LENGTH; 12098 while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { 12099 nextStr = _htmlElementAsString(currentElem, keyAttrs); 12100 if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { 12101 break; 12102 } 12103 out.push(nextStr); 12104 len += nextStr.length; 12105 currentElem = currentElem.parentNode; 12106 } 12107 return out.reverse().join(separator); 12108 } catch (_oO) { 12109 return "<unknown>"; 12110 } 12111 } 12112 function _htmlElementAsString(el, keyAttrs) { 12113 const elem = el; 12114 const out = []; 12115 if (!elem || !elem.tagName) { 12116 return ""; 12117 } 12118 if (WINDOW$4.HTMLElement) { 12119 if (elem instanceof HTMLElement && elem.dataset) { 12120 if (elem.dataset["sentryComponent"]) { 12121 return elem.dataset["sentryComponent"]; 12122 } 12123 if (elem.dataset["sentryElement"]) { 12124 return elem.dataset["sentryElement"]; 12125 } 12126 } 12127 } 12128 out.push(elem.tagName.toLowerCase()); 12129 const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; 12130 if (keyAttrPairs && keyAttrPairs.length) { 12131 keyAttrPairs.forEach((keyAttrPair) => { 12132 out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); 12133 }); 12134 } else { 12135 if (elem.id) { 12136 out.push(`#${elem.id}`); 12137 } 12138 const className = elem.className; 12139 if (className && isString$2(className)) { 12140 const classes = className.split(/\s+/); 12141 for (const c2 of classes) { 12142 out.push(`.${c2}`); 12143 } 12144 } 12145 } 12146 const allowedAttrs = ["aria-label", "type", "name", "title", "alt"]; 12147 for (const k2 of allowedAttrs) { 12148 const attr2 = elem.getAttribute(k2); 12149 if (attr2) { 12150 out.push(`[${k2}="${attr2}"]`); 12151 } 12152 } 12153 return out.join(""); 12154 } 12155 function getLocationHref() {
12156 try { 12157 return WINDOW$4.document.location.href; 12158 } catch (oO) { 12159 return ""; 12160 } 12161 } 12162 function getDomElement(selector) { 12163 if (WINDOW$4.document && WINDOW$4.document.querySelector) { 12164 return WINDOW$4.document.querySelector(selector); 12165 } 12166 return null; 12167 } 12168 function getComponentName(elem) { 12169 if (!WINDOW$4.HTMLElement) { 12170 return null; 12171 } 12172 let currentElem = elem; 12173 const MAX_TRAVERSE_HEIGHT = 5; 12174 for (let i2 = 0; i2 < MAX_TRAVERSE_HEIGHT; i2++) { 12175 if (!currentElem) { 12176 return null; 12177 } 12178 if (currentElem instanceof HTMLElement) { 12179 if (currentElem.dataset["sentryComponent"]) { 12180 return currentElem.dataset["sentryComponent"]; 12181 } 12182 if (currentElem.dataset["sentryElement"]) { 12183 return currentElem.dataset["sentryElement"]; 12184 } 12185 } 12186 currentElem = currentElem.parentNode; 12187 } 12188 return null; 12189 } 12190 function truncate(str, max2 = 0) { 12191 if (typeof str !== "string" || max2 === 0) { 12192 return str; 12193 } 12194 return str.length <= max2 ? str : `${str.slice(0, max2)}...`; 12195 } 12196 function safeJoin(input, delimiter2) { 12197 if (!Array.isArray(input)) { 12198 return ""; 12199 } 12200 const output = []; 12201 for (let i2 = 0; i2 < input.length; i2++) { 12202 const value = input[i2]; 12203 try { 12204 if (isVueViewModel(value)) { 12205 output.push("[VueViewModel]"); 12206 } else { 12207 output.push(String(value)); 12208 } 12209 } catch (e2) { 12210 output.push("[value cannot be serialized]"); 12211 } 12212 } 12213 return output.join(delimiter2); 12214 } 12215 function isMatchingPattern(value, pattern, requireExactStringMatch = false) { 12216 if (!isString$2(value)) { 12217 return false; 12218 } 12219 if (isRegExp$1(pattern)) { 12220 return pattern.test(value); 12221 } 12222 if (isString$2(pattern)) { 12223 return requireExactStringMatch ? value === pattern : value.includes(pattern); 12224 } 12225 return false; 12226 } 12227 function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { 12228 return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch)); 12229 } 12230 function fill(source, name, replacementFactory) { 12231 if (!(name in source)) { 12232 return; 12233 } 12234 const original = source[name]; 12235 const wrapped = replacementFactory(original); 12236 if (typeof wrapped === "function") { 12237 markFunctionWrapped(wrapped, original); 12238 } 12239 try { 12240 source[name] = wrapped; 12241 } catch (e2) { 12242 DEBUG_BUILD$2 && logger.log(`Failed to replace method "${name}" in object`, source); 12243 } 12244 } 12245 function addNonEnumerableProperty(obj, name, value) { 12246 try { 12247 Object.defineProperty(obj, name, { 12248 // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it 12249 value, 12250 writable: true, 12251 configurable: true 12252 }); 12253 } catch (o_O) { 12254 DEBUG_BUILD$2 && logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); 12255 } 12256 } 12257 function markFunctionWrapped(wrapped, original) { 12258 try { 12259 const proto = original.prototype || {}; 12260 wrapped.prototype = original.prototype = proto; 12261 addNonEnumerableProperty(wrapped, "__sentry_original__", original); 12262 } catch (o_O) { 12263 } 12264 } 12265 function getOriginalFunction(func) { 12266 return func.__sentry_original__; 12267 } 12268 function convertToPlainObject(value) { 12269 if (isError(value)) { 12270 return __spreadValues({ 12271 message: value.message, 12272 name: value.name, 12273 stack: value.stack 12274 }, getOwnProperties(value)); 12275 } else if (isEvent(value)) { 12276 const newObj = __spreadValues({ 12277 type: value.type, 12278 target: serializeEventTarget(value.target), 12279 currentTarget: serializeEventTarget(value.currentTarget) 12280 }, getOwnProperties(value)); 12281 if (typeof CustomEvent !== "undefined" && isInstanceOf(value, CustomEvent)) { 12282 newObj.detail = value.detail; 12283 } 12284 return newObj; 12285 } else { 12286 return value; 12287 } 12288 } 12289 function serializeEventTarget(target) {
vendor: 4,719 bytes, lines 12290-12417
12290 try { 12291 return isElement$1(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target); 12292 } catch (_oO) { 12293 return "<unknown>"; 12294 } 12295 } 12296 function getOwnProperties(obj) { 12297 if (typeof obj === "object" && obj !== null) { 12298 const extractedProps = {}; 12299 for (const property2 in obj) { 12300 if (Object.prototype.hasOwnProperty.call(obj, property2)) { 12301 extractedProps[property2] = obj[property2]; 12302 } 12303 } 12304 return extractedProps; 12305 } else { 12306 return {}; 12307 } 12308 } 12309 function extractExceptionKeysForMessage(exception, maxLength = 40) { 12310 const keys2 = Object.keys(convertToPlainObject(exception)); 12311 keys2.sort(); 12312 const firstKey = keys2[0]; 12313 if (!firstKey) { 12314 return "[object has no keys]"; 12315 } 12316 if (firstKey.length >= maxLength) { 12317 return truncate(firstKey, maxLength); 12318 } 12319 for (let includedKeys = keys2.length; includedKeys > 0; includedKeys--) { 12320 const serialized = keys2.slice(0, includedKeys).join(", "); 12321 if (serialized.length > maxLength) { 12322 continue; 12323 } 12324 if (includedKeys === keys2.length) { 12325 return serialized; 12326 } 12327 return truncate(serialized, maxLength); 12328 } 12329 return ""; 12330 } 12331 function dropUndefinedKeys(inputValue) { 12332 const memoizationMap = /* @__PURE__ */ new Map(); 12333 return _dropUndefinedKeys(inputValue, memoizationMap); 12334 } 12335 function _dropUndefinedKeys(inputValue, memoizationMap) { 12336 if (isPojo(inputValue)) { 12337 const memoVal = memoizationMap.get(inputValue); 12338 if (memoVal !== void 0) { 12339 return memoVal; 12340 } 12341 const returnValue = {}; 12342 memoizationMap.set(inputValue, returnValue); 12343 for (const key of Object.getOwnPropertyNames(inputValue)) { 12344 if (typeof inputValue[key] !== "undefined") { 12345 returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); 12346 } 12347 } 12348 return returnValue; 12349 } 12350 if (Array.isArray(inputValue)) { 12351 const memoVal = memoizationMap.get(inputValue); 12352 if (memoVal !== void 0) { 12353 return memoVal; 12354 } 12355 const returnValue = []; 12356 memoizationMap.set(inputValue, returnValue); 12357 inputValue.forEach((item) => { 12358 returnValue.push(_dropUndefinedKeys(item, memoizationMap)); 12359 }); 12360 return returnValue; 12361 } 12362 return inputValue; 12363 } 12364 function isPojo(input) { 12365 if (!isPlainObject$3(input)) { 12366 return false; 12367 } 12368 try { 12369 const name = Object.getPrototypeOf(input).constructor.name; 12370 return !name || name === "Object"; 12371 } catch (e2) { 12372 return true; 12373 } 12374 } 12375 const ONE_SECOND_IN_MS = 1e3; 12376 function dateTimestampInSeconds() { 12377 return Date.now() / ONE_SECOND_IN_MS; 12378 } 12379 function createUnixTimestampInSecondsFunc() { 12380 const { performance: performance2 } = GLOBAL_OBJ; 12381 if (!performance2 || !performance2.now) { 12382 return dateTimestampInSeconds; 12383 } 12384 const approxStartingTimeOrigin = Date.now() - performance2.now(); 12385 const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin; 12386 return () => { 12387 return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS; 12388 }; 12389 } 12390 const timestampInSeconds = createUnixTimestampInSecondsFunc(); 12391 const browserPerformanceTimeOrigin = (() => { 12392 const { performance: performance2 } = GLOBAL_OBJ; 12393 if (!performance2 || !performance2.now) { 12394 return void 0; 12395 } 12396 const threshold = 3600 * 1e3; 12397 const performanceNow = performance2.now(); 12398 const dateNow = Date.now(); 12399 const timeOriginDelta = performance2.timeOrigin ? Math.abs(performance2.timeOrigin + performanceNow - dateNow) : threshold; 12400 const timeOriginIsReliable = timeOriginDelta < threshold; 12401 const navigationStart = performance2.timing && performance2.timing.navigationStart; 12402 const hasNavigationStart = typeof navigationStart === "number"; 12403 const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; 12404 const navigationStartIsReliable = navigationStartDelta < threshold; 12405 if (timeOriginIsReliable || navigationStartIsReliable) { 12406 if (timeOriginDelta <= navigationStartDelta) { 12407 return performance2.timeOrigin; 12408 } else { 12409 return navigationStart; 12410 } 12411 } 12412 return dateNow; 12413 })(); 12414 function uuid4() { 12415 const gbl = GLOBAL_OBJ; 12416 const crypto2 = gbl.crypto || gbl.msCrypto; 12417 let getRandomByte = () => Math.random() * 16;
12418 try { 12419 if (crypto2 && crypto2.randomUUID) { 12420 return crypto2.randomUUID().replace(/-/g, ""); 12421 } 12422 if (crypto2 && crypto2.getRandomValues) { 12423 getRandomByte = () => { 12424 const typedArray = new Uint8Array(1); 12425 crypto2.getRandomValues(typedArray); 12426 return typedArray[0]; 12427 }; 12428 } 12429 } catch (_2) { 12430 } 12431 return ("10000000100040008000" + 1e11).replace( 12432 /[018]/g, 12433 (c2) => ( 12434 // eslint-disable-next-line no-bitwise 12435 (c2 ^ (getRandomByte() & 15) >> c2 / 4).toString(16) 12436 ) 12437 ); 12438 } 12439 function getFirstException(event) { 12440 return event.exception && event.exception.values ? event.exception.values[0] : void 0; 12441 } 12442 function getEventDescription(event) { 12443 const { message, event_id: eventId } = event; 12444 if (message) { 12445 return message; 12446 } 12447 const firstException = getFirstException(event); 12448 if (firstException) { 12449 if (firstException.type && firstException.value) { 12450 return `${firstException.type}: ${firstException.value}`; 12451 } 12452 return firstException.type || firstException.value || eventId || "<unknown>"; 12453 } 12454 return eventId || "<unknown>"; 12455 } 12456 function addExceptionTypeValue(event, value, type) { 12457 const exception = event.exception = event.exception || {}; 12458 const values = exception.values = exception.values || []; 12459 const firstException = values[0] = values[0] || {}; 12460 if (!firstException.value) { 12461 firstException.value = value || ""; 12462 } 12463 if (!firstException.type) { 12464 firstException.type = "Error"; 12465 } 12466 } 12467 function addExceptionMechanism(event, newMechanism) { 12468 const firstException = getFirstException(event); 12469 if (!firstException) { 12470 return; 12471 } 12472 const defaultMechanism = { type: "generic", handled: true }; 12473 const currentMechanism = firstException.mechanism; 12474 firstException.mechanism = __spreadValues(__spreadValues(__spreadValues({}, defaultMechanism), currentMechanism), newMechanism); 12475 if (newMechanism && "data" in newMechanism) { 12476 const mergedData = __spreadValues(__spreadValues({}, currentMechanism && currentMechanism.data), newMechanism.data); 12477 firstException.mechanism.data = mergedData; 12478 } 12479 } 12480 function checkOrSetAlreadyCaught(exception) { 12481 if (isAlreadyCaptured(exception)) { 12482 return true; 12483 } 12484 try { 12485 addNonEnumerableProperty(exception, "__sentry_captured__", true); 12486 } catch (err) { 12487 } 12488 return false; 12489 } 12490 function isAlreadyCaptured(exception) { 12491 try { 12492 return exception.__sentry_captured__; 12493 } catch (e2) { 12494 } 12495 } 12496 var States; 12497 (function(States2) { 12498 const PENDING = 0; 12499 States2[States2["PENDING"] = PENDING] = "PENDING"; 12500 const RESOLVED = 1; 12501 States2[States2["RESOLVED"] = RESOLVED] = "RESOLVED"; 12502 const REJECTED = 2; 12503 States2[States2["REJECTED"] = REJECTED] = "REJECTED"; 12504 })(States || (States = {})); 12505 function resolvedSyncPromise(value) { 12506 return new SyncPromise((resolve) => { 12507 resolve(value); 12508 }); 12509 } 12510 function rejectedSyncPromise(reason) { 12511 return new SyncPromise((_2, reject) => { 12512 reject(reason); 12513 }); 12514 } 12515 class SyncPromise { 12516 constructor(executor) { 12517 SyncPromise.prototype.__init.call(this); 12518 SyncPromise.prototype.__init2.call(this); 12519 SyncPromise.prototype.__init3.call(this); 12520 SyncPromise.prototype.__init4.call(this); 12521 this._state = States.PENDING; 12522 this._handlers = []; 12523 try { 12524 executor(this._resolve, this._reject); 12525 } catch (e2) { 12526 this._reject(e2); 12527 } 12528 } 12529 /** JSDoc */ 12530 then(onfulfilled, onrejected) { 12531 return new SyncPromise((resolve, reject) => { 12532 this._handlers.push([ 12533 false, 12534 (result) => { 12535 if (!onfulfilled) { 12536 resolve(result); 12537 } else { 12538 try { 12539 resolve(onfulfilled(result)); 12540 } catch (e2) { 12541 reject(e2); 12542 } 12543 } 12544 }, 12545 (reason) => { 12546 if (!onrejected) { 12547 reject(reason); 12548 } else { 12549 try { 12550 resolve(onrejected(reason)); 12551 } catch (e2) { 12552 reject(e2); 12553 } 12554 } 12555 } 12556 ]); 12557 this._executeHandlers(); 12558 }); 12559 } 12560 /** JSDoc */ 12561 catch(onrejected) { 12562 return this.then((val) => val, onrejected); 12563 } 12564 /** JSDoc */ 12565 finally(onfinally) { 12566 return new SyncPromise((resolve, reject) => { 12567 let val; 12568 let isRejected; 12569 return this.then( 12570 (value) => { 12571 isRejected = false;
vendor: 3,044 bytes, lines 12572-12680
12572 val = value; 12573 if (onfinally) { 12574 onfinally(); 12575 } 12576 }, 12577 (reason) => { 12578 isRejected = true; 12579 val = reason; 12580 if (onfinally) { 12581 onfinally(); 12582 } 12583 } 12584 ).then(() => { 12585 if (isRejected) { 12586 reject(val); 12587 return; 12588 } 12589 resolve(val); 12590 }); 12591 }); 12592 } 12593 /** JSDoc */ 12594 __init() { 12595 this._resolve = (value) => { 12596 this._setResult(States.RESOLVED, value); 12597 }; 12598 } 12599 /** JSDoc */ 12600 __init2() { 12601 this._reject = (reason) => { 12602 this._setResult(States.REJECTED, reason); 12603 }; 12604 } 12605 /** JSDoc */ 12606 __init3() { 12607 this._setResult = (state, value) => { 12608 if (this._state !== States.PENDING) { 12609 return; 12610 } 12611 if (isThenable$1(value)) { 12612 void value.then(this._resolve, this._reject); 12613 return; 12614 } 12615 this._state = state; 12616 this._value = value; 12617 this._executeHandlers(); 12618 }; 12619 } 12620 /** JSDoc */ 12621 __init4() { 12622 this._executeHandlers = () => { 12623 if (this._state === States.PENDING) { 12624 return; 12625 } 12626 const cachedHandlers = this._handlers.slice(); 12627 this._handlers = []; 12628 cachedHandlers.forEach((handler) => { 12629 if (handler[0]) { 12630 return; 12631 } 12632 if (this._state === States.RESOLVED) { 12633 handler[1](this._value); 12634 } 12635 if (this._state === States.REJECTED) { 12636 handler[2](this._value); 12637 } 12638 handler[0] = true; 12639 }); 12640 }; 12641 } 12642 } 12643 function makeSession(context) { 12644 const startingTime = timestampInSeconds(); 12645 const session = { 12646 sid: uuid4(), 12647 init: true, 12648 timestamp: startingTime, 12649 started: startingTime, 12650 duration: 0, 12651 status: "ok", 12652 errors: 0, 12653 ignoreDuration: false, 12654 toJSON: () => sessionToJSON(session) 12655 }; 12656 if (context) { 12657 updateSession(session, context); 12658 } 12659 return session; 12660 } 12661 function updateSession(session, context = {}) { 12662 if (context.user) { 12663 if (!session.ipAddress && context.user.ip_address) { 12664 session.ipAddress = context.user.ip_address; 12665 } 12666 if (!session.did && !context.did) { 12667 session.did = context.user.id || context.user.email || context.user.username; 12668 } 12669 } 12670 session.timestamp = context.timestamp || timestampInSeconds(); 12671 if (context.abnormal_mechanism) { 12672 session.abnormal_mechanism = context.abnormal_mechanism; 12673 } 12674 if (context.ignoreDuration) { 12675 session.ignoreDuration = context.ignoreDuration; 12676 } 12677 if (context.sid) { 12678 session.sid = context.sid.length === 32 ? context.sid : uuid4(); 12679 } 12680 if (context.init !== void 0) {
12681 session.init = context.init; 12682 } 12683 if (!session.did && context.did) { 12684 session.did = `${context.did}`; 12685 } 12686 if (typeof context.started === "number") { 12687 session.started = context.started; 12688 } 12689 if (session.ignoreDuration) { 12690 session.duration = void 0; 12691 } else if (typeof context.duration === "number") { 12692 session.duration = context.duration; 12693 } else { 12694 const duration = session.timestamp - session.started; 12695 session.duration = duration >= 0 ? duration : 0; 12696 } 12697 if (context.release) { 12698 session.release = context.release; 12699 } 12700 if (context.environment) { 12701 session.environment = context.environment; 12702 } 12703 if (!session.ipAddress && context.ipAddress) { 12704 session.ipAddress = context.ipAddress; 12705 } 12706 if (!session.userAgent && context.userAgent) { 12707 session.userAgent = context.userAgent; 12708 } 12709 if (typeof context.errors === "number") { 12710 session.errors = context.errors; 12711 } 12712 if (context.status) { 12713 session.status = context.status; 12714 } 12715 } 12716 function closeSession(session, status) { 12717 let context = {}; 12718 if (session.status === "ok") { 12719 context = { status: "exited" }; 12720 } 12721 updateSession(session, context); 12722 } 12723 function sessionToJSON(session) { 12724 return dropUndefinedKeys({ 12725 sid: `${session.sid}`, 12726 init: session.init, 12727 // Make sure that sec is converted to ms for date constructor 12728 started: new Date(session.started * 1e3).toISOString(), 12729 timestamp: new Date(session.timestamp * 1e3).toISOString(), 12730 status: session.status, 12731 errors: session.errors, 12732 did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0, 12733 duration: session.duration, 12734 abnormal_mechanism: session.abnormal_mechanism, 12735 attrs: { 12736 release: session.release, 12737 environment: session.environment, 12738 ip_address: session.ipAddress, 12739 user_agent: session.userAgent 12740 } 12741 }); 12742 } 12743 function generateTraceId() { 12744 return uuid4(); 12745 } 12746 function generateSpanId() { 12747 return uuid4().substring(16); 12748 } 12749 function merge$2(initialObj, mergeObj, levels = 2) { 12750 if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) { 12751 return mergeObj; 12752 } 12753 if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { 12754 return initialObj; 12755 } 12756 const output = __spreadValues({}, initialObj); 12757 for (const key in mergeObj) { 12758 if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { 12759 output[key] = merge$2(output[key], mergeObj[key], levels - 1); 12760 } 12761 } 12762 return output; 12763 } 12764 const SCOPE_SPAN_FIELD = "_sentrySpan"; 12765 function _setSpanForScope(scope, span) { 12766 if (span) { 12767 addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span); 12768 } else { 12769 delete scope[SCOPE_SPAN_FIELD]; 12770 } 12771 } 12772 function _getSpanForScope(scope) { 12773 return scope[SCOPE_SPAN_FIELD]; 12774 } 12775 const DEFAULT_MAX_BREADCRUMBS = 100; 12776 class ScopeClass { 12777 /** Flag if notifying is happening. */ 12778 /** Callback for client to receive scope changes. */ 12779 /** Callback list that will be called during event processing. */ 12780 /** Array of breadcrumbs. */ 12781 /** User */ 12782 /** Tags */ 12783 /** Extra */ 12784 /** Contexts */ 12785 /** Attachments */ 12786 /** Propagation Context for distributed tracing */ 12787 /** 12788 * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get 12789 * sent to Sentry 12790 */ 12791 /** Fingerprint */ 12792 /** Severity */ 12793 /** 12794 * Transaction Name 12795 * 12796 * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. 12797 * It's purpose is to assign a transaction to the scope that's added to non-transaction events. 12798 */ 12799 /** Session */ 12800 /** Request Mode Session Status */ 12801 // eslint-disable-next-line deprecation/deprecation 12802 /** The client on this scope */ 12803 /** Contains the last event id of a captured event. */ 12804 // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. 12805 constructor() { 12806 this._notifyingListeners = false;
12807 this._scopeListeners = []; 12808 this._eventProcessors = []; 12809 this._breadcrumbs = []; 12810 this._attachments = []; 12811 this._user = {}; 12812 this._tags = {}; 12813 this._extra = {}; 12814 this._contexts = {}; 12815 this._sdkProcessingMetadata = {}; 12816 this._propagationContext = { 12817 traceId: generateTraceId(), 12818 spanId: generateSpanId() 12819 }; 12820 } 12821 /** 12822 * @inheritDoc 12823 */ 12824 clone() { 12825 const newScope = new ScopeClass(); 12826 newScope._breadcrumbs = [...this._breadcrumbs]; 12827 newScope._tags = __spreadValues({}, this._tags); 12828 newScope._extra = __spreadValues({}, this._extra); 12829 newScope._contexts = __spreadValues({}, this._contexts); 12830 if (this._contexts.flags) { 12831 newScope._contexts.flags = { 12832 values: [...this._contexts.flags.values] 12833 }; 12834 } 12835 newScope._user = this._user; 12836 newScope._level = this._level; 12837 newScope._session = this._session; 12838 newScope._transactionName = this._transactionName; 12839 newScope._fingerprint = this._fingerprint; 12840 newScope._eventProcessors = [...this._eventProcessors]; 12841 newScope._requestSession = this._requestSession; 12842 newScope._attachments = [...this._attachments]; 12843 newScope._sdkProcessingMetadata = __spreadValues({}, this._sdkProcessingMetadata); 12844 newScope._propagationContext = __spreadValues({}, this._propagationContext); 12845 newScope._client = this._client; 12846 newScope._lastEventId = this._lastEventId; 12847 _setSpanForScope(newScope, _getSpanForScope(this)); 12848 return newScope; 12849 } 12850 /** 12851 * @inheritDoc 12852 */ 12853 setClient(client2) { 12854 this._client = client2; 12855 } 12856 /** 12857 * @inheritDoc 12858 */ 12859 setLastEventId(lastEventId) { 12860 this._lastEventId = lastEventId; 12861 } 12862 /** 12863 * @inheritDoc 12864 */ 12865 getClient() { 12866 return this._client; 12867 } 12868 /** 12869 * @inheritDoc 12870 */ 12871 lastEventId() { 12872 return this._lastEventId; 12873 } 12874 /** 12875 * @inheritDoc 12876 */ 12877 addScopeListener(callback) { 12878 this._scopeListeners.push(callback); 12879 } 12880 /** 12881 * @inheritDoc 12882 */ 12883 addEventProcessor(callback) { 12884 this._eventProcessors.push(callback); 12885 return this; 12886 } 12887 /** 12888 * @inheritDoc 12889 */ 12890 setUser(user) { 12891 this._user = user || { 12892 email: void 0, 12893 id: void 0, 12894 ip_address: void 0, 12895 username: void 0 12896 }; 12897 if (this._session) { 12898 updateSession(this._session, { user }); 12899 } 12900 this._notifyScopeListeners(); 12901 return this; 12902 } 12903 /** 12904 * @inheritDoc 12905 */ 12906 getUser() { 12907 return this._user; 12908 } 12909 /** 12910 * @inheritDoc 12911 */ 12912 // eslint-disable-next-line deprecation/deprecation 12913 getRequestSession() { 12914 return this._requestSession; 12915 } 12916 /** 12917 * @inheritDoc 12918 */ 12919 // eslint-disable-next-line deprecation/deprecation 12920 setRequestSession(requestSession) { 12921 this._requestSession = requestSession; 12922 return this; 12923 } 12924 /** 12925 * @inheritDoc 12926 */ 12927 setTags(tags) { 12928 this._tags = __spreadValues(__spreadValues({}, this._tags), tags); 12929 this._notifyScopeListeners(); 12930 return this; 12931 } 12932 /** 12933 * @inheritDoc 12934 */ 12935 setTag(key, value) { 12936 this._tags = __spreadProps(__spreadValues({}, this._tags), { [key]: value }); 12937 this._notifyScopeListeners(); 12938 return this; 12939 } 12940 /** 12941 * @inheritDoc 12942 */ 12943 setExtras(extras) { 12944 this._extra = __spreadValues(__spreadValues({}, this._extra), extras); 12945 this._notifyScopeListeners(); 12946 return this; 12947 } 12948 /** 12949 * @inheritDoc 12950 */ 12951 setExtra(key, extra) { 12952 this._extra = __spreadProps(__spreadValues({}, this._extra), { [key]: extra }); 12953 this._notifyScopeListeners(); 12954 return this; 12955 } 12956 /** 12957 * @inheritDoc 12958 */ 12959 setFingerprint(fingerprint) { 12960 this._fingerprint = fingerprint; 12961 this._notifyScopeListeners(); 12962 return this; 12963 } 12964 /** 12965 * @inheritDoc 12966 */ 12967 setLevel(level) { 12968 this._level = level; 12969 this._notifyScopeListeners(); 12970 return this; 12971 } 12972 /** 12973 * Sets the transaction name on the scope so that the name of e.g. taken server route or 12974 * the page location is attached to future events. 12975 *
12976 * IMPORTANT: Calling this function does NOT change the name of the currently active 12977 * root span. If you want to change the name of the active root span, use 12978 * `Sentry.updateSpanName(rootSpan, 'new name')` instead. 12979 * 12980 * By default, the SDK updates the scope's transaction name automatically on sensible 12981 * occasions, such as a page navigation or when handling a new request on the server. 12982 */ 12983 setTransactionName(name) { 12984 this._transactionName = name; 12985 this._notifyScopeListeners(); 12986 return this; 12987 } 12988 /** 12989 * @inheritDoc 12990 */ 12991 setContext(key, context) { 12992 if (context === null) { 12993 delete this._contexts[key]; 12994 } else { 12995 this._contexts[key] = context; 12996 } 12997 this._notifyScopeListeners(); 12998 return this; 12999 } 13000 /** 13001 * @inheritDoc 13002 */ 13003 setSession(session) { 13004 if (!session) { 13005 delete this._session; 13006 } else { 13007 this._session = session; 13008 } 13009 this._notifyScopeListeners(); 13010 return this; 13011 } 13012 /** 13013 * @inheritDoc 13014 */ 13015 getSession() { 13016 return this._session; 13017 } 13018 /** 13019 * @inheritDoc 13020 */ 13021 update(captureContext) { 13022 if (!captureContext) { 13023 return this; 13024 } 13025 const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext; 13026 const [scopeInstance, requestSession] = scopeToMerge instanceof Scope ? ( 13027 // eslint-disable-next-line deprecation/deprecation 13028 [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] 13029 ) : isPlainObject$3(scopeToMerge) ? [captureContext, captureContext.requestSession] : []; 13030 const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; 13031 this._tags = __spreadValues(__spreadValues({}, this._tags), tags); 13032 this._extra = __spreadValues(__spreadValues({}, this._extra), extra); 13033 this._contexts = __spreadValues(__spreadValues({}, this._contexts), contexts); 13034 if (user && Object.keys(user).length) { 13035 this._user = user; 13036 } 13037 if (level) { 13038 this._level = level; 13039 } 13040 if (fingerprint.length) { 13041 this._fingerprint = fingerprint; 13042 } 13043 if (propagationContext) { 13044 this._propagationContext = propagationContext; 13045 } 13046 if (requestSession) { 13047 this._requestSession = requestSession; 13048 } 13049 return this; 13050 } 13051 /** 13052 * @inheritDoc 13053 */ 13054 clear() { 13055 this._breadcrumbs = []; 13056 this._tags = {}; 13057 this._extra = {}; 13058 this._user = {}; 13059 this._contexts = {}; 13060 this._level = void 0; 13061 this._transactionName = void 0; 13062 this._fingerprint = void 0; 13063 this._requestSession = void 0; 13064 this._session = void 0; 13065 _setSpanForScope(this, void 0); 13066 this._attachments = []; 13067 this.setPropagationContext({ traceId: generateTraceId() }); 13068 this._notifyScopeListeners(); 13069 return this; 13070 } 13071 /** 13072 * @inheritDoc 13073 */ 13074 addBreadcrumb(breadcrumb, maxBreadcrumbs) { 13075 const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; 13076 if (maxCrumbs <= 0) { 13077 return this; 13078 } 13079 const mergedBreadcrumb = __spreadValues({ 13080 timestamp: dateTimestampInSeconds() 13081 }, breadcrumb); 13082 this._breadcrumbs.push(mergedBreadcrumb); 13083 if (this._breadcrumbs.length > maxCrumbs) { 13084 this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); 13085 if (this._client) { 13086 this._client.recordDroppedEvent("buffer_overflow", "log_item"); 13087 } 13088 } 13089 this._notifyScopeListeners(); 13090 return this; 13091 } 13092 /** 13093 * @inheritDoc 13094 */ 13095 getLastBreadcrumb() { 13096 return this._breadcrumbs[this._breadcrumbs.length - 1]; 13097 } 13098 /** 13099 * @inheritDoc 13100 */ 13101 clearBreadcrumbs() { 13102 this._breadcrumbs = []; 13103 this._notifyScopeListeners(); 13104 return this; 13105 } 13106 /** 13107 * @inheritDoc 13108 */ 13109 addAttachment(attachment) { 13110 this._attachments.push(attachment); 13111 return this; 13112 } 13113 /** 13114 * @inheritDoc 13115 */ 13116 clearAttachments() { 13117 this._attachments = []; 13118 return this; 13119 } 13120 /** @inheritDoc */ 13121 getScopeData() { 13122 return { 13123 breadcrumbs: this._breadcrumbs, 13124 attachments: this._attachments, 13125 contexts: this._contexts, 13126 tags: this._tags, 13127 extra: this._extra, 13128 user: this._user, 13129 level: this._level, 13130 fingerprint: this._fingerprint || [], 13131 eventProcessors: this._eventProcessors, 13132 propagationContext: this._propagationContext, 13133 sdkProcessingMetadata: this._sdkProcessingMetadata, 13134 transactionName: this._transactionName, 13135 span: _getSpanForScope(this) 13136 }; 13137 } 13138 /** 13139 * @inheritDoc 13140 */ 13141 setSDKProcessingMetadata(newData) { 13142 this._sdkProcessingMetadata = merge$2(this._sdkProcessingMetadata, newData, 2); 13143 return this; 13144 } 13145 /** 13146 * @inheritDoc 13147 */ 13148 setPropagationContext(context) { 13149 this._propagationContext = __spreadValues({ 13150 // eslint-disable-next-line deprecation/deprecation 13151 spanId: generateSpanId() 13152 }, context); 13153 return this; 13154 } 13155 /** 13156 * @inheritDoc 13157 */ 13158 getPropagationContext() { 13159 return this._propagationContext; 13160 } 13161 /** 13162 * @inheritDoc 13163 */ 13164 captureException(exception, hint) { 13165 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13166 if (!this._client) { 13167 logger.warn("No client configured on scope - will not capture exception!"); 13168 return eventId; 13169 } 13170 const syntheticException = new Error("Sentry syntheticException"); 13171 this._client.captureException( 13172 exception, 13173 __spreadProps(__spreadValues({ 13174 originalException: exception, 13175 syntheticException 13176 }, hint), { 13177 event_id: eventId 13178 }), 13179 this 13180 ); 13181 return eventId; 13182 } 13183 /** 13184 * @inheritDoc 13185 */ 13186 captureMessage(message, level, hint) { 13187 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13188 if (!this._client) { 13189 logger.warn("No client configured on scope - will not capture message!"); 13190 return eventId; 13191 } 13192 const syntheticException = new Error(message); 13193 this._client.captureMessage( 13194 message, 13195 level, 13196 __spreadProps(__spreadValues({ 13197 originalException: message, 13198 syntheticException 13199 }, hint), { 13200 event_id: eventId 13201 }), 13202 this 13203 ); 13204 return eventId; 13205 } 13206 /** 13207 * @inheritDoc 13208 */ 13209 captureEvent(event, hint) { 13210 const eventId = hint && hint.event_id ? hint.event_id : uuid4(); 13211 if (!this._client) { 13212 logger.warn("No client configured on scope - will not capture event!"); 13213 return eventId; 13214 } 13215 this._client.captureEvent(event, __spreadProps(__spreadValues({}, hint), { event_id: eventId }), this); 13216 return eventId; 13217 } 13218 /** 13219 * This will be called on every set call. 13220 */ 13221 _notifyScopeListeners() { 13222 if (!this._notifyingListeners) { 13223 this._notifyingListeners = true;
13224 this._scopeListeners.forEach((callback) => { 13225 callback(this); 13226 }); 13227 this._notifyingListeners = false; 13228 } 13229 } 13230 } 13231 const Scope = ScopeClass; 13232 function getDefaultCurrentScope() { 13233 return getGlobalSingleton("defaultCurrentScope", () => new Scope()); 13234 } 13235 function getDefaultIsolationScope() { 13236 return getGlobalSingleton("defaultIsolationScope", () => new Scope()); 13237 } 13238 class AsyncContextStack { 13239 constructor(scope, isolationScope) { 13240 let assignedScope; 13241 if (!scope) { 13242 assignedScope = new Scope(); 13243 } else { 13244 assignedScope = scope; 13245 } 13246 let assignedIsolationScope; 13247 if (!isolationScope) { 13248 assignedIsolationScope = new Scope(); 13249 } else { 13250 assignedIsolationScope = isolationScope; 13251 } 13252 this._stack = [{ scope: assignedScope }]; 13253 this._isolationScope = assignedIsolationScope; 13254 } 13255 /** 13256 * Fork a scope for the stack. 13257 */ 13258 withScope(callback) { 13259 const scope = this._pushScope(); 13260 let maybePromiseResult; 13261 try { 13262 maybePromiseResult = callback(scope); 13263 } catch (e2) { 13264 this._popScope(); 13265 throw e2; 13266 } 13267 if (isThenable$1(maybePromiseResult)) { 13268 return maybePromiseResult.then( 13269 (res) => { 13270 this._popScope(); 13271 return res; 13272 }, 13273 (e2) => { 13274 this._popScope(); 13275 throw e2; 13276 } 13277 ); 13278 } 13279 this._popScope(); 13280 return maybePromiseResult; 13281 } 13282 /** 13283 * Get the client of the stack. 13284 */ 13285 getClient() { 13286 return this.getStackTop().client; 13287 } 13288 /** 13289 * Returns the scope of the top stack. 13290 */ 13291 getScope() { 13292 return this.getStackTop().scope; 13293 } 13294 /** 13295 * Get the isolation scope for the stack. 13296 */ 13297 getIsolationScope() { 13298 return this._isolationScope; 13299 } 13300 /** 13301 * Returns the topmost scope layer in the order domain > local > process. 13302 */ 13303 getStackTop() { 13304 return this._stack[this._stack.length - 1]; 13305 } 13306 /** 13307 * Push a scope to the stack. 13308 */ 13309 _pushScope() { 13310 const scope = this.getScope().clone(); 13311 this._stack.push({ 13312 client: this.getClient(), 13313 scope 13314 }); 13315 return scope; 13316 } 13317 /** 13318 * Pop a scope from the stack. 13319 */ 13320 _popScope() { 13321 if (this._stack.length <= 1) return false; 13322 return !!this._stack.pop(); 13323 } 13324 } 13325 function getAsyncContextStack() { 13326 const registry = getMainCarrier(); 13327 const sentry = getSentryCarrier(registry); 13328 return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()); 13329 } 13330 function withScope$1(callback) { 13331 return getAsyncContextStack().withScope(callback); 13332 } 13333 function withSetScope(scope, callback) { 13334 const stack = getAsyncContextStack(); 13335 return stack.withScope(() => { 13336 stack.getStackTop().scope = scope; 13337 return callback(scope); 13338 }); 13339 } 13340 function withIsolationScope(callback) { 13341 return getAsyncContextStack().withScope(() => { 13342 return callback(getAsyncContextStack().getIsolationScope()); 13343 }); 13344 } 13345 function getStackAsyncContextStrategy() { 13346 return { 13347 withIsolationScope, 13348 withScope: withScope$1, 13349 withSetScope, 13350 withSetIsolationScope: (_isolationScope, callback) => { 13351 return withIsolationScope(callback); 13352 }, 13353 getCurrentScope: () => getAsyncContextStack().getScope(), 13354 getIsolationScope: () => getAsyncContextStack().getIsolationScope() 13355 }; 13356 } 13357 function getAsyncContextStrategy(carrier) { 13358 const sentry = getSentryCarrier(carrier); 13359 if (sentry.acs) { 13360 return sentry.acs; 13361 } 13362 return getStackAsyncContextStrategy(); 13363 } 13364 function getCurrentScope() { 13365 const carrier = getMainCarrier(); 13366 const acs = getAsyncContextStrategy(carrier); 13367 return acs.getCurrentScope(); 13368 } 13369 function getIsolationScope() { 13370 const carrier = getMainCarrier(); 13371 const acs = getAsyncContextStrategy(carrier); 13372 return acs.getIsolationScope(); 13373 } 13374 function getGlobalScope() { 13375 return getGlobalSingleton("globalScope", () => new Scope()); 13376 } 13377 function withScope(...rest) { 13378 const carrier = getMainCarrier(); 13379 const acs = getAsyncContextStrategy(carrier); 13380 if (rest.length === 2) { 13381 const [scope, callback] = rest; 13382 if (!scope) { 13383 return acs.withScope(callback); 13384 } 13385 return acs.withSetScope(scope, callback); 13386 } 13387 return acs.withScope(rest[0]); 13388 } 13389 function getClient() { 13390 return getCurrentScope().getClient(); 13391 } 13392 function getTraceContextFromScope(scope) { 13393 const propagationContext = scope.getPropagationContext(); 13394 const { traceId, spanId, parentSpanId } = propagationContext; 13395 const traceContext = dropUndefinedKeys({ 13396 trace_id: traceId, 13397 span_id: spanId, 13398 parent_span_id: parentSpanId 13399 }); 13400 return traceContext; 13401 } 13402 const METRICS_SPAN_FIELD = "_sentryMetrics"; 13403 function getMetricSummaryJsonForSpan(span) { 13404 const storage = span[METRICS_SPAN_FIELD]; 13405 if (!storage) { 13406 return void 0; 13407 } 13408 const output = {}; 13409 for (const [, [exportKey, summary]] of storage) { 13410 const arr = output[exportKey] || (output[exportKey] = []); 13411 arr.push(dropUndefinedKeys(summary)); 13412 } 13413 return output; 13414 } 13415 const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source"; 13416 const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate"; 13417 const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op"; 13418 const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin"; 13419 const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry.idle_span_finish_reason"; 13420 const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit"; 13421 const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value"; 13422 const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name"; 13423 const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id"; 13424 const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time"; 13425 const SPAN_STATUS_UNSET = 0; 13426 const SPAN_STATUS_OK = 1; 13427 const SPAN_STATUS_ERROR = 2; 13428 function getSpanStatusFromHttpCode(httpStatus) { 13429 if (httpStatus < 400 && httpStatus >= 100) { 13430 return { code: SPAN_STATUS_OK }; 13431 } 13432 if (httpStatus >= 400 && httpStatus < 500) { 13433 switch (httpStatus) { 13434 case 401: 13435 return { code: SPAN_STATUS_ERROR, message: "unauthenticated" }; 13436 case 403: 13437 return { code: SPAN_STATUS_ERROR, message: "permission_denied" }; 13438 case 404: 13439 return { code: SPAN_STATUS_ERROR, message: "not_found" }; 13440 case 409: 13441 return { code: SPAN_STATUS_ERROR, message: "already_exists" }; 13442 case 413: 13443 return { code: SPAN_STATUS_ERROR, message: "failed_precondition" }; 13444 case 429: 13445 return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" }; 13446 case 499: 13447 return { code: SPAN_STATUS_ERROR, message: "cancelled" }; 13448 default:
13449 return { code: SPAN_STATUS_ERROR, message: "invalid_argument" }; 13450 } 13451 } 13452 if (httpStatus >= 500 && httpStatus < 600) { 13453 switch (httpStatus) { 13454 case 501: 13455 return { code: SPAN_STATUS_ERROR, message: "unimplemented" }; 13456 case 503: 13457 return { code: SPAN_STATUS_ERROR, message: "unavailable" }; 13458 case 504: 13459 return { code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }; 13460 default: 13461 return { code: SPAN_STATUS_ERROR, message: "internal_error" }; 13462 } 13463 } 13464 return { code: SPAN_STATUS_ERROR, message: "unknown_error" }; 13465 } 13466 function setHttpStatus(span, httpStatus) { 13467 span.setAttribute("http.response.status_code", httpStatus); 13468 const spanStatus = getSpanStatusFromHttpCode(httpStatus); 13469 if (spanStatus.message !== "unknown_error") { 13470 span.setStatus(spanStatus); 13471 } 13472 } 13473 const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-"; 13474 const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; 13475 const MAX_BAGGAGE_STRING_LENGTH = 8192; 13476 function baggageHeaderToDynamicSamplingContext(baggageHeader) { 13477 const baggageObject = parseBaggageHeader(baggageHeader); 13478 if (!baggageObject) { 13479 return void 0; 13480 } 13481 const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { 13482 if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { 13483 const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); 13484 acc[nonPrefixedKey] = value; 13485 } 13486 return acc; 13487 }, {}); 13488 if (Object.keys(dynamicSamplingContext).length > 0) { 13489 return dynamicSamplingContext; 13490 } else { 13491 return void 0; 13492 } 13493 } 13494 function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) { 13495 if (!dynamicSamplingContext) { 13496 return void 0; 13497 } 13498 const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( 13499 (acc, [dscKey, dscValue]) => { 13500 if (dscValue) { 13501 acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; 13502 } 13503 return acc; 13504 }, 13505 {} 13506 ); 13507 return objectToBaggageHeader(sentryPrefixedDSC); 13508 } 13509 function parseBaggageHeader(baggageHeader) { 13510 if (!baggageHeader || !isString$2(baggageHeader) && !Array.isArray(baggageHeader)) { 13511 return void 0; 13512 } 13513 if (Array.isArray(baggageHeader)) { 13514 return baggageHeader.reduce((acc, curr) => { 13515 const currBaggageObject = baggageHeaderToObject(curr); 13516 Object.entries(currBaggageObject).forEach(([key, value]) => { 13517 acc[key] = value; 13518 }); 13519 return acc; 13520 }, {}); 13521 } 13522 return baggageHeaderToObject(baggageHeader); 13523 } 13524 function baggageHeaderToObject(baggageHeader) { 13525 return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => decodeURIComponent(keyOrValue.trim()))).reduce((acc, [key, value]) => { 13526 if (key && value) { 13527 acc[key] = value; 13528 } 13529 return acc; 13530 }, {}); 13531 } 13532 function objectToBaggageHeader(object2) { 13533 if (Object.keys(object2).length === 0) { 13534 return void 0; 13535 } 13536 return Object.entries(object2).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { 13537 const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; 13538 const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; 13539 if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { 13540 DEBUG_BUILD$2 && logger.warn( 13541 `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.` 13542 ); 13543 return baggageHeader; 13544 } else { 13545 return newBaggageHeader; 13546 } 13547 }, ""); 13548 } 13549 const TRACEPARENT_REGEXP = new RegExp( 13550 "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$" 13551 // whitespace 13552 ); 13553 function extractTraceparentData(traceparent) { 13554 if (!traceparent) { 13555 return void 0; 13556 } 13557 const matches2 = traceparent.match(TRACEPARENT_REGEXP); 13558 if (!matches2) { 13559 return void 0; 13560 } 13561 let parentSampled; 13562 if (matches2[3] === "1") { 13563 parentSampled = true; 13564 } else if (matches2[3] === "0") { 13565 parentSampled = false;
13566 } 13567 return { 13568 traceId: matches2[1], 13569 parentSampled, 13570 parentSpanId: matches2[2] 13571 }; 13572 } 13573 function propagationContextFromHeaders(sentryTrace, baggage) { 13574 const traceparentData = extractTraceparentData(sentryTrace); 13575 const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage); 13576 if (!traceparentData || !traceparentData.traceId) { 13577 return { traceId: generateTraceId(), spanId: generateSpanId() }; 13578 } 13579 const { traceId, parentSpanId, parentSampled } = traceparentData; 13580 const virtualSpanId = generateSpanId(); 13581 return { 13582 traceId, 13583 parentSpanId, 13584 spanId: virtualSpanId, 13585 sampled: parentSampled, 13586 dsc: dynamicSamplingContext || {} 13587 // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it 13588 }; 13589 } 13590 function generateSentryTraceHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) { 13591 let sampledString = ""; 13592 if (sampled !== void 0) { 13593 sampledString = sampled ? "-1" : "-0"; 13594 } 13595 return `${traceId}-${spanId}${sampledString}`; 13596 } 13597 const TRACE_FLAG_NONE = 0; 13598 const TRACE_FLAG_SAMPLED = 1; 13599 let hasShownSpanDropWarning = false; 13600 function spanToTransactionTraceContext(span) { 13601 const { spanId: span_id, traceId: trace_id } = span.spanContext(); 13602 const { data, op, parent_span_id, status, origin: origin2 } = spanToJSON(span); 13603 return dropUndefinedKeys({ 13604 parent_span_id, 13605 span_id, 13606 trace_id, 13607 data, 13608 op, 13609 status, 13610 origin: origin2 13611 }); 13612 } 13613 function spanToTraceContext(span) { 13614 const { spanId, traceId: trace_id, isRemote } = span.spanContext(); 13615 const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; 13616 const span_id = isRemote ? generateSpanId() : spanId; 13617 return dropUndefinedKeys({ 13618 parent_span_id, 13619 span_id, 13620 trace_id 13621 }); 13622 } 13623 function spanToTraceHeader(span) { 13624 const { traceId, spanId } = span.spanContext(); 13625 const sampled = spanIsSampled(span); 13626 return generateSentryTraceHeader(traceId, spanId, sampled); 13627 } 13628 function spanTimeInputToSeconds(input) { 13629 if (typeof input === "number") { 13630 return ensureTimestampInSeconds(input); 13631 } 13632 if (Array.isArray(input)) { 13633 return input[0] + input[1] / 1e9; 13634 } 13635 if (input instanceof Date) { 13636 return ensureTimestampInSeconds(input.getTime()); 13637 } 13638 return timestampInSeconds(); 13639 } 13640 function ensureTimestampInSeconds(timestamp) { 13641 const isMs = timestamp > 9999999999; 13642 return isMs ? timestamp / 1e3 : timestamp; 13643 } 13644 function spanToJSON(span) { 13645 if (spanIsSentrySpan(span)) { 13646 return span.getSpanJSON(); 13647 } 13648 try { 13649 const { spanId: span_id, traceId: trace_id } = span.spanContext(); 13650 if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { 13651 const { attributes, startTime, name, endTime, parentSpanId, status } = span; 13652 return dropUndefinedKeys({ 13653 span_id, 13654 trace_id, 13655 data: attributes, 13656 description: name, 13657 parent_span_id: parentSpanId, 13658 start_timestamp: spanTimeInputToSeconds(startTime), 13659 // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time 13660 timestamp: spanTimeInputToSeconds(endTime) || void 0, 13661 status: getStatusMessage(status), 13662 op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], 13663 origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], 13664 _metrics_summary: getMetricSummaryJsonForSpan(span) 13665 }); 13666 } 13667 return { 13668 span_id, 13669 trace_id 13670 }; 13671 } catch (e2) { 13672 return {}; 13673 } 13674 } 13675 function spanIsOpenTelemetrySdkTraceBaseSpan(span) { 13676 const castSpan = span; 13677 return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; 13678 } 13679 function spanIsSentrySpan(span) { 13680 return typeof span.getSpanJSON === "function"; 13681 } 13682 function spanIsSampled(span) { 13683 const { traceFlags } = span.spanContext(); 13684 return traceFlags === TRACE_FLAG_SAMPLED; 13685 } 13686 function getStatusMessage(status) { 13687 if (!status || status.code === SPAN_STATUS_UNSET) { 13688 return void 0; 13689 } 13690 if (status.code === SPAN_STATUS_OK) { 13691 return "ok"; 13692 } 13693 return status.message || "unknown_error"; 13694 } 13695 const CHILD_SPANS_FIELD = "_sentryChildSpans"; 13696 const ROOT_SPAN_FIELD = "_sentryRootSpan"; 13697 function addChildSpanToSpan(span, childSpan) { 13698 const rootSpan = span[ROOT_SPAN_FIELD] || span; 13699 addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan); 13700 if (span[CHILD_SPANS_FIELD]) { 13701 span[CHILD_SPANS_FIELD].add(childSpan); 13702 } else { 13703 addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__P
13703URE__ */ new Set([childSpan])); 13704 } 13705 } 13706 function removeChildSpanFromSpan(span, childSpan) { 13707 if (span[CHILD_SPANS_FIELD]) { 13708 span[CHILD_SPANS_FIELD].delete(childSpan); 13709 } 13710 } 13711 function getSpanDescendants(span) { 13712 const resultSet = /* @__PURE__ */ new Set(); 13713 function addSpanChildren(span2) { 13714 if (resultSet.has(span2)) { 13715 return; 13716 } else if (spanIsSampled(span2)) { 13717 resultSet.add(span2); 13718 const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : []; 13719 for (const childSpan of childSpans) { 13720 addSpanChildren(childSpan); 13721 } 13722 } 13723 } 13724 addSpanChildren(span); 13725 return Array.from(resultSet); 13726 } 13727 function getRootSpan(span) { 13728 return span[ROOT_SPAN_FIELD] || span; 13729 } 13730 function getActiveSpan() { 13731 const carrier = getMainCarrier(); 13732 const acs = getAsyncContextStrategy(carrier); 13733 if (acs.getActiveSpan) { 13734 return acs.getActiveSpan(); 13735 } 13736 return _getSpanForScope(getCurrentScope()); 13737 } 13738 function showSpanDropWarning() { 13739 if (!hasShownSpanDropWarning) { 13740 consoleSandbox(() => { 13741 console.warn( 13742 "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly." 13743 ); 13744 }); 13745 hasShownSpanDropWarning = true; 13746 } 13747 } 13748 let errorsInstrumented = false; 13749 function registerSpanErrorInstrumentation() { 13750 if (errorsInstrumented) { 13751 return; 13752 } 13753 errorsInstrumented = true; 13754 addGlobalErrorInstrumentationHandler(errorCallback); 13755 addGlobalUnhandledRejectionInstrumentationHandler(errorCallback); 13756 } 13757 function errorCallback() { 13758 const activeSpan = getActiveSpan(); 13759 const rootSpan = activeSpan && getRootSpan(activeSpan); 13760 if (rootSpan) { 13761 const message = "internal_error"; 13762 DEBUG_BUILD$3 && logger.log(`[Tracing] Root span: ${message} -> Global error occurred`); 13763 rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message }); 13764 } 13765 } 13766 errorCallback.tag = "sentry_tracingErrorCallback"; 13767 const SCOPE_ON_START_SPAN_FIELD = "_sentryScope"; 13768 const ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope"; 13769 function setCapturedScopesOnSpan(span, scope, isolationScope) { 13770 if (span) { 13771 addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); 13772 addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); 13773 } 13774 } 13775 function getCapturedScopesOnSpan(span) { 13776 return { 13777 scope: span[SCOPE_ON_START_SPAN_FIELD], 13778 isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD] 13779 }; 13780 } 13781 function hasTracingEnabled(maybeOptions) { 13782 if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) { 13783 return false; 13784 } 13785 const client2 = getClient(); 13786 const options2 = maybeOptions || client2 && client2.getOptions(); 13787 return !!options2 && (options2.enableTracing || "tracesSampleRate" in options2 || "tracesSampler" in options2); 13788 } 13789 class SentryNonRecordingSpan { 13790 constructor(spanContext = {}) { 13791 this._traceId = spanContext.traceId || generateTraceId(); 13792 this._spanId = spanContext.spanId || generateSpanId(); 13793 } 13794 /** @inheritdoc */ 13795 spanContext() { 13796 return { 13797 spanId: this._spanId, 13798 traceId: this._traceId, 13799 traceFlags: TRACE_FLAG_NONE 13800 }; 13801 } 13802 /** @inheritdoc */ 13803 // eslint-disable-next-line @typescript-eslint/no-empty-function 13804 end(_timestamp) { 13805 } 13806 /** @inheritdoc */ 13807 setAttribute(_key, _value) { 13808 return this; 13809 } 13810 /** @inheritdoc */ 13811 setAttributes(_values) { 13812 return this; 13813 } 13814 /** @inheritdoc */ 13815 setStatus(_status) { 13816 return this; 13817 } 13818 /** @inheritdoc */ 13819 updateName(_name) { 13820 return this; 13821 } 13822 /** @inheritdoc */ 13823 isRecording() { 13824 return false;
13825 } 13826 /** @inheritdoc */ 13827 addEvent(_name, _attributesOrStartTime, _startTime) { 13828 return this; 13829 } 13830 /** 13831 * This should generally not be used, 13832 * but we need it for being compliant with the OTEL Span interface. 13833 * 13834 * @hidden 13835 * @internal 13836 */ 13837 addLink(_link) { 13838 return this; 13839 } 13840 /** 13841 * This should generally not be used, 13842 * but we need it for being compliant with the OTEL Span interface. 13843 * 13844 * @hidden 13845 * @internal 13846 */ 13847 addLinks(_links) { 13848 return this; 13849 } 13850 /** 13851 * This should generally not be used, 13852 * but we need it for being compliant with the OTEL Span interface. 13853 * 13854 * @hidden 13855 * @internal 13856 */ 13857 recordException(_exception, _time) { 13858 } 13859 } 13860 const DEFAULT_ENVIRONMENT = "production"; 13861 const FROZEN_DSC_FIELD = "_frozenDsc"; 13862 function freezeDscOnSpan(span, dsc) { 13863 const spanWithMaybeDsc = span; 13864 addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); 13865 } 13866 function getDynamicSamplingContextFromClient(trace_id, client2) { 13867 const options2 = client2.getOptions(); 13868 const { publicKey: public_key } = client2.getDsn() || {}; 13869 const dsc = dropUndefinedKeys({ 13870 environment: options2.environment || DEFAULT_ENVIRONMENT, 13871 release: options2.release, 13872 public_key, 13873 trace_id 13874 }); 13875 client2.emit("createDsc", dsc); 13876 return dsc; 13877 } 13878 function getDynamicSamplingContextFromScope(client2, scope) { 13879 const propagationContext = scope.getPropagationContext(); 13880 return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client2); 13881 } 13882 function getDynamicSamplingContextFromSpan(span) { 13883 const client2 = getClient(); 13884 if (!client2) { 13885 return {}; 13886 } 13887 const rootSpan = getRootSpan(span); 13888 const frozenDsc = rootSpan[FROZEN_DSC_FIELD]; 13889 if (frozenDsc) { 13890 return frozenDsc; 13891 } 13892 const traceState = rootSpan.spanContext().traceState; 13893 const traceStateDsc = traceState && traceState.get("sentry.dsc"); 13894 const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc); 13895 if (dscOnTraceState) { 13896 return dscOnTraceState; 13897 } 13898 const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client2); 13899 const jsonSpan = spanToJSON(rootSpan); 13900 const attributes = jsonSpan.data || {}; 13901 const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; 13902 if (maybeSampleRate != null) { 13903 dsc.sample_rate = `${maybeSampleRate}`; 13904 } 13905 const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 13906 const name = jsonSpan.description; 13907 if (source !== "url" && name) { 13908 dsc.transaction = name; 13909 } 13910 if (hasTracingEnabled()) { 13911 dsc.sampled = String(spanIsSampled(rootSpan)); 13912 } 13913 client2.emit("createDsc", dsc, rootSpan); 13914 return dsc; 13915 } 13916 function logSpanStart(span) { 13917 if (!DEBUG_BUILD$3) return; 13918 const { description = "< unknown name >", op = "< unknown op >", parent_span_id: parentSpanId } = spanToJSON(span); 13919 const { spanId } = span.spanContext(); 13920 const sampled = spanIsSampled(span); 13921 const rootSpan = getRootSpan(span); 13922 const isRootSpan = rootSpan === span; 13923 const header = `[Tracing] Starting ${sampled ? "sampled" : "unsampled"} ${isRootSpan ? "root " : ""}span`; 13924 const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; 13925 if (parentSpanId) { 13926 infoParts.push(`parent ID: ${parentSpanId}`); 13927 } 13928 if (!isRootSpan) { 13929 const { op: op2, description: description2 } = spanToJSON(rootSpan); 13930 infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); 13931 if (op2) { 13932 infoParts.push(`root op: ${op2}`); 13933 } 13934 if (description2) { 13935 infoParts.push(`root description: ${description2}`); 13936 } 13937 } 13938 logger.log(`${header} 13939 ${infoParts.join("\n ")}`); 13940 } 13941 function logSpanEnd(span) { 13942 if (!DEBUG_BUILD$3) return; 13943 const { description = "< unknown name >", op = "< unknown op >" } = spanToJSON(span); 13944 const { spanId } = span.spanContext(); 13945 const rootSpan = getRootSpan(span); 13946 const isRootSpan = rootSpan === span; 13947 const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? "root " : ""}span "${description}" with ID ${spanId}`; 13948 logger.log(msg); 13949 } 13950 function parseSampleRate(sampleRate) { 13951 if (typeof sampleRate === "boolean") { 13952 return Number(sampleRate); 13953 } 13954 const rate = typeof sampleRate === "string" ? parseFloat(sampleRate) : sampleRate;
13955 if (typeof rate !== "number" || isNaN(rate) || rate < 0 || rate > 1) { 13956 DEBUG_BUILD$3 && logger.warn( 13957 `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( 13958 sampleRate 13959 )} of type ${JSON.stringify(typeof sampleRate)}.` 13960 ); 13961 return void 0; 13962 } 13963 return rate; 13964 } 13965 function sampleSpan(options2, samplingContext) { 13966 if (!hasTracingEnabled(options2)) { 13967 return [false]; 13968 } 13969 const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest; 13970 const enhancedSamplingContext = __spreadProps(__spreadValues({}, samplingContext), { 13971 normalizedRequest: samplingContext.normalizedRequest || normalizedRequest 13972 }); 13973 let sampleRate; 13974 if (typeof options2.tracesSampler === "function") { 13975 sampleRate = options2.tracesSampler(enhancedSamplingContext); 13976 } else if (enhancedSamplingContext.parentSampled !== void 0) { 13977 sampleRate = enhancedSamplingContext.parentSampled; 13978 } else if (typeof options2.tracesSampleRate !== "undefined") { 13979 sampleRate = options2.tracesSampleRate; 13980 } else { 13981 sampleRate = 1; 13982 } 13983 const parsedSampleRate = parseSampleRate(sampleRate); 13984 if (parsedSampleRate === void 0) { 13985 DEBUG_BUILD$3 && logger.warn("[Tracing] Discarding transaction because of invalid sample rate."); 13986 return [false]; 13987 } 13988 if (!parsedSampleRate) { 13989 DEBUG_BUILD$3 && logger.log( 13990 `[Tracing] Discarding transaction because ${typeof options2.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}` 13991 ); 13992 return [false, parsedSampleRate]; 13993 } 13994 const shouldSample = Math.random() < parsedSampleRate; 13995 if (!shouldSample) { 13996 DEBUG_BUILD$3 && logger.log( 13997 `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( 13998 sampleRate 13999 )})` 14000 ); 14001 return [false, parsedSampleRate]; 14002 } 14003 return [true, parsedSampleRate]; 14004 } 14005 const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; 14006 function isValidProtocol(protocol) { 14007 return protocol === "http" || protocol === "https"; 14008 } 14009 function dsnToString(dsn, withPassword = false) { 14010 const { host, path, pass, port, projectId, protocol, publicKey } = dsn; 14011 return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`; 14012 } 14013 function dsnFromString(str) { 14014 const match2 = DSN_REGEX.exec(str); 14015 if (!match2) { 14016 consoleSandbox(() => { 14017 console.error(`Invalid Sentry Dsn: ${str}`); 14018 }); 14019 return void 0; 14020 } 14021 const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match2.slice(1); 14022 let path = ""; 14023 let projectId = lastPath; 14024 const split = projectId.split("/"); 14025 if (split.length > 1) { 14026 path = split.slice(0, -1).join("/"); 14027 projectId = split.pop(); 14028 } 14029 if (projectId) { 14030 const projectMatch = projectId.match(/^\d+/); 14031 if (projectMatch) { 14032 projectId = projectMatch[0]; 14033 } 14034 } 14035 return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey }); 14036 } 14037 function dsnFromComponents(components2) { 14038 return { 14039 protocol: components2.protocol, 14040 publicKey: components2.publicKey || "", 14041 pass: components2.pass || "", 14042 host: components2.host, 14043 port: components2.port || "", 14044 path: components2.path || "", 14045 projectId: components2.projectId 14046 }; 14047 } 14048 function validateDsn(dsn) { 14049 if (!DEBUG_BUILD$2) { 14050 return true; 14051 } 14052 const { port, projectId, protocol } = dsn; 14053 const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; 14054 const hasMissingRequiredComponent = requiredComponents.find((component) => { 14055 if (!dsn[component]) { 14056 logger.error(`Invalid Sentry Dsn: ${component} missing`); 14057 return true; 14058 } 14059 return false;
14060 }); 14061 if (hasMissingRequiredComponent) { 14062 return false; 14063 } 14064 if (!projectId.match(/^\d+$/)) { 14065 logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); 14066 return false; 14067 } 14068 if (!isValidProtocol(protocol)) { 14069 logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); 14070 return false; 14071 } 14072 if (port && isNaN(parseInt(port, 10))) { 14073 logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); 14074 return false; 14075 } 14076 return true; 14077 } 14078 function makeDsn(from2) { 14079 const components2 = typeof from2 === "string" ? dsnFromString(from2) : dsnFromComponents(from2); 14080 if (!components2 || !validateDsn(components2)) { 14081 return void 0; 14082 } 14083 return components2; 14084 } 14085 function memoBuilder() { 14086 const hasWeakSet = typeof WeakSet === "function"; 14087 const inner = hasWeakSet ? /* @__PURE__ */ new WeakSet() : []; 14088 function memoize2(obj) { 14089 if (hasWeakSet) { 14090 if (inner.has(obj)) { 14091 return true; 14092 } 14093 inner.add(obj); 14094 return false; 14095 } 14096 for (let i2 = 0; i2 < inner.length; i2++) { 14097 const value = inner[i2]; 14098 if (value === obj) { 14099 return true; 14100 } 14101 } 14102 inner.push(obj); 14103 return false; 14104 } 14105 function unmemoize(obj) { 14106 if (hasWeakSet) { 14107 inner.delete(obj); 14108 } else { 14109 for (let i2 = 0; i2 < inner.length; i2++) { 14110 if (inner[i2] === obj) { 14111 inner.splice(i2, 1); 14112 break; 14113 } 14114 } 14115 } 14116 } 14117 return [memoize2, unmemoize]; 14118 } 14119 function normalize(input, depth = 100, maxProperties = Infinity) { 14120 try { 14121 return visit("", input, depth, maxProperties); 14122 } catch (err) { 14123 return { ERROR: `**non-serializable** (${err})` }; 14124 } 14125 } 14126 function normalizeToSize(object2, depth = 3, maxSize = 100 * 1024) { 14127 const normalized = normalize(object2, depth); 14128 if (jsonSize(normalized) > maxSize) { 14129 return normalizeToSize(object2, depth - 1, maxSize); 14130 } 14131 return normalized; 14132 } 14133 function visit(key, value, depth = Infinity, maxProperties = Infinity, memo2 = memoBuilder()) { 14134 const [memoize2, unmemoize] = memo2; 14135 if (value == null || // this matches null and undefined -> eqeq not eqeqeq 14136 ["boolean", "string"].includes(typeof value) || typeof value === "number" && Number.isFinite(value)) { 14137 return value; 14138 } 14139 const stringified = stringifyValue$1(key, value); 14140 if (!stringified.startsWith("[object ")) { 14141 return stringified; 14142 } 14143 if (value["__sentry_skip_normalization__"]) { 14144 return value; 14145 } 14146 const remainingDepth = typeof value["__sentry_override_normalization_depth__"] === "number" ? value["__sentry_override_normalization_depth__"] : depth; 14147 if (remainingDepth === 0) { 14148 return stringified.replace("object ", ""); 14149 } 14150 if (memoize2(value)) { 14151 return "[Circular ~]"; 14152 } 14153 const valueWithToJSON = value; 14154 if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { 14155 try { 14156 const jsonValue = valueWithToJSON.toJSON(); 14157 return visit("", jsonValue, remainingDepth - 1, maxProperties, memo2); 14158 } catch (err) { 14159 } 14160 } 14161 const normalized = Array.isArray(value) ? [] : {}; 14162 let numAdded = 0; 14163 const visitable = convertToPlainObject(value); 14164 for (const visitKey in visitable) { 14165 if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { 14166 continue; 14167 } 14168 if (numAdded >= maxProperties) { 14169 normalized[visitKey] = "[MaxProperties ~]"; 14170 break; 14171 } 14172 const visitValue = visitable[visitKey]; 14173 normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo2); 14174 numAdded++; 14175 } 14176 unmemoize(value); 14177 return normalized; 14178 } 14179 function stringifyValue$1(key, value) { 14180 try { 14181 if (key === "domain" && value && typeof value === "object" && value._events) { 14182 return "[Domain]"; 14183 } 14184 if (key === "domainEmitter") { 14185 return "[DomainEmitter]"; 14186 } 14187 if (typeof global !== "undefined" && value === global) { 14188 return "[Global]"; 14189 } 14190 if (typeof window !== "undefined" && value === window) { 14191 return "[Window]"; 14192 } 14193 if (typeof document !== "undefined" && value === document) { 14194 return "[Document]"; 14195 } 14196 if (isVueViewModel(value)) { 14197 return "[VueViewModel]"; 14198 } 14199 if (isSyntheticEvent(value)) { 14200 return "[SyntheticEvent]"; 14201 } 14202 if (typeof value === "number" && !Number.isFinite(value)) { 14203 return `[${value}]`; 14204 } 14205 if (typeof value === "function") { 14206 return `[Function: ${getFunctionName(value)}]`; 14207 } 14208 if (typeof value === "symbol") { 14209 return `[${String(value)}]`; 14210 } 14211 if (typeof value === "bigint") { 14212 return `[BigInt: ${String(value)}]`; 14213 } 14214 const objName = getConstructorName(value); 14215 if (/^HTML(\w*)Element$/.test(objName)) { 14216 return `[HTMLElement: ${objName}]`; 14217 } 14218 return `[object ${objName}]`; 14219 } catch (err) { 14220 return `**non-serializable** (${err})`; 14221 } 14222 } 14223 function getConstructorName(value) { 14224 const prototype2 = Object.getPrototypeOf(value); 14225 return prototype2 ? prototype2.constructor.name : "null prototype"; 14226 } 14227 function utf8Length(value) { 14228 return ~-encodeURI(value).split(/%..|./).length; 14229 } 14230 function jsonSize(value) { 14231 return utf8Length(JSON.stringify(value)); 14232 } 14233 function createEnvelope(headers, items = []) { 14234 return [headers, items]; 14235 } 14236 function addItemToEnvelope(envelope, newItem) { 14237 const [headers, items] = envelope; 14238 return [headers, [...items, newItem]]; 14239 } 14240 function forEachEnvelopeItem(envelope, callback) { 14241 const envelopeItems = envelope[1]; 14242 for (const envelopeItem of envelopeItems) { 14243 const envelopeItemType = envelopeItem[0].type; 14244 const result = callback(envelopeItem, envelopeItemType); 14245 if (result) { 14246 return true; 14247 } 14248 } 14249 return false;
14250 } 14251 function encodeUTF8(input) { 14252 return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) : new TextEncoder().encode(input); 14253 } 14254 function serializeEnvelope(envelope) { 14255 const [envHeaders, items] = envelope; 14256 let parts = JSON.stringify(envHeaders); 14257 function append2(next2) { 14258 if (typeof parts === "string") { 14259 parts = typeof next2 === "string" ? parts + next2 : [encodeUTF8(parts), next2]; 14260 } else { 14261 parts.push(typeof next2 === "string" ? encodeUTF8(next2) : next2); 14262 } 14263 } 14264 for (const item of items) { 14265 const [itemHeaders, payload] = item; 14266 append2(` 14267${JSON.stringify(itemHeaders)} 14268`); 14269 if (typeof payload === "string" || payload instanceof Uint8Array) { 14270 append2(payload); 14271 } else { 14272 let stringifiedPayload; 14273 try { 14274 stringifiedPayload = JSON.stringify(payload); 14275 } catch (e2) { 14276 stringifiedPayload = JSON.stringify(normalize(payload)); 14277 } 14278 append2(stringifiedPayload); 14279 } 14280 } 14281 return typeof parts === "string" ? parts : concatBuffers(parts); 14282 } 14283 function concatBuffers(buffers) { 14284 const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); 14285 const merged = new Uint8Array(totalLength); 14286 let offset2 = 0; 14287 for (const buffer of buffers) { 14288 merged.set(buffer, offset2); 14289 offset2 += buffer.length; 14290 } 14291 return merged; 14292 } 14293 function createSpanEnvelopeItem(spanJson) { 14294 const spanHeaders = { 14295 type: "span" 14296 }; 14297 return [spanHeaders, spanJson]; 14298 } 14299 function createAttachmentEnvelopeItem(attachment) { 14300 const buffer = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data; 14301 return [ 14302 dropUndefinedKeys({ 14303 type: "attachment", 14304 length: buffer.length, 14305 filename: attachment.filename, 14306 content_type: attachment.contentType, 14307 attachment_type: attachment.attachmentType 14308 }), 14309 buffer 14310 ]; 14311 } 14312 const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { 14313 session: "session", 14314 sessions: "session", 14315 attachment: "attachment", 14316 transaction: "transaction", 14317 event: "error", 14318 client_report: "internal", 14319 user_report: "default", 14320 profile: "profile", 14321 profile_chunk: "profile", 14322 replay_event: "replay", 14323 replay_recording: "replay", 14324 check_in: "monitor", 14325 feedback: "feedback", 14326 span: "span", 14327 statsd: "metric_bucket", 14328 raw_security: "security" 14329 }; 14330 function envelopeItemTypeToDataCategory(type) { 14331 return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; 14332 } 14333 function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { 14334 if (!metadataOrEvent || !metadataOrEvent.sdk) { 14335 return; 14336 } 14337 const { name, version } = metadataOrEvent.sdk; 14338 return { name, version }; 14339 } 14340 function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) { 14341 const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; 14342 return __spreadValues(__spreadValues(__spreadValues({ 14343 event_id: event.event_id, 14344 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14345 }, sdkInfo && { sdk: sdkInfo }), !!tunnel && dsn && { dsn: dsnToString(dsn) }), dynamicSamplingContext && { 14346 trace: dropUndefinedKeys(__spreadValues({}, dynamicSamplingContext)) 14347 }); 14348 } 14349 function enhanceEventWithSdkInfo(event, sdkInfo) { 14350 if (!sdkInfo) { 14351 return event; 14352 } 14353 event.sdk = event.sdk || {}; 14354 event.sdk.name = event.sdk.name || sdkInfo.name; 14355 event.sdk.version = event.sdk.version || sdkInfo.version; 14356 event.sdk.integrations = [...event.sdk.integrations || [], ...sdkInfo.integrations || []]; 14357 event.sdk.packages = [...event.sdk.packages || [], ...sdkInfo.packages || []]; 14358 return event; 14359 } 14360 function createSessionEnvelope(session, dsn, metadata, tunnel) { 14361 const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); 14362 const envelopeHeaders = __spreadValues(__spreadValues({ 14363 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14364 }, sdkInfo && { sdk: sdkInfo }), !!tunnel && dsn && { dsn: dsnToString(dsn) }); 14365 const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]; 14366 return createEnvelope(envelopeHeaders, [envelopeItem]); 14367 } 14368 function createEventEnvelope(event, dsn, metadata, tunnel) { 14369 const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata); 14370 const eventType = event.type && event.type !== "replay_event" ? event.type : "event";
14371 enhanceEventWithSdkInfo(event, metadata && metadata.sdk); 14372 const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); 14373 delete event.sdkProcessingMetadata; 14374 const eventItem = [{ type: eventType }, event]; 14375 return createEnvelope(envelopeHeaders, [eventItem]); 14376 } 14377 function createSpanEnvelope(spans, client2) { 14378 function dscHasRequiredProps(dsc2) { 14379 return !!dsc2.trace_id && !!dsc2.public_key; 14380 } 14381 const dsc = getDynamicSamplingContextFromSpan(spans[0]); 14382 const dsn = client2 && client2.getDsn(); 14383 const tunnel = client2 && client2.getOptions().tunnel; 14384 const headers = __spreadValues(__spreadValues({ 14385 sent_at: (/* @__PURE__ */ new Date()).toISOString() 14386 }, dscHasRequiredProps(dsc) && { trace: dsc }), !!tunnel && dsn && { dsn: dsnToString(dsn) }); 14387 const beforeSendSpan = client2 && client2.getOptions().beforeSendSpan; 14388 const convertToSpanJSON = beforeSendSpan ? (span) => { 14389 const spanJson = beforeSendSpan(spanToJSON(span)); 14390 if (!spanJson) { 14391 showSpanDropWarning(); 14392 }
14393 return spanJson; 14394 } : (span) => spanToJSON(span); 14395 const items = []; 14396 for (const span of spans) { 14397 const spanJson = convertToSpanJSON(span); 14398 if (spanJson) { 14399 items.push(createSpanEnvelopeItem(spanJson)); 14400 } 14401 } 14402 return createEnvelope(headers, items); 14403 } 14404 function setMeasurement(name, value, unit, activeSpan = getActiveSpan()) { 14405 const rootSpan = activeSpan && getRootSpan(activeSpan); 14406 if (rootSpan) { 14407 DEBUG_BUILD$3 && logger.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); 14408 rootSpan.addEvent(name, { 14409 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value, 14410 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit 14411 }); 14412 } 14413 } 14414 function timedEventsToMeasurements(events) { 14415 if (!events || events.length === 0) { 14416 return void 0; 14417 } 14418 const measurements = {}; 14419 events.forEach((event) => { 14420 const attributes = event.attributes || {}; 14421 const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]; 14422 const value = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]; 14423 if (typeof unit === "string" && typeof value === "number") { 14424 measurements[event.name] = { value, unit }; 14425 } 14426 }); 14427 return measurements; 14428 } 14429 const MAX_SPAN_COUNT = 1e3; 14430 class SentrySpan { 14431 /** Epoch timestamp in seconds when the span started. */ 14432 /** Epoch timestamp in seconds when the span ended. */ 14433 /** Internal keeper of the status */ 14434 /** The timed events added to this span. */ 14435 /** if true, treat span as a standalone span (not part of a transaction) */ 14436 /** 14437 * You should never call the constructor manually, always use `Sentry.startSpan()` 14438 * or other span methods. 14439 * @internal 14440 * @hideconstructor 14441 * @hidden 14442 */ 14443 constructor(spanContext = {}) { 14444 this._traceId = spanContext.traceId || generateTraceId(); 14445 this._spanId = spanContext.spanId || generateSpanId(); 14446 this._startTime = spanContext.startTimestamp || timestampInSeconds(); 14447 this._attributes = {}; 14448 this.setAttributes(__spreadValues({ 14449 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "manual", 14450 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op 14451 }, spanContext.attributes)); 14452 this._name = spanContext.name; 14453 if (spanContext.parentSpanId) { 14454 this._parentSpanId = spanContext.parentSpanId; 14455 } 14456 if ("sampled" in spanContext) { 14457 this._sampled = spanContext.sampled; 14458 } 14459 if (spanContext.endTimestamp) { 14460 this._endTime = spanContext.endTimestamp; 14461 } 14462 this._events = []; 14463 this._isStandaloneSpan = spanContext.isStandalone; 14464 if (this._endTime) { 14465 this._onSpanEnded(); 14466 } 14467 } 14468 /** 14469 * This should generally not be used, 14470 * but it is needed for being compliant with the OTEL Span interface. 14471 * 14472 * @hidden 14473 * @internal 14474 */ 14475 addLink(_link) { 14476 return this; 14477 } 14478 /** 14479 * This should generally not be used, 14480 * but it is needed for being compliant with the OTEL Span interface. 14481 * 14482 * @hidden 14483 * @internal 14484 */ 14485 addLinks(_links) { 14486 return this; 14487 } 14488 /** 14489 * This should generally not be used, 14490 * but it is needed for being compliant with the OTEL Span interface. 14491 * 14492 * @hidden 14493 * @internal 14494 */ 14495 recordException(_exception, _time) { 14496 } 14497 /** @inheritdoc */ 14498 spanContext() { 14499 const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; 14500 return { 14501 spanId, 14502 traceId, 14503 traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE 14504 }; 14505 } 14506 /** @inheritdoc */ 14507 setAttribute(key, value) { 14508 if (value === void 0) { 14509 delete this._attributes[key]; 14510 } else { 14511 this._attributes[key] = value; 14512 } 14513 return this; 14514 } 14515 /** @inheritdoc */ 14516 setAttributes(attributes) {
14517 Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key])); 14518 return this; 14519 } 14520 /** 14521 * This should generally not be used, 14522 * but we need it for browser tracing where we want to adjust the start time afterwards. 14523 * USE THIS WITH CAUTION! 14524 * 14525 * @hidden 14526 * @internal 14527 */ 14528 updateStartTime(timeInput) { 14529 this._startTime = spanTimeInputToSeconds(timeInput); 14530 } 14531 /** 14532 * @inheritDoc 14533 */ 14534 setStatus(value) { 14535 this._status = value; 14536 return this; 14537 } 14538 /** 14539 * @inheritDoc 14540 */ 14541 updateName(name) { 14542 this._name = name; 14543 this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom"); 14544 return this; 14545 } 14546 /** @inheritdoc */ 14547 end(endTimestamp) { 14548 if (this._endTime) { 14549 return; 14550 } 14551 this._endTime = spanTimeInputToSeconds(endTimestamp); 14552 logSpanEnd(this); 14553 this._onSpanEnded(); 14554 } 14555 /** 14556 * Get JSON representation of this span. 14557 * 14558 * @hidden 14559 * @internal This method is purely for internal purposes and should not be used outside 14560 * of SDK code. If you need to get a JSON representation of a span, 14561 * use `spanToJSON(span)` instead. 14562 */ 14563 getSpanJSON() { 14564 return dropUndefinedKeys({ 14565 data: this._attributes, 14566 description: this._name, 14567 op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP], 14568 parent_span_id: this._parentSpanId, 14569 span_id: this._spanId, 14570 start_timestamp: this._startTime, 14571 status: getStatusMessage(this._status), 14572 timestamp: this._endTime, 14573 trace_id: this._traceId, 14574 origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], 14575 _metrics_summary: getMetricSummaryJsonForSpan(this), 14576 profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID], 14577 exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME], 14578 measurements: timedEventsToMeasurements(this._events), 14579 is_segment: this._isStandaloneSpan && getRootSpan(this) === this || void 0, 14580 segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : void 0 14581 }); 14582 } 14583 /** @inheritdoc */ 14584 isRecording() { 14585 return !this._endTime && !!this._sampled; 14586 } 14587 /** 14588 * @inheritdoc 14589 */ 14590 addEvent(name, attributesOrStartTime, startTime) { 14591 DEBUG_BUILD$3 && logger.log("[Tracing] Adding an event to span:", name); 14592 const time2 = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds(); 14593 const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; 14594 const event = { 14595 name, 14596 time: spanTimeInputToSeconds(time2), 14597 attributes 14598 }; 14599 this._events.push(event); 14600 return this; 14601 } 14602 /** 14603 * This method should generally not be used, 14604 * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. 14605 * USE THIS WITH CAUTION! 14606 * @internal 14607 * @hidden 14608 * @experimental 14609 */ 14610 isStandaloneSpan() { 14611 return !!this._isStandaloneSpan; 14612 } 14613 /** Emit `spanEnd` when the span is ended. */ 14614 _onSpanEnded() { 14615 const client2 = getClient(); 14616 if (client2) { 14617 client2.emit("spanEnd", this); 14618 } 14619 const isSegmentSpan = this._isStandaloneSpan || this === getRootSpan(this); 14620 if (!isSegmentSpan) { 14621 return; 14622 } 14623 if (this._isStandaloneSpan) { 14624 if (this._sampled) { 14625 sendSpanEnvelope(createSpanEnvelope([this], client2)); 14626 } else { 14627 DEBUG_BUILD$3 && logger.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."); 14628 if (client2) { 14629 client2.recordDroppedEvent("sample_rate", "span"); 14630 } 14631 } 14632 return; 14633 } 14634 const transactionEvent = this._convertSpanToTransaction(); 14635 if (transactionEvent) { 14636 const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope(); 14637 scope.captureEvent(transactionEvent); 14638 } 14639 } 14640 /** 14641 * Finish the transaction & prepare the event to send to Sentry. 14642 */ 14643 _convertSpanToTransaction() { 14644 if (!isFullFinishedSpan(spanToJSON(this))) { 14645 return void 0; 14646 } 14647 if (!this._name) { 14648 DEBUG_BUILD$3 && logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."); 14649 this._name = "<unlabeled transaction>"; 14650 } 14651 const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this); 14652 const scope = capturedSpanScope || getCurrentScope(); 14653 const client2 = scope.getClient() || getClient(); 14654 if (this._sampled !== true) { 14655 DEBUG_BUILD$3 && logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."); 14656 if (client2) { 14657 client2.recordDroppedEvent("sample_rate", "transaction"); 14658 } 14659 return void 0; 14660 } 14661 const finishedSpans = getSpanDescendants(this).filter((span) => span !== this && !isStandaloneSpan(span)); 14662 const spans = finishedSpans.map((span) => spanToJSON(span)).filter(isFullFinishedSpan); 14663 const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 14664 delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; 14665 spans.forEach((span) => { 14666 span.data && delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; 14667 }); 14668 const transaction = __spreadValues({ 14669 contexts: { 14670 trace: spanToTransactionTraceContext(this) 14671 }, 14672 spans: ( 14673 // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here 14674 // we do not use spans anymore after this point 14675 spans.length > MAX_SPAN_COUNT ? spans.sort((a2, b2) => a2.start_timestamp - b2.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans 14676 ), 14677 start_timestamp: this._startTime, 14678 timestamp: this._endTime, 14679 transaction: this._name, 14680 type: "transaction", 14681 sdkProcessingMetadata: __spreadValues({ 14682 capturedSpanScope, 14683 capturedSpanIsolationScope 14684 }, dropUndefinedKeys({ 14685 dynamicSamplingContext: getDynamicSamplingContextFromSpan(this) 14686 })), 14687 _metrics_summary: getMetricSummaryJsonForSpan(this) 14688 }, source && { 14689 transaction_info: { 14690 source 14691 } 14692 }); 14693 const measurements = timedEventsToMeasurements(this._events); 14694 const hasMeasurements = measurements && Object.keys(measurements).length; 14695 if (hasMeasurements) { 14696 DEBUG_BUILD$3 && logger.log( 14697 "[Measurements] Adding measurements to transaction event", 14698 JSON.stringify(measurements, void 0, 2) 14699 ); 14700 transaction.measurements = measurements; 14701 } 14702 return transaction; 14703 } 14704 } 14705 function isSpanTimeInput(value) { 14706 return value && typeof value === "number" || value instanceof Date || Array.isArray(value); 14707 } 14708 function isFullFinishedSpan(input) { 14709 return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; 14710 } 14711 function isStandaloneSpan(span) { 14712 return span instanceof SentrySpan && span.isStandaloneSpan(); 14713 } 14714 function sendSpanEnvelope(envelope) { 14715 const client2 = getClient(); 14716 if (!client2) { 14717 return; 14718 } 14719 const spanItems = envelope[1]; 14720 if (!spanItems || spanItems.length === 0) { 14721 client2.recordDroppedEvent("before_send", "span"); 14722 return; 14723 } 14724 client2.sendEnvelope(envelope); 14725 } 14726 const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__"; 14727 function startInactiveSpan(options2) { 14728 const acs = getAcs(); 14729 if (acs.startInactiveSpan) { 14730 return acs.startInactiveSpan(options2); 14731 } 14732 const spanArguments = parseSentrySpanArguments(options2); 14733 const { forceTransaction, parentSpan: customParentSpan } = options2; 14734 const wrapper = options2.scope ? (callback) => withScope(options2.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback(); 14735 return wrapper(() => { 14736 const scope = getCurrentScope(); 14737 const parentSpan = getParentSpan(scope); 14738 const shouldSkipSpan = options2.onlyIfParent && !parentSpan; 14739 if (shouldSkipSpan) { 14740 return new SentryNonRecordingSpan(); 14741 } 14742 return createChildOrRootSpan({ 14743 parentSpan, 14744 spanArguments, 14745 forceTransaction, 14746 scope 14747 }); 14748 }); 14749 } 14750 function withActiveSpan(span, callback) { 14751 const acs = getAcs(); 14752 if (acs.withActiveSpan) { 14753 return acs.withActiveSpan(span, callback); 14754 } 14755 return withScope((scope) => { 14756 _setSpanForScope(scope, span || void 0); 14757 return callback(scope); 14758 }); 14759 } 14760 function createChildOrRootSpan({ 14761 parentSpan, 14762 spanArguments, 14763 forceTransaction, 14764 scope 14765 }) { 14766 if (!hasTracingEnabled()) { 14767 return new SentryNonRecordingSpan(); 14768 } 14769 const isolationScope = getIsolationScope(); 14770 let span; 14771 if (parentSpan && !forceTransaction) { 14772 span = _startChildSpan(parentSpan, scope, spanArguments); 14773 addChildSpanToSpan(parentSpan, span); 14774 } else if (parentSpan) { 14775 const dsc = getDynamicSamplingContextFromSpan(parentSpan); 14776 const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); 14777 const parentSampled = spanIsSampled(parentSpan); 14778 span = _startRootSpan( 14779 __spreadValues({ 14780 traceId, 14781 parentSpanId 14782 }, spanArguments), 14783 scope, 14784 parentSampled 14785 ); 14786 freezeDscOnSpan(span, dsc); 14787 } else { 14788 const { 14789 traceId, 14790 dsc, 14791 parentSpanId, 14792 sampled: parentSampled 14793 } = __spreadValues(__spreadValues({}, isolationScope.getPropagationContext()), scope.getPropagationContext()); 14794 span = _startRootSpan( 14795 __spreadValues({ 14796 traceId, 14797 parentSpanId 14798 }, spanArguments), 14799 scope, 14800 parentSampled 14801 ); 14802 if (dsc) { 14803 freezeDscOnSpan(span, dsc); 14804 } 14805 } 14806 logSpanStart(span); 14807 setCapturedScopesOnSpan(span, scope, isolationScope); 14808 return span; 14809 } 14810 function parseSentrySpanArguments(options2) { 14811 const exp = options2.experimental || {}; 14812 const initialCtx = __spreadValues({ 14813 isStandalone: exp.standalone 14814 }, options2); 14815 if (options2.startTime) { 14816 const ctx = __spreadValues({}, initialCtx); 14817 ctx.startTimestamp = spanTimeInputToSeconds(options2.startTime); 14818 delete ctx.startTime; 14819 return ctx; 14820 } 14821 return initialCtx; 14822 } 14823 function getAcs() { 14824 const carrier = getMainCarrier(); 14825 return getAsyncContextStrategy(carrier); 14826 } 14827 function _startRootSpan(spanArguments, scope, parentSampled) { 14828 const client2 = getClient(); 14829 const options2 = client2 && client2.getOptions() || {}; 14830 const { name = "", attributes } = spanArguments; 14831 const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? [false] : sampleSpan(options2, { 14832 name, 14833 parentSampled, 14834 attributes, 14835 transactionContext: { 14836 name, 14837 parentSampled 14838 } 14839 }); 14840 const rootSpan = new SentrySpan(__spreadProps(__spreadValues({}, spanArguments), { 14841 attributes: __spreadValues({ 14842 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom" 14843 }, spanArguments.attributes), 14844 sampled 14845 })); 14846 if (sampleRate !== void 0) { 14847 rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); 14848 } 14849 if (client2) { 14850 client2.emit("spanStart", rootSpan); 14851 } 14852 return rootSpan; 14853 } 14854 function _startChildSpan(parentSpan, scope, spanArguments) { 14855 const { spanId, traceId } = parentSpan.spanContext(); 14856 const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanIsSampled(parentSpan); 14857 const childSpan = sampled ? new SentrySpan(__spreadProps(__spreadValues({}, spanArguments), { 14858 parentSpanId: spanId, 14859 traceId, 14860 sampled 14861 })) : new SentryNonRecordingSpan({ traceId }); 14862 addChildSpanToSpan(parentSpan, childSpan); 14863 const client2 = getClient(); 14864 if (client2) { 14865 client2.emit("spanStart", childSpan); 14866 if (spanArguments.endTimestamp) { 14867 client2.emit("spanEnd", childSpan); 14868 } 14869 } 14870 return childSpan; 14871 } 14872 function getParentSpan(scope) { 14873 const span = _getSpanForScope(scope); 14874 if (!span) { 14875 return void 0; 14876 } 14877 const client2 = getClient(); 14878 const options2 = client2 ? client2.getOptions() : {}; 14879 if (options2.parentSpanIsAlwaysRootSpan) { 14880 return getRootSpan(span); 14881 } 14882 return span; 14883 } 14884 const TRACING_DEFAULTS = { 14885 idleTimeout: 1e3, 14886 finalTimeout: 3e4, 14887 childSpanTimeout: 15e3 14888 }; 14889 const FINISH_REASON_HEARTBEAT_FAILED = "heartbeatFailed"; 14890 const FINISH_REASON_IDLE_TIMEOUT = "idleTimeout"; 14891 const FINISH_REASON_FINAL_TIMEOUT = "finalTimeout"; 14892 const FINISH_REASON_EXTERNAL_FINISH = "externalFinish";
14893 function startIdleSpan(startSpanOptions, options2 = {}) { 14894 const activities = /* @__PURE__ */ new Map(); 14895 let _finished = false; 14896 let _idleTimeoutID; 14897 let _finishReason = FINISH_REASON_EXTERNAL_FINISH; 14898 let _autoFinishAllowed = !options2.disableAutoFinish; 14899 const _cleanupHooks = []; 14900 const { 14901 idleTimeout = TRACING_DEFAULTS.idleTimeout, 14902 finalTimeout = TRACING_DEFAULTS.finalTimeout, 14903 childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, 14904 beforeSpanEnd 14905 } = options2; 14906 const client2 = getClient(); 14907 if (!client2 || !hasTracingEnabled()) { 14908 return new SentryNonRecordingSpan(); 14909 } 14910 const scope = getCurrentScope(); 14911 const previousActiveSpan = getActiveSpan(); 14912 const span = _startIdleSpan(startSpanOptions); 14913 span.end = new Proxy(span.end, { 14914 apply(target, thisArg, args) { 14915 if (beforeSpanEnd) { 14916 beforeSpanEnd(span); 14917 } 14918 const [definedEndTimestamp, ...rest] = args; 14919 const timestamp = definedEndTimestamp || timestampInSeconds(); 14920 const spanEndTimestamp = spanTimeInputToSeconds(timestamp); 14921 const spans = getSpanDescendants(span).filter((child) => child !== span); 14922 if (!spans.length) { 14923 onIdleSpanEnded(spanEndTimestamp); 14924 return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]); 14925 } 14926 const childEndTimestamps = spans.map((span2) => spanToJSON(span2).timestamp).filter((timestamp2) => !!timestamp2); 14927 const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : void 0; 14928 const spanStartTimestamp = spanToJSON(span).start_timestamp; 14929 const endTimestamp = Math.min( 14930 spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1e3 : Infinity, 14931 Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)) 14932 ); 14933 onIdleSpanEnded(endTimestamp); 14934 return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); 14935 } 14936 }); 14937 function _cancelIdleTimeout() { 14938 if (_idleTimeoutID) { 14939 clearTimeout(_idleTimeoutID); 14940 _idleTimeoutID = void 0; 14941 } 14942 } 14943 function _restartIdleTimeout(endTimestamp) { 14944 _cancelIdleTimeout(); 14945 _idleTimeoutID = setTimeout(() => { 14946 if (!_finished && activities.size === 0 && _autoFinishAllowed) { 14947 _finishReason = FINISH_REASON_IDLE_TIMEOUT; 14948 span.end(endTimestamp); 14949 } 14950 }, idleTimeout); 14951 } 14952 function _restartChildSpanTimeout(endTimestamp) { 14953 _idleTimeoutID = setTimeout(() => { 14954 if (!_finished && _autoFinishAllowed) { 14955 _finishReason = FINISH_REASON_HEARTBEAT_FAILED; 14956 span.end(endTimestamp); 14957 } 14958 }, childSpanTimeout); 14959 } 14960 function _pushActivity(spanId) { 14961 _cancelIdleTimeout(); 14962 activities.set(spanId, true); 14963 const endTimestamp = timestampInSeconds(); 14964 _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3); 14965 } 14966 function _popActivity(spanId) { 14967 if (activities.has(spanId)) { 14968 activities.delete(spanId); 14969 } 14970 if (activities.size === 0) { 14971 const endTimestamp = timestampInSeconds(); 14972 _restartIdleTimeout(endTimestamp + idleTimeout / 1e3); 14973 } 14974 } 14975 function onIdleSpanEnded(endTimestamp) { 14976 _finished = true; 14977 activities.clear(); 14978 _cleanupHooks.forEach((cleanup) => cleanup()); 14979 _setSpanForScope(scope, previousActiveSpan); 14980 const spanJSON = spanToJSON(span); 14981 const { start_timestamp: startTimestamp } = spanJSON; 14982 if (!startTimestamp) { 14983 return; 14984 } 14985 const attributes = spanJSON.data || {}; 14986 if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { 14987 span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); 14988 } 14989 logger.log(`[Tracing] Idle span "${spanJSON.op}" finished`); 14990 const childSpans = getSpanDescendants(span).filter((child) => child !== span); 14991 let discardedSpans = 0; 14992 childSpans.forEach((childSpan) => { 14993 if (childSpan.isRecording()) { 14994 childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "cancelled" });
14995 childSpan.end(endTimestamp); 14996 DEBUG_BUILD$3 && logger.log("[Tracing] Cancelling span since span ended early", JSON.stringify(childSpan, void 0, 2)); 14997 } 14998 const childSpanJSON = spanToJSON(childSpan); 14999 const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; 15000 const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; 15001 const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3; 15002 const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; 15003 if (DEBUG_BUILD$3) { 15004 const stringifiedSpan = JSON.stringify(childSpan, void 0, 2); 15005 if (!spanStartedBeforeIdleSpanEnd) { 15006 logger.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan); 15007 } else if (!spanEndedBeforeFinalTimeout) { 15008 logger.log("[Tracing] Discarding span since it finished after idle span final timeout", stringifiedSpan); 15009 } 15010 } 15011 if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { 15012 removeChildSpanFromSpan(span, childSpan); 15013 discardedSpans++; 15014 } 15015 }); 15016 if (discardedSpans > 0) { 15017 span.setAttribute("sentry.idle_span_discarded_spans", discardedSpans); 15018 } 15019 } 15020 _cleanupHooks.push( 15021 client2.on("spanStart", (startedSpan) => { 15022 if (_finished || startedSpan === span || !!spanToJSON(startedSpan).timestamp) { 15023 return; 15024 } 15025 const allSpans = getSpanDescendants(span); 15026 if (allSpans.includes(startedSpan)) { 15027 _pushActivity(startedSpan.spanContext().spanId); 15028 } 15029 }) 15030 ); 15031 _cleanupHooks.push( 15032 client2.on("spanEnd", (endedSpan) => { 15033 if (_finished) { 15034 return; 15035 } 15036 _popActivity(endedSpan.spanContext().spanId); 15037 }) 15038 ); 15039 _cleanupHooks.push( 15040 client2.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => { 15041 if (spanToAllowAutoFinish === span) { 15042 _autoFinishAllowed = true; 15043 _restartIdleTimeout(); 15044 if (activities.size) { 15045 _restartChildSpanTimeout(); 15046 } 15047 } 15048 }) 15049 ); 15050 if (!options2.disableAutoFinish) { 15051 _restartIdleTimeout(); 15052 } 15053 setTimeout(() => { 15054 if (!_finished) { 15055 span.setStatus({ code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }); 15056 _finishReason = FINISH_REASON_FINAL_TIMEOUT; 15057 span.end(); 15058 } 15059 }, finalTimeout); 15060 return span; 15061 } 15062 function _startIdleSpan(options2) { 15063 const span = startInactiveSpan(options2); 15064 _setSpanForScope(getCurrentScope(), span); 15065 DEBUG_BUILD$3 && logger.log("[Tracing] Started span is an idle span"); 15066 return span; 15067 } 15068 function notifyEventProcessors(processors, event, hint, index2 = 0) { 15069 return new SyncPromise((resolve, reject) => { 15070 const processor = processors[index2]; 15071 if (event === null || typeof processor !== "function") { 15072 resolve(event); 15073 } else { 15074 const result = processor(__spreadValues({}, event), hint); 15075 DEBUG_BUILD$3 && processor.id && result === null && logger.log(`Event processor "${processor.id}" dropped event`); 15076 if (isThenable$1(result)) { 15077 void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve)).then(null, reject); 15078 } else { 15079 void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve).then(null, reject); 15080 } 15081 } 15082 }); 15083 } 15084 let parsedStackResults; 15085 let lastKeysCount;
15086 let cachedFilenameDebugIds; 15087 function getFilenameToDebugIdMap(stackParser) { 15088 const debugIdMap = GLOBAL_OBJ._sentryDebugIds; 15089 if (!debugIdMap) { 15090 return {}; 15091 } 15092 const debugIdKeys = Object.keys(debugIdMap); 15093 if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { 15094 return cachedFilenameDebugIds; 15095 } 15096 lastKeysCount = debugIdKeys.length; 15097 cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { 15098 if (!parsedStackResults) { 15099 parsedStackResults = {}; 15100 } 15101 const result = parsedStackResults[stackKey]; 15102 if (result) { 15103 acc[result[0]] = result[1]; 15104 } else { 15105 const parsedStack = stackParser(stackKey); 15106 for (let i2 = parsedStack.length - 1; i2 >= 0; i2--) { 15107 const stackFrame = parsedStack[i2]; 15108 const filename = stackFrame && stackFrame.filename; 15109 const debugId = debugIdMap[stackKey]; 15110 if (filename && debugId) { 15111 acc[filename] = debugId; 15112 parsedStackResults[stackKey] = [filename, debugId]; 15113 break; 15114 } 15115 } 15116 } 15117 return acc; 15118 }, {}); 15119 return cachedFilenameDebugIds; 15120 } 15121 function applyScopeDataToEvent(event, data) { 15122 const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; 15123 applyDataToEvent(event, data); 15124 if (span) { 15125 applySpanToEvent(event, span); 15126 } 15127 applyFingerprintToEvent(event, fingerprint); 15128 applyBreadcrumbsToEvent(event, breadcrumbs); 15129 applySdkMetadataToEvent(event, sdkProcessingMetadata); 15130 } 15131 function mergeScopeData(data, mergeData) { 15132 const { 15133 extra, 15134 tags, 15135 user, 15136 contexts, 15137 level, 15138 sdkProcessingMetadata, 15139 breadcrumbs, 15140 fingerprint, 15141 eventProcessors, 15142 attachments, 15143 propagationContext, 15144 transactionName, 15145 span 15146 } = mergeData; 15147 mergeAndOverwriteScopeData(data, "extra", extra); 15148 mergeAndOverwriteScopeData(data, "tags", tags); 15149 mergeAndOverwriteScopeData(data, "user", user); 15150 mergeAndOverwriteScopeData(data, "contexts", contexts); 15151 data.sdkProcessingMetadata = merge$2(data.sdkProcessingMetadata, sdkProcessingMetadata, 2); 15152 if (level) { 15153 data.level = level; 15154 } 15155 if (transactionName) { 15156 data.transactionName = transactionName; 15157 } 15158 if (span) { 15159 data.span = span; 15160 } 15161 if (breadcrumbs.length) { 15162 data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs]; 15163 } 15164 if (fingerprint.length) { 15165 data.fingerprint = [...data.fingerprint, ...fingerprint]; 15166 } 15167 if (eventProcessors.length) { 15168 data.eventProcessors = [...data.eventProcessors, ...eventProcessors]; 15169 } 15170 if (attachments.length) { 15171 data.attachments = [...data.attachments, ...attachments]; 15172 } 15173 data.propagationContext = __spreadValues(__spreadValues({}, data.propagationContext), propagationContext); 15174 } 15175 function mergeAndOverwriteScopeData(data, prop, mergeVal) { 15176 data[prop] = merge$2(data[prop], mergeVal, 1); 15177 } 15178 function applyDataToEvent(event, data) { 15179 const { extra, tags, user, contexts, level, transactionName } = data; 15180 const cleanedExtra = dropUndefinedKeys(extra); 15181 if (cleanedExtra && Object.keys(cleanedExtra).length) { 15182 event.extra = __spreadValues(__spreadValues({}, cleanedExtra), event.extra); 15183 } 15184 const cleanedTags = dropUndefinedKeys(tags); 15185 if (cleanedTags && Object.keys(cleanedTags).length) { 15186 event.tags = __spreadValues(__spreadValues({}, cleanedTags), event.tags); 15187 } 15188 const cleanedUser = dropUndefinedKeys(user); 15189 if (cleanedUser && Object.keys(cleanedUser).length) { 15190 event.user = __spreadValues(__spreadValues({}, cleanedUser), event.user); 15191 } 15192 const cleanedContexts = dropUndefinedKeys(contexts); 15193 if (cleanedContexts && Object.keys(cleanedContexts).length) { 15194 event.contexts = __spreadValues(__spreadValues({}, cleanedContexts), event.contexts); 15195 } 15196 if (level) { 15197 event.level = level; 15198 } 15199 if (transactionName && event.type !== "transaction") { 15200 event.transaction = transactionName; 15201 } 15202 } 15203 function applyBreadcrumbsToEvent(event, breadcrumbs) { 15204 const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs]; 15205 event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0; 15206 } 15207 function applySdkMetadataToEvent(event, sdkProcessingMetadata) { 15208 event.sdkProcessingMetadata = __spreadValues(__spreadValues({}, event.sdkProcessingMetadata), sdkProcessingMetadata); 15209 } 15210 function applySpanToEvent(event, span) { 15211 event.contexts = __spreadValues({ 15212 trace: spanToTraceContext(span) 15213 }, event.contexts); 15214 event.sdkProcessingMetadata = __spreadValues({ 15215 dynamicSamplingContext: getDynamicSamplingContextFromSpan(span) 15216 }, event.sdkProcessingMetadata); 15217 const rootSpan = getRootSpan(span); 15218 const transactionName = spanToJSON(rootSpan).description; 15219 if (transactionName && !event.transaction && event.type === "transaction") { 15220 event.transaction = transactionName; 15221 } 15222 } 15223 function applyFingerprintToEvent(event, fingerprint) { 15224 event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint]
15224: []; 15225 if (fingerprint) { 15226 event.fingerprint = event.fingerprint.concat(fingerprint); 15227 } 15228 if (event.fingerprint && !event.fingerprint.length) { 15229 delete event.fingerprint; 15230 } 15231 } 15232 function prepareEvent(options2, event, hint, scope, client2, isolationScope) { 15233 const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options2; 15234 const prepared = __spreadProps(__spreadValues({}, event), { 15235 event_id: event.event_id || hint.event_id || uuid4(), 15236 timestamp: event.timestamp || dateTimestampInSeconds() 15237 }); 15238 const integrations = hint.integrations || options2.integrations.map((i2) => i2.name); 15239 applyClientOptions(prepared, options2); 15240 applyIntegrationsMetadata(prepared, integrations); 15241 if (client2) { 15242 client2.emit("applyFrameMetadata", event); 15243 } 15244 if (event.type === void 0) { 15245 applyDebugIds(prepared, options2.stackParser); 15246 } 15247 const finalScope = getFinalScope(scope, hint.captureContext); 15248 if (hint.mechanism) { 15249 addExceptionMechanism(prepared, hint.mechanism); 15250 } 15251 const clientEventProcessors = client2 ? client2.getEventProcessors() : []; 15252 const data = getGlobalScope().getScopeData(); 15253 if (isolationScope) { 15254 const isolationData = isolationScope.getScopeData(); 15255 mergeScopeData(data, isolationData); 15256 } 15257 if (finalScope) { 15258 const finalScopeData = finalScope.getScopeData(); 15259 mergeScopeData(data, finalScopeData); 15260 } 15261 const attachments = [...hint.attachments || [], ...data.attachments]; 15262 if (attachments.length) { 15263 hint.attachments = attachments; 15264 } 15265 applyScopeDataToEvent(prepared, data); 15266 const eventProcessors = [ 15267 ...clientEventProcessors, 15268 // Run scope event processors _after_ all other processors 15269 ...data.eventProcessors 15270 ]; 15271 const result = notifyEventProcessors(eventProcessors, prepared, hint); 15272 return result.then((evt) => { 15273 if (evt) { 15274 applyDebugMeta(evt); 15275 } 15276 if (typeof normalizeDepth === "number" && normalizeDepth > 0) { 15277 return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); 15278 } 15279 return evt; 15280 }); 15281 } 15282 function applyClientOptions(event, options2) { 15283 const { environment, release, dist: dist2, maxValueLength = 250 } = options2; 15284 event.environment = event.environment || environment || DEFAULT_ENVIRONMENT; 15285 if (!event.release && release) { 15286 event.release = release; 15287 } 15288 if (!event.dist && dist2) { 15289 event.dist = dist2; 15290 } 15291 if (event.message) { 15292 event.message = truncate(event.message, maxValueLength); 15293 } 15294 const exception = event.exception && event.exception.values && event.exception.values[0]; 15295 if (exception && exception.value) { 15296 exception.value = truncate(exception.value, maxValueLength); 15297 } 15298 const request = event.request; 15299 if (request && request.url) { 15300 request.url = truncate(request.url, maxValueLength); 15301 } 15302 } 15303 function applyDebugIds(event, stackParser) { 15304 const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); 15305 try { 15306 event.exception.values.forEach((exception) => { 15307 exception.stacktrace.frames.forEach((frame2) => { 15308 if (filenameDebugIdMap && frame2.filename) { 15309 frame2.debug_id = filenameDebugIdMap[frame2.filename]; 15310 } 15311 }); 15312 }); 15313 } catch (e2) { 15314 } 15315 } 15316 function applyDebugMeta(event) { 15317 const filenameDebugIdMap = {}; 15318 try { 15319 event.exception.values.forEach((exception) => { 15320 exception.stacktrace.frames.forEach((frame2) => { 15321 if (frame2.debug_id) { 15322 if (frame2.abs_path) { 15323 filenameDebugIdMap[frame2.abs_path] = frame2.debug_id; 15324 } else if (frame2.filename) { 15325 filenameDebugIdMap[frame2.filename] = frame2.debug_id; 15326 } 15327 delete frame2.debug_id; 15328 } 15329 }); 15330 }); 15331 } catch (e2) { 15332 } 15333 if (Object.keys(filenameDebugIdMap).length === 0) { 15334 return; 15335 } 15336 event.debug_meta = event.debug_meta || {}; 15337 event.debug_meta.images = event.debug_meta.images || []; 15338 const images = event.debug_meta.images;
15339 Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { 15340 images.push({ 15341 type: "sourcemap", 15342 code_file: filename, 15343 debug_id 15344 }); 15345 }); 15346 } 15347 function applyIntegrationsMetadata(event, integrationNames) { 15348 if (integrationNames.length > 0) { 15349 event.sdk = event.sdk || {}; 15350 event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames]; 15351 } 15352 } 15353 function normalizeEvent(event, depth, maxBreadth) { 15354 if (!event) { 15355 return null; 15356 } 15357 const normalized = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, event), event.breadcrumbs && { 15358 breadcrumbs: event.breadcrumbs.map((b2) => __spreadValues(__spreadValues({}, b2), b2.data && { 15359 data: normalize(b2.data, depth, maxBreadth) 15360 })) 15361 }), event.user && { 15362 user: normalize(event.user, depth, maxBreadth) 15363 }), event.contexts && { 15364 contexts: normalize(event.contexts, depth, maxBreadth) 15365 }), event.extra && { 15366 extra: normalize(event.extra, depth, maxBreadth) 15367 }); 15368 if (event.contexts && event.contexts.trace && normalized.contexts) { 15369 normalized.contexts.trace = event.contexts.trace; 15370 if (event.contexts.trace.data) { 15371 normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth); 15372 } 15373 } 15374 if (event.spans) { 15375 normalized.spans = event.spans.map((span) => { 15376 return __spreadValues(__spreadValues({}, span), span.data && { 15377 data: normalize(span.data, depth, maxBreadth) 15378 }); 15379 }); 15380 } 15381 if (event.contexts && event.contexts.flags && normalized.contexts) { 15382 normalized.contexts.flags = normalize(event.contexts.flags, 3, maxBreadth); 15383 } 15384 return normalized; 15385 } 15386 function getFinalScope(scope, captureContext) { 15387 if (!captureContext) { 15388 return scope; 15389 } 15390 const finalScope = scope ? scope.clone() : new Scope(); 15391 finalScope.update(captureContext); 15392 return finalScope; 15393 } 15394 function parseEventHintOrCaptureContext(hint) { 15395 if (!hint) { 15396 return void 0; 15397 } 15398 if (hintIsScopeOrFunction(hint)) { 15399 return { captureContext: hint }; 15400 } 15401 if (hintIsScopeContext(hint)) { 15402 return { 15403 captureContext: hint 15404 }; 15405 } 15406 return hint; 15407 } 15408 function hintIsScopeOrFunction(hint) { 15409 return hint instanceof Scope || typeof hint === "function"; 15410 } 15411 const captureContextKeys = [ 15412 "user", 15413 "level", 15414 "extra", 15415 "contexts", 15416 "tags", 15417 "fingerprint", 15418 "requestSession", 15419 "propagationContext" 15420 ]; 15421 function hintIsScopeContext(hint) { 15422 return Object.keys(hint).some((key) => captureContextKeys.includes(key)); 15423 } 15424 function captureException(exception, hint) { 15425 return getCurrentScope().captureException(exception, parseEventHintOrCaptureContext(hint)); 15426 } 15427 function captureEvent(event, hint) { 15428 return getCurrentScope().captureEvent(event, hint); 15429 } 15430 function setContext(name, context) { 15431 getIsolationScope().setContext(name, context); 15432 } 15433 function isEnabled() { 15434 const client2 = getClient(); 15435 return !!client2 && client2.getOptions().enabled !== false && !!client2.getTransport(); 15436 } 15437 function startSession(context) { 15438 const client2 = getClient(); 15439 const isolationScope = getIsolationScope(); 15440 const currentScope = getCurrentScope(); 15441 const { release, environment = DEFAULT_ENVIRONMENT } = client2 && client2.getOptions() || {}; 15442 const { userAgent } = GLOBAL_OBJ.navigator || {}; 15443 const session = makeSession(__spreadValues(__spreadValues({ 15444 release, 15445 environment, 15446 user: currentScope.getUser() || isolationScope.getUser() 15447 }, userAgent && { userAgent }), context)); 15448 const currentSession = isolationScope.getSession(); 15449 if (currentSession && currentSession.status === "ok") { 15450 updateSession(currentSession, { status: "exited" }); 15451 } 15452 endSession(); 15453 isolationScope.setSession(session); 15454 currentScope.setSession(session); 15455 return session; 15456 } 15457 function endSession() { 15458 const isolationScope = getIsolationScope(); 15459 const currentScope = getCurrentScope(); 15460 const session = currentScope.getSession() || isolationScope.getSession(); 15461 if (session) { 15462 closeSession(session); 15463 } 15464 _sendSessionUpdate(); 15465 isolationScope.setSession(); 15466 currentScope.setSession(); 15467 } 15468 function _sendSessionUpdate() { 15469 const isolationScope = getIsolationScope(); 15470 const currentScope = getCurrentScope(); 15471 const client2 = getClient(); 15472 const session = currentScope.getSession() || isolationScope.getSession(); 15473 if (session && client2) { 15474 client2.captureSession(session); 15475 } 15476 } 15477 function captureSession(end = false) { 15478 if (end) { 15479 endSession(); 15480 return; 15481 } 15482 _sendSessionUpdate(); 15483 } 15484 const SENTRY_API_VERSION = "7"; 15485 function getBaseApiEndpoint(dsn) { 15486 const protocol = dsn.protocol ? `${dsn.protocol}:` : ""; 15487 const port = dsn.port ? `:${dsn.port}` : ""; 15488 return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`; 15489 } 15490 function _getIngestEndpoint(dsn) { 15491 return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; 15492 } 15493 function _encodedAuth(dsn, sdkInfo) { 15494 const params = { 15495 sentry_version: SENTRY_API_VERSION 15496 }; 15497 if (dsn.publicKey) { 15498 params.sentry_key = dsn.publicKey; 15499 } 15500 if (sdkInfo) { 15501 params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; 15502 } 15503 return new URLSearchParams(params).toString(); 15504 } 15505 function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { 15506 return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; 15507 } 15508 const installedIntegrations = []; 15509 function filterDuplicates(integrations) { 15510 const integrationsByName = {}; 15511 integrations.forEach((currentInstance) => { 15512 const { name } = currentInstance; 15513 const existingInstance = integrationsByName[name]; 15514 if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { 15515 return; 15516 } 15517 integrationsByName[name] = currentInstance; 15518 }); 15519 return Object.values(integrationsByName); 15520 } 15521 function getIntegrationsToSetup(options2) { 15522 const defaultIntegrations = options2.defaultIntegrations || []; 15523 const userIntegrations = options2.integrations; 15524 defaultIntegrations.forEach((integration) => { 15525 integration.isDefaultInstance = true; 15526 }); 15527 let integrations; 15528 if (Array.isArray(userIntegrations)) { 15529 integrations = [...defaultIntegrations, ...userIntegrations]; 15530 } else if (typeof userIntegrations === "function") { 15531 const resolvedUserIntegrations = userIntegrations(defaultIntegrations); 15532 integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; 15533 } else { 15534 integrations = defaultIntegrations; 15535 } 15536 const finalIntegrations = filterDuplicates(integrations); 15537 const debugIndex = finalIntegrations.findIndex((integration) => integration.name === "Debug"); 15538 if (debugIndex > -1) { 15539 const [debugInstance] = finalIntegrations.splice(debugIndex, 1); 15540 finalIntegrations.push(debugInstance); 15541 } 15542 return finalIntegrations; 15543 } 15544 function setupIntegrations(client2, integrations) { 15545 const integrationIndex = {}; 15546 integrations.forEach((integration) => { 15547 if (integration) { 15548 setupIntegration(client2, integration, integrationIndex); 15549 } 15550 }); 15551 return integrationIndex; 15552 } 15553 function afterSetupIntegrations(client2, integrations) { 15554 for (const integration of integrations) { 15555 if (integration && integration.afterAllSetup) { 15556 integration.afterAllSetup(client2); 15557 } 15558 } 15559 } 15560 function setupIntegration(client2, integration, integrationIndex) { 15561 if (integrationIndex[integration.name]) { 15562 DEBUG_BUILD$3 && logger.log(`Integration skipped because it was already installed: ${integration.name}`); 15563 return; 15564 } 15565 integrationIndex[integration.name] = integration; 15566 if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === "function") { 15567 integration.setupOnce(); 15568 installedIntegrations.push(integration.name); 15569 } 15570 if (integration.setup && typeof integration.setup === "function") { 15571 integration.setup(client2); 15572 } 15573 if (typeof integration.preprocessEvent === "function") { 15574 const callback = integration.preprocessEvent.bind(integration); 15575 client2.on("preprocessEvent", (event, hint) => callback(event, hint, client2)); 15576 } 15577 if (typeof integration.processEvent === "function") { 15578 const callback = integration.processEvent.bind(integration); 15579 const processor = Object.assign((event, hint) => callback(event, hint, client2), { 15580 id: integration.name 15581 }); 15582 client2.addEventProcessor(processor); 15583 } 15584 DEBUG_BUILD$3 && logger.log(`Integration installed: ${integration.name}`); 15585 } 15586 function defineIntegration(fn2) { 15587 return fn2; 15588 } 15589 function createClientReportEnvelope(discarded_events, dsn, timestamp) { 15590 const clientReportItem = [ 15591 { type: "client_report" }, 15592 { 15593 timestamp: dateTimestampInSeconds(), 15594 discarded_events 15595 } 15596 ]; 15597 return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); 15598 }
15599 class SentryError extends Error { 15600 constructor(message, logLevel = "warn") { 15601 super(message); 15602 this.message = message; 15603 this.logLevel = logLevel; 15604 } 15605 } 15606 const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; 15607 class BaseClient { 15608 /** Options passed to the SDK. */ 15609 /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ 15610 /** Array of set up integrations. */ 15611 /** Number of calls being processed */ 15612 /** Holds flushable */ 15613 // eslint-disable-next-line @typescript-eslint/ban-types 15614 /** 15615 * Initializes this client instance. 15616 * 15617 * @param options Options for the client. 15618 */ 15619 constructor(options2) { 15620 this._options = options2; 15621 this._integrations = {}; 15622 this._numProcessing = 0; 15623 this._outcomes = {}; 15624 this._hooks = {}; 15625 this._eventProcessors = []; 15626 if (options2.dsn) { 15627 this._dsn = makeDsn(options2.dsn); 15628 } else { 15629 DEBUG_BUILD$3 && logger.warn("No DSN provided, client will not send events."); 15630 } 15631 if (this._dsn) { 15632 const url = getEnvelopeEndpointWithUrlEncodedAuth( 15633 this._dsn, 15634 options2.tunnel, 15635 options2._metadata ? options2._metadata.sdk : void 0 15636 ); 15637 this._transport = options2.transport(__spreadProps(__spreadValues({ 15638 tunnel: this._options.tunnel, 15639 recordDroppedEvent: this.recordDroppedEvent.bind(this) 15640 }, options2.transportOptions), { 15641 url 15642 })); 15643 } 15644 const tracingOptions = ["enableTracing", "tracesSampleRate", "tracesSampler"]; 15645 const undefinedOption = tracingOptions.find((option) => option in options2 && options2[option] == void 0); 15646 if (undefinedOption) { 15647 consoleSandbox(() => { 15648 console.warn( 15649 `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.` 15650 ); 15651 }); 15652 } 15653 } 15654 /** 15655 * @inheritDoc 15656 */ 15657 captureException(exception, hint, scope) { 15658 const eventId = uuid4(); 15659 if (checkOrSetAlreadyCaught(exception)) { 15660 DEBUG_BUILD$3 && logger.log(ALREADY_SEEN_ERROR); 15661 return eventId; 15662 } 15663 const hintWithEventId = __spreadValues({ 15664 event_id: eventId 15665 }, hint); 15666 this._process( 15667 this.eventFromException(exception, hintWithEventId).then( 15668 (event) => this._captureEvent(event, hintWithEventId, scope) 15669 ) 15670 ); 15671 return hintWithEventId.event_id; 15672 } 15673 /** 15674 * @inheritDoc 15675 */ 15676 captureMessage(message, level, hint, currentScope) { 15677 const hintWithEventId = __spreadValues({ 15678 event_id: uuid4() 15679 }, hint); 15680 const eventMessage = isParameterizedString(message) ? message : String(message); 15681 const promisedEvent = isPrimitive(message) ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message, hintWithEventId); 15682 this._process(promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope))); 15683 return hintWithEventId.event_id; 15684 } 15685 /** 15686 * @inheritDoc 15687 */ 15688 captureEvent(event, hint, currentScope) { 15689 const eventId = uuid4(); 15690 if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) { 15691 DEBUG_BUILD$3 && logger.log(ALREADY_SEEN_ERROR); 15692 return eventId; 15693 } 15694 const hintWithEventId = __spreadValues({ 15695 event_id: eventId 15696 }, hint); 15697 const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; 15698 const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; 15699 this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); 15700 return hintWithEventId.event_id; 15701 } 15702 /** 15703 * @inheritDoc 15704 */ 15705 captureSession(session) { 15706 if (!(typeof session.release === "string")) { 15707 DEBUG_BUILD$3 && logger.warn("Discarded session because of missing or non-string release"); 15708 } else { 15709 this.sendSession(session); 15710 updateSession(session, { init: false }); 15711 } 15712 } 15713 /** 15714 * @inheritDoc 15715 */ 15716 getDsn() { 15717 return this._dsn; 15718 } 15719 /** 15720 * @inheritDoc 15721 */ 15722 getOptions() { 15723 return this._options; 15724 } 15725 /** 15726 * @see SdkMetadata 15727 * 15728 * @return The metadata of the SDK 15729 */ 15730 getSdkMetadata() { 15731 return this._options._metadata; 15732 } 15733 /** 15734 * @inheritDoc 15735 */ 15736 getTransport() { 15737 return this._transport; 15738 } 15739 /** 15740 * @inheritDoc 15741 */ 15742 flush(timeout) { 15743 const transport = this._transport; 15744 if (transport) {
vendor: 3,087 bytes, lines 15745-15827
15745 this.emit("flush"); 15746 return this._isClientDoneProcessing(timeout).then((clientFinished) => { 15747 return transport.flush(timeout).then((transportFlushed) => clientFinished && transportFlushed); 15748 }); 15749 } else { 15750 return resolvedSyncPromise(true); 15751 } 15752 } 15753 /** 15754 * @inheritDoc 15755 */ 15756 close(timeout) { 15757 return this.flush(timeout).then((result) => { 15758 this.getOptions().enabled = false; 15759 this.emit("close"); 15760 return result; 15761 }); 15762 } 15763 /** Get all installed event processors. */ 15764 getEventProcessors() { 15765 return this._eventProcessors; 15766 } 15767 /** @inheritDoc */ 15768 addEventProcessor(eventProcessor) { 15769 this._eventProcessors.push(eventProcessor); 15770 } 15771 /** @inheritdoc */ 15772 init() { 15773 if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have 15774 // Spotlight enabled. This is particularly important for browser as we 15775 // don't support the `spotlight` option there and rely on the users 15776 // adding the `spotlightBrowserIntegration()` to their integrations which 15777 // wouldn't get initialized with the check below when there's no DSN set. 15778 this._options.integrations.some(({ name }) => name.startsWith("Spotlight"))) { 15779 this._setupIntegrations(); 15780 } 15781 } 15782 /** 15783 * Gets an installed integration by its name. 15784 * 15785 * @returns The installed integration or `undefined` if no integration with that `name` was installed. 15786 */ 15787 getIntegrationByName(integrationName) { 15788 return this._integrations[integrationName]; 15789 } 15790 /** 15791 * @inheritDoc 15792 */ 15793 addIntegration(integration) { 15794 const isAlreadyInstalled = this._integrations[integration.name]; 15795 setupIntegration(this, integration, this._integrations); 15796 if (!isAlreadyInstalled) { 15797 afterSetupIntegrations(this, [integration]); 15798 } 15799 } 15800 /** 15801 * @inheritDoc 15802 */ 15803 sendEvent(event, hint = {}) { 15804 this.emit("beforeSendEvent", event, hint); 15805 let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); 15806 for (const attachment of hint.attachments || []) { 15807 env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment)); 15808 } 15809 const promise = this.sendEnvelope(env); 15810 if (promise) { 15811 promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null); 15812 } 15813 } 15814 /** 15815 * @inheritDoc 15816 */ 15817 sendSession(session) { 15818 const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); 15819 this.sendEnvelope(env); 15820 } 15821 /** 15822 * @inheritDoc 15823 */ 15824 recordDroppedEvent(reason, category, eventOrCount) { 15825 if (this._options.sendClientReports) { 15826 const count2 = typeof eventOrCount === "number" ? eventOrCount : 1; 15827 const key = `${reason}:${category}`;
15828 DEBUG_BUILD$3 && logger.log(`Recording outcome: "${key}"${count2 > 1 ? ` (${count2} times)` : ""}`); 15829 this._outcomes[key] = (this._outcomes[key] || 0) + count2; 15830 } 15831 } 15832 // Keep on() & emit() signatures in sync with types' client.ts interface 15833 /* eslint-disable @typescript-eslint/unified-signatures */ 15834 /** @inheritdoc */ 15835 /** @inheritdoc */ 15836 on(hook, callback) { 15837 const hooks = this._hooks[hook] = this._hooks[hook] || []; 15838 hooks.push(callback); 15839 return () => { 15840 const cbIndex = hooks.indexOf(callback); 15841 if (cbIndex > -1) { 15842 hooks.splice(cbIndex, 1); 15843 } 15844 }; 15845 } 15846 /** @inheritdoc */ 15847 /** @inheritdoc */ 15848 emit(hook, ...rest) { 15849 const callbacks = this._hooks[hook]; 15850 if (callbacks) { 15851 callbacks.forEach((callback) => callback(...rest)); 15852 } 15853 } 15854 /** 15855 * @inheritdoc 15856 */ 15857 sendEnvelope(envelope) { 15858 this.emit("beforeEnvelope", envelope); 15859 if (this._isEnabled() && this._transport) { 15860 return this._transport.send(envelope).then(null, (reason) => { 15861 DEBUG_BUILD$3 && logger.error("Error while sending envelope:", reason); 15862 return reason; 15863 }); 15864 } 15865 DEBUG_BUILD$3 && logger.error("Transport disabled"); 15866 return resolvedSyncPromise({}); 15867 } 15868 /* eslint-enable @typescript-eslint/unified-signatures */ 15869 /** Setup integrations for this client. */ 15870 _setupIntegrations() { 15871 const { integrations } = this._options; 15872 this._integrations = setupIntegrations(this, integrations); 15873 afterSetupIntegrations(this, integrations); 15874 } 15875 /** Updates existing session based on the provided event */ 15876 _updateSessionFromEvent(session, event) { 15877 let crashed = event.level === "fatal"; 15878 let errored = false; 15879 const exceptions = event.exception && event.exception.values; 15880 if (exceptions) { 15881 errored = true; 15882 for (const ex of exceptions) { 15883 const mechanism = ex.mechanism; 15884 if (mechanism && mechanism.handled === false) { 15885 crashed = true; 15886 break; 15887 } 15888 } 15889 } 15890 const sessionNonTerminal = session.status === "ok"; 15891 const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed; 15892 if (shouldUpdateAndSend) { 15893 updateSession(session, __spreadProps(__spreadValues({}, crashed && { status: "crashed" }), { 15894 errors: session.errors || Number(errored || crashed) 15895 })); 15896 this.captureSession(session); 15897 } 15898 } 15899 /** 15900 * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying 15901 * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. 15902 * 15903 * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not 15904 * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to 15905 * `true`. 15906 * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and 15907 * `false` otherwise 15908 */ 15909 _isClientDoneProcessing(timeout) { 15910 return new SyncPromise((resolve) => { 15911 let ticked = 0; 15912 const tick = 1; 15913 const interval = setInterval(() => { 15914 if (this._numProcessing == 0) { 15915 clearInterval(interval); 15916 resolve(true); 15917 } else { 15918 ticked += tick; 15919 if (timeout && ticked >= timeout) { 15920 clearInterval(interval); 15921 resolve(false); 15922 } 15923 } 15924 }, tick); 15925 }); 15926 } 15927 /** Determines whether this SDK is enabled and a transport is present. */ 15928 _isEnabled() { 15929 return this.getOptions().enabled !== false && this._transport !== void 0; 15930 } 15931 /** 15932 * Adds common information to events. 15933 * 15934 * The information includes release and environment from `options`, 15935 * breadcrumbs and context (extra, tags and user) from the scope. 15936 * 15937 * Information that is already present in the event is never overwritten. For 15938 * nested objects, such as the context, keys are merged. 15939 * 15940 * @param event The original event. 15941 * @param hint May contain additional information about the original exception. 15942 * @param currentScope A scope containing event metadata. 15943 * @returns A new event with more information. 15944 */ 15945 _prepareEvent(event, hint, currentScope = getCurrentScope(), isolationScope = getIsolationScope()) { 15946 const options2 = this.getOptions(); 15947 const integrations = Object.keys(this._integrations); 15948 if (!hint.integrations && integrations.length > 0) { 15949 hint.integrations = integrations; 15950 }
15951 this.emit("preprocessEvent", event, hint); 15952 if (!event.type) { 15953 isolationScope.setLastEventId(event.event_id || hint.event_id); 15954 } 15955 return prepareEvent(options2, event, hint, currentScope, this, isolationScope).then((evt) => { 15956 if (evt === null) { 15957 return evt; 15958 } 15959 evt.contexts = __spreadValues({ 15960 trace: getTraceContextFromScope(currentScope) 15961 }, evt.contexts); 15962 const dynamicSamplingContext = getDynamicSamplingContextFromScope(this, currentScope); 15963 evt.sdkProcessingMetadata = __spreadValues({ 15964 dynamicSamplingContext 15965 }, evt.sdkProcessingMetadata); 15966 return evt; 15967 }); 15968 } 15969 /** 15970 * Processes the event and logs an error in case of rejection 15971 * @param event 15972 * @param hint 15973 * @param scope 15974 */ 15975 _captureEvent(event, hint = {}, scope) { 15976 return this._processEvent(event, hint, scope).then( 15977 (finalEvent) => { 15978 return finalEvent.event_id; 15979 }, 15980 (reason) => { 15981 if (DEBUG_BUILD$3) { 15982 if (reason instanceof SentryError && reason.logLevel === "log") { 15983 logger.log(reason.message); 15984 } else { 15985 logger.warn(reason); 15986 } 15987 } 15988 return void 0; 15989 } 15990 ); 15991 } 15992 /** 15993 * Processes an event (either error or message) and sends it to Sentry. 15994 * 15995 * This also adds breadcrumbs and context information to the event. However, 15996 * platform specific meta data (such as the User's IP address) must be added 15997 * by the SDK implementor. 15998 * 15999 * 16000 * @param event The event to send to Sentry. 16001 * @param hint May contain additional information about the original exception. 16002 * @param currentScope A scope containing event metadata. 16003 * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. 16004 */ 16005 _processEvent(event, hint, currentScope) { 16006 const options2 = this.getOptions(); 16007 const { sampleRate } = options2; 16008 const isTransaction = isTransactionEvent(event); 16009 const isError2 = isErrorEvent(event); 16010 const eventType = event.type || "error"; 16011 const beforeSendLabel = `before send for type \`${eventType}\``; 16012 const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate(sampleRate); 16013 if (isError2 && typeof parsedSampleRate === "number" && Math.random() > parsedSampleRate) { 16014 this.recordDroppedEvent("sample_rate", "error", event); 16015 return rejectedSyncPromise( 16016 new SentryError( 16017 `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, 16018 "log" 16019 ) 16020 ); 16021 } 16022 const dataCategory = eventType === "replay_event" ? "replay" : eventType; 16023 const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; 16024 const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; 16025 return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope).then((prepared) => { 16026 if (prepared === null) { 16027 this.recordDroppedEvent("event_processor", dataCategory, event); 16028 throw new SentryError("An event processor returned `null`, will not send event.", "log"); 16029 } 16030 const isInternalException = hint.data && hint.data.__sentry__ === true; 16031 if (isInternalException) { 16032 return prepared; 16033 } 16034 const result = processBeforeSend(this, options2, prepared, hint); 16035 return _validateBeforeSendResult(result, beforeSendLabel); 16036 }).then((processedEvent) => { 16037 if (processedEvent === null) { 16038 this.recordDroppedEvent("before_send", dataCategory, event); 16039 if (isTransaction) { 16040 const spans = event.spans || []; 16041 const spanCount = 1 + spans.length; 16042 this.recordDroppedEvent("before_send", "span", spanCount); 16043 } 16044 throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, "log"); 16045 } 16046 const session = currentScope && currentScope.getSession(); 16047 if (!isTransaction && session) { 16048 this._updateSessionFromEvent(session, processedEvent); 16049 } 16050 if (isTransaction) { 16051 const spanCountBefore = processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing || 0; 16052 const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; 16053 const droppedSpanCount = spanCountBefore - spanCountAfter; 16054 if (droppedSpanCount > 0) { 16055 this.recordDroppedEvent("before_send", "span", droppedSpanCount); 16056 } 16057 } 16058 const transactionInfo = processedEvent.transaction_info; 16059 if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { 16060 const source = "custom"; 16061 processedEvent.transaction_info = __spreadProps(__spreadValues({}, transactionInfo), { 16062 source 16063 }); 16064 } 16065 this.sendEvent(processedEvent, hint); 16066 return processedEvent; 16067 }).then(null, (reason) => { 16068 if (reason instanceof SentryError) { 16069 throw reason; 16070 } 16071 this.captureException(reason, { 16072 data: { 16073 __sentry__: true 16074 }, 16075 originalException: reason 16076 }); 16077 throw new SentryError( 16078 `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. 16079Reason: ${reason}` 16080 ); 16081 }); 16082 } 16083 /** 16084 * Occupies the client with processing and event 16085 */ 16086 _process(promise) { 16087 this._numProcessing++; 16088 void promise.then( 16089 (value) => { 16090 this._numProcessing--; 16091 return value; 16092 }, 16093 (reason) => { 16094 this._numProcessing--; 16095 return reason; 16096 } 16097 ); 16098 } 16099 /** 16100 * Clears outcomes on this client and returns them. 16101 */ 16102 _clearOutcomes() { 16103 const outcomes = this._outcomes; 16104 this._outcomes = {}; 16105 return Object.entries(outcomes).map(([key, quantity]) => { 16106 const [reason, category] = key.split(":"); 16107 return { 16108 reason, 16109 category, 16110 quantity 16111 }; 16112 }); 16113 } 16114 /** 16115 * Sends client reports as an envelope. 16116 */ 16117 _flushOutcomes() { 16118 DEBUG_BUILD$3 && logger.log("Flushing outcomes..."); 16119 const outcomes = this._clearOutcomes(); 16120 if (outcomes.length === 0) { 16121 DEBUG_BUILD$3 && logger.log("No outcomes to send"); 16122 return; 16123 } 16124 if (!this._dsn) { 16125 DEBUG_BUILD$3 && logger.log("No dsn provided, will not send outcomes"); 16126 return; 16127 } 16128 DEBUG_BUILD$3 && logger.log("Sending outcomes:", outcomes); 16129 const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn)); 16130 this.sendEnvelope(envelope); 16131 } 16132 /** 16133 * @inheritDoc 16134 */ 16135 } 16136 function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) { 16137 const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; 16138 if (isThenable$1(beforeSendResult)) { 16139 return beforeSendResult.then( 16140 (event) => { 16141 if (!isPlainObject$3(event) && event !== null) { 16142 throw new SentryError(invalidValueError); 16143 } 16144 return event; 16145 }, 16146 (e2) => { 16147 throw new SentryError(`${beforeSendLabel} rejected with ${e2}`); 16148 } 16149 ); 16150 } else if (!isPlainObject$3(beforeSendResult) && beforeSendResult !== null) { 16151 throw new SentryError(invalidValueError); 16152 } 16153 return beforeSendResult; 16154 } 16155 function processBeforeSend(client2, options2, event, hint) { 16156 const { beforeSend, beforeSendTransaction, beforeSendSpan } = options2; 16157 if (isErrorEvent(event) && beforeSend) { 16158 return beforeSend(event, hint); 16159 } 16160 if (isTransactionEvent(event)) { 16161 if (event.spans && beforeSendSpan) { 16162 const processedSpans = []; 16163 for (const span of event.spans) { 16164 const processedSpan = beforeSendSpan(span); 16165 if (processedSpan) { 16166 processedSpans.push(processedSpan); 16167 } else { 16168 showSpanDropWarning(); 16169 client2.recordDroppedEvent("before_send", "span"); 16170 } 16171 } 16172 event.spans = processedSpans; 16173 } 16174 if (beforeSendTransaction) { 16175 if (event.spans) { 16176 const spanCountBefore = event.spans.length; 16177 event.sdkProcessingMetadata = __spreadProps(__spreadValues({}, event.sdkProcessingMetadata), { 16178 spanCountBeforeProcessing: spanCountBefore 16179 }); 16180 } 16181 return beforeSendTransaction(event, hint); 16182 } 16183 } 16184 return event; 16185 } 16186 function isErrorEvent(event) { 16187 return event.type === void 0; 16188 } 16189 function isTransactionEvent(event) { 16190 return event.type === "transaction"; 16191 } 16192 function initAndBind(clientClass, options2) { 16193 if (options2.debug === true) { 16194 if (DEBUG_BUILD$3) { 16195 logger.enable(); 16196 } else { 16197 consoleSandbox(() => { 16198 console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); 16199 }); 16200 } 16201 } 16202 const scope = getCurrentScope(); 16203 scope.update(options2.initialScope); 16204 const client2 = new clientClass(options2); 16205 setCurrentClient(client2); 16206 client2.init(); 16207 return client2; 16208 } 16209 function setCurrentClient(client2) { 16210 getCurrentScope().setClient(client2); 16211 } 16212 function makePromiseBuffer(limit) { 16213 const buffer = []; 16214 function isReady() { 16215 return limit === void 0 || buffer.length < limit; 16216 } 16217 function remove(task) { 16218 return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(void 0); 16219 } 16220 function add(taskProducer) { 16221 if (!isReady()) { 16222 return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached.")); 16223 } 16224 const task = taskProducer(); 16225 if (buffer.indexOf(task) === -1) { 16226 buffer.push(task); 16227 } 16228 void task.then(() => remove(task)).then( 16229 null, 16230 () => remove(task).then(null, () => { 16231 }) 16232 ); 16233 return task; 16234 } 16235 function drain(timeout) { 16236 return new SyncPromise((resolve, reject) => { 16237 let counter = buffer.length; 16238 if (!counter) { 16239 return resolve(true); 16240 } 16241 const capturedSetTimeout = setTimeout(() => { 16242 if (timeout && timeout > 0) { 16243 resolve(false); 16244 } 16245 }, timeout); 16246 buffer.forEach((item) => { 16247 void resolvedSyncPromise(item).then(() => { 16248 if (!--counter) { 16249 clearTimeout(capturedSetTimeout); 16250 resolve(true); 16251 } 16252 }, reject); 16253 }); 16254 }); 16255 } 16256 return { 16257 $: buffer, 16258 add, 16259 drain 16260 }; 16261 } 16262 const DEFAULT_RETRY_AFTER = 60 * 1e3; 16263 function parseRetryAfterHeader(header, now2 = Date.now()) { 16264 const headerDelay = parseInt(`${header}`, 10); 16265 if (!isNaN(headerDelay)) { 16266 return headerDelay * 1e3; 16267 } 16268 const headerDate = Date.parse(`${header}`); 16269 if (!isNaN(headerDate)) { 16270 return headerDate - now2; 16271 } 16272 return DEFAULT_RETRY_AFTER; 16273 } 16274 function disabledUntil(limits, dataCategory) { 16275 return limits[dataCategory] || limits.all || 0; 16276 } 16277 function isRateLimited(limits, dataCategory, now2 = Date.now()) { 16278 return disabledUntil(limits, dataCategory) > now2; 16279 } 16280 function updateRateLimits(limits, { statusCode, headers }, now2 = Date.now()) { 16281 const updatedRateLimits = __spreadValues({}, limits);
16282 const rateLimitHeader = headers && headers["x-sentry-rate-limits"]; 16283 const retryAfterHeader = headers && headers["retry-after"]; 16284 if (rateLimitHeader) { 16285 for (const limit of rateLimitHeader.trim().split(",")) { 16286 const [retryAfter, categories, , , namespaces] = limit.split(":", 5); 16287 const headerDelay = parseInt(retryAfter, 10); 16288 const delay2 = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3; 16289 if (!categories) { 16290 updatedRateLimits.all = now2 + delay2; 16291 } else { 16292 for (const category of categories.split(";")) { 16293 if (category === "metric_bucket") { 16294 if (!namespaces || namespaces.split(";").includes("custom")) { 16295 updatedRateLimits[category] = now2 + delay2; 16296 } 16297 } else { 16298 updatedRateLimits[category] = now2 + delay2; 16299 } 16300 } 16301 } 16302 } 16303 } else if (retryAfterHeader) { 16304 updatedRateLimits.all = now2 + parseRetryAfterHeader(retryAfterHeader, now2); 16305 } else if (statusCode === 429) { 16306 updatedRateLimits.all = now2 + 60 * 1e3; 16307 } 16308 return updatedRateLimits; 16309 } 16310 const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; 16311 function createTransport(options2, makeRequest, buffer = makePromiseBuffer( 16312 options2.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE 16313 )) { 16314 let rateLimits = {}; 16315 const flush = (timeout) => buffer.drain(timeout); 16316 function send(envelope) { 16317 const filteredEnvelopeItems = []; 16318 forEachEnvelopeItem(envelope, (item, type) => { 16319 const dataCategory = envelopeItemTypeToDataCategory(type); 16320 if (isRateLimited(rateLimits, dataCategory)) { 16321 const event = getEventForEnvelopeItem(item, type); 16322 options2.recordDroppedEvent("ratelimit_backoff", dataCategory, event); 16323 } else { 16324 filteredEnvelopeItems.push(item); 16325 } 16326 }); 16327 if (filteredEnvelopeItems.length === 0) { 16328 return resolvedSyncPromise({}); 16329 } 16330 const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems); 16331 const recordEnvelopeLoss = (reason) => { 16332 forEachEnvelopeItem(filteredEnvelope, (item, type) => { 16333 const event = getEventForEnvelopeItem(item, type); 16334 options2.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event); 16335 }); 16336 }; 16337 const requestTask = () => makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then( 16338 (response) => { 16339 if (response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) { 16340 DEBUG_BUILD$3 && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); 16341 } 16342 rateLimits = updateRateLimits(rateLimits, response); 16343 return response; 16344 }, 16345 (error) => { 16346 recordEnvelopeLoss("network_error"); 16347 throw error; 16348 } 16349 ); 16350 return buffer.add(requestTask).then( 16351 (result) => result, 16352 (error) => { 16353 if (error instanceof SentryError) { 16354 DEBUG_BUILD$3 && logger.error("Skipped sending event because buffer is full."); 16355 recordEnvelopeLoss("queue_overflow"); 16356 return resolvedSyncPromise({}); 16357 } else { 16358 throw error; 16359 } 16360 } 16361 ); 16362 } 16363 return { 16364 send, 16365 flush 16366 }; 16367 } 16368 function getEventForEnvelopeItem(item, type) { 16369 if (type !== "event" && type !== "transaction") { 16370 return void 0; 16371 } 16372 return Array.isArray(item) ? item[1] : void 0; 16373 } 16374 function applySdkMetadata(options2, name, names2 = [name], source = "npm") { 16375 const metadata = options2._metadata || {}; 16376 if (!metadata.sdk) { 16377 metadata.sdk = { 16378 name: `sentry.javascript.${name}`, 16379 packages: names2.map((name2) => ({ 16380 name: `${source}:@sentry/${name2}`, 16381 version: SDK_VERSION 16382 })), 16383 version: SDK_VERSION 16384 }; 16385 } 16386 options2._metadata = metadata; 16387 } 16388 function getTraceData(options2 = {}) { 16389 const client2 = getClient(); 16390 if (!isEnabled() || !client2) { 16391 return {}; 16392 } 16393 const carrier = getMainCarrier(); 16394 const acs = getAsyncContextStrategy(carrier); 16395 if (acs.getTraceData) { 16396 return acs.getTraceData(options2); 16397 } 16398 const scope = getCurrentScope(); 16399 const span = options2.span || getActiveSpan(); 16400 const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope); 16401 const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client2, scope); 16402 const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc); 16403 const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace); 16404 if (!isValidSentryTraceHeader) { 16405 logger.warn("Invalid sentry-trace data. Cannot generate trace data"); 16406 return {}; 16407 } 16408 return { 16409 "sentry-trace": sentryTrace, 16410 baggage 16411 }; 16412 } 16413 function scopeToTraceHeader(scope) { 16414 const { traceId, sampled, spanId } = scope.getPropagationContext(); 16415 return generateSentryTraceHeader(traceId, spanId, sampled); 16416 } 16417 const DEFAULT_BREADCRUMBS = 100; 16418 function addBreadcrumb(breadcrumb, hint) { 16419 const client2 = getClient(); 16420 const isolationScope = getIsolationScope(); 16421 if (!client2) return; 16422 const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client2.getOptions(); 16423 if (maxBreadcrumbs <= 0) return; 16424 const timestamp = dateTimestampInSeconds(); 16425 const mergedBreadcrumb = __spreadValues({ timestamp }, breadcrumb); 16426 const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb; 16427 if (finalBreadcrumb === null) return; 16428 if (client2.emit) { 16429 client2.emit("beforeAddBreadcrumb", finalBreadcrumb, hint); 16430 } 16431 isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); 16432 } 16433 let originalFunctionToString; 16434 const INTEGRATION_NAME$6 = "FunctionToString"; 16435 const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap(); 16436 const _functionToStringIntegration = (() => { 16437 return { 16438 name: INTEGRATION_NAME$6, 16439 setupOnce() { 16440 originalFunctionToString = Function.prototype.toString; 16441 try { 16442 Function.prototype.toString = function(...args) { 16443 const originalFunction = getOriginalFunction(this); 16444 const context = SETUP_CLIENTS.has(getClient()) && originalFunction !== void 0 ? originalFunction : this; 16445 return originalFunctionToString.apply(context, args
16445); 16446 }; 16447 } catch (e2) { 16448 } 16449 }, 16450 setup(client2) { 16451 SETUP_CLIENTS.set(client2, true); 16452 } 16453 }; 16454 }); 16455 const functionToStringIntegration = defineIntegration(_functionToStringIntegration); 16456 const DEFAULT_IGNORE_ERRORS = [ 16457 /^Script error\.?$/, 16458 /^Javascript error: Script error\.? on line 0$/, 16459 /^ResizeObserver loop completed with undelivered notifications.$/, 16460 // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. 16461 /^Cannot redefine property: googletag$/, 16462 // This is thrown when google tag manager is used in combination with an ad blocker 16463 "undefined is not an object (evaluating 'a.L')", 16464 // Random error that happens but not actionable or noticeable to end-users. 16465 `can't redefine non-configurable property "solana"`, 16466 // Probably a browser extension or custom browser (Brave) throwing this error 16467 "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", 16468 // Error thrown by GTM, seemingly not affecting end-users 16469 "Can't find variable: _AutofillCallbackHandler", 16470 // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ 16471 /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/ 16472 // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps 16473 ]; 16474 const INTEGRATION_NAME$5 = "InboundFilters"; 16475 const _inboundFiltersIntegration = ((options2 = {}) => { 16476 return { 16477 name: INTEGRATION_NAME$5, 16478 processEvent(event, _hint, client2) { 16479 const clientOptions = client2.getOptions(); 16480 const mergedOptions = _mergeOptions(options2, clientOptions); 16481 return _shouldDropEvent$1(event, mergedOptions) ? null : event; 16482 } 16483 }; 16484 }); 16485 const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration); 16486 function _mergeOptions(internalOptions = {}, clientOptions = {}) { 16487 return { 16488 allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []], 16489 denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []], 16490 ignoreErrors: [ 16491 ...internalOptions.ignoreErrors || [], 16492 ...clientOptions.ignoreErrors || [], 16493 ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS 16494 ], 16495 ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []], 16496 ignoreInternal: internalOptions.ignoreInternal !== void 0 ? internalOptions.ignoreInternal : true 16497 }; 16498 } 16499 function _shouldDropEvent$1(event, options2) { 16500 if (options2.ignoreInternal && _isSentryError(event)) { 16501 DEBUG_BUILD$3 && logger.warn(`Event dropped due to being internal Sentry Error. 16502Event: ${getEventDescription(event)}`); 16503 return true; 16504 } 16505 if (_isIgnoredError(event, options2.ignoreErrors)) { 16506 DEBUG_BUILD$3 && logger.warn( 16507 `Event dropped due to being matched by \`ignoreErrors\` option. 16508Event: ${getEventDescription(event)}` 16509 ); 16510 return true; 16511 } 16512 if (_isUselessError(event)) { 16513 DEBUG_BUILD$3 && logger.warn( 16514 `Event dropped due to not having an error message, error type or stacktrace. 16515Event: ${getEventDescription( 16516 event 16517 )}` 16518 ); 16519 return true; 16520 } 16521 if (_isIgnoredTransaction(event, options2.ignoreTransactions)) { 16522 DEBUG_BUILD$3 && logger.warn( 16523 `Event dropped due to being matched by \`ignoreTransactions\` option. 16524Event: ${getEventDescription(event)}` 16525 ); 16526 return true; 16527 } 16528 if (_isDeniedUrl(event, options2.denyUrls)) { 16529 DEBUG_BUILD$3 && logger.warn( 16530 `Event dropped due to being matched by \`denyUrls\` option. 16531Event: ${getEventDescription( 16532 event 16533 )}. 16534Url: ${_getEventFilterUrl(event)}` 16535 ); 16536 return true; 16537 } 16538 if (!_isAllowedUrl(event, options2.allowUrls)) { 16539 DEBUG_BUILD$3 && logger.warn( 16540 `Event dropped due to not being matched by \`allowUrls\` option. 16541Event: ${getEventDescription( 16542 event 16543 )}. 16544Url: ${_getEventFilterUrl(event)}` 16545 ); 16546 return true; 16547 } 16548 return false;
vendor: 7,074 bytes, lines 16549-16737
16549 } 16550 function _isIgnoredError(event, ignoreErrors) { 16551 if (event.type || !ignoreErrors || !ignoreErrors.length) { 16552 return false; 16553 } 16554 return _getPossibleEventMessages(event).some((message) => stringMatchesSomePattern(message, ignoreErrors)); 16555 } 16556 function _isIgnoredTransaction(event, ignoreTransactions) { 16557 if (event.type !== "transaction" || !ignoreTransactions || !ignoreTransactions.length) { 16558 return false; 16559 } 16560 const name = event.transaction; 16561 return name ? stringMatchesSomePattern(name, ignoreTransactions) : false; 16562 } 16563 function _isDeniedUrl(event, denyUrls) { 16564 if (!denyUrls || !denyUrls.length) { 16565 return false; 16566 } 16567 const url = _getEventFilterUrl(event); 16568 return !url ? false : stringMatchesSomePattern(url, denyUrls); 16569 } 16570 function _isAllowedUrl(event, allowUrls) { 16571 if (!allowUrls || !allowUrls.length) { 16572 return true; 16573 } 16574 const url = _getEventFilterUrl(event); 16575 return !url ? true : stringMatchesSomePattern(url, allowUrls); 16576 } 16577 function _getPossibleEventMessages(event) { 16578 const possibleMessages = []; 16579 if (event.message) { 16580 possibleMessages.push(event.message); 16581 } 16582 let lastException; 16583 try { 16584 lastException = event.exception.values[event.exception.values.length - 1]; 16585 } catch (e2) { 16586 } 16587 if (lastException) { 16588 if (lastException.value) { 16589 possibleMessages.push(lastException.value); 16590 if (lastException.type) { 16591 possibleMessages.push(`${lastException.type}: ${lastException.value}`); 16592 } 16593 } 16594 } 16595 return possibleMessages; 16596 } 16597 function _isSentryError(event) { 16598 try { 16599 return event.exception.values[0].type === "SentryError"; 16600 } catch (e2) { 16601 } 16602 return false; 16603 } 16604 function _getLastValidUrl(frames = []) { 16605 for (let i2 = frames.length - 1; i2 >= 0; i2--) { 16606 const frame2 = frames[i2]; 16607 if (frame2 && frame2.filename !== "<anonymous>" && frame2.filename !== "[native code]") { 16608 return frame2.filename || null; 16609 } 16610 } 16611 return null; 16612 } 16613 function _getEventFilterUrl(event) { 16614 try { 16615 let frames; 16616 try { 16617 frames = event.exception.values[0].stacktrace.frames; 16618 } catch (e2) { 16619 } 16620 return frames ? _getLastValidUrl(frames) : null; 16621 } catch (oO) { 16622 DEBUG_BUILD$3 && logger.error(`Cannot extract url for event ${getEventDescription(event)}`); 16623 return null; 16624 } 16625 } 16626 function _isUselessError(event) { 16627 if (event.type) { 16628 return false; 16629 } 16630 if (!event.exception || !event.exception.values || event.exception.values.length === 0) { 16631 return false; 16632 } 16633 return ( 16634 // No top-level message 16635 !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value 16636 !event.exception.values.some((value) => value.stacktrace || value.type && value.type !== "Error" || value.value) 16637 ); 16638 } 16639 function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, maxValueLimit = 250, key, limit, event, hint) { 16640 if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) { 16641 return; 16642 } 16643 const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; 16644 if (originalException) { 16645 event.exception.values = truncateAggregateExceptions( 16646 aggregateExceptionsFromError( 16647 exceptionFromErrorImplementation, 16648 parser, 16649 limit, 16650 hint.originalException, 16651 key, 16652 event.exception.values, 16653 originalException, 16654 0 16655 ), 16656 maxValueLimit 16657 ); 16658 } 16659 } 16660 function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error, key, prevExceptions, exception, exceptionId) { 16661 if (prevExceptions.length >= limit + 1) { 16662 return prevExceptions; 16663 } 16664 let newExceptions = [...prevExceptions]; 16665 if (isInstanceOf(error[key], Error)) { 16666 applyExceptionGroupFieldsForParentException(exception, exceptionId); 16667 const newException = exceptionFromErrorImplementation(parser, error[key]); 16668 const newExceptionId = newExceptions.length; 16669 applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); 16670 newExceptions = aggregateExceptionsFromError( 16671 exceptionFromErrorImplementation, 16672 parser, 16673 limit, 16674 error[key], 16675 key, 16676 [newException, ...newExceptions], 16677 newException, 16678 newExceptionId 16679 ); 16680 } 16681 if (Array.isArray(error.errors)) { 16682 error.errors.forEach((childError, i2) => { 16683 if (isInstanceOf(childError, Error)) { 16684 applyExceptionGroupFieldsForParentException(exception, exceptionId); 16685 const newException = exceptionFromErrorImplementation(parser, childError); 16686 const newExceptionId = newExceptions.length; 16687 applyExceptionGroupFieldsForChildException(newException, `errors[${i2}]`, newExceptionId, exceptionId); 16688 newExceptions = aggregateExceptionsFromError( 16689 exceptionFromErrorImplementation, 16690 parser, 16691 limit, 16692 childError, 16693 key, 16694 [newException, ...newExceptions], 16695 newException, 16696 newExceptionId 16697 ); 16698 } 16699 }); 16700 } 16701 return newExceptions; 16702 } 16703 function applyExceptionGroupFieldsForParentException(exception, exceptionId) { 16704 exception.mechanism = exception.mechanism || { type: "generic", handled: true }; 16705 exception.mechanism = __spreadProps(__spreadValues(__spreadValues({}, exception.mechanism), exception.type === "AggregateError" && { is_exception_group: true }), { 16706 exception_id: exceptionId 16707 }); 16708 } 16709 function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { 16710 exception.mechanism = exception.mechanism || { type: "generic", handled: true }; 16711 exception.mechanism = __spreadProps(__spreadValues({}, exception.mechanism), { 16712 type: "chained", 16713 source, 16714 exception_id: exceptionId, 16715 parent_id: parentId 16716 }); 16717 } 16718 function truncateAggregateExceptions(exceptions, maxValueLength) { 16719 return exceptions.map((exception) => { 16720 if (exception.value) { 16721 exception.value = truncate(exception.value, maxValueLength); 16722 } 16723 return exception; 16724 }); 16725 } 16726 function parseUrl$1(url) { 16727 if (!url) { 16728 return {}; 16729 } 16730 const match2 = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); 16731 if (!match2) { 16732 return {}; 16733 } 16734 const query = match2[6] || ""; 16735 const fragment = match2[8] || ""; 16736 return { 16737 host: match2[4],
16738 path: match2[5], 16739 protocol: match2[2], 16740 search: query, 16741 hash: fragment, 16742 relative: match2[5] + query + fragment 16743 // everything minus origin 16744 }; 16745 } 16746 function addConsoleInstrumentationHandler(handler) { 16747 const type = "console"; 16748 addHandler$1(type, handler); 16749 maybeInstrument(type, instrumentConsole); 16750 } 16751 function instrumentConsole() { 16752 if (!("console" in GLOBAL_OBJ)) { 16753 return; 16754 } 16755 CONSOLE_LEVELS.forEach(function(level) { 16756 if (!(level in GLOBAL_OBJ.console)) { 16757 return; 16758 } 16759 fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) { 16760 originalConsoleMethods[level] = originalConsoleMethod; 16761 return function(...args) { 16762 const handlerData = { args, level }; 16763 triggerHandlers$1("console", handlerData); 16764 const log = originalConsoleMethods[level]; 16765 log && log.apply(GLOBAL_OBJ.console, args); 16766 }; 16767 }); 16768 }); 16769 } 16770 function severityLevelFromString(level) { 16771 return level === "warn" ? "warning" : ["fatal", "error", "warning", "log", "info", "debug"].includes(level) ? level : "log"; 16772 } 16773 const INTEGRATION_NAME$4 = "Dedupe"; 16774 const _dedupeIntegration = (() => { 16775 let previousEvent; 16776 return { 16777 name: INTEGRATION_NAME$4, 16778 processEvent(currentEvent) { 16779 if (currentEvent.type) { 16780 return currentEvent; 16781 } 16782 try { 16783 if (_shouldDropEvent(currentEvent, previousEvent)) { 16784 DEBUG_BUILD$3 && logger.warn("Event dropped due to being a duplicate of previously captured event."); 16785 return null; 16786 } 16787 } catch (_oO) { 16788 } 16789 return previousEvent = currentEvent; 16790 } 16791 }; 16792 }); 16793 const dedupeIntegration = defineIntegration(_dedupeIntegration); 16794 function _shouldDropEvent(currentEvent, previousEvent) { 16795 if (!previousEvent) { 16796 return false; 16797 } 16798 if (_isSameMessageEvent(currentEvent, previousEvent)) { 16799 return true; 16800 } 16801 if (_isSameExceptionEvent(currentEvent, previousEvent)) { 16802 return true; 16803 } 16804 return false; 16805 } 16806 function _isSameMessageEvent(currentEvent, previousEvent) { 16807 const currentMessage = currentEvent.message; 16808 const previousMessage = previousEvent.message; 16809 if (!currentMessage && !previousMessage) { 16810 return false; 16811 } 16812 if (currentMessage && !previousMessage || !currentMessage && previousMessage) { 16813 return false; 16814 } 16815 if (currentMessage !== previousMessage) { 16816 return false; 16817 } 16818 if (!_isSameFingerprint(currentEvent, previousEvent)) { 16819 return false; 16820 } 16821 if (!_isSameStacktrace(currentEvent, previousEvent)) { 16822 return false; 16823 } 16824 return true; 16825 } 16826 function _isSameExceptionEvent(currentEvent, previousEvent) { 16827 const previousException = _getExceptionFromEvent(previousEvent); 16828 const currentException = _getExceptionFromEvent(currentEvent); 16829 if (!previousException || !currentException) { 16830 return false; 16831 } 16832 if (previousException.type !== currentException.type || previousException.value !== currentException.value) { 16833 return false; 16834 } 16835 if (!_isSameFingerprint(currentEvent, previousEvent)) { 16836 return false; 16837 } 16838 if (!_isSameStacktrace(currentEvent, previousEvent)) { 16839 return false; 16840 } 16841 return true; 16842 } 16843 function _isSameStacktrace(currentEvent, previousEvent) { 16844 let currentFrames = getFramesFromEvent(currentEvent); 16845 let previousFrames = getFramesFromEvent(previousEvent); 16846 if (!currentFrames && !previousFrames) { 16847 return true; 16848 } 16849 if (currentFrames && !previousFrames || !currentFrames && previousFrames) { 16850 return false; 16851 } 16852 currentFrames = currentFrames; 16853 previousFrames = previousFrames; 16854 if (previousFrames.length !== currentFrames.length) { 16855 return false; 16856 } 16857 for (let i2 = 0; i2 < previousFrames.length; i2++) { 16858 const frameA = previousFrames[i2]; 16859 const frameB = currentFrames[i2]; 16860 if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) { 16861 return false;
16862 } 16863 } 16864 return true; 16865 } 16866 function _isSameFingerprint(currentEvent, previousEvent) { 16867 let currentFingerprint = currentEvent.fingerprint; 16868 let previousFingerprint = previousEvent.fingerprint; 16869 if (!currentFingerprint && !previousFingerprint) { 16870 return true; 16871 } 16872 if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) { 16873 return false; 16874 } 16875 currentFingerprint = currentFingerprint; 16876 previousFingerprint = previousFingerprint; 16877 try { 16878 return !!(currentFingerprint.join("") === previousFingerprint.join("")); 16879 } catch (_oO) { 16880 return false; 16881 } 16882 } 16883 function _getExceptionFromEvent(event) { 16884 return event.exception && event.exception.values && event.exception.values[0]; 16885 } 16886 function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans, spanOrigin = "auto.http.browser") { 16887 if (!handlerData.fetchData) { 16888 return void 0; 16889 } 16890 const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url); 16891 if (handlerData.endTimestamp && shouldCreateSpanResult) { 16892 const spanId = handlerData.fetchData.__span; 16893 if (!spanId) return; 16894 const span2 = spans[spanId]; 16895 if (span2) { 16896 endSpan(span2, handlerData); 16897 delete spans[spanId]; 16898 } 16899 return void 0; 16900 } 16901 const { method, url } = handlerData.fetchData; 16902 const fullUrl = getFullURL$1(url); 16903 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 16904 const hasParent = !!getActiveSpan(); 16905 const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ 16906 name: `${method} ${url}`, 16907 attributes: { 16908 url, 16909 type: "fetch", 16910 "http.method": method, 16911 "http.url": fullUrl, 16912 "server.address": host, 16913 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, 16914 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" 16915 } 16916 }) : new SentryNonRecordingSpan(); 16917 handlerData.fetchData.__span = span.spanContext().spanId; 16918 spans[span.spanContext().spanId] = span; 16919 if (shouldAttachHeaders2(handlerData.fetchData.url)) { 16920 const request = handlerData.args[0]; 16921 const options2 = handlerData.args[1] || {}; 16922 const headers = _addTracingHeadersToFetchRequest( 16923 request, 16924 options2, 16925 // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), 16926 // we do not want to use the span as base for the trace headers, 16927 // which means that the headers will be generated from the scope and the sampling decision is deferred 16928 hasTracingEnabled() && hasParent ? span : void 0 16929 ); 16930 if (headers) { 16931 handlerData.args[1] = options2; 16932 options2.headers = headers; 16933 } 16934 } 16935 return span; 16936 } 16937 function _addTracingHeadersToFetchRequest(request, fetchOptionsObj, span) { 16938 const traceHeaders = getTraceData({ span }); 16939 const sentryTrace = traceHeaders["sentry-trace"]; 16940 const baggage = traceHeaders.baggage; 16941 if (!sentryTrace) { 16942 return void 0; 16943 } 16944 const headers = fetchOptionsObj.headers || (isRequest$1(request) ? request.headers : void 0); 16945 if (!headers) { 16946 return __spreadValues({}, traceHeaders); 16947 } else if (isHeaders$1(headers)) { 16948 const newHeaders = new Headers(headers); 16949 newHeaders.set("sentry-trace", sentryTrace); 16950 if (baggage) { 16951 const prevBaggageHeader = newHeaders.get("baggage"); 16952 if (prevBaggageHeader) { 16953 const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); 16954 newHeaders.set( 16955 "baggage", 16956 // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header 16957 // otherwise just set the sentry baggage header 16958 prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage 16959 ); 16960 } else { 16961 newHeaders.set("baggage", baggage); 16962 } 16963 } 16964 return newHeaders; 16965 } else if (Array.isArray(headers)) { 16966 const newHeaders = [ 16967 ...headers.filter((header) => { 16968 return !(Array.isArray(header) && header[0] === "sentry-trace"); 16969 }).map((header) => { 16970 if (Array.isArray(header) && header[0] === "baggage" && typeof header[1] === "string") { 16971 const [headerName, headerValue, ...rest] = header; 16972 return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; 16973 } else { 16974 return header; 16975 } 16976 }), 16977 // Attach the new sentry-trace header 16978 ["sentry-trace", sentryTrace] 16979 ]; 16980 if (baggage) { 16981 newHeaders.push(["baggage", baggage]); 16982 } 16983 return newHeaders; 16984 } else { 16985 const existingBaggageHeader = "baggage" in headers ? headers.baggage : void 0; 16986 let newBaggageHeaders = []; 16987 if (Array.isArray(existingBaggageHeader)) { 16988 newBaggageHeaders = existingBaggageHeader.map( 16989 (headerItem) => typeof headerItem === "string" ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem 16990 ).filter((headerItem) => headerItem === ""); 16991 } else if (existingBaggageHeader) { 16992 newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); 16993 } 16994 if (baggage) { 16995 newBaggageHeaders.push(baggage); 16996 } 16997 return __spreadProps(__spreadValues({}, headers), { 16998 "sentry-trace": sentryTrace, 16999 baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(",") : void 0 17000 }); 17001 } 17002 } 17003 function getFullURL$1(url) {
17004 try { 17005 const parsed = new URL(url); 17006 return parsed.href; 17007 } catch (e2) { 17008 return void 0; 17009 } 17010 } 17011 function endSpan(span, handlerData) { 17012 if (handlerData.response) { 17013 setHttpStatus(span, handlerData.response.status); 17014 const contentLength = handlerData.response && handlerData.response.headers && handlerData.response.headers.get("content-length"); 17015 if (contentLength) { 17016 const contentLengthNum = parseInt(contentLength); 17017 if (contentLengthNum > 0) { 17018 span.setAttribute("http.response_content_length", contentLengthNum); 17019 } 17020 } 17021 } else if (handlerData.error) { 17022 span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" }); 17023 } 17024 span.end(); 17025 } 17026 function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { 17027 return baggageHeader.split(",").filter((baggageEntry) => !baggageEntry.split("=")[0].startsWith(SENTRY_BAGGAGE_KEY_PREFIX)).join(","); 17028 } 17029 function isRequest$1(request) { 17030 return typeof Request !== "undefined" && isInstanceOf(request, Request); 17031 } 17032 function isHeaders$1(headers) { 17033 return typeof Headers !== "undefined" && isInstanceOf(headers, Headers); 17034 } 17035 function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { 17036 if (statusCode === void 0) { 17037 return void 0; 17038 } else if (statusCode >= 400 && statusCode < 500) { 17039 return "warning"; 17040 } else if (statusCode >= 500) { 17041 return "error"; 17042 } else { 17043 return void 0; 17044 } 17045 } 17046 const WINDOW$3 = GLOBAL_OBJ; 17047 function supportsFetch() { 17048 if (!("fetch" in WINDOW$3)) { 17049 return false; 17050 } 17051 try { 17052 new Headers(); 17053 new Request("http://www.example.com"); 17054 new Response(); 17055 return true; 17056 } catch (e2) { 17057 return false; 17058 } 17059 } 17060 function isNativeFunction(func) { 17061 return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); 17062 } 17063 function supportsNativeFetch() { 17064 if (typeof EdgeRuntime === "string") { 17065 return true; 17066 } 17067 if (!supportsFetch()) { 17068 return false; 17069 } 17070 if (isNativeFunction(WINDOW$3.fetch)) { 17071 return true; 17072 } 17073 let result = false;
17074 const doc = WINDOW$3.document; 17075 if (doc && typeof doc.createElement === "function") { 17076 try { 17077 const sandbox = doc.createElement("iframe"); 17078 sandbox.hidden = true; 17079 doc.head.appendChild(sandbox); 17080 if (sandbox.contentWindow && sandbox.contentWindow.fetch) { 17081 result = isNativeFunction(sandbox.contentWindow.fetch); 17082 } 17083 doc.head.removeChild(sandbox); 17084 } catch (err) { 17085 DEBUG_BUILD$2 && logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", err); 17086 } 17087 } 17088 return result; 17089 } 17090 function addFetchInstrumentationHandler(handler, skipNativeFetchCheck) { 17091 const type = "fetch"; 17092 addHandler$1(type, handler); 17093 maybeInstrument(type, () => instrumentFetch(void 0, skipNativeFetchCheck)); 17094 } 17095 function addFetchEndInstrumentationHandler(handler) { 17096 const type = "fetch-body-resolved"; 17097 addHandler$1(type, handler); 17098 maybeInstrument(type, () => instrumentFetch(streamHandler)); 17099 } 17100 function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { 17101 if (skipNativeFetchCheck && !supportsNativeFetch()) { 17102 return; 17103 } 17104 fill(GLOBAL_OBJ, "fetch", function(originalFetch) { 17105 return function(...args) { 17106 const virtualError = new Error(); 17107 const { method, url } = parseFetchArgs(args); 17108 const handlerData = { 17109 args, 17110 fetchData: { 17111 method, 17112 url 17113 }, 17114 startTimestamp: timestampInSeconds() * 1e3, 17115 // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation 17116 virtualError 17117 }; 17118 if (!onFetchResolved) { 17119 triggerHandlers$1("fetch", __spreadValues({}, handlerData)); 17120 } 17121 return originalFetch.apply(GLOBAL_OBJ, args).then( 17122 (response) => __async(null, null, function* () { 17123 if (onFetchResolved) { 17124 onFetchResolved(response); 17125 } else { 17126 triggerHandlers$1("fetch", __spreadProps(__spreadValues({}, handlerData), { 17127 endTimestamp: timestampInSeconds() * 1e3, 17128 response 17129 })); 17130 } 17131 return response; 17132 }), 17133 (error) => { 17134 triggerHandlers$1("fetch", __spreadProps(__spreadValues({}, handlerData), { 17135 endTimestamp: timestampInSeconds() * 1e3, 17136 error 17137 })); 17138 if (isError(error) && error.stack === void 0) { 17139 error.stack = virtualError.stack; 17140 addNonEnumerableProperty(error, "framesToPop", 1); 17141 } 17142 throw error; 17143 } 17144 ); 17145 }; 17146 }); 17147 } 17148 function resolveResponse(res, onFinishedResolving) { 17149 return __async(this, null, function* () { 17150 if (res && res.body) { 17151 const body = res.body; 17152 const responseReader = body.getReader(); 17153 const maxFetchDurationTimeout = setTimeout( 17154 () => { 17155 body.cancel().then(null, () => { 17156 }); 17157 }, 17158 90 * 1e3 17159 // 90s 17160 ); 17161 let readingActive = true; 17162 while (readingActive) { 17163 let chunkTimeout; 17164 try { 17165 chunkTimeout = setTimeout(() => { 17166 body.cancel().then(null, () => { 17167 }); 17168 }, 5e3); 17169 const { done } = yield responseReader.read(); 17170 clearTimeout(chunkTimeout); 17171 if (done) { 17172 onFinishedResolving(); 17173 readingActive = false; 17174 } 17175 } catch (error) { 17176 readingActive = false; 17177 } finally { 17178 clearTimeout(chunkTimeout); 17179 } 17180 } 17181 clearTimeout(maxFetchDurationTimeout); 17182 responseReader.releaseLock(); 17183 body.cancel().then(null, () => { 17184 }); 17185 } 17186 }); 17187 } 17188 function streamHandler(response) { 17189 let clonedResponseForResolving;
17190 try { 17191 clonedResponseForResolving = response.clone(); 17192 } catch (e2) { 17193 return; 17194 } 17195 resolveResponse(clonedResponseForResolving, () => { 17196 triggerHandlers$1("fetch-body-resolved", { 17197 endTimestamp: timestampInSeconds() * 1e3, 17198 response 17199 }); 17200 }); 17201 } 17202 function hasProp(obj, prop) { 17203 return !!obj && typeof obj === "object" && !!obj[prop]; 17204 } 17205 function getUrlFromResource(resource) { 17206 if (typeof resource === "string") { 17207 return resource; 17208 } 17209 if (!resource) { 17210 return ""; 17211 } 17212 if (hasProp(resource, "url")) { 17213 return resource.url; 17214 } 17215 if (resource.toString) { 17216 return resource.toString(); 17217 } 17218 return ""; 17219 } 17220 function parseFetchArgs(fetchArgs) { 17221 if (fetchArgs.length === 0) { 17222 return { method: "GET", url: "" }; 17223 } 17224 if (fetchArgs.length === 2) { 17225 const [url, options2] = fetchArgs; 17226 return { 17227 url: getUrlFromResource(url), 17228 method: hasProp(options2, "method") ? String(options2.method).toUpperCase() : "GET" 17229 }; 17230 } 17231 const arg = fetchArgs[0]; 17232 return { 17233 url: getUrlFromResource(arg), 17234 method: hasProp(arg, "method") ? String(arg.method).toUpperCase() : "GET" 17235 }; 17236 } 17237 function getSDKSource() { 17238 return "npm"; 17239 } 17240 const WINDOW$2 = GLOBAL_OBJ; 17241 function supportsHistory() { 17242 const chromeVar = WINDOW$2.chrome; 17243 const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; 17244 const hasHistoryApi = "history" in WINDOW$2 && !!WINDOW$2.history.pushState && !!WINDOW$2.history.replaceState; 17245 return !isChromePackagedApp && hasHistoryApi; 17246 } 17247 const WINDOW$1 = GLOBAL_OBJ; 17248 let ignoreOnError = 0; 17249 function shouldIgnoreOnError() { 17250 return ignoreOnError > 0; 17251 } 17252 function ignoreNextOnError() { 17253 ignoreOnError++; 17254 setTimeout(() => { 17255 ignoreOnError--; 17256 }); 17257 } 17258 function wrap(fn2, options2 = {}) { 17259 function isFunction2(fn3) { 17260 return typeof fn3 === "function"; 17261 } 17262 if (!isFunction2(fn2)) { 17263 return fn2; 17264 } 17265 try { 17266 const wrapper = fn2.__sentry_wrapped__; 17267 if (wrapper) { 17268 if (typeof wrapper === "function") { 17269 return wrapper; 17270 } else { 17271 return fn2; 17272 } 17273 } 17274 if (getOriginalFunction(fn2)) { 17275 return fn2; 17276 } 17277 } catch (e2) { 17278 return fn2; 17279 } 17280 const sentryWrapped = function(...args) { 17281 try { 17282 const wrappedArguments = args.map((arg) => wrap(arg, options2)); 17283 return fn2.apply(this, wrappedArguments); 17284 } catch (ex) { 17285 ignoreNextOnError(); 17286 withScope((scope) => { 17287 scope.addEventProcessor((event) => { 17288 if (options2.mechanism) { 17289 addExceptionTypeValue(event, void 0); 17290 addExceptionMechanism(event, options2.mechanism); 17291 } 17292 event.extra = __spreadProps(__spreadValues({}, event.extra), { 17293 arguments: args 17294 }); 17295 return event; 17296 }); 17297 captureException(ex); 17298 }); 17299 throw ex; 17300 } 17301 }; 17302 try { 17303 for (const property2 in fn2) { 17304 if (Object.prototype.hasOwnProperty.call(fn2, property2)) { 17305 sentryWrapped[property2] = fn2[property2]; 17306 } 17307 } 17308 } catch (e2) { 17309 } 17310 markFunctionWrapped(sentryWrapped, fn2); 17311 addNonEnumerableProperty(fn2, "__sentry_wrapped__", sentryWrapped); 17312 try { 17313 const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, "name"); 17314 if (descriptor.configurable) { 17315 Object.defineProperty(sentryWrapped, "name", { 17316 get() { 17317 return fn2.name; 17318 } 17319 }); 17320 } 17321 } catch (e3) { 17322 } 17323 return sentryWrapped; 17324 } 17325 const DEBUG_BUILD$1 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 17326 function exceptionFromError(stackParser, ex) { 17327 const frames = parseStackFrames(stackParser, ex); 17328 const exception = { 17329 type: extractType(ex), 17330 value: extractMessage(ex) 17331 }; 17332 if (frames.length) { 17333 exception.stacktrace = { frames }; 17334 } 17335 if (exception.type === void 0 && exception.value === "") { 17336 exception.value = "Unrecoverable error caught"; 17337 } 17338 return exception; 17339 } 17340 function eventFromPlainObject(stackParser, exception, syntheticException, isUnhandledRejection) { 17341 const client2 = getClient(); 17342 const normalizeDepth = client2 && client2.getOptions().normalizeDepth; 17343 const errorFromProp = getErrorPropertyFromObject(exception); 17344 const extra = { 17345 __serialized__: normalizeToSize(exception, normalizeDepth) 17346 }; 17347 if (errorFromProp) { 17348 return { 17349 exception: { 17350 values: [exceptionFromError(stackParser, errorFromProp)] 17351 }, 17352 extra 17353 }; 17354 } 17355 const event = { 17356 exception: { 17357 values: [ 17358 { 17359 type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? "UnhandledRejection" : "Error", 17360 value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) 17361 } 17362 ] 17363 }, 17364 extra 17365 }; 17366 if (syntheticException) { 17367 const frames = parseStackFrames(stackParser, syntheticException); 17368 if (frames.length) { 17369 event.exception.values[0].stacktrace = { frames }; 17370 } 17371 } 17372 return event; 17373 } 17374 function eventFromError(stackParser, ex) { 17375 return { 17376 exception: { 17377 values: [exceptionFromError(stackParser, ex)] 17378 } 17379 }; 17380 } 17381 function parseStackFrames(stackParser, ex) { 17382 const stacktrace = ex.stacktrace || ex.stack || ""; 17383 const skipLines = getSkipFirstStackStringLines(ex); 17384 const framesToPop = getPopFirstTopFrames(ex);
17385 try { 17386 return stackParser(stacktrace, skipLines, framesToPop); 17387 } catch (e2) { 17388 } 17389 return []; 17390 } 17391 const reactMinifiedRegexp = /Minified React error #\d+;/i; 17392 function getSkipFirstStackStringLines(ex) { 17393 if (ex && reactMinifiedRegexp.test(ex.message)) { 17394 return 1; 17395 } 17396 return 0; 17397 } 17398 function getPopFirstTopFrames(ex) { 17399 if (typeof ex.framesToPop === "number") { 17400 return ex.framesToPop; 17401 } 17402 return 0; 17403 } 17404 function isWebAssemblyException(exception) { 17405 if (typeof WebAssembly !== "undefined" && typeof WebAssembly.Exception !== "undefined") { 17406 return exception instanceof WebAssembly.Exception; 17407 } else { 17408 return false; 17409 } 17410 } 17411 function extractType(ex) { 17412 const name = ex && ex.name; 17413 if (!name && isWebAssemblyException(ex)) { 17414 const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2; 17415 return hasTypeInMessage ? ex.message[0] : "WebAssembly.Exception"; 17416 } 17417 return name; 17418 } 17419 function extractMessage(ex) { 17420 const message = ex && ex.message; 17421 if (!message) { 17422 return "No error message"; 17423 } 17424 if (message.error && typeof message.error.message === "string") { 17425 return message.error.message; 17426 } 17427 if (isWebAssemblyException(ex) && Array.isArray(ex.message) && ex.message.length == 2) { 17428 return ex.message[1]; 17429 } 17430 return message; 17431 } 17432 function eventFromException(stackParser, exception, hint, attachStacktrace) { 17433 const syntheticException = hint && hint.syntheticException || void 0; 17434 const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace); 17435 addExceptionMechanism(event); 17436 event.level = "error"; 17437 if (hint && hint.event_id) { 17438 event.event_id = hint.event_id; 17439 } 17440 return resolvedSyncPromise(event); 17441 } 17442 function eventFromMessage(stackParser, message, level = "info", hint, attachStacktrace) { 17443 const syntheticException = hint && hint.syntheticException || void 0; 17444 const event = eventFromString(stackParser, message, syntheticException, attachStacktrace); 17445 event.level = level; 17446 if (hint && hint.event_id) { 17447 event.event_id = hint.event_id; 17448 } 17449 return resolvedSyncPromise(event); 17450 } 17451 function eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace, isUnhandledRejection) { 17452 let event; 17453 if (isErrorEvent$1(exception) && exception.error) { 17454 const errorEvent = exception; 17455 return eventFromError(stackParser, errorEvent.error); 17456 } 17457 if (isDOMError(exception) || isDOMException(exception)) { 17458 const domException = exception; 17459 if ("stack" in exception) { 17460 event = eventFromError(stackParser, exception); 17461 } else { 17462 const name = domException.name || (isDOMError(domException) ? "DOMError" : "DOMException"); 17463 const message = domException.message ? `${name}: ${domException.message}` : name; 17464 event = eventFromString(stackParser, message, syntheticException, attachStacktrace); 17465 addExceptionTypeValue(event, message); 17466 } 17467 if ("code" in domException) { 17468 event.tags = __spreadProps(__spreadValues({}, event.tags), { "DOMException.code": `${domException.code}` }); 17469 } 17470 return event; 17471 } 17472 if (isError(exception)) { 17473 return eventFromError(stackParser, exception); 17474 } 17475 if (isPlainObject$3(exception) || isEvent(exception)) { 17476 const objectException = exception; 17477 event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection); 17478 addExceptionMechanism(event, { 17479 synthetic: true 17480 }); 17481 return event; 17482 } 17483 event = eventFromString(stackParser, exception, syntheticException, attachStacktrace); 17484 addExceptionTypeValue(event, `${exception}`); 17485 addExceptionMechanism(event, { 17486 synthetic: true 17487 }); 17488 return event; 17489 } 17490 function eventFromString(stackParser, message, syntheticException, attachStacktrace) { 17491 const event = {}; 17492 if (attachStacktrace && syntheticException) { 17493 const frames = parseStackFrames(stackParser, syntheticException); 17494 if (frames.length) { 17495 event.exception = { 17496 values: [{ value: message, stacktrace: { frames } }] 17497 }; 17498 } 17499 addExceptionMechanism(event, { synthetic: true }); 17500 } 17501 if (isParameterizedString(message)) {
17502 const { __sentry_template_string__, __sentry_template_values__ } = message; 17503 event.logentry = { 17504 message: __sentry_template_string__, 17505 params: __sentry_template_values__ 17506 }; 17507 return event; 17508 } 17509 event.message = message; 17510 return event; 17511 } 17512 function getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }) { 17513 const keys2 = extractExceptionKeysForMessage(exception); 17514 const captureType = isUnhandledRejection ? "promise rejection" : "exception"; 17515 if (isErrorEvent$1(exception)) { 17516 return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``; 17517 } 17518 if (isEvent(exception)) { 17519 const className = getObjectClassName(exception); 17520 return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`; 17521 } 17522 return `Object captured as ${captureType} with keys: ${keys2}`; 17523 } 17524 function getObjectClassName(obj) { 17525 try { 17526 const prototype2 = Object.getPrototypeOf(obj); 17527 return prototype2 ? prototype2.constructor.name : void 0; 17528 } catch (e2) { 17529 } 17530 } 17531 function getErrorPropertyFromObject(obj) { 17532 for (const prop in obj) { 17533 if (Object.prototype.hasOwnProperty.call(obj, prop)) { 17534 const value = obj[prop]; 17535 if (value instanceof Error) { 17536 return value; 17537 } 17538 } 17539 } 17540 return void 0; 17541 } 17542 function createUserFeedbackEnvelope(feedback, { 17543 metadata, 17544 tunnel, 17545 dsn 17546 }) { 17547 const headers = __spreadValues(__spreadValues({ 17548 event_id: feedback.event_id, 17549 sent_at: (/* @__PURE__ */ new Date()).toISOString() 17550 }, metadata && metadata.sdk && { 17551 sdk: { 17552 name: metadata.sdk.name, 17553 version: metadata.sdk.version 17554 } 17555 }), !!tunnel && !!dsn && { dsn: dsnToString(dsn) }); 17556 const item = createUserFeedbackEnvelopeItem(feedback); 17557 return createEnvelope(headers, [item]); 17558 } 17559 function createUserFeedbackEnvelopeItem(feedback) { 17560 const feedbackHeaders = { 17561 type: "user_report" 17562 }; 17563 return [feedbackHeaders, feedback]; 17564 } 17565 class BrowserClient extends BaseClient { 17566 /** 17567 * Creates a new Browser SDK instance. 17568 * 17569 * @param options Configuration options for this SDK. 17570 */ 17571 constructor(options2) { 17572 const opts = __spreadValues({ 17573 // We default this to true, as it is the safer scenario 17574 parentSpanIsAlwaysRootSpan: true 17575 }, options2); 17576 const sdkSource = WINDOW$1.SENTRY_SDK_SOURCE || getSDKSource(); 17577 applySdkMetadata(opts, "browser", ["browser"], sdkSource); 17578 super(opts); 17579 if (opts.sendClientReports && WINDOW$1.document) { 17580 WINDOW$1.document.addEventListener("visibilitychange", () => { 17581 if (WINDOW$1.document.visibilityState === "hidden") { 17582 this._flushOutcomes(); 17583 } 17584 }); 17585 } 17586 } 17587 /** 17588 * @inheritDoc 17589 */ 17590 eventFromException(exception, hint) { 17591 return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace); 17592 } 17593 /** 17594 * @inheritDoc 17595 */ 17596 eventFromMessage(message, level = "info", hint) { 17597 return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace); 17598 } 17599 /** 17600 * Sends user feedback to Sentry. 17601 * 17602 * @deprecated Use `captureFeedback` instead. 17603 */ 17604 captureUserFeedback(feedback) { 17605 if (!this._isEnabled()) { 17606 DEBUG_BUILD$1 && logger.warn("SDK not enabled, will not capture user feedback."); 17607 return; 17608 } 17609 const envelope = createUserFeedbackEnvelope(feedback, { 17610 metadata: this.getSdkMetadata(), 17611 dsn: this.getDsn(), 17612 tunnel: this.getOptions().tunnel 17613 }); 17614 this.sendEnvelope(envelope); 17615 } 17616 /** 17617 * @inheritDoc 17618 */ 17619 _prepareEvent(event, hint, scope) { 17620 event.platform = event.platform || "javascript"; 17621 return super._prepareEvent(event, hint, scope); 17622 } 17623 } 17624 const DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; 17625 const getRating = (value, thresholds) => { 17626 if (value > thresholds[1]) { 17627 return "poor"; 17628 } 17629 if (value > thresholds[0]) { 17630 return "needs-improvement"; 17631 } 17632 return "good"; 17633 }; 17634 const bindReporter = (callback, metric, thresholds, reportAllChanges) => { 17635 let prevValue; 17636 let delta; 17637 return (forceReport) => { 17638 if (metric.value >= 0) { 17639 if (forceReport || reportAllChanges) {
17640 delta = metric.value - (prevValue || 0); 17641 if (delta || prevValue === void 0) { 17642 prevValue = metric.value; 17643 metric.delta = delta; 17644 metric.rating = getRating(metric.value, thresholds); 17645 callback(metric); 17646 } 17647 } 17648 } 17649 }; 17650 }; 17651 const WINDOW = GLOBAL_OBJ; 17652 const generateUniqueID = () => { 17653 return `v4-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`; 17654 }; 17655 const getNavigationEntry = (checkResponseStart = true) => { 17656 const navigationEntry = WINDOW.performance && WINDOW.performance.getEntriesByType && WINDOW.performance.getEntriesByType("navigation")[0]; 17657 if ( 17658 // sentry-specific change: 17659 // We don't want to check for responseStart for our own use of `getNavigationEntry` 17660 !checkResponseStart || navigationEntry && navigationEntry.responseStart > 0 && navigationEntry.responseStart < performance.now() 17661 ) { 17662 return navigationEntry; 17663 } 17664 }; 17665 const getActivationStart = () => { 17666 const navEntry = getNavigationEntry(); 17667 return navEntry && navEntry.activationStart || 0; 17668 }; 17669 const initMetric = (name, value) => { 17670 const navEntry = getNavigationEntry(); 17671 let navigationType = "navigate"; 17672 if (navEntry) { 17673 if (WINDOW.document && WINDOW.document.prerendering || getActivationStart() > 0) { 17674 navigationType = "prerender"; 17675 } else if (WINDOW.document && WINDOW.document.wasDiscarded) { 17676 navigationType = "restore"; 17677 } else if (navEntry.type) { 17678 navigationType = navEntry.type.replace(/_/g, "-"); 17679 } 17680 } 17681 const entries2 = []; 17682 return { 17683 name, 17684 value: typeof value === "undefined" ? -1 : value, 17685 rating: "good", 17686 // If needed, will be updated when reported. `const` to keep the type from widening to `string`. 17687 delta: 0, 17688 entries: entries2, 17689 id: generateUniqueID(), 17690 navigationType 17691 }; 17692 }; 17693 const observe = (type, callback, opts) => { 17694 try { 17695 if (PerformanceObserver.supportedEntryTypes.includes(type)) { 17696 const po2 = new PerformanceObserver((list) => { 17697 Promise.resolve().then(() => { 17698 callback(list.getEntries()); 17699 }); 17700 }); 17701 po2.observe( 17702 Object.assign( 17703 { 17704 type, 17705 buffered: true 17706 }, 17707 opts || {} 17708 ) 17709 ); 17710 return po2; 17711 } 17712 } catch (e2) { 17713 } 17714 return; 17715 }; 17716 const onHidden = (cb) => { 17717 const onHiddenOrPageHide = (event) => { 17718 if (event.type === "pagehide" || WINDOW.document && WINDOW.document.visibilityState === "hidden") { 17719 cb(event); 17720 } 17721 }; 17722 if (WINDOW.document) { 17723 addEventListener("visibilitychange", onHiddenOrPageHide, true); 17724 addEventListener("pagehide", onHiddenOrPageHide, true); 17725 } 17726 }; 17727 const runOnce = (cb) => { 17728 let called = false; 17729 return () => { 17730 if (!called) { 17731 cb(); 17732 called = true; 17733 } 17734 }; 17735 }; 17736 let firstHiddenTime = -1; 17737 const initHiddenTime = () => { 17738 return WINDOW.document.visibilityState === "hidden" && !WINDOW.document.prerendering ? 0 : Infinity; 17739 }; 17740 const onVisibilityUpdate = (event) => { 17741 if (WINDOW.document.visibilityState === "hidden" && firstHiddenTime > -1) { 17742 firstHiddenTime = event.type === "visibilitychange" ? event.timeStamp : 0; 17743 removeChangeListeners(); 17744 } 17745 }; 17746 const addChangeListeners = () => { 17747 addEventListener("visibilitychange", onVisibilityUpdate, true); 17748 addEventListener("prerenderingchange", onVisibilityUpdate, true); 17749 }; 17750 const removeChangeListeners = () => { 17751 removeEventListener("visibilitychange", onVisibilityUpdate, true); 17752 removeEventListener("prerenderingchange", onVisibilityUpdate, true); 17753 }; 17754 const getVisibilityWatcher = () => { 17755 if (WINDOW.document && firstHiddenTime < 0) { 17756 firstHiddenTime = initHiddenTime(); 17757 addChangeListeners(); 17758 } 17759 return { 17760 get firstHiddenTime() { 17761 return firstHiddenTime; 17762 } 17763 }; 17764 }; 17765 const whenActivated = (callback) => { 17766 if (WINDOW.document && WINDOW.document.prerendering) { 17767 addEventListener("prerenderingchange", () => callback(), true); 17768 } else { 17769 callback(); 17770 } 17771 }; 17772 const FCPThresholds = [1800, 3e3]; 17773 const onFCP = (onReport, opts = {}) => { 17774 whenActivated(() => { 17775 const visibilityWatcher = getVisibilityWatcher(); 17776 const metric = initMetric("FCP"); 17777 let report; 17778 const handleEntries = (entries2) => {
17779 entries2.forEach((entry) => { 17780 if (entry.name === "first-contentful-paint") { 17781 po2.disconnect(); 17782 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17783 metric.value = Math.max(entry.startTime - getActivationStart(), 0); 17784 metric.entries.push(entry); 17785 report(true); 17786 } 17787 } 17788 }); 17789 }; 17790 const po2 = observe("paint", handleEntries); 17791 if (po2) { 17792 report = bindReporter(onReport, metric, FCPThresholds, opts.reportAllChanges); 17793 } 17794 }); 17795 }; 17796 const CLSThresholds = [0.1, 0.25]; 17797 const onCLS = (onReport, opts = {}) => { 17798 onFCP( 17799 runOnce(() => { 17800 const metric = initMetric("CLS", 0); 17801 let report; 17802 let sessionValue = 0; 17803 let sessionEntries = []; 17804 const handleEntries = (entries2) => { 17805 entries2.forEach((entry) => { 17806 if (!entry.hadRecentInput) { 17807 const firstSessionEntry = sessionEntries[0]; 17808 const lastSessionEntry = sessionEntries[sessionEntries.length - 1]; 17809 if (sessionValue && firstSessionEntry && lastSessionEntry && entry.startTime - lastSessionEntry.startTime < 1e3 && entry.startTime - firstSessionEntry.startTime < 5e3) { 17810 sessionValue += entry.value; 17811 sessionEntries.push(entry); 17812 } else { 17813 sessionValue = entry.value; 17814 sessionEntries = [entry]; 17815 } 17816 } 17817 }); 17818 if (sessionValue > metric.value) { 17819 metric.value = sessionValue; 17820 metric.entries = sessionEntries; 17821 report(); 17822 } 17823 }; 17824 const po2 = observe("layout-shift", handleEntries); 17825 if (po2) { 17826 report = bindReporter(onReport, metric, CLSThresholds, opts.reportAllChanges); 17827 onHidden(() => { 17828 handleEntries(po2.takeRecords()); 17829 report(true); 17830 }); 17831 setTimeout(report, 0); 17832 } 17833 }) 17834 ); 17835 }; 17836 const FIDThresholds = [100, 300]; 17837 const onFID = (onReport, opts = {}) => { 17838 whenActivated(() => { 17839 const visibilityWatcher = getVisibilityWatcher(); 17840 const metric = initMetric("FID"); 17841 let report; 17842 const handleEntry = (entry) => { 17843 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17844 metric.value = entry.processingStart - entry.startTime; 17845 metric.entries.push(entry); 17846 report(true); 17847 } 17848 }; 17849 const handleEntries = (entries2) => { 17850 entries2.forEach(handleEntry); 17851 }; 17852 const po2 = observe("first-input", handleEntries); 17853 report = bindReporter(onReport, metric, FIDThresholds, opts.reportAllChanges); 17854 if (po2) { 17855 onHidden( 17856 runOnce(() => { 17857 handleEntries(po2.takeRecords()); 17858 po2.disconnect(); 17859 }) 17860 ); 17861 } 17862 }); 17863 }; 17864 let interactionCountEstimate = 0; 17865 let minKnownInteractionId = Infinity; 17866 let maxKnownInteractionId = 0; 17867 const updateEstimate = (entries2) => { 17868 entries2.forEach((e2) => { 17869 if (e2.interactionId) { 17870 minKnownInteractionId = Math.min(minKnownInteractionId, e2.interactionId); 17871 maxKnownInteractionId = Math.max(maxKnownInteractionId, e2.interactionId); 17872 interactionCountEstimate = maxKnownInteractionId ? (maxKnownInteractionId - minKnownInteractionId) / 7 + 1 : 0; 17873 } 17874 }); 17875 }; 17876 let po$1; 17877 const getInteractionCount = () => { 17878 return po$1 ? interactionCountEstimate : performance.interactionCount || 0; 17879 }; 17880 const initInteractionCountPolyfill = () => { 17881 if ("interactionCount" in performance || po$1) return; 17882 po$1 = observe("event", updateEstimate, { 17883 type: "event", 17884 buffered: true, 17885 durationThreshold: 0 17886 }); 17887 }; 17888 const longestInteractionList = []; 17889 const longestInteractionMap = /* @__PURE__ */ new Map(); 17890 const DEFAULT_DURATION_THRESHOLD = 40; 17891 let prevInteractionCount = 0; 17892 const getInteractionCountForNavigation = () => { 17893 return getInteractionCount() - prevInteractionCount; 17894 }; 17895 const estimateP98LongestInteraction = () => { 17896 const candidateInteractionIndex = Math.min( 17897 longestInteractionList.length - 1, 17898 Math.floor(getInteractionCountForNavigation() / 50) 17899 ); 17900 return longestInteractionList[candidateInteractionIndex]; 17901 }; 17902 const MAX_INTERACTIONS_TO_CONSIDER = 10; 17903 const entryPreProcessingCallbacks = []; 17904 const processInteractionEntry = (entry) => { 17905 entryPreProcessingCallbacks.forEach((cb) => cb(entry)); 17906 if (!(entry.interactionId || entry.entryType === "first-input")) return; 17907 const minLongestInteraction = longestInteractionList[longestInteractionList.length - 1]; 17908 const existingInteraction = longestInteractionMap.get(entry.interactionId); 17909 if (existingInteraction || longestInteractionList.length < MAX_INTERACTIONS_TO_CONSIDER || minLongestInteraction && entry.duration > minLongestInteraction.latency) { 17910 if (existingInteraction) { 17911 if (entry.duration > existingInteraction.latency) { 17912 existingInteraction.entries = [entry]; 17913 existingInteraction.latency = entry.duration; 17914 } else if (entry.duration === existingInteraction.latency && entry.startTime === (existingInteraction.entries[0] && existingInteraction.entries[0].startTime)) { 17915 existingInteraction.entries.push(entry); 17916 } 17917 } else { 17918 const interaction = { 17919 id: entry.interactionId, 17920 latency: entry.duration,
17921 entries: [entry] 17922 }; 17923 longestInteractionMap.set(interaction.id, interaction); 17924 longestInteractionList.push(interaction); 17925 } 17926 longestInteractionList.sort((a2, b2) => b2.latency - a2.latency); 17927 if (longestInteractionList.length > MAX_INTERACTIONS_TO_CONSIDER) { 17928 longestInteractionList.splice(MAX_INTERACTIONS_TO_CONSIDER).forEach((i2) => longestInteractionMap.delete(i2.id)); 17929 } 17930 } 17931 }; 17932 const whenIdle = (cb) => { 17933 const rIC = WINDOW.requestIdleCallback || WINDOW.setTimeout; 17934 let handle = -1; 17935 cb = runOnce(cb); 17936 if (WINDOW.document && WINDOW.document.visibilityState === "hidden") { 17937 cb(); 17938 } else { 17939 handle = rIC(cb); 17940 onHidden(cb); 17941 } 17942 return handle; 17943 }; 17944 const INPThresholds = [200, 500]; 17945 const onINP = (onReport, opts = {}) => { 17946 if (!("PerformanceEventTiming" in WINDOW && "interactionId" in PerformanceEventTiming.prototype)) { 17947 return; 17948 } 17949 whenActivated(() => { 17950 initInteractionCountPolyfill(); 17951 const metric = initMetric("INP"); 17952 let report; 17953 const handleEntries = (entries2) => { 17954 whenIdle(() => { 17955 entries2.forEach(processInteractionEntry); 17956 const inp = estimateP98LongestInteraction(); 17957 if (inp && inp.latency !== metric.value) { 17958 metric.value = inp.latency; 17959 metric.entries = inp.entries; 17960 report(); 17961 } 17962 }); 17963 }; 17964 const po2 = observe("event", handleEntries, { 17965 // Event Timing entries have their durations rounded to the nearest 8ms, 17966 // so a duration of 40ms would be any event that spans 2.5 or more frames 17967 // at 60Hz. This threshold is chosen to strike a balance between usefulness 17968 // and performance. Running this callback for any interaction that spans 17969 // just one or two frames is likely not worth the insight that could be 17970 // gained. 17971 durationThreshold: opts.durationThreshold != null ? opts.durationThreshold : DEFAULT_DURATION_THRESHOLD 17972 }); 17973 report = bindReporter(onReport, metric, INPThresholds, opts.reportAllChanges); 17974 if (po2) { 17975 po2.observe({ type: "first-input", buffered: true }); 17976 onHidden(() => { 17977 handleEntries(po2.takeRecords()); 17978 report(true); 17979 }); 17980 } 17981 }); 17982 }; 17983 const LCPThresholds = [2500, 4e3]; 17984 const reportedMetricIDs = {}; 17985 const onLCP = (onReport, opts = {}) => { 17986 whenActivated(() => { 17987 const visibilityWatcher = getVisibilityWatcher(); 17988 const metric = initMetric("LCP"); 17989 let report; 17990 const handleEntries = (entries2) => { 17991 if (!opts.reportAllChanges) { 17992 entries2 = entries2.slice(-1); 17993 } 17994 entries2.forEach((entry) => { 17995 if (entry.startTime < visibilityWatcher.firstHiddenTime) { 17996 metric.value = Math.max(entry.startTime - getActivationStart(), 0); 17997 metric.entries = [entry]; 17998 report(); 17999 } 18000 }); 18001 }; 18002 const po2 = observe("largest-contentful-paint", handleEntries); 18003 if (po2) { 18004 report = bindReporter(onReport, metric, LCPThresholds, opts.reportAllChanges); 18005 const stopListening = runOnce(() => { 18006 if (!reportedMetricIDs[metric.id]) { 18007 handleEntries(po2.takeRecords()); 18008 po2.disconnect(); 18009 reportedMetricIDs[metric.id] = true; 18010 report(true); 18011 } 18012 }); 18013 ["keydown", "click"].forEach((type) => { 18014 if (WINDOW.document) { 18015 addEventListener(type, () => whenIdle(stopListening), { 18016 once: true, 18017 capture: true 18018 }); 18019 } 18020 }); 18021 onHidden(stopListening); 18022 } 18023 }); 18024 }; 18025 const TTFBThresholds = [800, 1800]; 18026 const whenReady = (callback) => { 18027 if (WINDOW.document && WINDOW.document.prerendering) { 18028 whenActivated(() => whenReady(callback)); 18029 } else if (WINDOW.document && WINDOW.document.readyState !== "complete") { 18030 addEventListener("load", () => whenReady(callback), true); 18031 } else { 18032 setTimeout(callback, 0); 18033 } 18034 }; 18035 const onTTFB = (onReport, opts = {}) => { 18036 const metric = initMetric("TTFB"); 18037 const report = bindReporter(onReport, metric, TTFBThresholds, opts.reportAllChanges); 18038 whenReady(() => { 18039 const navigationEntry = getNavigationEntry(); 18040 if (navigationEntry) { 18041 metric.value = Math.max(navigationEntry.responseStart - getActivationStart(), 0); 18042 metric.entries = [navigationEntry]; 18043 report(true); 18044 } 18045 }); 18046 }; 18047 const handlers = {}; 18048 const instrumented = {}; 18049 let _previousCls; 18050 let _previousFid; 18051 let _previousLcp; 18052 let _previousTtfb; 18053 let _previousInp; 18054 function addClsInstrumentationHandler(callback, stopOnCallback = false) { 18055 return addMetricObserver("cls", callback, instrumentCls, _previousCls, stopOnCallback); 18056 } 18057 function addLcpInstrumentationHandler(callback, stopOnCallback = false) { 18058 return addMetricObserver("lcp", callback, instrumentLcp, _previousLcp, stopOnCallback); 18059 } 18060 function addFidInstrumentationHandler(callback) { 18061 return addMetricObserver("fid", callback, instrumentFid, _previousFid); 18062 } 18063 function addTtfbInstrumentationHandler(callback) { 18064 return addMetricObserver("ttfb", callback, instrumentTtfb, _previousTtfb); 18065 } 18066 function addInpInstrumentationHandler(callback) { 18067 return addMetricObserver("inp", callback, instrumentInp, _previousInp); 18068 } 18069 function addPerformanceInstrumentationHandler(type, callback) { 18070 addHandler(type, callback); 18071 if (!instrumented[type]) { 18072 instrumentPerformanceObserver(type); 18073 instrumented[type] = true; 18074 } 18075 return getCleanupCallback(type, callback); 18076 } 18077 function triggerHandlers(type, data) { 18078 const typeHandlers = handlers[type]; 18079 if (!typeHandlers || !typeHandlers.length) { 18080 return; 18081 } 18082 for (const handler of typeHandlers) { 18083 try { 18084 handler(data); 18085 } catch (e2) { 18086 DEBUG_BUILD && logger.error( 18087 `Error while triggering instrumentation handler. 18088Type: ${type} 18089Name: ${getFunctionName(handler)} 18090Error:`, 18091 e2 18092 ); 18093 } 18094 } 18095 } 18096 function instrumentCls() { 18097 return onCLS( 18098 (metric) => { 18099 triggerHandlers("cls", { 18100 metric 18101 }); 18102 _previousCls = metric; 18103 }, 18104 // We want the callback to be called whenever the CLS value updates. 18105 // By default, the callback is only called when the tab goes to the background. 18106 { reportAllChanges: true } 18107 ); 18108 } 18109 function instrumentFid() { 18110 return onFID((metric) => { 18111 triggerHandlers("fid", { 18112 metric 18113 }); 18114 _previousFid = metric; 18115 }); 18116 } 18117 function instrumentLcp() { 18118 return onLCP( 18119 (metric) => { 18120 triggerHandlers("lcp", { 18121 metric 18122 }); 18123 _previousLcp = metric; 18124 }, 18125 // We want the callback to be called whenever the LCP value updates. 18126 // By default, the callback is only called when the tab goes to the background. 18127 { reportAllChanges: true } 18128 ); 18129 } 18130 function instrumentTtfb() { 18131 return onTTFB((metric) => { 18132 triggerHandlers("ttfb", { 18133 metric 18134 }); 18135 _previousTtfb = metric; 18136 }); 18137 } 18138 function instrumentInp() { 18139 return onINP((metric) => { 18140 triggerHandlers("inp", { 18141 metric 18142 }); 18143 _previousInp = metric; 18144 }); 18145 } 18146 function addMetricObserver(type, callback, instrumentFn, previousValue, stopOnCallback = false) { 18147 addHandler(type, callback); 18148 let stopListening; 18149 if (!instrumented[type]) { 18150 stopListening = instrumentFn(); 18151 instrumented[type] = true; 18152 } 18153 if (previousValue) { 18154 callback({ metric: previousValue }); 18155 } 18156 return getCleanupCallback(type, callback, stopOnCallback ? stopListening : void 0); 18157 } 18158 function instrumentPerformanceObserver(type) { 18159 const options2 = {}; 18160 if (type === "event") { 18161 options2.durationThreshold = 0; 18162 } 18163 observe( 18164 type, 18165 (entries2) => { 18166 triggerHandlers(type, { entries: entries2 }); 18167 }, 18168 options2 18169 ); 18170 } 18171 function addHandler(type, handler) { 18172 handlers[type] = handlers[type] || []; 18173 handlers[type].push(handler); 18174 } 18175 function getCleanupCallback(type, callback, stopListening) { 18176 return () => { 18177 if (stopListening) { 18178 stopListening(); 18179 } 18180 const typeHandlers = handlers[type]; 18181 if (!typeHandlers) { 18182 return; 18183 } 18184 const index2 = typeHandlers.indexOf(callback); 18185 if (index2 !== -1) { 18186 typeHandlers.splice(index2, 1); 18187 } 18188 }; 18189 } 18190 function isPerformanceEventTiming(entry) { 18191 return "duration" in entry; 18192 } 18193 function isMeasurementValue(value) { 18194 return typeof value === "number" && isFinite(value); 18195 } 18196 function startAndEndSpan(parentSpan, startTimeInSeconds, endTime, _e2) { 18197 var ctx = __objRest(_e2, []); 18198 const parentStartTime = spanToJSON(parentSpan).start_timestamp; 18199 if (parentStartTime && parentStartTime > startTimeInSeconds) { 18200 if (typeof parentSpan.updateStartTime === "function") { 18201 parentSpan.updateStartTime(startTimeInSeconds); 18202 } 18203 } 18204 return withActiveSpan(parentSpan, () => { 18205 const span = startInactiveSpan(__spreadValues({ 18206 startTime: startTimeInSeconds 18207 }, ctx)); 18208 if (span) {
18209 span.end(endTime); 18210 } 18211 return span; 18212 }); 18213 } 18214 function startStandaloneWebVitalSpan(options2) { 18215 const client2 = getClient(); 18216 if (!client2) { 18217 return; 18218 } 18219 const { name, transaction, attributes: passedAttributes, startTime } = options2; 18220 const { release, environment } = client2.getOptions(); 18221 const replay = client2.getIntegrationByName("Replay"); 18222 const replayId = replay && replay.getReplayId(); 18223 const scope = getCurrentScope(); 18224 const user = scope.getUser(); 18225 const userDisplay = user !== void 0 ? user.email || user.id || user.ip_address : void 0; 18226 let profileId; 18227 try { 18228 profileId = scope.getScopeData().contexts.profile.profile_id; 18229 } catch (e2) { 18230 } 18231 const attributes = __spreadValues({ 18232 release, 18233 environment, 18234 user: userDisplay || void 0, 18235 profile_id: profileId || void 0, 18236 replay_id: replayId || void 0, 18237 transaction, 18238 // Web vital score calculation relies on the user agent to account for different 18239 // browsers setting different thresholds for what is considered a good/meh/bad value. 18240 // For example: Chrome vs. Chrome Mobile 18241 "user_agent.original": WINDOW.navigator && WINDOW.navigator.userAgent 18242 }, passedAttributes); 18243 return startInactiveSpan({ 18244 name, 18245 attributes, 18246 startTime, 18247 experimental: { 18248 standalone: true 18249 } 18250 }); 18251 } 18252 function getBrowserPerformanceAPI() { 18253 return WINDOW && WINDOW.addEventListener && WINDOW.performance; 18254 } 18255 function msToSec(time2) { 18256 return time2 / 1e3; 18257 } 18258 function extractNetworkProtocol(nextHopProtocol) { 18259 let name = "unknown"; 18260 let version = "unknown"; 18261 let _name = ""; 18262 for (const char2 of nextHopProtocol) { 18263 if (char2 === "/") { 18264 [name, version] = nextHopProtocol.split("/"); 18265 break; 18266 } 18267 if (!isNaN(Number(char2))) { 18268 name = _name === "h" ? "http" : _name; 18269 version = nextHopProtocol.split(_name)[1]; 18270 break; 18271 } 18272 _name += char2; 18273 } 18274 if (_name === nextHopProtocol) { 18275 name = _name; 18276 } 18277 return { name, version }; 18278 } 18279 function trackClsAsStandaloneSpan() { 18280 let standaloneCLsValue = 0; 18281 let standaloneClsEntry; 18282 let pageloadSpanId; 18283 if (!supportsLayoutShift()) { 18284 return; 18285 } 18286 let sentSpan = false; 18287 function _collectClsOnce() { 18288 if (sentSpan) { 18289 return; 18290 } 18291 sentSpan = true; 18292 if (pageloadSpanId) { 18293 sendStandaloneClsSpan(standaloneCLsValue, standaloneClsEntry, pageloadSpanId); 18294 } 18295 cleanupClsHandler(); 18296 } 18297 const cleanupClsHandler = addClsInstrumentationHandler(({ metric }) => { 18298 const entry = metric.entries[metric.entries.length - 1]; 18299 if (!entry) { 18300 return; 18301 } 18302 standaloneCLsValue = metric.value; 18303 standaloneClsEntry = entry; 18304 }, true); 18305 onHidden(() => { 18306 _collectClsOnce(); 18307 }); 18308 setTimeout(() => { 18309 const client2 = getClient(); 18310 if (!client2) { 18311 return; 18312 } 18313 const unsubscribeStartNavigation = client2.on("startNavigationSpan", () => { 18314 _collectClsOnce(); 18315 unsubscribeStartNavigation && unsubscribeStartNavigation(); 18316 }); 18317 const activeSpan = getActiveSpan(); 18318 const rootSpan = activeSpan && getRootSpan(activeSpan); 18319 const spanJSON = rootSpan && spanToJSON(rootSpan); 18320 if (spanJSON && spanJSON.op === "pageload") { 18321 pageloadSpanId = rootSpan.spanContext().spanId; 18322 } 18323 }, 0); 18324 } 18325 function sendStandaloneClsSpan(clsValue, entry, pageloadSpanId) { 18326 DEBUG_BUILD && logger.log(`Sending CLS span (${clsValue})`); 18327 const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (entry && entry.startTime || 0)); 18328 const routeName = getCurrentScope().getScopeData().transactionName; 18329 const name = entry ? htmlTreeAsString(entry.sources[0] && entry.sources[0].node) : "Layout shift"; 18330 const attributes = dropUndefinedKeys({ 18331 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.cls", 18332 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "ui.webvital.cls", 18333 [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry && entry.duration || 0, 18334 // attach the pageload span id to the CLS span so that we can link them in the UI 18335 "sentry.pageload.span_id": pageloadSpanId 18336 }); 18337 const span = startStandaloneWebVitalSpan({ 18338 name, 18339 transaction: routeName, 18340 attributes, 18341 startTime 18342 }); 18343 if (span) { 18344 span.addEvent("cls", { 18345 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "", 18346 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue 18347 }); 18348 span.end(startTime); 18349 } 18350 } 18351 function supportsLayoutShift() {
18352 try { 18353 return PerformanceObserver.supportedEntryTypes.includes("layout-shift"); 18354 } catch (e2) { 18355 return false; 18356 } 18357 } 18358 const MAX_INT_AS_BYTES = 2147483647; 18359 let _performanceCursor = 0; 18360 let _measurements = {}; 18361 let _lcpEntry; 18362 let _clsEntry; 18363 function startTrackingWebVitals({ recordClsStandaloneSpans }) { 18364 const performance2 = getBrowserPerformanceAPI(); 18365 if (performance2 && browserPerformanceTimeOrigin) { 18366 if (performance2.mark) { 18367 WINDOW.performance.mark("sentry-tracing-init"); 18368 } 18369 const fidCleanupCallback = _trackFID(); 18370 const lcpCleanupCallback = _trackLCP(); 18371 const ttfbCleanupCallback = _trackTtfb(); 18372 const clsCleanupCallback = recordClsStandaloneSpans ? trackClsAsStandaloneSpan() : _trackCLS(); 18373 return () => { 18374 fidCleanupCallback(); 18375 lcpCleanupCallback(); 18376 ttfbCleanupCallback(); 18377 clsCleanupCallback && clsCleanupCallback(); 18378 }; 18379 } 18380 return () => void 0; 18381 } 18382 function startTrackingLongTasks() { 18383 addPerformanceInstrumentationHandler("longtask", ({ entries: entries2 }) => { 18384 const parent = getActiveSpan(); 18385 if (!parent) { 18386 return; 18387 } 18388 const { op: parentOp, start_timestamp: parentStartTimestamp } = spanToJSON(parent); 18389 for (const entry of entries2) { 18390 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18391 const duration = msToSec(entry.duration); 18392 if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { 18393 continue; 18394 } 18395 startAndEndSpan(parent, startTime, startTime + duration, { 18396 name: "Main UI thread blocked", 18397 op: "ui.long-task", 18398 attributes: { 18399 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18400 } 18401 }); 18402 } 18403 }); 18404 } 18405 function startTrackingLongAnimationFrames() { 18406 const observer = new PerformanceObserver((list) => { 18407 const parent = getActiveSpan(); 18408 if (!parent) { 18409 return; 18410 } 18411 for (const entry of list.getEntries()) { 18412 if (!entry.scripts[0]) { 18413 continue; 18414 } 18415 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18416 const { start_timestamp: parentStartTimestamp, op: parentOp } = spanToJSON(parent); 18417 if (parentOp === "navigation" && parentStartTimestamp && startTime < parentStartTimestamp) { 18418 continue; 18419 } 18420 const duration = msToSec(entry.duration); 18421 const attributes = { 18422 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18423 }; 18424 const initialScript = entry.scripts[0]; 18425 const { invoker, invokerType, sourceURL, sourceFunctionName, sourceCharPosition } = initialScript; 18426 attributes["browser.script.invoker"] = invoker; 18427 attributes["browser.script.invoker_type"] = invokerType; 18428 if (sourceURL) { 18429 attributes["code.filepath"] = sourceURL; 18430 } 18431 if (sourceFunctionName) { 18432 attributes["code.function"] = sourceFunctionName; 18433 } 18434 if (sourceCharPosition !== -1) { 18435 attributes["browser.script.source_char_position"] = sourceCharPosition; 18436 } 18437 startAndEndSpan(parent, startTime, startTime + duration, { 18438 name: "Main UI thread blocked", 18439 op: "ui.long-animation-frame", 18440 attributes 18441 }); 18442 } 18443 }); 18444 observer.observe({ type: "long-animation-frame", buffered: true }); 18445 } 18446 function startTrackingInteractions() { 18447 addPerformanceInstrumentationHandler("event", ({ entries: entries2 }) => { 18448 const parent = getActiveSpan(); 18449 if (!parent) { 18450 return; 18451 } 18452 for (const entry of entries2) { 18453 if (entry.name === "click") { 18454 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 18455 const duration = msToSec(entry.duration); 18456 const spanOptions = { 18457 name: htmlTreeAsString(entry.target), 18458 op: `ui.interaction.${entry.name}`, 18459 startTime, 18460 attributes: { 18461 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18462 } 18463 }; 18464 const componentName = getComponentName(entry.target); 18465 if (componentName) { 18466 spanOptions.attributes["ui.component_name"] = componentName; 18467 } 18468 startAndEndSpan(parent, startTime, startTime + duration, spanOptions); 18469 } 18470 } 18471 }); 18472 } 18473 function _trackCLS() { 18474 return addClsInstrumentationHandler(({ metric }) => { 18475 const entry = metric.entries[metric.entries.length - 1]; 18476 if (!entry) { 18477 return; 18478 } 18479 _measurements["cls"] = { value: metric.value, unit: "" }; 18480 _clsEntry = entry; 18481 }, true); 18482 } 18483 function _trackLCP() { 18484 return addLcpInstrumentationHandler(({ metric }) => { 18485 const entry = metric.entries[metric.entries.length - 1]; 18486 if (!entry) { 18487 return; 18488 } 18489 _measurements["lcp"] = { value: metric.value, unit: "millisecond" }; 18490 _lcpEntry = entry; 18491 }, true); 18492 } 18493 function _trackFID() { 18494 return addFidInstrumentationHandler(({ metric }) => { 18495 const entry = metric.entries[metric.entries.length - 1]; 18496 if (!entry) { 18497 return; 18498 } 18499 const timeOrigin = msToSec(browserPerformanceTimeOrigin); 18500 const startTime = msToSec(entry.startTime); 18501 _measurements["fid"] = { value: metric.value, unit: "millisecond" }; 18502 _measurements["mark.fid"] = { value: timeOrigin + startTime, unit: "second" }; 18503 }); 18504 } 18505 function _trackTtfb() { 18506 return addTtfbInstrumentationHandler(({ metric }) => { 18507 const entry = metric.entries[metric.entries.length - 1]; 18508 if (!entry) { 18509 return; 18510 } 18511 _measurements["ttfb"] = { value: metric.value, unit: "millisecond" }; 18512 }); 18513 } 18514 function addPerformanceEntries(span, options2) { 18515 const performance2 = getBrowserPerformanceAPI(); 18516 if (!performance2 || !performance2.getEntries || !browserPerformanceTimeOrigin) { 18517 return; 18518 } 18519 const timeOrigin = msToSec(browserPerformanceTimeOrigin); 18520 const performanceEntries = performance2.getEntries(); 18521 const { op, start_timestamp: transactionStartTime } = spanToJSON(span); 18522 performanceEntries.slice(_performanceCursor).forEach((entry) => { 18523 const startTime = msToSec(entry.startTime); 18524 const duration = msToSec( 18525 // Inexplicably, Chrome sometimes emits a negative duration. We need to work around this. 18526 // There is a SO post attempting to explain this, but it leaves one with open questions: https://stackoverflow.com/questions/23191918/peformance-getentries-and-negative-duration-display
18527 // The way we clamp the value is probably not accurate, since we have observed this happen for things that may take a while to load, like for example the replay worker. 18528 // TODO: Investigate why this happens and how to properly mitigate. For now, this is a workaround to prevent transactions being dropped due to negative duration spans. 18529 Math.max(0, entry.duration) 18530 ); 18531 if (op === "navigation" && transactionStartTime && timeOrigin + startTime < transactionStartTime) { 18532 return; 18533 } 18534 switch (entry.entryType) { 18535 case "navigation": { 18536 _addNavigationSpans(span, entry, timeOrigin); 18537 break; 18538 } 18539 case "mark": 18540 case "paint": 18541 case "measure": { 18542 _addMeasureSpans(span, entry, startTime, duration, timeOrigin); 18543 const firstHidden = getVisibilityWatcher(); 18544 const shouldRecord = entry.startTime < firstHidden.firstHiddenTime; 18545 if (entry.name === "first-paint" && shouldRecord) { 18546 _measurements["fp"] = { value: entry.startTime, unit: "millisecond" }; 18547 } 18548 if (entry.name === "first-contentful-paint" && shouldRecord) { 18549 _measurements["fcp"] = { value: entry.startTime, unit: "millisecond" }; 18550 } 18551 break; 18552 } 18553 case "resource": { 18554 _addResourceSpans(span, entry, entry.name, startTime, duration, timeOrigin); 18555 break; 18556 } 18557 } 18558 }); 18559 _performanceCursor = Math.max(performanceEntries.length - 1, 0); 18560 _trackNavigator(span); 18561 if (op === "pageload") { 18562 _addTtfbRequestTimeToMeasurements(_measurements); 18563 const fidMark = _measurements["mark.fid"]; 18564 if (fidMark && _measurements["fid"]) { 18565 startAndEndSpan(span, fidMark.value, fidMark.value + msToSec(_measurements["fid"].value), { 18566 name: "first input delay", 18567 op: "ui.action", 18568 attributes: { 18569 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18570 } 18571 }); 18572 delete _measurements["mark.fid"]; 18573 } 18574 if (!("fcp" in _measurements) || !options2.recordClsOnPageloadSpan) { 18575 delete _measurements.cls; 18576 } 18577 Object.entries(_measurements).forEach(([measurementName, measurement]) => { 18578 setMeasurement(measurementName, measurement.value, measurement.unit); 18579 }); 18580 span.setAttribute("performance.timeOrigin", timeOrigin); 18581 span.setAttribute("performance.activationStart", getActivationStart()); 18582 _setWebVitalAttributes(span); 18583 } 18584 _lcpEntry = void 0; 18585 _clsEntry = void 0; 18586 _measurements = {}; 18587 } 18588 function _addMeasureSpans(span, entry, startTime, duration, timeOrigin) { 18589 const navEntry = getNavigationEntry(false); 18590 const requestTime = msToSec(navEntry ? navEntry.requestStart : 0); 18591 const measureStartTimestamp = timeOrigin + Math.max(startTime, requestTime); 18592 const startTimeStamp = timeOrigin + startTime; 18593 const measureEndTimestamp = startTimeStamp + duration; 18594 const attributes = { 18595 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" 18596 }; 18597 if (measureStartTimestamp !== startTimeStamp) { 18598 attributes["sentry.browser.measure_happened_before_request"] = true; 18599 attributes["sentry.browser.measure_start_time"] = measureStartTimestamp; 18600 } 18601 startAndEndSpan(span, measureStartTimestamp, measureEndTimestamp, { 18602 name: entry.name, 18603 op: entry.entryType, 18604 attributes 18605 }); 18606 return measureStartTimestamp; 18607 } 18608 function _addNavigationSpans(span, entry, timeOrigin) { 18609 ["unloadEvent", "redirect", "domContentLoadedEvent", "loadEvent", "connect"].forEach((event) => { 18610 _addPerformanceNavigationTiming(span, entry, event, timeOrigin); 18611 }); 18612 _addPerformanceNavigationTiming(span, entry, "secureConnection", timeOrigin, "TLS/SSL"); 18613 _addPerformanceNavigationTiming(span, entry, "fetch", timeOrigin, "cache"); 18614 _addPerformanceNavigationTiming(span, entry, "domainLookup", timeOrigin, "DNS"); 18615 _addRequest(span, entry, timeOrigin); 18616 } 18617 function _addPerformanceNavigationTiming(span, entry, event, timeOrigin, name = event) { 18618 const eventEnd = _getEndPropertyNameForNavigationTiming(event); 18619 const end = entry[eventEnd]; 18620 const start = entry[`${event}Start`]; 18621 if (!start || !end) { 18622 return; 18623 } 18624 startAndEndSpan(span, timeOrigin + msToSec(start), timeOrigin + msToSec(end), { 18625 op: `browser.${name}`, 18626 name: entry.name, 18627 attributes: { 18628 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18629 } 18630 }); 18631 } 18632 function _getEndPropertyNameForNavigationTiming(event) { 18633 if (event === "secureConnection") { 18634 return "connectEnd"; 18635 } 18636 if (event === "fetch") { 18637 return "domainLookupStart"; 18638 } 18639 return `${event}End`; 18640 } 18641 function _addRequest(span, entry, timeOrigin) { 18642 const requestStartTimestamp = timeOrigin + msToSec(entry.requestStart); 18643 const responseEndTimestamp = timeOrigin + msToSec(entry.responseEnd); 18644 const responseStartTimestamp = timeOrigin + msToSec(entry.responseStart); 18645 if (entry.responseEnd) { 18646 startAndEndSpan(span, requestStartTimestamp, responseEndTimestamp, { 18647 op: "browser.request", 18648 name: entry.name, 18649 attributes: { 18650 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18651 } 18652 }); 18653 startAndEndSpan(span, responseStartTimestamp, responseEndTimestamp, { 18654 op: "browser.response", 18655 name: entry.name, 18656 attributes: { 18657 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ui.browser.metrics" 18658 } 18659 }); 18660 } 18661 } 18662 function _addResourceSpans(span, entry, resourceUrl, startTime, duration, timeOrigin) { 18663 if (entry.initiatorType === "xmlhttprequest" || entry.initiatorType === "fetch") { 18664 return; 18665 } 18666 const parsedUrl = parseUrl$1(resourceUrl); 18667 const attributes = { 18668 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.resource.browser.metrics" 18669 }; 18670 setResourceEntrySizeData(attributes, entry, "transferSize", "http.response_transfer_size"); 18671 setResourceEntrySizeData(attributes, entry, "encodedBodySize", "http.response_content_length"); 18672 setResourceEntrySizeData(attributes, entry, "decodedBodySize", "http.decoded_response_content_length"); 18673 const deliveryType = entry.deliveryType; 18674 if (deliveryType != null) { 18675 attributes["http.response_delivery_type"] = deliveryType; 18676 } 18677 const renderBlockingStatus = entry.renderBlockingStatus; 18678 if (renderBlockingStatus) { 18679 attributes["resource.render_blocking_status"] = renderBlockingStatus; 18680 } 18681 if (parsedUrl.protocol) { 18682 attributes["url.scheme"] = parsedUrl.protocol.split(":").pop(); 18683 } 18684 if (parsedUrl.host) { 18685 attributes["server.address"] = parsedUrl.host; 18686 } 18687 attributes["url.same_origin"] = resourceUrl.includes(WINDOW.location.origin); 18688 const { name, version } = extractNetworkProtocol(entry.nextHopProtocol); 18689 attributes["network.protocol.name"] = name; 18690 attributes["network.protocol.version"] = version; 18691 const startTimestamp = timeOrigin + startTime; 18692 const endTimestamp = startTimestamp + duration; 18693 startAndEndSpan(span, startTimestamp, endTimestamp, { 18694 name: resourceUrl.replace(WINDOW.location.origin, ""), 18695 op: entry.initiatorType ? `resource.${entry.initiatorType}` : "resource.other", 18696 attributes 18697 }); 18698 } 18699 function _trackNavigator(span) { 18700 const navigator2 = WINDOW.navigator; 18701 if (!navigator2) { 18702 return; 18703 } 18704 const connection = navigator2.connection; 18705 if (connection) { 18706 if (connection.effectiveType) { 18707 span.setAttribute("effectiveConnectionType", connection.effectiveType); 18708 } 18709 if (connection.type) { 18710 span.setAttribute("connectionType", connection.type); 18711 } 18712 if (isMeasurementValue(connection.rtt)) { 18713 _measurements["connection.rtt"] = { value: connection.rtt, unit: "millisecond" }; 18714 } 18715 } 18716 if (isMeasurementValue(navigator2.deviceMemory)) { 18717 span.setAttribute("deviceMemory", `${navigator2.deviceMemory} GB`); 18718 } 18719 if (isMeasurementValue(navigator2.hardwareConcurrency)) { 18720 span.setAttribute("hardwareConcurrency", String(navigator2.hardwareConcurrency)); 18721 } 18722 } 18723 function _setWebVitalAttributes(span) { 18724 if (_lcpEntry) { 18725 if (_lcpEntry.element) { 18726 span.setAttribute("lcp.element", htmlTreeAsString(_lcpEntry.element)); 18727 } 18728 if (_lcpEntry.id) { 18729 span.setAttribute("lcp.id", _lcpEntry.id); 18730 } 18731 if (_lcpEntry.url) { 18732 span.setAttribute("lcp.url", _lcpEntry.url.trim().slice(0, 200)); 18733 } 18734 if (_lcpEntry.loadTime != null) { 18735 span.setAttribute("lcp.loadTime", _lcpEntry.loadTime); 18736 } 18737 if (_lcpEntry.renderTime != null) { 18738 span.setAttribute("lcp.renderTime", _lcpEntry.renderTime); 18739 } 18740 span.setAttribute("lcp.size", _lcpEntry.size); 18741 } 18742 if (_clsEntry && _clsEntry.sources) {
18743 _clsEntry.sources.forEach( 18744 (source, index2) => span.setAttribute(`cls.source.${index2 + 1}`, htmlTreeAsString(source.node)) 18745 ); 18746 } 18747 } 18748 function setResourceEntrySizeData(attributes, entry, key, dataKey) { 18749 const entryVal = entry[key]; 18750 if (entryVal != null && entryVal < MAX_INT_AS_BYTES) { 18751 attributes[dataKey] = entryVal; 18752 } 18753 } 18754 function _addTtfbRequestTimeToMeasurements(_measurements2) { 18755 const navEntry = getNavigationEntry(false); 18756 if (!navEntry) { 18757 return; 18758 } 18759 const { responseStart, requestStart } = navEntry; 18760 if (requestStart <= responseStart) { 18761 _measurements2["ttfb.requestTime"] = { 18762 value: responseStart - requestStart, 18763 unit: "millisecond" 18764 }; 18765 } 18766 } 18767 const DEBOUNCE_DURATION = 1e3; 18768 let debounceTimerID; 18769 let lastCapturedEventType; 18770 let lastCapturedEventTargetId; 18771 function addClickKeypressInstrumentationHandler(handler) { 18772 const type = "dom"; 18773 addHandler$1(type, handler); 18774 maybeInstrument(type, instrumentDOM); 18775 } 18776 function instrumentDOM() { 18777 if (!WINDOW.document) { 18778 return; 18779 } 18780 const triggerDOMHandler = triggerHandlers$1.bind(null, "dom"); 18781 const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true); 18782 WINDOW.document.addEventListener("click", globalDOMEventHandler, false); 18783 WINDOW.document.addEventListener("keypress", globalDOMEventHandler, false); 18784 ["EventTarget", "Node"].forEach((target) => { 18785 const globalObject = WINDOW; 18786 const targetObj = globalObject[target]; 18787 const proto = targetObj && targetObj.prototype; 18788 if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { 18789 return; 18790 } 18791 fill(proto, "addEventListener", function(originalAddEventListener) { 18792 return function(type, listener, options2) { 18793 if (type === "click" || type == "keypress") { 18794 try { 18795 const handlers2 = this.__sentry_instrumentation_handlers__ = this.__sentry_instrumentation_handlers__ || {}; 18796 const handlerForType = handlers2[type] = handlers2[type] || { refCount: 0 }; 18797 if (!handlerForType.handler) { 18798 const handler = makeDOMEventHandler(triggerDOMHandler); 18799 handlerForType.handler = handler; 18800 originalAddEventListener.call(this, type, handler, options2); 18801 } 18802 handlerForType.refCount++; 18803 } catch (e2) { 18804 } 18805 } 18806 return originalAddEventListener.call(this, type, listener, options2); 18807 }; 18808 }); 18809 fill( 18810 proto, 18811 "removeEventListener", 18812 function(originalRemoveEventListener) { 18813 return function(type, listener, options2) { 18814 if (type === "click" || type == "keypress") { 18815 try { 18816 const handlers2 = this.__sentry_instrumentation_handlers__ || {}; 18817 const handlerForType = handlers2[type]; 18818 if (handlerForType) { 18819 handlerForType.refCount--; 18820 if (handlerForType.refCount <= 0) { 18821 originalRemoveEventListener.call(this, type, handlerForType.handler, options2); 18822 handlerForType.handler = void 0; 18823 delete handlers2[type]; 18824 } 18825 if (Object.keys(handlers2).length === 0) { 18826 delete this.__sentry_instrumentation_handlers__; 18827 } 18828 } 18829 } catch (e2) { 18830 } 18831 } 18832 return originalRemoveEventListener.call(this, type, listener, options2); 18833 }; 18834 } 18835 ); 18836 }); 18837 } 18838 function isSimilarToLastCapturedEvent(event) { 18839 if (event.type !== lastCapturedEventType) { 18840 return false; 18841 } 18842 try { 18843 if (!event.target || event.target._sentryId !== lastCapturedEventTargetId) { 18844 return false;
18845 } 18846 } catch (e2) { 18847 } 18848 return true; 18849 } 18850 function shouldSkipDOMEvent(eventType, target) { 18851 if (eventType !== "keypress") { 18852 return false; 18853 } 18854 if (!target || !target.tagName) { 18855 return true; 18856 } 18857 if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable) { 18858 return false; 18859 } 18860 return true; 18861 } 18862 function makeDOMEventHandler(handler, globalListener = false) { 18863 return (event) => { 18864 if (!event || event["_sentryCaptured"]) { 18865 return; 18866 } 18867 const target = getEventTarget(event); 18868 if (shouldSkipDOMEvent(event.type, target)) { 18869 return; 18870 } 18871 addNonEnumerableProperty(event, "_sentryCaptured", true); 18872 if (target && !target._sentryId) { 18873 addNonEnumerableProperty(target, "_sentryId", uuid4()); 18874 } 18875 const name = event.type === "keypress" ? "input" : event.type; 18876 if (!isSimilarToLastCapturedEvent(event)) { 18877 const handlerData = { event, name, global: globalListener }; 18878 handler(handlerData); 18879 lastCapturedEventType = event.type; 18880 lastCapturedEventTargetId = target ? target._sentryId : void 0; 18881 } 18882 clearTimeout(debounceTimerID); 18883 debounceTimerID = WINDOW.setTimeout(() => { 18884 lastCapturedEventTargetId = void 0; 18885 lastCapturedEventType = void 0; 18886 }, DEBOUNCE_DURATION); 18887 }; 18888 } 18889 function getEventTarget(event) { 18890 try { 18891 return event.target; 18892 } catch (e2) { 18893 return null; 18894 } 18895 } 18896 let lastHref; 18897 function addHistoryInstrumentationHandler(handler) { 18898 const type = "history"; 18899 addHandler$1(type, handler); 18900 maybeInstrument(type, instrumentHistory); 18901 } 18902 function instrumentHistory() { 18903 if (!supportsHistory()) { 18904 return; 18905 } 18906 const oldOnPopState = WINDOW.onpopstate; 18907 WINDOW.onpopstate = function(...args) { 18908 const to2 = WINDOW.location.href; 18909 const from2 = lastHref; 18910 lastHref = to2; 18911 const handlerData = { from: from2, to: to2 }; 18912 triggerHandlers$1("history", handlerData); 18913 if (oldOnPopState) { 18914 try { 18915 return oldOnPopState.apply(this, args); 18916 } catch (_oO) { 18917 } 18918 } 18919 }; 18920 function historyReplacementFunction(originalHistoryFunction) { 18921 return function(...args) { 18922 const url = args.length > 2 ? args[2] : void 0; 18923 if (url) { 18924 const from2 = lastHref; 18925 const to2 = String(url); 18926 lastHref = to2; 18927 const handlerData = { from: from2, to: to2 }; 18928 triggerHandlers$1("history", handlerData); 18929 } 18930 return originalHistoryFunction.apply(this, args); 18931 }; 18932 } 18933 fill(WINDOW.history, "pushState", historyReplacementFunction); 18934 fill(WINDOW.history, "replaceState", historyReplacementFunction); 18935 } 18936 const cachedImplementations = {}; 18937 function getNativeImplementation(name) { 18938 const cached = cachedImplementations[name]; 18939 if (cached) { 18940 return cached; 18941 } 18942 let impl = WINDOW[name]; 18943 if (isNativeFunction(impl)) { 18944 return cachedImplementations[name] = impl.bind(WINDOW); 18945 } 18946 const document2 = WINDOW.document; 18947 if (document2 && typeof document2.createElement === "function") { 18948 try { 18949 const sandbox = document2.createElement("iframe"); 18950 sandbox.hidden = true; 18951 document2.head.appendChild(sandbox); 18952 const contentWindow = sandbox.contentWindow; 18953 if (contentWindow && contentWindow[name]) { 18954 impl = contentWindow[name]; 18955 } 18956 document2.head.removeChild(sandbox); 18957 } catch (e2) { 18958 DEBUG_BUILD && logger.warn(`Could not create sandbox iframe for ${name} check, bailing to window.${name}: `, e2); 18959 } 18960 } 18961 if (!impl) { 18962 return impl; 18963 } 18964 return cachedImplementations[name] = impl.bind(WINDOW); 18965 } 18966 function clearCachedImplementation(name) { 18967 cachedImplementations[name] = void 0; 18968 } 18969 const SENTRY_XHR_DATA_KEY = "__sentry_xhr_v3__"; 18970 function addXhrInstrumentationHandler(handler) { 18971 const type = "xhr"; 18972 addHandler$1(type, handler); 18973 maybeInstrument(type, instrumentXHR); 18974 } 18975 function instrumentXHR() { 18976 if (!WINDOW.XMLHttpRequest) { 18977 return; 18978 } 18979 const xhrproto = XMLHttpRequest.prototype; 18980 xhrproto.open = new Proxy(xhrproto.open, { 18981 apply(originalOpen, xhrOpenThisArg, xhrOpenArgArray) { 18982 const virtualError = new Error(); 18983 const startTimestamp = timestampInSeconds() * 1e3; 18984 const method = isString$2(xhrOpenArgArray[0]) ? xhrOpenArgArray[0].toUpperCase() : void 0; 18985 const url = parseUrl(xhrOpenArgArray[1]); 18986 if (!method || !url) { 18987 return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); 18988 } 18989 xhrOpenThisArg[SENTRY_XHR_DATA_KEY] = { 18990 method, 18991 url, 18992 request_headers: {} 18993 };
18994 if (method === "POST" && url.match(/sentry_key/)) { 18995 xhrOpenThisArg.__sentry_own_request__ = true; 18996 } 18997 const onreadystatechangeHandler = () => { 18998 const xhrInfo = xhrOpenThisArg[SENTRY_XHR_DATA_KEY]; 18999 if (!xhrInfo) { 19000 return; 19001 } 19002 if (xhrOpenThisArg.readyState === 4) { 19003 try { 19004 xhrInfo.status_code = xhrOpenThisArg.status; 19005 } catch (e2) { 19006 } 19007 const handlerData = { 19008 endTimestamp: timestampInSeconds() * 1e3, 19009 startTimestamp, 19010 xhr: xhrOpenThisArg, 19011 virtualError 19012 }; 19013 triggerHandlers$1("xhr", handlerData); 19014 } 19015 }; 19016 if ("onreadystatechange" in xhrOpenThisArg && typeof xhrOpenThisArg.onreadystatechange === "function") { 19017 xhrOpenThisArg.onreadystatechange = new Proxy(xhrOpenThisArg.onreadystatechange, { 19018 apply(originalOnreadystatechange, onreadystatechangeThisArg, onreadystatechangeArgArray) { 19019 onreadystatechangeHandler(); 19020 return originalOnreadystatechange.apply(onreadystatechangeThisArg, onreadystatechangeArgArray); 19021 } 19022 }); 19023 } else { 19024 xhrOpenThisArg.addEventListener("readystatechange", onreadystatechangeHandler); 19025 } 19026 xhrOpenThisArg.setRequestHeader = new Proxy(xhrOpenThisArg.setRequestHeader, { 19027 apply(originalSetRequestHeader, setRequestHeaderThisArg, setRequestHeaderArgArray) { 19028 const [header, value] = setRequestHeaderArgArray; 19029 const xhrInfo = setRequestHeaderThisArg[SENTRY_XHR_DATA_KEY]; 19030 if (xhrInfo && isString$2(header) && isString$2(value)) { 19031 xhrInfo.request_headers[header.toLowerCase()] = value; 19032 } 19033 return originalSetRequestHeader.apply(setRequestHeaderThisArg, setRequestHeaderArgArray); 19034 } 19035 }); 19036 return originalOpen.apply(xhrOpenThisArg, xhrOpenArgArray); 19037 } 19038 }); 19039 xhrproto.send = new Proxy(xhrproto.send, { 19040 apply(originalSend, sendThisArg, sendArgArray) { 19041 const sentryXhrData = sendThisArg[SENTRY_XHR_DATA_KEY]; 19042 if (!sentryXhrData) { 19043 return originalSend.apply(sendThisArg, sendArgArray); 19044 } 19045 if (sendArgArray[0] !== void 0) { 19046 sentryXhrData.body = sendArgArray[0]; 19047 } 19048 const handlerData = { 19049 startTimestamp: timestampInSeconds() * 1e3, 19050 xhr: sendThisArg 19051 }; 19052 triggerHandlers$1("xhr", handlerData); 19053 return originalSend.apply(sendThisArg, sendArgArray); 19054 } 19055 }); 19056 } 19057 function parseUrl(url) { 19058 if (isString$2(url)) { 19059 return url; 19060 } 19061 try { 19062 return url.toString(); 19063 } catch (e2) { 19064 } 19065 return void 0; 19066 } 19067 const LAST_INTERACTIONS = []; 19068 const INTERACTIONS_SPAN_MAP = /* @__PURE__ */ new Map(); 19069 function startTrackingINP() { 19070 const performance2 = getBrowserPerformanceAPI(); 19071 if (performance2 && browserPerformanceTimeOrigin) { 19072 const inpCallback = _trackINP(); 19073 return () => { 19074 inpCallback(); 19075 }; 19076 } 19077 return () => void 0; 19078 } 19079 const INP_ENTRY_MAP = { 19080 click: "click", 19081 pointerdown: "click", 19082 pointerup: "click", 19083 mousedown: "click", 19084 mouseup: "click", 19085 touchstart: "click", 19086 touchend: "click", 19087 mouseover: "hover", 19088 mouseout: "hover", 19089 mouseenter: "hover", 19090 mouseleave: "hover", 19091 pointerover: "hover", 19092 pointerout: "hover", 19093 pointerenter: "hover", 19094 pointerleave: "hover", 19095 dragstart: "drag", 19096 dragend: "drag", 19097 drag: "drag", 19098 dragenter: "drag", 19099 dragleave: "drag", 19100 dragover: "drag", 19101 drop: "drag", 19102 keydown: "press", 19103 keyup: "press", 19104 keypress: "press", 19105 input: "press" 19106 }; 19107 function _trackINP() { 19108 return addInpInstrumentationHandler(({ metric }) => { 19109 if (metric.value == void 0) { 19110 return; 19111 } 19112 const entry = metric.entries.find((entry2) => entry2.duration === metric.value && INP_ENTRY_MAP[entry2.name]); 19113 if (!entry) { 19114 return; 19115 } 19116 const { interactionId } = entry; 19117 const interactionType = INP_ENTRY_MAP[entry.name]; 19118 const startTime = msToSec(browserPerformanceTimeOrigin + entry.startTime); 19119 const duration = msToSec(metric.value); 19120 const activeSpan = getActiveSpan(); 19121 const rootSpan = activeSpan ? getRootSpan(activeSpan) : void 0; 19122 const cachedSpan = interactionId != null ? INTERACTIONS_SPAN_MAP.get(interactionId) : void 0; 19123 const spanToUse = cachedSpan || rootSpan; 19124 const routeName = spanToUse ? spanToJSON(spanToUse).description : getCurrentScope().getScopeData().transactionName; 19125 const name = htmlTreeAsString(entry.target); 19126 const attributes = dropUndefinedKeys({ 19127 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser.inp", 19128 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `ui.interaction.${interactionType}`, 19129 [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: entry.duration 19130 }); 19131 const span = startStandaloneWebVitalSpan({ 19132 name, 19133 transaction: routeName, 19134 attributes, 19135 startTime 19136 }); 19137 if (span) { 19138 span.addEvent("inp", { 19139 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: "millisecond", 19140 [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: metric.value 19141 }); 19142 span.end(startTime + duration); 19143 } 19144 }); 19145 } 19146 function registerInpInteractionListener(_latestRoute) { 19147 const handleEntries = ({ entries: entries2 }) => { 19148 const activeSpan = getActiveSpan(); 19149 const activeRootSpan = activeSpan && getRootSpan(activeSpan);
19150 entries2.forEach((entry) => { 19151 if (!isPerformanceEventTiming(entry) || !activeRootSpan) { 19152 return; 19153 } 19154 const interactionId = entry.interactionId; 19155 if (interactionId == null) { 19156 return; 19157 } 19158 if (INTERACTIONS_SPAN_MAP.has(interactionId)) { 19159 return; 19160 } 19161 if (LAST_INTERACTIONS.length > 10) { 19162 const last = LAST_INTERACTIONS.shift(); 19163 INTERACTIONS_SPAN_MAP.delete(last); 19164 } 19165 LAST_INTERACTIONS.push(interactionId); 19166 INTERACTIONS_SPAN_MAP.set(interactionId, activeRootSpan); 19167 }); 19168 }; 19169 addPerformanceInstrumentationHandler("event", handleEntries); 19170 addPerformanceInstrumentationHandler("first-input", handleEntries); 19171 } 19172 function makeFetchTransport(options2, nativeFetch = getNativeImplementation("fetch")) { 19173 let pendingBodySize = 0; 19174 let pendingCount = 0; 19175 function makeRequest(request) { 19176 const requestSize = request.body.length; 19177 pendingBodySize += requestSize; 19178 pendingCount++; 19179 const requestOptions = __spreadValues({ 19180 body: request.body, 19181 method: "POST", 19182 referrerPolicy: "origin", 19183 headers: options2.headers, 19184 // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to 19185 // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)". 19186 // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're 19187 // frequently sending events right before the user is switching pages (eg. when finishing navigation transactions). 19188 // Gotchas: 19189 // - `keepalive` isn't supported by Firefox 19190 // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch): 19191 // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error. 19192 // We will therefore only activate the flag when we're below that limit. 19193 // There is also a limit of requests that can be open at the same time, so we also limit this to 15 19194 // See https://github.com/getsentry/sentry-javascript/pull/7553 for details 19195 keepalive: pendingBodySize <= 6e4 && pendingCount < 15 19196 }, options2.fetchOptions); 19197 if (!nativeFetch) { 19198 clearCachedImplementation("fetch"); 19199 return rejectedSyncPromise("No fetch implementation available"); 19200 } 19201 try { 19202 return nativeFetch(options2.url, requestOptions).then((response) => { 19203 pendingBodySize -= requestSize; 19204 pendingCount--; 19205 return { 19206 statusCode: response.status, 19207 headers: { 19208 "x-sentry-rate-limits": response.headers.get("X-Sentry-Rate-Limits"), 19209 "retry-after": response.headers.get("Retry-After") 19210 } 19211 }; 19212 }); 19213 } catch (e2) { 19214 clearCachedImplementation("fetch"); 19215 pendingBodySize -= requestSize; 19216 pendingCount--; 19217 return rejectedSyncPromise(e2); 19218 } 19219 } 19220 return createTransport(options2, makeRequest); 19221 } 19222 const CHROME_PRIORITY = 30; 19223 const GECKO_PRIORITY = 50; 19224 function createFrame(filename, func, lineno, colno) { 19225 const frame2 = { 19226 filename, 19227 function: func === "<anonymous>" ? UNKNOWN_FUNCTION : func, 19228 in_app: true 19229 // All browser frames are considered in_app 19230 }; 19231 if (lineno !== void 0) { 19232 frame2.lineno = lineno; 19233 } 19234 if (colno !== void 0) { 19235 frame2.colno = colno; 19236 } 19237 return frame2; 19238 } 19239 const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; 19240 const chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; 19241 const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; 19242 const chromeStackParserFn = (line2) => { 19243 const noFnParts = chromeRegexNoFnName.exec(line2); 19244 if (noFnParts) { 19245 const [, filename, line3, col] = noFnParts; 19246 return createFrame(filename, UNKNOWN_FUNCTION, +line3, +col); 19247 } 19248 const parts = chromeRegex.exec(line2); 19249 if (parts) { 19250 const isEval = parts[2] && parts[2].indexOf("eval") === 0; 19251 if (isEval) { 19252 const subMatch = chromeEvalRegex.exec(parts[2]); 19253 if (subMatch) { 19254 parts[2] = subMatch[1]; 19255 parts[3] = subMatch[2]; 19256 parts[4] = subMatch[3]; 19257 } 19258 }
19259 const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]); 19260 return createFrame(filename, func, parts[3] ? +parts[3] : void 0, parts[4] ? +parts[4] : void 0); 19261 } 19262 return; 19263 }; 19264 const chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn]; 19265 const geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; 19266 const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; 19267 const gecko = (line2) => { 19268 const parts = geckoREgex.exec(line2); 19269 if (parts) { 19270 const isEval = parts[3] && parts[3].indexOf(" > eval") > -1; 19271 if (isEval) { 19272 const subMatch = geckoEvalRegex.exec(parts[3]); 19273 if (subMatch) { 19274 parts[1] = parts[1] || "eval"; 19275 parts[3] = subMatch[1]; 19276 parts[4] = subMatch[2]; 19277 parts[5] = ""; 19278 } 19279 } 19280 let filename = parts[3]; 19281 let func = parts[1] || UNKNOWN_FUNCTION; 19282 [func, filename] = extractSafariExtensionDetails(func, filename); 19283 return createFrame(filename, func, parts[4] ? +parts[4] : void 0, parts[5] ? +parts[5] : void 0); 19284 } 19285 return; 19286 }; 19287 const geckoStackLineParser = [GECKO_PRIORITY, gecko]; 19288 const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser]; 19289 const defaultStackParser = createStackParser(...defaultStackLineParsers); 19290 const extractSafariExtensionDetails = (func, filename) => { 19291 const isSafariExtension = func.indexOf("safari-extension") !== -1; 19292 const isSafariWebExtension = func.indexOf("safari-web-extension") !== -1; 19293 return isSafariExtension || isSafariWebExtension ? [ 19294 func.indexOf("@") !== -1 ? func.split("@")[0] : UNKNOWN_FUNCTION, 19295 isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}` 19296 ] : [func, filename]; 19297 }; 19298 const MAX_ALLOWED_STRING_LENGTH = 1024; 19299 const INTEGRATION_NAME$3 = "Breadcrumbs"; 19300 const _breadcrumbsIntegration = ((options2 = {}) => { 19301 const _options = __spreadValues({ 19302 console: true, 19303 dom: true, 19304 fetch: true, 19305 history: true, 19306 sentry: true, 19307 xhr: true 19308 }, options2); 19309 return { 19310 name: INTEGRATION_NAME$3, 19311 setup(client2) { 19312 if (_options.console) { 19313 addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client2)); 19314 } 19315 if (_options.dom) { 19316 addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client2, _options.dom)); 19317 } 19318 if (_options.xhr) { 19319 addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client2)); 19320 } 19321 if (_options.fetch) { 19322 addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client2)); 19323 } 19324 if (_options.history) { 19325 addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client2)); 19326 } 19327 if (_options.sentry) { 19328 client2.on("beforeSendEvent", _getSentryBreadcrumbHandler(client2)); 19329 } 19330 } 19331 }; 19332 }); 19333 const breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration); 19334 function _getSentryBreadcrumbHandler(client2) { 19335 return function addSentryBreadcrumb(event) { 19336 if (getClient() !== client2) { 19337 return; 19338 } 19339 addBreadcrumb( 19340 { 19341 category: `sentry.${event.type === "transaction" ? "transaction" : "event"}`, 19342 event_id: event.event_id, 19343 level: event.level, 19344 message: getEventDescription(event) 19345 }, 19346 { 19347 event 19348 } 19349 ); 19350 }; 19351 } 19352 function _getDomBreadcrumbHandler(client2, dom) { 19353 return function _innerDomBreadcrumb(handlerData) { 19354 if (getClient() !== client2) { 19355 return; 19356 } 19357 let target; 19358 let componentName; 19359 let keyAttrs = typeof dom === "object" ? dom.serializeAttribute : void 0; 19360 let maxStringLength = typeof dom === "object" && typeof dom.maxStringLength === "number" ? dom.maxStringLength : void 0; 19361 if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) { 19362 DEBUG_BUILD$1 && logger.warn( 19363 `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.` 19364 ); 19365 maxStringLength = MAX_ALLOWED_STRING_LENGTH; 19366 } 19367 if (typeof keyAttrs === "string") { 19368 keyAttrs = [keyAttrs]; 19369 } 19370 try { 19371 const event = handlerData.event; 19372 const element = _isEvent(event) ? event.target : event; 19373 target = htmlTreeAsString(element, { keyAttrs, maxStringLength }); 19374 componentName = getComponentName(element); 19375 } catch (e2) { 19376 target = "<unknown>"; 19377 } 19378 if (target.length === 0) { 19379 return; 19380 } 19381 const breadcrumb = { 19382 category: `ui.${handlerData.name}`, 19383 message: target 19384 }; 19385 if (componentName) {
19386 breadcrumb.data = { "ui.component_name": componentName }; 19387 } 19388 addBreadcrumb(breadcrumb, { 19389 event: handlerData.event, 19390 name: handlerData.name, 19391 global: handlerData.global 19392 }); 19393 }; 19394 } 19395 function _getConsoleBreadcrumbHandler(client2) { 19396 return function _consoleBreadcrumb(handlerData) { 19397 if (getClient() !== client2) { 19398 return; 19399 } 19400 const breadcrumb = { 19401 category: "console", 19402 data: { 19403 arguments: handlerData.args, 19404 logger: "console" 19405 }, 19406 level: severityLevelFromString(handlerData.level), 19407 message: safeJoin(handlerData.args, " ") 19408 }; 19409 if (handlerData.level === "assert") { 19410 if (handlerData.args[0] === false) { 19411 breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), " ") || "console.assert"}`; 19412 breadcrumb.data.arguments = handlerData.args.slice(1); 19413 } else { 19414 return; 19415 } 19416 } 19417 addBreadcrumb(breadcrumb, { 19418 input: handlerData.args, 19419 level: handlerData.level 19420 }); 19421 }; 19422 } 19423 function _getXhrBreadcrumbHandler(client2) { 19424 return function _xhrBreadcrumb(handlerData) { 19425 if (getClient() !== client2) { 19426 return; 19427 } 19428 const { startTimestamp, endTimestamp } = handlerData; 19429 const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY]; 19430 if (!startTimestamp || !endTimestamp || !sentryXhrData) { 19431 return; 19432 } 19433 const { method, url, status_code, body } = sentryXhrData; 19434 const data = { 19435 method, 19436 url, 19437 status_code 19438 }; 19439 const hint = { 19440 xhr: handlerData.xhr, 19441 input: body, 19442 startTimestamp, 19443 endTimestamp 19444 }; 19445 const level = getBreadcrumbLogLevelFromHttpStatusCode(status_code); 19446 addBreadcrumb( 19447 { 19448 category: "xhr", 19449 data, 19450 type: "http", 19451 level 19452 }, 19453 hint 19454 ); 19455 }; 19456 } 19457 function _getFetchBreadcrumbHandler(client2) { 19458 return function _fetchBreadcrumb(handlerData) { 19459 if (getClient() !== client2) { 19460 return; 19461 } 19462 const { startTimestamp, endTimestamp } = handlerData; 19463 if (!endTimestamp) { 19464 return; 19465 } 19466 if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === "POST") { 19467 return; 19468 } 19469 if (handlerData.error) { 19470 const data = handlerData.fetchData; 19471 const hint = { 19472 data: handlerData.error, 19473 input: handlerData.args, 19474 startTimestamp, 19475 endTimestamp 19476 }; 19477 addBreadcrumb( 19478 { 19479 category: "fetch", 19480 data, 19481 level: "error", 19482 type: "http" 19483 }, 19484 hint 19485 ); 19486 } else { 19487 const response = handlerData.response; 19488 const data = __spreadProps(__spreadValues({}, handlerData.fetchData), { 19489 status_code: response && response.status 19490 }); 19491 const hint = { 19492 input: handlerData.args, 19493 response, 19494 startTimestamp, 19495 endTimestamp 19496 }; 19497 const level = getBreadcrumbLogLevelFromHttpStatusCode(data.status_code); 19498 addBreadcrumb( 19499 { 19500 category: "fetch", 19501 data, 19502 type: "http", 19503 level 19504 }, 19505 hint 19506 ); 19507 } 19508 }; 19509 } 19510 function _getHistoryBreadcrumbHandler(client2) { 19511 return function _historyBreadcrumb(handlerData) { 19512 if (getClient() !== client2) { 19513 return; 19514 } 19515 let from2 = handlerData.from; 19516 let to2 = handlerData.to; 19517 const parsedLoc = parseUrl$1(WINDOW$1.location.href); 19518 let parsedFrom = from2 ? parseUrl$1(from2) : void 0; 19519 const parsedTo = parseUrl$1(to2); 19520 if (!parsedFrom || !parsedFrom.path) { 19521 parsedFrom = parsedLoc; 19522 } 19523 if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { 19524 to2 = parsedTo.relative; 19525 } 19526 if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { 19527 from2 = parsedFrom.relative; 19528 } 19529 addBreadcrumb({ 19530 category: "navigation", 19531 data: { 19532 from: from2, 19533 to: to2 19534 } 19535 }); 19536 }; 19537 } 19538 function _isEvent(event) { 19539 return !!event && !!event.target; 19540 } 19541 const DEFAULT_EVENT_TARGET = [ 19542 "EventTarget", 19543 "Window", 19544 "Node", 19545 "ApplicationCache", 19546 "AudioTrackList", 19547 "BroadcastChannel", 19548 "ChannelMergerNode", 19549 "CryptoOperation", 19550 "EventSource", 19551 "FileReader", 19552 "HTMLUnknownElement", 19553 "IDBDatabase", 19554 "IDBRequest", 19555 "IDBTransaction", 19556 "KeyOperation", 19557 "MediaController", 19558 "MessagePort", 19559 "ModalWindow", 19560 "Notification", 19561 "SVGElementInstance", 19562 "Screen", 19563 "SharedWorker", 19564 "TextTrack", 19565 "TextTrackCue", 19566 "TextTrackList", 19567 "WebSocket", 19568 "WebSocketWorker", 19569 "Worker", 19570 "XMLHttpRequest", 19571 "XMLHttpRequestEventTarget", 19572 "XMLHttpRequestUpload" 19573 ]; 19574 const INTEGRATION_NAME$2 = "BrowserApiErrors"; 19575 const _browserApiErrorsIntegration = ((options2 = {}) => { 19576 const _options = __spreadValues({ 19577 XMLHttpRequest: true, 19578 eventTarget: true, 19579 requestAnimationFrame: true, 19580 setInterval: true, 19581 setTimeout: true 19582 }, options2); 19583 return { 19584 name: INTEGRATION_NAME$2,
19585 // TODO: This currently only works for the first client this is setup 19586 // We may want to adjust this to check for client etc. 19587 setupOnce() { 19588 if (_options.setTimeout) { 19589 fill(WINDOW$1, "setTimeout", _wrapTimeFunction); 19590 } 19591 if (_options.setInterval) { 19592 fill(WINDOW$1, "setInterval", _wrapTimeFunction); 19593 } 19594 if (_options.requestAnimationFrame) { 19595 fill(WINDOW$1, "requestAnimationFrame", _wrapRAF); 19596 } 19597 if (_options.XMLHttpRequest && "XMLHttpRequest" in WINDOW$1) { 19598 fill(XMLHttpRequest.prototype, "send", _wrapXHR); 19599 } 19600 const eventTargetOption = _options.eventTarget; 19601 if (eventTargetOption) { 19602 const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET; 19603 eventTarget.forEach(_wrapEventTarget); 19604 } 19605 } 19606 }; 19607 }); 19608 const browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration); 19609 function _wrapTimeFunction(original) { 19610 return function(...args) { 19611 const originalCallback = args[0]; 19612 args[0] = wrap(originalCallback, { 19613 mechanism: { 19614 data: { function: getFunctionName(original) }, 19615 handled: false, 19616 type: "instrument" 19617 } 19618 }); 19619 return original.apply(this, args); 19620 }; 19621 } 19622 function _wrapRAF(original) { 19623 return function(callback) { 19624 return original.apply(this, [ 19625 wrap(callback, { 19626 mechanism: { 19627 data: { 19628 function: "requestAnimationFrame", 19629 handler: getFunctionName(original) 19630 }, 19631 handled: false, 19632 type: "instrument" 19633 } 19634 }) 19635 ]); 19636 }; 19637 } 19638 function _wrapXHR(originalSend) { 19639 return function(...args) { 19640 const xhr = this; 19641 const xmlHttpRequestProps = ["onload", "onerror", "onprogress", "onreadystatechange"]; 19642 xmlHttpRequestProps.forEach((prop) => { 19643 if (prop in xhr && typeof xhr[prop] === "function") { 19644 fill(xhr, prop, function(original) { 19645 const wrapOptions = { 19646 mechanism: { 19647 data: { 19648 function: prop, 19649 handler: getFunctionName(original) 19650 }, 19651 handled: false, 19652 type: "instrument" 19653 } 19654 }; 19655 const originalFunction = getOriginalFunction(original); 19656 if (originalFunction) { 19657 wrapOptions.mechanism.data.handler = getFunctionName(originalFunction); 19658 } 19659 return wrap(original, wrapOptions); 19660 }); 19661 } 19662 }); 19663 return originalSend.apply(this, args); 19664 }; 19665 } 19666 function _wrapEventTarget(target) { 19667 const globalObject = WINDOW$1; 19668 const targetObj = globalObject[target]; 19669 const proto = targetObj && targetObj.prototype; 19670 if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty("addEventListener")) { 19671 return; 19672 } 19673 fill(proto, "addEventListener", function(original) { 19674 return function(eventName, fn2, options2) { 19675 try { 19676 if (isEventListenerObject(fn2)) { 19677 fn2.handleEvent = wrap(fn2.handleEvent, { 19678 mechanism: { 19679 data: { 19680 function: "handleEvent", 19681 handler: getFunctionName(fn2), 19682 target 19683 }, 19684 handled: false, 19685 type: "instrument" 19686 } 19687 }); 19688 } 19689 } catch (e2) { 19690 } 19691 return original.apply(this, [ 19692 eventName, 19693 wrap(fn2, { 19694 mechanism: { 19695 data: { 19696 function: "addEventListener", 19697 handler: getFunctionName(fn2), 19698 target 19699 }, 19700 handled: false, 19701 type: "instrument" 19702 } 19703 }), 19704 options2 19705 ]); 19706 }; 19707 }); 19708 fill(proto, "removeEventListener", function(originalRemoveEventListener) { 19709 return function(eventName, fn2, options2) { 19710 try { 19711 const originalEventHandler = fn2.__sentry_wrapped__; 19712 if (originalEventHandler) { 19713 originalRemoveEventListener.call(this, eventName, originalEventHandler, options2); 19714 } 19715 } catch (e2) { 19716 } 19717 return originalRemoveEventListener.call(this, eventName, fn2, options2); 19718 }; 19719 }); 19720 } 19721 function isEventListenerObject(obj) { 19722 return typeof obj.handleEvent === "function"; 19723 } 19724 const browserSessionIntegration = defineIntegration(() => { 19725 return { 19726 name: "BrowserSession", 19727 setupOnce() { 19728 if (typeof WINDOW$1.document === "undefined") { 19729 DEBUG_BUILD$1 && logger.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."); 19730 return; 19731 } 19732 startSession({ ignoreDuration: true }); 19733 captureSession(); 19734 addHistoryInstrumentationHandler(({ from: from2, to: to2 }) => { 19735 if (from2 !== void 0 && from2 !== to2) { 19736 startSession({ ignoreDuration: true }); 19737 captureSession(); 19738 } 19739 }); 19740 } 19741 }; 19742 }); 19743 const INTEGRATION_NAME$1 = "GlobalHandlers"; 19744 const _globalHandlersIntegration = ((options2 = {}) => { 19745 const _options = __spreadValues({ 19746 onerror: true, 19747 onunhandledrejection: true 19748 }, options2); 19749 return { 19750 name: INTEGRATION_NAME$1, 19751 setupOnce() { 19752 Error.stackTraceLimit = 50; 19753 }, 19754 setup(client2) { 19755 if (_options.onerror) { 19756 _installGlobalOnErrorHandler(client2); 19757 globalHandlerLog("onerror"); 19758 } 19759 if (_options.onunhandledrejection) { 19760 _installGlobalOnUnhandledRejectionHandler(client2); 19761 globalHandlerLog("onunhandledrejection"); 19762 } 19763 } 19764 }; 19765 }); 19766 const globalHandlersIntegration = defineIntegration(_globalHandlersIntegration); 19767 function _installGlobalOnErrorHandler(client2) { 19768 addGlobalErrorInstrumentationHandler((data) => { 19769 const { stackParser, attachStacktrace } = getOptions(); 19770 if (getClient() !== client2 || shouldIgnoreOnError()) { 19771 return; 19772 } 19773 const { msg, url, line: line2, column: column2, error } = data; 19774 const event = _enhanceEventWithInitialFrame( 19775 eventFromUnknownInput(stackParser, error || msg, void 0, attachStacktrace, false), 19776 url, 19777 line2, 19778 column2 19779 ); 19780 event.level = "error"; 19781 captureEvent(event, { 19782 originalException: error, 19783 mechanism: { 19784 handled: false, 19785 type: "onerror" 19786 } 19787 }); 19788 }); 19789 } 19790 function _installGlobalOnUnhandledRejectionHandler(client2) { 19791 addGlobalUnhandledRejectionInstrumentationHandler((e2) => { 19792 const { stackParser, attachStacktrace } = getOptions(); 19793 if (getClient() !== client2 || shouldIgnoreOnError()) { 19794 return; 19795 } 19796 const error = _getUnhandledRejectionError(e2); 19797 const event = isPrimitive(error) ? _eventFromRejectionWithPrimitive(error) : eventFromUnknownInput(stackParser, error, void 0, attachStacktrace, true); 19798 event.level = "error"; 19799 captureEvent(event, { 19800 originalException: error, 19801 mechanism: { 19802 handled: false, 19803 type: "onunhandledrejection" 19804 } 19805 }); 19806 }); 19807 } 19808 function _getUnhandledRejectionError(error) { 19809 if (isPrimitive(error)) { 19810 return error; 19811 }
19812 try { 19813 if ("reason" in error) { 19814 return error.reason; 19815 } 19816 if ("detail" in error && "reason" in error.detail) { 19817 return error.detail.reason; 19818 } 19819 } catch (e2) { 19820 } 19821 return error; 19822 } 19823 function _eventFromRejectionWithPrimitive(reason) { 19824 return { 19825 exception: { 19826 values: [ 19827 { 19828 type: "UnhandledRejection", 19829 // String() is needed because the Primitive type includes symbols (which can't be automatically stringified) 19830 value: `Non-Error promise rejection captured with value: ${String(reason)}` 19831 } 19832 ] 19833 } 19834 }; 19835 } 19836 function _enhanceEventWithInitialFrame(event, url, line2, column2) { 19837 const e2 = event.exception = event.exception || {}; 19838 const ev = e2.values = e2.values || []; 19839 const ev0 = ev[0] = ev[0] || {}; 19840 const ev0s = ev0.stacktrace = ev0.stacktrace || {}; 19841 const ev0sf = ev0s.frames = ev0s.frames || []; 19842 const colno = column2; 19843 const lineno = line2; 19844 const filename = isString$2(url) && url.length > 0 ? url : getLocationHref(); 19845 if (ev0sf.length === 0) { 19846 ev0sf.push({ 19847 colno, 19848 filename, 19849 function: UNKNOWN_FUNCTION, 19850 in_app: true, 19851 lineno 19852 }); 19853 } 19854 return event; 19855 } 19856 function globalHandlerLog(type) { 19857 DEBUG_BUILD$1 && logger.log(`Global Handler attached: ${type}`); 19858 } 19859 function getOptions() { 19860 const client2 = getClient(); 19861 const options2 = client2 && client2.getOptions() || { 19862 stackParser: () => [], 19863 attachStacktrace: false 19864 }; 19865 return options2; 19866 } 19867 const httpContextIntegration = defineIntegration(() => { 19868 return { 19869 name: "HttpContext", 19870 preprocessEvent(event) { 19871 if (!WINDOW$1.navigator && !WINDOW$1.location && !WINDOW$1.document) { 19872 return; 19873 } 19874 const url = event.request && event.request.url || WINDOW$1.location && WINDOW$1.location.href; 19875 const { referrer } = WINDOW$1.document || {}; 19876 const { userAgent } = WINDOW$1.navigator || {}; 19877 const headers = __spreadValues(__spreadValues(__spreadValues({}, event.request && event.request.headers), referrer && { Referer: referrer }), userAgent && { "User-Agent": userAgent }); 19878 const request = __spreadProps(__spreadValues(__spreadValues({}, event.request), url && { url }), { headers }); 19879 event.request = request; 19880 } 19881 }; 19882 }); 19883 const DEFAULT_KEY = "cause"; 19884 const DEFAULT_LIMIT = 5; 19885 const INTEGRATION_NAME = "LinkedErrors"; 19886 const _linkedErrorsIntegration = ((options2 = {}) => { 19887 const limit = options2.limit || DEFAULT_LIMIT; 19888 const key = options2.key || DEFAULT_KEY; 19889 return { 19890 name: INTEGRATION_NAME, 19891 preprocessEvent(event, hint, client2) { 19892 const options3 = client2.getOptions(); 19893 applyAggregateErrorsToEvent( 19894 // This differs from the LinkedErrors integration in core by using a different exceptionFromError function 19895 exceptionFromError, 19896 options3.stackParser, 19897 options3.maxValueLength, 19898 key, 19899 limit, 19900 event, 19901 hint 19902 ); 19903 } 19904 }; 19905 }); 19906 const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration); 19907 function getDefaultIntegrations(options2) { 19908 const integrations = [ 19909 inboundFiltersIntegration(), 19910 functionToStringIntegration(), 19911 browserApiErrorsIntegration(), 19912 breadcrumbsIntegration(), 19913 globalHandlersIntegration(), 19914 linkedErrorsIntegration(), 19915 dedupeIntegration(), 19916 httpContextIntegration() 19917 ]; 19918 if (options2.autoSessionTracking !== false) { 19919 integrations.push(browserSessionIntegration()); 19920 } 19921 return integrations; 19922 } 19923 function applyDefaultOptions(optionsArg = {}) { 19924 const defaultOptions2 = { 19925 defaultIntegrations: getDefaultIntegrations(optionsArg), 19926 release: typeof __SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW$1.SENTRY_RELEASE && WINDOW$1.SENTRY_RELEASE.id ? WINDOW$1.SENTRY_RELEASE.id : void 0, 19927 autoSessionTracking: true, 19928 sendClientReports: true 19929 }; 19930 if (optionsArg.defaultIntegrations == null) { 19931 delete optionsArg.defaultIntegrations; 19932 } 19933 return __spreadValues(__spreadValues({}, defaultOptions2), optionsArg); 19934 } 19935 function shouldShowBrowserExtensionError() { 19936 const windowWithMaybeExtension = typeof WINDOW$1.window !== "undefined" && WINDOW$1; 19937 if (!windowWithMaybeExtension) { 19938 return false;
19939 } 19940 const extensionKey = windowWithMaybeExtension.chrome ? "chrome" : "browser"; 19941 const extensionObject = windowWithMaybeExtension[extensionKey]; 19942 const runtimeId = extensionObject && extensionObject.runtime && extensionObject.runtime.id; 19943 const href = WINDOW$1.location && WINDOW$1.location.href || ""; 19944 const extensionProtocols = ["chrome-extension:", "moz-extension:", "ms-browser-extension:", "safari-web-extension:"]; 19945 const isDedicatedExtensionPage = !!runtimeId && WINDOW$1 === WINDOW$1.top && extensionProtocols.some((protocol) => href.startsWith(`${protocol}//`)); 19946 const isNWjs = typeof windowWithMaybeExtension.nw !== "undefined"; 19947 return !!runtimeId && !isDedicatedExtensionPage && !isNWjs; 19948 } 19949 function init$2(browserOptions = {}) { 19950 const options2 = applyDefaultOptions(browserOptions); 19951 if (!options2.skipBrowserExtensionCheck && shouldShowBrowserExtensionError()) { 19952 consoleSandbox(() => { 19953 console.error( 19954 "[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/" 19955 ); 19956 }); 19957 return; 19958 } 19959 if (DEBUG_BUILD$1) { 19960 if (!supportsFetch()) { 19961 logger.warn( 19962 "No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill." 19963 ); 19964 } 19965 } 19966 const clientOptions = __spreadProps(__spreadValues({}, options2), { 19967 stackParser: stackParserFromStackParserOptions(options2.stackParser || defaultStackParser), 19968 integrations: getIntegrationsToSetup(options2), 19969 transport: options2.transport || makeFetchTransport 19970 }); 19971 return initAndBind(BrowserClient, clientOptions); 19972 } 19973 const responseToSpanId = /* @__PURE__ */ new WeakMap(); 19974 const spanIdToEndTimestamp = /* @__PURE__ */ new Map(); 19975 const defaultRequestInstrumentationOptions = { 19976 traceFetch: true, 19977 traceXHR: true, 19978 enableHTTPTimings: true, 19979 trackFetchStreamPerformance: false 19980 }; 19981 function instrumentOutgoingRequests(client2, _options) { 19982 const { 19983 traceFetch, 19984 traceXHR, 19985 trackFetchStreamPerformance, 19986 shouldCreateSpanForRequest, 19987 enableHTTPTimings, 19988 tracePropagationTargets 19989 } = __spreadValues({ 19990 traceFetch: defaultRequestInstrumentationOptions.traceFetch, 19991 traceXHR: defaultRequestInstrumentationOptions.traceXHR, 19992 trackFetchStreamPerformance: defaultRequestInstrumentationOptions.trackFetchStreamPerformance 19993 }, _options); 19994 const shouldCreateSpan = typeof shouldCreateSpanForRequest === "function" ? shouldCreateSpanForRequest : (_2) => true; 19995 const shouldAttachHeadersWithTargets = (url) => shouldAttachHeaders(url, tracePropagationTargets); 19996 const spans = {}; 19997 if (traceFetch) { 19998 client2.addEventProcessor((event) => { 19999 if (event.type === "transaction" && event.spans) { 20000 event.spans.forEach((span) => { 20001 if (span.op === "http.client") { 20002 const updatedTimestamp = spanIdToEndTimestamp.get(span.span_id); 20003 if (updatedTimestamp) { 20004 span.timestamp = updatedTimestamp / 1e3; 20005 spanIdToEndTimestamp.delete(span.span_id); 20006 } 20007 } 20008 }); 20009 } 20010 return event; 20011 }); 20012 if (trackFetchStreamPerformance) { 20013 addFetchEndInstrumentationHandler((handlerData) => { 20014 if (handlerData.response) { 20015 const span = responseToSpanId.get(handlerData.response); 20016 if (span && handlerData.endTimestamp) { 20017 spanIdToEndTimestamp.set(span, handlerData.endTimestamp); 20018 } 20019 } 20020 }); 20021 } 20022 addFetchInstrumentationHandler((handlerData) => { 20023 const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); 20024 if (handlerData.response && handlerData.fetchData.__span) { 20025 responseToSpanId.set(handlerData.response, handlerData.fetchData.__span); 20026 } 20027 if (createdSpan) { 20028 const fullUrl = getFullURL(handlerData.fetchData.url); 20029 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 20030 createdSpan.setAttributes({ 20031 "http.url": fullUrl, 20032 "server.address": host 20033 }); 20034 } 20035 if (enableHTTPTimings && createdSpan) { 20036 addHTTPTimings(createdSpan); 20037 } 20038 }); 20039 } 20040 if (traceXHR) { 20041 addXhrInstrumentationHandler((handlerData) => { 20042 const createdSpan = xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans); 20043 if (enableHTTPTimings && createdSpan) { 20044 addHTTPTimings(createdSpan); 20045 } 20046 }); 20047 } 20048 } 20049 function isPerformanceResourceTiming(entry) { 20050 return entry.entryType === "resource" && "initiatorType" in entry && typeof entry.nextHopProtocol === "string" && (entry.initiatorType === "fetch" || entry.initiatorType === "xmlhttprequest"); 20051 } 20052 function addHTTPTimings(span) { 20053 const { url } = spanToJSON(span).data || {}; 20054 if (!url || typeof url !== "string") { 20055 return; 20056 } 20057 const cleanup = addPerformanceInstrumentationHandler("resource", ({ entries: entries2 }) => {
20058 entries2.forEach((entry) => { 20059 if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) { 20060 const spanData = resourceTimingEntryToSpanData(entry); 20061 spanData.forEach((data) => span.setAttribute(...data)); 20062 setTimeout(cleanup); 20063 } 20064 }); 20065 }); 20066 } 20067 function getAbsoluteTime(time2 = 0) { 20068 return ((browserPerformanceTimeOrigin || performance.timeOrigin) + time2) / 1e3; 20069 } 20070 function resourceTimingEntryToSpanData(resourceTiming) { 20071 const { name, version } = extractNetworkProtocol(resourceTiming.nextHopProtocol); 20072 const timingSpanData = []; 20073 timingSpanData.push(["network.protocol.version", version], ["network.protocol.name", name]); 20074 if (!browserPerformanceTimeOrigin) { 20075 return timingSpanData; 20076 } 20077 return [ 20078 ...timingSpanData, 20079 ["http.request.redirect_start", getAbsoluteTime(resourceTiming.redirectStart)], 20080 ["http.request.fetch_start", getAbsoluteTime(resourceTiming.fetchStart)], 20081 ["http.request.domain_lookup_start", getAbsoluteTime(resourceTiming.domainLookupStart)], 20082 ["http.request.domain_lookup_end", getAbsoluteTime(resourceTiming.domainLookupEnd)], 20083 ["http.request.connect_start", getAbsoluteTime(resourceTiming.connectStart)], 20084 ["http.request.secure_connection_start", getAbsoluteTime(resourceTiming.secureConnectionStart)], 20085 ["http.request.connection_end", getAbsoluteTime(resourceTiming.connectEnd)], 20086 ["http.request.request_start", getAbsoluteTime(resourceTiming.requestStart)], 20087 ["http.request.response_start", getAbsoluteTime(resourceTiming.responseStart)], 20088 ["http.request.response_end", getAbsoluteTime(resourceTiming.responseEnd)] 20089 ]; 20090 } 20091 function shouldAttachHeaders(targetUrl, tracePropagationTargets) { 20092 const href = WINDOW$1.location && WINDOW$1.location.href; 20093 if (!href) { 20094 const isRelativeSameOriginRequest = !!targetUrl.match(/^\/(?!\/)/); 20095 if (!tracePropagationTargets) { 20096 return isRelativeSameOriginRequest; 20097 } else { 20098 return stringMatchesSomePattern(targetUrl, tracePropagationTargets); 20099 } 20100 } else { 20101 let resolvedUrl; 20102 let currentOrigin; 20103 try { 20104 resolvedUrl = new URL(targetUrl, href); 20105 currentOrigin = new URL(href).origin; 20106 } catch (e2) { 20107 return false; 20108 } 20109 const isSameOriginRequest = resolvedUrl.origin === currentOrigin; 20110 if (!tracePropagationTargets) { 20111 return isSameOriginRequest; 20112 } else { 20113 return stringMatchesSomePattern(resolvedUrl.toString(), tracePropagationTargets) || isSameOriginRequest && stringMatchesSomePattern(resolvedUrl.pathname, tracePropagationTargets); 20114 } 20115 } 20116 }
20117 function xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeaders2, spans) { 20118 const xhr = handlerData.xhr; 20119 const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY]; 20120 if (!xhr || xhr.__sentry_own_request__ || !sentryXhrData) { 20121 return void 0; 20122 } 20123 const shouldCreateSpanResult = hasTracingEnabled() && shouldCreateSpan(sentryXhrData.url); 20124 if (handlerData.endTimestamp && shouldCreateSpanResult) { 20125 const spanId = xhr.__sentry_xhr_span_id__; 20126 if (!spanId) return; 20127 const span2 = spans[spanId]; 20128 if (span2 && sentryXhrData.status_code !== void 0) { 20129 setHttpStatus(span2, sentryXhrData.status_code); 20130 span2.end(); 20131 delete spans[spanId]; 20132 } 20133 return void 0; 20134 } 20135 const fullUrl = getFullURL(sentryXhrData.url); 20136 const host = fullUrl ? parseUrl$1(fullUrl).host : void 0; 20137 const hasParent = !!getActiveSpan(); 20138 const span = shouldCreateSpanResult && hasParent ? startInactiveSpan({ 20139 name: `${sentryXhrData.method} ${sentryXhrData.url}`, 20140 attributes: { 20141 type: "xhr", 20142 "http.method": sentryXhrData.method, 20143 "http.url": fullUrl, 20144 url: sentryXhrData.url, 20145 "server.address": host, 20146 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.browser", 20147 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" 20148 } 20149 }) : new SentryNonRecordingSpan(); 20150 xhr.__sentry_xhr_span_id__ = span.spanContext().spanId; 20151 spans[xhr.__sentry_xhr_span_id__] = span; 20152 if (shouldAttachHeaders2(sentryXhrData.url)) { 20153 addTracingHeadersToXhrRequest( 20154 xhr, 20155 // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), 20156 // we do not want to use the span as base for the trace headers, 20157 // which means that the headers will be generated from the scope and the sampling decision is deferred 20158 hasTracingEnabled() && hasParent ? span : void 0 20159 ); 20160 } 20161 return span; 20162 } 20163 function addTracingHeadersToXhrRequest(xhr, span) { 20164 const { "sentry-trace": sentryTrace, baggage } = getTraceData({ span }); 20165 if (sentryTrace) { 20166 setHeaderOnXhr(xhr, sentryTrace, baggage); 20167 } 20168 } 20169 function setHeaderOnXhr(xhr, sentryTraceHeader, sentryBaggageHeader) { 20170 try { 20171 xhr.setRequestHeader("sentry-trace", sentryTraceHeader); 20172 if (sentryBaggageHeader) { 20173 xhr.setRequestHeader("baggage", sentryBaggageHeader); 20174 } 20175 } catch (_2) { 20176 } 20177 } 20178 function getFullURL(url) { 20179 try { 20180 const parsed = new URL(url, WINDOW$1.location.origin); 20181 return parsed.href; 20182 } catch (e2) { 20183 return void 0; 20184 } 20185 } 20186 function registerBackgroundTabDetection() { 20187 if (WINDOW$1 && WINDOW$1.document) { 20188 WINDOW$1.document.addEventListener("visibilitychange", () => { 20189 const activeSpan = getActiveSpan(); 20190 if (!activeSpan) { 20191 return; 20192 } 20193 const rootSpan = getRootSpan(activeSpan); 20194 if (WINDOW$1.document.hidden && rootSpan) { 20195 const cancelledStatus = "cancelled"; 20196 const { op, status } = spanToJSON(rootSpan); 20197 if (DEBUG_BUILD$1) { 20198 logger.log(`[Tracing] Transaction: ${cancelledStatus} -> since tab moved to the background, op: ${op}`); 20199 } 20200 if (!status) { 20201 rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: cancelledStatus }); 20202 } 20203 rootSpan.setAttribute("sentry.cancellation_reason", "document.hidden"); 20204 rootSpan.end(); 20205 } 20206 }); 20207 } else { 20208 DEBUG_BUILD$1 && logger.warn("[Tracing] Could not set up background tab detection due to lack of global document"); 20209 } 20210 } 20211 const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing"; 20212 const DEFAULT_BROWSER_TRACING_OPTIONS = __spreadValues(__spreadProps(__spreadValues({}, TRACING_DEFAULTS), { 20213 instrumentNavigation: true, 20214 instrumentPageLoad: true,
20215 markBackgroundSpan: true, 20216 enableLongTask: true, 20217 enableLongAnimationFrame: true, 20218 enableInp: true, 20219 _experiments: {} 20220 }), defaultRequestInstrumentationOptions); 20221 const browserTracingIntegration = ((_options = {}) => { 20222 registerSpanErrorInstrumentation(); 20223 const { 20224 enableInp, 20225 enableLongTask, 20226 enableLongAnimationFrame, 20227 _experiments: { enableInteractions, enableStandaloneClsSpans }, 20228 beforeStartSpan, 20229 idleTimeout, 20230 finalTimeout, 20231 childSpanTimeout, 20232 markBackgroundSpan, 20233 traceFetch, 20234 traceXHR, 20235 trackFetchStreamPerformance, 20236 shouldCreateSpanForRequest, 20237 enableHTTPTimings, 20238 instrumentPageLoad, 20239 instrumentNavigation 20240 } = __spreadValues(__spreadValues({}, DEFAULT_BROWSER_TRACING_OPTIONS), _options); 20241 const _collectWebVitals = startTrackingWebVitals({ recordClsStandaloneSpans: enableStandaloneClsSpans || false }); 20242 if (enableInp) { 20243 startTrackingINP(); 20244 } 20245 if (enableLongAnimationFrame && GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")) { 20246 startTrackingLongAnimationFrames(); 20247 } else if (enableLongTask) { 20248 startTrackingLongTasks(); 20249 } 20250 if (enableInteractions) { 20251 startTrackingInteractions(); 20252 } 20253 const latestRoute = { 20254 name: void 0, 20255 source: void 0 20256 }; 20257 function _createRouteSpan(client2, startSpanOptions) { 20258 const isPageloadTransaction = startSpanOptions.op === "pageload"; 20259 const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions; 20260 const attributes = finalStartSpanOptions.attributes || {}; 20261 if (startSpanOptions.name !== finalStartSpanOptions.name) { 20262 attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom"; 20263 finalStartSpanOptions.attributes = attributes; 20264 } 20265 latestRoute.name = finalStartSpanOptions.name; 20266 latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 20267 const idleSpan = startIdleSpan(finalStartSpanOptions, { 20268 idleTimeout, 20269 finalTimeout, 20270 childSpanTimeout, 20271 // should wait for finish signal if it's a pageload transaction 20272 disableAutoFinish: isPageloadTransaction, 20273 beforeSpanEnd: (span) => { 20274 _collectWebVitals(); 20275 addPerformanceEntries(span, { recordClsOnPageloadSpan: !enableStandaloneClsSpans }); 20276 } 20277 }); 20278 function emitFinish() { 20279 if (["interactive", "complete"].includes(WINDOW$1.document.readyState)) { 20280 client2.emit("idleSpanEnableAutoFinish", idleSpan); 20281 } 20282 } 20283 if (isPageloadTransaction && WINDOW$1.document) { 20284 WINDOW$1.document.addEventListener("readystatechange", () => { 20285 emitFinish(); 20286 }); 20287 emitFinish(); 20288 } 20289 return idleSpan; 20290 } 20291 return { 20292 name: BROWSER_TRACING_INTEGRATION_ID, 20293 afterAllSetup(client2) { 20294 let activeSpan; 20295 let startingUrl = WINDOW$1.location && WINDOW$1.location.href; 20296 function maybeEndActiveSpan() { 20297 if (activeSpan && !spanToJSON(activeSpan).timestamp) { 20298 DEBUG_BUILD$1 && logger.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`); 20299 activeSpan.end(); 20300 } 20301 } 20302 client2.on("startNavigationSpan", (startSpanOptions) => { 20303 if (getClient() !== client2) { 20304 return; 20305 } 20306 maybeEndActiveSpan(); 20307 activeSpan = _createRouteSpan(client2, __spreadValues({ 20308 op: "navigation" 20309 }, startSpanOptions)); 20310 }); 20311 client2.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => { 20312 if (getClient() !== client2) { 20313 return; 20314 } 20315 maybeEndActiveSpan(); 20316 const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace"); 20317 const baggage = traceOptions.baggage || getMetaContent("baggage"); 20318 const propagationContext = propagationContextFromHeaders(sentryTrace, baggage); 20319 getCurrentScope().setPropagationContext(propagationContext); 20320 activeSpan = _createRouteSpan(client2, __spreadValues({ 20321 op: "pageload" 20322 }, startSpanOptions)); 20323 }); 20324 client2.on("spanEnd", (span) => { 20325 const op = spanToJSON(span).op; 20326 if (span !== getRootSpan(span) || op !== "navigation" && op !== "pageload") { 20327 return; 20328 } 20329 const scope = getCurrentScope(); 20330 const oldPropagationContext = scope.getPropagationContext(); 20331 scope.setPropagationContext(__spreadProps(__spreadValues({}, oldPropagationContext), { 20332 sampled: oldPropagationContext.sampled !== void 0 ? oldPropagationContext.sampled : spanIsSampled(span), 20333 dsc: oldPropagationContext.dsc || getDynamicSamplingContextFromSpan(span) 20334 })); 20335 }); 20336 if (WINDOW$1.location) { 20337 if (instrumentPageLoad) { 20338 startBrowserTracingPageLoadSpan(client2, { 20339 name: WINDOW$1.location.pathname, 20340 // pageload should always start at timeOrigin (and needs to be in s, not ms) 20341 startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1e3 : void 0, 20342 attributes: { 20343 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20344 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser" 20345 } 20346 }); 20347 } 20348 if (instrumentNavigation) { 20349 addHistoryInstrumentationHandler(({ to: to2, from: from2 }) => { 20350 if (from2 === void 0 && startingUrl && startingUrl.indexOf(to2) !== -1) { 20351 startingUrl = void 0; 20352 return; 20353 } 20354 if (from2 !== to2) { 20355 startingUrl = void 0; 20356 startBrowserTracingNavigationSpan(client2, { 20357 name: WINDOW$1.location.pathname, 20358 attributes: { 20359 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20360 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser" 20361 } 20362 }); 20363 } 20364 }); 20365 } 20366 }
20367 if (markBackgroundSpan) { 20368 registerBackgroundTabDetection(); 20369 } 20370 if (enableInteractions) { 20371 registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); 20372 } 20373 if (enableInp) { 20374 registerInpInteractionListener(); 20375 } 20376 instrumentOutgoingRequests(client2, { 20377 traceFetch, 20378 traceXHR, 20379 trackFetchStreamPerformance, 20380 tracePropagationTargets: client2.getOptions().tracePropagationTargets, 20381 shouldCreateSpanForRequest, 20382 enableHTTPTimings 20383 }); 20384 } 20385 }; 20386 }); 20387 function startBrowserTracingPageLoadSpan(client2, spanOptions, traceOptions) { 20388 client2.emit("startPageLoadSpan", spanOptions, traceOptions); 20389 getCurrentScope().setTransactionName(spanOptions.name); 20390 const span = getActiveSpan(); 20391 const op = span && spanToJSON(span).op; 20392 return op === "pageload" ? span : void 0; 20393 } 20394 function startBrowserTracingNavigationSpan(client2, spanOptions) { 20395 getIsolationScope().setPropagationContext({ traceId: generateTraceId() }); 20396 getCurrentScope().setPropagationContext({ traceId: generateTraceId() }); 20397 client2.emit("startNavigationSpan", spanOptions); 20398 getCurrentScope().setTransactionName(spanOptions.name); 20399 const span = getActiveSpan(); 20400 const op = span && spanToJSON(span).op; 20401 return op === "navigation" ? span : void 0; 20402 } 20403 function getMetaContent(metaName) { 20404 const metaTag = getDomElement(`meta[name=${metaName}]`); 20405 return metaTag ? metaTag.getAttribute("content") : void 0; 20406 } 20407 function registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute) { 20408 let inflightInteractionSpan; 20409 const registerInteractionTransaction = () => { 20410 const op = "ui.action.click"; 20411 const activeSpan = getActiveSpan(); 20412 const rootSpan = activeSpan && getRootSpan(activeSpan); 20413 if (rootSpan) { 20414 const currentRootSpanOp = spanToJSON(rootSpan).op; 20415 if (["navigation", "pageload"].includes(currentRootSpanOp)) { 20416 DEBUG_BUILD$1 && logger.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`); 20417 return void 0; 20418 } 20419 } 20420 if (inflightInteractionSpan) { 20421 inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted"); 20422 inflightInteractionSpan.end(); 20423 inflightInteractionSpan = void 0; 20424 } 20425 if (!latestRoute.name) { 20426 DEBUG_BUILD$1 && logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`); 20427 return void 0; 20428 } 20429 inflightInteractionSpan = startIdleSpan( 20430 { 20431 name: latestRoute.name, 20432 op, 20433 attributes: { 20434 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url" 20435 } 20436 }, 20437 { 20438 idleTimeout, 20439 finalTimeout, 20440 childSpanTimeout 20441 } 20442 ); 20443 }; 20444 if (WINDOW$1.document) { 20445 addEventListener("click", registerInteractionTransaction, { once: false, capture: true }); 20446 } 20447 } 20448 function init$1(options2) { 20449 const opts = __spreadValues({}, options2); 20450 applySdkMetadata(opts, "react"); 20451 setContext("react", { version: reactExports.version }); 20452 return init$2(opts); 20453 } 20454 var reactIs = { exports: {} }; 20455 var reactIs_production_min = {}; 20456 /** @license React v16.13.1 20457 * react-is.production.min.js 20458 * 20459 * Copyright (c) Facebook, Inc. and its affiliates. 20460 * 20461 * This source code is licensed under the MIT license found in the 20462 * LICENSE file in the root directory of this source tree. 20463 */ 20464 var hasRequiredReactIs_production_min; 20465 function requireReactIs_production_min() { 20466 if (hasRequiredReactIs_production_min) return reactIs_production_min; 20467 hasRequiredReactIs_production_min = 1; 20468 var b2 = "function" === typeof Symbol && Symbol.for, c2 = b2 ? Symbol.for("react.element") : 60103, d2 = b2 ? Symbol.for("react.portal") : 60106, e2 = b2 ? Symbol.for("react.fragment") : 60107, f2 = b2 ? Symbol.for("react.strict_mode") : 60108, g2 = b2 ? Symbol.for("react.profiler")
vendor: 6,121 bytes, lines 20468-20625
20468: 60114, h2 = b2 ? Symbol.for("react.provider") : 60109, k2 = b2 ? Symbol.for("react.context") : 60110, l2 = b2 ? Symbol.for("react.async_mode") : 60111, m2 = b2 ? Symbol.for("react.concurrent_mode") : 60111, n2 = b2 ? Symbol.for("react.forward_ref") : 60112, p2 = b2 ? Symbol.for("react.suspense") : 60113, q2 = b2 ? Symbol.for("react.suspense_list") : 60120, r2 = b2 ? Symbol.for("react.memo") : 60115, t2 = b2 ? Symbol.for("react.lazy") : 60116, v2 = b2 ? Symbol.for("react.block") : 60121, w2 = b2 ? Symbol.for("react.fundamental") : 60117, x2 = b2 ? Symbol.for("react.responder") : 60118, y2 = b2 ? Symbol.for("react.scope") : 60119; 20469 function z2(a2) { 20470 if ("object" === typeof a2 && null !== a2) { 20471 var u2 = a2.$$typeof; 20472 switch (u2) { 20473 case c2: 20474 switch (a2 = a2.type, a2) { 20475 case l2: 20476 case m2: 20477 case e2: 20478 case g2: 20479 case f2: 20480 case p2: 20481 return a2; 20482 default: 20483 switch (a2 = a2 && a2.$$typeof, a2) { 20484 case k2: 20485 case n2: 20486 case t2: 20487 case r2: 20488 case h2: 20489 return a2; 20490 default: 20491 return u2; 20492 } 20493 } 20494 case d2: 20495 return u2; 20496 } 20497 } 20498 } 20499 function A2(a2) { 20500 return z2(a2) === m2; 20501 } 20502 reactIs_production_min.AsyncMode = l2; 20503 reactIs_production_min.ConcurrentMode = m2; 20504 reactIs_production_min.ContextConsumer = k2; 20505 reactIs_production_min.ContextProvider = h2; 20506 reactIs_production_min.Element = c2; 20507 reactIs_production_min.ForwardRef = n2; 20508 reactIs_production_min.Fragment = e2; 20509 reactIs_production_min.Lazy = t2; 20510 reactIs_production_min.Memo = r2; 20511 reactIs_production_min.Portal = d2; 20512 reactIs_production_min.Profiler = g2; 20513 reactIs_production_min.StrictMode = f2; 20514 reactIs_production_min.Suspense = p2; 20515 reactIs_production_min.isAsyncMode = function(a2) { 20516 return A2(a2) || z2(a2) === l2; 20517 }; 20518 reactIs_production_min.isConcurrentMode = A2; 20519 reactIs_production_min.isContextConsumer = function(a2) { 20520 return z2(a2) === k2; 20521 }; 20522 reactIs_production_min.isContextProvider = function(a2) { 20523 return z2(a2) === h2; 20524 }; 20525 reactIs_production_min.isElement = function(a2) { 20526 return "object" === typeof a2 && null !== a2 && a2.$$typeof === c2; 20527 }; 20528 reactIs_production_min.isForwardRef = function(a2) { 20529 return z2(a2) === n2; 20530 }; 20531 reactIs_production_min.isFragment = function(a2) { 20532 return z2(a2) === e2; 20533 }; 20534 reactIs_production_min.isLazy = function(a2) { 20535 return z2(a2) === t2; 20536 }; 20537 reactIs_production_min.isMemo = function(a2) { 20538 return z2(a2) === r2; 20539 }; 20540 reactIs_production_min.isPortal = function(a2) { 20541 return z2(a2) === d2; 20542 }; 20543 reactIs_production_min.isProfiler = function(a2) { 20544 return z2(a2) === g2; 20545 }; 20546 reactIs_production_min.isStrictMode = function(a2) { 20547 return z2(a2) === f2; 20548 }; 20549 reactIs_production_min.isSuspense = function(a2) { 20550 return z2(a2) === p2; 20551 }; 20552 reactIs_production_min.isValidElementType = function(a2) { 20553 return "string" === typeof a2 || "function" === typeof a2 || a2 === e2 || a2 === m2 || a2 === g2 || a2 === f2 || a2 === p2 || a2 === q2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === t2 || a2.$$typeof === r2 || a2.$$typeof === h2 || a2.$$typeof === k2 || a2.$$typeof === n2 || a2.$$typeof === w2 || a2.$$typeof === x2 || a2.$$typeof === y2 || a2.$$typeof === v2); 20554 }; 20555 reactIs_production_min.typeOf = z2; 20556 return reactIs_production_min; 20557 } 20558 var hasRequiredReactIs; 20559 function requireReactIs() { 20560 if (hasRequiredReactIs) return reactIs.exports; 20561 hasRequiredReactIs = 1; 20562 { 20563 reactIs.exports = requireReactIs_production_min(); 20564 } 20565 return reactIs.exports; 20566 } 20567 var hoistNonReactStatics_cjs; 20568 var hasRequiredHoistNonReactStatics_cjs; 20569 function requireHoistNonReactStatics_cjs() { 20570 if (hasRequiredHoistNonReactStatics_cjs) return hoistNonReactStatics_cjs; 20571 hasRequiredHoistNonReactStatics_cjs = 1; 20572 var reactIs2 = requireReactIs(); 20573 var REACT_STATICS = { 20574 childContextTypes: true, 20575 contextType: true, 20576 contextTypes: true, 20577 defaultProps: true, 20578 displayName: true, 20579 getDefaultProps: true, 20580 getDerivedStateFromError: true, 20581 getDerivedStateFromProps: true, 20582 mixins: true, 20583 propTypes: true, 20584 type: true 20585 }; 20586 var KNOWN_STATICS = { 20587 name: true, 20588 length: true, 20589 prototype: true, 20590 caller: true, 20591 callee: true, 20592 arguments: true, 20593 arity: true 20594 }; 20595 var FORWARD_REF_STATICS = { 20596 "$$typeof": true, 20597 render: true, 20598 defaultProps: true, 20599 displayName: true, 20600 propTypes: true 20601 }; 20602 var MEMO_STATICS = { 20603 "$$typeof": true, 20604 compare: true, 20605 defaultProps: true, 20606 displayName: true, 20607 propTypes: true, 20608 type: true 20609 }; 20610 var TYPE_STATICS = {}; 20611 TYPE_STATICS[reactIs2.ForwardRef] = FORWARD_REF_STATICS; 20612 TYPE_STATICS[reactIs2.Memo] = MEMO_STATICS; 20613 function getStatics(component) { 20614 if (reactIs2.isMemo(component)) { 20615 return MEMO_STATICS; 20616 } 20617 return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; 20618 } 20619 var defineProperty2 = Object.defineProperty; 20620 var getOwnPropertyNames = Object.getOwnPropertyNames; 20621 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 20622 var getOwnPropertyDescriptor2 = Object.getOwnPropertyDescriptor; 20623 var getPrototypeOf2 = Object.getPrototypeOf; 20624 var objectPrototype = Object.prototype; 20625 function hoistNonReactStatics(targetComponent, sourceComponent, blackl
20625ist) { 20626 if (typeof sourceComponent !== "string") { 20627 if (objectPrototype) { 20628 var inheritedComponent = getPrototypeOf2(sourceComponent); 20629 if (inheritedComponent && inheritedComponent !== objectPrototype) { 20630 hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); 20631 } 20632 } 20633 var keys2 = getOwnPropertyNames(sourceComponent); 20634 if (getOwnPropertySymbols) { 20635 keys2 = keys2.concat(getOwnPropertySymbols(sourceComponent)); 20636 } 20637 var targetStatics = getStatics(targetComponent); 20638 var sourceStatics = getStatics(sourceComponent); 20639 for (var i2 = 0; i2 < keys2.length; ++i2) { 20640 var key = keys2[i2]; 20641 if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { 20642 var descriptor = getOwnPropertyDescriptor2(sourceComponent, key); 20643 try { 20644 defineProperty2(targetComponent, key, descriptor); 20645 } catch (e2) { 20646 } 20647 } 20648 } 20649 } 20650 return targetComponent; 20651 } 20652 hoistNonReactStatics_cjs = hoistNonReactStatics; 20653 return hoistNonReactStatics_cjs; 20654 } 20655 requireHoistNonReactStatics_cjs(); 20656 const CLIENTS_WITH_INSTRUMENT_NAVIGATION = /* @__PURE__ */ new WeakSet(); 20657 function createReactRouterV6CompatibleTracingIntegration(options2, version) { 20658 const integration = browserTracingIntegration(__spreadProps(__spreadValues({}, options2), { 20659 instrumentPageLoad: false, 20660 instrumentNavigation: false 20661 })); 20662 const { 20663 useEffect, 20664 useLocation: useLocation2, 20665 useNavigationType: useNavigationType2, 20666 createRoutesFromChildren: createRoutesFromChildren2, 20667 matchRoutes: matchRoutes2, 20668 stripBasename: stripBasename2, 20669 instrumentPageLoad = true, 20670 instrumentNavigation = true 20671 } = options2; 20672 return __spreadProps(__spreadValues({}, integration), { 20673 setup() { 20674 }, 20675 afterAllSetup(client2) { 20676 integration.afterAllSetup(client2); 20677 const initPathName = WINDOW$1 && WINDOW$1.location && WINDOW$1.location.pathname; 20678 if (instrumentPageLoad && initPathName) { 20679 startBrowserTracingPageLoadSpan(client2, { 20680 name: initPathName, 20681 attributes: { 20682 [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", 20683 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "pageload", 20684 [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.pageload.react.reactrouter_v${version}` 20685 } 20686 }); 20687 } 20688 if (instrumentNavigation) { 20689 CLIENTS_WITH_INSTRUMENT_NAVIGATION.add(client2); 20690 } 20691 } 20692 }); 20693 } 20694 function reactRouterV6BrowserTracingIntegration(options2) { 20695 return createReactRouterV6CompatibleTracingIntegration(options2, "6"); 20696 } 20697 var s$5 = (r2, t2) => { 20698 if (getCurrentEnvironment() === "development") { 20699 console.error(r2, t2); 20700 return; 20701 } 20702 return captureException(r2, t2); 20703 }; 20704 var c$4 = [/Cannot read properties of null \(reading 'sessionId'\)/, /null is not an object \(evaluating 'Qr\.sessionId'\)/, /Cannot read properties of null \(reading 'version'\)/, /null is not an object \(evaluating 'yi\.version'\)/], u$5 = []; 20705 var R$6 = (r2) => { 20706 let _a = r2 != null ? r2 : {}, { denyUrls: t2, ignoreErrors: o2, integrations: n2 } = _a, a2 = __objRest(_a, ["denyUrls", "ignoreErrors", "integrations"]); 20707 return __spreadValues({ dsn: getSentryDsn(), release: getCommitHash(), environment: getCurrentEnvironment(), integrations: [browserTracingIntegration(), breadcrumbsIntegration({ console: true, dom: true, fetch: true, history: true, xhr: true }), ...Array.isArray(n2) ? n2 : []], tracesSampleRate: 0, beforeBreadcrumb: (p2) => { 20708 var _a2; 20709 return typeof ((_a2 = p2.data) == null ? void 0 : _a2.url) == "string" && p2.data.url.includes("base64") && (p2.data.url = "__base64__"), p2; 20710 }, ignoreErrors: [...c$4, ...o2 != null ? o2 : []], denyUrls: [...u$5, ...t2 != null ? t2 : []] }, a2); 20711 }, b$4 = ({ appName: r2, options: t2 }) => { 20712 let o2 = getCurrentEnvironment(); 20713 o2 !== "production" && o2 !== "staging" || (init$1(R$6(t2)), getCurrentScope().setTag("app", r2)); 20714 }; 20715 const errorLoggerInterceptor = (logger2) => (error) => { 20716 var _a, _b, _c; 20717 if (((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) && ((_b = error == null ? void 0 : error.response) == null ? void 0 : _b.status) >= 500 || !((_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status)) { 20718 logger2(error); 20719 } 20720 return Promise.reject(error); 20721 }; 20722 function bind(fn2, thisArg) { 20723 return function wrap2() { 20724 return fn2.apply(thisArg, arguments); 20725 }; 20726 } 20727 const { toString: toString$2 } = Object.prototype; 20728 const { getPrototypeOf: getPrototypeOf$1 } = Object;
vendor: 8,656 bytes, lines 20729-20951
20729 const kindOf = /* @__PURE__ */ ((cache) => (thing) => { 20730 const str = toString$2.call(thing); 20731 return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); 20732 })(/* @__PURE__ */ Object.create(null)); 20733 const kindOfTest = (type) => { 20734 type = type.toLowerCase(); 20735 return (thing) => kindOf(thing) === type; 20736 }; 20737 const typeOfTest = (type) => (thing) => typeof thing === type; 20738 const { isArray: isArray$1 } = Array; 20739 const isUndefined$1 = typeOfTest("undefined"); 20740 function isBuffer$1(val) { 20741 return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val); 20742 } 20743 const isArrayBuffer = kindOfTest("ArrayBuffer"); 20744 function isArrayBufferView(val) { 20745 let result; 20746 if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { 20747 result = ArrayBuffer.isView(val); 20748 } else { 20749 result = val && val.buffer && isArrayBuffer(val.buffer); 20750 } 20751 return result; 20752 } 20753 const isString$1 = typeOfTest("string"); 20754 const isFunction$2 = typeOfTest("function"); 20755 const isNumber = typeOfTest("number"); 20756 const isObject$4 = (thing) => thing !== null && typeof thing === "object"; 20757 const isBoolean = (thing) => thing === true || thing === false; 20758 const isPlainObject$2 = (val) => { 20759 if (kindOf(val) !== "object") { 20760 return false; 20761 } 20762 const prototype2 = getPrototypeOf$1(val); 20763 return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); 20764 }; 20765 const isDate$1 = kindOfTest("Date"); 20766 const isFile = kindOfTest("File"); 20767 const isBlob = kindOfTest("Blob"); 20768 const isFileList = kindOfTest("FileList"); 20769 const isStream = (val) => isObject$4(val) && isFunction$2(val.pipe); 20770 const isFormData = (thing) => { 20771 let kind; 20772 return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$2(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance 20773 kind === "object" && isFunction$2(thing.toString) && thing.toString() === "[object FormData]")); 20774 }; 20775 const isURLSearchParams = kindOfTest("URLSearchParams"); 20776 const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); 20777 const trim$2 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); 20778 function forEach(obj, fn2, { allOwnKeys = false } = {}) { 20779 if (obj === null || typeof obj === "undefined") { 20780 return; 20781 } 20782 let i2; 20783 let l2; 20784 if (typeof obj !== "object") { 20785 obj = [obj]; 20786 } 20787 if (isArray$1(obj)) { 20788 for (i2 = 0, l2 = obj.length; i2 < l2; i2++) { 20789 fn2.call(null, obj[i2], i2, obj); 20790 } 20791 } else { 20792 const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); 20793 const len = keys2.length; 20794 let key; 20795 for (i2 = 0; i2 < len; i2++) { 20796 key = keys2[i2]; 20797 fn2.call(null, obj[key], key, obj); 20798 } 20799 } 20800 } 20801 function findKey(obj, key) { 20802 key = key.toLowerCase(); 20803 const keys2 = Object.keys(obj); 20804 let i2 = keys2.length; 20805 let _key; 20806 while (i2-- > 0) { 20807 _key = keys2[i2]; 20808 if (key === _key.toLowerCase()) { 20809 return _key; 20810 } 20811 } 20812 return null; 20813 } 20814 const _global = (() => { 20815 if (typeof globalThis !== "undefined") return globalThis; 20816 return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; 20817 })(); 20818 const isContextDefined = (context) => !isUndefined$1(context) && context !== _global; 20819 function merge$1() { 20820 const { caseless } = isContextDefined(this) && this || {}; 20821 const result = {}; 20822 const assignValue2 = (val, key) => { 20823 const targetKey = caseless && findKey(result, key) || key; 20824 if (isPlainObject$2(result[targetKey]) && isPlainObject$2(val)) { 20825 result[targetKey] = merge$1(result[targetKey], val); 20826 } else if (isPlainObject$2(val)) { 20827 result[targetKey] = merge$1({}, val); 20828 } else if (isArray$1(val)) { 20829 result[targetKey] = val.slice(); 20830 } else { 20831 result[targetKey] = val; 20832 } 20833 }; 20834 for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) { 20835 arguments[i2] && forEach(arguments[i2], assignValue2); 20836 } 20837 return result; 20838 } 20839 const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => { 20840 forEach(b2, (val, key) => { 20841 if (thisArg && isFunction$2(val)) { 20842 a2[key] = bind(val, thisArg); 20843 } else { 20844 a2[key] = val; 20845 } 20846 }, { allOwnKeys }); 20847 return a2; 20848 }; 20849 const stripBOM = (content) => { 20850 if (content.charCodeAt(0) === 65279) { 20851 content = content.slice(1); 20852 } 20853 return content; 20854 }; 20855 const inherits$1 = (constructor, superConstructor, props, descriptors2) => { 20856 constructor.prototype = Object.create(superConstructor.prototype, descriptors2); 20857 constructor.prototype.constructor = constructor; 20858 Object.defineProperty(constructor, "super", { 20859 value: superConstructor.prototype 20860 }); 20861 props && Object.assign(constructor.prototype, props); 20862 }; 20863 const toFlatObject = (sourceObj, destObj, filter2, propFilter) => { 20864 let props; 20865 let i2; 20866 let prop; 20867 const merged = {}; 20868 destObj = destObj || {}; 20869 if (sourceObj == null) return destObj; 20870 do { 20871 props = Object.getOwnPropertyNames(sourceObj); 20872 i2 = props.length; 20873 while (i2-- > 0) { 20874 prop = props[i2]; 20875 if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { 20876 destObj[prop] = sourceObj[prop]; 20877 merged[prop] = true; 20878 } 20879 } 20880 sourceObj = filter2 !== false && getPrototypeOf$1(sourceObj); 20881 } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); 20882 return destObj; 20883 }; 20884 const endsWith = (str, searchString, position2) => { 20885 str = String(str); 20886 if (position2 === void 0 || position2 > str.length) { 20887 position2 = str.length; 20888 } 20889 position2 -= searchString.length; 20890 const lastIndex = str.indexOf(searchString, position2); 20891 return lastIndex !== -1 && lastIndex === position2; 20892 }; 20893 const toArray$1 = (thing) => { 20894 if (!thing) return null; 20895 if (isArray$1(thing)) return thing; 20896 let i2 = thing.length; 20897 if (!isNumber(i2)) return null; 20898 const arr = new Array(i2); 20899 while (i2-- > 0) { 20900 arr[i2] = thing[i2]; 20901 } 20902 return arr; 20903 }; 20904 const isTypedArray$1 = /* @__PURE__ */ ((TypedArray) => { 20905 return (thing) => { 20906 return TypedArray && thing instanceof TypedArray; 20907 }; 20908 })(typeof Uint8Array !== "undefined" && getPrototypeOf$1(Uint8Array)); 20909 const forEachEntry = (obj, fn2) => { 20910 const generator = obj && obj[Symbol.iterator]; 20911 const iterator = generator.call(obj); 20912 let result; 20913 while ((result = iterator.next()) && !result.done) { 20914 const pair = result.value; 20915 fn2.call(obj, pair[0], pair[1]); 20916 } 20917 }; 20918 const matchAll = (regExp, str) => { 20919 let matches2; 20920 const arr = []; 20921 while ((matches2 = regExp.exec(str)) !== null) { 20922 arr.push(matches2); 20923 } 20924 return arr; 20925 }; 20926 const isHTMLForm = kindOfTest("HTMLFormElement"); 20927 const toCamelCase = (str) => { 20928 return str.toLowerCase().replace( 20929 /[-_\s]([a-z\d])(\w*)/g, 20930 function replacer(m2, p1, p2) { 20931 return p1.toUpperCase() + p2; 20932 } 20933 ); 20934 }; 20935 const hasOwnProperty$f = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); 20936 const isRegExp = kindOfTest("RegExp"); 20937 const reduceDescriptors = (obj, reducer2) => { 20938 const descriptors2 = Object.getOwnPropertyDescriptors(obj); 20939 const reducedDescriptors = {}; 20940 forEach(descriptors2, (descriptor, name) => { 20941 let ret; 20942 if ((ret = reducer2(descriptor, name, obj)) !== false) { 20943 reducedDescriptors[name] = ret || descriptor; 20944 } 20945 }); 20946 Object.defineProperties(obj, reducedDescriptors); 20947 }; 20948 const freezeMethods = (obj) => { 20949 reduceDescriptors(obj, (descriptor, name) => { 20950 if (isFunction$2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) { 20951 return false;
vendor: 5,681 bytes, lines 20952-21136
20952 } 20953 const value = obj[name]; 20954 if (!isFunction$2(value)) return; 20955 descriptor.enumerable = false; 20956 if ("writable" in descriptor) { 20957 descriptor.writable = false; 20958 return; 20959 } 20960 if (!descriptor.set) { 20961 descriptor.set = () => { 20962 throw Error("Can not rewrite read-only method '" + name + "'"); 20963 }; 20964 } 20965 }); 20966 }; 20967 const toObjectSet = (arrayOrString, delimiter2) => { 20968 const obj = {}; 20969 const define = (arr) => { 20970 arr.forEach((value) => { 20971 obj[value] = true; 20972 }); 20973 }; 20974 isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter2)); 20975 return obj; 20976 }; 20977 const noop$7 = () => { 20978 }; 20979 const toFiniteNumber = (value, defaultValue) => { 20980 return value != null && Number.isFinite(value = +value) ? value : defaultValue; 20981 }; 20982 const ALPHA = "abcdefghijklmnopqrstuvwxyz"; 20983 const DIGIT = "0123456789"; 20984 const ALPHABET = { 20985 DIGIT, 20986 ALPHA, 20987 ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT 20988 }; 20989 const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { 20990 let str = ""; 20991 const { length: length2 } = alphabet; 20992 while (size--) { 20993 str += alphabet[Math.random() * length2 | 0]; 20994 } 20995 return str; 20996 }; 20997 function isSpecCompliantForm(thing) { 20998 return !!(thing && isFunction$2(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); 20999 } 21000 const toJSONObject = (obj) => { 21001 const stack = new Array(10); 21002 const visit2 = (source, i2) => { 21003 if (isObject$4(source)) { 21004 if (stack.indexOf(source) >= 0) { 21005 return; 21006 } 21007 if (!("toJSON" in source)) { 21008 stack[i2] = source; 21009 const target = isArray$1(source) ? [] : {}; 21010 forEach(source, (value, key) => { 21011 const reducedValue = visit2(value, i2 + 1); 21012 !isUndefined$1(reducedValue) && (target[key] = reducedValue); 21013 }); 21014 stack[i2] = void 0; 21015 return target; 21016 } 21017 } 21018 return source; 21019 }; 21020 return visit2(obj, 0); 21021 }; 21022 const isAsyncFn = kindOfTest("AsyncFunction"); 21023 const isThenable = (thing) => thing && (isObject$4(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch); 21024 const _setImmediate = ((setImmediateSupported, postMessageSupported) => { 21025 if (setImmediateSupported) { 21026 return setImmediate; 21027 } 21028 return postMessageSupported ? ((token2, callbacks) => { 21029 _global.addEventListener("message", ({ source, data }) => { 21030 if (source === _global && data === token2) { 21031 callbacks.length && callbacks.shift()(); 21032 } 21033 }, false); 21034 return (cb) => { 21035 callbacks.push(cb); 21036 _global.postMessage(token2, "*"); 21037 }; 21038 })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); 21039 })( 21040 typeof setImmediate === "function", 21041 isFunction$2(_global.postMessage) 21042 ); 21043 const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; 21044 const utils$1 = { 21045 isArray: isArray$1, 21046 isArrayBuffer, 21047 isBuffer: isBuffer$1, 21048 isFormData, 21049 isArrayBufferView, 21050 isString: isString$1, 21051 isNumber, 21052 isBoolean, 21053 isObject: isObject$4, 21054 isPlainObject: isPlainObject$2, 21055 isReadableStream, 21056 isRequest, 21057 isResponse, 21058 isHeaders, 21059 isUndefined: isUndefined$1, 21060 isDate: isDate$1, 21061 isFile, 21062 isBlob, 21063 isRegExp, 21064 isFunction: isFunction$2, 21065 isStream, 21066 isURLSearchParams, 21067 isTypedArray: isTypedArray$1, 21068 isFileList, 21069 forEach, 21070 merge: merge$1, 21071 extend, 21072 trim: trim$2, 21073 stripBOM, 21074 inherits: inherits$1, 21075 toFlatObject, 21076 kindOf, 21077 kindOfTest, 21078 endsWith, 21079 toArray: toArray$1, 21080 forEachEntry, 21081 matchAll, 21082 isHTMLForm, 21083 hasOwnProperty: hasOwnProperty$f, 21084 hasOwnProp: hasOwnProperty$f, 21085 // an alias to avoid ESLint no-prototype-builtins detection 21086 reduceDescriptors, 21087 freezeMethods, 21088 toObjectSet, 21089 toCamelCase, 21090 noop: noop$7, 21091 toFiniteNumber, 21092 findKey, 21093 global: _global, 21094 isContextDefined, 21095 ALPHABET, 21096 generateString, 21097 isSpecCompliantForm, 21098 toJSONObject, 21099 isAsyncFn, 21100 isThenable, 21101 setImmediate: _setImmediate, 21102 asap 21103 }; 21104 function AxiosError$1(message, code, config, request, response) { 21105 Error.call(this); 21106 if (Error.captureStackTrace) { 21107 Error.captureStackTrace(this, this.constructor); 21108 } else { 21109 this.stack = new Error().stack; 21110 } 21111 this.message = message; 21112 this.name = "AxiosError"; 21113 code && (this.code = code); 21114 config && (this.config = config); 21115 request && (this.request = request); 21116 if (response) { 21117 this.response = response; 21118 this.status = response.status ? response.status : null; 21119 } 21120 } 21121 utils$1.inherits(AxiosError$1, Error, { 21122 toJSON: function toJSON() { 21123 return { 21124 // Standard 21125 message: this.message, 21126 name: this.name, 21127 // Microsoft 21128 description: this.description, 21129 number: this.number, 21130 // Mozilla 21131 fileName: this.fileName, 21132 lineNumber: this.lineNumber, 21133 columnNumber: this.columnNumber, 21134 stack: this.stack, 21135 // Axios 21136 config: utils$1.toJSONObject(this.config),
vendor: 4,271 bytes, lines 21137-21245
21137 code: this.code, 21138 status: this.status 21139 }; 21140 } 21141 }); 21142 const prototype$1 = AxiosError$1.prototype; 21143 const descriptors = {}; 21144 [ 21145 "ERR_BAD_OPTION_VALUE", 21146 "ERR_BAD_OPTION", 21147 "ECONNABORTED", 21148 "ETIMEDOUT", 21149 "ERR_NETWORK", 21150 "ERR_FR_TOO_MANY_REDIRECTS", 21151 "ERR_DEPRECATED", 21152 "ERR_BAD_RESPONSE", 21153 "ERR_BAD_REQUEST", 21154 "ERR_CANCELED", 21155 "ERR_NOT_SUPPORT", 21156 "ERR_INVALID_URL" 21157 // eslint-disable-next-line func-names 21158 ].forEach((code) => { 21159 descriptors[code] = { value: code }; 21160 }); 21161 Object.defineProperties(AxiosError$1, descriptors); 21162 Object.defineProperty(prototype$1, "isAxiosError", { value: true }); 21163 AxiosError$1.from = (error, code, config, request, response, customProps) => { 21164 const axiosError = Object.create(prototype$1); 21165 utils$1.toFlatObject(error, axiosError, function filter2(obj) { 21166 return obj !== Error.prototype; 21167 }, (prop) => { 21168 return prop !== "isAxiosError"; 21169 }); 21170 AxiosError$1.call(axiosError, error.message, code, config, request, response); 21171 axiosError.cause = error; 21172 axiosError.name = error.name; 21173 customProps && Object.assign(axiosError, customProps); 21174 return axiosError; 21175 }; 21176 const httpAdapter = null; 21177 function isVisitable(thing) { 21178 return utils$1.isPlainObject(thing) || utils$1.isArray(thing); 21179 } 21180 function removeBrackets(key) { 21181 return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key; 21182 } 21183 function renderKey(path, key, dots) { 21184 if (!path) return key; 21185 return path.concat(key).map(function each(token2, i2) { 21186 token2 = removeBrackets(token2); 21187 return !dots && i2 ? "[" + token2 + "]" : token2; 21188 }).join(dots ? "." : ""); 21189 } 21190 function isFlatArray(arr) { 21191 return utils$1.isArray(arr) && !arr.some(isVisitable); 21192 } 21193 const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter2(prop) { 21194 return /^is[A-Z]/.test(prop); 21195 }); 21196 function toFormData$1(obj, formData, options2) { 21197 if (!utils$1.isObject(obj)) { 21198 throw new TypeError("target must be an object"); 21199 } 21200 formData = formData || new FormData(); 21201 options2 = utils$1.toFlatObject(options2, { 21202 metaTokens: true, 21203 dots: false, 21204 indexes: false 21205 }, false, function defined(option, source) { 21206 return !utils$1.isUndefined(source[option]); 21207 }); 21208 const metaTokens = options2.metaTokens; 21209 const visitor = options2.visitor || defaultVisitor; 21210 const dots = options2.dots; 21211 const indexes = options2.indexes; 21212 const _Blob = options2.Blob || typeof Blob !== "undefined" && Blob; 21213 const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); 21214 if (!utils$1.isFunction(visitor)) { 21215 throw new TypeError("visitor must be a function"); 21216 } 21217 function convertValue(value) { 21218 if (value === null) return ""; 21219 if (utils$1.isDate(value)) { 21220 return value.toISOString(); 21221 } 21222 if (!useBlob && utils$1.isBlob(value)) { 21223 throw new AxiosError$1("Blob is not supported. Use a Buffer instead."); 21224 } 21225 if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { 21226 return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); 21227 } 21228 return value; 21229 } 21230 function defaultVisitor(value, key, path) { 21231 let arr = value; 21232 if (value && !path && typeof value === "object") { 21233 if (utils$1.endsWith(key, "{}")) { 21234 key = metaTokens ? key : key.slice(0, -2); 21235 value = JSON.stringify(value); 21236 } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) { 21237 key = removeBrackets(key); 21238 arr.forEach(function each(el, index2) { 21239 !(utils$1.isUndefined(el) || el === null) && formData.append( 21240 // eslint-disable-next-line no-nested-ternary 21241 indexes === true ? renderKey([key], index2, dots) : indexes === null ? key : key + "[]", 21242 convertValue(el) 21243 ); 21244 }); 21245 return false;
vendor: 4,760 bytes, lines 21246-21397
21246 } 21247 } 21248 if (isVisitable(value)) { 21249 return true; 21250 } 21251 formData.append(renderKey(path, key, dots), convertValue(value)); 21252 return false; 21253 } 21254 const stack = []; 21255 const exposedHelpers = Object.assign(predicates, { 21256 defaultVisitor, 21257 convertValue, 21258 isVisitable 21259 }); 21260 function build(value, path) { 21261 if (utils$1.isUndefined(value)) return; 21262 if (stack.indexOf(value) !== -1) { 21263 throw Error("Circular reference detected in " + path.join(".")); 21264 } 21265 stack.push(value); 21266 utils$1.forEach(value, function each(el, key) { 21267 const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( 21268 formData, 21269 el, 21270 utils$1.isString(key) ? key.trim() : key, 21271 path, 21272 exposedHelpers 21273 ); 21274 if (result === true) { 21275 build(el, path ? path.concat(key) : [key]); 21276 } 21277 }); 21278 stack.pop(); 21279 } 21280 if (!utils$1.isObject(obj)) { 21281 throw new TypeError("data must be an object"); 21282 } 21283 build(obj); 21284 return formData; 21285 } 21286 function encode$1(str) { 21287 const charMap = { 21288 "!": "%21", 21289 "'": "%27", 21290 "(": "%28", 21291 ")": "%29", 21292 "~": "%7E", 21293 "%20": "+", 21294 "%00": "\0" 21295 }; 21296 return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match2) { 21297 return charMap[match2]; 21298 }); 21299 } 21300 function AxiosURLSearchParams(params, options2) { 21301 this._pairs = []; 21302 params && toFormData$1(params, this, options2); 21303 } 21304 const prototype = AxiosURLSearchParams.prototype; 21305 prototype.append = function append2(name, value) { 21306 this._pairs.push([name, value]); 21307 }; 21308 prototype.toString = function toString2(encoder) { 21309 const _encode = encoder ? function(value) { 21310 return encoder.call(this, value, encode$1); 21311 } : encode$1; 21312 return this._pairs.map(function each(pair) { 21313 return _encode(pair[0]) + "=" + _encode(pair[1]); 21314 }, "").join("&"); 21315 }; 21316 function encode(val) { 21317 return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); 21318 } 21319 function buildURL(url, params, options2) { 21320 if (!params) { 21321 return url; 21322 } 21323 const _encode = options2 && options2.encode || encode; 21324 if (utils$1.isFunction(options2)) { 21325 options2 = { 21326 serialize: options2 21327 }; 21328 } 21329 const serializeFn = options2 && options2.serialize; 21330 let serializedParams; 21331 if (serializeFn) { 21332 serializedParams = serializeFn(params, options2); 21333 } else { 21334 serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options2).toString(_encode); 21335 } 21336 if (serializedParams) { 21337 const hashmarkIndex = url.indexOf("#"); 21338 if (hashmarkIndex !== -1) { 21339 url = url.slice(0, hashmarkIndex); 21340 } 21341 url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; 21342 } 21343 return url; 21344 } 21345 class InterceptorManager { 21346 constructor() { 21347 this.handlers = []; 21348 } 21349 /** 21350 * Add a new interceptor to the stack 21351 * 21352 * @param {Function} fulfilled The function to handle `then` for a `Promise` 21353 * @param {Function} rejected The function to handle `reject` for a `Promise` 21354 * 21355 * @return {Number} An ID used to remove interceptor later 21356 */ 21357 use(fulfilled, rejected, options2) { 21358 this.handlers.push({ 21359 fulfilled, 21360 rejected, 21361 synchronous: options2 ? options2.synchronous : false, 21362 runWhen: options2 ? options2.runWhen : null 21363 }); 21364 return this.handlers.length - 1; 21365 } 21366 /** 21367 * Remove an interceptor from the stack 21368 * 21369 * @param {Number} id The ID that was returned by `use` 21370 * 21371 * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise 21372 */ 21373 eject(id2) { 21374 if (this.handlers[id2]) { 21375 this.handlers[id2] = null; 21376 } 21377 } 21378 /** 21379 * Clear all interceptors from the stack 21380 * 21381 * @returns {void} 21382 */ 21383 clear() { 21384 if (this.handlers) { 21385 this.handlers = []; 21386 } 21387 } 21388 /** 21389 * Iterate over all the registered interceptors 21390 * 21391 * This method is particularly useful for skipping over any 21392 * interceptors that may have become `null` calling `eject`. 21393 * 21394 * @param {Function} fn The function to call for each interceptor 21395 * 21396 * @returns {void} 21397 */
vendor: 5,549 bytes, lines 21398-21540
21398 forEach(fn2) { 21399 utils$1.forEach(this.handlers, function forEachHandler(h2) { 21400 if (h2 !== null) { 21401 fn2(h2); 21402 } 21403 }); 21404 } 21405 } 21406 const transitionalDefaults = { 21407 silentJSONParsing: true, 21408 forcedJSONParsing: true, 21409 clarifyTimeoutError: false 21410 }; 21411 const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams; 21412 const FormData$1 = typeof FormData !== "undefined" ? FormData : null; 21413 const Blob$1 = typeof Blob !== "undefined" ? Blob : null; 21414 const platform$2 = { 21415 isBrowser: true, 21416 classes: { 21417 URLSearchParams: URLSearchParams$1, 21418 FormData: FormData$1, 21419 Blob: Blob$1 21420 }, 21421 protocols: ["http", "https", "file", "blob", "url", "data"] 21422 }; 21423 const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; 21424 const _navigator = typeof navigator === "object" && navigator || void 0; 21425 const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); 21426 const hasStandardBrowserWebWorkerEnv = (() => { 21427 return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef 21428 self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; 21429 })(); 21430 const origin = hasBrowserEnv && window.location.href || "http://localhost"; 21431 const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 21432 __proto__: null, 21433 hasBrowserEnv, 21434 hasStandardBrowserEnv, 21435 hasStandardBrowserWebWorkerEnv, 21436 navigator: _navigator, 21437 origin 21438 }, Symbol.toStringTag, { value: "Module" })); 21439 const platform$1 = __spreadValues(__spreadValues({}, utils), platform$2); 21440 function toURLEncodedForm(data, options2) { 21441 return toFormData$1(data, new platform$1.classes.URLSearchParams(), Object.assign({ 21442 visitor: function(value, key, path, helpers) { 21443 if (platform$1.isNode && utils$1.isBuffer(value)) { 21444 this.append(key, value.toString("base64")); 21445 return false; 21446 } 21447 return helpers.defaultVisitor.apply(this, arguments); 21448 } 21449 }, options2)); 21450 } 21451 function parsePropPath(name) { 21452 return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => { 21453 return match2[0] === "[]" ? "" : match2[1] || match2[0]; 21454 }); 21455 } 21456 function arrayToObject(arr) { 21457 const obj = {}; 21458 const keys2 = Object.keys(arr); 21459 let i2; 21460 const len = keys2.length; 21461 let key; 21462 for (i2 = 0; i2 < len; i2++) { 21463 key = keys2[i2]; 21464 obj[key] = arr[key]; 21465 } 21466 return obj; 21467 } 21468 function formDataToJSON(formData) { 21469 function buildPath(path, value, target, index2) { 21470 let name = path[index2++]; 21471 if (name === "__proto__") return true; 21472 const isNumericKey = Number.isFinite(+name); 21473 const isLast = index2 >= path.length; 21474 name = !name && utils$1.isArray(target) ? target.length : name; 21475 if (isLast) { 21476 if (utils$1.hasOwnProp(target, name)) { 21477 target[name] = [target[name], value]; 21478 } else { 21479 target[name] = value; 21480 } 21481 return !isNumericKey; 21482 } 21483 if (!target[name] || !utils$1.isObject(target[name])) { 21484 target[name] = []; 21485 } 21486 const result = buildPath(path, value, target[name], index2); 21487 if (result && utils$1.isArray(target[name])) { 21488 target[name] = arrayToObject(target[name]); 21489 } 21490 return !isNumericKey; 21491 } 21492 if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { 21493 const obj = {}; 21494 utils$1.forEachEntry(formData, (name, value) => { 21495 buildPath(parsePropPath(name), value, obj, 0); 21496 }); 21497 return obj; 21498 } 21499 return null; 21500 } 21501 function stringifySafely(rawValue, parser, encoder) { 21502 if (utils$1.isString(rawValue)) { 21503 try { 21504 (parser || JSON.parse)(rawValue); 21505 return utils$1.trim(rawValue); 21506 } catch (e2) { 21507 if (e2.name !== "SyntaxError") { 21508 throw e2; 21509 } 21510 } 21511 } 21512 return (encoder || JSON.stringify)(rawValue); 21513 } 21514 const defaults = { 21515 transitional: transitionalDefaults, 21516 adapter: ["xhr", "http", "fetch"], 21517 transformRequest: [function transformRequest(data, headers) { 21518 const contentType = headers.getContentType() || ""; 21519 const hasJSONContentType = contentType.indexOf("application/json") > -1; 21520 const isObjectPayload = utils$1.isObject(data); 21521 if (isObjectPayload && utils$1.isHTMLForm(data)) { 21522 data = new FormData(data); 21523 } 21524 const isFormData2 = utils$1.isFormData(data); 21525 if (isFormData2) { 21526 return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; 21527 } 21528 if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { 21529 return data; 21530 } 21531 if (utils$1.isArrayBufferView(data)) { 21532 return data.buffer; 21533 } 21534 if (utils$1.isURLSearchParams(data)) { 21535 headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); 21536 return data.toString(); 21537 } 21538 let isFileList2; 21539 if (isObjectPayload) { 21540 if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
vendor: 10,225 bytes, lines 21541-21836
21541 return toURLEncodedForm(data, this.formSerializer).toString(); 21542 } 21543 if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { 21544 const _FormData = this.env && this.env.FormData; 21545 return toFormData$1( 21546 isFileList2 ? { "files[]": data } : data, 21547 _FormData && new _FormData(), 21548 this.formSerializer 21549 ); 21550 } 21551 } 21552 if (isObjectPayload || hasJSONContentType) { 21553 headers.setContentType("application/json", false); 21554 return stringifySafely(data); 21555 } 21556 return data; 21557 }], 21558 transformResponse: [function transformResponse(data) { 21559 const transitional = this.transitional || defaults.transitional; 21560 const forcedJSONParsing = transitional && transitional.forcedJSONParsing; 21561 const JSONRequested = this.responseType === "json"; 21562 if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { 21563 return data; 21564 } 21565 if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { 21566 const silentJSONParsing = transitional && transitional.silentJSONParsing; 21567 const strictJSONParsing = !silentJSONParsing && JSONRequested; 21568 try { 21569 return JSON.parse(data); 21570 } catch (e2) { 21571 if (strictJSONParsing) { 21572 if (e2.name === "SyntaxError") { 21573 throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); 21574 } 21575 throw e2; 21576 } 21577 } 21578 } 21579 return data; 21580 }], 21581 /** 21582 * A timeout in milliseconds to abort a request. If set to 0 (default) a 21583 * timeout is not created. 21584 */ 21585 timeout: 0, 21586 xsrfCookieName: "XSRF-TOKEN", 21587 xsrfHeaderName: "X-XSRF-TOKEN", 21588 maxContentLength: -1, 21589 maxBodyLength: -1, 21590 env: { 21591 FormData: platform$1.classes.FormData, 21592 Blob: platform$1.classes.Blob 21593 }, 21594 validateStatus: function validateStatus(status) { 21595 return status >= 200 && status < 300; 21596 }, 21597 headers: { 21598 common: { 21599 "Accept": "application/json, text/plain, */*", 21600 "Content-Type": void 0 21601 } 21602 } 21603 }; 21604 utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => { 21605 defaults.headers[method] = {}; 21606 }); 21607 const ignoreDuplicateOf = utils$1.toObjectSet([ 21608 "age", 21609 "authorization", 21610 "content-length", 21611 "content-type", 21612 "etag", 21613 "expires", 21614 "from", 21615 "host", 21616 "if-modified-since", 21617 "if-unmodified-since", 21618 "last-modified", 21619 "location", 21620 "max-forwards", 21621 "proxy-authorization", 21622 "referer", 21623 "retry-after", 21624 "user-agent" 21625 ]); 21626 const parseHeaders = (rawHeaders) => { 21627 const parsed = {}; 21628 let key; 21629 let val; 21630 let i2; 21631 rawHeaders && rawHeaders.split("\n").forEach(function parser(line2) { 21632 i2 = line2.indexOf(":"); 21633 key = line2.substring(0, i2).trim().toLowerCase(); 21634 val = line2.substring(i2 + 1).trim(); 21635 if (!key || parsed[key] && ignoreDuplicateOf[key]) { 21636 return; 21637 } 21638 if (key === "set-cookie") { 21639 if (parsed[key]) { 21640 parsed[key].push(val); 21641 } else { 21642 parsed[key] = [val]; 21643 } 21644 } else { 21645 parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; 21646 } 21647 }); 21648 return parsed; 21649 }; 21650 const $internals = Symbol("internals"); 21651 function normalizeHeader(header) { 21652 return header && String(header).trim().toLowerCase(); 21653 } 21654 function normalizeValue(value) { 21655 if (value === false || value == null) { 21656 return value; 21657 } 21658 return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); 21659 } 21660 function parseTokens(str) { 21661 const tokens = /* @__PURE__ */ Object.create(null); 21662 const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; 21663 let match2; 21664 while (match2 = tokensRE.exec(str)) { 21665 tokens[match2[1]] = match2[2]; 21666 } 21667 return tokens; 21668 } 21669 const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); 21670 function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { 21671 if (utils$1.isFunction(filter2)) { 21672 return filter2.call(this, value, header); 21673 } 21674 if (isHeaderNameFilter) { 21675 value = header; 21676 } 21677 if (!utils$1.isString(value)) return; 21678 if (utils$1.isString(filter2)) { 21679 return value.indexOf(filter2) !== -1; 21680 } 21681 if (utils$1.isRegExp(filter2)) { 21682 return filter2.test(value); 21683 } 21684 } 21685 function formatHeader(header) { 21686 return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char2, str) => { 21687 return char2.toUpperCase() + str; 21688 }); 21689 } 21690 function buildAccessors(obj, header) { 21691 const accessorName = utils$1.toCamelCase(" " + header); 21692 ["get", "set", "has"].forEach((methodName) => { 21693 Object.defineProperty(obj, methodName + accessorName, { 21694 value: function(arg1, arg2, arg3) { 21695 return this[methodName].call(this, header, arg1, arg2, arg3); 21696 }, 21697 configurable: true 21698 }); 21699 }); 21700 } 21701 let AxiosHeaders$1 = class AxiosHeaders { 21702 constructor(headers) { 21703 headers && this.set(headers); 21704 } 21705 set(header, valueOrRewrite, rewrite) { 21706 const self2 = this; 21707 function setHeader(_value, _header, _rewrite) { 21708 const lHeader = normalizeHeader(_header); 21709 if (!lHeader) { 21710 throw new Error("header name must be a non-empty string"); 21711 } 21712 const key = utils$1.findKey(self2, lHeader); 21713 if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { 21714 self2[key || _header] = normalizeValue(_value); 21715 } 21716 } 21717 const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); 21718 if (utils$1.isPlainObject(header) || header instanceof this.constructor) { 21719 setHeaders(header, valueOrRewrite); 21720 } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { 21721 setHeaders(parseHeaders(header), valueOrRewrite); 21722 } else if (utils$1.isHeaders(header)) { 21723 for (const [key, value] of header.entries()) { 21724 setHeader(value, key, rewrite); 21725 } 21726 } else { 21727 header != null && setHeader(valueOrRewrite, header, rewrite); 21728 } 21729 return this; 21730 } 21731 get(header, parser) { 21732 header = normalizeHeader(header); 21733 if (header) { 21734 const key = utils$1.findKey(this, header); 21735 if (key) { 21736 const value = this[key]; 21737 if (!parser) { 21738 return value; 21739 } 21740 if (parser === true) { 21741 return parseTokens(value); 21742 } 21743 if (utils$1.isFunction(parser)) { 21744 return parser.call(this, value, key); 21745 } 21746 if (utils$1.isRegExp(parser)) { 21747 return parser.exec(value); 21748 } 21749 throw new TypeError("parser must be boolean|regexp|function"); 21750 } 21751 } 21752 } 21753 has(header, matcher) { 21754 header = normalizeHeader(header); 21755 if (header) { 21756 const key = utils$1.findKey(this, header); 21757 return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); 21758 } 21759 return false; 21760 } 21761 delete(header, matcher) { 21762 const self2 = this; 21763 let deleted = false; 21764 function deleteHeader(_header) { 21765 _header = normalizeHeader(_header); 21766 if (_header) { 21767 const key = utils$1.findKey(self2, _header); 21768 if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { 21769 delete self2[key]; 21770 deleted = true; 21771 } 21772 } 21773 } 21774 if (utils$1.isArray(header)) { 21775 header.forEach(deleteHeader); 21776 } else { 21777 deleteHeader(header); 21778 } 21779 return deleted; 21780 } 21781 clear(matcher) { 21782 const keys2 = Object.keys(this); 21783 let i2 = keys2.length; 21784 let deleted = false; 21785 while (i2--) { 21786 const key = keys2[i2]; 21787 if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { 21788 delete this[key]; 21789 deleted = true; 21790 } 21791 } 21792 return deleted; 21793 } 21794 normalize(format) { 21795 const self2 = this; 21796 const headers = {}; 21797 utils$1.forEach(this, (value, header) => { 21798 const key = utils$1.findKey(headers, header); 21799 if (key) { 21800 self2[key] = normalizeValue(value); 21801 delete self2[header]; 21802 return; 21803 } 21804 const normalized = format ? formatHeader(header) : String(header).trim(); 21805 if (normalized !== header) { 21806 delete self2[header]; 21807 } 21808 self2[normalized] = normalizeValue(value); 21809 headers[normalized] = true; 21810 }); 21811 return this; 21812 } 21813 concat(...targets) { 21814 return this.constructor.concat(this, ...targets); 21815 } 21816 toJSON(asStrings) { 21817 const obj = /* @__PURE__ */ Object.create(null); 21818 utils$1.forEach(this, (value, header) => { 21819 value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value); 21820 }); 21821 return obj; 21822 } 21823 [Symbol.iterator]() { 21824 return Object.entries(this.toJSON())[Symbol.iterator](); 21825 } 21826 toString() { 21827 return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); 21828 } 21829 get [Symbol.toStringTag]() { 21830 return "AxiosHeaders"; 21831 } 21832 static from(thing) { 21833 return thing instanceof this ? thing : new this(thing); 21834 } 21835 static concat(first, ...targets) { 21836 const computed = new this(first);
vendor: 4,336 bytes, lines 21837-21963
21837 targets.forEach((target) => computed.set(target)); 21838 return computed; 21839 } 21840 static accessor(header) { 21841 const internals = this[$internals] = this[$internals] = { 21842 accessors: {} 21843 }; 21844 const accessors = internals.accessors; 21845 const prototype2 = this.prototype; 21846 function defineAccessor(_header) { 21847 const lHeader = normalizeHeader(_header); 21848 if (!accessors[lHeader]) { 21849 buildAccessors(prototype2, _header); 21850 accessors[lHeader] = true; 21851 } 21852 } 21853 utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); 21854 return this; 21855 } 21856 }; 21857 AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); 21858 utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => { 21859 let mapped = key[0].toUpperCase() + key.slice(1); 21860 return { 21861 get: () => value, 21862 set(headerValue) { 21863 this[mapped] = headerValue; 21864 } 21865 }; 21866 }); 21867 utils$1.freezeMethods(AxiosHeaders$1); 21868 function transformData(fns, response) { 21869 const config = this || defaults; 21870 const context = response || config; 21871 const headers = AxiosHeaders$1.from(context.headers); 21872 let data = context.data; 21873 utils$1.forEach(fns, function transform2(fn2) { 21874 data = fn2.call(config, data, headers.normalize(), response ? response.status : void 0); 21875 }); 21876 headers.normalize(); 21877 return data; 21878 } 21879 function isCancel$1(value) { 21880 return !!(value && value.__CANCEL__); 21881 } 21882 function CanceledError$1(message, config, request) { 21883 AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request); 21884 this.name = "CanceledError"; 21885 } 21886 utils$1.inherits(CanceledError$1, AxiosError$1, { 21887 __CANCEL__: true 21888 }); 21889 function settle(resolve, reject, response) { 21890 const validateStatus = response.config.validateStatus; 21891 if (!response.status || !validateStatus || validateStatus(response.status)) { 21892 resolve(response); 21893 } else { 21894 reject(new AxiosError$1( 21895 "Request failed with status code " + response.status, 21896 [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], 21897 response.config, 21898 response.request, 21899 response 21900 )); 21901 } 21902 } 21903 function parseProtocol(url) { 21904 const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); 21905 return match2 && match2[1] || ""; 21906 } 21907 function speedometer(samplesCount, min2) { 21908 samplesCount = samplesCount || 10; 21909 const bytes = new Array(samplesCount); 21910 const timestamps = new Array(samplesCount); 21911 let head = 0; 21912 let tail = 0; 21913 let firstSampleTS; 21914 min2 = min2 !== void 0 ? min2 : 1e3; 21915 return function push(chunkLength) { 21916 const now2 = Date.now(); 21917 const startedAt = timestamps[tail]; 21918 if (!firstSampleTS) { 21919 firstSampleTS = now2; 21920 } 21921 bytes[head] = chunkLength; 21922 timestamps[head] = now2; 21923 let i2 = tail; 21924 let bytesCount = 0; 21925 while (i2 !== head) { 21926 bytesCount += bytes[i2++]; 21927 i2 = i2 % samplesCount; 21928 } 21929 head = (head + 1) % samplesCount; 21930 if (head === tail) { 21931 tail = (tail + 1) % samplesCount; 21932 } 21933 if (now2 - firstSampleTS < min2) { 21934 return; 21935 } 21936 const passed = startedAt && now2 - startedAt; 21937 return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; 21938 }; 21939 } 21940 function throttle(fn2, freq) { 21941 let timestamp = 0; 21942 let threshold = 1e3 / freq; 21943 let lastArgs; 21944 let timer; 21945 const invoke = (args, now2 = Date.now()) => { 21946 timestamp = now2; 21947 lastArgs = null; 21948 if (timer) { 21949 clearTimeout(timer); 21950 timer = null; 21951 } 21952 fn2.apply(null, args); 21953 }; 21954 const throttled = (...args) => { 21955 const now2 = Date.now(); 21956 const passed = now2 - timestamp; 21957 if (passed >= threshold) { 21958 invoke(args, now2); 21959 } else { 21960 lastArgs = args; 21961 if (!timer) { 21962 timer = setTimeout(() => { 21963 timer = null;
vendor: 5,696 bytes, lines 21964-22114
21964 invoke(lastArgs); 21965 }, threshold - passed); 21966 } 21967 } 21968 }; 21969 const flush = () => lastArgs && invoke(lastArgs); 21970 return [throttled, flush]; 21971 } 21972 const progressEventReducer = (listener, isDownloadStream, freq = 3) => { 21973 let bytesNotified = 0; 21974 const _speedometer = speedometer(50, 250); 21975 return throttle((e2) => { 21976 const loaded = e2.loaded; 21977 const total = e2.lengthComputable ? e2.total : void 0; 21978 const progressBytes = loaded - bytesNotified; 21979 const rate = _speedometer(progressBytes); 21980 const inRange = loaded <= total; 21981 bytesNotified = loaded; 21982 const data = { 21983 loaded, 21984 total, 21985 progress: total ? loaded / total : void 0, 21986 bytes: progressBytes, 21987 rate: rate ? rate : void 0, 21988 estimated: rate && total && inRange ? (total - loaded) / rate : void 0, 21989 event: e2, 21990 lengthComputable: total != null, 21991 [isDownloadStream ? "download" : "upload"]: true 21992 }; 21993 listener(data); 21994 }, freq); 21995 }; 21996 const progressEventDecorator = (total, throttled) => { 21997 const lengthComputable = total != null; 21998 return [(loaded) => throttled[0]({ 21999 lengthComputable, 22000 total, 22001 loaded 22002 }), throttled[1]]; 22003 }; 22004 const asyncDecorator = (fn2) => (...args) => utils$1.asap(() => fn2(...args)); 22005 const isURLSameOrigin = platform$1.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => { 22006 url = new URL(url, platform$1.origin); 22007 return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port); 22008 })( 22009 new URL(platform$1.origin), 22010 platform$1.navigator && /(msie|trident)/i.test(platform$1.navigator.userAgent) 22011 ) : () => true; 22012 const cookies = platform$1.hasStandardBrowserEnv ? ( 22013 // Standard browser envs support document.cookie 22014 { 22015 write(name, value, expires, path, domain, secure) { 22016 const cookie = [name + "=" + encodeURIComponent(value)]; 22017 utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); 22018 utils$1.isString(path) && cookie.push("path=" + path); 22019 utils$1.isString(domain) && cookie.push("domain=" + domain); 22020 secure === true && cookie.push("secure"); 22021 document.cookie = cookie.join("; "); 22022 }, 22023 read(name) { 22024 const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); 22025 return match2 ? decodeURIComponent(match2[3]) : null; 22026 }, 22027 remove(name) { 22028 this.write(name, "", Date.now() - 864e5); 22029 } 22030 } 22031 ) : ( 22032 // Non-standard browser env (web workers, react-native) lack needed support. 22033 { 22034 write() { 22035 }, 22036 read() { 22037 return null; 22038 }, 22039 remove() { 22040 } 22041 } 22042 ); 22043 function isAbsoluteURL(url) { 22044 return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 22045 } 22046 function combineURLs(baseURL, relativeURL) { 22047 return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; 22048 } 22049 function buildFullPath(baseURL, requestedURL) { 22050 if (baseURL && !isAbsoluteURL(requestedURL)) { 22051 return combineURLs(baseURL, requestedURL); 22052 } 22053 return requestedURL; 22054 } 22055 const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? __spreadValues({}, thing) : thing; 22056 function mergeConfig$1(config1, config2) { 22057 config2 = config2 || {}; 22058 const config = {}; 22059 function getMergedValue(target, source, prop, caseless) { 22060 if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { 22061 return utils$1.merge.call({ caseless }, target, source); 22062 } else if (utils$1.isPlainObject(source)) { 22063 return utils$1.merge({}, source); 22064 } else if (utils$1.isArray(source)) { 22065 return source.slice(); 22066 } 22067 return source; 22068 } 22069 function mergeDeepProperties(a2, b2, prop, caseless) { 22070 if (!utils$1.isUndefined(b2)) { 22071 return getMergedValue(a2, b2, prop, caseless); 22072 } else if (!utils$1.isUndefined(a2)) { 22073 return getMergedValue(void 0, a2, prop, caseless); 22074 } 22075 } 22076 function valueFromConfig2(a2, b2) { 22077 if (!utils$1.isUndefined(b2)) { 22078 return getMergedValue(void 0, b2); 22079 } 22080 } 22081 function defaultToConfig2(a2, b2) { 22082 if (!utils$1.isUndefined(b2)) { 22083 return getMergedValue(void 0, b2); 22084 } else if (!utils$1.isUndefined(a2)) { 22085 return getMergedValue(void 0, a2); 22086 } 22087 } 22088 function mergeDirectKeys(a2, b2, prop) { 22089 if (prop in config2) { 22090 return getMergedValue(a2, b2); 22091 } else if (prop in config1) { 22092 return getMergedValue(void 0, a2); 22093 } 22094 } 22095 const mergeMap = { 22096 url: valueFromConfig2, 22097 method: valueFromConfig2, 22098 data: valueFromConfig2, 22099 baseURL: defaultToConfig2, 22100 transformRequest: defaultToConfig2, 22101 transformResponse: defaultToConfig2, 22102 paramsSerializer: defaultToConfig2, 22103 timeout: defaultToConfig2, 22104 timeoutMessage: defaultToConfig2, 22105 withCredentials: defaultToConfig2, 22106 withXSRFToken: defaultToConfig2, 22107 adapter: defaultToConfig2, 22108 responseType: defaultToConfig2, 22109 xsrfCookieName: defaultToConfig2, 22110 xsrfHeaderName: defaultToConfig2, 22111 onUploadProgress: defaultToConfig2, 22112 onDownloadProgress: defaultToConfig2, 22113 decompress: defaultToConfig2, 22114 maxContentLength: defaultToConfig2,
vendor: 5,911 bytes, lines 22115-22247
22115 maxBodyLength: defaultToConfig2, 22116 beforeRedirect: defaultToConfig2, 22117 transport: defaultToConfig2, 22118 httpAgent: defaultToConfig2, 22119 httpsAgent: defaultToConfig2, 22120 cancelToken: defaultToConfig2, 22121 socketPath: defaultToConfig2, 22122 responseEncoding: defaultToConfig2, 22123 validateStatus: mergeDirectKeys, 22124 headers: (a2, b2, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), prop, true) 22125 }; 22126 utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { 22127 const merge2 = mergeMap[prop] || mergeDeepProperties; 22128 const configValue = merge2(config1[prop], config2[prop], prop); 22129 utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); 22130 }); 22131 return config; 22132 } 22133 const resolveConfig = (config) => { 22134 const newConfig = mergeConfig$1({}, config); 22135 let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; 22136 newConfig.headers = headers = AxiosHeaders$1.from(headers); 22137 newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer); 22138 if (auth) { 22139 headers.set( 22140 "Authorization", 22141 "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")) 22142 ); 22143 } 22144 let contentType; 22145 if (utils$1.isFormData(data)) { 22146 if (platform$1.hasStandardBrowserEnv || platform$1.hasStandardBrowserWebWorkerEnv) { 22147 headers.setContentType(void 0); 22148 } else if ((contentType = headers.getContentType()) !== false) { 22149 const [type, ...tokens] = contentType ? contentType.split(";").map((token2) => token2.trim()).filter(Boolean) : []; 22150 headers.setContentType([type || "multipart/form-data", ...tokens].join("; ")); 22151 } 22152 } 22153 if (platform$1.hasStandardBrowserEnv) { 22154 withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); 22155 if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { 22156 const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); 22157 if (xsrfValue) { 22158 headers.set(xsrfHeaderName, xsrfValue); 22159 } 22160 } 22161 } 22162 return newConfig; 22163 }; 22164 const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; 22165 const xhrAdapter = isXHRAdapterSupported && function(config) { 22166 return new Promise(function dispatchXhrRequest(resolve, reject) { 22167 const _config = resolveConfig(config); 22168 let requestData = _config.data; 22169 const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); 22170 let { responseType, onUploadProgress, onDownloadProgress } = _config; 22171 let onCanceled; 22172 let uploadThrottled, downloadThrottled; 22173 let flushUpload, flushDownload; 22174 function done() { 22175 flushUpload && flushUpload(); 22176 flushDownload && flushDownload(); 22177 _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); 22178 _config.signal && _config.signal.removeEventListener("abort", onCanceled); 22179 } 22180 let request = new XMLHttpRequest(); 22181 request.open(_config.method.toUpperCase(), _config.url, true); 22182 request.timeout = _config.timeout; 22183 function onloadend() { 22184 if (!request) { 22185 return; 22186 } 22187 const responseHeaders = AxiosHeaders$1.from( 22188 "getAllResponseHeaders" in request && request.getAllResponseHeaders() 22189 ); 22190 const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; 22191 const response = { 22192 data: responseData, 22193 status: request.status, 22194 statusText: request.statusText, 22195 headers: responseHeaders, 22196 config, 22197 request 22198 }; 22199 settle(function _resolve(value) { 22200 resolve(value); 22201 done(); 22202 }, function _reject(err) { 22203 reject(err); 22204 done(); 22205 }, response); 22206 request = null; 22207 } 22208 if ("onloadend" in request) { 22209 request.onloadend = onloadend; 22210 } else { 22211 request.onreadystatechange = function handleLoad() { 22212 if (!request || request.readyState !== 4) { 22213 return; 22214 } 22215 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) { 22216 return; 22217 } 22218 setTimeout(onloadend); 22219 }; 22220 } 22221 request.onabort = function handleAbort() { 22222 if (!request) { 22223 return; 22224 } 22225 reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request)); 22226 request = null; 22227 }; 22228 request.onerror = function handleError() { 22229 reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request)); 22230 request = null; 22231 }; 22232 request.ontimeout = function handleTimeout() { 22233 let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; 22234 const transitional = _config.transitional || transitionalDefaults; 22235 if (_config.timeoutErrorMessage) { 22236 timeoutErrorMessage = _config.timeoutErrorMessage; 22237 } 22238 reject(new AxiosError$1( 22239 timeoutErrorMessage, 22240 transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, 22241 config, 22242 request 22243 )); 22244 request = null; 22245 }; 22246 requestData === void 0 && requestHeaders.setContentType(null); 22247 if ("setRequestHeader" in request) {
vendor: 6,127 bytes, lines 22248-22417
22248 utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { 22249 request.setRequestHeader(key, val); 22250 }); 22251 } 22252 if (!utils$1.isUndefined(_config.withCredentials)) { 22253 request.withCredentials = !!_config.withCredentials; 22254 } 22255 if (responseType && responseType !== "json") { 22256 request.responseType = _config.responseType; 22257 } 22258 if (onDownloadProgress) { 22259 [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); 22260 request.addEventListener("progress", downloadThrottled); 22261 } 22262 if (onUploadProgress && request.upload) { 22263 [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); 22264 request.upload.addEventListener("progress", uploadThrottled); 22265 request.upload.addEventListener("loadend", flushUpload); 22266 } 22267 if (_config.cancelToken || _config.signal) { 22268 onCanceled = (cancel) => { 22269 if (!request) { 22270 return; 22271 } 22272 reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); 22273 request.abort(); 22274 request = null; 22275 }; 22276 _config.cancelToken && _config.cancelToken.subscribe(onCanceled); 22277 if (_config.signal) { 22278 _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); 22279 } 22280 } 22281 const protocol = parseProtocol(_config.url); 22282 if (protocol && platform$1.protocols.indexOf(protocol) === -1) { 22283 reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config)); 22284 return; 22285 } 22286 request.send(requestData || null); 22287 }); 22288 }; 22289 const composeSignals = (signals, timeout) => { 22290 const { length: length2 } = signals = signals ? signals.filter(Boolean) : []; 22291 if (timeout || length2) { 22292 let controller = new AbortController(); 22293 let aborted; 22294 const onabort = function(reason) { 22295 if (!aborted) { 22296 aborted = true; 22297 unsubscribe(); 22298 const err = reason instanceof Error ? reason : this.reason; 22299 controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); 22300 } 22301 }; 22302 let timer = timeout && setTimeout(() => { 22303 timer = null; 22304 onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT)); 22305 }, timeout); 22306 const unsubscribe = () => { 22307 if (signals) { 22308 timer && clearTimeout(timer); 22309 timer = null; 22310 signals.forEach((signal2) => { 22311 signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); 22312 }); 22313 signals = null; 22314 } 22315 }; 22316 signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); 22317 const { signal } = controller; 22318 signal.unsubscribe = () => utils$1.asap(unsubscribe); 22319 return signal; 22320 } 22321 }; 22322 const streamChunk = function* (chunk, chunkSize) { 22323 let len = chunk.byteLength; 22324 if (len < chunkSize) { 22325 yield chunk; 22326 return; 22327 } 22328 let pos = 0; 22329 let end; 22330 while (pos < len) { 22331 end = pos + chunkSize; 22332 yield chunk.slice(pos, end); 22333 pos = end; 22334 } 22335 }; 22336 const readBytes = function(iterable, chunkSize) { 22337 return __asyncGenerator(this, null, function* () { 22338 try { 22339 for (var iter = __forAwait(readStream(iterable)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 22340 const chunk = temp.value; 22341 yield* __yieldStar(streamChunk(chunk, chunkSize)); 22342 } 22343 } catch (temp) { 22344 error = [temp]; 22345 } finally { 22346 try { 22347 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 22348 } finally { 22349 if (error) 22350 throw error[0]; 22351 } 22352 } 22353 }); 22354 }; 22355 const readStream = function(stream) { 22356 return __asyncGenerator(this, null, function* () { 22357 if (stream[Symbol.asyncIterator]) { 22358 yield* __yieldStar(stream); 22359 return; 22360 } 22361 const reader = stream.getReader(); 22362 try { 22363 for (; ; ) { 22364 const { done, value } = yield new __await(reader.read()); 22365 if (done) { 22366 break; 22367 } 22368 yield value; 22369 } 22370 } finally { 22371 yield new __await(reader.cancel()); 22372 } 22373 }); 22374 }; 22375 const trackStream = (stream, chunkSize, onProgress, onFinish) => { 22376 const iterator = readBytes(stream, chunkSize); 22377 let bytes = 0; 22378 let done; 22379 let _onFinish = (e2) => { 22380 if (!done) { 22381 done = true; 22382 onFinish && onFinish(e2); 22383 } 22384 }; 22385 return new ReadableStream({ 22386 pull(controller) { 22387 return __async(this, null, function* () { 22388 try { 22389 const { done: done2, value } = yield iterator.next(); 22390 if (done2) { 22391 _onFinish(); 22392 controller.close(); 22393 return; 22394 } 22395 let len = value.byteLength; 22396 if (onProgress) { 22397 let loadedBytes = bytes += len; 22398 onProgress(loadedBytes); 22399 } 22400 controller.enqueue(new Uint8Array(value)); 22401 } catch (err) { 22402 _onFinish(err); 22403 throw err; 22404 } 22405 }); 22406 }, 22407 cancel(reason) { 22408 _onFinish(reason); 22409 return iterator.return(); 22410 } 22411 }, { 22412 highWaterMark: 2 22413 }); 22414 }; 22415 const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function"; 22416 const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function"; 22417 const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__P
22417URE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : (str) => __async(null, null, function* () { 22418 return new Uint8Array(yield new Response(str).arrayBuffer()); 22419 })); 22420 const test$1 = (fn2, ...args) => { 22421 try { 22422 return !!fn2(...args); 22423 } catch (e2) { 22424 return false; 22425 } 22426 }; 22427 const supportsRequestStream = isReadableStreamSupported && test$1(() => { 22428 let duplexAccessed = false; 22429 const hasContentType = new Request(platform$1.origin, { 22430 body: new ReadableStream(), 22431 method: "POST", 22432 get duplex() { 22433 duplexAccessed = true; 22434 return "half"; 22435 } 22436 }).headers.has("Content-Type"); 22437 return duplexAccessed && !hasContentType; 22438 }); 22439 const DEFAULT_CHUNK_SIZE = 64 * 1024; 22440 const supportsResponseStream = isReadableStreamSupported && test$1(() => utils$1.isReadableStream(new Response("").body)); 22441 const resolvers = { 22442 stream: supportsResponseStream && ((res) => res.body) 22443 }; 22444 isFetchSupported && ((res) => { 22445 ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { 22446 !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_2, config) => { 22447 throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); 22448 }); 22449 }); 22450 })(new Response()); 22451 const getBodyLength = (body) => __async(null, null, function* () { 22452 if (body == null) { 22453 return 0; 22454 } 22455 if (utils$1.isBlob(body)) { 22456 return body.size; 22457 } 22458 if (utils$1.isSpecCompliantForm(body)) { 22459 const _request = new Request(platform$1.origin, { 22460 method: "POST", 22461 body 22462 }); 22463 return (yield _request.arrayBuffer()).byteLength; 22464 } 22465 if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { 22466 return body.byteLength; 22467 } 22468 if (utils$1.isURLSearchParams(body)) { 22469 body = body + ""; 22470 } 22471 if (utils$1.isString(body)) { 22472 return (yield encodeText(body)).byteLength; 22473 } 22474 }); 22475 const resolveBodyLength = (headers, body) => __async(null, null, function* () { 22476 const length2 = utils$1.toFiniteNumber(headers.getContentLength()); 22477 return length2 == null ? getBodyLength(body) : length2; 22478 }); 22479 const fetchAdapter = isFetchSupported && ((config) => __async(null, null, function* () { 22480 let { 22481 url, 22482 method, 22483 data, 22484 signal, 22485 cancelToken, 22486 timeout, 22487 onDownloadProgress, 22488 onUploadProgress, 22489 responseType, 22490 headers, 22491 withCredentials = "same-origin", 22492 fetchOptions 22493 } = resolveConfig(config); 22494 responseType = responseType ? (responseType + "").toLowerCase() : "text"; 22495 let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); 22496 let request; 22497 const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { 22498 composedSignal.unsubscribe(); 22499 }); 22500 let requestContentLength;
vendor: 18,793 bytes, lines 22501-23015
22501 try { 22502 if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = yield resolveBodyLength(headers, data)) !== 0) { 22503 let _request = new Request(url, { 22504 method: "POST", 22505 body: data, 22506 duplex: "half" 22507 }); 22508 let contentTypeHeader; 22509 if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { 22510 headers.setContentType(contentTypeHeader); 22511 } 22512 if (_request.body) { 22513 const [onProgress, flush] = progressEventDecorator( 22514 requestContentLength, 22515 progressEventReducer(asyncDecorator(onUploadProgress)) 22516 ); 22517 data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); 22518 } 22519 } 22520 if (!utils$1.isString(withCredentials)) { 22521 withCredentials = withCredentials ? "include" : "omit"; 22522 } 22523 const isCredentialsSupported = "credentials" in Request.prototype; 22524 request = new Request(url, __spreadProps(__spreadValues({}, fetchOptions), { 22525 signal: composedSignal, 22526 method: method.toUpperCase(), 22527 headers: headers.normalize().toJSON(), 22528 body: data, 22529 duplex: "half", 22530 credentials: isCredentialsSupported ? withCredentials : void 0 22531 })); 22532 let response = yield fetch(request); 22533 const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); 22534 if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { 22535 const options2 = {}; 22536 ["status", "statusText", "headers"].forEach((prop) => { 22537 options2[prop] = response[prop]; 22538 }); 22539 const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length")); 22540 const [onProgress, flush] = onDownloadProgress && progressEventDecorator( 22541 responseContentLength, 22542 progressEventReducer(asyncDecorator(onDownloadProgress), true) 22543 ) || []; 22544 response = new Response( 22545 trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { 22546 flush && flush(); 22547 unsubscribe && unsubscribe(); 22548 }), 22549 options2 22550 ); 22551 } 22552 responseType = responseType || "text"; 22553 let responseData = yield resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config); 22554 !isStreamResponse && unsubscribe && unsubscribe(); 22555 return yield new Promise((resolve, reject) => { 22556 settle(resolve, reject, { 22557 data: responseData, 22558 headers: AxiosHeaders$1.from(response.headers), 22559 status: response.status, 22560 statusText: response.statusText, 22561 config, 22562 request 22563 }); 22564 }); 22565 } catch (err) { 22566 unsubscribe && unsubscribe(); 22567 if (err && err.name === "TypeError" && /fetch/i.test(err.message)) { 22568 throw Object.assign( 22569 new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request), 22570 { 22571 cause: err.cause || err 22572 } 22573 ); 22574 } 22575 throw AxiosError$1.from(err, err && err.code, config, request); 22576 } 22577 })); 22578 const knownAdapters = { 22579 http: httpAdapter, 22580 xhr: xhrAdapter, 22581 fetch: fetchAdapter 22582 }; 22583 utils$1.forEach(knownAdapters, (fn2, value) => { 22584 if (fn2) { 22585 try { 22586 Object.defineProperty(fn2, "name", { value }); 22587 } catch (e2) { 22588 } 22589 Object.defineProperty(fn2, "adapterName", { value }); 22590 } 22591 }); 22592 const renderReason = (reason) => `- ${reason}`; 22593 const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; 22594 const adapters = { 22595 getAdapter: (adapters2) => { 22596 adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2]; 22597 const { length: length2 } = adapters2; 22598 let nameOrAdapter; 22599 let adapter; 22600 const rejectedReasons = {}; 22601 for (let i2 = 0; i2 < length2; i2++) { 22602 nameOrAdapter = adapters2[i2]; 22603 let id2; 22604 adapter = nameOrAdapter; 22605 if (!isResolvedHandle(nameOrAdapter)) { 22606 adapter = knownAdapters[(id2 = String(nameOrAdapter)).toLowerCase()]; 22607 if (adapter === void 0) { 22608 throw new AxiosError$1(`Unknown adapter '${id2}'`); 22609 } 22610 } 22611 if (adapter) { 22612 break; 22613 } 22614 rejectedReasons[id2 || "#" + i2] = adapter; 22615 } 22616 if (!adapter) { 22617 const reasons = Object.entries(rejectedReasons).map( 22618 ([id2, state]) => `adapter ${id2} ` + (state === false ? "is not supported by the environment" : "is not available in the build") 22619 ); 22620 let s2 = length2 ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; 22621 throw new AxiosError$1( 22622 `There is no suitable adapter to dispatch the request ` + s2, 22623 "ERR_NOT_SUPPORT" 22624 ); 22625 } 22626 return adapter; 22627 }, 22628 adapters: knownAdapters 22629 }; 22630 function throwIfCancellationRequested(config) { 22631 if (config.cancelToken) { 22632 config.cancelToken.throwIfRequested(); 22633 } 22634 if (config.signal && config.signal.aborted) { 22635 throw new CanceledError$1(null, config); 22636 } 22637 } 22638 function dispatchRequest(config) { 22639 throwIfCancellationRequested(config); 22640 config.headers = AxiosHeaders$1.from(config.headers); 22641 config.data = transformData.call( 22642 config, 22643 config.transformRequest 22644 ); 22645 if (["post", "put", "patch"].indexOf(config.method) !== -1) { 22646 config.headers.setContentType("application/x-www-form-urlencoded", false); 22647 } 22648 const adapter = adapters.getAdapter(config.adapter || defaults.adapter); 22649 return adapter(config).then(function onAdapterResolution(response) { 22650 throwIfCancellationRequested(config); 22651 response.data = transformData.call( 22652 config, 22653 config.transformResponse, 22654 response 22655 ); 22656 response.headers = AxiosHeaders$1.from(response.headers); 22657 return response; 22658 }, function onAdapterRejection(reason) { 22659 if (!isCancel$1(reason)) { 22660 throwIfCancellationRequested(config); 22661 if (reason && reason.response) { 22662 reason.response.data = transformData.call( 22663 config, 22664 config.transformResponse, 22665 reason.response 22666 ); 22667 reason.response.headers = AxiosHeaders$1.from(reason.response.headers); 22668 } 22669 } 22670 return Promise.reject(reason); 22671 }); 22672 } 22673 const VERSION$1 = "1.7.9"; 22674 const validators$1 = {}; 22675 ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => { 22676 validators$1[type] = function validator2(thing) { 22677 return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type; 22678 }; 22679 }); 22680 const deprecatedWarnings = {}; 22681 validators$1.transitional = function transitional(validator2, version, message) { 22682 function formatMessage(opt, desc) { 22683 return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); 22684 } 22685 return (value, opt, opts) => { 22686 if (validator2 === false) { 22687 throw new AxiosError$1( 22688 formatMessage(opt, " has been removed" + (version ? " in " + version : "")), 22689 AxiosError$1.ERR_DEPRECATED 22690 ); 22691 } 22692 if (version && !deprecatedWarnings[opt]) { 22693 deprecatedWarnings[opt] = true; 22694 console.warn( 22695 formatMessage( 22696 opt, 22697 " has been deprecated since v" + version + " and will be removed in the near future" 22698 ) 22699 ); 22700 } 22701 return validator2 ? validator2(value, opt, opts) : true; 22702 }; 22703 }; 22704 validators$1.spelling = function spelling(correctSpelling) { 22705 return (value, opt) => { 22706 console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); 22707 return true; 22708 }; 22709 }; 22710 function assertOptions(options2, schema, allowUnknown) { 22711 if (typeof options2 !== "object") { 22712 throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE); 22713 } 22714 const keys2 = Object.keys(options2); 22715 let i2 = keys2.length; 22716 while (i2-- > 0) { 22717 const opt = keys2[i2]; 22718 const validator2 = schema[opt]; 22719 if (validator2) { 22720 const value = options2[opt]; 22721 const result = value === void 0 || validator2(value, opt, options2); 22722 if (result !== true) { 22723 throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE); 22724 } 22725 continue; 22726 } 22727 if (allowUnknown !== true) { 22728 throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION); 22729 } 22730 } 22731 } 22732 const validator = { 22733 assertOptions, 22734 validators: validators$1 22735 }; 22736 const validators = validator.validators; 22737 let Axios$1 = class Axios { 22738 constructor(instanceConfig) { 22739 this.defaults = instanceConfig; 22740 this.interceptors = { 22741 request: new InterceptorManager(), 22742 response: new InterceptorManager() 22743 }; 22744 } 22745 /** 22746 * Dispatch a request 22747 * 22748 * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) 22749 * @param {?Object} config 22750 * 22751 * @returns {Promise} The Promise to be fulfilled 22752 */ 22753 request(configOrUrl, config) { 22754 return __async(this, null, function* () { 22755 try { 22756 return yield this._request(configOrUrl, config); 22757 } catch (err) { 22758 if (err instanceof Error) { 22759 let dummy = {}; 22760 Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); 22761 const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; 22762 try { 22763 if (!err.stack) { 22764 err.stack = stack; 22765 } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { 22766 err.stack += "\n" + stack; 22767 } 22768 } catch (e2) { 22769 } 22770 } 22771 throw err; 22772 } 22773 }); 22774 } 22775 _request(configOrUrl, config) { 22776 if (typeof configOrUrl === "string") { 22777 config = config || {}; 22778 config.url = configOrUrl; 22779 } else { 22780 config = configOrUrl || {}; 22781 } 22782 config = mergeConfig$1(this.defaults, config); 22783 const { transitional, paramsSerializer, headers } = config; 22784 if (transitional !== void 0) { 22785 validator.assertOptions(transitional, { 22786 silentJSONParsing: validators.transitional(validators.boolean), 22787 forcedJSONParsing: validators.transitional(validators.boolean), 22788 clarifyTimeoutError: validators.transitional(validators.boolean) 22789 }, false); 22790 } 22791 if (paramsSerializer != null) { 22792 if (utils$1.isFunction(paramsSerializer)) { 22793 config.paramsSerializer = { 22794 serialize: paramsSerializer 22795 }; 22796 } else { 22797 validator.assertOptions(paramsSerializer, { 22798 encode: validators.function, 22799 serialize: validators.function 22800 }, true); 22801 } 22802 } 22803 validator.assertOptions(config, { 22804 baseUrl: validators.spelling("baseURL"), 22805 withXsrfToken: validators.spelling("withXSRFToken") 22806 }, true); 22807 config.method = (config.method || this.defaults.method || "get").toLowerCase(); 22808 let contextHeaders = headers && utils$1.merge( 22809 headers.common, 22810 headers[config.method] 22811 ); 22812 headers && utils$1.forEach( 22813 ["delete", "get", "head", "post", "put", "patch", "common"], 22814 (method) => { 22815 delete headers[method]; 22816 } 22817 ); 22818 config.headers = AxiosHeaders$1.concat(contextHeaders, headers); 22819 const requestInterceptorChain = []; 22820 let synchronousRequestInterceptors = true; 22821 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 22822 if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { 22823 return; 22824 } 22825 synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; 22826 requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); 22827 }); 22828 const responseInterceptorChain = []; 22829 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 22830 responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); 22831 }); 22832 let promise; 22833 let i2 = 0; 22834 let len; 22835 if (!synchronousRequestInterceptors) { 22836 const chain = [dispatchRequest.bind(this), void 0]; 22837 chain.unshift.apply(chain, requestInterceptorChain); 22838 chain.push.apply(chain, responseInterceptorChain); 22839 len = chain.length; 22840 promise = Promise.resolve(config); 22841 while (i2 < len) { 22842 promise = promise.then(chain[i2++], chain[i2++]); 22843 } 22844 return promise; 22845 } 22846 len = requestInterceptorChain.length; 22847 let newConfig = config; 22848 i2 = 0; 22849 while (i2 < len) { 22850 const onFulfilled = requestInterceptorChain[i2++]; 22851 const onRejected = requestInterceptorChain[i2++]; 22852 try { 22853 newConfig = onFulfilled(newConfig); 22854 } catch (error) { 22855 onRejected.call(this, error); 22856 break; 22857 } 22858 } 22859 try { 22860 promise = dispatchRequest.call(this, newConfig); 22861 } catch (error) { 22862 return Promise.reject(error); 22863 } 22864 i2 = 0; 22865 len = responseInterceptorChain.length; 22866 while (i2 < len) { 22867 promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]); 22868 } 22869 return promise; 22870 } 22871 getUri(config) { 22872 config = mergeConfig$1(this.defaults, config); 22873 const fullPath = buildFullPath(config.baseURL, config.url); 22874 return buildURL(fullPath, config.params, config.paramsSerializer); 22875 } 22876 }; 22877 utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { 22878 Axios$1.prototype[method] = function(url, config) { 22879 return this.request(mergeConfig$1(config || {}, { 22880 method, 22881 url, 22882 data: (config || {}).data 22883 })); 22884 }; 22885 }); 22886 utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) { 22887 function generateHTTPMethod(isForm) { 22888 return function httpMethod(url, data, config) { 22889 return this.request(mergeConfig$1(config || {}, { 22890 method, 22891 headers: isForm ? { 22892 "Content-Type": "multipart/form-data" 22893 } : {}, 22894 url, 22895 data 22896 })); 22897 }; 22898 } 22899 Axios$1.prototype[method] = generateHTTPMethod(); 22900 Axios$1.prototype[method + "Form"] = generateHTTPMethod(true); 22901 }); 22902 let CancelToken$1 = class CancelToken2 { 22903 constructor(executor) { 22904 if (typeof executor !== "function") { 22905 throw new TypeError("executor must be a function."); 22906 } 22907 let resolvePromise; 22908 this.promise = new Promise(function promiseExecutor(resolve) { 22909 resolvePromise = resolve; 22910 }); 22911 const token2 = this; 22912 this.promise.then((cancel) => { 22913 if (!token2._listeners) return; 22914 let i2 = token2._listeners.length; 22915 while (i2-- > 0) { 22916 token2._listeners[i2](cancel); 22917 } 22918 token2._listeners = null; 22919 }); 22920 this.promise.then = (onfulfilled) => { 22921 let _resolve; 22922 const promise = new Promise((resolve) => { 22923 token2.subscribe(resolve); 22924 _resolve = resolve; 22925 }).then(onfulfilled); 22926 promise.cancel = function reject() { 22927 token2.unsubscribe(_resolve); 22928 }; 22929 return promise; 22930 }; 22931 executor(function cancel(message, config, request) { 22932 if (token2.reason) { 22933 return; 22934 } 22935 token2.reason = new CanceledError$1(message, config, request); 22936 resolvePromise(token2.reason); 22937 }); 22938 } 22939 /** 22940 * Throws a `CanceledError` if cancellation has been requested. 22941 */ 22942 throwIfRequested() { 22943 if (this.reason) { 22944 throw this.reason; 22945 } 22946 } 22947 /** 22948 * Subscribe to the cancel signal 22949 */ 22950 subscribe(listener) { 22951 if (this.reason) { 22952 listener(this.reason); 22953 return; 22954 } 22955 if (this._listeners) { 22956 this._listeners.push(listener); 22957 } else { 22958 this._listeners = [listener]; 22959 } 22960 } 22961 /** 22962 * Unsubscribe from the cancel signal 22963 */ 22964 unsubscribe(listener) { 22965 if (!this._listeners) { 22966 return; 22967 } 22968 const index2 = this._listeners.indexOf(listener); 22969 if (index2 !== -1) { 22970 this._listeners.splice(index2, 1); 22971 } 22972 } 22973 toAbortSignal() { 22974 const controller = new AbortController(); 22975 const abort = (err) => { 22976 controller.abort(err); 22977 }; 22978 this.subscribe(abort); 22979 controller.signal.unsubscribe = () => this.unsubscribe(abort); 22980 return controller.signal; 22981 } 22982 /** 22983 * Returns an object that contains a new `CancelToken` and a function that, when called, 22984 * cancels the `CancelToken`. 22985 */ 22986 static source() { 22987 let cancel; 22988 const token2 = new CancelToken2(function executor(c2) { 22989 cancel = c2; 22990 }); 22991 return { 22992 token: token2, 22993 cancel 22994 }; 22995 } 22996 }; 22997 function spread$1(callback) { 22998 return function wrap2(arr) { 22999 return callback.apply(null, arr); 23000 }; 23001 } 23002 function isAxiosError$1(payload) { 23003 return utils$1.isObject(payload) && payload.isAxiosError === true; 23004 } 23005 const HttpStatusCode$1 = { 23006 Continue: 100, 23007 SwitchingProtocols: 101, 23008 Processing: 102, 23009 EarlyHints: 103, 23010 Ok: 200, 23011 Created: 201, 23012 Accepted: 202, 23013 NonAuthoritativeInformation: 203, 23014 NoContent: 204, 23015 ResetContent: 205,
23016 PartialContent: 206, 23017 MultiStatus: 207, 23018 AlreadyReported: 208, 23019 ImUsed: 226, 23020 MultipleChoices: 300, 23021 MovedPermanently: 301, 23022 Found: 302, 23023 SeeOther: 303, 23024 NotModified: 304, 23025 UseProxy: 305, 23026 Unused: 306, 23027 TemporaryRedirect: 307, 23028 PermanentRedirect: 308, 23029 BadRequest: 400, 23030 Unauthorized: 401, 23031 PaymentRequired: 402, 23032 Forbidden: 403, 23033 NotFound: 404, 23034 MethodNotAllowed: 405, 23035 NotAcceptable: 406, 23036 ProxyAuthenticationRequired: 407, 23037 RequestTimeout: 408, 23038 Conflict: 409, 23039 Gone: 410, 23040 LengthRequired: 411, 23041 PreconditionFailed: 412, 23042 PayloadTooLarge: 413, 23043 UriTooLong: 414, 23044 UnsupportedMediaType: 415, 23045 RangeNotSatisfiable: 416, 23046 ExpectationFailed: 417, 23047 ImATeapot: 418, 23048 MisdirectedRequest: 421, 23049 UnprocessableEntity: 422, 23050 Locked: 423, 23051 FailedDependency: 424, 23052 TooEarly: 425, 23053 UpgradeRequired: 426, 23054 PreconditionRequired: 428, 23055 TooManyRequests: 429, 23056 RequestHeaderFieldsTooLarge: 431, 23057 UnavailableForLegalReasons: 451, 23058 InternalServerError: 500, 23059 NotImplemented: 501, 23060 BadGateway: 502, 23061 ServiceUnavailable: 503, 23062 GatewayTimeout: 504, 23063 HttpVersionNotSupported: 505, 23064 VariantAlsoNegotiates: 506, 23065 InsufficientStorage: 507, 23066 LoopDetected: 508, 23067 NotExtended: 510, 23068 NetworkAuthenticationRequired: 511 23069 }; 23070 Object.entries(HttpStatusCode$1).forEach(([key, value]) => { 23071 HttpStatusCode$1[value] = key; 23072 }); 23073 function createInstance(defaultConfig) { 23074 const context = new Axios$1(defaultConfig); 23075 const instance2 = bind(Axios$1.prototype.request, context); 23076 utils$1.extend(instance2, Axios$1.prototype, context, { allOwnKeys: true }); 23077 utils$1.extend(instance2, context, null, { allOwnKeys: true }); 23078 instance2.create = function create2(instanceConfig) { 23079 return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); 23080 }; 23081 return instance2; 23082 } 23083 const axios = createInstance(defaults); 23084 axios.Axios = Axios$1; 23085 axios.CanceledError = CanceledError$1; 23086 axios.CancelToken = CancelToken$1; 23087 axios.isCancel = isCancel$1; 23088 axios.VERSION = VERSION$1; 23089 axios.toFormData = toFormData$1; 23090 axios.AxiosError = AxiosError$1; 23091 axios.Cancel = axios.CanceledError; 23092 axios.all = function all2(promises) { 23093 return Promise.all(promises); 23094 }; 23095 axios.spread = spread$1; 23096 axios.isAxiosError = isAxiosError$1; 23097 axios.mergeConfig = mergeConfig$1; 23098 axios.AxiosHeaders = AxiosHeaders$1; 23099 axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); 23100 axios.getAdapter = adapters.getAdapter; 23101 axios.HttpStatusCode = HttpStatusCode$1; 23102 axios.default = axios; 23103 const { 23104 Axios, 23105 AxiosError, 23106 CanceledError, 23107 isCancel, 23108 CancelToken, 23109 VERSION, 23110 all, 23111 Cancel, 23112 isAxiosError, 23113 spread, 23114 toFormData, 23115 AxiosHeaders, 23116 HttpStatusCode, 23117 formToJSON, 23118 getAdapter, 23119 mergeConfig 23120 } = axios; 23121 class ApiBase { 23122 constructor(customUrl) { 23123 __publicField(this, "instance"); 23124 __publicField(this, "customUrl"); 23125 __publicField(this, "getUrl", (customUrl) => { 23126 if (customUrl) { 23127 return customUrl; 23128 } 23129 return getBaseApiUrl("api"); 23130 }); 23131 __publicField(this, "setMaxRequestsCount", (maxRequestsCount = 5) => { 23132 const MAX_REQUESTS_COUNT = maxRequestsCount; 23133 const INTERVAL_MS = 10; 23134 let PENDING_REQUESTS = 0; 23135 this.instance.interceptors.request.use((config) => { 23136 return new Promise((resolve) => { 23137 const interval = setInterval(() => { 23138 if (PENDING_REQUESTS < MAX_REQUESTS_COUNT) { 23139 PENDING_REQUESTS++; 23140 clearInterval(interval); 23141 resolve(config); 23142 } 23143 }, INTERVAL_MS); 23144 }); 23145 }); 23146 this.instance.interceptors.response.use((response) => { 23147 PENDING_REQUESTS = Math.max(0, PENDING_REQUESTS - 1); 23148 return Promise.resolve(response); 23149 }, (error) => { 23150 PENDING_REQUESTS = Math.max(0, PENDING_REQUESTS - 1); 23151 return Promise.reject(error); 23152 }); 23153 }); 23154 __publicField(this, "getCancelTokenSource", () => { 23155 return axios.CancelToken.source(); 23156 }); 23157 __publicField(this, "getUnsafe", (path, params, headers) => { 23158 return this.instance.get(path, { params, headers }); 23159 }); 23160 __publicField(this, "get", (path, params, headers, config) => { 23161 return this.instance.get(path, __spreadValues({ params, headers }, config)); 23162 }); 23163 __publicField(this, "getBlob", (path, params, headers) => { 23164 return this.instance.get(path, { params, headers, responseType: "blob" }); 23165 }); 23166 __publicField(this, "post", (path, payload, params, config) => { 23167 return this.instance.post(path, payload, __spreadValues({ params }, config)); 23168 }); 23169 __publicField(this, "put", (path, payload, params, config) => { 23170 return this.instance.put(path, payload, __spreadValues({ params }, config)); 23171 }); 23172 __publicField(this, "patch", (path, payload, params, config) => { 23173 return this.instance.patch(path, payload, __spreadValues({ params }, config)); 23174 }); 23175 __publicField(this, "delete", (path, payload, params) => { 23176 return this.instance.delete(path, { data: payload, params }); 23177 }); 23178 __publicField(this, "getLink", (path) => { 23179 return `${this.getUrl(this.customUrl)}${path}`;
23180 }); 23181 __publicField(this, "setAuthorizationHeader", (token2) => { 23182 this.setHeader("Authorization", `Bearer ${token2}`); 23183 }); 23184 __publicField(this, "removeAuthorizationHeader", () => { 23185 this.removeHeader("Authorization"); 23186 }); 23187 __publicField(this, "setHeader", (key, value) => { 23188 this.instance.defaults.headers.common[key] = value; 23189 }); 23190 __publicField(this, "removeHeader", (key) => { 23191 delete this.instance.defaults.headers.common[key]; 23192 }); 23193 __publicField(this, "addErrorResponseInterceptor", (errorInterceptor) => { 23194 this.instance.interceptors.response.use((success) => success, errorInterceptor); 23195 }); 23196 __publicField(this, "addRequestInterceptor", (interceptor) => { 23197 return this.instance.interceptors.request.use(interceptor); 23198 }); 23199 __publicField(this, "removeRequestInterceptor", (interceptorId) => { 23200 this.instance.interceptors.request.eject(interceptorId); 23201 }); 23202 this.customUrl = customUrl; 23203 this.instance = axios.create({ 23204 xsrfCookieName: getCsrfCookieName(), 23205 xsrfHeaderName: "X-XSRF-TOKEN", 23206 paramsSerializer: { 23207 serialize: (params) => { 23208 const searchParams = new URLSearchParams(); 23209 for (const [key, value] of Object.entries(params)) { 23210 if (params[key] !== void 0) { 23211 if (Array.isArray(value)) { 23212 value.forEach((val) => searchParams.append(key, val)); 23213 } else { 23214 searchParams.set(key, value); 23215 } 23216 } 23217 } 23218 return searchParams.toString(); 23219 } 23220 } 23221 }); 23222 this.instance.interceptors.request.use((config) => { 23223 return __spreadValues({ 23224 baseURL: this.getUrl(this.customUrl) 23225 }, config); 23226 }); 23227 this.instance.interceptors.response.use((response) => response, (error) => __async(this, null, function* () { 23228 const response = error == null ? void 0 : error.response; 23229 const data = response == null ? void 0 : response.data; 23230 if (response && data instanceof Blob && data.type.includes("json")) { 23231 try { 23232 response.data = JSON.parse(yield data.text()); 23233 } catch (e2) { 23234 } 23235 } 23236 return Promise.reject(error); 23237 })); 23238 } 23239 } 23240 class OrderStatusClientModel extends ApiBase { 23241 constructor() { 23242 super(...arguments); 23243 __publicField(this, "getBasicOrderStatus", (orderId) => { 23244 return this.get("/features/order-status/basic", { orderId }); 23245 }); 23246 __publicField(this, "getFullOrderStatus", (orderId, email, orderFriendlyId) => { 23247 const params = { orderId, email, orderFriendlyId }; 23248 return this.get("/features/order-status/full", params); 23249 }); 23250 __publicField(this, "getGiftCardsOrderStatus", (orderId) => { 23251 return this.get("/features/order-status/gift-cards", { 23252 orderId 23253 }); 23254 }); 23255 __publicField(this, "getBasicGiveawayStatus", (giveawayId) => { 23256 return this.get("/features/giveaway-status/basic", { 23257 giveawayId 23258 }); 23259 }); 23260 __publicField(this, "getFullGiveawayStatus", (giveawayId, email, giveawayFriendlyId) => { 23261 const params = { giveawayId, email, giveawayFriendlyId }; 23262 return this.get("/features/giveaway-status/full", params); 23263 }); 23264 __publicField(this, "getBasicMembershipGiftStatus", (checkoutId) => { 23265 return this.get("/features/membership-gift-status/basic", { 23266 checkoutId 23267 }); 23268 }); 23269 __publicField(this, "getFullMembershipGiftStatus", (checkoutId, email) => { 23270 const params = { checkoutId, email }; 23271 return this.get("/features/membership-gift-status/full", params); 23272 }); 23273 __publicField(this, "cancelOrder", (orderId, friendlyId, email, reason) => { 23274 return this.post(`/orders/${orderId}/cancel`, { reason }, { friendlyId, email }); 23275 }); 23276 __publicField(this, "getBasicOrderShipment", (params) => { 23277 return this.get(`/order/${params.orderId}/shipment/${params.shipmentTrackerId}/basic`); 23278 }); 23279 __publicField(this, "getFullOrderShipment", (params, queryParams) => { 23280 return this.get(`/order/${params.orderId}/shipment/${params.shipmentTrackerId}/full`, queryParams); 23281 }); 23282 __publicField(this, "updateEmail", (pathParams, payload, queryParams) => { 23283 return this.put(`/orders/${pathParams.orderId}/email`, payload, queryParams); 23284 }); 23285 } 23286 } 23287 const OrderStatusClient = new OrderStatusClientModel(); 23288 var O4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 12 12", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.683 8.634.186 3.494l1.128-.988 4.498 5.14a.25.25 0 0 0 .376 0l4.498-5.14 1.128.988-4.497 5.14a1.75 1.75 0 0 1-2.634 0", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), Z4 = O4; 23289 var U4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "m4.366 6.683 7.14-6.247.988 1.128-7.14 6.248a.25.25 0 0 0 0 .376l7.14 6.247-.988 1.13
23289-7.14-6.248a1.75 1.75 0 0 1 0-2.634", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), X4 = U4; 23290 var W4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 12 12", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.683 3.366.186 8.506l1.128.988 4.498-5.14a.25.25 0 0 1 .376 0l4.498 5.14 1.128-.988-4.497-5.14a1.75 1.75 0 0 0-2.634 0", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), K4 = W4; 23291 var Y4 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "m8 9.06-6.72 6.72-1.06-1.06L6.94 8 .22 1.28 1.28.22 8 6.94 14.72.22l1.06 1.06L9.06 8l6.72 6.72-1.06 1.06z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), $4 = Y4; 23292 var ze$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.25 9.121 3.12 4.934 2.054 5.987 6.996 11a1.41 1.41 0 0 0 2.008 0l4.943-5.013-1.068-1.053L8.75 9.12V0h-1.5zM1.5 11.108v3.143c0 .138.111.249.249.249h12.504a.247.247 0 0 0 .247-.25v-3.142H16v3.143c0 .963-.777 1.749-1.747 1.749H1.75A1.75 1.75 0 0 1 0 14.25v-3.142z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), Me$3 = ze$3; 23293 var $e$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13m-.92 2.875h1.5v4.63h-1.5zm0 7.15v-1.47h1.5v1.47z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), je$3 = $e$3; 23294 var G8 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 32 32", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "m11.947 6-.682 3.151H9.983c-1.61 0-1.964.081-2.237 1.195l-.136.733h3.246l-.683 3.178H6.928L4.5 25.692H0l2.428-11.435H.409l.682-3.178h1.991l.219-.923C4.01 6.706 5.7 6 9.628 6zm3.525 5.08 1.936 9.913 1.718-9.914h4.637l1.69 9.914 1.938-9.914H32l-3.382 14.613h-5.21L21.446 14.91 19.48 25.692h-5.237L10.862 11.08z", vectorEffect: "non-scaling-stroke" }) })), u8 = G8; 23295 var C8 = (o2) => jsxRuntimeExports.jsxs("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 113 20", overflow: "visible", role: "img" }, o2), { children: [jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.85.016H9.545L9.559 0C5.655 0 3.972.705 3.273 4.14l-.214.93H1.083L.407 8.237H2.41L0 19.644h4.465L6.872 8.237h2.226C7.952 9.936 7.45 11.969 7.45 13.679c0 4.275 2.984 6.305 6.881 6.305 3.879 0 6.254-2.043 7.493-4.484l-.008.263c0 2.868 1.539 4.22 4.19 4.22V20c2.489 0 3.993-1.055 4.924-2.219l-.405 1.863h4.356l3.091-14.557h-4.465l-1.63 7.631c-.542 2.598-1.813 3.895-3.599 3.895-1.243 0-1.839-.715-1.839-2.095a8 8 0 0 1 .245-1.812l1.63-7.63h-4.466l-1.011 4.819c-.47-3.52-3.231-5.197-6.774-5.197-2.444 0-4.297.809-5.645 2.017l.351-1.64H7.55l.136-.729c.27-1.11.621-1.192 2.218-1.192h1.271zm3.887 8.146c-2.435 0-3.68 2.514-3.68 5.3 0 2.031.894 3.058 2.56 3.058 2.436 0 3.681-2.515 3.681-5.304 0-2.027-.894-3.054-2.56-3.054", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "M102.552.019h4.463v19.613h-4.463z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M94.525 7.648c-1.434 0-2.435.728-2.598 2.137h-4.065l
23295-2.27 9.847h-5.196L78.45 8.891 76.5 19.632h-5.166L67.981 5.075h4.572l1.92 9.875 1.677-9.875h4.6l1.704 9.875 1.92-9.875h4.573l-.662 2.872c.993-1.9 3.32-3.33 6.617-3.33 4.167 0 6.577 1.676 6.493 6.115l-.054 3.164c-.025 1.895.054 4.49.324 5.736h-4.381l-.054-1.76c-1.082 1.544-2.815 2.112-4.889 2.112-2.758 0-5.03-1.63-5.03-4.275 0-3.57 4.031-4.763 9.684-5.168v-.568c0-1.704-.866-2.328-2.46-2.328zm-.559 9.31c1.784 0 3.138-.757 3.138-3.435v-.358c-3.112.27-5.196.677-5.196 2.219 0 .947.894 1.569 2.058 1.569z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "M112.69.019h-4.465v19.613h4.465z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M59.92 7.024c.974-1.218 2.38-2.245 4.815-2.245 2.652 0 4.19 1.353 4.19 4.247-.014.82-.113 1.635-.295 2.435l-1.73 8.183h-4.465l1.63-7.576a8 8 0 0 0 .232-1.813c0-1.353-.595-2.028-1.839-2.028-1.757 0-3.056 1.243-3.599 3.841l-1.63 7.576h-4.45l.002-.012h-2.787c-2.866 0-4.139-.433-4.139-2.41q.026-.848.217-1.676l1.275-5.966a8 8 0 0 0-1.54-.135c-1.894 0-3.22.647-3.654 2.814l-1.569 7.385h-4.463l3.083-14.567h4.33l-.561 2.673c1.022-1.57 2.67-2.84 4.889-2.84h.48l.814-3.816h4.463l-.864 3.979h3.115L56.943.016h4.465zM55.2 8.237h-3.121l-1.38 6.513q-.075.363-.082.731c0 .769.46.932 1.65.932h1.198z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" })] })), P8 = C8; 23296 var mt$3 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 7.25h16v1.5H0z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), wt$2 = mt$3; 23297 var F9 = (o2) => jsxRuntimeExports.jsxs("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 32 32", overflow: "visible", role: "img" }, o2), { children: [jsxRuntimeExports.jsxs("g", { fill: "currentColor", clipPath: "url(#PlaceholderPhotoIcon_svg__a)", children: [jsxRuntimeExports.jsx("path", { d: "M9.96 12.141a3.304 3.304 0 1 0 0-6.607 3.304 3.304 0 0 0 0 6.607m8.972-1.062-4.315 7.094-3.146-2.655-5.93 6.551h21.277z", vectorEffect: "non-scaling-stroke" }), jsxRuntimeExports.jsx("path", { d: "M32 0H0v32h32zm-3.31 24.276H3.31V3.31h25.38z", vectorEffect: "non-scaling-stroke" })] }), jsxRuntimeExports.jsx("defs", { children: jsxRuntimeExports.jsx("clipPath", { id: "PlaceholderPhotoIcon_svg__a", children: jsxRuntimeExports.jsx("path", { fill: "#fff", d: "M0 0h32v32H0z", vectorEffect: "non-scaling-stroke" }) }) })] })), D9 = F9; 23298 var _9 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.25 7.25V0h1.5v7.25H16v1.5H8.75V16h-1.5V8.75H0v-1.5z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), W9 = _9; 23299 var ar$2 = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13m-.555 4.021a.79.79 0 0 0-.79.79h-1.5a2.29 2.29 0 0 1 2.29-2.29h.77a2.29 2.29 0 0 1 .365 4.551v.434h-1.5v-.77c0-.627.508-1.135 1.135-1.135a.79.79 0 1 0 0-1.58zm-.365 6.004v-1.47h1.5v1.47z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), fr$2 = ar$2; 23300 var Bc = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.857 2.44 7.796 13.56a1.75 1.75 0 0 1-2.56.298L.26 9.568l.98-1.136 4.976 4.29a.25.25 0 0 0 .365-.043l8.062-11.12z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), yc = Bc; 23301 var fs = (o2) => jsxRuntimeExports.jsx("svg", __spreadProps(__spreadValues({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 16 16", overflow: "visible", role: "img" }, o2), { children: jsxRuntimeExports.jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M6.996.471a1.41 1.41 0 0 1 2.008 0l4.943 5.013-1.
23301068 1.053L8.75 2.35v9.121h-1.5V2.35L3.12 6.537 2.054 5.484zM1.5 11.11v3.142c0 .138.111.249.249.249H14.25c.138 0 .249-.11.249-.25v-3.142H16v3.143c0 .965-.781 1.749-1.749 1.749H1.75A1.75 1.75 0 0 1 0 14.25v-3.142z", clipRule: "evenodd", vectorEffect: "non-scaling-stroke" }) })), ps = fs; 23302 var __assign$3 = function() { 23303 __assign$3 = Object.assign || function __assign2(t2) { 23304 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 23305 s2 = arguments[i2]; 23306 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 23307 } 23308 return t2; 23309 }; 23310 return __assign$3.apply(this, arguments); 23311 }; 23312 function __spreadArray$1(to2, from2, pack) { 23313 if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { 23314 if (ar2 || !(i2 in from2)) { 23315 if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); 23316 ar2[i2] = from2[i2]; 23317 } 23318 } 23319 return to2.concat(ar2 || Array.prototype.slice.call(from2)); 23320 } 23321 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 23322 var e2 = new Error(message); 23323 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 23324 }; 23325 var MS = "-ms-"; 23326 var MOZ = "-moz-"; 23327 var WEBKIT = "-webkit-"; 23328 var COMMENT = "comm"; 23329 var RULESET = "rule"; 23330 var DECLARATION = "decl"; 23331 var IMPORT = "@import"; 23332 var KEYFRAMES = "@keyframes"; 23333 var LAYER = "@layer"; 23334 var abs = Math.abs; 23335 var from = String.fromCharCode; 23336 var assign$1 = Object.assign; 23337 function hash(value, length2) { 23338 return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0; 23339 } 23340 function trim$1(value) { 23341 return value.trim(); 23342 } 23343 function match$1(value, pattern) { 23344 return (value = pattern.exec(value)) ? value[0] : value; 23345 } 23346 function replace(value, pattern, replacement) { 23347 return value.replace(pattern, replacement); 23348 } 23349 function indexof(value, search, position2) { 23350 return value.indexOf(search, position2); 23351 } 23352 function charat(value, index2) { 23353 return value.charCodeAt(index2) | 0; 23354 } 23355 function substr(value, begin, end) { 23356 return value.slice(begin, end); 23357 } 23358 function strlen(value) { 23359 return value.length; 23360 } 23361 function sizeof(value) { 23362 return value.length; 23363 } 23364 function append(value, array2) { 23365 return array2.push(value), value; 23366 } 23367 function combine(array2, callback) { 23368 return array2.map(callback).join(""); 23369 } 23370 function filter$1(array2, pattern) { 23371 return array2.filter(function(value) { 23372 return !match$1(value, pattern); 23373 }); 23374 } 23375 var line = 1; 23376 var column = 1; 23377 var length = 0; 23378 var position = 0; 23379 var character = 0; 23380 var characters = ""; 23381 function node(value, root2, parent, type, props, children, length2, siblings) { 23382 return { value, root: root2, parent, type, props, children, line, column, length: length2, return: "", siblings }; 23383 } 23384 function copy(root2, props) { 23385 return assign$1(node("", null, null, "", null, null, 0, root2.siblings), root2, { length: -root2.length }, props); 23386 } 23387 function lift(root2) { 23388 while (root2.root) 23389 root2 = copy(root2.root, { children: [root2] }); 23390 append(root2, root2.siblings); 23391 } 23392 function char() { 23393 return character; 23394 } 23395 function prev() { 23396 character = position > 0 ? charat(characters, --position) : 0; 23397 if (column--, character === 10) 23398 column = 1, line--; 23399 return character; 23400 } 23401 function next() { 23402 character = position < length ? charat(characters, position++) : 0; 23403 if (column++, character === 10) 23404 column = 1, line++; 23405 return character; 23406 } 23407 function peek() { 23408 return charat(characters, position); 23409 } 23410 function caret() { 23411 return position; 23412 } 23413 function slice(begin, end) { 23414 return substr(characters, begin, end); 23415 } 23416 function token(type) { 23417 switch (type) { 23418 // \0 \t \n \r \s whitespace token 23419 case 0: 23420 case 9: 23421 case 10: 23422 case 13: 23423 case 32: 23424 return 5; 23425 // ! + , / > @ ~ isolate token 23426 case 33: 23427 case 43: 23428 case 44: 23429 case 47: 23430 case 62: 23431 case 64: 23432 case 126: 23433 // ; { } breakpoint token 23434 case 59: 23435 case 123: 23436 case 125: 23437 return 4; 23438 // : accompanied token 23439 case 58: 23440 return 3; 23441 // " ' ( [ opening delimit token 23442 case 34: 23443 case 39: 23444 case 40: 23445 case 91: 23446 return 2; 23447 // ) ] closing delimit token 23448 case 41: 23449 case 93: 23450 return 1; 23451 } 23452 return 0; 23453 } 23454 function alloc(value) { 23455 return line = column = 1, length = strlen(characters = value), position = 0, []; 23456 } 23457 function dealloc(value) { 23458 return characters = "", value; 23459 } 23460 function delimit(type) { 23461 return trim$1(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))); 23462 } 23463 function whitespace(type) { 23464 while (character = peek()) 23465 if (character < 33) 23466 next(); 23467 else 23468 break; 23469 return token(type) > 2 || token(character) > 3 ? "" : " "; 23470 } 23471 function escaping(index2, count2) { 23472 while (--count2 && next()) 23473 if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) 23474 break; 23475 return slice(index2, caret() + (count2 < 6 && peek() == 32 && next() == 32)); 23476 } 23477 function delimiter(type) { 23478 while (next()) 23479 switch (character) { 23480 // ] ) " ' 23481 case type: 23482 return position; 23483 // " ' 23484 case 34: 23485 case 39: 23486 if (type !== 34 && type !== 39) 23487 delimiter(character); 23488 break; 23489 // ( 23490 case 40: 23491 if (type === 41) 23492 delimiter(type); 23493 break; 23494 // \ 23495 case 92: 23496 next(); 23497 break; 23498 } 23499 return position; 23500 } 23501 function commenter(type, index2) { 23502 while (next()) 23503 if (type + character === 47 + 10) 23504 break; 23505 else if (type + character === 42 + 42 && peek() === 47) 23506 break; 23507 return "/*" + slice(index2, position - 1) + "*" + from(type === 47 ? type : next()); 23508 } 23509 function identifier(index2) { 23510 while (!token(peek())) 23511 next(); 23512 return slice(index2, position); 23513 } 23514 function compile$1(value) { 23515 return dealloc(parse$2("", null, null, null, [""], value = alloc(value), 0, [0], value)); 23516 } 23517 function parse$2(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) { 23518 var index2 = 0; 23519 var offset2 = 0; 23520 var length2 = pseudo; 23521 var atrule = 0; 23522 var property2 = 0; 23523 var previous = 0; 23524 var variable = 1; 23525 var scanning = 1; 23526 var ampersand = 1; 23527 var character2 = 0; 23528 var type = ""; 23529 var props = rules; 23530 var children = rulesets; 23531 var reference = rule; 23532 var characters2 = type; 23533 while (scanning) 23534 switch (previous = character2, character2 = next()) { 23535 // ( 23536 case 40: 23537 if (previous != 108 && charat(characters2, length2 - 1) == 58) { 23538 if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index2 ? points[index2 - 1] : 0)) != -1) 23539 ampersand = -1; 23540 break; 23541 } 23542 // " ' [ 23543 case 34: 23544 case 39: 23545 case 91: 23546 characters2 += delimit(character2); 23547 break; 23548 // \t \n \r \s 23549 case 9: 23550 case 10: 23551 case 13: 23552 case 32: 23553 characters2 += whitespace(previous); 23554 break; 23555 // \ 23556 case 92: 23557 characters2 += escaping(caret() - 1, 7); 23558 continue; 23559 // / 23560 case 47: 23561 switch (peek()) { 23562 case 42: 23563 case 47: 23564 append(comment(commenter(next(), caret()), root2, parent, declarations), declarations); 23565 break; 23566 default: 23567 characters2 += "/"; 23568 } 23569 break; 23570 // { 23571 case 123 * variable: 23572 points[index2++] = strlen(characters2) * ampersand; 23573 // } ; \0 23574 case 125 * variable: 23575 case 59: 23576 case 0: 23577 switch (character2) { 23578 // \0 } 23579 case 0: 23580 case 125: 23581 scanning = 0; 23582 // ; 23583 case 59 + offset2: 23584 if (ampersand == -1) characters2 = replace(characters2, /\f/g, ""); 23585 if (property2 > 0 && strlen(characters2) - length2) 23586 append(property2 >
vendor: 10,273 bytes, lines 23586-23818
23586 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations); 23587 break; 23588 // @ ; 23589 case 59: 23590 characters2 += ";"; 23591 // { rule/at-rule 23592 default: 23593 append(reference = ruleset(characters2, root2, parent, index2, offset2, rules, points, type, props = [], children = [], length2, rulesets), rulesets); 23594 if (character2 === 123) 23595 if (offset2 === 0) 23596 parse$2(characters2, root2, reference, reference, props, rulesets, length2, points, children); 23597 else 23598 switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) { 23599 // d l m s 23600 case 100: 23601 case 108: 23602 case 109: 23603 case 115: 23604 parse$2(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2, children), children), rules, children, length2, points, rule ? props : children); 23605 break; 23606 default: 23607 parse$2(characters2, reference, reference, reference, [""], children, 0, points, children); 23608 } 23609 } 23610 index2 = offset2 = property2 = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo; 23611 break; 23612 // : 23613 case 58: 23614 length2 = 1 + strlen(characters2), property2 = previous; 23615 default: 23616 if (variable < 1) { 23617 if (character2 == 123) 23618 --variable; 23619 else if (character2 == 125 && variable++ == 0 && prev() == 125) 23620 continue; 23621 } 23622 switch (characters2 += from(character2), character2 * variable) { 23623 // & 23624 case 38: 23625 ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1); 23626 break; 23627 // , 23628 case 44: 23629 points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1; 23630 break; 23631 // @ 23632 case 64: 23633 if (peek() === 45) 23634 characters2 += delimit(next()); 23635 atrule = peek(), offset2 = length2 = strlen(type = characters2 += identifier(caret())), character2++; 23636 break; 23637 // - 23638 case 45: 23639 if (previous === 45 && strlen(characters2) == 2) 23640 variable = 0; 23641 } 23642 } 23643 return rulesets; 23644 } 23645 function ruleset(value, root2, parent, index2, offset2, rules, points, type, props, children, length2, siblings) { 23646 var post = offset2 - 1; 23647 var rule = offset2 === 0 ? rules : [""]; 23648 var size = sizeof(rule); 23649 for (var i2 = 0, j2 = 0, k2 = 0; i2 < index2; ++i2) 23650 for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i2])), z2 = value; x2 < size; ++x2) 23651 if (z2 = trim$1(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) 23652 props[k2++] = z2; 23653 return node(value, root2, parent, offset2 === 0 ? RULESET : type, props, children, length2, siblings); 23654 } 23655 function comment(value, root2, parent, siblings) { 23656 return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings); 23657 } 23658 function declaration(value, root2, parent, length2, siblings) { 23659 return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings); 23660 } 23661 function prefix(value, length2, children) { 23662 switch (hash(value, length2)) { 23663 // color-adjust 23664 case 5103: 23665 return WEBKIT + "print-" + value + value; 23666 // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) 23667 case 5737: 23668 case 4201: 23669 case 3177: 23670 case 3433: 23671 case 1641: 23672 case 4457: 23673 case 2921: 23674 // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break 23675 case 5572: 23676 case 6356: 23677 case 5844: 23678 case 3191: 23679 case 6645: 23680 case 3005: 23681 // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, 23682 case 6391: 23683 case 5879: 23684 case 5623: 23685 case 6135: 23686 case 4599: 23687 case 4855: 23688 // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) 23689 case 4215: 23690 case 6389: 23691 case 5109: 23692 case 5365: 23693 case 5621: 23694 case 3829: 23695 return WEBKIT + value + value; 23696 // tab-size 23697 case 4789: 23698 return MOZ + value + value; 23699 // appearance, user-select, transform, hyphens, text-size-adjust 23700 case 5349: 23701 case 4246: 23702 case 4810: 23703 case 6968: 23704 case 2756: 23705 return WEBKIT + value + MOZ + value + MS + value + value; 23706 // writing-mode 23707 case 5936: 23708 switch (charat(value, length2 + 11)) { 23709 // vertical-l(r) 23710 case 114: 23711 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value; 23712 // vertical-r(l) 23713 case 108: 23714 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value; 23715 // horizontal(-)tb 23716 case 45: 23717 return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value; 23718 } 23719 // flex, flex-direction, scroll-snap-type, writing-mode 23720 case 6828: 23721 case 4268: 23722 case 2903: 23723 return WEBKIT + value + MS + value + value; 23724 // order 23725 case 6165: 23726 return WEBKIT + value + MS + "flex-" + value + value; 23727 // align-items 23728 case 5187: 23729 return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value; 23730 // align-self 23731 case 5443: 23732 return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match$1(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value; 23733 // align-content 23734 case 4675: 23735 return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value; 23736 // flex-shrink 23737 case 5548: 23738 return WEBKIT + value + MS + replace(value, "shrink", "negative") + value; 23739 // flex-basis 23740 case 5292: 23741 return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value; 23742 // flex-grow 23743 case 6060: 23744 return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value; 23745 // transition 23746 case 4554: 23747 return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value; 23748 // cursor 23749 case 6187: 23750 return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value; 23751 // background, background-image 23752 case 5495: 23753 case 3959: 23754 return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1"); 23755 // justify-content 23756 case 4968: 23757 return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value; 23758 // justify-self 23759 case 4200: 23760 if (!match$1(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value; 23761 break; 23762 // grid-template-(columns|rows) 23763 case 2592: 23764 case 3360: 23765 return MS + replace(value, "template-", "") + value; 23766 // grid-(row|column)-start 23767 case 4384: 23768 case 3616: 23769 if (children && children.some(function(element, index2) { 23770 return length2 = index2, match$1(element.props, /grid-\w+-end/); 23771 })) { 23772 return ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match$1(children, /\d+/) : +match$1(children, /\d+/) - +match$1(value, /\d+/)) + ";"; 23773 } 23774 return MS + replace(value, "-start", "") + value; 23775 // grid-(row|column)-end 23776 case 4896: 23777 case 4128: 23778 return children && children.some(function(element) { 23779 return match$1(element.props, /grid-\w+-start/); 23780 }) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value; 23781 // (margin|padding)-inline-(start|end) 23782 case 4095: 23783 case 3583: 23784 case 4068: 23785 case 2532: 23786 return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value; 23787 // (min|max)?(width|height|inline-size|block-size) 23788 case 8116: 23789 case 7059: 23790 case 5753: 23791 case 5535: 23792 case 5445: 23793 case 5701: 23794 case 4933: 23795 case 4677: 23796 case 5533: 23797 case 5789: 23798 case 5021: 23799 case 4765: 23800 if (strlen(value) - 1 - length2 > 6) 23801 switch (charat(value, length2 + 1)) { 23802 // (m)ax-content, (m)in-content 23803 case 109: 23804 if (charat(value, length2 + 4) !== 45) 23805 break; 23806 // (f)ill-available, (f)it-content 23807 case 102: 23808 return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value; 23809 // (s)tretch 23810 case 115: 23811 return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value; 23812 } 23813 break; 23814 // grid-(column|row) 23815 case 5152: 23816 case 5920: 23817 return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a2, b2, c2, d2, e2, f2) { 23818 return MS + a2 + ":" + b2 + f2 + (c2 ? MS + a2 + "-sp
23818an:" + (d2 ? e2 : +e2 - +b2) + f2 : "") + value; 23819 }); 23820 // position: sticky 23821 case 4949: 23822 if (charat(value, length2 + 6) === 121) 23823 return replace(value, ":", ":" + WEBKIT) + value; 23824 break; 23825 // display: (flex|inline-flex|grid|inline-grid) 23826 case 6444: 23827 switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) { 23828 // (inline-)?fle(x) 23829 case 120: 23830 return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value; 23831 // (inline-)?gri(d) 23832 case 100: 23833 return replace(value, ":", ":" + MS) + value; 23834 } 23835 break; 23836 // scroll-margin, scroll-margin-(top|right|bottom|left) 23837 case 5719: 23838 case 2647: 23839 case 2135: 23840 case 3927: 23841 case 2391: 23842 return replace(value, "scroll-", "scroll-snap-") + value; 23843 } 23844 return value; 23845 } 23846 function serialize(children, callback) { 23847 var output = ""; 23848 for (var i2 = 0; i2 < children.length; i2++) 23849 output += callback(children[i2], i2, children, callback) || ""; 23850 return output; 23851 } 23852 function stringify(element, index2, children, callback) { 23853 switch (element.type) { 23854 case LAYER: 23855 if (element.children.length) break; 23856 case IMPORT: 23857 case DECLARATION: 23858 return element.return = element.return || element.value; 23859 case COMMENT: 23860 return ""; 23861 case KEYFRAMES: 23862 return element.return = element.value + "{" + serialize(element.children, callback) + "}"; 23863 case RULESET: 23864 if (!strlen(element.value = element.props.join(","))) return ""; 23865 } 23866 return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : ""; 23867 } 23868 function middleware(collection) { 23869 var length2 = sizeof(collection); 23870 return function(element, index2, children, callback) { 23871 var output = ""; 23872 for (var i2 = 0; i2 < length2; i2++) 23873 output += collection[i2](element, index2, children, callback) || ""; 23874 return output; 23875 }; 23876 } 23877 function rulesheet(callback) { 23878 return function(element) { 23879 if (!element.root) { 23880 if (element = element.return) 23881 callback(element); 23882 } 23883 }; 23884 } 23885 function prefixer(element, index2, children, callback) { 23886 if (element.length > -1) { 23887 if (!element.return) 23888 switch (element.type) { 23889 case DECLARATION: 23890 element.return = prefix(element.value, element.length, children); 23891 return; 23892 case KEYFRAMES: 23893 return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback); 23894 case RULESET: 23895 if (element.length) 23896 return combine(children = element.props, function(value) { 23897 switch (match$1(value, callback = /(::plac\w+|:read-\w+)/)) { 23898 // :read-(only|write) 23899 case ":read-only": 23900 case ":read-write": 23901 lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })); 23902 lift(copy(element, { props: [value] })); 23903 assign$1(element, { props: filter$1(children, callback) }); 23904 break; 23905 // :placeholder 23906 case "::placeholder": 23907 lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] })); 23908 lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] })); 23909 lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })); 23910 lift(copy(element, { props: [value] })); 23911 assign$1(element, { props: filter$1(children, callback) }); 23912 break; 23913 } 23914 return ""; 23915 }); 23916 } 23917 } 23918 } 23919 var unitlessKeys = { 23920 animationIterationCount: 1, 23921 aspectRatio: 1, 23922 borderImageOutset: 1, 23923 borderImageSlice: 1, 23924 borderImageWidth: 1, 23925 boxFlex: 1, 23926 boxFlexGroup: 1, 23927 boxOrdinalGroup: 1, 23928 columnCount: 1, 23929 columns: 1, 23930 flex: 1, 23931 flexGrow: 1, 23932 flexPositive: 1, 23933 flexShrink: 1, 23934 flexNegative: 1, 23935 flexOrder: 1, 23936 gridRow: 1, 23937 gridRowEnd: 1, 23938 gridRowSpan: 1, 23939 gridRowStart: 1, 23940 gridColumn: 1, 23941 gridColumnEnd: 1, 23942 gridColumnSpan: 1, 23943 gridColumnStart: 1, 23944 msGridRow: 1, 23945 msGridRowSpan: 1, 23946 msGridColumn: 1, 23947 msGridColumnSpan: 1, 23948 fontWeight: 1, 23949 lineHeight: 1, 23950 opacity: 1, 23951 order: 1, 23952 orphans: 1, 23953 tabSize: 1, 23954 widows: 1, 23955 zIndex: 1, 23956 zoom: 1, 23957 WebkitLineClamp: 1, 23958 // SVG-related properties 23959 fillOpacity: 1, 23960 floodOpacity: 1, 23961 stopOpacity: 1, 23962 strokeDasharray: 1, 23963 strokeDashoffset: 1, 23964 strokeMiterlimit: 1, 23965 strokeOpacity: 1, 23966 strokeWidth: 1 23967 }; 23968 var define_process_env_default = {}; 23969 var f$5 = "undefined" != typeof process && void 0 !== define_process_env_default && (define_process_env_default.REACT_APP_SC_ATTR || define_process_env_default.SC_ATTR) || "data-styled", m$4 = "active", y$5 = "data-styled-version", v$5 = "6.1.17", g$3 = "/*!sc*/\n", S$2 = "undefined" != typeof window && "HTMLElement" in window, w$7 = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== define_process_env_default && void 0 !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && "" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== define_process_env_default && void 0 !== define_process_env_default.SC_DISABLE_SPEEDY && "" !== define_process_env_default.SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.SC_DISABLE_SPEEDY && define_process_env_default.SC_DISABLE_SPEEDY : false), b$3 = {}, _$4 = Object.freeze([]), C$4 = Object.freeze({}); 23970 function I$3(e2, t2, n2) { 23971 return void 0 === n2 && (n2 = C$4), e2.theme !== n2.theme && e2.theme || t2 || n2.theme; 23972 } 23973 var A$5 = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), O$5 = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, D$5 = /(^-|-$)/g; 23974 function R$5(e2) { 23975 return e2.replace(O$5, "-").replace(D$5, ""); 23976 } 23977 var T$3 = /(a)(d)/gi, k$4 = 52, j$2 = function(e2) { 23978 return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97)); 23979 }; 23980 function x$4(e2) { 23981 var t2, n2 = ""; 23982 for (t2 = Math.abs(e2); t2 > k$4; t2 = t2 / k$4 | 0) n2 = j$2(t2 % k$4) + n2; 23983 return (j$2(t2 % k$4) + n2).replace(T$3, "$1-$2"); 23984 }
vendor: 9,738 bytes, lines 23985-24179
23985 var V$4, F$4 = 5381, M$7 = function(e2, t2) { 23986 for (var n2 = t2.length; n2; ) e2 = 33 * e2 ^ t2.charCodeAt(--n2); 23987 return e2; 23988 }, z$4 = function(e2) { 23989 return M$7(F$4, e2); 23990 }; 23991 function $$6(e2) { 23992 return x$4(z$4(e2) >>> 0); 23993 } 23994 function B$2(e2) { 23995 return e2.displayName || e2.name || "Component"; 23996 } 23997 function L$5(e2) { 23998 return "string" == typeof e2 && true; 23999 } 24000 var G$2 = "function" == typeof Symbol && Symbol.for, Y$2 = G$2 ? Symbol.for("react.memo") : 60115, W$1 = G$2 ? Symbol.for("react.forward_ref") : 60112, q$3 = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }, H$4 = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }, U$4 = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }, J$2 = ((V$4 = {})[W$1] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, V$4[Y$2] = U$4, V$4); 24001 function X$1(e2) { 24002 return ("type" in (t2 = e2) && t2.type.$$typeof) === Y$2 ? U$4 : "$$typeof" in e2 ? J$2[e2.$$typeof] : q$3; 24003 var t2; 24004 } 24005 var Z$2 = Object.defineProperty, K$3 = Object.getOwnPropertyNames, Q$4 = Object.getOwnPropertySymbols, ee$1 = Object.getOwnPropertyDescriptor, te$1 = Object.getPrototypeOf, ne$1 = Object.prototype; 24006 function oe$1(e2, t2, n2) { 24007 if ("string" != typeof t2) { 24008 if (ne$1) { 24009 var o2 = te$1(t2); 24010 o2 && o2 !== ne$1 && oe$1(e2, o2, n2); 24011 } 24012 var r2 = K$3(t2); 24013 Q$4 && (r2 = r2.concat(Q$4(t2))); 24014 for (var s2 = X$1(e2), i2 = X$1(t2), a2 = 0; a2 < r2.length; ++a2) { 24015 var c2 = r2[a2]; 24016 if (!(c2 in H$4 || n2 && n2[c2] || i2 && c2 in i2 || s2 && c2 in s2)) { 24017 var l2 = ee$1(t2, c2); 24018 try { 24019 Z$2(e2, c2, l2); 24020 } catch (e3) { 24021 } 24022 } 24023 } 24024 } 24025 return e2; 24026 } 24027 function re$1(e2) { 24028 return "function" == typeof e2; 24029 } 24030 function se$1(e2) { 24031 return "object" == typeof e2 && "styledComponentId" in e2; 24032 } 24033 function ie$1(e2, t2) { 24034 return e2 && t2 ? "".concat(e2, " ").concat(t2) : e2 || t2 || ""; 24035 } 24036 function ae$1(e2, t2) { 24037 if (0 === e2.length) return ""; 24038 for (var n2 = e2[0], o2 = 1; o2 < e2.length; o2++) n2 += e2[o2]; 24039 return n2; 24040 } 24041 function ce$1(e2) { 24042 return null !== e2 && "object" == typeof e2 && e2.constructor.name === Object.name && !("props" in e2 && e2.$$typeof); 24043 } 24044 function le$1(e2, t2, n2) { 24045 if (void 0 === n2 && (n2 = false), !n2 && !ce$1(e2) && !Array.isArray(e2)) return t2; 24046 if (Array.isArray(t2)) for (var o2 = 0; o2 < t2.length; o2++) e2[o2] = le$1(e2[o2], t2[o2]); 24047 else if (ce$1(t2)) for (var o2 in t2) e2[o2] = le$1(e2[o2], t2[o2]); 24048 return e2; 24049 } 24050 function ue$1(e2, t2) { 24051 Object.defineProperty(e2, "toString", { value: t2 }); 24052 } 24053 function he$2(t2) { 24054 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24055 return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t2, " for more information.").concat(n2.length > 0 ? " Args: ".concat(n2.join(", ")) : "")); 24056 } 24057 var fe$3 = (function() { 24058 function e2(e3) { 24059 this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3; 24060 } 24061 return e2.prototype.indexOfGroup = function(e3) { 24062 for (var t2 = 0, n2 = 0; n2 < e3; n2++) t2 += this.groupSizes[n2]; 24063 return t2; 24064 }, e2.prototype.insertRules = function(e3, t2) { 24065 if (e3 >= this.groupSizes.length) { 24066 for (var n2 = this.groupSizes, o2 = n2.length, r2 = o2; e3 >= r2; ) if ((r2 <<= 1) < 0) throw he$2(16, "".concat(e3)); 24067 this.groupSizes = new Uint32Array(r2), this.groupSizes.set(n2), this.length = r2; 24068 for (var s2 = o2; s2 < r2; s2++) this.groupSizes[s2] = 0; 24069 } 24070 for (var i2 = this.indexOfGroup(e3 + 1), a2 = (s2 = 0, t2.length); s2 < a2; s2++) this.tag.insertRule(i2, t2[s2]) && (this.groupSizes[e3]++, i2++); 24071 }, e2.prototype.clearGroup = function(e3) { 24072 if (e3 < this.length) { 24073 var t2 = this.groupSizes[e3], n2 = this.indexOfGroup(e3), o2 = n2 + t2; 24074 this.groupSizes[e3] = 0; 24075 for (var r2 = n2; r2 < o2; r2++) this.tag.deleteRule(n2); 24076 } 24077 }, e2.prototype.getGroup = function(e3) { 24078 var t2 = ""; 24079 if (e3 >= this.length || 0 === this.groupSizes[e3]) return t2; 24080 for (var n2 = this.groupSizes[e3], o2 = this.indexOfGroup(e3), r2 = o2 + n2, s2 = o2; s2 < r2; s2++) t2 += "".concat(this.tag.getRule(s2)).concat(g$3); 24081 return t2; 24082 }, e2; 24083 })(), ye$2 = /* @__PURE__ */ new Map(), ve$2 = /* @__PURE__ */ new Map(), ge$2 = 1, Se$2 = function(e2) { 24084 if (ye$2.has(e2)) return ye$2.get(e2); 24085 for (; ve$2.has(ge$2); ) ge$2++; 24086 var t2 = ge$2++; 24087 return ye$2.set(e2, t2), ve$2.set(t2, e2), t2; 24088 }, we$2 = function(e2, t2) { 24089 ge$2 = t2 + 1, ye$2.set(e2, t2), ve$2.set(t2, e2); 24090 }, be$2 = "style[".concat(f$5, "][").concat(y$5, '="').concat(v$5, '"]'), Ee$2 = new RegExp("^".concat(f$5, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne$2 = function(e2, t2, n2) { 24091 for (var o2, r2 = n2.split(","), s2 = 0, i2 = r2.length; s2 < i2; s2++) (o2 = r2[s2]) && e2.registerName(t2, o2); 24092 }, Pe$2 = function(e2, t2) { 24093 for (var n2, o2 = (null !== (n2 = t2.textContent) && void 0 !== n2 ? n2 : "").split(g$3), r2 = [], s2 = 0, i2 = o2.length; s2 < i2; s2++) { 24094 var a2 = o2[s2].trim(); 24095 if (a2) { 24096 var c2 = a2.match(Ee$2); 24097 if (c2) { 24098 var l2 = 0 | parseInt(c2[1], 10), u2 = c2[2]; 24099 0 !== l2 && (we$2(u2, l2), Ne$2(e2, u2, c2[3]), e2.getTag().insertRules(l2, r2)), r2.length = 0; 24100 } else r2.push(a2); 24101 } 24102 } 24103 }, _e$2 = function(e2) { 24104 for (var t2 = document.querySelectorAll(be$2), n2 = 0, o2 = t2.length; n2 < o2; n2++) { 24105 var r2 = t2[n2]; 24106 r2 && r2.getAttribute(f$5) !== m$4 && (Pe$2(e2, r2), r2.parentNode && r2.parentNode.removeChild(r2)); 24107 } 24108 }; 24109 function Ce$2() { 24110 return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null; 24111 } 24112 var Ie$2 = function(e2) { 24113 var t2 = document.head, n2 = e2 || t2, o2 = document.createElement("style"), r2 = (function(e3) { 24114 var t3 = Array.from(e3.querySelectorAll("style[".concat(f$5, "]"))); 24115 return t3[t3.length - 1]; 24116 })(n2), s2 = void 0 !== r2 ? r2.nextSibling : null; 24117 o2.setAttribute(f$5, m$4), o2.setAttribute(y$5, v$5); 24118 var i2 = Ce$2(); 24119 return i2 && o2.setAttribute("nonce", i2), n2.insertBefore(o2, s2), o2; 24120 }, Ae$2 = (function() { 24121 function e2(e3) { 24122 this.element = Ie$2(e3), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e4) { 24123 if (e4.sheet) return e4.sheet; 24124 for (var t2 = document.styleSheets, n2 = 0, o2 = t2.length; n2 < o2; n2++) { 24125 var r2 = t2[n2]; 24126 if (r2.ownerNode === e4) return r2; 24127 } 24128 throw he$2(17); 24129 })(this.element), this.length = 0; 24130 } 24131 return e2.prototype.insertRule = function(e3, t2) { 24132 try { 24133 return this.sheet.insertRule(t2, e3), this.length++, true; 24134 } catch (e4) { 24135 return false; 24136 } 24137 }, e2.prototype.deleteRule = function(e3) { 24138 this.sheet.deleteRule(e3), this.length--; 24139 }, e2.prototype.getRule = function(e3) { 24140 var t2 = this.sheet.cssRules[e3]; 24141 return t2 && t2.cssText ? t2.cssText : ""; 24142 }, e2; 24143 })(), Oe$2 = (function() { 24144 function e2(e3) { 24145 this.element = Ie$2(e3), this.nodes = this.element.childNodes, this.length = 0; 24146 } 24147 return e2.prototype.insertRule = function(e3, t2) { 24148 if (e3 <= this.length && e3 >= 0) { 24149 var n2 = document.createTextNode(t2); 24150 return this.element.insertBefore(n2, this.nodes[e3] || null), this.length++, true; 24151 } 24152 return false; 24153 }, e2.prototype.deleteRule = function(e3) { 24154 this.element.removeChild(this.nodes[e3]), this.length--; 24155 }, e2.prototype.getRule = function(e3) { 24156 return e3 < this.length ? this.nodes[e3].textContent : ""; 24157 }, e2; 24158 })(), De$2 = (function() { 24159 function e2(e3) { 24160 this.rules = [], this.length = 0; 24161 } 24162 return e2.prototype.insertRule = function(e3, t2) { 24163 return e3 <= this.length && (this.rules.splice(e3, 0, t2), this.length++, true); 24164 }, e2.prototype.deleteRule = function(e3) { 24165 this.rules.splice(e3, 1), this.length--; 24166 }, e2.prototype.getRule = function(e3) { 24167 return e3 < this.length ? this.rules[e3] : ""; 24168 }, e2; 24169 })(), Re$2 = S$2, Te$2 = { isServer: !S$2, useCSSOMInjection: !w$7 }, ke$2 = (function() { 24170 function e2(e3, n2, o2) { 24171 void 0 === e3 && (e3 = C$4), void 0 === n2 && (n2 = {}); 24172 var r2 = this; 24173 this.options = __assign$3(__assign$3({}, Te$2), e3), this.gs = n2, this.names = new Map(o2), this.server = !!e3.isServer, !this.server && S$2 && Re$2 && (Re$2 = false, _e$2(this)), ue$1(this, function() { 24174 return (function(e4) { 24175 for (var t2 = e4.getTag(), n3 = t2.length, o3 = "", r3 = function(n4) { 24176 var r4 = (function(e5) { 24177 return ve$2.get(e5); 24178 })(n4); 24179 if (void 0 === r4) return "continue";
24180 var s3 = e4.names.get(r4), i2 = t2.getGroup(n4); 24181 if (void 0 === s3 || !s3.size || 0 === i2.length) return "continue"; 24182 var a2 = "".concat(f$5, ".g").concat(n4, '[id="').concat(r4, '"]'), c2 = ""; 24183 void 0 !== s3 && s3.forEach(function(e5) { 24184 e5.length > 0 && (c2 += "".concat(e5, ",")); 24185 }), o3 += "".concat(i2).concat(a2, '{content:"').concat(c2, '"}').concat(g$3); 24186 }, s2 = 0; s2 < n3; s2++) r3(s2); 24187 return o3; 24188 })(r2); 24189 }); 24190 } 24191 return e2.registerId = function(e3) { 24192 return Se$2(e3); 24193 }, e2.prototype.rehydrate = function() { 24194 !this.server && S$2 && _e$2(this); 24195 }, e2.prototype.reconstructWithOptions = function(n2, o2) { 24196 return void 0 === o2 && (o2 = true), new e2(__assign$3(__assign$3({}, this.options), n2), this.gs, o2 && this.names || void 0); 24197 }, e2.prototype.allocateGSInstance = function(e3) { 24198 return this.gs[e3] = (this.gs[e3] || 0) + 1; 24199 }, e2.prototype.getTag = function() { 24200 return this.tag || (this.tag = (e3 = (function(e4) { 24201 var t2 = e4.useCSSOMInjection, n2 = e4.target; 24202 return e4.isServer ? new De$2(n2) : t2 ? new Ae$2(n2) : new Oe$2(n2); 24203 })(this.options), new fe$3(e3))); 24204 var e3; 24205 }, e2.prototype.hasNameForId = function(e3, t2) { 24206 return this.names.has(e3) && this.names.get(e3).has(t2); 24207 }, e2.prototype.registerName = function(e3, t2) { 24208 if (Se$2(e3), this.names.has(e3)) this.names.get(e3).add(t2); 24209 else { 24210 var n2 = /* @__PURE__ */ new Set(); 24211 n2.add(t2), this.names.set(e3, n2); 24212 } 24213 }, e2.prototype.insertRules = function(e3, t2, n2) { 24214 this.registerName(e3, t2), this.getTag().insertRules(Se$2(e3), n2); 24215 }, e2.prototype.clearNames = function(e3) { 24216 this.names.has(e3) && this.names.get(e3).clear(); 24217 }, e2.prototype.clearRules = function(e3) { 24218 this.getTag().clearGroup(Se$2(e3)), this.clearNames(e3); 24219 }, e2.prototype.clearTag = function() { 24220 this.tag = void 0; 24221 }, e2; 24222 })(), je$2 = /&/g, xe$2 = /^\s*\/\/.*$/gm; 24223 function Ve$2(e2, t2) { 24224 return e2.map(function(e3) { 24225 return "rule" === e3.type && (e3.value = "".concat(t2, " ").concat(e3.value), e3.value = e3.value.replaceAll(",", ",".concat(t2, " ")), e3.props = e3.props.map(function(e4) { 24226 return "".concat(t2, " ").concat(e4); 24227 })), Array.isArray(e3.children) && "@keyframes" !== e3.type && (e3.children = Ve$2(e3.children, t2)), e3; 24228 }); 24229 } 24230 function Fe$3(e2) { 24231 var t2, n2, o2, r2 = C$4, s2 = r2.options, i2 = void 0 === s2 ? C$4 : s2, a2 = r2.plugins, c2 = void 0 === a2 ? _$4 : a2, l2 = function(e3, o3, r3) { 24232 return r3.startsWith(n2) && r3.endsWith(n2) && r3.replaceAll(n2, "").length > 0 ? ".".concat(t2) : e3; 24233 }, u2 = c2.slice(); 24234 u2.push(function(e3) { 24235 e3.type === RULESET && e3.value.includes("&") && (e3.props[0] = e3.props[0].replace(je$2, n2).replace(o2, l2)); 24236 }), i2.prefix && u2.push(prefixer), u2.push(stringify); 24237 var p2 = function(e3, r3, s3, a3) { 24238 void 0 === r3 && (r3 = ""), void 0 === s3 && (s3 = ""), void 0 === a3 && (a3 = "&"), t2 = a3, n2 = r3, o2 = new RegExp("\\".concat(n2, "\\b"), "g"); 24239 var c3 = e3.replace(xe$2, ""), l3 = compile$1(s3 || r3 ? "".concat(s3, " ").concat(r3, " { ").concat(c3, " }") : c3); 24240 i2.namespace && (l3 = Ve$2(l3, i2.namespace)); 24241 var p3 = []; 24242 return serialize(l3, middleware(u2.concat(rulesheet(function(e4) { 24243 return p3.push(e4); 24244 })))), p3; 24245 }; 24246 return p2.hash = c2.length ? c2.reduce(function(e3, t3) { 24247 return t3.name || he$2(15), M$7(e3, t3.name); 24248 }, F$4).toString() : "", p2; 24249 } 24250 var Me$2 = new ke$2(), ze$2 = Fe$3(), $e$2 = e$3.createContext({ shouldForwardProp: void 0, styleSheet: Me$2, stylis: ze$2 }); 24251 $e$2.Consumer; 24252 e$3.createContext(void 0); 24253 function Ge$2() { 24254 return reactExports.useContext($e$2); 24255 } 24256 var We$2 = (function() { 24257 function e2(e3, t2) { 24258 var n2 = this; 24259 this.inject = function(e4, t3) { 24260 void 0 === t3 && (t3 = ze$2); 24261 var o2 = n2.name + t3.hash; 24262 e4.hasNameForId(n2.id, o2) || e4.insertRules(n2.id, o2, t3(n2.rules, o2, "@keyframes")); 24263 }, this.name = e3, this.id = "sc-keyframes-".concat(e3), this.rules = t2, ue$1(this, function() { 24264 throw he$2(12, String(n2.name)); 24265 }); 24266 } 24267 return e2.prototype.getName = function(e3) { 24268 return void 0 === e3 && (e3 = ze$2), this.name + e3.hash; 24269 }, e2; 24270 })(), qe$2 = function(e2) { 24271 return e2 >= "A" && e2 <= "Z"; 24272 }; 24273 function He$2(e2) { 24274 for (var t2 = "", n2 = 0; n2 < e2.length; n2++) { 24275 var o2 = e2[n2]; 24276 if (1 === n2 && "-" === o2 && "-" === e2[0]) return e2; 24277 qe$2(o2) ? t2 += "-" + o2.toLowerCase() : t2 += o2; 24278 } 24279 return t2.startsWith("ms-") ? "-" + t2 : t2; 24280 } 24281 var Ue$2 = function(e2) { 24282 return null == e2 || false === e2 || "" === e2; 24283 }, Je$2 = function(t2) { 24284 var n2, o2, r2 = []; 24285 for (var s2 in t2) { 24286 var i2 = t2[s2]; 24287 t2.hasOwnProperty(s2) && !Ue$2(i2) && (Array.isArray(i2) && i2.isCss || re$1(i2) ? r2.push("".concat(He$2(s2), ":"), i2, ";") : ce$1(i2) ? r2.push.apply(r2, __spreadArray$1(__spreadArray$1(["".concat(s2, " {")], Je$2(i2), false), ["}"], false)) : r2.push("".concat(He$2(s2), ": ").concat((n2 = s2, null == (o2 = i2) || "boolean" == typeof o2 || "" === o2 ? "" : "number" != typeof o2 || 0 === o2 || n2 in unitlessKeys || n2.startsWith("--") ? String(o2).trim() : "".concat(o2, "px")), ";"))); 24288 } 24289 return r2; 24290 }; 24291 function Xe$2(e2, t2, n2, o2) { 24292 if (Ue$2(e2)) return []; 24293 if (se$1(e2)) return [".".concat(e2.styledComponentId)]; 24294 if (re$1(e2)) { 24295 if (!re$1(s2 = e2) || s2.prototype && s2.prototype.isReactComponent || !t2) return [e2]; 24296 var r2 = e2(t2); 24297 return Xe$2(r2, t2, n2, o2); 24298 } 24299 var s2; 24300 return e2 instanceof We$2 ? n2 ? (e2.inject(n2, o2), [e2.getName(o2)]) : [e2] : ce$1(e2) ? Je$2(e2)
24300: Array.isArray(e2) ? Array.prototype.concat.apply(_$4, e2.map(function(e3) { 24301 return Xe$2(e3, t2, n2, o2); 24302 })) : [e2.toString()]; 24303 } 24304 function Ze$2(e2) { 24305 for (var t2 = 0; t2 < e2.length; t2 += 1) { 24306 var n2 = e2[t2]; 24307 if (re$1(n2) && !se$1(n2)) return false; 24308 } 24309 return true; 24310 } 24311 var Ke$2 = z$4(v$5), Qe$1 = (function() { 24312 function e2(e3, t2, n2) { 24313 this.rules = e3, this.staticRulesId = "", this.isStatic = (void 0 === n2 || n2.isStatic) && Ze$2(e3), this.componentId = t2, this.baseHash = M$7(Ke$2, t2), this.baseStyle = n2, ke$2.registerId(t2); 24314 } 24315 return e2.prototype.generateAndInjectStyles = function(e3, t2, n2) { 24316 var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e3, t2, n2) : ""; 24317 if (this.isStatic && !n2.hash) if (this.staticRulesId && t2.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie$1(o2, this.staticRulesId); 24318 else { 24319 var r2 = ae$1(Xe$2(this.rules, e3, t2, n2)), s2 = x$4(M$7(this.baseHash, r2) >>> 0); 24320 if (!t2.hasNameForId(this.componentId, s2)) { 24321 var i2 = n2(r2, ".".concat(s2), void 0, this.componentId); 24322 t2.insertRules(this.componentId, s2, i2); 24323 } 24324 o2 = ie$1(o2, s2), this.staticRulesId = s2; 24325 } 24326 else { 24327 for (var a2 = M$7(this.baseHash, n2.hash), c2 = "", l2 = 0; l2 < this.rules.length; l2++) { 24328 var u2 = this.rules[l2]; 24329 if ("string" == typeof u2) c2 += u2; 24330 else if (u2) { 24331 var p2 = ae$1(Xe$2(u2, e3, t2, n2)); 24332 a2 = M$7(a2, p2 + l2), c2 += p2; 24333 } 24334 } 24335 if (c2) { 24336 var d2 = x$4(a2 >>> 0); 24337 t2.hasNameForId(this.componentId, d2) || t2.insertRules(this.componentId, d2, n2(c2, ".".concat(d2), void 0, this.componentId)), o2 = ie$1(o2, d2); 24338 } 24339 } 24340 return o2; 24341 }, e2; 24342 })(), et$1 = e$3.createContext(void 0); 24343 et$1.Consumer; 24344 var rt$1 = {}; 24345 function it$1(e2, r2, s2) { 24346 var i2 = se$1(e2), a2 = e2, c2 = !L$5(e2), p2 = r2.attrs, d2 = void 0 === p2 ? _$4 : p2, h2 = r2.componentId, f2 = void 0 === h2 ? (function(e3, t2) { 24347 var n2 = "string" != typeof e3 ? "sc" : R$5(e3); 24348 rt$1[n2] = (rt$1[n2] || 0) + 1; 24349 var o2 = "".concat(n2, "-").concat($$6(v$5 + n2 + rt$1[n2])); 24350 return t2 ? "".concat(t2, "-").concat(o2) : o2; 24351 })(r2.displayName, r2.parentComponentId) : h2, m2 = r2.displayName, y2 = void 0 === m2 ? (function(e3) { 24352 return L$5(e3) ? "styled.".concat(e3) : "Styled(".concat(B$2(e3), ")"); 24353 })(e2) : m2, g2 = r2.displayName && r2.componentId ? "".concat(R$5(r2.displayName), "-").concat(r2.componentId) : r2.componentId || f2, S2 = i2 && a2.attrs ? a2.attrs.concat(d2).filter(Boolean) : d2, w2 = r2.shouldForwardProp; 24354 if (i2 && a2.shouldForwardProp) { 24355 var b2 = a2.shouldForwardProp; 24356 if (r2.shouldForwardProp) { 24357 var E2 = r2.shouldForwardProp; 24358 w2 = function(e3, t2) { 24359 return b2(e3, t2) && E2(e3, t2); 24360 }; 24361 } else w2 = b2; 24362 } 24363 var N2 = new Qe$1(s2, g2, i2 ? a2.componentStyle : void 0); 24364 function O2(e3, r3) { 24365 return (function(e4, r4, s3) { 24366 var i3 = e4.attrs, a3 = e4.componentStyle, c3 = e4.defaultProps, p3 = e4.foldedComponentIds, d3 = e4.styledComponentId, h3 = e4.target, f3 = e$3.useContext(et$1), m3 = Ge$2(), y3 = e4.shouldForwardProp || m3.shouldForwardProp; 24367 var v2 = I$3(r4, f3, c3) || C$4, g3 = (function(e5, n2, o2) { 24368 for (var r5, s4 = __assign$3(__assign$3({}, n2), { className: void 0, theme: o2 }), i4 = 0; i4 < e5.length; i4 += 1) { 24369 var a4 = re$1(r5 = e5[i4]) ? r5(s4) : r5; 24370 for (var c4 in a4) s4[c4] = "className" === c4 ? ie$1(s4[c4], a4[c4]) : "style" === c4 ? __assign$3(__assign$3({}, s4[c4]), a4[c4]) : a4[c4]; 24371 } 24372 return n2.className && (s4.className = ie$1(s4.className, n2.className)), s4; 24373 })(i3, r4, v2), S3 = g3.as || h3, w3 = {}; 24374 for (var b3 in g3) void 0 === g3[b3] || "$" === b3[0] || "as" === b3 || "theme" === b3 && g3.theme === v2 || ("forwardedAs" === b3 ? w3.as = g3.forwardedAs : y3 && !y3(b3, S3) || (w3[b3] = g3[b3], y3 || true)); 24375 var E3 = (function(e5, t2) { 24376 var n2 = Ge$2(), o2 = e5.generateAndInjectStyles(t2, n2.styleSheet, n2.stylis); 24377 return o2; 24378 })(a3, g3); 24379 var N3 = ie$1(p3, d3); 24380 return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L$5(S3) && !A$5.has(S3) ? "class" : "className"] = N3, s3 && (w3.ref = s3), reactExports.createElement(S3, w3); 24381 })(D2, e3, r3); 24382 } 24383 O2.displayName = y2; 24384 var D2 = e$3.forwardRef(O2); 24385 return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie$1(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e2, Object.defineProperty(D2, "defaultProps", { get: function() { 24386 return this._foldedDefaultProps; 24387 }, set: function(e3) { 24388 this._foldedDefaultProps = i2 ? (function(e4) { 24389 for (var t2 = [], n2 = 1; n2 < arguments.length; n2++) t2[n2 - 1] = arguments[n2]; 24390 for (var o2 = 0, r3 = t2; o2 < r3.length; o2++) le$1(e4, r3[o2], true); 24391 return e4; 24392 })({}, a2.defaultProps, e3) : e3; 24393 } }), ue$1(D2, function() { 24394 return ".".concat(D2.styledComponentId); 24395 }), c2 && oe$1(D2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true }), D2; 24396 } 24397 function at$1(e2, t2) { 24398 for (var n2 = [e2[0]], o2 = 0, r2 = t2.length; o2 < r2; o2 += 1) n2.push(t2[o2], e2[o2 + 1]); 24399 return n2; 24400 } 24401 var ct$1 = function(e2) { 24402 return Object.assign(e2, { isCss: true }); 24403 }; 24404 function lt$2(t2) { 24405 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24406 if (re$1(t2) || ce$1(t2)) return ct$1(Xe$2(at$1(_$4, __spreadArray$1([t2], n2, true)))); 24407 var r2 = t2; 24408 return 0 === n2.length && 1 === r2.length && "string" == typeof r2[0] ? Xe$2(r2) : ct$1(Xe$2(at$1(r2, n2))); 24409 } 24410 function ut$1(n2, o2, r2) { 24411 if (void 0 === r2 && (r2 = C$4), !o2) throw he$2(1, o2); 24412 var s2 = function(t2) { 24413 for (var s3 = [], i2 = 1; i2 < arguments.length; i2++) s3[i2 - 1] = arguments[i2]; 24414 return n2(o2, r2, lt$2.apply(void 0, __spreadArray$1([t2], s3, false))); 24415 }; 24416 return s2.attrs = function(e2) { 24417 return ut$1(n2, o2, __assign$3(__assign$3({}
24417, r2), { attrs: Array.prototype.concat(r2.attrs, e2).filter(Boolean) })); 24418 }, s2.withConfig = function(e2) { 24419 return ut$1(n2, o2, __assign$3(__assign$3({}, r2), e2)); 24420 }, s2; 24421 } 24422 var pt$2 = function(e2) { 24423 return ut$1(it$1, e2); 24424 }, dt$2 = pt$2; 24425 A$5.forEach(function(e2) { 24426 dt$2[e2] = pt$2(e2); 24427 }); 24428 var ht$3 = (function() { 24429 function e2(e3, t2) { 24430 this.rules = e3, this.componentId = t2, this.isStatic = Ze$2(e3), ke$2.registerId(this.componentId + 1); 24431 } 24432 return e2.prototype.createStyles = function(e3, t2, n2, o2) { 24433 var r2 = o2(ae$1(Xe$2(this.rules, t2, n2, o2)), ""), s2 = this.componentId + e3; 24434 n2.insertRules(s2, s2, r2); 24435 }, e2.prototype.removeStyles = function(e3, t2) { 24436 t2.clearRules(this.componentId + e3); 24437 }, e2.prototype.renderStyles = function(e3, t2, n2, o2) { 24438 e3 > 2 && ke$2.registerId(this.componentId + e3), this.removeStyles(e3, n2), this.createStyles(e3, t2, n2, o2); 24439 }, e2; 24440 })(); 24441 function ft$2(n2) { 24442 for (var r2 = [], s2 = 1; s2 < arguments.length; s2++) r2[s2 - 1] = arguments[s2]; 24443 var i2 = lt$2.apply(void 0, __spreadArray$1([n2], r2, false)), a2 = "sc-global-".concat($$6(JSON.stringify(i2))), c2 = new ht$3(i2, a2); 24444 var l2 = function(e2) { 24445 var t2 = Ge$2(), n3 = e$3.useContext(et$1), r3 = e$3.useRef(t2.styleSheet.allocateGSInstance(a2)).current; 24446 return t2.styleSheet.server && u2(r3, e2, t2.styleSheet, n3, t2.stylis), e$3.useLayoutEffect(function() { 24447 if (!t2.styleSheet.server) return u2(r3, e2, t2.styleSheet, n3, t2.stylis), function() { 24448 return c2.removeStyles(r3, t2.styleSheet); 24449 }; 24450 }, [r3, e2, t2.styleSheet, n3, t2.stylis]), null; 24451 }; 24452 function u2(e2, n3, o2, r3, s3) { 24453 if (c2.isStatic) c2.renderStyles(e2, b$3, o2, s3); 24454 else { 24455 var i3 = __assign$3(__assign$3({}, n3), { theme: I$3(n3, r3, l2.defaultProps) }); 24456 c2.renderStyles(e2, i3, o2, s3); 24457 } 24458 } 24459 return e$3.memo(l2); 24460 } 24461 function mt$2(t2) { 24462 for (var n2 = [], o2 = 1; o2 < arguments.length; o2++) n2[o2 - 1] = arguments[o2]; 24463 var r2 = ae$1(lt$2.apply(void 0, __spreadArray$1([t2], n2, false))), s2 = $$6(r2); 24464 return new We$2(s2, r2); 24465 } 24466 var freeGlobal = typeof global == "object" && global && global.Object === Object && global; 24467 var freeSelf = typeof self == "object" && self && self.Object === Object && self; 24468 var root$1 = freeGlobal || freeSelf || Function("return this")(); 24469 var Symbol$1 = root$1.Symbol; 24470 var objectProto$h = Object.prototype; 24471 var hasOwnProperty$e = objectProto$h.hasOwnProperty; 24472 var nativeObjectToString$1 = objectProto$h.toString; 24473 var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0; 24474 function getRawTag(value) { 24475 var isOwn = hasOwnProperty$e.call(value, symToStringTag$1), tag = value[symToStringTag$1]; 24476 try { 24477 value[symToStringTag$1] = void 0; 24478 var unmasked = true; 24479 } catch (e2) { 24480 } 24481 var result = nativeObjectToString$1.call(value); 24482 if (unmasked) { 24483 if (isOwn) { 24484 value[symToStringTag$1] = tag; 24485 } else { 24486 delete value[symToStringTag$1]; 24487 } 24488 } 24489 return result; 24490 } 24491 var objectProto$g = Object.prototype; 24492 var nativeObjectToString = objectProto$g.toString; 24493 function objectToString$1(value) { 24494 return nativeObjectToString.call(value); 24495 } 24496 var nullTag = "[object Null]", undefinedTag = "[object Undefined]"; 24497 var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0; 24498 function baseGetTag(value) { 24499 if (value == null) { 24500 return value === void 0 ? undefinedTag : nullTag; 24501 } 24502 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$1(value); 24503 } 24504 function isObject$3(value) { 24505 var type = typeof value; 24506 return value != null && (type == "object" || type == "function"); 24507 } 24508 var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]"; 24509 function isFunction$1(value) { 24510 if (!isObject$3(value)) { 24511 return false;
vendor: 5,776 bytes, lines 24512-24684
24512 } 24513 var tag = baseGetTag(value); 24514 return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag; 24515 } 24516 var coreJsData = root$1["__core-js_shared__"]; 24517 var maskSrcKey = (function() { 24518 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); 24519 return uid ? "Symbol(src)_1." + uid : ""; 24520 })(); 24521 function isMasked(func) { 24522 return !!maskSrcKey && maskSrcKey in func; 24523 } 24524 var funcProto$2 = Function.prototype; 24525 var funcToString$2 = funcProto$2.toString; 24526 function toSource(func) { 24527 if (func != null) { 24528 try { 24529 return funcToString$2.call(func); 24530 } catch (e2) { 24531 } 24532 try { 24533 return func + ""; 24534 } catch (e2) { 24535 } 24536 } 24537 return ""; 24538 } 24539 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 24540 var reIsHostCtor = /^\[object .+?Constructor\]$/; 24541 var funcProto$1 = Function.prototype, objectProto$f = Object.prototype; 24542 var funcToString$1 = funcProto$1.toString; 24543 var hasOwnProperty$d = objectProto$f.hasOwnProperty; 24544 var reIsNative = RegExp( 24545 "^" + funcToString$1.call(hasOwnProperty$d).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" 24546 ); 24547 function baseIsNative(value) { 24548 if (!isObject$3(value) || isMasked(value)) { 24549 return false; 24550 } 24551 var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor; 24552 return pattern.test(toSource(value)); 24553 } 24554 function getValue(object2, key) { 24555 return object2 == null ? void 0 : object2[key]; 24556 } 24557 function getNative(object2, key) { 24558 var value = getValue(object2, key); 24559 return baseIsNative(value) ? value : void 0; 24560 } 24561 var nativeCreate = getNative(Object, "create"); 24562 function hashClear() { 24563 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 24564 this.size = 0; 24565 } 24566 function hashDelete(key) { 24567 var result = this.has(key) && delete this.__data__[key]; 24568 this.size -= result ? 1 : 0; 24569 return result; 24570 } 24571 var HASH_UNDEFINED$2 = "__lodash_hash_undefined__"; 24572 var objectProto$e = Object.prototype; 24573 var hasOwnProperty$c = objectProto$e.hasOwnProperty; 24574 function hashGet(key) { 24575 var data = this.__data__; 24576 if (nativeCreate) { 24577 var result = data[key]; 24578 return result === HASH_UNDEFINED$2 ? void 0 : result; 24579 } 24580 return hasOwnProperty$c.call(data, key) ? data[key] : void 0; 24581 } 24582 var objectProto$d = Object.prototype; 24583 var hasOwnProperty$b = objectProto$d.hasOwnProperty; 24584 function hashHas(key) { 24585 var data = this.__data__; 24586 return nativeCreate ? data[key] !== void 0 : hasOwnProperty$b.call(data, key); 24587 } 24588 var HASH_UNDEFINED$1 = "__lodash_hash_undefined__"; 24589 function hashSet(key, value) { 24590 var data = this.__data__; 24591 this.size += this.has(key) ? 0 : 1; 24592 data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value; 24593 return this; 24594 } 24595 function Hash(entries2) { 24596 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24597 this.clear(); 24598 while (++index2 < length2) { 24599 var entry = entries2[index2]; 24600 this.set(entry[0], entry[1]); 24601 } 24602 } 24603 Hash.prototype.clear = hashClear; 24604 Hash.prototype["delete"] = hashDelete; 24605 Hash.prototype.get = hashGet; 24606 Hash.prototype.has = hashHas; 24607 Hash.prototype.set = hashSet; 24608 function listCacheClear() { 24609 this.__data__ = []; 24610 this.size = 0; 24611 } 24612 function eq(value, other) { 24613 return value === other || value !== value && other !== other; 24614 } 24615 function assocIndexOf(array2, key) { 24616 var length2 = array2.length; 24617 while (length2--) { 24618 if (eq(array2[length2][0], key)) { 24619 return length2; 24620 } 24621 } 24622 return -1; 24623 } 24624 var arrayProto = Array.prototype; 24625 var splice = arrayProto.splice; 24626 function listCacheDelete(key) { 24627 var data = this.__data__, index2 = assocIndexOf(data, key); 24628 if (index2 < 0) { 24629 return false; 24630 } 24631 var lastIndex = data.length - 1; 24632 if (index2 == lastIndex) { 24633 data.pop(); 24634 } else { 24635 splice.call(data, index2, 1); 24636 } 24637 --this.size; 24638 return true; 24639 } 24640 function listCacheGet(key) { 24641 var data = this.__data__, index2 = assocIndexOf(data, key); 24642 return index2 < 0 ? void 0 : data[index2][1]; 24643 } 24644 function listCacheHas(key) { 24645 return assocIndexOf(this.__data__, key) > -1; 24646 } 24647 function listCacheSet(key, value) { 24648 var data = this.__data__, index2 = assocIndexOf(data, key); 24649 if (index2 < 0) { 24650 ++this.size; 24651 data.push([key, value]); 24652 } else { 24653 data[index2][1] = value; 24654 } 24655 return this; 24656 } 24657 function ListCache(entries2) { 24658 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24659 this.clear(); 24660 while (++index2 < length2) { 24661 var entry = entries2[index2]; 24662 this.set(entry[0], entry[1]); 24663 } 24664 } 24665 ListCache.prototype.clear = listCacheClear; 24666 ListCache.prototype["delete"] = listCacheDelete; 24667 ListCache.prototype.get = listCacheGet; 24668 ListCache.prototype.has = listCacheHas; 24669 ListCache.prototype.set = listCacheSet; 24670 var Map$1 = getNative(root$1, "Map"); 24671 function mapCacheClear() { 24672 this.size = 0; 24673 this.__data__ = { 24674 "hash": new Hash(), 24675 "map": new (Map$1 || ListCache)(), 24676 "string": new Hash() 24677 }; 24678 } 24679 function isKeyable(value) { 24680 var type = typeof value; 24681 return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; 24682 } 24683 function getMapData(map2, key) { 24684 var data = map2.__data__;
vendor: 6,395 bytes, lines 24685-24895
24685 return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; 24686 } 24687 function mapCacheDelete(key) { 24688 var result = getMapData(this, key)["delete"](key); 24689 this.size -= result ? 1 : 0; 24690 return result; 24691 } 24692 function mapCacheGet(key) { 24693 return getMapData(this, key).get(key); 24694 } 24695 function mapCacheHas(key) { 24696 return getMapData(this, key).has(key); 24697 } 24698 function mapCacheSet(key, value) { 24699 var data = getMapData(this, key), size = data.size; 24700 data.set(key, value); 24701 this.size += data.size == size ? 0 : 1; 24702 return this; 24703 } 24704 function MapCache(entries2) { 24705 var index2 = -1, length2 = entries2 == null ? 0 : entries2.length; 24706 this.clear(); 24707 while (++index2 < length2) { 24708 var entry = entries2[index2]; 24709 this.set(entry[0], entry[1]); 24710 } 24711 } 24712 MapCache.prototype.clear = mapCacheClear; 24713 MapCache.prototype["delete"] = mapCacheDelete; 24714 MapCache.prototype.get = mapCacheGet; 24715 MapCache.prototype.has = mapCacheHas; 24716 MapCache.prototype.set = mapCacheSet; 24717 var HASH_UNDEFINED = "__lodash_hash_undefined__"; 24718 function setCacheAdd(value) { 24719 this.__data__.set(value, HASH_UNDEFINED); 24720 return this; 24721 } 24722 function setCacheHas(value) { 24723 return this.__data__.has(value); 24724 } 24725 function SetCache(values) { 24726 var index2 = -1, length2 = values == null ? 0 : values.length; 24727 this.__data__ = new MapCache(); 24728 while (++index2 < length2) { 24729 this.add(values[index2]); 24730 } 24731 } 24732 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 24733 SetCache.prototype.has = setCacheHas; 24734 function arrayMap(array2, iteratee) { 24735 var index2 = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2); 24736 while (++index2 < length2) { 24737 result[index2] = iteratee(array2[index2], index2, array2); 24738 } 24739 return result; 24740 } 24741 function baseUnary(func) { 24742 return function(value) { 24743 return func(value); 24744 }; 24745 } 24746 function cacheHas(cache, key) { 24747 return cache.has(key); 24748 } 24749 function identity(value) { 24750 return value; 24751 } 24752 function apply$1(func, thisArg, args) { 24753 switch (args.length) { 24754 case 0: 24755 return func.call(thisArg); 24756 case 1: 24757 return func.call(thisArg, args[0]); 24758 case 2: 24759 return func.call(thisArg, args[0], args[1]); 24760 case 3: 24761 return func.call(thisArg, args[0], args[1], args[2]); 24762 } 24763 return func.apply(thisArg, args); 24764 } 24765 var nativeMax = Math.max; 24766 function overRest(func, start, transform2) { 24767 start = nativeMax(start === void 0 ? func.length - 1 : start, 0); 24768 return function() { 24769 var args = arguments, index2 = -1, length2 = nativeMax(args.length - start, 0), array2 = Array(length2); 24770 while (++index2 < length2) { 24771 array2[index2] = args[start + index2]; 24772 } 24773 index2 = -1; 24774 var otherArgs = Array(start + 1); 24775 while (++index2 < start) { 24776 otherArgs[index2] = args[index2]; 24777 } 24778 otherArgs[start] = transform2(array2); 24779 return apply$1(func, this, otherArgs); 24780 }; 24781 } 24782 function constant(value) { 24783 return function() { 24784 return value; 24785 }; 24786 } 24787 var defineProperty = (function() { 24788 try { 24789 var func = getNative(Object, "defineProperty"); 24790 func({}, "", {}); 24791 return func; 24792 } catch (e2) { 24793 } 24794 })(); 24795 var baseSetToString = !defineProperty ? identity : function(func, string2) { 24796 return defineProperty(func, "toString", { 24797 "configurable": true, 24798 "enumerable": false, 24799 "value": constant(string2), 24800 "writable": true 24801 }); 24802 }; 24803 var HOT_COUNT = 800, HOT_SPAN = 16; 24804 var nativeNow = Date.now; 24805 function shortOut(func) { 24806 var count2 = 0, lastCalled = 0; 24807 return function() { 24808 var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); 24809 lastCalled = stamp; 24810 if (remaining > 0) { 24811 if (++count2 >= HOT_COUNT) { 24812 return arguments[0]; 24813 } 24814 } else { 24815 count2 = 0; 24816 } 24817 return func.apply(void 0, arguments); 24818 }; 24819 } 24820 var setToString = shortOut(baseSetToString); 24821 function baseRest(func, start) { 24822 return setToString(overRest(func, start, identity), func + ""); 24823 } 24824 var MAX_SAFE_INTEGER$1 = 9007199254740991; 24825 function isLength(value) { 24826 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1; 24827 } 24828 function isArrayLike(value) { 24829 return value != null && isLength(value.length) && !isFunction$1(value); 24830 } 24831 function isObjectLike(value) { 24832 return value != null && typeof value == "object"; 24833 } 24834 function isArrayLikeObject(value) { 24835 return isObjectLike(value) && isArrayLike(value); 24836 } 24837 const sizeStylesMap$1 = { 24838 small: lt$2` 24839 font-size: var(--font-size-200); 24840 line-height: var(--font-line-height-200); 24841 letter-spacing: var(--font-letter-spacing-looser); 24842 gap: var(--space-150); 24843 `, 24844 medium: lt$2` 24845 font-size: var(--font-size-300); 24846 line-height: var(--font-line-height-300); 24847 letter-spacing: var(--font-letter-spacing-loose); 24848 gap: var(--space-200); 24849 `, 24850 large: lt$2` 24851 font-size: var(--font-size-400); 24852 line-height: var(--font-line-height-400); 24853 letter-spacing: var(--font-letter-spacing-normal); 24854 gap: var(--space-200); 24855 ` 24856 }; 24857 const variantStylesMap = { 24858 primary: lt$2` 24859 color: var(--text-primary); 24860 &:hover, 24861 &:active { 24862 color: var(--text-secondary); 24863 } 24864 `, 24865 secondary: lt$2` 24866 color: var(--text-secondary); 24867 &:hover, 24868 &:active { 24869 color: var(--text-primary); 24870 } 24871 `, 24872 brand: lt$2` 24873 color: var(--text-link); 24874 &:hover, 24875 &:active { 24876 color: var(--text-link-secondary); 24877 } 24878 ` 24879 }; 24880 const Container$v = dt$2.button` 24881 display: inline-flex; 24882 align-items: center; 24883 min-height: 1lh; 24884 text-align: left; 24885 font-family: var(--font-family-body); 24886 font-weight: var(--font-weight-400); 24887 &:is(a, button):not(:disabled) { 24888 cursor: pointer; 24889 } 24890 ${({ $size }) => sizeStylesMap$1[$size]}; 24891 ${({ $variant }) => variantStylesMap[$variant]}; 24892 ${({ $disabled }) => $disabled && lt$2` 24893 opacity: 0.5; 24894 &, 24895 &:is(a, button) {
24896 cursor: not-allowed; 24897 } 24898 `} 24899 & > svg { 24900 flex-shrink: 0; 24901 } 24902`; 24903 const Label$5 = dt$2.span` 24904 text-box: trim-both cap alphabetic; 24905`; 24906 const iconSizeMap$2 = { 24907 small: 12, 24908 medium: 14, 24909 large: 16 24910 }; 24911 const getComponent$3 = ({ to: to2, onClick, disabled }) => { 24912 if (to2 && !disabled) return Link; 24913 if (onClick) return "button"; 24914 return "div"; 24915 }; 24916 const TextButton = ({ 24917 label, 24918 icon: Icon2, 24919 variant = "primary", 24920 size = "medium", 24921 testid = "TextButton", 24922 disabled, 24923 to: to2, 24924 state, 24925 onClick 24926 }) => { 24927 const component = getComponent$3({ to: to2, onClick, disabled }); 24928 const isButton = component === "button"; 24929 const isLink = component === Link; 24930 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 24931 Container$v, 24932 { 24933 as: component, 24934 type: isButton ? "button" : void 0, 24935 disabled: isButton ? disabled : void 0, 24936 "aria-disabled": !isButton && disabled ? true : void 0, 24937 $disabled: disabled, 24938 to: isLink ? to2 : void 0, 24939 state: isLink ? state : void 0, 24940 onClick, 24941 "data-testid": testid, 24942 $size: size, 24943 $variant: variant, 24944 children: [ 24945 Icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { width: iconSizeMap$2[size], height: iconSizeMap$2[size], "aria-hidden": true }),
24946 /* @__PURE__ */ jsxRuntimeExports.jsx(Label$5, { children: label }) 24947 ] 24948 } 24949 ); 24950 }; 24951 var symbolTag$3 = "[object Symbol]"; 24952 function isSymbol(value) { 24953 return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3; 24954 } 24955 var pe$2 = () => { 24956 let e2 = reactExports.useRef(null); 24957 return [e2, () => { 24958 var _a; 24959 (_a = e2.current) == null ? void 0 : _a.focus(); 24960 }]; 24961 }; 24962 var V$3 = class V { 24963 constructor() { 24964 __publicField(this, "setItem", (t2, r2) => { 24965 localStorage.setItem(t2, r2); 24966 }); 24967 __publicField(this, "setObjectItem", (t2, r2) => { 24968 this.setItem(t2, JSON.stringify(r2)); 24969 }); 24970 __publicField(this, "getItem", (t2) => localStorage.getItem(t2)); 24971 __publicField(this, "getObjectItem", (t2) => { 24972 try { 24973 return JSON.parse(this.getItem(t2) || ""); 24974 } catch (e2) { 24975 return; 24976 } 24977 }); 24978 __publicField(this, "removeItem", (t2) => { 24979 localStorage.removeItem(t2); 24980 }); 24981 } 24982 }, L$4 = new V$3(), H$3 = (e2) => ({ localStorage: reactExports.useMemo(() => ({ get: (r2) => { 24983 let o2 = L$4.getObjectItem(e2); 24984 return o2 ? o2[r2] : void 0; 24985 }, set: (r2, o2) => { 24986 let s2 = L$4.getObjectItem(e2); 24987 return L$4.setObjectItem(e2, __spreadProps(__spreadValues({}, s2), { [r2]: o2 })); 24988 }, clear: () => { 24989 L$4.removeItem(e2); 24990 } }), [e2]) }); 24991 function baseAssignValue(object2, key, value) { 24992 if (key == "__proto__" && defineProperty) { 24993 defineProperty(object2, key, { 24994 "configurable": true, 24995 "enumerable": true, 24996 "value": value, 24997 "writable": true 24998 }); 24999 } else { 25000 object2[key] = value; 25001 } 25002 } 25003 function createBaseFor(fromRight) { 25004 return function(object2, iteratee, keysFunc) { 25005 var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length; 25006 while (length2--) { 25007 var key = props[++index2]; 25008 if (iteratee(iterable[key], key, iterable) === false) { 25009 break; 25010 } 25011 } 25012 return object2; 25013 }; 25014 } 25015 var baseFor = createBaseFor(); 25016 function baseTimes(n2, iteratee) { 25017 var index2 = -1, result = Array(n2); 25018 while (++index2 < n2) { 25019 result[index2] = iteratee(index2); 25020 } 25021 return result; 25022 } 25023 var argsTag$3 = "[object Arguments]"; 25024 function baseIsArguments(value) { 25025 return isObjectLike(value) && baseGetTag(value) == argsTag$3; 25026 } 25027 var objectProto$c = Object.prototype; 25028 var hasOwnProperty$a = objectProto$c.hasOwnProperty; 25029 var propertyIsEnumerable$1 = objectProto$c.propertyIsEnumerable; 25030 var isArguments = baseIsArguments(/* @__PURE__ */ (function() { 25031 return arguments; 25032 })()) ? baseIsArguments : function(value) { 25033 return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee"); 25034 }; 25035 var isArray = Array.isArray; 25036 function stubFalse() { 25037 return false; 25038 } 25039 var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports; 25040 var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module; 25041 var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2; 25042 var Buffer$2 = moduleExports$2 ? root$1.Buffer : void 0; 25043 var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : void 0; 25044 var isBuffer = nativeIsBuffer || stubFalse; 25045 var MAX_SAFE_INTEGER = 9007199254740991; 25046 var reIsUint = /^(?:0|[1-9]\d*)$/; 25047 function isIndex(value, length2) { 25048 var type = typeof value; 25049 length2 = length2 == null ? MAX_SAFE_INTEGER : length2; 25050 return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2); 25051 } 25052 var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$6 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$6 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]"; 25053 var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array
25053]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]"; 25054 var typedArrayTags = {}; 25055 typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true; 25056 typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$6] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$6] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false; 25057 function baseIsTypedArray(value) { 25058 return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 25059 } 25060 var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports; 25061 var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module; 25062 var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; 25063 var freeProcess = moduleExports$1 && freeGlobal.process; 25064 var nodeUtil = (function() { 25065 try { 25066 var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types; 25067 if (types) { 25068 return types; 25069 } 25070 return freeProcess && freeProcess.binding && freeProcess.binding("util"); 25071 } catch (e2) { 25072 } 25073 })(); 25074 var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 25075 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 25076 var objectProto$b = Object.prototype; 25077 var hasOwnProperty$9 = objectProto$b.hasOwnProperty; 25078 function arrayLikeKeys(value, inherited) { 25079 var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length; 25080 for (var key in value) { 25081 if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. 25082 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. 25083 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. 25084 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. 25085 isIndex(key, length2)))) { 25086 result.push(key); 25087 } 25088 } 25089 return result; 25090 } 25091 var objectProto$a = Object.prototype; 25092 function isPrototype(value) { 25093 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a; 25094 return value === proto; 25095 } 25096 function overArg(func, transform2) { 25097 return function(arg) { 25098 return func(transform2(arg)); 25099 }; 25100 } 25101 var nativeKeys = overArg(Object.keys, Object); 25102 var objectProto$9 = Object.prototype; 25103 var hasOwnProperty$8 = objectProto$9.hasOwnProperty; 25104 function baseKeys(object2) { 25105 if (!isPrototype(object2)) { 25106 return nativeKeys(object2); 25107 } 25108 var result = []; 25109 for (var key in Object(object2)) { 25110 if (hasOwnProperty$8.call(object2, key) && key != "constructor") { 25111 result.push(key); 25112 } 25113 } 25114 return result; 25115 } 25116 function keys(object2) { 25117 return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2); 25118 } 25119 function baseForOwn(object2, iteratee) { 25120 return object2 && baseFor(object2, iteratee, keys); 25121 } 25122 function stackClear() {
vendor: 2,574 bytes, lines 25123-25194
25123 this.__data__ = new ListCache(); 25124 this.size = 0; 25125 } 25126 function stackDelete(key) { 25127 var data = this.__data__, result = data["delete"](key); 25128 this.size = data.size; 25129 return result; 25130 } 25131 function stackGet(key) { 25132 return this.__data__.get(key); 25133 } 25134 function stackHas(key) { 25135 return this.__data__.has(key); 25136 } 25137 var LARGE_ARRAY_SIZE = 200; 25138 function stackSet(key, value) { 25139 var data = this.__data__; 25140 if (data instanceof ListCache) { 25141 var pairs = data.__data__; 25142 if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) { 25143 pairs.push([key, value]); 25144 this.size = ++data.size; 25145 return this; 25146 } 25147 data = this.__data__ = new MapCache(pairs); 25148 } 25149 data.set(key, value); 25150 this.size = data.size; 25151 return this; 25152 } 25153 function Stack(entries2) { 25154 var data = this.__data__ = new ListCache(entries2); 25155 this.size = data.size; 25156 } 25157 Stack.prototype.clear = stackClear; 25158 Stack.prototype["delete"] = stackDelete; 25159 Stack.prototype.get = stackGet; 25160 Stack.prototype.has = stackHas; 25161 Stack.prototype.set = stackSet; 25162 function arraySome(array2, predicate) { 25163 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 25164 while (++index2 < length2) { 25165 if (predicate(array2[index2], index2, array2)) { 25166 return true; 25167 } 25168 } 25169 return false; 25170 } 25171 var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2; 25172 function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) { 25173 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array2.length, othLength = other.length; 25174 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 25175 return false; 25176 } 25177 var arrStacked = stack.get(array2); 25178 var othStacked = stack.get(other); 25179 if (arrStacked && othStacked) { 25180 return arrStacked == other && othStacked == array2; 25181 } 25182 var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0; 25183 stack.set(array2, other); 25184 stack.set(other, array2); 25185 while (++index2 < arrLength) { 25186 var arrValue = array2[index2], othValue = other[index2]; 25187 if (customizer) { 25188 var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack); 25189 } 25190 if (compared !== void 0) { 25191 if (compared) { 25192 continue; 25193 } 25194 result = false;
vendor: 4,273 bytes, lines 25195-25305
25195 break; 25196 } 25197 if (seen) { 25198 if (!arraySome(other, function(othValue2, othIndex) { 25199 if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { 25200 return seen.push(othIndex); 25201 } 25202 })) { 25203 result = false; 25204 break; 25205 } 25206 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 25207 result = false; 25208 break; 25209 } 25210 } 25211 stack["delete"](array2); 25212 stack["delete"](other); 25213 return result; 25214 } 25215 var Uint8Array$1 = root$1.Uint8Array; 25216 function mapToArray(map2) { 25217 var index2 = -1, result = Array(map2.size); 25218 map2.forEach(function(value, key) { 25219 result[++index2] = [key, value]; 25220 }); 25221 return result; 25222 } 25223 function setToArray(set2) { 25224 var index2 = -1, result = Array(set2.size); 25225 set2.forEach(function(value) { 25226 result[++index2] = value; 25227 }); 25228 return result; 25229 } 25230 var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2; 25231 var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", mapTag$5 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]"; 25232 var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]"; 25233 var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : void 0; 25234 function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) { 25235 switch (tag) { 25236 case dataViewTag$3: 25237 if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) { 25238 return false; 25239 } 25240 object2 = object2.buffer; 25241 other = other.buffer; 25242 case arrayBufferTag$2: 25243 if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object2), new Uint8Array$1(other))) { 25244 return false; 25245 } 25246 return true; 25247 case boolTag$2: 25248 case dateTag$2: 25249 case numberTag$2: 25250 return eq(+object2, +other); 25251 case errorTag$1: 25252 return object2.name == other.name && object2.message == other.message; 25253 case regexpTag$2: 25254 case stringTag$2: 25255 return object2 == other + ""; 25256 case mapTag$5: 25257 var convert = mapToArray; 25258 case setTag$5: 25259 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4; 25260 convert || (convert = setToArray); 25261 if (object2.size != other.size && !isPartial) { 25262 return false; 25263 } 25264 var stacked = stack.get(object2); 25265 if (stacked) { 25266 return stacked == other; 25267 } 25268 bitmask |= COMPARE_UNORDERED_FLAG$2; 25269 stack.set(object2, other); 25270 var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack); 25271 stack["delete"](object2); 25272 return result; 25273 case symbolTag$2: 25274 if (symbolValueOf$1) { 25275 return symbolValueOf$1.call(object2) == symbolValueOf$1.call(other); 25276 } 25277 } 25278 return false; 25279 } 25280 function arrayPush$1(array2, values) { 25281 var index2 = -1, length2 = values.length, offset2 = array2.length; 25282 while (++index2 < length2) { 25283 array2[offset2 + index2] = values[index2]; 25284 } 25285 return array2; 25286 } 25287 function baseGetAllKeys(object2, keysFunc, symbolsFunc) { 25288 var result = keysFunc(object2); 25289 return isArray(object2) ? result : arrayPush$1(result, symbolsFunc(object2)); 25290 } 25291 function arrayFilter(array2, predicate) { 25292 var index2 = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = []; 25293 while (++index2 < length2) { 25294 var value = array2[index2]; 25295 if (predicate(value, index2, array2)) { 25296 result[resIndex++] = value; 25297 } 25298 } 25299 return result; 25300 } 25301 function stubArray() { 25302 return []; 25303 } 25304 var objectProto$8 = Object.prototype; 25305 var propertyIsEnumerable = objectProto$8.propertyIsEnumerable;
vendor: 1,952 bytes, lines 25306-25350
25306 var nativeGetSymbols$1 = Object.getOwnPropertySymbols; 25307 var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object2) { 25308 if (object2 == null) { 25309 return []; 25310 } 25311 object2 = Object(object2); 25312 return arrayFilter(nativeGetSymbols$1(object2), function(symbol) { 25313 return propertyIsEnumerable.call(object2, symbol); 25314 }); 25315 }; 25316 function getAllKeys(object2) { 25317 return baseGetAllKeys(object2, keys, getSymbols); 25318 } 25319 var COMPARE_PARTIAL_FLAG$3 = 1; 25320 var objectProto$7 = Object.prototype; 25321 var hasOwnProperty$7 = objectProto$7.hasOwnProperty; 25322 function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) { 25323 var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; 25324 if (objLength != othLength && !isPartial) { 25325 return false; 25326 } 25327 var index2 = objLength; 25328 while (index2--) { 25329 var key = objProps[index2]; 25330 if (!(isPartial ? key in other : hasOwnProperty$7.call(other, key))) { 25331 return false; 25332 } 25333 } 25334 var objStacked = stack.get(object2); 25335 var othStacked = stack.get(other); 25336 if (objStacked && othStacked) { 25337 return objStacked == other && othStacked == object2; 25338 } 25339 var result = true; 25340 stack.set(object2, other); 25341 stack.set(other, object2); 25342 var skipCtor = isPartial; 25343 while (++index2 < objLength) { 25344 key = objProps[index2]; 25345 var objValue = object2[key], othValue = other[key]; 25346 if (customizer) { 25347 var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack); 25348 } 25349 if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { 25350 result = false;
vendor: 10,086 bytes, lines 25351-25593
25351 break; 25352 } 25353 skipCtor || (skipCtor = key == "constructor"); 25354 } 25355 if (result && !skipCtor) { 25356 var objCtor = object2.constructor, othCtor = other.constructor; 25357 if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { 25358 result = false; 25359 } 25360 } 25361 stack["delete"](object2); 25362 stack["delete"](other); 25363 return result; 25364 } 25365 var DataView = getNative(root$1, "DataView"); 25366 var Promise$1 = getNative(root$1, "Promise"); 25367 var Set$1 = getNative(root$1, "Set"); 25368 var WeakMap$1 = getNative(root$1, "WeakMap"); 25369 var mapTag$4 = "[object Map]", objectTag$3 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]"; 25370 var dataViewTag$2 = "[object DataView]"; 25371 var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1); 25372 var getTag = baseGetTag; 25373 if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) { 25374 getTag = function(value) { 25375 var result = baseGetTag(value), Ctor = result == objectTag$3 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : ""; 25376 if (ctorString) { 25377 switch (ctorString) { 25378 case dataViewCtorString: 25379 return dataViewTag$2; 25380 case mapCtorString: 25381 return mapTag$4; 25382 case promiseCtorString: 25383 return promiseTag; 25384 case setCtorString: 25385 return setTag$4; 25386 case weakMapCtorString: 25387 return weakMapTag$1; 25388 } 25389 } 25390 return result; 25391 }; 25392 } 25393 var COMPARE_PARTIAL_FLAG$2 = 1; 25394 var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", objectTag$2 = "[object Object]"; 25395 var objectProto$6 = Object.prototype; 25396 var hasOwnProperty$6 = objectProto$6.hasOwnProperty; 25397 function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) { 25398 var objIsArr = isArray(object2), othIsArr = isArray(other), objTag = objIsArr ? arrayTag$1 : getTag(object2), othTag = othIsArr ? arrayTag$1 : getTag(other); 25399 objTag = objTag == argsTag$1 ? objectTag$2 : objTag; 25400 othTag = othTag == argsTag$1 ? objectTag$2 : othTag; 25401 var objIsObj = objTag == objectTag$2, othIsObj = othTag == objectTag$2, isSameTag = objTag == othTag; 25402 if (isSameTag && isBuffer(object2)) { 25403 if (!isBuffer(other)) { 25404 return false; 25405 } 25406 objIsArr = true; 25407 objIsObj = false; 25408 } 25409 if (isSameTag && !objIsObj) { 25410 stack || (stack = new Stack()); 25411 return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack); 25412 } 25413 if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) { 25414 var objIsWrapped = objIsObj && hasOwnProperty$6.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$6.call(other, "__wrapped__"); 25415 if (objIsWrapped || othIsWrapped) { 25416 var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other; 25417 stack || (stack = new Stack()); 25418 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 25419 } 25420 } 25421 if (!isSameTag) { 25422 return false; 25423 } 25424 stack || (stack = new Stack()); 25425 return equalObjects(object2, other, bitmask, customizer, equalFunc, stack); 25426 } 25427 function baseIsEqual(value, other, bitmask, customizer, stack) { 25428 if (value === other) { 25429 return true; 25430 } 25431 if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { 25432 return value !== value && other !== other; 25433 } 25434 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 25435 } 25436 var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2; 25437 function baseIsMatch(object2, source, matchData, customizer) { 25438 var index2 = matchData.length, length2 = index2; 25439 if (object2 == null) { 25440 return !length2; 25441 } 25442 object2 = Object(object2); 25443 while (index2--) { 25444 var data = matchData[index2]; 25445 if (data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) { 25446 return false; 25447 } 25448 } 25449 while (++index2 < length2) { 25450 data = matchData[index2]; 25451 var key = data[0], objValue = object2[key], srcValue = data[1]; 25452 if (data[2]) { 25453 if (objValue === void 0 && !(key in object2)) { 25454 return false; 25455 } 25456 } else { 25457 var stack = new Stack(); 25458 var result; 25459 if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) { 25460 return false; 25461 } 25462 } 25463 } 25464 return true; 25465 } 25466 function isStrictComparable(value) { 25467 return value === value && !isObject$3(value); 25468 } 25469 function getMatchData(object2) { 25470 var result = keys(object2), length2 = result.length; 25471 while (length2--) { 25472 var key = result[length2], value = object2[key]; 25473 result[length2] = [key, value, isStrictComparable(value)]; 25474 } 25475 return result; 25476 } 25477 function matchesStrictComparable(key, srcValue) { 25478 return function(object2) { 25479 if (object2 == null) { 25480 return false; 25481 } 25482 return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2)); 25483 }; 25484 } 25485 function baseMatches(source) { 25486 var matchData = getMatchData(source); 25487 if (matchData.length == 1 && matchData[0][2]) { 25488 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 25489 } 25490 return function(object2) { 25491 return object2 === source || baseIsMatch(object2, source, matchData); 25492 }; 25493 } 25494 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; 25495 function isKey(value, object2) { 25496 if (isArray(value)) { 25497 return false; 25498 } 25499 var type = typeof value; 25500 if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { 25501 return true; 25502 } 25503 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2); 25504 } 25505 var FUNC_ERROR_TEXT$1 = "Expected a function"; 25506 function memoize(func, resolver) { 25507 if (typeof func != "function" || resolver != null && typeof resolver != "function") { 25508 throw new TypeError(FUNC_ERROR_TEXT$1); 25509 } 25510 var memoized = function() { 25511 var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; 25512 if (cache.has(key)) { 25513 return cache.get(key); 25514 } 25515 var result = func.apply(this, args); 25516 memoized.cache = cache.set(key, result) || cache; 25517 return result; 25518 }; 25519 memoized.cache = new (memoize.Cache || MapCache)(); 25520 return memoized; 25521 } 25522 memoize.Cache = MapCache; 25523 var MAX_MEMOIZE_SIZE = 500; 25524 function memoizeCapped(func) { 25525 var result = memoize(func, function(key) { 25526 if (cache.size === MAX_MEMOIZE_SIZE) { 25527 cache.clear(); 25528 } 25529 return key; 25530 }); 25531 var cache = result.cache; 25532 return result; 25533 } 25534 var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 25535 var reEscapeChar = /\\(\\)?/g; 25536 var stringToPath = memoizeCapped(function(string2) { 25537 var result = []; 25538 if (string2.charCodeAt(0) === 46) { 25539 result.push(""); 25540 } 25541 string2.replace(rePropName, function(match2, number2, quote, subString) { 25542 result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2); 25543 }); 25544 return result; 25545 }); 25546 var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString$2 = symbolProto$1 ? symbolProto$1.toString : void 0; 25547 function baseToString(value) { 25548 if (typeof value == "string") { 25549 return value; 25550 } 25551 if (isArray(value)) { 25552 return arrayMap(value, baseToString) + ""; 25553 } 25554 if (isSymbol(value)) { 25555 return symbolToString$2 ? symbolToString$2.call(value) : ""; 25556 } 25557 var result = value + ""; 25558 return result == "0" && 1 / value == -Infinity ? "-0" : result; 25559 } 25560 function toString$1(value) { 25561 return value == null ? "" : baseToString(value); 25562 } 25563 function castPath(value, object2) { 25564 if (isArray(value)) { 25565 return value; 25566 } 25567 return isKey(value, object2) ? [value] : stringToPath(toString$1(value)); 25568 } 25569 function toKey(value) { 25570 if (typeof value == "string" || isSymbol(value)) { 25571 return value; 25572 } 25573 var result = value + ""; 25574 return result == "0" && 1 / value == -Infinity ? "-0" : result; 25575 } 25576 function baseGet(object2, path) { 25577 path = castPath(path, object2); 25578 var index2 = 0, length2 = path.length; 25579 while (object2 != null && index2 < length2) { 25580 object2 = object2[toKey(path[index2++])]; 25581 } 25582 return index2 && index2 == length2 ? object2 : void 0; 25583 } 25584 function get(object2, path, defaultValue) { 25585 var result = object2 == null ? void 0 : baseGet(object2, path); 25586 return result === void 0 ? defaultValue : result; 25587 } 25588 function baseHasIn(object2, key) { 25589 return object2 != null && key in Object(object2); 25590 } 25591 function hasPath(object2, path, hasFunc) { 25592 path = castPath(path, object2); 25593 var index2 = -1, length2 = path.length, result = false;
25594 while (++index2 < length2) { 25595 var key = toKey(path[index2]); 25596 if (!(result = object2 != null && hasFunc(object2, key))) { 25597 break; 25598 } 25599 object2 = object2[key]; 25600 } 25601 if (result || ++index2 != length2) { 25602 return result; 25603 } 25604 length2 = object2 == null ? 0 : object2.length; 25605 return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray(object2) || isArguments(object2)); 25606 } 25607 function hasIn(object2, path) { 25608 return object2 != null && hasPath(object2, path, baseHasIn); 25609 } 25610 var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; 25611 function baseMatchesProperty(path, srcValue) { 25612 if (isKey(path) && isStrictComparable(srcValue)) { 25613 return matchesStrictComparable(toKey(path), srcValue); 25614 } 25615 return function(object2) { 25616 var objValue = get(object2, path); 25617 return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 25618 }; 25619 } 25620 function baseProperty(key) { 25621 return function(object2) { 25622 return object2 == null ? void 0 : object2[key]; 25623 }; 25624 } 25625 function basePropertyDeep(path) { 25626 return function(object2) { 25627 return baseGet(object2, path); 25628 }; 25629 } 25630 function property(path) { 25631 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 25632 } 25633 function baseIteratee(value) { 25634 if (typeof value == "function") { 25635 return value; 25636 } 25637 if (value == null) { 25638 return identity; 25639 } 25640 if (typeof value == "object") { 25641 return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); 25642 } 25643 return property(value); 25644 } 25645 function mapValues(object2, iteratee) { 25646 var result = {}; 25647 iteratee = baseIteratee(iteratee); 25648 baseForOwn(object2, function(value, key, object3) { 25649 baseAssignValue(result, key, iteratee(value, key, object3)); 25650 }); 25651 return result; 25652 } 25653 const breakpoints = { 25654 mobileM: 375, 25655 tablet: 768, 25656 laptopS: 992, 25657 laptop: 1280, 25658 desktop: 1920 25659 }; 25660 const mediaQueriesExpressions = mapValues(breakpoints, (item) => { 25661 return `(min-width: ${item}px)`; 25662 }); 25663 const mediaQueries = mapValues(mediaQueriesExpressions, (item) => { 25664 return `@media ${item}`; 25665 }); 25666 const Container$u = dt$2.div` 25667 padding: var(--space-200) var(--space-300); 25668 display: flex; 25669 align-items: center; 25670 gap: var(--space-400); 25671 border-radius: var(--panel-radius-normal); 25672 font-weight: var(--font-weight-500); 25673 25674 ${({ $type }) => $type === "success" && lt$2` 25675 background: var(--bg-success); 25676 color: var(--text-white); 25677 `} 25678 25679 ${({ $type }) => $type === "info" && lt$2` 25680 background: var(--bg-primary-invert); 25681 color: var(--text-primary-invert); 25682 `} 25683 25684 ${({ $type }) => $type === "error" && lt$2` 25685 background: var(--bg-critical); 25686 color: var(--text-white); 25687 `} 25688 25689 ${mediaQueries.tablet} { 25690 padding: var(--space-300) var(--space-400); 25691 max-width: 870px; 25692 width: 80vw; 25693 } 25694 25695 ol { 25696 padding-left: var(--space-500); 25697 list-style-type: decimal; 25698 } 25699 25700 a { 25701 text-decoration: underline; 25702 } 25703`; 25704 const Message = dt$2.div` 25705 white-space: pre-line; 25706 flex: 1; 25707`; 25708 const Close = dt$2.button` 25709 padding: var(--space-200); 25710 margin: var(--space-n200); 25711 color: inherit; 25712`; 25713 const Alert = ({ message, type = "info", onClose }) => { 25714 const [closeButtonRef, setCloseButtonFocus] = pe$2(); 25715 reactExports.useEffect(() => { 25716 const timeout = setTimeout(() => { 25717 setCloseButtonFocus(); 25718 }, 200); 25719 return () => clearTimeout(timeout); 25720 }, [setCloseButtonFocus]); 25721 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$u, { $type: type, role: "alert", children: [
25722 /* @__PURE__ */ jsxRuntimeExports.jsx(Message, { children: message }), 25723 onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(Close, { title: "Close", onClick: onClose, "data-testid": "Alert.Close", ref: closeButtonRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 16, "aria-label": "close" }) }) 25724 ] }); 25725 }; 25726 const AspectBox = ({ ratio, children }) => { 25727 return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: reactExports.Children.map(children, (child) => { 25728 if (reactExports.isValidElement(child)) { 25729 return reactExports.cloneElement(child, __spreadProps(__spreadValues({}, child.props), { 25730 style: __spreadProps(__spreadValues({}, child.props.style), { 25731 aspectRatio: ratio.split(":").join("/") 25732 }) 25733 })); 25734 } 25735 }) }); 25736 }; 25737 function arrayEach(array2, iteratee) { 25738 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 25739 while (++index2 < length2) { 25740 if (iteratee(array2[index2], index2, array2) === false) { 25741 break; 25742 } 25743 } 25744 return array2; 25745 } 25746 var objectProto$5 = Object.prototype; 25747 var hasOwnProperty$5 = objectProto$5.hasOwnProperty; 25748 function assignValue(object2, key, value) { 25749 var objValue = object2[key]; 25750 if (!(hasOwnProperty$5.call(object2, key) && eq(objValue, value)) || value === void 0 && !(key in object2)) { 25751 baseAssignValue(object2, key, value); 25752 } 25753 } 25754 function copyObject(source, props, object2, customizer) { 25755 var isNew = !object2; 25756 object2 || (object2 = {}); 25757 var index2 = -1, length2 = props.length; 25758 while (++index2 < length2) { 25759 var key = props[index2]; 25760 var newValue = void 0; 25761 if (newValue === void 0) { 25762 newValue = source[key]; 25763 } 25764 if (isNew) { 25765 baseAssignValue(object2, key, newValue); 25766 } else { 25767 assignValue(object2, key, newValue); 25768 } 25769 } 25770 return object2; 25771 } 25772 function baseAssign(object2, source) { 25773 return object2 && copyObject(source, keys(source), object2); 25774 } 25775 function nativeKeysIn(object2) { 25776 var result = []; 25777 if (object2 != null) { 25778 for (var key in Object(object2)) { 25779 result.push(key); 25780 } 25781 } 25782 return result; 25783 } 25784 var objectProto$4 = Object.prototype; 25785 var hasOwnProperty$4 = objectProto$4.hasOwnProperty; 25786 function baseKeysIn(object2) { 25787 if (!isObject$3(object2)) { 25788 return nativeKeysIn(object2); 25789 } 25790 var isProto = isPrototype(object2), result = []; 25791 for (var key in object2) { 25792 if (!(key == "constructor" && (isProto || !hasOwnProperty$4.call(object2, key)))) { 25793 result.push(key); 25794 } 25795 } 25796 return result; 25797 } 25798 function keysIn(object2) { 25799 return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2); 25800 } 25801 function baseAssignIn(object2, source) { 25802 return object2 && copyObject(source, keysIn(source), object2); 25803 } 25804 var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; 25805 var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; 25806 var moduleExports = freeModule && freeModule.exports === freeExports; 25807 var Buffer$1 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0; 25808 function cloneBuffer(buffer, isDeep) { 25809 if (isDeep) { 25810 return buffer.slice(); 25811 } 25812 var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2); 25813 buffer.copy(result); 25814 return result; 25815 } 25816 function copyArray(source, array2) { 25817 var index2 = -1, length2 = source.length; 25818 array2 || (array2 = Array(length2)); 25819 while (++index2 < length2) { 25820 array2[index2] = source[index2]; 25821 } 25822 return array2; 25823 } 25824 function copySymbols(source, object2) { 25825 return copyObject(source, getSymbols(source), object2); 25826 } 25827 var getPrototype = overArg(Object.getPrototypeOf, Object); 25828 var nativeGetSymbols = Object.getOwnPropertySymbols; 25829 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object2) { 25830 var result = []; 25831 while (object2) {
vendor: 4,720 bytes, lines 25832-25943
25832 arrayPush$1(result, getSymbols(object2)); 25833 object2 = getPrototype(object2); 25834 } 25835 return result; 25836 }; 25837 function copySymbolsIn(source, object2) { 25838 return copyObject(source, getSymbolsIn(source), object2); 25839 } 25840 function getAllKeysIn(object2) { 25841 return baseGetAllKeys(object2, keysIn, getSymbolsIn); 25842 } 25843 var objectProto$3 = Object.prototype; 25844 var hasOwnProperty$3 = objectProto$3.hasOwnProperty; 25845 function initCloneArray(array2) { 25846 var length2 = array2.length, result = new array2.constructor(length2); 25847 if (length2 && typeof array2[0] == "string" && hasOwnProperty$3.call(array2, "index")) { 25848 result.index = array2.index; 25849 result.input = array2.input; 25850 } 25851 return result; 25852 } 25853 function cloneArrayBuffer(arrayBuffer) { 25854 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 25855 new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer)); 25856 return result; 25857 } 25858 function cloneDataView(dataView, isDeep) { 25859 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 25860 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 25861 } 25862 var reFlags = /\w*$/; 25863 function cloneRegExp(regexp) { 25864 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 25865 result.lastIndex = regexp.lastIndex; 25866 return result; 25867 } 25868 var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; 25869 function cloneSymbol(symbol) { 25870 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 25871 } 25872 function cloneTypedArray(typedArray, isDeep) { 25873 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 25874 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 25875 } 25876 var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$3 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]"; 25877 var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]"; 25878 function initCloneByTag(object2, tag, isDeep) { 25879 var Ctor = object2.constructor; 25880 switch (tag) { 25881 case arrayBufferTag$1: 25882 return cloneArrayBuffer(object2); 25883 case boolTag$1: 25884 case dateTag$1: 25885 return new Ctor(+object2); 25886 case dataViewTag$1: 25887 return cloneDataView(object2, isDeep); 25888 case float32Tag$1: 25889 case float64Tag$1: 25890 case int8Tag$1: 25891 case int16Tag$1: 25892 case int32Tag$1: 25893 case uint8Tag$1: 25894 case uint8ClampedTag$1: 25895 case uint16Tag$1: 25896 case uint32Tag$1: 25897 return cloneTypedArray(object2, isDeep); 25898 case mapTag$3: 25899 return new Ctor(); 25900 case numberTag$1: 25901 case stringTag$1: 25902 return new Ctor(object2); 25903 case regexpTag$1: 25904 return cloneRegExp(object2); 25905 case setTag$3: 25906 return new Ctor(); 25907 case symbolTag$1: 25908 return cloneSymbol(object2); 25909 } 25910 } 25911 var objectCreate = Object.create; 25912 var baseCreate = /* @__PURE__ */ (function() { 25913 function object2() { 25914 } 25915 return function(proto) { 25916 if (!isObject$3(proto)) { 25917 return {}; 25918 } 25919 if (objectCreate) { 25920 return objectCreate(proto); 25921 } 25922 object2.prototype = proto; 25923 var result = new object2(); 25924 object2.prototype = void 0; 25925 return result; 25926 }; 25927 })(); 25928 function initCloneObject(object2) { 25929 return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {}; 25930 } 25931 var mapTag$2 = "[object Map]"; 25932 function baseIsMap(value) { 25933 return isObjectLike(value) && getTag(value) == mapTag$2; 25934 } 25935 var nodeIsMap = nodeUtil && nodeUtil.isMap; 25936 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 25937 var setTag$2 = "[object Set]"; 25938 function baseIsSet(value) { 25939 return isObjectLike(value) && getTag(value) == setTag$2; 25940 } 25941 var nodeIsSet = nodeUtil && nodeUtil.isSet; 25942 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 25943 var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$2 = 4;
vendor: 4,277 bytes, lines 25944-26018
25944 var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]"; 25945 var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; 25946 var cloneableTags = {}; 25947 cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag] = cloneableTags[objectTag$1] = cloneableTags[regexpTag] = cloneableTags[setTag$1] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 25948 cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; 25949 function baseClone$1(value, bitmask, customizer, key, object2, stack) { 25950 var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$2; 25951 if (result !== void 0) { 25952 return result; 25953 } 25954 if (!isObject$3(value)) { 25955 return value; 25956 } 25957 var isArr = isArray(value); 25958 if (isArr) { 25959 result = initCloneArray(value); 25960 if (!isDeep) { 25961 return copyArray(value, result); 25962 } 25963 } else { 25964 var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; 25965 if (isBuffer(value)) { 25966 return cloneBuffer(value, isDeep); 25967 } 25968 if (tag == objectTag$1 || tag == argsTag || isFunc && !object2) { 25969 result = isFlat || isFunc ? {} : initCloneObject(value); 25970 if (!isDeep) { 25971 return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); 25972 } 25973 } else { 25974 if (!cloneableTags[tag]) { 25975 return object2 ? value : {}; 25976 } 25977 result = initCloneByTag(value, tag, isDeep); 25978 } 25979 } 25980 stack || (stack = new Stack()); 25981 var stacked = stack.get(value); 25982 if (stacked) { 25983 return stacked; 25984 } 25985 stack.set(value, result); 25986 if (isSet(value)) { 25987 value.forEach(function(subValue) { 25988 result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack)); 25989 }); 25990 } else if (isMap(value)) { 25991 value.forEach(function(subValue, key2) { 25992 result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack)); 25993 }); 25994 } 25995 var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; 25996 var props = isArr ? void 0 : keysFunc(value); 25997 arrayEach(props || value, function(subValue, key2) { 25998 if (props) { 25999 key2 = subValue; 26000 subValue = value[key2]; 26001 } 26002 assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack)); 26003 }); 26004 return result; 26005 } 26006 var CLONE_SYMBOLS_FLAG$1 = 4; 26007 function clone$2(value) { 26008 return baseClone$1(value, CLONE_SYMBOLS_FLAG$1); 26009 } 26010 function assignMergeValue(object2, key, value) { 26011 if (value !== void 0 && !eq(object2[key], value) || value === void 0 && !(key in object2)) { 26012 baseAssignValue(object2, key, value); 26013 } 26014 } 26015 var objectTag = "[object Object]"; 26016 var funcProto = Function.prototype, objectProto$2 = Object.prototype; 26017 var funcToString = funcProto.toString; 26018 var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
vendor: 7,546 bytes, lines 26019-26215
26019 var objectCtorString = funcToString.call(Object); 26020 function isPlainObject$1(value) { 26021 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 26022 return false; 26023 } 26024 var proto = getPrototype(value); 26025 if (proto === null) { 26026 return true; 26027 } 26028 var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor; 26029 return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; 26030 } 26031 function safeGet(object2, key) { 26032 if (key === "constructor" && typeof object2[key] === "function") { 26033 return; 26034 } 26035 if (key == "__proto__") { 26036 return; 26037 } 26038 return object2[key]; 26039 } 26040 function toPlainObject(value) { 26041 return copyObject(value, keysIn(value)); 26042 } 26043 function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, stack) { 26044 var objValue = safeGet(object2, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); 26045 if (stacked) { 26046 assignMergeValue(object2, key, stacked); 26047 return; 26048 } 26049 var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : void 0; 26050 var isCommon = newValue === void 0; 26051 if (isCommon) { 26052 var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); 26053 newValue = srcValue; 26054 if (isArr || isBuff || isTyped) { 26055 if (isArray(objValue)) { 26056 newValue = objValue; 26057 } else if (isArrayLikeObject(objValue)) { 26058 newValue = copyArray(objValue); 26059 } else if (isBuff) { 26060 isCommon = false; 26061 newValue = cloneBuffer(srcValue, true); 26062 } else if (isTyped) { 26063 isCommon = false; 26064 newValue = cloneTypedArray(srcValue, true); 26065 } else { 26066 newValue = []; 26067 } 26068 } else if (isPlainObject$1(srcValue) || isArguments(srcValue)) { 26069 newValue = objValue; 26070 if (isArguments(objValue)) { 26071 newValue = toPlainObject(objValue); 26072 } else if (!isObject$3(objValue) || isFunction$1(objValue)) { 26073 newValue = initCloneObject(srcValue); 26074 } 26075 } else { 26076 isCommon = false; 26077 } 26078 } 26079 if (isCommon) { 26080 stack.set(srcValue, newValue); 26081 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 26082 stack["delete"](srcValue); 26083 } 26084 assignMergeValue(object2, key, newValue); 26085 } 26086 function baseMerge(object2, source, srcIndex, customizer, stack) { 26087 if (object2 === source) { 26088 return; 26089 } 26090 baseFor(source, function(srcValue, key) { 26091 stack || (stack = new Stack()); 26092 if (isObject$3(srcValue)) { 26093 baseMergeDeep(object2, source, key, srcIndex, baseMerge, customizer, stack); 26094 } else { 26095 var newValue = customizer ? customizer(safeGet(object2, key), srcValue, key + "", object2, source, stack) : void 0; 26096 if (newValue === void 0) { 26097 newValue = srcValue; 26098 } 26099 assignMergeValue(object2, key, newValue); 26100 } 26101 }, keysIn); 26102 } 26103 function isIterateeCall(value, index2, object2) { 26104 if (!isObject$3(object2)) { 26105 return false; 26106 } 26107 var type = typeof index2; 26108 if (type == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type == "string" && index2 in object2) { 26109 return eq(object2[index2], value); 26110 } 26111 return false; 26112 } 26113 function createAssigner(assigner) { 26114 return baseRest(function(object2, sources) { 26115 var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0; 26116 customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0; 26117 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 26118 customizer = length2 < 3 ? void 0 : customizer; 26119 length2 = 1; 26120 } 26121 object2 = Object(object2); 26122 while (++index2 < length2) { 26123 var source = sources[index2]; 26124 if (source) { 26125 assigner(object2, source, index2, customizer); 26126 } 26127 } 26128 return object2; 26129 }); 26130 } 26131 var merge = createAssigner(function(object2, source, srcIndex) { 26132 baseMerge(object2, source, srcIndex); 26133 }); 26134 function arrayReduce(array2, iteratee, accumulator, initAccum) { 26135 var index2 = -1, length2 = array2 == null ? 0 : array2.length; 26136 if (initAccum && length2) { 26137 accumulator = array2[++index2]; 26138 } 26139 while (++index2 < length2) { 26140 accumulator = iteratee(accumulator, array2[index2], index2, array2); 26141 } 26142 return accumulator; 26143 } 26144 function createBaseEach(eachFunc, fromRight) { 26145 return function(collection, iteratee) { 26146 if (collection == null) { 26147 return collection; 26148 } 26149 if (!isArrayLike(collection)) { 26150 return eachFunc(collection, iteratee); 26151 } 26152 var length2 = collection.length, index2 = -1, iterable = Object(collection); 26153 while (++index2 < length2) { 26154 if (iteratee(iterable[index2], index2, iterable) === false) { 26155 break; 26156 } 26157 } 26158 return collection; 26159 }; 26160 } 26161 var baseEach = createBaseEach(baseForOwn); 26162 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 26163 eachFunc(collection, function(value, index2, collection2) { 26164 accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2); 26165 }); 26166 return accumulator; 26167 } 26168 function reduce(collection, iteratee, accumulator) { 26169 var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; 26170 return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach); 26171 } 26172 function baseSet(object2, path, value, customizer) { 26173 if (!isObject$3(object2)) { 26174 return object2; 26175 } 26176 path = castPath(path, object2); 26177 var index2 = -1, length2 = path.length, lastIndex = length2 - 1, nested = object2; 26178 while (nested != null && ++index2 < length2) { 26179 var key = toKey(path[index2]), newValue = value; 26180 if (key === "__proto__" || key === "constructor" || key === "prototype") { 26181 return object2; 26182 } 26183 if (index2 != lastIndex) { 26184 var objValue = nested[key]; 26185 newValue = void 0; 26186 if (newValue === void 0) { 26187 newValue = isObject$3(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {}; 26188 } 26189 } 26190 assignValue(nested, key, newValue); 26191 nested = nested[key]; 26192 } 26193 return object2; 26194 } 26195 function set$1(object2, path, value) { 26196 return object2 == null ? object2 : baseSet(object2, path, value); 26197 } 26198 var __assign$2 = function() { 26199 __assign$2 = Object.assign || function(t2) { 26200 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 26201 s2 = arguments[i2]; 26202 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) 26203 t2[p2] = s2[p2]; 26204 } 26205 return t2; 26206 }; 26207 return __assign$2.apply(this, arguments); 26208 }; 26209 var pairDivider = "~"; 26210 var blockDivider = "~~"; 26211 function generateNamedReferences(input, prev2) { 26212 var entities = {}; 26213 var characters2 = {}; 26214 var blocks = input.split(blockDivider); 26215 var isOptionalBlock = false;
vendor: 4,763 bytes, lines 26216-26239
26216 for (var i2 = 0; blocks.length > i2; i2++) { 26217 var entries2 = blocks[i2].split(pairDivider); 26218 for (var j2 = 0; j2 < entries2.length; j2 += 2) { 26219 var entity = entries2[j2]; 26220 var character2 = entries2[j2 + 1]; 26221 var fullEntity = "&" + entity + ";"; 26222 entities[fullEntity] = character2; 26223 if (isOptionalBlock) { 26224 entities["&" + entity] = character2; 26225 } 26226 characters2[character2] = fullEntity; 26227 } 26228 isOptionalBlock = true; 26229 } 26230 return prev2 ? { entities: __assign$2(__assign$2({}, entities), prev2.entities), characters: __assign$2(__assign$2({}, characters2), prev2.characters) } : { entities, characters: characters2 }; 26231 } 26232 var bodyRegExps = { 26233 xml: /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, 26234 html4: /∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, 26235 html5: /·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g 26236 }; 26237 var namedReferences = {}; 26238 namedReferences["xml"] = generateNamedReferences(`lt~<~gt~>~quot~"~apos~'~amp~&`); 26239 namedReferences["html4"] = generateNamedReferences(`apos~'~OElig~Å~oelig~Å~Scaron~Å ~scaron~Å¡~Yuml~Ÿ~circ~Ë~tilde~Ë~ensp~â~emsp~â~thinsp~â~zwnj~â~zwj~â~lrm~â~rlm~â~ndash~â~mdash~â~lsquo~â~rsquo~â~sbquo~â~ldquo~â~rdquo~â~bdquo~â~dagger~â ~Dagger~â¡~permil~â°~lsaquo~â¹~rsaquo~âº~euro~â¬~fnof~Æ~Alpha~Î~Beta~Î~Gamma~Î~Delta~Î~Epsilon~Î~Zeta~Î~Eta~Î~Theta~Î~Iota~Î~Kappa~Î~Lambda~Î~Mu~Î~Nu~Î~Xi~Î~Omicron~Î~Pi~Î ~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Î¥~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~Ï~rho~Ï~sigmaf~Ï~sigma~Ï~tau~Ï~upsilon~Ï ~phi~Ï~chi~Ï~psi~Ï~omega~Ï~thetasym~Ï~upsih~Ï~piv~Ï~bull~â¢~hellip~â¦~prime~â²~Prime~â³~oline~â¾~frasl~â~weierp~â~image~â~real~â~trade~â¢~alefsym~âµ~larr~â~uarr~â~rarr~â~darr~â~harr~â~crarr~âµ~lArr~â~uArr~â~rArr~â~dArr~â~hArr~â~forall~â~part~â~exist~â~empty~â ~nabla~â~isin~â~notin~â~ni~â~prod~â~sum~â~minus~â~lowast~â~radic~â~prop~â~infin~â~ang~â ~and~â§~or~â¨~cap~â©~cup~âª~int~â«~there4~â´~sim~â¼~cong~â ~asymp~â~ne~â ~equiv~â¡~le~â¤~ge~â¥~sub~â~sup~â~nsub~â~sube~â~supe~â~oplus~â~otimes~â~perp~â¥~sdot~â ~lceil~â~rceil~â~lfloor~â~rfloor~â~lang~â©~rang~âª~loz~â~spades~â ~clubs~â£~hearts~â¥~diams~â¦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~Â¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~Â~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~Ã~Aacute~Ã~Acirc~Ã~Atilde~Ã~Auml~Ã~Aring~à ~AElig~Ã~Ccedil~Ã~Egrave~Ã~Eacute~Ã~Ecirc~Ã~Euml~Ã~Igrave~Ã~Iacute~Ã~Icirc~Ã~Iuml~Ã~ETH~Ã~Ntilde~Ã~Ograve~Ã~Oacute~Ã~Ocirc~Ã~Otilde~Ã~Ouml~Ã~times~Ã~Oslash~Ã~Ugrave~Ã~Uacute~Ã~Ucirc~Ã~Uuml~Ã~Yacute~Ã~THORN~Ã~szlig~Ã~agrave~à ~aacute~á~acirc~â~atilde~ã~auml~ä~aring~Ã¥~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~
26239ê~euml~ë~igrave~ì~iacute~Ã~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`); 26240 namedReferences["html5"] = generateNamedReferences('Abreve~Ä~Acy~Ð~Afr~ð~Amacr~Ä~And~â©~Aogon~Ä~Aopf~ð¸~ApplyFunction~â¡~Ascr~ð~Assign~â~Backslash~â~Barv~â«§~Barwed~â~Bcy~Ð~Because~âµ~Bernoullis~â¬~Bfr~ð ~Bopf~ð¹~Breve~Ë~Bscr~â¬~Bumpeq~â~CHcy~Ч~Cacute~Ä~Cap~â~CapitalDifferentialD~â ~Cayleys~â~Ccaron~Ä~Ccirc~Ä~Cconint~â°~Cdot~Ä~Cedilla~¸~CenterDot~·~Cfr~â~CircleDot~â~CircleMinus~â~CirclePlus~â~CircleTimes~â~ClockwiseContourIntegral~â²~CloseCurlyDoubleQuote~â~CloseCurlyQuote~â~Colon~â·~Colone~â©´~Congruent~â¡~Conint~â¯~ContourIntegral~â®~Copf~â~Coproduct~â~CounterClockwiseContourIntegral~â³~Cross~⨯~Cscr~ð~Cup~â~CupCap~â~DD~â ~DDotrahd~â¤~DJcy~Ð~DScy~Ð ~DZcy~Ð~Darr~â¡~Dashv~⫤~Dcaron~Ä~Dcy~Ð~Del~â~Dfr~ð~DiacriticalAcute~´~DiacriticalDot~Ë~DiacriticalDoubleAcute~Ë~DiacriticalGrave~`~DiacriticalTilde~Ë~Diamond~â~DifferentialD~â ~Dopf~ð»~Dot~¨~DotDot~â~DotEqual~â~DoubleContourIntegral~â¯~DoubleDot~¨~DoubleDownArrow~â~DoubleLeftArrow~â~DoubleLeftRightArrow~â~DoubleLeftTee~⫤~DoubleLongLeftArrow~â¸~DoubleLongLeftRightArrow~âº~DoubleLongRightArrow~â¹~DoubleRightArrow~â~DoubleRightTee~â¨~DoubleUpArrow~â~DoubleUpDownArrow~â~DoubleVerticalBar~â¥~DownArrow~â~DownArrowBar~â¤~DownArrowUpArrow~âµ~DownBreve~Ì~DownLeftRightVector~â¥~DownLeftTeeVector~â¥~DownLeftVector~â½~DownLeftVectorBar~â¥~DownRightTeeVector~â¥~DownRightVector~â~DownRightVectorBar~â¥~DownTee~â¤~DownTeeArrow~â§~Downarrow~â~Dscr~ð~Dstrok~Ä~ENG~Å~Ecaron~Ä~Ecy~Ð~Edot~Ä~Efr~ð~Element~â~Emacr~Ä~EmptySmallSquare~â»~EmptyVerySmallSquare~â«~Eogon~Ä~Eopf~ð¼~Equal~⩵~EqualTilde~â~Equilibrium~â~Escr~â°~Esim~⩳~Exists~â~ExponentialE~â ~Fcy~Ф~Ffr~ð~FilledSmallSquare~â¼~FilledVerySmallSquare~âª~Fopf~ð½~ForAll~â~Fouriertrf~â±~Fscr~â±~GJcy~Ð~Gammad~Ï~Gbreve~Ä~Gcedil~Ä¢~Gcirc~Ä~Gcy~Ð~Gdot~Ä ~Gfr~ð~Gg~â~Gopf~ð¾~GreaterEqual~â¥~GreaterEqualLess~â~GreaterFullEqual~â§~GreaterGreater~⪢~GreaterLess~â·~GreaterSlantEqual~⩾~GreaterTilde~â³~Gscr~ð¢~Gt~â«~HARDcy~Ъ~Hacek~Ë~Hat~^~Hcirc~Ĥ~Hfr~â~HilbertSpace~â~Hopf~â~HorizontalLine~â~Hscr~â~Hstrok~Ħ~HumpDownHump~â~HumpEqual~â~IEcy~Ð~IJlig~IJ~IOcy~Ð~Icy~Ð~Idot~İ~Ifr~â~Im~â~Imacr~Ī~ImaginaryI~â ~Implies~â~Int~â¬~Integral~â«~Intersection~â~InvisibleComma~â£~InvisibleTimes~â¢~Iogon~Ä®~Iopf~ð~Iscr~â~Itilde~Ĩ~Iukcy~Ð~Jcirc~Ä´~Jcy~Ð~Jfr~ð~Jopf~ð~Jscr~ð¥~Jsercy~Ð~Jukcy~Ð~KHcy~Ð¥~KJcy~Ð~Kcedil~Ķ~Kcy~Ð~Kfr~ð~Kopf~ð~Kscr~ð¦~LJcy~Ð~Lacute~Ĺ~Lang~âª~Laplacetrf~â~Larr~â~Lcaron~Ľ~Lcedil~Ä»~Lcy~Ð~LeftAngleBracket~â¨~LeftArrow~â~LeftArrowBar~â¤~LeftArrowRightArrow~â~LeftCeiling~â~LeftDoubleBracket~â¦~LeftDownTeeVector~⥡~LeftDownVector~â~LeftDownVectorBar~â¥~LeftFloor~â~LeftRightArrow~â~LeftRightVector~â¥~LeftTee~â£~LeftTeeArrow~â¤~LeftTeeVector~â¥~LeftTriangle~â²~LeftTriangleBar~â§~LeftTriangleEqual~â´~LeftUpDownVector~â¥~LeftUpTeeVector~⥠~LeftUpVector~â¿~LeftUpVectorBar~â¥~LeftVector~â¼~LeftVectorBar~â¥~Leftarrow~â~Leftrightarrow~â~LessEqualGreater~â~LessFullEqual~â¦~LessGreater~â¶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~â²~Lfr~ð~Ll~â~Lleftarrow~â~Lmidot~Ä¿~LongLeftArrow~âµ~LongLeftRightArrow~â·~LongRightArrow~â¶~Longleftarrow~â¸~Longleftrightarrow~âº~Longrightarrow~â¹~Lopf~ð~LowerLeftArrow~â~LowerRightArrow~â~Lscr~â~Lsh~â°~Lstrok~Å~Lt~âª~Map~⤠~Mcy~Ð~MediumSpace~â~Mellintrf~â³~Mfr~ð~MinusPlus~â~Mopf~ð~Mscr~â³~NJcy~Ð~Nacute~Å~Ncaron~Å~Ncedil~Å ~Ncy~Ð~NegativeMediumSpace~â~NegativeThickSpace~â~NegativeThinSpace~â~NegativeVeryThinSpace~â~NestedGreaterGreater~â«~NestedLessLess~âª~NewLine~\n~Nfr~ð~NoBreak~â ~NonBreakingSpace~ ~Nopf~â~Not~⫬~NotCongruent~â¢~NotCupCap~â~NotDoubleVerticalBar~â¦~NotElement~â~NotEqual~â ~NotEqualTilde~â̸~NotExists~â~NotGreater~â¯~NotGreaterEqual~â±~NotGreaterFullEqual~â§Ì¸~NotGreaterGreater~â«Ì¸~NotGreaterLess~â¹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~âµ~NotHumpDownHump~â̸~NotHumpEqual~â̸~NotLeftTriangle~âª~NotLeftTriangleBar~â§
26240̸~NotLeftTriangleEqual~â¬~NotLess~â®~NotLessEqual~â°~NotLessGreater~â¸~NotLessLess~âªÌ¸~NotLessSlantEqual~⩽̸~NotLessTilde~â´~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~â~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~â ~NotReverseElement~â~NotRightTriangle~â«~NotRightTriangleBar~â§Ì¸~NotRightTriangleEqual~â~NotSquareSubset~â̸~NotSquareSubsetEqual~â¢~NotSquareSuperset~â̸~NotSquareSupersetEqual~â£~NotSubset~ââ~NotSubsetEqual~â~NotSucceeds~â~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~â¡~NotSucceedsTilde~â¿Ì¸~NotSuperset~ââ~NotSupersetEqual~â~NotTilde~â~NotTildeEqual~â~NotTildeFullEqual~â~NotTildeTilde~â~NotVerticalBar~â¤~Nscr~ð©~Ocy~Ð~Odblac~Å~Ofr~ð~Omacr~Å~Oopf~ð~OpenCurlyDoubleQuote~â~OpenCurlyQuote~â~Or~â©~Oscr~ðª~Otimes~⨷~OverBar~â¾~OverBrace~â~OverBracket~â´~OverParenthesis~â~PartialD~â~Pcy~Ð~Pfr~ð~PlusMinus~±~Poincareplane~â~Popf~â~Pr~⪻~Precedes~âº~PrecedesEqual~⪯~PrecedesSlantEqual~â¼~PrecedesTilde~â¾~Product~â~Proportion~â·~Proportional~â~Pscr~ð«~Qfr~ð~Qopf~â~Qscr~ð¬~RBarr~â¤~Racute~Å~Rang~â«~Rarr~â ~Rarrtl~â¤~Rcaron~Å~Rcedil~Å~Rcy~Ð ~Re~â~ReverseElement~â~ReverseEquilibrium~â~ReverseUpEquilibrium~⥯~Rfr~â~RightAngleBracket~â©~RightArrow~â~RightArrowBar~â¥~RightArrowLeftArrow~â~RightCeiling~â~RightDoubleBracket~â§~RightDownTeeVector~â¥~RightDownVector~â~RightDownVectorBar~â¥~RightFloor~â~RightTee~â¢~RightTeeArrow~â¦~RightTeeVector~â¥~RightTriangle~â³~RightTriangleBar~â§~RightTriangleEqual~âµ~RightUpDownVector~â¥~RightUpTeeVector~â¥~RightUpVector~â¾~RightUpVectorBar~â¥~RightVector~â~RightVectorBar~â¥~Rightarrow~â~Ropf~â~RoundImplies~⥰~Rrightarrow~â~Rscr~â~Rsh~â±~RuleDelayed~â§´~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Å~Sc~⪼~Scedil~Å~Scirc~Å~Scy~С~Sfr~ð~ShortDownArrow~â~ShortLeftArrow~â~ShortRightArrow~â~ShortUpArrow~â~SmallCircle~â~Sopf~ð~Sqrt~â~Square~â¡~SquareIntersection~â~SquareSubset~â~SquareSubsetEqual~â~SquareSuperset~â~SquareSupersetEqual~â~SquareUnion~â~Sscr~ð®~Star~â~Sub~â~Subset~â~SubsetEqual~â~Succeeds~â»~SucceedsEqual~⪰~SucceedsSlantEqual~â½~SucceedsTilde~â¿~SuchThat~â~Sum~â~Sup~â~Superset~â~SupersetEqual~â~Supset~â~TRADE~â¢~TSHcy~Ð~TScy~Ц~Tab~
vendor: 15,711 bytes, line 26240
26240~Tcaron~Ť~Tcedil~Å¢~Tcy~Т~Tfr~ð~Therefore~â´~ThickSpace~ââ~ThinSpace~â~Tilde~â¼~TildeEqual~â~TildeFullEqual~â
~TildeTilde~â~Topf~ð~TripleDot~â~Tscr~ð¯~Tstrok~Ŧ~Uarr~â~Uarrocir~â¥~Ubrcy~Ð~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~ð~Umacr~Ū~UnderBar~_~UnderBrace~â~UnderBracket~âµ~UnderParenthesis~â~Union~â~UnionPlus~â~Uogon~Ų~Uopf~ð~UpArrow~â~UpArrowBar~â¤~UpArrowDownArrow~â
~UpDownArrow~â~UpEquilibrium~⥮~UpTee~â¥~UpTeeArrow~â¥~Uparrow~â~Updownarrow~â~UpperLeftArrow~â~UpperRightArrow~â~Upsi~Ï~Uring~Å®~Uscr~ð°~Utilde~Ũ~VDash~â«~Vbar~â««~Vcy~Ð~Vdash~â©~Vdashl~⫦~Vee~â~Verbar~â~Vert~â~VerticalBar~â£~VerticalLine~|~VerticalSeparator~â~VerticalTilde~â~VeryThinSpace~â~Vfr~ð~Vopf~ð~Vscr~ð±~Vvdash~âª~Wcirc~Å´~Wedge~â~Wfr~ð~Wopf~ð~Wscr~ð²~Xfr~ð~Xopf~ð~Xscr~ð³~YAcy~Я~YIcy~Ð~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~ð~Yopf~ð~Yscr~ð´~ZHcy~Ð~Zacute~Ź~Zcaron~Ž~Zcy~Ð~Zdot~Å»~ZeroWidthSpace~â~Zfr~â¨~Zopf~â¤~Zscr~ðµ~abreve~Ä~ac~â¾~acE~â¾Ì³~acd~â¿~acy~а~af~â¡~afr~ð~aleph~âµ~amacr~Ä~amalg~⨿~andand~â©~andd~â©~andslope~â©~andv~â©~ange~⦤~angle~â ~angmsd~â¡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~â¦~angmsdag~⦮~angmsdah~⦯~angrt~â~angrtvb~â¾~angrtvbd~â¦~angsph~â¢~angst~Ã
~angzarr~â¼~aogon~Ä
~aopf~ð~ap~â~apE~â©°~apacir~⩯~ape~â~apid~â~approx~â~approxeq~â~ascr~ð¶~ast~*~asympeq~â~awconint~â³~awint~â¨~bNot~â«~backcong~â~backepsilon~϶~backprime~âµ~backsim~â½~backsimeq~â~barvee~â½~barwed~â
~barwedge~â
~bbrk~âµ~bbrktbrk~â¶~bcong~â~bcy~б~becaus~âµ~because~âµ~bemptyv~⦰~bepsi~϶~bernou~â¬~beth~â¶~between~â¬~bfr~ð~bigcap~â~bigcirc~â¯~bigcup~â~bigodot~â¨~bigoplus~â¨~bigotimes~â¨~bigsqcup~â¨~bigstar~â
~bigtriangledown~â½~bigtriangleup~â³~biguplus~â¨~bigvee~â~bigwedge~â~bkarow~â¤~blacklozenge~â§«~blacksquare~âª~blacktriangle~â´~blacktriangledown~â¾~blacktriangleleft~â~blacktriangleright~â¸~blank~â£~blk12~â~blk14~â~blk34~â~block~â~bne~=â¥~bnequiv~â¡â¥~bnot~â~bopf~ð~bot~â¥~bottom~â¥~bowtie~â~boxDL~â~boxDR~â~boxDl~â~boxDr~â~boxH~â~boxHD~â¦~boxHU~â©~boxHd~â¤~boxHu~â§~boxUL~â~boxUR~â~boxUl~â~boxUr~â~boxV~â~boxVH~â¬~boxVL~â£~boxVR~â ~boxVh~â«~boxVl~â¢~boxVr~â~boxbox~â§~boxdL~â~boxdR~â~boxdl~â~boxdr~â~boxh~â~boxhD~â¥~boxhU~â¨~boxhd~â¬~boxhu~â´~boxminus~â~boxplus~â~boxtimes~â ~boxuL~â~boxuR~â~boxul~â~boxur~â~boxv~â~boxvH~âª~boxvL~â¡~boxvR~â~boxvh~â¼~boxvl~â¤~boxvr~â~bprime~âµ~breve~Ë~bscr~ð·~bsemi~â~bsim~â½~bsime~â~bsol~\\~bsolb~â§
~bsolhsub~â~bullet~â¢~bump~â~bumpE~⪮~bumpe~â~bumpeq~â~cacute~Ä~capand~â©~capbrcup~â©~capcap~â©~capcup~â©~capdot~â©~caps~â©ï¸~caret~â~caron~Ë~ccaps~â©~ccaron~Ä~ccirc~Ä~ccups~â©~ccupssm~â©~cdot~Ä~cemptyv~⦲~centerdot~·~cfr~ð ~chcy~Ñ~check~â~checkmark~â~cir~â~cirE~â§~circeq~â~circlearrowleft~âº~circlearrowright~â»~circledR~®~circledS~â~circledast~â~circledcirc~â~circleddash~â~cire~â~cirfnint~â¨~cirmid~⫯~cirscir~â§~clubsuit~â£~colon~:~colone~â~coloneq~â~comma~,~commat~@~comp~â~compfn~â~complement~â~complexes~â~congdot~â©~conint~â®~copf~ð~coprod~â~copysr~â~cross~â~cscr~ð¸~csub~â«~csube~â«~csup~â«~csupe~â«~ctdot~â¯~cudarrl~⤸~cudarrr~⤵~cuepr~â~cuesc~â~cularr~â¶~cularrp~⤽~cupbrcap~â©~cupcap~â©~cupcup~â©~cupdot~â~cupor~â©
~cups~âªï¸~curarr~â·~curarrm~⤼~curlyeqprec~â~curlyeqsucc~â~curlyvee~â~curlywedge~â~curvearrowleft~â¶~curvearrowright~â·~cuvee~â~cuwed~â~cwconint~â²~cwint~â±~cylcty~â~dHar~⥥~daleth~â¸~dash~â~dashv~â£~dbkarow~â¤~dblac~Ë~dcaron~Ä~dcy~д~dd~â
~ddagger~â¡~ddarr~â~ddotseq~â©·~demptyv~⦱~dfisht~⥿~dfr~ð¡~dharl~â~dharr~â~diam~â~diamond~â~diamondsuit~â¦~die~¨~digamma~Ï~disin~â²~div~÷~divideontimes~â~divonx~â~djcy~Ñ~dlcorn~â~dlcrop~â~dollar~$~dopf~ð~dot~Ë~doteq~â~doteqdot~â~dotminus~â¸~dotplus~â~dotsquare~â¡~doublebarwedge~â~downarrow~â~downdownarrows~â~downharpoonleft~â~downharpoonright~â~drbkarow~â¤~drcorn~â~drcrop~â~dscr~ð¹~dscy~Ñ~dsol~â§¶~dstrok~Ä~dtdot~â±~dtri~â¿~dtrif~â¾~duarr~âµ~duhar~⥯~dwangle~⦦~dzcy~Ñ~dzigrarr~â¿~eDDot~â©·~eDot~â~easter~â©®~ecaron~Ä~ecir~â~ecolon~â~ecy~Ñ~edot~Ä~ee~â
~efDot~â~efr~ð¢~eg~âª~egs~âª~egsdot~âª~el~âª~elinters~â§~ell~â~els~âª~elsdot~âª~emacr~Ä~emptyset~â
~emptyv~â
~emsp13~â~emsp14~â
~eng~Å~eogon~Ä~eopf~ð~epar~â~eparsl~â§£~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~â~eqcolon~â~eqsim~â~eqslantgtr~âª~eqslantless~âª~equals~=~equest~â~equivDD~⩸~eqvparsl~â§¥~erDot~â~erarr~⥱~escr~â¯~esdot~â~esim~â~excl~!~expectation~â°~exponentiale~â
~fallingdotseq~â~fcy~Ñ~female~â~ffilig~ï¬~fflig~ï¬~ffllig~ï¬~ffr~ð£~filig~ï¬~fjlig~fj~flat~â~fllig~ï¬~fltns~â±~fopf~ð~fork~â~forkv~â«~fpartint~â¨~frac13~â
~frac15~â
~frac16~â
~frac18~â
~frac23~â
~frac25~â
~frac35~â
~frac38~â
~frac45~â
~frac56~â
~frac58~â
~frac78~â
~frown~â¢~fscr~ð»~gE~â§~gEl~âª~gacute~ǵ~gammad~Ï~gap~âª~gbreve~Ä~gcirc~Ä~gcy~г~gdot~Ä¡~gel~â~geq~â¥~geqq~â§~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~âª~gesdoto~âª~gesdotol~âª~gesl~âï¸~gesles~âª~gfr~ð¤~gg~â«~ggg~â~gimel~â·~gjcy~Ñ~gl~â·~glE~âª~gla~⪥~glj~⪤~gnE~â©~gnap~âª~gnapprox~âª~gne~âª~gneq~âª~gneqq~â©~gnsim~â§~gopf~ð~grave~`~gscr~â~gsim~â³~gsime~âª~gsiml~âª~gtcc~⪧~gtcir~⩺~gtdot~â~gtlPar~â¦~gtquest~⩼~gtrapprox~âª~gtrarr~⥸~gtrdot~â~gtreqless~â~gtreqqless~âª~gtrless~â·~gtrsim~â³~gvertneqq~â©ï¸~gvnE~â©ï¸~hairsp~â~half~½~hamilt~â~hardcy~Ñ~harrcir~â¥~harrw~â~hbar~â~hcirc~Ä¥~heartsuit~â¥~hercon~â¹~hfr~ð¥~hksearow~⤥~hkswarow~⤦~hoarr~â¿~homtht~â»~hookleftarrow~â©~hookrightarrow~âª~hopf~ð~horbar~â~hscr~ð½~hslash~â~hstrok~ħ~hybull~â~hyphen~â~ic~â£~icy~и~iecy~е~iff~â~ifr~ð¦~ii~â
~iiiint~â¨~iiint~â~iinfin~â§~iiota~â©~ijlig~ij~imacr~Ä«~imagline~â~imagpart~â~imath~ı~imof~â·~imped~Ƶ~in~â~incare~â
~infintie~â§~inodot~ı~intcal~âº~integers~â¤~intercal~âº~intlarhk~â¨~intprod~⨼~iocy~Ñ~iogon~į~iopf~ð~iprod~⨼~iscr~ð¾~isinE~â¹~isindot~âµ~isins~â´~isinsv~â³~isinv~â~it~â¢~itilde~Ä©~iukcy~Ñ~jcirc~ĵ~jcy~й~jfr~ð§~jmath~È·~jopf~ð~jscr~ð¿~jsercy~Ñ~jukcy~Ñ~kappav~ϰ~kcedil~Ä·~kcy~к~kfr~ð¨~kgreen~ĸ~khcy~Ñ
~kjcy~Ñ~kopf~ð~kscr~ð~lAarr~â~lAtail~â¤~lBarr~â¤~lE~â¦~lEg~âª~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~â~langd~â¦~langle~â¨~lap~âª
~larrb~â¤~larrbfs~â¤~larrfs~â¤~larrhk~â©~larrlp~â«~larrpl~⤹~larrsim~⥳~larrtl~â¢~lat~⪫~latail~â¤~late~âª~lates~âªï¸~lbarr~â¤~lbbrk~â²~lbrace~{~lbrack~[~lbrke~â¦~lbrksld~â¦~lbrkslu~â¦~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~â~ldrdhar~⥧~ldrushar~â¥~ldsh~â²~leftarrow~â~leftarrowtail~â¢~leftharpoondown~â½~leftharpoonup~â¼~leftleftarrows~â~leftrightarrow~â~leftrightarrows~â~leftrightharpoons~â~leftrightsquigarrow~â~leftthreetimes~â~leg~â~leq~â¤~leqq~â¦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~â©¿~lesdoto~âª~lesdotor~âª~lesg~âï¸~lesges~âª~lessapprox~âª
~lessdot~â~lesseqgtr~â~lesseqqgtr~âª~lessgtr~â¶~lesssim~â²~lfisht~⥼~lfr~ð©~lg~â¶~lgE~âª~lhard~â½~lharu~â¼~lharul~⥪~lhblk~â~ljcy~Ñ~ll~âª~llarr~â~llcorner~â~llhard~⥫~lltri~âº~lmidot~Å~lmoust~â°~lmoustache~â°~lnE~â¨~lnap~âª~lnapprox~âª~lne~âª~lneq~âª~lneqq~â¨~lnsim~â¦~loang~â¬~loarr~â½~lobrk~â¦~longleftarrow~âµ~longleftrightarrow~â·~longmapsto~â¼~longrightarrow~â¶~looparrowleft~â«~looparrowright~â¬~lopar~â¦
~lopf~ð~loplus~â¨~lotimes~⨴~lowbar~_~lozenge~â~lozf~â§«~lpar~(~lparlt~â¦~lrarr~â~lrcorner~â~lrhar~â~lrhard~â¥~lrtri~â¿~lscr~ð~lsh~â°~lsim~â²~lsime~âª~lsimg~âª~lsqb~[~lsquor~â~lstrok~Å~ltcc~⪦~ltcir~⩹~ltdot~â~lthree~â~ltimes~â~ltlarr~⥶~ltquest~â©»~ltrPar~â¦~ltri~â~ltrie~â´~ltrif~â~lurdshar~â¥~luruhar~⥦~lvertneqq~â¨ï¸~lvnE~â¨ï¸~mDDot~âº~male~â~malt~â ~maltese~â ~map~â¦~mapsto~â¦~mapstodown~â§~mapstoleft~â¤~mapstoup~â¥~marker~â®~mcomma~⨩~mcy~м~measuredangle~â¡~mfr~ðª~mho~â§~mid~â£~midast~*~midcir~â«°~minusb~â~minusd~â¸~minusdu~⨪~mlcp~â«~mldr~â¦~mnplus~â~models~â§~mopf~ð~mp~â~mscr~ð~mstpos~â¾~multimap~â¸~mumap~â¸~nGg~â̸~nGt~â«â~nGtv~â«Ì¸~nLeftarrow~â~nLeftrightarrow~â~nLl~â̸~nLt~âªâ~nLtv~âªÌ¸~nRightarrow~â~nVDash~â¯~nVdash~â®~nacute~Å~nang~â â~nap~â~napE~⩰̸~napid~â̸~napos~Å~napprox~â~natur~â®~natural~â®~naturals~â~nbump~â̸~nbumpe~â̸~ncap~â©~ncaron~Å~ncedil~Å~ncong~â~ncongdot~â©Ì¸~ncup~â©~ncy~н~neArr~â~nearhk~⤤~nearr~â~nearrow~â~nedot~â̸~nequiv~â¢~nesear~⤨~nesim~â̸~nexist~â~nexists~â~nfr~ð«~ngE~â§Ì¸~nge~â±~ngeq~â±~ngeqq~â§Ì¸~ngeqslant~⩾̸~nges~⩾̸~ngsim~âµ~ngt~â¯~ngtr~â¯~nhArr~â~nharr~â®~nhpar~⫲~nis~â¼~nisd~âº~niv~â~njcy~Ñ~nlArr~â~nlE~â¦Ì¸~nlarr~â~nldr~â¥~nle~â°~nleftarrow~â~nleftrightarrow~â®~nleq~â°~nleqq~â¦Ì¸~nleqslant~⩽̸~nles~⩽̸~nless~â®~nlsim~â´~nlt~â®~nltri~âª~nltrie~â¬~nmid~â¤~nopf~ð~notinE~â¹Ì¸~notindot~âµÌ¸~notinva~â~notinvb~â·~notinvc~â¶~notni~â~notniva~â~notnivb~â¾~notnivc~â½~npar~â¦~nparallel~â¦~nparsl~⫽â¥~npart~â̸~npolint~â¨~npr~â~nprcue~â ~npre~⪯̸~nprec~â~npreceq~⪯̸~nrArr~â~nrarr~â~nrarrc~⤳̸~nrarrw~â̸~nrightarrow~â~nrtri~â«~nrtrie~â~nsc~â~nsccue~â¡~nsce~⪰̸~nscr~ð~nshortmid~â¤~nshortparallel~â¦~nsim~â~nsime~â~nsimeq~â~nsmid~â¤~nspar~â¦~nsqsube~â¢~nsqsupe~â£~nsubE~â«
̸~nsube~â~nsubset~ââ~nsubseteq~â~nsubseteqq~â«
̸~nsucc~â~nsucceq~⪰̸~nsup~â
~nsupE~â«Ì¸~nsupe~â~nsupset~ââ~nsupseteq~â~nsupseteqq~â«Ì¸~ntgl~â¹~ntlg~â¸~ntriangleleft~âª~ntrianglelefteq~â¬~ntriangleright~â«~ntrianglerighteq~â~num~#~numero~â~numsp~â~nvDash~â~nvHarr~â¤~nvap~ââ~nvdash~â¬~nvge~â¥â~nvgt~>â~nvinfin~â§~nvlArr~â¤~nvle~â¤â~nvlt~<â~nvltrie~â´â~nvrArr~â¤~nvrtrie~âµâ~nvsim~â¼â~nwArr~â~nwarhk~⤣~nwarr~â~nwarrow~â~nwnear~⤧~oS~â~oast~â~ocir~â~ocy~о~odash~â~odblac~Å~odiv~⨸~odot~â~odsold~⦼~ofcir~⦿~ofr~ð¬~ogon~Ë~ogt~â§~ohbar~⦵~ohm~Ω~oint~â®~olarr~âº~olcir~⦾~olcross~⦻~olt~â§~omacr~Å~omid~⦶~ominus~â~oopf~ð ~opar~⦷~operp~⦹~orarr~â»~ord~â©~order~â´~orderof~â´~origof~â¶~oror~â©~orslope~â©~orv~â©~oscr~â´~osol~â~otimesas~⨶~ovbar~â½~par~â¥~parallel~â¥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~â±~pfr~ð~phiv~Ï~phmmat~â³~phone~â~pitchfork~â~planck~â~planckh~â~plankv~â~plus~+~plusacir~⨣~plusb~â~pluscir~⨢~plusdo~â~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~â¨~popf~ð¡~pr~âº~prE~⪳~prap~⪷~prcue~â¼~pre~⪯~prec~âº~precapprox~⪷~preccurlyeq~â¼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~â¨~precsim~â¾~primes~â~prnE~⪵~prnap~⪹~prnsim~â¨~profalar~â®~profline~â~profsurf~â~propto~â~prsim~â¾~prurel~â°~pscr~ð
~puncsp~â~qfr~ð®~qint~â¨~qopf~ð¢~qprime~â~qscr~ð~quaternions~â~quatint~â¨~quest~?~questeq~â~rAarr~â~rAtail~â¤~rBarr~â¤~rHar~⥤~race~â½Ì±~racute~Å~raemptyv~⦳~rangd~â¦~range~⦥~rangle~â©~rarrap~⥵~rarrb~â¥~rarrbfs~⤠~rarrc~⤳~rarrfs~â¤~rarrhk~âª~rarrlp~â¬~rarrpl~â¥
~rarrsim~⥴~rarrtl~â£~rarrw~â~ratail~â¤~ratio~â¶~rationals~â~rbarr~â¤~rbbrk~â³~rbrace~}~rbrack~]~rbrke~â¦~rbrksld~â¦~rbrkslu~â¦~rcaron~Å~rcedil~Å~rcub~}~rcy~Ñ~rdca~⤷~rdldhar~⥩~rdquor~â~rdsh~â³~realine~â~realpart~â~reals~â~rect~â~rfisht~⥽~rfr~ð¯~rhard~â~rharu~â~rharul~⥬~rhov~ϱ~rightarrow~â~rightarrowtail~â£~rightharpoondown~â~rightharpoonup~â~rightleftarrows~â~rightleftharpoons~â~rightrightarrows~â~rightsquigarrow~â~rightthreetimes~â~ring~Ë~risingdotseq~â~rlarr~â~rlhar~â~rmoust~â±~rmoustache~â±~rnmid~â«®~roang~â~roarr~â¾~robrk~â§~ropar~â¦~ropf~ð£~roplus~⨮~rotimes~⨵~rpar~)~rpargt~â¦~rppolint~â¨~rrarr~â~rscr~ð~rsh~â±~rsqb~]~rsquor~â~rthree~â~rtimes~â~rtri~â¹~rtrie~âµ~rtrif~â¸~rtriltri~â§~ruluhar~⥨~rx~â~sacute~Å~sc~â»~scE~⪴~scap~⪸~sccue~â½~sce~⪰~scedil~Å~scirc~Å~scnE~⪶~scnap~⪺~scnsim~â©~scpolint~â¨~scsim~â¿~scy~Ñ~sdotb~â¡~sdote~⩦~seArr~â~searhk~⤥~searr~â~searrow~â~semi~;~seswar~⤩~setminus~â~setmn~â~sext~â¶~sfr~ð°~sfrown~â¢~sharp~â¯~shchcy~Ñ~shcy~Ñ~shortmid~â£~shortparallel~â¥~sigmav~Ï~simdot~⩪~sime~â~simeq~â~simg~âª~simgE~⪠~siml~âª~simlE~âª~simne~â~simplus~⨤~simrarr~⥲~slarr~â~smallsetminus~â~smashp~⨳~smeparsl~⧤~smid~â£~smile~â£~smt~⪪~smte~⪬~smtes~⪬ï¸~softcy~Ñ~sol~/~solb~â§~solbar~â¿~sopf~ð¤~spadesuit~â ~spar~â¥~sqcap~â~sqcaps~âï¸~sqcup~â~sqcups~âï¸~sqsub~â~sqsube~â~sqsubset~â~sqsubseteq~â~sqsup~â~sqsupe~â~sqsupset~â~sqsupseteq~â~squ~â¡~square~â¡~squarf~âª~squf~âª~srarr~â~sscr~ð~ssetmn~â~ssmile~â£~sstarf~â~star~â~starf~â
~straightepsilon~ϵ~straightphi~Ï~strns~¯~subE~â«
~subdot~⪽~subedot~â«~submult~â«~subnE~â«~subne~â~subplus~⪿~subrarr~⥹~subset~â~subseteq~â~subseteqq~â«
~subsetneq~â~subsetneqq~â«~subsim~â«~subsub~â«~subsup~â«~succ~â»~succapprox~⪸~succcurlyeq~â½~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~â©~succsim~â¿~sung~âª~supE~â«~supdot~⪾~supdsub~â«~supedot~â«~suphsol~â~suphsub~â«~suplarr~⥻~supmult~â«~supnE~â«~supne~â~supplus~â«~supset~â~supseteq~â~supseteqq~â«~supsetneq~â~supsetneqq~â«~supsim~â«~supsub~â«~supsup~â«~swArr~â~swarhk~⤦~swarr~â~swarrow~â~swnwar~⤪~target~â~tbrk~â´~tcaron~Å¥~tcedil~Å£~tcy~Ñ~tdot~â~telrec~â~tfr~ð±~therefore~â´~thetav~Ï~thickapprox~â~thicksim~â¼~thkap~â~thksim~â¼~timesb~â ~timesbar~⨱~timesd~⨰~tint~â~toea~⤨~top~â¤~topbot~â¶~topcir~⫱~topf~ð¥~topfork~â«~tosa~⤩~tprime~â´~triangle~âµ~triangledown~â¿~triangleleft~â~trianglelefteq~â´~triangleq~â~triangleright~â¹~trianglerighteq~âµ~tridot~â¬~trie~â~triminus~⨺~triplus~⨹~trisb~â§~tritime~⨻~trpezium~â¢~tscr~ð~tscy~Ñ~tshcy~Ñ~tstrok~ŧ~twixt~â¬~twoheadleftarrow~â~twoheadrightarrow~â ~uHar~⥣~ubrcy~Ñ~ubreve~Å~ucy~Ñ~udarr~â
~udblac~ű~udhar~⥮~ufisht~⥾~ufr~ð²~uharl~â¿~uharr~â¾~uhblk~â~ulcorn~â~ulcorner~â~ulcrop~â~ultri~â¸~umacr~Å«~uogon~ų~uopf~ð¦~uparrow~â~updownarrow~â~upharpoonleft~â¿~upharpoonright~â¾~uplus~â~upsi~Ï
~upuparrows~â~urcorn~â~urcorner~â~urcrop~â~uring~ů~urtri~â¹~uscr~ð~utdot~â°~utilde~Å©~utri~âµ~utrif~â´~uuarr~â~uwangle~⦧~vArr~â~vBar~⫨~vBarv~â«©~vDash~â¨~vangrt~â¦~varepsilon~ϵ~varkappa~ϰ~varnothing~â
~varphi~Ï~varpi~Ï~varpropto~â~varr~â~varrho~ϱ~varsigma~Ï~varsubsetneq~âï¸~varsubsetneqq~â«ï¸~varsupsetneq~âï¸~varsupsetneqq~â«ï¸~vartheta~Ï~vartriangleleft~â²~vartriangleright~â³~vcy~в~vdash~â¢~vee~â¨~veebar~â»~veeeq~â~vellip~â®~verbar~|~vert~|~vfr~ð³~vltri~â²~vnsub~ââ~vnsup~ââ~vopf~ð§~vprop~â~vrtri~â³~vscr~ð~vsubnE~â«ï¸~vsubne~âï¸~vsupnE~â«ï¸~vsupne~âï¸~vzigzag~â¦~wcirc~ŵ~wedbar~â©~wedge~â§~wedgeq~â~wfr~ð´~wopf~ð¨~wp~â~wr~â~wreath~â~wscr~ð~xcap~â~xcirc~â¯~xcup~â~xdtri~â½~xfr~ðµ~xhArr~âº~xharr~â·~xlArr~â¸~xlarr~âµ~xmap~â¼~xnis~â»~xodot~â¨~xopf~ð©~xoplus~â¨~xotime~â¨~xrArr~â¹~xrarr~â¶~xscr~ð~xsqcup~â¨~xuplus~â¨~xutri~â³~xvee~â~xwedge~â~yacy~Ñ~ycirc~Å·~ycy~Ñ~yfr~ð¶~yicy~Ñ~yopf~ðª~yscr~ð~yucy~Ñ~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~â¨~zfr~ð·~zhcy~ж~zigrarr~â~zopf~ð«~zscr~ð~~AMP~&~COPY~©~GT~>~LT~<~QUOT~
26240"~REG~®', namedReferences["html4"]); 26241 var numericUnicodeMap = { 26242 0: 65533, 26243 128: 8364, 26244 130: 8218, 26245 131: 402, 26246 132: 8222, 26247 133: 8230, 26248 134: 8224, 26249 135: 8225, 26250 136: 710, 26251 137: 8240, 26252 138: 352, 26253 139: 8249, 26254 140: 338, 26255 142: 381, 26256 145: 8216, 26257 146: 8217, 26258 147: 8220, 26259 148: 8221, 26260 149: 8226, 26261 150: 8211, 26262 151: 8212, 26263 152: 732, 26264 153: 8482, 26265 154: 353, 26266 155: 8250, 26267 156: 339, 26268 158: 382, 26269 159: 376 26270 }; 26271 var fromCodePoint = String.fromCodePoint || function(astralCodePoint) { 26272 return String.fromCharCode(Math.floor((astralCodePoint - 65536) / 1024) + 55296, (astralCodePoint - 65536) % 1024 + 56320); 26273 }; 26274 var __assign$1 = function() { 26275 __assign$1 = Object.assign || function(t2) { 26276 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 26277 s2 = arguments[i2]; 26278 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) 26279 t2[p2] = s2[p2]; 26280 } 26281 return t2; 26282 }; 26283 return __assign$1.apply(this, arguments); 26284 }; 26285 var allNamedReferences = __assign$1(__assign$1({}, namedReferences), { all: namedReferences.html5 }); 26286 var defaultDecodeOptions = { 26287 scope: "body", 26288 level: "all" 26289 }; 26290 var strict = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g; 26291 var attribute = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g; 26292 var baseDecodeRegExps = { 26293 xml: { 26294 strict, 26295 attribute, 26296 body: bodyRegExps.xml 26297 }, 26298 html4: { 26299 strict, 26300 attribute, 26301 body: bodyRegExps.html4 26302 }, 26303 html5: { 26304 strict, 26305 attribute, 26306 body: bodyRegExps.html5 26307 } 26308 }; 26309 var decodeRegExps = __assign$1(__assign$1({}, baseDecodeRegExps), { all: baseDecodeRegExps.html5 }); 26310 var fromCharCode = String.fromCharCode; 26311 var outOfBoundsChar = fromCharCode(65533); 26312 function getDecodedEntity(entity, references, isAttribute, isStrict) { 26313 var decodeResult = entity; 26314 var decodeEntityLastChar = entity[entity.length - 1]; 26315 if (isAttribute && decodeEntityLastChar === "=") { 26316 decodeResult = entity; 26317 } else if (isStrict && decodeEntityLastChar !== ";") { 26318 decodeResult = entity; 26319 } else { 26320 var decodeResultByReference = references[entity]; 26321 if (decodeResultByReference) { 26322 decodeResult = decodeResultByReference; 26323 } else if (entity[0] === "&" && entity[1] === "#") { 26324 var decodeSecondChar = entity[2]; 26325 var decodeCode = decodeSecondChar == "x" || decodeSecondChar == "X" ? parseInt(entity.substr(3), 16) : parseInt(entity.substr(2)); 26326 decodeResult = decodeCode >= 1114111 ? outOfBoundsChar : decodeCode > 65535 ? fromCodePoint(decodeCode) : fromCharCode(numericUnicodeMap[decodeCode] || decodeCode); 26327 } 26328 } 26329 return decodeResult; 26330 } 26331 function decode(text2, _a) { 26332 var _b = _a === void 0 ? defaultDecodeOptions : _a, _c = _b.level, level = _c === void 0 ? "all" : _c, _d = _b.scope, scope = _d === void 0 ? level === "xml" ? "strict" : "body" : _d; 26333 if (!text2) { 26334 return ""; 26335 } 26336 var decodeRegExp = decodeRegExps[level][scope]; 26337 var references = allNamedReferences[level].entities; 26338 var isAttribute = scope === "attribute"; 26339 var isStrict = scope === "strict"; 26340 return text2.replace(decodeRegExp, function(entity) { 26341 return getDecodedEntity(entity, references, isAttribute, isStrict); 26342 }); 26343 } 26344 /*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */ 26345 function _arrayLikeToArray$2(r2, a2) { 26346 (null == a2 || a2 > r2.length) && (a2 = r2.length); 26347 for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2]; 26348 return n2; 26349 } 26350 function _arrayWithHoles$2(r2) { 26351 if (Array.isArray(r2)) return r2; 26352 } 26353 function _iterableToArrayLimit$2(r2, l2) { 26354 var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"]; 26355 if (null != t2) { 26356 var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
26357 try { 26358 if (i2 = (t2 = t2.call(r2)).next, 0 === l2) ; 26359 else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ; 26360 } catch (r3) { 26361 o2 = true, n2 = r3; 26362 } finally { 26363 try { 26364 if (!f2 && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) return; 26365 } finally { 26366 if (o2) throw n2; 26367 } 26368 } 26369 return a2; 26370 } 26371 } 26372 function _nonIterableRest$2() { 26373 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 26374 } 26375 function _slicedToArray$2(r2, e2) { 26376 return _arrayWithHoles$2(r2) || _iterableToArrayLimit$2(r2, e2) || _unsupportedIterableToArray$2(r2, e2) || _nonIterableRest$2(); 26377 } 26378 function _unsupportedIterableToArray$2(r2, a2) { 26379 if (r2) { 26380 if ("string" == typeof r2) return _arrayLikeToArray$2(r2, a2); 26381 var t2 = {}.toString.call(r2).slice(8, -1); 26382 return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$2(r2, a2) : void 0; 26383 } 26384 } 26385 const entries = Object.entries, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 26386 let freeze = Object.freeze, seal = Object.seal, create$9 = Object.create; 26387 let _ref = typeof Reflect !== "undefined" && Reflect, apply = _ref.apply, construct = _ref.construct; 26388 if (!freeze) { 26389 freeze = function freeze2(x2) { 26390 return x2; 26391 }; 26392 } 26393 if (!seal) { 26394 seal = function seal2(x2) { 26395 return x2; 26396 }; 26397 } 26398 if (!apply) { 26399 apply = function apply2(func, thisArg) { 26400 for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { 26401 args[_key - 2] = arguments[_key]; 26402 } 26403 return func.apply(thisArg, args); 26404 }; 26405 } 26406 if (!construct) { 26407 construct = function construct2(Func) { 26408 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 26409 args[_key2 - 1] = arguments[_key2]; 26410 } 26411 return new Func(...args); 26412 }; 26413 } 26414 const arrayForEach = unapply(Array.prototype.forEach); 26415 const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf); 26416 const arrayPop = unapply(Array.prototype.pop); 26417 const arrayPush = unapply(Array.prototype.push); 26418 const arraySplice = unapply(Array.prototype.splice); 26419 const arrayIsArray = Array.isArray; 26420 const stringToLowerCase = unapply(String.prototype.toLowerCase); 26421 const stringToString = unapply(String.prototype.toString); 26422 const stringMatch = unapply(String.prototype.match); 26423 const stringReplace = unapply(String.prototype.replace); 26424 const stringIndexOf = unapply(String.prototype.indexOf); 26425 const stringTrim = unapply(String.prototype.trim); 26426 const numberToString = unapply(Number.prototype.toString); 26427 const booleanToString = unapply(Boolean.prototype.toString); 26428 const bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString); 26429 const symbolToString$1 = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString); 26430 const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty); 26431 const objectToString = unapply(Object.prototype.toString); 26432 const regExpTest = unapply(RegExp.prototype.test); 26433 const typeErrorCreate = unconstruct(TypeError); 26434 function unapply(func) { 26435 return function(thisArg) { 26436 if (thisArg instanceof RegExp) { 26437 thisArg.lastIndex = 0; 26438 } 26439 for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { 26440 args[_key3 - 1] = arguments[_key3]; 26441 } 26442 return apply(func, thisArg, args); 26443 }; 26444 } 26445 function unconstruct(Func) { 26446 return function() { 26447 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
vendor: 8,250 bytes, lines 26448-26577
26448 args[_key4] = arguments[_key4]; 26449 } 26450 return construct(Func, args); 26451 }; 26452 } 26453 function addToSet(set2, array2) { 26454 let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase; 26455 if (setPrototypeOf) { 26456 setPrototypeOf(set2, null); 26457 } 26458 if (!arrayIsArray(array2)) { 26459 return set2; 26460 } 26461 let l2 = array2.length; 26462 while (l2--) { 26463 let element = array2[l2]; 26464 if (typeof element === "string") { 26465 const lcElement = transformCaseFunc(element); 26466 if (lcElement !== element) { 26467 if (!isFrozen(array2)) { 26468 array2[l2] = lcElement; 26469 } 26470 element = lcElement; 26471 } 26472 } 26473 set2[element] = true; 26474 } 26475 return set2; 26476 } 26477 function cleanArray(array2) { 26478 for (let index2 = 0; index2 < array2.length; index2++) { 26479 const isPropertyExist = objectHasOwnProperty(array2, index2); 26480 if (!isPropertyExist) { 26481 array2[index2] = null; 26482 } 26483 } 26484 return array2; 26485 } 26486 function clone$1(object2) { 26487 const newObject = create$9(null); 26488 for (const _ref2 of entries(object2)) { 26489 var _ref3 = _slicedToArray$2(_ref2, 2); 26490 const property2 = _ref3[0]; 26491 const value = _ref3[1]; 26492 const isPropertyExist = objectHasOwnProperty(object2, property2); 26493 if (isPropertyExist) { 26494 if (arrayIsArray(value)) { 26495 newObject[property2] = cleanArray(value); 26496 } else if (value && typeof value === "object" && value.constructor === Object) { 26497 newObject[property2] = clone$1(value); 26498 } else { 26499 newObject[property2] = value; 26500 } 26501 } 26502 } 26503 return newObject; 26504 } 26505 function stringifyValue(value) { 26506 switch (typeof value) { 26507 case "string": { 26508 return value; 26509 } 26510 case "number": { 26511 return numberToString(value); 26512 } 26513 case "boolean": { 26514 return booleanToString(value); 26515 } 26516 case "bigint": { 26517 return bigintToString ? bigintToString(value) : "0"; 26518 } 26519 case "symbol": { 26520 return symbolToString$1 ? symbolToString$1(value) : "Symbol()"; 26521 } 26522 case "undefined": { 26523 return objectToString(value); 26524 } 26525 case "function": 26526 case "object": { 26527 if (value === null) { 26528 return objectToString(value); 26529 } 26530 const valueAsRecord = value; 26531 const valueToString = lookupGetter(valueAsRecord, "toString"); 26532 if (typeof valueToString === "function") { 26533 const stringified = valueToString(valueAsRecord); 26534 return typeof stringified === "string" ? stringified : objectToString(stringified); 26535 } 26536 return objectToString(value); 26537 } 26538 default: { 26539 return objectToString(value); 26540 } 26541 } 26542 } 26543 function lookupGetter(object2, prop) { 26544 while (object2 !== null) { 26545 const desc = getOwnPropertyDescriptor(object2, prop); 26546 if (desc) { 26547 if (desc.get) { 26548 return unapply(desc.get); 26549 } 26550 if (typeof desc.value === "function") { 26551 return unapply(desc.value); 26552 } 26553 } 26554 object2 = getPrototypeOf(object2); 26555 } 26556 function fallbackValue() { 26557 return null; 26558 } 26559 return fallbackValue; 26560 } 26561 function isRegex(value) { 26562 try { 26563 regExpTest(value, ""); 26564 return true; 26565 } catch (_unused) { 26566 return false; 26567 } 26568 } 26569 const html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]); 26570 const svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]); 26571 const svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]); 26572 const svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]); 26573 const mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]); 26574 const mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]); 26575 const text = freeze(["#text"]); 26576 const html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]); 26577 const svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "dis
26577play", "divisor", "dominant-baseline", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-orientation", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]); 26578 const mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]); 26579 const xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]); 26580 const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g); 26581 const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g); 26582 const TMPLIT_EXPR = seal(/\${[\w\W]*/g); 26583 const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); 26584 const ARIA_ATTR = seal(/^aria-[\-\w]+$/); 26585 const IS_ALLOWED_URI = seal(
vendor: 4,923 bytes, lines 26586-26696
26586 /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i 26587 // eslint-disable-line no-useless-escape 26588 ); 26589 const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); 26590 const ATTR_WHITESPACE = seal( 26591 /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g 26592 // eslint-disable-line no-control-regex 26593 ); 26594 const DOCTYPE_NAME = seal(/^html$/i); 26595 const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i); 26596 const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g); 26597 const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g); 26598 const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i); 26599 const SELF_CLOSING_TAG = seal(/\/>/i); 26600 const NODE_TYPE = { 26601 element: 1, 26602 attribute: 2, 26603 text: 3, 26604 cdataSection: 4, 26605 entityReference: 5, 26606 // Deprecated 26607 entityNode: 6, 26608 // Deprecated 26609 processingInstruction: 7, 26610 comment: 8, 26611 document: 9, 26612 documentType: 10, 26613 documentFragment: 11, 26614 notation: 12 26615 // Deprecated 26616 }; 26617 const getGlobal = function getGlobal2() { 26618 return typeof window === "undefined" ? null : window; 26619 }; 26620 const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) { 26621 if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") { 26622 return null; 26623 } 26624 let suffix = null; 26625 const ATTR_NAME = "data-tt-policy-suffix"; 26626 if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) { 26627 suffix = purifyHostElement.getAttribute(ATTR_NAME); 26628 } 26629 const policyName = "dompurify" + (suffix ? "#" + suffix : ""); 26630 try { 26631 return trustedTypes.createPolicy(policyName, { 26632 createHTML(html2) { 26633 return html2; 26634 }, 26635 createScriptURL(scriptUrl) { 26636 return scriptUrl; 26637 } 26638 }); 26639 } catch (_2) { 26640 console.warn("TrustedTypes policy " + policyName + " could not be created."); 26641 return null; 26642 } 26643 }; 26644 const _createHooksMap = function _createHooksMap2() { 26645 return { 26646 afterSanitizeAttributes: [], 26647 afterSanitizeElements: [], 26648 afterSanitizeShadowDOM: [], 26649 beforeSanitizeAttributes: [], 26650 beforeSanitizeElements: [], 26651 beforeSanitizeShadowDOM: [], 26652 uponSanitizeAttribute: [], 26653 uponSanitizeElement: [], 26654 uponSanitizeShadowNode: [] 26655 }; 26656 }; 26657 const _resolveSetOption = function _resolveSetOption2(cfg, key, fallback, options2) { 26658 return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options2.base ? clone$1(options2.base) : {}, cfg[key], options2.transform) : fallback; 26659 }; 26660 function createDOMPurify() { 26661 let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(); 26662 const DOMPurify = (root2) => createDOMPurify(root2); 26663 DOMPurify.version = "3.4.12"; 26664 DOMPurify.removed = []; 26665 if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) { 26666 DOMPurify.isSupported = false; 26667 return DOMPurify; 26668 } 26669 let document2 = window2.document; 26670 const originalDocument = document2; 26671 const currentScript = originalDocument.currentScript; 26672 window2.DocumentFragment; 26673 const HTMLTemplateElement = window2.HTMLTemplateElement, Node2 = window2.Node, Element2 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap; 26674 _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap; 26675 window2.HTMLFormElement; 26676 const DOMParser = window2.DOMParser, trustedTypes = window2.trustedTypes; 26677 const ElementPrototype = Element2.prototype; 26678 const cloneNode = lookupGetter(ElementPrototype, "cloneNode"); 26679 const remove = lookupGetter(ElementPrototype, "remove"); 26680 const getNextSibling = lookupGetter(ElementPrototype, "nextSibling"); 26681 const getChildNodes = lookupGetter(ElementPrototype, "childNodes"); 26682 const getParentNode2 = lookupGetter(ElementPrototype, "parentNode"); 26683 const getShadowRoot = lookupGetter(ElementPrototype, "shadowRoot"); 26684 const getAttributes = lookupGetter(ElementPrototype, "attributes"); 26685 const getNodeType = Node2 && Node2.prototype ? lookupGetter(Node2.prototype, "nodeType") : null; 26686 const getNodeName2 = Node2 && Node2.prototype ? lookupGetter(Node2.prototype, "nodeName") : null; 26687 if (typeof HTMLTemplateElement === "function") { 26688 const template = document2.createElement("template"); 26689 if (template.content && template.content.ownerDocument) { 26690 document2 = template.content.ownerDocument; 26691 } 26692 } 26693 let trustedTypesPolicy; 26694 let emptyHTML = ""; 26695 let defaultTrustedTypesPolicy; 26696 let defaultTrustedTypesPolicyResolved = false;
vendor: 3,872 bytes, lines 26697-26784
26697 let IN_TRUSTED_TYPES_POLICY = 0; 26698 const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy2() { 26699 if (IN_TRUSTED_TYPES_POLICY > 0) { 26700 throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.'); 26701 } 26702 }; 26703 const _createTrustedHTML = function _createTrustedHTML2(html2) { 26704 _assertNotInTrustedTypesPolicy(); 26705 IN_TRUSTED_TYPES_POLICY++; 26706 try { 26707 return trustedTypesPolicy.createHTML(html2); 26708 } finally { 26709 IN_TRUSTED_TYPES_POLICY--; 26710 } 26711 }; 26712 const _createTrustedScriptURL = function _createTrustedScriptURL2(scriptUrl) { 26713 _assertNotInTrustedTypesPolicy(); 26714 IN_TRUSTED_TYPES_POLICY++; 26715 try { 26716 return trustedTypesPolicy.createScriptURL(scriptUrl); 26717 } finally { 26718 IN_TRUSTED_TYPES_POLICY--; 26719 } 26720 }; 26721 const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy2() { 26722 if (!defaultTrustedTypesPolicyResolved) { 26723 defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript); 26724 defaultTrustedTypesPolicyResolved = true; 26725 } 26726 return defaultTrustedTypesPolicy; 26727 }; 26728 const _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName; 26729 const importNode = originalDocument.importNode; 26730 let hooks = _createHooksMap(); 26731 DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode2 === "function" && implementation && implementation.createHTMLDocument !== void 0; 26732 const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT; 26733 let IS_ALLOWED_URI$1 = IS_ALLOWED_URI; 26734 let ALLOWED_TAGS = null; 26735 const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]); 26736 let ALLOWED_ATTR = null; 26737 const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]); 26738 let CUSTOM_ELEMENT_HANDLING = Object.seal(create$9(null, { 26739 tagNameCheck: { 26740 writable: true, 26741 configurable: false, 26742 enumerable: true, 26743 value: null 26744 }, 26745 attributeNameCheck: { 26746 writable: true, 26747 configurable: false, 26748 enumerable: true, 26749 value: null 26750 }, 26751 allowCustomizedBuiltInElements: { 26752 writable: true, 26753 configurable: false, 26754 enumerable: true, 26755 value: false 26756 } 26757 })); 26758 let FORBID_TAGS = null; 26759 let FORBID_ATTR = null; 26760 const EXTRA_ELEMENT_HANDLING = Object.seal(create$9(null, { 26761 tagCheck: { 26762 writable: true, 26763 configurable: false, 26764 enumerable: true, 26765 value: null 26766 }, 26767 attributeCheck: { 26768 writable: true, 26769 configurable: false, 26770 enumerable: true, 26771 value: null 26772 } 26773 })); 26774 let ALLOW_ARIA_ATTR = true; 26775 let ALLOW_DATA_ATTR = true; 26776 let ALLOW_UNKNOWN_PROTOCOLS = false; 26777 let ALLOW_SELF_CLOSE_IN_ATTR = true; 26778 let SAFE_FOR_TEMPLATES = false; 26779 let SAFE_FOR_XML = true; 26780 let WHOLE_DOCUMENT = false; 26781 let SET_CONFIG = false; 26782 let SET_CONFIG_ALLOWED_TAGS = null; 26783 let SET_CONFIG_ALLOWED_ATTR = null; 26784 let FORCE_BODY = false;
26785 let RETURN_DOM = false; 26786 let RETURN_DOM_FRAGMENT = false; 26787 let RETURN_TRUSTED_TYPE = false; 26788 let SANITIZE_DOM = true; 26789 let SANITIZE_NAMED_PROPS = false; 26790 const SANITIZE_NAMED_PROPS_PREFIX = "user-content-"; 26791 let KEEP_CONTENT = true; 26792 let IN_PLACE = false; 26793 let USE_PROFILES = {}; 26794 let FORBID_CONTENTS = null; 26795 const DEFAULT_FORBID_CONTENTS = addToSet({}, [ 26796 "annotation-xml", 26797 "audio", 26798 "colgroup", 26799 "desc", 26800 "foreignobject", 26801 "head", 26802 "iframe", 26803 "math", 26804 "mi", 26805 "mn", 26806 "mo", 26807 "ms", 26808 "mtext", 26809 "noembed", 26810 "noframes", 26811 "noscript", 26812 "plaintext", 26813 "script", 26814 // <selectedcontent> mirrors the selected <option>'s subtree, cloned by 26815 // the UA (customizable <select>) â including any on* handlers â and the 26816 // engine re-mirrors synchronously whenever a removal changes which 26817 // option/selectedcontent is current, even inside DOMPurify's inert 26818 // DOMParser document. Hoisting its children on removal re-inserts a fresh 26819 // mirror target ahead of the walk, which the engine refills, looping 26820 // forever (DoS) and amplifying output. Dropping its content on removal 26821 // (rather than hoisting) breaks that cascade; the content is a duplicate 26822 // of the option, which is sanitized on its own. See campaign-3 F1/F6. 26823 "selectedcontent", 26824 "style", 26825 "svg", 26826 "template", 26827 "thead", 26828 "title", 26829 "video", 26830 "xmp" 26831 ]); 26832 let DATA_URI_TAGS = null; 26833 const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]); 26834 let URI_SAFE_ATTRIBUTES = null; 26835 const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]); 26836 const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML"; 26837 const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; 26838 const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; 26839 let NAMESPACE = HTML_NAMESPACE; 26840 let IS_EMPTY_INPUT = false;
vendor: 1,968 bytes, lines 26841-26874
26841 let ALLOWED_NAMESPACES = null; 26842 const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString); 26843 const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(["mi", "mo", "mn", "ms", "mtext"]); 26844 let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); 26845 const DEFAULT_HTML_INTEGRATION_POINTS = freeze(["annotation-xml"]); 26846 let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); 26847 const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]); 26848 let PARSER_MEDIA_TYPE = null; 26849 const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"]; 26850 const DEFAULT_PARSER_MEDIA_TYPE = "text/html"; 26851 let transformCaseFunc = null; 26852 let CONFIG = null; 26853 const formElement = document2.createElement("form"); 26854 const isRegexOrFunction = function isRegexOrFunction2(testValue) { 26855 return testValue instanceof RegExp || testValue instanceof Function; 26856 }; 26857 const _parseConfig = function _parseConfig2() { 26858 let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 26859 if (CONFIG && CONFIG === cfg) { 26860 return; 26861 } 26862 if (!cfg || typeof cfg !== "object") { 26863 cfg = {}; 26864 } 26865 cfg = clone$1(cfg); 26866 PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes 26867 SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE; 26868 transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase; 26869 ALLOWED_TAGS = _resolveSetOption(cfg, "ALLOWED_TAGS", DEFAULT_ALLOWED_TAGS, { 26870 transform: transformCaseFunc 26871 }); 26872 ALLOWED_ATTR = _resolveSetOption(cfg, "ALLOWED_ATTR", DEFAULT_ALLOWED_ATTR, { 26873 transform: transformCaseFunc 26874 });
vendor: 9,382 bytes, lines 26875-27056
26875 ALLOWED_NAMESPACES = _resolveSetOption(cfg, "ALLOWED_NAMESPACES", DEFAULT_ALLOWED_NAMESPACES, { 26876 transform: stringToString 26877 }); 26878 URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, "ADD_URI_SAFE_ATTR", DEFAULT_URI_SAFE_ATTRIBUTES, { 26879 transform: transformCaseFunc, 26880 base: DEFAULT_URI_SAFE_ATTRIBUTES 26881 }); 26882 DATA_URI_TAGS = _resolveSetOption(cfg, "ADD_DATA_URI_TAGS", DEFAULT_DATA_URI_TAGS, { 26883 transform: transformCaseFunc, 26884 base: DEFAULT_DATA_URI_TAGS 26885 }); 26886 FORBID_CONTENTS = _resolveSetOption(cfg, "FORBID_CONTENTS", DEFAULT_FORBID_CONTENTS, { 26887 transform: transformCaseFunc 26888 }); 26889 FORBID_TAGS = _resolveSetOption(cfg, "FORBID_TAGS", clone$1({}), { 26890 transform: transformCaseFunc 26891 }); 26892 FORBID_ATTR = _resolveSetOption(cfg, "FORBID_ATTR", clone$1({}), { 26893 transform: transformCaseFunc 26894 }); 26895 USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone$1(cfg.USE_PROFILES) : cfg.USE_PROFILES : false; 26896 ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; 26897 ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; 26898 ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; 26899 ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; 26900 SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; 26901 SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; 26902 WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; 26903 RETURN_DOM = cfg.RETURN_DOM || false; 26904 RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; 26905 RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; 26906 FORCE_BODY = cfg.FORCE_BODY || false; 26907 SANITIZE_DOM = cfg.SANITIZE_DOM !== false; 26908 SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; 26909 KEEP_CONTENT = cfg.KEEP_CONTENT !== false; 26910 IN_PLACE = cfg.IN_PLACE || false; 26911 IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; 26912 NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE; 26913 MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone$1(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); 26914 HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone$1(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); 26915 const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone$1(cfg.CUSTOM_ELEMENT_HANDLING) : create$9(null); 26916 CUSTOM_ELEMENT_HANDLING = create$9(null); 26917 if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) { 26918 CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; 26919 } 26920 if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) { 26921 CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; 26922 } 26923 if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") { 26924 CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; 26925 } 26926 seal(CUSTOM_ELEMENT_HANDLING); 26927 if (SAFE_FOR_TEMPLATES) { 26928 ALLOW_DATA_ATTR = false; 26929 } 26930 if (RETURN_DOM_FRAGMENT) { 26931 RETURN_DOM = true; 26932 } 26933 if (USE_PROFILES) { 26934 ALLOWED_TAGS = addToSet({}, text); 26935 ALLOWED_ATTR = create$9(null); 26936 if (USE_PROFILES.html === true) { 26937 addToSet(ALLOWED_TAGS, html$1); 26938 addToSet(ALLOWED_ATTR, html); 26939 } 26940 if (USE_PROFILES.svg === true) { 26941 addToSet(ALLOWED_TAGS, svg$1); 26942 addToSet(ALLOWED_ATTR, svg); 26943 addToSet(ALLOWED_ATTR, xml); 26944 } 26945 if (USE_PROFILES.svgFilters === true) { 26946 addToSet(ALLOWED_TAGS, svgFilters); 26947 addToSet(ALLOWED_ATTR, svg); 26948 addToSet(ALLOWED_ATTR, xml); 26949 } 26950 if (USE_PROFILES.mathMl === true) { 26951 addToSet(ALLOWED_TAGS, mathMl$1); 26952 addToSet(ALLOWED_ATTR, mathMl); 26953 addToSet(ALLOWED_ATTR, xml); 26954 } 26955 } 26956 EXTRA_ELEMENT_HANDLING.tagCheck = null; 26957 EXTRA_ELEMENT_HANDLING.attributeCheck = null; 26958 if (objectHasOwnProperty(cfg, "ADD_TAGS")) { 26959 if (typeof cfg.ADD_TAGS === "function") { 26960 EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS; 26961 } else if (arrayIsArray(cfg.ADD_TAGS)) { 26962 if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { 26963 ALLOWED_TAGS = clone$1(ALLOWED_TAGS); 26964 } 26965 addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc); 26966 } 26967 } 26968 if (objectHasOwnProperty(cfg, "ADD_ATTR")) { 26969 if (typeof cfg.ADD_ATTR === "function") { 26970 EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR; 26971 } else if (arrayIsArray(cfg.ADD_ATTR)) { 26972 if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { 26973 ALLOWED_ATTR = clone$1(ALLOWED_ATTR); 26974 } 26975 addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc); 26976 } 26977 } 26978 if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) { 26979 addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc); 26980 } 26981 if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) { 26982 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 26983 FORBID_CONTENTS = clone$1(FORBID_CONTENTS); 26984 } 26985 addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc); 26986 } 26987 if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) { 26988 if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { 26989 FORBID_CONTENTS = clone$1(FORBID_CONTENTS); 26990 } 26991 addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc); 26992 } 26993 if (KEEP_CONTENT) { 26994 ALLOWED_TAGS["#text"] = true; 26995 } 26996 if (WHOLE_DOCUMENT) { 26997 addToSet(ALLOWED_TAGS, ["html", "head", "body"]); 26998 } 26999 if (ALLOWED_TAGS.table) { 27000 addToSet(ALLOWED_TAGS, ["tbody"]); 27001 delete FORBID_TAGS.tbody; 27002 } 27003 if (cfg.TRUSTED_TYPES_POLICY) { 27004 if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") { 27005 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); 27006 } 27007 if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") { 27008 throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); 27009 } 27010 const previousTrustedTypesPolicy = trustedTypesPolicy; 27011 trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY; 27012 try { 27013 emptyHTML = _createTrustedHTML(""); 27014 } catch (error) { 27015 trustedTypesPolicy = previousTrustedTypesPolicy; 27016 throw error; 27017 } 27018 } else if (cfg.TRUSTED_TYPES_POLICY === null) { 27019 trustedTypesPolicy = void 0; 27020 emptyHTML = ""; 27021 } else { 27022 if (trustedTypesPolicy === void 0) { 27023 trustedTypesPolicy = _getDefaultTrustedTypesPolicy(); 27024 } 27025 if (trustedTypesPolicy && typeof emptyHTML === "string") { 27026 emptyHTML = _createTrustedHTML(""); 27027 } 27028 } 27029 if (freeze) { 27030 freeze(cfg); 27031 } 27032 CONFIG = cfg; 27033 }; 27034 const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]); 27035 const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]); 27036 const _checkSvgNamespace = function _checkSvgNamespace2(tagName, parent, parentTagName) { 27037 if (parent.namespaceURI === HTML_NAMESPACE) { 27038 return tagName === "svg"; 27039 } 27040 if (parent.namespaceURI === MATHML_NAMESPACE) { 27041 return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); 27042 } 27043 return Boolean(ALL_SVG_TAGS[tagName]); 27044 }; 27045 const _checkMathMlNamespace = function _checkMathMlNamespace2(tagName, parent, parentTagName) { 27046 if (parent.namespaceURI === HTML_NAMESPACE) { 27047 return tagName === "math"; 27048 } 27049 if (parent.namespaceURI === SVG_NAMESPACE) { 27050 return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName]; 27051 } 27052 return Boolean(ALL_MATHML_TAGS[tagName]); 27053 }; 27054 const _checkHtmlNamespace = function _checkHtmlNamespace2(tagName, parent, parentTagName) { 27055 if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { 27056 return false;
vendor: 27,760 bytes, lines 27057-27688
27057 } 27058 if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { 27059 return false; 27060 } 27061 return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); 27062 }; 27063 const _checkValidNamespace = function _checkValidNamespace2(element) { 27064 let parent = getParentNode2(element); 27065 if (!parent || !parent.tagName) { 27066 parent = { 27067 namespaceURI: NAMESPACE, 27068 tagName: "template" 27069 }; 27070 } 27071 const tagName = stringToLowerCase(element.tagName); 27072 const parentTagName = stringToLowerCase(parent.tagName); 27073 if (!ALLOWED_NAMESPACES[element.namespaceURI]) { 27074 return false; 27075 } 27076 if (element.namespaceURI === SVG_NAMESPACE) { 27077 return _checkSvgNamespace(tagName, parent, parentTagName); 27078 } 27079 if (element.namespaceURI === MATHML_NAMESPACE) { 27080 return _checkMathMlNamespace(tagName, parent, parentTagName); 27081 } 27082 if (element.namespaceURI === HTML_NAMESPACE) { 27083 return _checkHtmlNamespace(tagName, parent, parentTagName); 27084 } 27085 if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) { 27086 return true; 27087 } 27088 return false; 27089 }; 27090 const _forceRemove = function _forceRemove2(node2) { 27091 arrayPush(DOMPurify.removed, { 27092 element: node2 27093 }); 27094 try { 27095 getParentNode2(node2).removeChild(node2); 27096 } catch (_2) { 27097 remove(node2); 27098 if (!getParentNode2(node2)) { 27099 throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place"); 27100 } 27101 } 27102 }; 27103 const _neutralizeRoot = function _neutralizeRoot2(root2) { 27104 _neutralizeSubtree(root2); 27105 const childNodes = getChildNodes(root2); 27106 if (childNodes) { 27107 const snapshot = []; 27108 arrayForEach(childNodes, (child) => { 27109 arrayPush(snapshot, child); 27110 }); 27111 arrayForEach(snapshot, (child) => { 27112 try { 27113 remove(child); 27114 } catch (_2) { 27115 } 27116 }); 27117 } 27118 const attributes = getAttributes(root2); 27119 if (attributes) { 27120 for (let i2 = attributes.length - 1; i2 >= 0; --i2) { 27121 const attribute2 = attributes[i2]; 27122 const name = attribute2 && attribute2.name; 27123 if (typeof name === "string") { 27124 try { 27125 root2.removeAttribute(name); 27126 } catch (_2) { 27127 } 27128 } 27129 } 27130 } 27131 }; 27132 const _removeAttribute = function _removeAttribute2(name, element) { 27133 try { 27134 arrayPush(DOMPurify.removed, { 27135 attribute: element.getAttributeNode(name), 27136 from: element 27137 }); 27138 } catch (_2) { 27139 arrayPush(DOMPurify.removed, { 27140 attribute: null, 27141 from: element 27142 }); 27143 } 27144 element.removeAttribute(name); 27145 if (name === "is") { 27146 if (RETURN_DOM || RETURN_DOM_FRAGMENT) { 27147 try { 27148 _forceRemove(element); 27149 } catch (_2) { 27150 } 27151 } else { 27152 try { 27153 element.setAttribute(name, ""); 27154 } catch (_2) { 27155 } 27156 } 27157 } 27158 }; 27159 const _stripDisallowedAttributes = function _stripDisallowedAttributes2(element) { 27160 const attributes = getAttributes(element); 27161 if (!attributes) { 27162 return; 27163 } 27164 for (let i2 = attributes.length - 1; i2 >= 0; --i2) { 27165 const attribute2 = attributes[i2]; 27166 const name = attribute2 && attribute2.name; 27167 if (typeof name !== "string" || ALLOWED_ATTR[transformCaseFunc(name)]) { 27168 continue; 27169 } 27170 try { 27171 element.removeAttribute(name); 27172 } catch (_2) { 27173 } 27174 } 27175 }; 27176 const _neutralizeSubtree = function _neutralizeSubtree2(root2) { 27177 const stack = [root2]; 27178 while (stack.length > 0) { 27179 const node2 = stack.pop(); 27180 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27181 if (nodeType === NODE_TYPE.element) { 27182 _stripDisallowedAttributes(node2); 27183 } 27184 const childNodes = getChildNodes(node2); 27185 if (childNodes) { 27186 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27187 stack.push(childNodes[i2]); 27188 } 27189 } 27190 } 27191 }; 27192 const _neutralizePatchLinkage = function _neutralizePatchLinkage2(root2) { 27193 if (!SAFE_FOR_XML) { 27194 return; 27195 } 27196 const stack = [root2]; 27197 while (stack.length > 0) { 27198 const node2 = stack.pop(); 27199 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27200 if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node2.data)) { 27201 try { 27202 remove(node2); 27203 } catch (_2) { 27204 } 27205 continue; 27206 } 27207 if (nodeType === NODE_TYPE.element) { 27208 const element = node2; 27209 const lcTag = transformCaseFunc(getNodeName2 ? getNodeName2(node2) : node2.nodeName); 27210 try { 27211 if (element.hasAttribute && element.hasAttribute("patchsrc")) { 27212 element.removeAttribute("patchsrc"); 27213 } 27214 if (element.hasAttribute && element.hasAttribute("for") && lcTag !== "label" && lcTag !== "output") { 27215 element.removeAttribute("for"); 27216 } 27217 } catch (_2) { 27218 } 27219 } 27220 const childNodes = getChildNodes(node2); 27221 if (childNodes) { 27222 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27223 stack.push(childNodes[i2]); 27224 } 27225 } 27226 } 27227 }; 27228 const _initDocument = function _initDocument2(dirty) { 27229 let doc = null; 27230 let leadingWhitespace = null; 27231 if (FORCE_BODY) { 27232 dirty = "<remove></remove>" + dirty; 27233 } else { 27234 const matches2 = stringMatch(dirty, /^[\r\n\t ]+/); 27235 leadingWhitespace = matches2 && matches2[0]; 27236 } 27237 if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) { 27238 dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + "</body></html>"; 27239 } 27240 const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty; 27241 if (NAMESPACE === HTML_NAMESPACE) { 27242 try { 27243 doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); 27244 } catch (_2) { 27245 } 27246 } 27247 if (!doc || !doc.documentElement) { 27248 doc = implementation.createDocument(NAMESPACE, "template", null); 27249 try { 27250 doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload; 27251 } catch (_2) { 27252 } 27253 } 27254 const body = doc.body || doc.documentElement; 27255 if (dirty && leadingWhitespace) { 27256 body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null); 27257 } 27258 if (NAMESPACE === HTML_NAMESPACE) { 27259 return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0]; 27260 } 27261 return WHOLE_DOCUMENT ? doc.documentElement : body; 27262 }; 27263 const _createNodeIterator = function _createNodeIterator2(root2) { 27264 return createNodeIterator.call( 27265 root2.ownerDocument || root2, 27266 root2, 27267 // eslint-disable-next-line no-bitwise 27268 NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, 27269 null 27270 ); 27271 }; 27272 const _stripTemplateExpressions = function _stripTemplateExpressions2(value) { 27273 value = stringReplace(value, MUSTACHE_EXPR$1, " "); 27274 value = stringReplace(value, ERB_EXPR$1, " "); 27275 value = stringReplace(value, TMPLIT_EXPR$1, " "); 27276 return value; 27277 }; 27278 const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node2) { 27279 var _node$querySelectorAl; 27280 node2.normalize(); 27281 const walker = createNodeIterator.call( 27282 node2.ownerDocument || node2, 27283 node2, 27284 // eslint-disable-next-line no-bitwise 27285 NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, 27286 null 27287 ); 27288 let currentNode = walker.nextNode(); 27289 while (currentNode) { 27290 currentNode.data = _stripTemplateExpressions(currentNode.data); 27291 currentNode = walker.nextNode(); 27292 } 27293 const templates = (_node$querySelectorAl = node2.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node2, "template"); 27294 if (templates) { 27295 arrayForEach(templates, (tmpl) => { 27296 if (_isDocumentFragment(tmpl.content)) { 27297 _scrubTemplateExpressions2(tmpl.content); 27298 } 27299 }); 27300 } 27301 }; 27302 const _isClobbered = function _isClobbered2(element) { 27303 const realTagName = getNodeName2 ? getNodeName2(element) : null; 27304 if (typeof realTagName !== "string") { 27305 return false; 27306 } 27307 if (transformCaseFunc(realTagName) !== "form") { 27308 return false; 27309 } 27310 return typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || // Realm-safe NamedNodeMap detection: equality against the cached 27311 // prototype getter. Clobbered .attributes (e.g. <input name="attributes">) 27312 // makes the direct read diverge from the cached read; a clean form 27313 // (same-realm OR foreign-realm) has both reads pointing at the same 27314 // canonical NamedNodeMap. 27315 element.attributes !== getAttributes(element) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter 27316 // returns the integer 1 for any Element regardless of realm; direct 27317 // read on a clobbered form (e.g. <input name="nodeType">) returns 27318 // the named child element. Cheap addition â nodeType is read from 27319 // an internal slot, no serialization cost â and removes a residual 27320 // clobbering surface used by several mXSS / PI / comment branches 27321 // in _sanitizeElements that compare currentNode.nodeType directly. 27322 element.nodeType !== getNodeType(element) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named 27323 // "childNodes" shadows the prototype getter. Direct reads of 27324 // form.childNodes from a clobbered form return the named child 27325 // instead of the real NodeList, so any walk that reads it directly 27326 // skips the form's real children. Compare the direct read to the 27327 // cached Node.prototype getter â when the form's named-property 27328 // getter intercepts the read, the two values differ and we flag 27329 // the form. This catches every clobbering child type (input, 27330 // select, etc.) regardless of whether the named child happens to 27331 // carry a numeric .length, which a typeof-based probe would miss 27332 // (e.g. HTMLSelectElement.length is a defined unsigned-long). 27333 element.childNodes !== getChildNodes(element); 27334 }; 27335 const _isDocumentFragment = function _isDocumentFragment2(value) { 27336 if (!getNodeType || typeof value !== "object" || value === null) { 27337 return false; 27338 } 27339 try { 27340 return getNodeType(value) === NODE_TYPE.documentFragment; 27341 } catch (_2) { 27342 return false; 27343 } 27344 }; 27345 const _isNode = function _isNode2(value) { 27346 if (!getNodeType || typeof value !== "object" || value === null) { 27347 return false; 27348 } 27349 try { 27350 return typeof getNodeType(value) === "number"; 27351 } catch (_2) { 27352 return false; 27353 } 27354 }; 27355 function _executeHooks(hooks2, currentNode, data) { 27356 if (hooks2.length === 0) { 27357 return; 27358 } 27359 arrayForEach(hooks2, (hook) => { 27360 hook.call(DOMPurify, currentNode, data, CONFIG); 27361 }); 27362 } 27363 const _isUnsafeNode = function _isUnsafeNode2(currentNode, tagName) { 27364 if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) { 27365 return true; 27366 } 27367 if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) { 27368 return true; 27369 } 27370 if (currentNode.nodeType === NODE_TYPE.processingInstruction) { 27371 return true; 27372 } 27373 if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) { 27374 return true; 27375 } 27376 return false; 27377 }; 27378 const _sanitizeDisallowedNode = function _sanitizeDisallowedNode2(currentNode, tagName) { 27379 if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) { 27380 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) { 27381 return false; 27382 } 27383 if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) { 27384 return false; 27385 } 27386 } 27387 if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) { 27388 const parentNode = getParentNode2(currentNode); 27389 const childNodes = getChildNodes(currentNode); 27390 if (childNodes && parentNode) { 27391 const childCount = childNodes.length; 27392 for (let i2 = childCount - 1; i2 >= 0; --i2) { 27393 const hoisted = IN_PLACE ? childNodes[i2] : cloneNode(childNodes[i2], true); 27394 parentNode.insertBefore(hoisted, getNextSibling(currentNode)); 27395 } 27396 } 27397 } 27398 _forceRemove(currentNode); 27399 return true; 27400 }; 27401 const _sanitizeElements = function _sanitizeElements2(currentNode, root2) { 27402 _executeHooks(hooks.beforeSanitizeElements, currentNode, null); 27403 if (currentNode !== root2 && getParentNode2(currentNode) === null) { 27404 return true; 27405 } 27406 if (_isClobbered(currentNode)) { 27407 _forceRemove(currentNode); 27408 return true; 27409 } 27410 const tagName = transformCaseFunc(getNodeName2 ? getNodeName2(currentNode) : currentNode.nodeName); 27411 _executeHooks(hooks.uponSanitizeElement, currentNode, { 27412 tagName, 27413 allowedTags: ALLOWED_TAGS 27414 }); 27415 if (currentNode !== root2 && getParentNode2(currentNode) === null) { 27416 return true; 27417 } 27418 if (_isUnsafeNode(currentNode, tagName)) { 27419 _forceRemove(currentNode); 27420 return true; 27421 } 27422 if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) { 27423 const removed = _sanitizeDisallowedNode(currentNode, tagName); 27424 if (removed === false) { 27425 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 27426 } 27427 return removed; 27428 } 27429 const nt2 = getNodeType ? getNodeType(currentNode) : currentNode.nodeType; 27430 if (nt2 === NODE_TYPE.element && !_checkValidNamespace(currentNode)) { 27431 _forceRemove(currentNode); 27432 return true; 27433 } 27434 if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) { 27435 _forceRemove(currentNode); 27436 return true; 27437 } 27438 if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) { 27439 const content = _stripTemplateExpressions(currentNode.textContent); 27440 if (currentNode.textContent !== content) { 27441 arrayPush(DOMPurify.removed, { 27442 element: currentNode.cloneNode() 27443 }); 27444 currentNode.textContent = content; 27445 } 27446 } 27447 _executeHooks(hooks.afterSanitizeElements, currentNode, null); 27448 return false; 27449 }; 27450 const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) { 27451 if (FORBID_ATTR[lcName]) { 27452 return false; 27453 } 27454 if (SAFE_FOR_XML && lcName === "patchsrc") { 27455 return false; 27456 } 27457 if (SAFE_FOR_XML && lcName === "for" && lcTag !== "label" && lcTag !== "output") { 27458 return false; 27459 } 27460 if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) { 27461 return false; 27462 } 27463 const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag); 27464 if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; 27465 else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; 27466 else if (!nameIsPermitted) { 27467 if ( 27468 // First condition does a very basic check if a) it's basically a valid custom element tagname AND 27469 // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 27470 // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck 27471 _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || // Alternative, second condition checks if it's an `is`-attribute, AND 27472 // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck 27473 lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)) 27474 ) ; 27475 else { 27476 return false; 27477 } 27478 } else if (URI_SAFE_ATTRIBUTES[lcName]) ; 27479 else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ; 27480 else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag]) ; 27481 else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ""))) ; 27482 else if (value) { 27483 return false; 27484 } else ; 27485 return true; 27486 }; 27487 const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]); 27488 const _isBasicCustomElement = function _isBasicCustomElement2(tagName) { 27489 return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName); 27490 }; 27491 const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute2(lcTag, lcName, namespaceURI, value) { 27492 if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function" && !namespaceURI) { 27493 switch (trustedTypes.getAttributeType(lcTag, lcName)) { 27494 case "TrustedHTML": { 27495 return _createTrustedHTML(value); 27496 } 27497 case "TrustedScriptURL": { 27498 return _createTrustedScriptURL(value); 27499 } 27500 } 27501 } 27502 return value; 27503 }; 27504 const _setAttributeValue = function _setAttributeValue2(currentNode, name, namespaceURI, value) { 27505 try { 27506 if (namespaceURI) { 27507 currentNode.setAttributeNS(namespaceURI, name, value); 27508 } else { 27509 currentNode.setAttribute(name, value); 27510 } 27511 if (_isClobbered(currentNode)) { 27512 _forceRemove(currentNode); 27513 } else { 27514 arrayPop(DOMPurify.removed); 27515 } 27516 } catch (_2) { 27517 _removeAttribute(name, currentNode); 27518 } 27519 }; 27520 const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) { 27521 _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null); 27522 const attributes = currentNode.attributes; 27523 if (!attributes || _isClobbered(currentNode)) { 27524 return; 27525 } 27526 const hookEvent = { 27527 attrName: "", 27528 attrValue: "", 27529 keepAttr: true, 27530 allowedAttributes: ALLOWED_ATTR, 27531 forceKeepAttr: void 0 27532 }; 27533 let l2 = attributes.length; 27534 const lcTag = transformCaseFunc(currentNode.nodeName); 27535 while (l2--) { 27536 const attr2 = attributes[l2]; 27537 const name = attr2.name, namespaceURI = attr2.namespaceURI, attrValue = attr2.value; 27538 const lcName = transformCaseFunc(name); 27539 const initValue = attrValue; 27540 let value = name === "value" ? initValue : stringTrim(initValue); 27541 hookEvent.attrName = lcName; 27542 hookEvent.attrValue = value; 27543 hookEvent.keepAttr = true; 27544 hookEvent.forceKeepAttr = void 0; 27545 _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent); 27546 value = hookEvent.attrValue; 27547 if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) { 27548 _removeAttribute(name, currentNode); 27549 value = SANITIZE_NAMED_PROPS_PREFIX + value; 27550 } 27551 if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) { 27552 _removeAttribute(name, currentNode); 27553 continue; 27554 } 27555 if (lcName === "attributename" && stringMatch(value, "href")) { 27556 _removeAttribute(name, currentNode); 27557 continue; 27558 } 27559 if (hookEvent.forceKeepAttr) { 27560 continue; 27561 } 27562 if (!hookEvent.keepAttr) { 27563 _removeAttribute(name, currentNode); 27564 continue; 27565 } 27566 if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) { 27567 _removeAttribute(name, currentNode); 27568 continue; 27569 } 27570 if (SAFE_FOR_TEMPLATES) { 27571 value = _stripTemplateExpressions(value); 27572 } 27573 if (!_isValidAttribute(lcTag, lcName, value)) { 27574 _removeAttribute(name, currentNode); 27575 continue; 27576 } 27577 value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value); 27578 if (value !== initValue) { 27579 _setAttributeValue(currentNode, name, namespaceURI, value); 27580 } 27581 } 27582 _executeHooks(hooks.afterSanitizeAttributes, currentNode, null); 27583 }; 27584 const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) { 27585 let shadowNode = null; 27586 const shadowIterator = _createNodeIterator(fragment); 27587 _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null); 27588 while (shadowNode = shadowIterator.nextNode()) { 27589 _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null); 27590 _sanitizeElements(shadowNode, fragment); 27591 _sanitizeAttributes(shadowNode); 27592 if (_isDocumentFragment(shadowNode.content)) { 27593 _sanitizeShadowDOM2(shadowNode.content); 27594 } 27595 const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType; 27596 if (shadowNodeType === NODE_TYPE.element) { 27597 const innerSr = getShadowRoot(shadowNode); 27598 if (_isDocumentFragment(innerSr)) { 27599 _sanitizeAttachedShadowRoots(innerSr); 27600 _sanitizeShadowDOM2(innerSr); 27601 } 27602 } 27603 } 27604 _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null); 27605 }; 27606 const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots2(root2) { 27607 const stack = [{ 27608 node: root2, 27609 shadow: null 27610 }]; 27611 while (stack.length > 0) { 27612 const item = stack.pop(); 27613 if (item.shadow) { 27614 _sanitizeShadowDOM2(item.shadow); 27615 continue; 27616 } 27617 const node2 = item.node; 27618 const nodeType = getNodeType ? getNodeType(node2) : node2.nodeType; 27619 const isElement2 = nodeType === NODE_TYPE.element; 27620 const childNodes = getChildNodes(node2); 27621 if (childNodes) { 27622 for (let i2 = childNodes.length - 1; i2 >= 0; --i2) { 27623 stack.push({ 27624 node: childNodes[i2], 27625 shadow: null 27626 }); 27627 } 27628 } 27629 if (isElement2) { 27630 const rootName = getNodeName2 ? getNodeName2(node2) : null; 27631 if (typeof rootName === "string" && transformCaseFunc(rootName) === "template") { 27632 const content = node2.content; 27633 if (_isDocumentFragment(content)) { 27634 stack.push({ 27635 node: content, 27636 shadow: null 27637 }); 27638 } 27639 } 27640 } 27641 if (isElement2) { 27642 const sr2 = getShadowRoot(node2); 27643 if (_isDocumentFragment(sr2)) { 27644 stack.push({ 27645 node: null, 27646 shadow: sr2 27647 }, { 27648 node: sr2, 27649 shadow: null 27650 }); 27651 } 27652 } 27653 } 27654 }; 27655 DOMPurify.sanitize = function(dirty) { 27656 let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 27657 let body = null; 27658 let importedNode = null; 27659 let currentNode = null; 27660 let returnNode = null; 27661 IS_EMPTY_INPUT = !dirty; 27662 if (IS_EMPTY_INPUT) { 27663 dirty = "<!-->"; 27664 } 27665 if (typeof dirty !== "string" && !_isNode(dirty)) { 27666 dirty = stringifyValue(dirty); 27667 if (typeof dirty !== "string") { 27668 throw typeErrorCreate("dirty is not a string, aborting"); 27669 } 27670 } 27671 if (!DOMPurify.isSupported) { 27672 return dirty; 27673 } 27674 if (SET_CONFIG) { 27675 ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS; 27676 ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR; 27677 } else { 27678 _parseConfig(cfg); 27679 } 27680 if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) { 27681 ALLOWED_TAGS = clone$1(ALLOWED_TAGS); 27682 } 27683 if (hooks.uponSanitizeAttribute.length > 0) { 27684 ALLOWED_ATTR = clone$1(ALLOWED_ATTR); 27685 } 27686 DOMPurify.removed = []; 27687 const inPlace = IN_PLACE && typeof dirty !== "string" && _isNode(dirty); 27688 if (inPlace) {
vendor: 8,621 bytes, lines 27689-27939
27689 _neutralizePatchLinkage(dirty); 27690 const nn2 = getNodeName2 ? getNodeName2(dirty) : dirty.nodeName; 27691 if (typeof nn2 === "string") { 27692 const tagName = transformCaseFunc(nn2); 27693 if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) { 27694 _neutralizeRoot(dirty); 27695 throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place"); 27696 } 27697 } 27698 if (_isClobbered(dirty)) { 27699 _neutralizeRoot(dirty); 27700 throw typeErrorCreate("root node is clobbered and cannot be sanitized in-place"); 27701 } 27702 try { 27703 _sanitizeAttachedShadowRoots(dirty); 27704 } catch (error) { 27705 _neutralizeRoot(dirty); 27706 throw error; 27707 } 27708 } else if (_isNode(dirty)) { 27709 body = _initDocument("<!---->"); 27710 importedNode = body.ownerDocument.importNode(dirty, true); 27711 if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") { 27712 body = importedNode; 27713 } else if (importedNode.nodeName === "HTML") { 27714 body = importedNode; 27715 } else { 27716 body.appendChild(importedNode); 27717 } 27718 _sanitizeAttachedShadowRoots(importedNode); 27719 } else { 27720 if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && // eslint-disable-next-line unicorn/prefer-includes 27721 dirty.indexOf("<") === -1) { 27722 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty; 27723 } 27724 body = _initDocument(dirty); 27725 if (!body) { 27726 return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : ""; 27727 } 27728 } 27729 if (body && FORCE_BODY) { 27730 _forceRemove(body.firstChild); 27731 } 27732 const walkRoot = inPlace ? dirty : body; 27733 const nodeIterator = _createNodeIterator(walkRoot); 27734 try { 27735 while (currentNode = nodeIterator.nextNode()) { 27736 _sanitizeElements(currentNode, walkRoot); 27737 _sanitizeAttributes(currentNode); 27738 if (_isDocumentFragment(currentNode.content)) { 27739 _sanitizeShadowDOM2(currentNode.content); 27740 } 27741 } 27742 } catch (error) { 27743 if (inPlace) { 27744 _neutralizeRoot(dirty); 27745 arrayForEach(DOMPurify.removed, (entry) => { 27746 if (entry.element) { 27747 _neutralizeSubtree(entry.element); 27748 } 27749 }); 27750 } 27751 throw error; 27752 } 27753 if (inPlace) { 27754 arrayForEach(DOMPurify.removed, (entry) => { 27755 if (entry.element) { 27756 _neutralizeSubtree(entry.element); 27757 } 27758 }); 27759 if (SAFE_FOR_TEMPLATES) { 27760 _scrubTemplateExpressions2(dirty); 27761 } 27762 return dirty; 27763 } 27764 if (RETURN_DOM) { 27765 if (SAFE_FOR_TEMPLATES) { 27766 _scrubTemplateExpressions2(body); 27767 } 27768 if (RETURN_DOM_FRAGMENT) { 27769 returnNode = createDocumentFragment.call(body.ownerDocument); 27770 while (body.firstChild) { 27771 returnNode.appendChild(body.firstChild); 27772 } 27773 } else { 27774 returnNode = body; 27775 } 27776 if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) { 27777 returnNode = importNode.call(originalDocument, returnNode, true); 27778 } 27779 return returnNode; 27780 } 27781 let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML; 27782 if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) { 27783 serializedHTML = "<!DOCTYPE " + body.ownerDocument.doctype.name + ">\n" + serializedHTML; 27784 } 27785 if (SAFE_FOR_TEMPLATES) { 27786 serializedHTML = _stripTemplateExpressions(serializedHTML); 27787 } 27788 return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML; 27789 }; 27790 DOMPurify.setConfig = function() { 27791 let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 27792 _parseConfig(cfg); 27793 SET_CONFIG = true; 27794 SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS; 27795 SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR; 27796 }; 27797 DOMPurify.clearConfig = function() { 27798 CONFIG = null; 27799 SET_CONFIG = false; 27800 SET_CONFIG_ALLOWED_TAGS = null; 27801 SET_CONFIG_ALLOWED_ATTR = null; 27802 trustedTypesPolicy = defaultTrustedTypesPolicy; 27803 emptyHTML = ""; 27804 }; 27805 DOMPurify.isValidAttribute = function(tag, attr2, value) { 27806 if (!CONFIG) { 27807 _parseConfig({}); 27808 } 27809 const lcTag = transformCaseFunc(tag); 27810 const lcName = transformCaseFunc(attr2); 27811 return _isValidAttribute(lcTag, lcName, value); 27812 }; 27813 DOMPurify.addHook = function(entryPoint, hookFunction) { 27814 if (typeof hookFunction !== "function") { 27815 return; 27816 } 27817 if (!objectHasOwnProperty(hooks, entryPoint)) { 27818 return; 27819 } 27820 arrayPush(hooks[entryPoint], hookFunction); 27821 }; 27822 DOMPurify.removeHook = function(entryPoint, hookFunction) { 27823 if (!objectHasOwnProperty(hooks, entryPoint)) { 27824 return void 0; 27825 } 27826 if (hookFunction !== void 0) { 27827 const index2 = arrayLastIndexOf(hooks[entryPoint], hookFunction); 27828 return index2 === -1 ? void 0 : arraySplice(hooks[entryPoint], index2, 1)[0]; 27829 } 27830 return arrayPop(hooks[entryPoint]); 27831 }; 27832 DOMPurify.removeHooks = function(entryPoint) { 27833 if (!objectHasOwnProperty(hooks, entryPoint)) { 27834 return; 27835 } 27836 hooks[entryPoint] = []; 27837 }; 27838 DOMPurify.removeAllHooks = function() { 27839 hooks = _createHooksMap(); 27840 }; 27841 return DOMPurify; 27842 } 27843 var purify = createDOMPurify(); 27844 var browser_default = purify; 27845 purify.sanitize.bind(purify); 27846 purify.isSupported; 27847 purify.addHook.bind(purify); 27848 purify.removeHook.bind(purify); 27849 purify.removeHooks.bind(purify); 27850 purify.removeAllHooks.bind(purify); 27851 purify.setConfig.bind(purify); 27852 purify.clearConfig.bind(purify); 27853 purify.isValidAttribute.bind(purify); 27854 purify.version; 27855 purify.removed; 27856 var names = { 27857 aliceblue: "f0f8ff", 27858 antiquewhite: "faebd7", 27859 aqua: "0ff", 27860 aquamarine: "7fffd4", 27861 azure: "f0ffff", 27862 beige: "f5f5dc", 27863 bisque: "ffe4c4", 27864 black: "000", 27865 blanchedalmond: "ffebcd", 27866 blue: "00f", 27867 blueviolet: "8a2be2", 27868 brown: "a52a2a", 27869 burlywood: "deb887", 27870 burntsienna: "ea7e5d", 27871 cadetblue: "5f9ea0", 27872 chartreuse: "7fff00", 27873 chocolate: "d2691e", 27874 coral: "ff7f50", 27875 cornflowerblue: "6495ed", 27876 cornsilk: "fff8dc", 27877 crimson: "dc143c", 27878 cyan: "0ff", 27879 darkblue: "00008b", 27880 darkcyan: "008b8b", 27881 darkgoldenrod: "b8860b", 27882 darkgray: "a9a9a9", 27883 darkgreen: "006400", 27884 darkgrey: "a9a9a9", 27885 darkkhaki: "bdb76b", 27886 darkmagenta: "8b008b", 27887 darkolivegreen: "556b2f", 27888 darkorange: "ff8c00", 27889 darkorchid: "9932cc", 27890 darkred: "8b0000", 27891 darksalmon: "e9967a", 27892 darkseagreen: "8fbc8f", 27893 darkslateblue: "483d8b", 27894 darkslategray: "2f4f4f", 27895 darkslategrey: "2f4f4f", 27896 darkturquoise: "00ced1", 27897 darkviolet: "9400d3", 27898 deeppink: "ff1493", 27899 deepskyblue: "00bfff", 27900 dimgray: "696969", 27901 dimgrey: "696969", 27902 dodgerblue: "1e90ff", 27903 firebrick: "b22222", 27904 floralwhite: "fffaf0", 27905 forestgreen: "228b22", 27906 fuchsia: "f0f", 27907 gainsboro: "dcdcdc", 27908 ghostwhite: "f8f8ff", 27909 gold: "ffd700", 27910 goldenrod: "daa520", 27911 gray: "808080", 27912 green: "008000", 27913 greenyellow: "adff2f", 27914 grey: "808080", 27915 honeydew: "f0fff0", 27916 hotpink: "ff69b4", 27917 indianred: "cd5c5c", 27918 indigo: "4b0082", 27919 ivory: "fffff0", 27920 khaki: "f0e68c", 27921 lavender: "e6e6fa", 27922 lavenderblush: "fff0f5", 27923 lawngreen: "7cfc00", 27924 lemonchiffon: "fffacd", 27925 lightblue: "add8e6", 27926 lightcoral: "f08080", 27927 lightcyan: "e0ffff", 27928 lightgoldenrodyellow: "fafad2", 27929 lightgray: "d3d3d3", 27930 lightgreen: "90ee90", 27931 lightgrey: "d3d3d3", 27932 lightpink: "ffb6c1", 27933 lightsalmon: "ffa07a", 27934 lightseagreen: "20b2aa", 27935 lightskyblue: "87cefa", 27936 lightslategray: "789", 27937 lightslategrey: "789", 27938 lightsteelblue: "b0c4de", 27939 lightyellow: "ffffe0",
27940 lime: "0f0", 27941 limegreen: "32cd32", 27942 linen: "faf0e6", 27943 magenta: "f0f", 27944 maroon: "800000", 27945 mediumaquamarine: "66cdaa", 27946 mediumblue: "0000cd", 27947 mediumorchid: "ba55d3", 27948 mediumpurple: "9370db", 27949 mediumseagreen: "3cb371", 27950 mediumslateblue: "7b68ee", 27951 mediumspringgreen: "00fa9a", 27952 mediumturquoise: "48d1cc", 27953 mediumvioletred: "c71585", 27954 midnightblue: "191970", 27955 mintcream: "f5fffa", 27956 mistyrose: "ffe4e1", 27957 moccasin: "ffe4b5", 27958 navajowhite: "ffdead", 27959 navy: "000080", 27960 oldlace: "fdf5e6", 27961 olive: "808000", 27962 olivedrab: "6b8e23", 27963 orange: "ffa500", 27964 orangered: "ff4500", 27965 orchid: "da70d6", 27966 palegoldenrod: "eee8aa", 27967 palegreen: "98fb98", 27968 paleturquoise: "afeeee", 27969 palevioletred: "db7093", 27970 papayawhip: "ffefd5", 27971 peachpuff: "ffdab9", 27972 peru: "cd853f", 27973 pink: "ffc0cb", 27974 plum: "dda0dd", 27975 powderblue: "b0e0e6", 27976 purple: "800080", 27977 rebeccapurple: "663399", 27978 red: "f00", 27979 rosybrown: "bc8f8f", 27980 royalblue: "4169e1", 27981 saddlebrown: "8b4513", 27982 salmon: "fa8072", 27983 sandybrown: "f4a460", 27984 seagreen: "2e8b57", 27985 seashell: "fff5ee", 27986 sienna: "a0522d", 27987 silver: "c0c0c0", 27988 skyblue: "87ceeb", 27989 slateblue: "6a5acd", 27990 slategray: "708090", 27991 slategrey: "708090", 27992 snow: "fffafa", 27993 springgreen: "00ff7f", 27994 steelblue: "4682b4", 27995 tan: "d2b48c", 27996 teal: "008080", 27997 thistle: "d8bfd8", 27998 tomato: "ff6347", 27999 turquoise: "40e0d0", 28000 violet: "ee82ee", 28001 wheat: "f5deb3", 28002 white: "fff", 28003 whitesmoke: "f5f5f5", 28004 yellow: "ff0", 28005 yellowgreen: "9acd32" 28006 }; 28007 flip$3(names); 28008 function flip$3(o2) { 28009 var flipped = {}; 28010 for (var i2 in o2) { 28011 if (o2.hasOwnProperty(i2)) { 28012 flipped[o2[i2]] = i2; 28013 } 28014 } 28015 return flipped; 28016 } 28017 var I$2 = (e2, t2, o2 = `${t2}s`) => e2 === 1 ? t2 : o2, M$6 = (e2, t2, o2) => { 28018 let r2 = "â¢".repeat(o2); 28019 if (e2.length <= t2) return r2; 28020 let n2 = e2.slice(-t2); 28021 return r2 + n2; 28022 }; 28023 var E$5 = (e2, t2) => browser_default.sanitize(e2, void 0), me$2 = (e2) => e2.replaceAll("&", "\\u0026").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029"), fe$2 = (e2, t2) => decode(E$5(e2), { scope: "strict" }); 28024 const BackButton$1 = ({ label, to: to2, state, onClick }) => /* @__PURE__ */ jsxRuntimeExports.jsx( 28025 TextButton, 28026 { 28027 label, 28028 icon: X4, 28029 size: "medium", 28030 variant: "secondary", 28031 to: to2, 28032 state, 28033 onClick, 28034 testid: "BackButton" 28035 } 28036 ); 28037 const Container$t = dt$2.div` 28038 position: relative; 28039 display: flex; 28040 background: var(--bg-transparent); 28041 color: var(--text-primary); 28042 border-radius: var(--panel-radius-normal); 28043 28044 a, 28045 button { 28046 font-size: inherit; 28047 line-height: inherit; 28048 text-decoration: underline; 28049 text-underline-offset: var(--space-100); 28050 } 28051 28052 ul { 28053 list-style: disc; 28054 padding-inline-start: 1.5em; 28055 } 28056 28057 ol { 28058 list-style: decimal; 28059 padding-inline-start: 1.5em; 28060 } 28061 28062 strong { 28063 font-weight: var(--font-weight-500); 28064 } 28065 28066 ${({ $appearance }) => $appearance === "info" && lt$2` 28067 background: var(--bg-transparent); 28068 color: var(--text-primary); 28069 `}; 28070 28071 ${({ $appearance }) => $appearance === "danger" && lt$2` 28072 background: var(--bg-critical-secondary); 28073 color: var(--text-critical-tertiary); 28074 `}; 28075 28076 ${({ $appearance }) => $appearance === "warning" && lt$2` 28077 background: var(--bg-alert-secondary); 28078 color: var(--text-alert-tertiary); 28079 `}; 28080 28081 ${({ $appearance }) => $appearance === "inherit" && lt$2` 28082 background: var(--bg-secondary); 28083 color: var(--text-primary); 28084 `}; 28085 28086 ${({ $appearance }) => $appearance === "danger-strong" && lt$2` 28087 background: var(--bg-critical); 28088 color: var(--text-white); 28089 `}; 28090 28091 ${({ $appearance }) => $appearance === "clean" && lt$2` 28092 background: none; 28093 `}; 28094 28095 ${({ $appearance }) => $appearance === "pro" && lt$2` 28096 background-color: var(--bg-pro); 28097 color: var(--text-pro); 28098 `}; 28099 28100 ${({ $appearance }) => $appearance === "success" && lt$2` 28101 background: var(--bg-success-secondary); 28102 color: var(--text-success-secondary); 28103 `}; 28104 28105 ${({ $size }) => $size === "normal" && lt$2` 28106 padding: var(--space-300) var(--space-500); 28107 font-size: var(--font-size-400); 28108 `}; 28109 28110 ${({ $size }) => $size === "small" && lt$2` 28111 padding: var(--space-250) var(--space-400); 28112 font-size: var(--font-size-300); 28113 `}; 28114 28115 ${({ $size }) => $size === "xsmall" && lt$2` 28116 padding: var(--space-200) var(--space-300); 28117 font-size: var(--font-size-200); 28118 `}; 28119 28120 ${({ $size, $withRightContent }) => $size === "normal" && $withRightContent && lt$2` 28121 padding-right: 52px; 28122 `}; 28123 28124 ${({ $size, $withRightContent }) => ($size === "small" || $size === "xsmall") && $withRightContent && lt$2` 28125 padding-right: var(--space-1200); 28126 `}; 28127 28128 ${({ $withoutPaddings }) => $withoutPaddings && lt$2` 28129 padding: 0; 28130 `}; 28131`; 28132 const Main$1 = dt$2.div` 28133 flex: 1; 28134 display: flex; 28135 28136 ${({ $size }) => $size === "normal" && lt$2` 28137 gap: var(--space-350); 28138 line-height: var(--font-line-height-400); 28139 font-size: var(--font-size-400); 28140 letter-spacing: var(--font-letter-spacing-normal); 28141 `} 28142 28143 ${({ $size }) => $size === "small" && lt$2` 28144 gap: var(--space-300); 28145 line-height: var(--font-line-height-300); 28146 font-size: var(--font-size-300); 28147 letter-spacing: var(--font-letter-spacing-loose); 28148 `} 28149 28150 ${({ $size }) => $size === "xsmall" && lt$2` 28151 gap: var(--space-200); 28152 font-family: var(--font-family-body); 28153 font-size: var(--font-size-200); 28154 font-weight: var(--font-weight-400); 28155 line-height: var(--font-line-height-200); 28156 letter-spacing: var(--font-letter-spacing-looser); 28157 `} 28158 28159 ${({ $justify }) => $justify === "center" && lt$2` 28160 justify-content: center; 28161 `}; 28162 28163 ${({ $justify }) => $justify === "right" && lt$2` 28164 justify-content: flex-end; 28165 `}; 28166`; 28167 const IconContainer$2 = dt$2.div` 28168 display: flex; 28169 align-items: center; 28170 justify-content: center; 28171 28172 ${({ $size }) => $size === "normal" && lt$2` 28173 height: var(--font-line-height-400); 28174 `}; 28175 28176 ${({ $size }) => $size === "small" && lt$2` 28177 height: var(--font-line-height-300); 28178 `}; 28179 28180 ${({ $size }) => $size === "xsmall" && lt$2` 28181 height: var(--font-line-height-200); 28182 `}; 28183`; 28184 const Title$3 = dt$2.div` 28185 font-size: var(--font-size-400); 28186`; 28187 const Subtitle$1 = dt$2.div` 28188 font-size: var(--font-size-300); 28189 letter-spacing: var(--font-letter-spacing-loose); 28190`; 28191 const CloseButtonContainer = dt$2.button` 28192 position: absolute; 28193 cursor: pointer; 28194 right: var(--space-500); 28195 28196 ${({ $size }) => $size === "normal" && lt$2` 28197 top: var(--space-400); 28198 `}; 28199 28200 ${({ $size }) => $size === "small" && lt$2` 28201 top: var(--space-350); 28202 `}; 28203 28204 ${({ $size }) => $size === "xsmall" && lt$2` 28205 top: var(--space-300); 28206 `}; 28207`; 28208 const ICON_SIZE_MAP = { normal: 16, small: 14, xsmall: 12 }; 28209 const Banner = ({ 28210 title, 28211 subtitle, 28212 panel, 28213 appearance, 28214 withoutPaddings = false, 28215 icon: Icon2 = je$3, 28216 size = "normal", 28217 justify = "left", 28218 children, 28219 onClose 28220 }) => { 28221 const [isOpen, setIsOpen] = reactExports.useState(false); 28222 const ArrowIcon = isOpen ? K4 : Z4; 28223 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 28224 Container$t, 28225 { 28226 $appearance: appearance, 28227 $size: size,
28228 $withoutPaddings: withoutPaddings, 28229 role: "alert", 28230 "data-testid": "Banner", 28231 $withRightContent: !!onClose, 28232 children: [ 28233 /* @__PURE__ */ jsxRuntimeExports.jsxs(Main$1, { $justify: justify, $size: size, children: [ 28234 Icon2 !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(IconContainer$2, { $size: size, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: ICON_SIZE_MAP[size] }) }), 28235 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ 28236 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$3, { children: title }), 28237 subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(Subtitle$1, { children: subtitle }), 28238 isOpen && panel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginTop: 8 }, children: panel }), 28239 children 28240 ] }) 28241 ] }), 28242 panel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: () => setIsOpen((currentIsOpen) => !currentIsOpen), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowIcon, { height: 16 }) }) }), 28243 onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonContainer, { $size: size, onClick: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 16 }) }) 28244 ] 28245 } 28246 ); 28247 }; 28248 const getSize = (size) => ({ micro: 12, small: 15, medium: 18, large: 32 })[size]; 28249 const getColor = ({ $appearance }) => { 28250 if ($appearance === "primary") { 28251 return "var(--text-primary-invert)"; 28252 } 28253 if ($appearance === "secondary") { 28254 return "var(--text-primary)"; 28255 } 28256 if ($appearance === "inherit") { 28257 return "currentColor"; 28258 } 28259 }; 28260 const wrapperAnimation = mt$2` 28261 0% { 28262 transform: rotateZ(0deg); 28263 } 28264 100% { 28265 transform: rotateZ(360deg) 28266 } 28267`; 28268 const circleAnimation = mt$2` 28269 0%, 28270 25% { 28271 stroke-dashoffset: 270; 28272 transform: rotate(0); 28273 } 28274 28275 50%, 28276 75% { 28277 stroke-dashoffset: 75; 28278 transform: rotate(45deg); 28279 } 28280 28281 100% { 28282 stroke-dashoffset: 270; 28283 transform: rotate(360deg); 28284 } 28285`; 28286 const Wrapper = dt$2.svg` 28287 width: ${({ $size }) => getSize($size)}px; 28288 animation: 2s linear infinite ${wrapperAnimation}; 28289 animation-delay: -1.5s; 28290`; 28291 const Circle = dt$2.circle` 28292 animation: 1.4s ease-in-out infinite both ${circleAnimation}; 28293 animation-delay: -1.05s; 28294 display: block; 28295 fill: transparent; 28296 stroke: ${getColor}; 28297 stroke-dasharray: 283; 28298 stroke-dashoffset: 75; 28299 stroke-width: 10px; 28300 transform-origin: 50% 50%; 28301`; 28302 const Loader = ({ appearance = "secondary", size = "medium" }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Wrapper, { viewBox: "0 0 100 100", $size: size, "aria-label": "loader", "data-testid": "Loader", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Circle, { cx: "50", cy: "50", r: "45", $appearance: appearance }) }); 28303 const bodyMd = lt$2` 28304 font-size: var(--font-size-400); 28305 line-height: var(--font-line-height-400); 28306 letter-spacing: var(--font-letter-spacing-normal); 28307`; 28308 const bodySm = lt$2` 28309 font-size: var(--font-size-300); 28310 line-height: var(--font-line-height-300); 28311 letter-spacing: var(--font-letter-spacing-loose); 28312`; 28313 const bodyXs = lt$2` 28314 font-size: var(--font-size-200); 28315 line-height: var(--font-line-height-200); 28316 letter-spacing: var(--font-letter-spacing-looser); 28317`; 28318 const sizeStylesMap = { 28319 large: lt$2` 28320 height: var(--space-1200); 28321 padding: 0 var(--space-400); 28322 gap: var(--space-300); 28323 ${bodyMd} 28324 `, 28325 medium: lt$2` 28326 height: var(--space-1000); 28327 padding: 0 var(--space-350); 28328 gap: var(--space-250); 28329 ${bodyMd} 28330 `, 28331 small: lt$2` 28332 height: var(--space-800); 28333 padding: 0 var(--space-250); 28334 gap: var(--space-250); 28335 ${bodySm} 28336 `, 28337 micro: lt$2` 28338 height: var(--space-600); 28339 padding: 0 var(--space-200); 28340 gap: var(--space-150); 28341 ${bodyXs} 28342 ` 28343 }; 28344 const proGradient = (start, end) => lt$2` 28345 background: radial-gradient(135.71% 135.71% at 28.85% 0%, ${start} 0%, ${end} 100%); 28346`; 28347 const appearanceStylesMap = { 28348 primary: lt$2` 28349 color: var(--text-primary-invert); 28350 background: var(--bg-brand); 28351 &:hover:not(:disabled) { 28352 background: var(--bg-brand-hover); 28353 } 28354 &:active:not(:disabled) { 28355 background: var(--bg-brand-active); 28356 } 28357 `, 28358 secondary: lt$2` 28359 color: var(--text-primary); 28360 background: var(--bg-secondary); 28361 &:hover:not(:disabled) { 28362 background: var(--bg-secondary-hover); 28363 } 28364 &:active:not(:disabled) { 28365 background: var(--bg-secondary-active); 28366 } 28367 `, 28368 "semi-transparent": lt$2` 28369 color: var(--text-primary); 28370 background: var(--bg-transparent); 28371 &:hover:not(:disabled) { 28372 background: var(--bg-transparent-strong); 28373 } 28374 &:active:not(:disabled) { 28375 background: var(--bg-transparent-strongest); 28376 } 28377 `, 28378 transparent: lt$2` 28379 color: var(--text-primary); 28380 background: transparent; 28381 &:hover:not(:disabled) { 28382 background: var(--bg-transparent); 28383 } 28384 &:active:not(:disabled) { 28385 background: var(--bg-transparent-strong); 28386 } 28387 `, 28388 destructive: lt$2` 28389 color: var(--text-white); 28390 background: var(--bg-critical); 28391 &:hover:not(:disabled) { 28392 background: var(--bg-critical-hover); 28393 } 28394 &:active:not(:disabled) { 28395 background: var(--bg-critical-active); 28396 } 28397 `, 28398 "destructive-secondary": lt$2` 28399 color: var(--text-critical-tertiary); 28400 background: var(--bg-critical-secondary); 28401 &:hover:not(:disabled) { 28402 background: var(--bg-critical-secondary-hover); 28403 } 28404 &:active:not(:disabled) { 28405 background: var(--bg-critical-secondary-active); 28406 } 28407 `, 28408 alert: lt$2` 28409 color: var(--text-alert-tertiary); 28410 background: var(--bg-alert-secondary); 28411 &:hover:not(:disabled) { 28412 background: var(--bg-alert-secondary-hover); 28413 } 28414 &:active:not(:disabled) { 28415 background: var(--bg-alert-secondary-active); 28416 } 28417 `, 28418 pro: lt$2` 28419 color: var(--text-white); 28420 ${proGradient("var(--bg-pro-gradient-start)", "var(--bg-pro-gradient-end)")} 28421 &:hover:not(:disabled), 28422 &:active:not(:disabled) { 28423 ${proGradient("var(--bg-pro-gradient-start-hover)", "var(--bg-pro-gradient-end-h
28423over)")} 28424 } 28425 ` 28426 }; 28427 const Container$s = dt$2.button` 28428 position: relative; 28429 display: flex; 28430 align-items: center; 28431 justify-content: center; 28432 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 28433 border: none; 28434 border-radius: var(--button-radius-normal); 28435 font-family: var(--font-family-body); 28436 font-weight: var(--font-weight-500); 28437 text-transform: var(--text-transform-body); 28438 text-decoration: none; 28439 white-space: nowrap; 28440 cursor: pointer; 28441 appearance: none !important; // NOTE: Required for Safari. 28442 ${({ $size }) => sizeStylesMap[$size]} 28443 ${({ $appearance }) => appearanceStylesMap[$appearance]} 28444 &:disabled { 28445 cursor: not-allowed; 28446 opacity: 0.4; 28447 } 28448 &:focus-visible { 28449 outline: var(--space-50) solid var(--text-primary); 28450 outline-offset: var(--space-50); 28451 } 28452`; 28453 const Content$4 = dt$2.span` 28454 display: inline-flex; 28455 align-items: center; 28456 gap: inherit; 28457 visibility: ${({ $hidden }) => $hidden ? "hidden" : "visible"}; 28458`; 28459 const labelOffsetMap = { 28460 large: "0", 28461 medium: "0", 28462 small: "1px", 28463 micro: "1px" 28464 }; 28465 const Label$4 = dt$2.span` 28466 padding-top: ${({ $size }) => labelOffsetMap[$size]}; 28467`; 28468 const Icon = dt$2.span` 28469 display: inline-flex; 28470 align-items: center; 28471 justify-content: center; 28472 flex-shrink: 0; 28473`; 28474 const LoaderContainer$2 = dt$2.span` 28475 position: absolute; 28476 inset: 0; 28477 display: flex; 28478 align-items: center; 28479 justify-content: center; 28480`; 28481 const iconSizeMap$1 = { 28482 large: 16, 28483 medium: 16, 28484 small: 14, 28485 micro: 12 28486 }; 28487 const loaderSizeMap$1 = { 28488 large: "medium", 28489 medium: "medium", 28490 small: "small", 28491 micro: "micro" 28492 }; 28493 const renderIcon = (icon, size) => { 28494 if (reactExports.isValidElement(icon)) { 28495 return /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { "aria-hidden": "true", children: icon }); 28496 } 28497 const Icon$1 = icon; 28498 return /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, { width: size, height: size }) }); 28499 }; 28500 const getComponent$2 = ({ 28501 to: to2, 28502 href, 28503 inactive 28504 }) => { 28505 if (!inactive && to2) return Link; 28506 if (!inactive && href) return "a"; 28507 return "button"; 28508 }; 28509 const Button$1 = ({ 28510 id: id2, 28511 label, 28512 appearance = "secondary", 28513 size = "large", 28514 leftIcon, 28515 rightIcon, 28516 to: to2, 28517 href, 28518 target, 28519 download, 28520 disabled = false, 28521 loading = false, 28522 fullWidth = false, 28523 type = "button", 28524 className, 28525 analytics, 28526 "aria-label": ariaLabel, 28527 onClick 28528 }) => { 28529 const inactive = disabled || loading; 28530 const component = getComponent$2({ to: to2, href, inactive }); 28531 const isButton = component === "button"; 28532 const iconSize = iconSizeMap$1[size]; 28533 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 28534 Container$s, 28535 { 28536 as: component, 28537 id: id2, 28538 className, 28539 role: isButton ? void 0 : "button", 28540 $appearance: appearance, 28541 $size: size, 28542 $fullWidth: fullWidth, 28543 to: isButton ? void 0 : to2, 28544 href: isButton ? void 0 : href, 28545 target: isButton ? void 0 : target, 28546 download: isButton ? void 0 : download, 28547 type: isButton ? type : void 0, 28548 disabled: isButton ? inactive : void 0, 28549 "aria-busy": loading || void 0, 28550 "aria-label": ariaLabel, 28551 onClick, 28552 "data-analytics": analytics, 28553 "data-testid": "button", 28554 children: [
28555 /* @__PURE__ */ jsxRuntimeExports.jsxs(Content$4, { $hidden: loading, children: [ 28556 leftIcon && renderIcon(leftIcon, iconSize), 28557 label && /* @__PURE__ */ jsxRuntimeExports.jsx(Label$4, { $size: size, children: label }), 28558 rightIcon && renderIcon(rightIcon, iconSize) 28559 ] }), 28560 loading && /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer$2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { appearance: "inherit", size: loaderSizeMap$1[size] }) }) 28561 ] 28562 } 28563 ); 28564 }; 28565 const Button = dt$2.button` 28566 display: inline-flex; 28567 align-items: center; 28568 28569 font-weight: inherit; 28570 font-size: inherit; 28571 font-family: inherit; 28572 text-align: left; 28573 28574 cursor: pointer; 28575 28576 appearance: none !important; // NOTE: Required for Safari. 28577 28578 ${({ $appearance }) => $appearance === "inherit" && lt$2` 28579 color: inherit; 28580 `} 28581 28582 ${({ $appearance }) => $appearance === "primary" && lt$2` 28583 color: var(--text-primary); 28584 `} 28585 28586 ${({ $appearance }) => $appearance === "secondary" && lt$2` 28587 color: var(--text-secondary); 28588 `} 28589 28590 ${({ $appearance }) => $appearance === "destructive" && lt$2` 28591 color: var(--text-critical); 28592 `} 28593 28594 ${({ $appearance }) => $appearance === "success" && lt$2` 28595 color: var(--text-success); 28596 `} 28597 28598 ${({ $appearance }) => $appearance === "warning" && lt$2` 28599 color: var(--text-alert); 28600 `} 28601 28602 &:hover, 28603 &:active, 28604 &:focus { 28605 ${({ $appearance }) => $appearance === "primary" && lt$2` 28606 color: var(--text-link); 28607 `} 28608 28609 ${({ $appearance }) => $appearance === "secondary" && lt$2` 28610 color: var(--text-primary); 28611 `} 28612 28613 ${({ $appearance }) => $appearance === "destructive" && lt$2` 28614 color: var(--text-critical); 28615 `} 28616 28617 ${({ $appearance }) => $appearance === "success" && lt$2` 28618 color: var(--text-success); 28619 `} 28620 28621 ${({ $appearance }) => $appearance === "warning" && lt$2` 28622 color: var(--text-alert); 28623 `} 28624 28625 ${({ disabled }) => disabled && lt$2` 28626 color: inherit; 28627 `} 28628 } 28629 28630 ${({ $withUnderline }) => $withUnderline && lt$2` 28631 text-decoration-line: underline; 28632 text-underline-offset: var(--space-100); 28633 `} 28634 28635 ${({ disabled }) => disabled && lt$2` 28636 cursor: not-allowed; 28637 `} 28638 28639 & > svg { 28640 margin-right: var(--space-200); 28641 } 28642`; 28643 const getComponent$1 = ({ to: to2, href }) => { 28644 if (to2) return Link; 28645 if (href) return "a"; 28646 return "button"; 28647 }; 28648 const ButtonClean = ({ 28649 appearance = "primary", 28650 ariaLabel, 28651 analyticsKey, 28652 to: to2, 28653 state, 28654 href, 28655 target, 28656 label, 28657 title, 28658 icon: Icon2, 28659 withUnderline = true, 28660 disabled = false, 28661 type = "button", 28662 onClick 28663 }) => /* @__PURE__ */ jsxRuntimeExports.jsxs( 28664 Button, 28665 { 28666 $appearance: appearance, 28667 as: getComponent$1({ to: to2, href }), 28668 to: to2, 28669 state, 28670 href, 28671 target, 28672 title, 28673 $withUnderline: withUnderline, 28674 disabled, 28675 onClick, 28676 type, 28677 "aria-label": ariaLabel, 28678 "data-testid": "ButtonClean", 28679 "data-analytics": analyticsKey, 28680 children: [ 28681 Icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: 12, "aria-hidden": true }), 28682 label 28683 ] 28684 } 28685 ); 28686 const Group = dt$2.div` 28687 display: flex; 28688 flex-direction: ${({ $direction }) => $direction}; 28689 28690 ${({ $space }) => $space === "small" && lt$2` 28691 gap: var(--space-50); 28692 `} 28693 28694 ${({ $space }) => $space === "medium" && lt$2` 28695 gap: var(--space-200); 28696 `} 28697 28698 ${({ $space }) => $space === "large" && lt$2` 28699 gap: var(--space-400); 28700 `} 28701 28702 ${({ $space }) => $space === "xlarge" && lt$2` 28703 gap: var(--space-500); 28704 `} 28705 28706 ${({ $fullWidth }) => $fullWidth && lt$2` 28707 width: 100%; 28708 `} 28709 28710 ${({ $justify }) => $justify === "right" && lt$2` 28711 justify-content: flex-end; 28712 `} 28713 28714 ${({ $align }) => $align === "center" && lt$2` 28715 align-items: center; 28716 `} 28717`; 28718 const ButtonGroup = ({ 28719 space = "small", 28720 justify = "left", 28721 align, 28722 direction = "row", 28723 fullWidth = false, 28724 children 28725 }) => { 28726 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28727 Group, 28728 { 28729 $justify: justify, 28730 $align: align, 28731 $direction: direction, 28732 $fullWidth: fullWidth, 28733 $space: space, 28734 children 28735 } 28736 ); 28737 }; 28738 const containerSizeMap = { 28739 large: 48, 28740 medium: 40, 28741 small: 32, 28742 micro: 24 28743 }; 28744 const Container$r = dt$2.button` 28745 display: inline-flex; 28746 align-items: center; 28747 justify-content: center; 28748 color: var(--icon-primary); 28749 background: var(--bg-secondary); 28750 border-radius: var(--button-radius-normal); 28751 cursor: pointer; 28752 flex-shrink: 0; 28753 text-decoration: none; 28754 border: none; 28755 28756 &:hover:not(:disabled) { 28757 background: var(--bg-secondary-hover); 28758 } 28759 28760 &:active:not(:disabled) { 28761 background: var(--bg-secondary-active); 28762 } 28763 28764 &:disabled { 28765 opacity: 0.4; 28766 color: var(--icon-secondary);
28767 cursor: not-allowed; 28768 } 28769 28770 height: ${({ $size }) => containerSizeMap[$size]}px; 28771 width: ${({ $size }) => containerSizeMap[$size]}px; 28772 28773 ${({ $variant }) => $variant === "primary" && lt$2` 28774 color: var(--text-primary-invert); 28775 background: var(--bg-brand); 28776 28777 &:hover:not(:disabled) { 28778 background: var(--bg-brand-hover); 28779 } 28780 28781 &:active:not(:disabled) { 28782 background: var(--bg-brand-hover); 28783 } 28784 28785 &:disabled { 28786 color: var(--text-primary-invert); 28787 } 28788 `} 28789 28790 ${({ $variant }) => $variant === "transparent" && lt$2` 28791 background: transparent; 28792 28793 &:hover:not(:disabled) { 28794 background: var(--bg-transparent); 28795 } 28796 28797 &:active:not(:disabled) { 28798 background: var(--bg-transparent-strong); 28799 } 28800 `} 28801 28802 ${({ $variant }) => $variant === "semi-transparent" && lt$2` 28803 background: var(--bg-transparent); 28804 28805 &:hover:not(:disabled) { 28806 background: var(--bg-transparent-strong); 28807 } 28808 28809 &:active:not(:disabled) { 28810 background: var(--bg-transparent-strongest); 28811 } 28812 `} 28813 28814 ${({ $variant }) => $variant === "outline" && lt$2` 28815 background: var(--bg-primary); 28816 border: 1px solid var(--border-transparent-strongest); 28817 28818 &:hover:not(:disabled) { 28819 background: var(--bg-primary-hover); 28820 } 28821 28822 &:active:not(:disabled) { 28823 background: var(--bg-transparent-strongest); 28824 } 28825 `} 28826 28827 ${({ $variant }) => $variant === "subtle" && lt$2` 28828 color: var(--icon-secondary); 28829 background: transparent; 28830 28831 &:hover:not(:disabled) { 28832 color: var(--icon-primary); 28833 background: var(--bg-transparent); 28834 } 28835 28836 &:active:not(:disabled) { 28837 color: var(--icon-primary); 28838 background: var(--bg-transparent-strong); 28839 } 28840 `} 28841 28842 ${({ $isActive, $variant }) => { 28843 if (!$isActive) return null; 28844 const activeBackgroundMap = { 28845 standard: "var(--bg-secondary-active)", 28846 primary: "var(--bg-brand-hover)", 28847 transparent: "var(--bg-transparent-strong)", 28848 "semi-transparent": "var(--bg-transparent-strongest)", 28849 outline: "var(--bg-transparent-strongest)", 28850 subtle: "var(--bg-transparent-strong)" 28851 }; 28852 return lt$2` 28853 background: ${activeBackgroundMap[$variant]}; 28854 `; 28855 }} 28856`; 28857 const iconSizeMap = { 28858 large: 20, 28859 medium: 18, 28860 small: 16, 28861 micro: 12 28862 }; 28863 const loaderSizeMap = { 28864 large: "medium", 28865 medium: "medium", 28866 small: "small", 28867 micro: "micro" 28868 }; 28869 const getComponent = ({ to: to2, href }) => { 28870 if (to2) return Link; 28871 if (href) return "a"; 28872 return "button"; 28873 }; 28874 const IconButton = reactExports.forwardRef( 28875 (_f, ref) => { 28876 var _g = _f, { 28877 icon: Icon2, 28878 size = "medium", 28879 variant = "standard", 28880 isActive = false, 28881 loading = false, 28882 type = "button", 28883 to: to2, 28884 href, 28885 target, 28886 disabled, 28887 onClick 28888 } = _g, rest = __objRest(_g, [ 28889 "icon", 28890 "size", 28891 "variant", 28892 "isActive", 28893 "loading", 28894 "type", 28895 "to", 28896 "href", 28897 "target", 28898 "disabled", 28899 "onClick" 28900 ]); 28901 const component = getComponent({ to: to2, href }); 28902 const isButton = component === "button"; 28903 const handleClick = (event) => { 28904 if (isButton) { 28905 event.preventDefault(); 28906 } 28907 if (!onClick) return; 28908 onClick(event); 28909 }; 28910 return /* @__PURE__ */ jsxRuntimeExports.jsx( 28911 Container$r, 28912 __spreadProps(__spreadValues({ 28913 ref, 28914 as: component, 28915 $size: size, 28916 $variant: variant, 28917 $isActive: isActive, 28918 type: isButton ? type : void 0, 28919 to: to2, 28920 href, 28921 target, 28922 disabled: disabled || loading, 28923 onClick: handleClick, 28924 "data-icon-button": true 28925 }, rest), {
28926 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx( 28927 Loader, 28928 { 28929 appearance: variant === "primary" ? "primary" : "secondary", 28930 size: loaderSizeMap[size] 28931 } 28932 ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: iconSizeMap[size], width: iconSizeMap[size] }) 28933 }) 28934 ); 28935 } 28936 ); 28937 IconButton.displayName = "IconButton"; 28938 function isNil(value) { 28939 return value == null; 28940 } 28941 function isUndefined(value) { 28942 return value === void 0; 28943 } 28944 var p$4 = ["po box", "post office box", "p.o. box", "p.o box", "postal box", "p.o.b", "p.o.box"], d$3 = (t2) => !!p$4.find((e2) => t2.toLowerCase().includes(e2)), s$4 = new RegExp("\\p{Script=Latin}\\p{White_Space}\\p{Punctuation}\\p{Number}\\n\\+", "gu"), m$3 = (t2) => new RegExp(`^[${s$4}]*$`, "gu").test(t2), V$2 = (t2) => /<\/?\s*[a-zA-Z][^>]*>/g.test(t2); 28945 var isMergeableObject = function isMergeableObject2(value) { 28946 return isNonNullObject(value) && !isSpecial(value); 28947 }; 28948 function isNonNullObject(value) { 28949 return !!value && typeof value === "object"; 28950 } 28951 function isSpecial(value) { 28952 var stringValue = Object.prototype.toString.call(value); 28953 return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); 28954 } 28955 var canUseSymbol = typeof Symbol === "function" && Symbol.for; 28956 var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; 28957 function isReactElement(value) { 28958 return value.$$typeof === REACT_ELEMENT_TYPE; 28959 } 28960 function emptyTarget(val) { 28961 return Array.isArray(val) ? [] : {}; 28962 } 28963 function cloneUnlessOtherwiseSpecified(value, options2) { 28964 return options2.clone !== false && options2.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options2) : value; 28965 } 28966 function defaultArrayMerge(target, source, options2) { 28967 return target.concat(source).map(function(element) { 28968 return cloneUnlessOtherwiseSpecified(element, options2); 28969 }); 28970 } 28971 function mergeObject(target, source, options2) { 28972 var destination = {}; 28973 if (options2.isMergeableObject(target)) { 28974 Object.keys(target).forEach(function(key) { 28975 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options2); 28976 }); 28977 } 28978 Object.keys(source).forEach(function(key) { 28979 if (!options2.isMergeableObject(source[key]) || !target[key]) { 28980 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options2); 28981 } else { 28982 destination[key] = deepmerge(target[key], source[key], options2); 28983 } 28984 }); 28985 return destination; 28986 } 28987 function deepmerge(target, source, options2) { 28988 options2 = options2 || {}; 28989 options2.arrayMerge = options2.arrayMerge || defaultArrayMerge; 28990 options2.isMergeableObject = options2.isMergeableObject || isMergeableObject; 28991 var sourceIsArray = Array.isArray(source); 28992 var targetIsArray = Array.isArray(target); 28993 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 28994 if (!sourceAndTargetTypesMatch) { 28995 return cloneUnlessOtherwiseSpecified(source, options2); 28996 } else if (sourceIsArray) { 28997 return options2.arrayMerge(target, source, options2); 28998 } else { 28999 return mergeObject(target, source, options2); 29000 } 29001 } 29002 deepmerge.all = function deepmergeAll(array2, options2) { 29003 if (!Array.isArray(array2)) { 29004 throw new Error("first argument should be an array"); 29005 } 29006 return array2.reduce(function(prev2, next2) { 29007 return deepmerge(prev2, next2, options2); 29008 }, {}); 29009 }; 29010 var deepmerge_1 = deepmerge; 29011 var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; 29012 function cloneDeep(value) { 29013 return baseClone$1(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 29014 } 29015 var reactFastCompare$1; 29016 var hasRequiredReactFastCompare$1; 29017 function requireReactFastCompare$1() { 29018 if (hasRequiredReactFastCompare$1) return reactFastCompare$1; 29019 hasRequiredReactFastCompare$1 = 1; 29020 var isArray2 = Array.isArray; 29021 var keyList = Object.keys; 29022 var hasProp2 = Object.prototype.hasOwnProperty; 29023 var hasElementType = typeof Element !== "undefined"; 29024 function equal(a2, b2) { 29025 if (a2 === b2) return true; 29026 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 29027 var arrA = isArray2(a2), arrB = isArray2(b2), i2, length2, key; 29028 if (arrA && arrB) { 29029 length2 = a2.length; 29030 if (length2 != b2.length) return false;
29031 for (i2 = length2; i2-- !== 0; ) 29032 if (!equal(a2[i2], b2[i2])) return false; 29033 return true; 29034 } 29035 if (arrA != arrB) return false; 29036 var dateA = a2 instanceof Date, dateB = b2 instanceof Date; 29037 if (dateA != dateB) return false; 29038 if (dateA && dateB) return a2.getTime() == b2.getTime(); 29039 var regexpA = a2 instanceof RegExp, regexpB = b2 instanceof RegExp; 29040 if (regexpA != regexpB) return false; 29041 if (regexpA && regexpB) return a2.toString() == b2.toString(); 29042 var keys2 = keyList(a2); 29043 length2 = keys2.length; 29044 if (length2 !== keyList(b2).length) 29045 return false; 29046 for (i2 = length2; i2-- !== 0; ) 29047 if (!hasProp2.call(b2, keys2[i2])) return false; 29048 if (hasElementType && a2 instanceof Element && b2 instanceof Element) 29049 return a2 === b2; 29050 for (i2 = length2; i2-- !== 0; ) { 29051 key = keys2[i2]; 29052 if (key === "_owner" && a2.$$typeof) { 29053 continue; 29054 } else { 29055 if (!equal(a2[key], b2[key])) return false; 29056 } 29057 } 29058 return true; 29059 } 29060 return a2 !== a2 && b2 !== b2; 29061 } 29062 reactFastCompare$1 = function exportedEqual(a2, b2) { 29063 try { 29064 return equal(a2, b2); 29065 } catch (error) { 29066 if (error.message && error.message.match(/stack|recursion/i) || error.number === -2146828260) { 29067 console.warn("Warning: react-fast-compare does not handle circular references.", error.name, error.message); 29068 return false; 29069 } 29070 throw error; 29071 } 29072 }; 29073 return reactFastCompare$1; 29074 } 29075 var reactFastCompareExports$1 = requireReactFastCompare$1(); 29076 const isEqual$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompareExports$1); 29077 function toPath(value) { 29078 if (isArray(value)) { 29079 return arrayMap(value, toKey); 29080 } 29081 return isSymbol(value) ? [value] : copyArray(stringToPath(toString$1(value))); 29082 } 29083 function _extends$6() { 29084 _extends$6 = Object.assign || function(target) { 29085 for (var i2 = 1; i2 < arguments.length; i2++) { 29086 var source = arguments[i2]; 29087 for (var key in source) { 29088 if (Object.prototype.hasOwnProperty.call(source, key)) { 29089 target[key] = source[key]; 29090 } 29091 } 29092 } 29093 return target; 29094 }; 29095 return _extends$6.apply(this, arguments); 29096 } 29097 function _objectWithoutPropertiesLoose$2(source, excluded) { 29098 if (source == null) return {}; 29099 var target = {}; 29100 var sourceKeys = Object.keys(source); 29101 var key, i2; 29102 for (i2 = 0; i2 < sourceKeys.length; i2++) { 29103 key = sourceKeys[i2]; 29104 if (excluded.indexOf(key) >= 0) continue; 29105 target[key] = source[key]; 29106 } 29107 return target; 29108 } 29109 var FormikContext = /* @__PURE__ */ reactExports.createContext(void 0); 29110 FormikContext.displayName = "FormikContext"; 29111 var FormikProvider = FormikContext.Provider; 29112 FormikContext.Consumer; 29113 function useFormikContext() { 29114 var formik = reactExports.useContext(FormikContext); 29115 return formik; 29116 } 29117 var isFunction = function isFunction2(obj) { 29118 return typeof obj === "function"; 29119 }; 29120 var isObject$2 = function isObject2(obj) { 29121 return obj !== null && typeof obj === "object"; 29122 }; 29123 var isInteger = function isInteger2(obj) { 29124 return String(Math.floor(Number(obj))) === obj; 29125 }; 29126 var isString = function isString2(obj) { 29127 return Object.prototype.toString.call(obj) === "[object String]"; 29128 }; 29129 var isEmptyChildren = function isEmptyChildren2(children) { 29130 return reactExports.Children.count(children) === 0; 29131 }; 29132 var isPromise = function isPromise2(value) { 29133 return isObject$2(value) && isFunction(value.then); 29134 }; 29135 function getIn$1(obj, key, def, p2) { 29136 if (p2 === void 0) { 29137 p2 = 0; 29138 } 29139 var path = toPath(key); 29140 while (obj && p2 < path.length) { 29141 obj = obj[path[p2++]]; 29142 } 29143 if (p2 !== path.length && !obj) { 29144 return def; 29145 } 29146 return obj === void 0 ? def : obj; 29147 } 29148 function setIn(obj, path, value) { 29149 var res = clone$2(obj); 29150 var resVal = res; 29151 var i2 = 0; 29152 var pathArray = toPath(path); 29153 for (; i2 < pathArray.length - 1; i2++) { 29154 var currentPath = pathArray[i2]; 29155 var currentObj = getIn$1(obj, pathArray.slice(0, i2 + 1)); 29156 if (currentObj && (isObject$2(currentObj) || Array.isArray(currentObj))) { 29157 resVal = resVal[currentPath] = clone$2(currentObj); 29158 } else {
vendor: 4,778 bytes, lines 29159-29280
29159 var nextPath = pathArray[i2 + 1]; 29160 resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {}; 29161 } 29162 } 29163 if ((i2 === 0 ? obj : resVal)[pathArray[i2]] === value) { 29164 return obj; 29165 } 29166 if (value === void 0) { 29167 delete resVal[pathArray[i2]]; 29168 } else { 29169 resVal[pathArray[i2]] = value; 29170 } 29171 if (i2 === 0 && value === void 0) { 29172 delete res[pathArray[i2]]; 29173 } 29174 return res; 29175 } 29176 function setNestedObjectValues(object2, value, visited, response) { 29177 if (visited === void 0) { 29178 visited = /* @__PURE__ */ new WeakMap(); 29179 } 29180 if (response === void 0) { 29181 response = {}; 29182 } 29183 for (var _i2 = 0, _Object$keys = Object.keys(object2); _i2 < _Object$keys.length; _i2++) { 29184 var k2 = _Object$keys[_i2]; 29185 var val = object2[k2]; 29186 if (isObject$2(val)) { 29187 if (!visited.get(val)) { 29188 visited.set(val, true); 29189 response[k2] = Array.isArray(val) ? [] : {}; 29190 setNestedObjectValues(val, value, visited, response[k2]); 29191 } 29192 } else { 29193 response[k2] = value; 29194 } 29195 } 29196 return response; 29197 } 29198 function formikReducer(state, msg) { 29199 switch (msg.type) { 29200 case "SET_VALUES": 29201 return _extends$6({}, state, { 29202 values: msg.payload 29203 }); 29204 case "SET_TOUCHED": 29205 return _extends$6({}, state, { 29206 touched: msg.payload 29207 }); 29208 case "SET_ERRORS": 29209 if (isEqual$1(state.errors, msg.payload)) { 29210 return state; 29211 } 29212 return _extends$6({}, state, { 29213 errors: msg.payload 29214 }); 29215 case "SET_STATUS": 29216 return _extends$6({}, state, { 29217 status: msg.payload 29218 }); 29219 case "SET_ISSUBMITTING": 29220 return _extends$6({}, state, { 29221 isSubmitting: msg.payload 29222 }); 29223 case "SET_ISVALIDATING": 29224 return _extends$6({}, state, { 29225 isValidating: msg.payload 29226 }); 29227 case "SET_FIELD_VALUE": 29228 return _extends$6({}, state, { 29229 values: setIn(state.values, msg.payload.field, msg.payload.value) 29230 }); 29231 case "SET_FIELD_TOUCHED": 29232 return _extends$6({}, state, { 29233 touched: setIn(state.touched, msg.payload.field, msg.payload.value) 29234 }); 29235 case "SET_FIELD_ERROR": 29236 return _extends$6({}, state, { 29237 errors: setIn(state.errors, msg.payload.field, msg.payload.value) 29238 }); 29239 case "RESET_FORM": 29240 return _extends$6({}, state, msg.payload); 29241 case "SET_FORMIK_STATE": 29242 return msg.payload(state); 29243 case "SUBMIT_ATTEMPT": 29244 return _extends$6({}, state, { 29245 touched: setNestedObjectValues(state.values, true), 29246 isSubmitting: true, 29247 submitCount: state.submitCount + 1 29248 }); 29249 case "SUBMIT_FAILURE": 29250 return _extends$6({}, state, { 29251 isSubmitting: false 29252 }); 29253 case "SUBMIT_SUCCESS": 29254 return _extends$6({}, state, { 29255 isSubmitting: false 29256 }); 29257 default: 29258 return state; 29259 } 29260 } 29261 var emptyErrors = {}; 29262 var emptyTouched = {}; 29263 function useFormik(_ref2) { 29264 var _ref$validateOnChange = _ref2.validateOnChange, validateOnChange = _ref$validateOnChange === void 0 ? true : _ref$validateOnChange, _ref$validateOnBlur = _ref2.validateOnBlur, validateOnBlur = _ref$validateOnBlur === void 0 ? true : _ref$validateOnBlur, _ref$validateOnMount = _ref2.validateOnMount, validateOnMount = _ref$validateOnMount === void 0 ? false : _ref$validateOnMount, isInitialValid = _ref2.isInitialValid, _ref$enableReinitiali = _ref2.enableReinitialize, enableReinitialize = _ref$enableReinitiali === void 0 ? false : _ref$enableReinitiali, onSubmit = _ref2.onSubmit, rest = _objectWithoutPropertiesLoose$2(_ref2, ["validateOnChange", "validateOnBlur", "validateOnMount", "isInitialValid", "enableReinitialize", "onSubmit"]); 29265 var props = _extends$6({ 29266 validateOnChange, 29267 validateOnBlur, 29268 validateOnMount, 29269 onSubmit 29270 }, rest); 29271 var initialValues = reactExports.useRef(props.initialValues); 29272 var initialErrors = reactExports.useRef(props.initialErrors || emptyErrors); 29273 var initialTouched = reactExports.useRef(props.initialTouched || emptyTouched); 29274 var initialStatus = reactExports.useRef(props.initialStatus); 29275 var isMounted = reactExports.useRef(false); 29276 var fieldRegistry = reactExports.useRef({}); 29277 reactExports.useEffect(function() { 29278 isMounted.current = true; 29279 return function() { 29280 isMounted.current = false;
29281 }; 29282 }, []); 29283 var _React$useState = reactExports.useState(0), setIteration = _React$useState[1]; 29284 var stateRef = reactExports.useRef({ 29285 values: cloneDeep(props.initialValues), 29286 errors: cloneDeep(props.initialErrors) || emptyErrors, 29287 touched: cloneDeep(props.initialTouched) || emptyTouched, 29288 status: cloneDeep(props.initialStatus), 29289 isSubmitting: false, 29290 isValidating: false, 29291 submitCount: 0 29292 }); 29293 var state = stateRef.current; 29294 var dispatch = reactExports.useCallback(function(action) { 29295 var prev2 = stateRef.current; 29296 stateRef.current = formikReducer(prev2, action); 29297 if (prev2 !== stateRef.current) setIteration(function(x2) { 29298 return x2 + 1; 29299 }); 29300 }, []); 29301 var runValidateHandler = reactExports.useCallback(function(values, field) { 29302 return new Promise(function(resolve, reject) { 29303 var maybePromisedErrors = props.validate(values, field); 29304 if (maybePromisedErrors == null) { 29305 resolve(emptyErrors); 29306 } else if (isPromise(maybePromisedErrors)) { 29307 maybePromisedErrors.then(function(errors) { 29308 resolve(errors || emptyErrors); 29309 }, function(actualException) { 29310 reject(actualException); 29311 }); 29312 } else { 29313 resolve(maybePromisedErrors); 29314 } 29315 }); 29316 }, [props.validate]); 29317 var runValidationSchema = reactExports.useCallback(function(values, field) { 29318 var validationSchema = props.validationSchema; 29319 var schema = isFunction(validationSchema) ? validationSchema(field) : validationSchema; 29320 var promise = field && schema.validateAt ? schema.validateAt(field, values) : validateYupSchema(values, schema); 29321 return new Promise(function(resolve, reject) { 29322 promise.then(function() { 29323 resolve(emptyErrors); 29324 }, function(err) { 29325 if (err.name === "ValidationError") { 29326 resolve(yupToFormErrors(err)); 29327 } else { 29328 reject(err); 29329 } 29330 }); 29331 }); 29332 }, [props.validationSchema]); 29333 var runSingleFieldLevelValidation = reactExports.useCallback(function(field, value) { 29334 return new Promise(function(resolve) { 29335 return resolve(fieldRegistry.current[field].validate(value)); 29336 }); 29337 }, []); 29338 var runFieldLevelValidations = reactExports.useCallback(function(values) { 29339 var fieldKeysWithValidation = Object.keys(fieldRegistry.current).filter(function(f2) { 29340 return isFunction(fieldRegistry.current[f2].validate); 29341 }); 29342 var fieldValidations = fieldKeysWithValidation.length > 0 ? fieldKeysWithValidation.map(function(f2) { 29343 return runSingleFieldLevelValidation(f2, getIn$1(values, f2)); 29344 }) : [Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]; 29345 return Promise.all(fieldValidations).then(function(fieldErrorsList) { 29346 return fieldErrorsList.reduce(function(prev2, curr, index2) { 29347 if (curr === "DO_NOT_DELETE_YOU_WILL_BE_FIRED") { 29348 return prev2; 29349 } 29350 if (curr) { 29351 prev2 = setIn(prev2, fieldKeysWithValidation[index2], curr); 29352 } 29353 return prev2; 29354 }, {}); 29355 }); 29356 }, [runSingleFieldLevelValidation]); 29357 var runAllValidations = reactExports.useCallback(function(values) { 29358 return Promise.all([runFieldLevelValidations(values), props.validationSchema ? runValidationSchema(values) : {}, props.validate ? runValidateHandler(values) : {}]).then(function(_ref22) { 29359 var fieldErrors = _ref22[0], schemaErrors = _ref22[1], validateErrors = _ref22[2]; 29360 var combinedErrors = deepmerge_1.all([fieldErrors, schemaErrors, validateErrors], { 29361 arrayMerge 29362 }); 29363 return combinedErrors; 29364 }); 29365 }, [props.validate, props.validationSchema, runFieldLevelValidations, runValidateHandler, runValidationSchema]); 29366 var validateFormWithHighPriority = useEventCallback(function(values) { 29367 if (values === void 0) { 29368 values = state.values; 29369 } 29370 dispatch({ 29371 type: "SET_ISVALIDATING", 29372 payload: true 29373 }); 29374 return runAllValidations(values).then(function(combinedErrors) { 29375 if (!!isMounted.current) { 29376 dispatch({ 29377 type: "SET_ISVALIDATING", 29378 payload: false 29379 }); 29380 dispatch({ 29381 type: "SET_ERRORS", 29382 payload: combinedErrors 29383 }); 29384 } 29385 return combinedErrors; 29386 }); 29387 }); 29388 reactExports.useEffect(function() { 29389 if (validateOnMount && isMounted.current === true && isEqual$1(initialValues.current, props.initialValues)) { 29390 validateFormWithHighPriority(initialValues.current); 29391 } 29392 }, [validateOnMount, validateFormWithHighPriority]); 29393 var resetForm = reactExports.useCallback(function(nextState) { 29394 var values = nextState && nextState.values ? nextState.values : initialValues.current; 29395 var errors = nextState && nextState.errors ? nextState.errors : initialErrors.current ? initialErrors.current : props.initialErrors || {}; 29396 var touched = nextState && nextState.touched ? nextState.touched : initialTouched.current ? initialTouched.current : props.initialTouched || {}; 29397 var status = nextState && nextState.status ? nextState.status : initialStatus.current ? initialStatus.current : props.initialStatus; 29398 initialValues.current = values; 29399 initialErrors.current = errors; 29400 initialTouched.current = touched; 29401 initialStatus.current = status; 29402 var dispatchFn = function dispatchFn2() { 29403 dispatch({ 29404 type: "RESET_FORM", 29405 payload: { 29406 isSubmitting: !!nextState && !!nextState.isSubmitting, 29407 errors, 29408 touched, 29409 status, 29410 values, 29411 isValidating: !!nextState && !!nextState.isValidating, 29412 submitCount: !!nextState && !!nextState.submitCount && typeof nextState.submitCount === "number" ? nextState.submitCount : 0 29413 } 29414 }); 29415 }; 29416 if (props.onReset) { 29417 var maybePromisedOnReset = props.onReset(state.values, imperativeMethods);
29418 if (isPromise(maybePromisedOnReset)) { 29419 maybePromisedOnReset.then(dispatchFn); 29420 } else { 29421 dispatchFn(); 29422 } 29423 } else { 29424 dispatchFn(); 29425 } 29426 }, [props.initialErrors, props.initialStatus, props.initialTouched, props.onReset]); 29427 reactExports.useEffect(function() { 29428 if (isMounted.current === true && !isEqual$1(initialValues.current, props.initialValues)) { 29429 if (enableReinitialize) { 29430 initialValues.current = props.initialValues; 29431 resetForm(); 29432 if (validateOnMount) { 29433 validateFormWithHighPriority(initialValues.current); 29434 } 29435 } 29436 } 29437 }, [enableReinitialize, props.initialValues, resetForm, validateOnMount, validateFormWithHighPriority]); 29438 reactExports.useEffect(function() { 29439 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialErrors.current, props.initialErrors)) { 29440 initialErrors.current = props.initialErrors || emptyErrors; 29441 dispatch({ 29442 type: "SET_ERRORS", 29443 payload: props.initialErrors || emptyErrors 29444 }); 29445 } 29446 }, [enableReinitialize, props.initialErrors]); 29447 reactExports.useEffect(function() { 29448 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialTouched.current, props.initialTouched)) { 29449 initialTouched.current = props.initialTouched || emptyTouched; 29450 dispatch({ 29451 type: "SET_TOUCHED", 29452 payload: props.initialTouched || emptyTouched 29453 }); 29454 } 29455 }, [enableReinitialize, props.initialTouched]); 29456 reactExports.useEffect(function() { 29457 if (enableReinitialize && isMounted.current === true && !isEqual$1(initialStatus.current, props.initialStatus)) { 29458 initialStatus.current = props.initialStatus; 29459 dispatch({ 29460 type: "SET_STATUS", 29461 payload: props.initialStatus 29462 }); 29463 } 29464 }, [enableReinitialize, props.initialStatus, props.initialTouched]); 29465 var validateField = useEventCallback(function(name) { 29466 if (fieldRegistry.current[name] && isFunction(fieldRegistry.current[name].validate)) { 29467 var value = getIn$1(state.values, name); 29468 var maybePromise = fieldRegistry.current[name].validate(value); 29469 if (isPromise(maybePromise)) { 29470 dispatch({ 29471 type: "SET_ISVALIDATING", 29472 payload: true 29473 }); 29474 return maybePromise.then(function(x2) { 29475 return x2; 29476 }).then(function(error) { 29477 dispatch({ 29478 type: "SET_FIELD_ERROR", 29479 payload: { 29480 field: name, 29481 value: error 29482 } 29483 }); 29484 dispatch({ 29485 type: "SET_ISVALIDATING", 29486 payload: false 29487 }); 29488 }); 29489 } else { 29490 dispatch({ 29491 type: "SET_FIELD_ERROR", 29492 payload: { 29493 field: name, 29494 value: maybePromise 29495 } 29496 }); 29497 return Promise.resolve(maybePromise); 29498 } 29499 } else if (props.validationSchema) { 29500 dispatch({ 29501 type: "SET_ISVALIDATING", 29502 payload: true 29503 }); 29504 return runValidationSchema(state.values, name).then(function(x2) { 29505 return x2; 29506 }).then(function(error) { 29507 dispatch({ 29508 type: "SET_FIELD_ERROR", 29509 payload: { 29510 field: name, 29511 value: getIn$1(error, name) 29512 } 29513 }); 29514 dispatch({ 29515 type: "SET_ISVALIDATING", 29516 payload: false 29517 }); 29518 }); 29519 } 29520 return Promise.resolve(); 29521 }); 29522 var registerField = reactExports.useCallback(function(name, _ref3) { 29523 var validate = _ref3.validate; 29524 fieldRegistry.current[name] = { 29525 validate 29526 }; 29527 }, []); 29528 var unregisterField = reactExports.useCallback(function(name) { 29529 delete fieldRegistry.current[name]; 29530 }, []); 29531 var setTouched = useEventCallback(function(touched, shouldValidate) { 29532 dispatch({ 29533 type: "SET_TOUCHED", 29534 payload: touched 29535 }); 29536 var willValidate = shouldValidate === void 0 ? validateOnBlur : shouldValidate; 29537 return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve(); 29538 }); 29539 var setErrors = reactExports.useCallback(function(errors) { 29540 dispatch({ 29541 type: "SET_ERRORS", 29542 payload: errors 29543 }); 29544 }, []); 29545 var setValues = useEventCallback(function(values, shouldValidate) { 29546 var resolvedValues = isFunction(values) ? values(state.values) : values; 29547 dispatch({
vendor: 12,048 bytes, lines 29548-29871
29548 type: "SET_VALUES", 29549 payload: resolvedValues 29550 }); 29551 var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate; 29552 return willValidate ? validateFormWithHighPriority(resolvedValues) : Promise.resolve(); 29553 }); 29554 var setFieldError = reactExports.useCallback(function(field, value) { 29555 dispatch({ 29556 type: "SET_FIELD_ERROR", 29557 payload: { 29558 field, 29559 value 29560 } 29561 }); 29562 }, []); 29563 var setFieldValue = useEventCallback(function(field, value, shouldValidate) { 29564 dispatch({ 29565 type: "SET_FIELD_VALUE", 29566 payload: { 29567 field, 29568 value 29569 } 29570 }); 29571 var willValidate = shouldValidate === void 0 ? validateOnChange : shouldValidate; 29572 return willValidate ? validateFormWithHighPriority(setIn(state.values, field, value)) : Promise.resolve(); 29573 }); 29574 var executeChange = reactExports.useCallback(function(eventOrTextValue, maybePath) { 29575 var field = maybePath; 29576 var val = eventOrTextValue; 29577 var parsed; 29578 if (!isString(eventOrTextValue)) { 29579 if (eventOrTextValue.persist) { 29580 eventOrTextValue.persist(); 29581 } 29582 var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget; 29583 var type = target.type, name = target.name, id2 = target.id, value = target.value, checked = target.checked; 29584 target.outerHTML; 29585 var options2 = target.options, multiple = target.multiple; 29586 field = maybePath ? maybePath : name ? name : id2; 29587 val = /number|range/.test(type) ? (parsed = parseFloat(value), isNaN(parsed) ? "" : parsed) : /checkbox/.test(type) ? getValueForCheckbox(getIn$1(state.values, field), checked, value) : options2 && multiple ? getSelectedValues(options2) : value; 29588 } 29589 if (field) { 29590 setFieldValue(field, val); 29591 } 29592 }, [setFieldValue, state.values]); 29593 var handleChange = useEventCallback(function(eventOrPath) { 29594 if (isString(eventOrPath)) { 29595 return function(event) { 29596 return executeChange(event, eventOrPath); 29597 }; 29598 } else { 29599 executeChange(eventOrPath); 29600 } 29601 }); 29602 var setFieldTouched = useEventCallback(function(field, touched, shouldValidate) { 29603 if (touched === void 0) { 29604 touched = true; 29605 } 29606 dispatch({ 29607 type: "SET_FIELD_TOUCHED", 29608 payload: { 29609 field, 29610 value: touched 29611 } 29612 }); 29613 var willValidate = shouldValidate === void 0 ? validateOnBlur : shouldValidate; 29614 return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve(); 29615 }); 29616 var executeBlur = reactExports.useCallback(function(e2, path) { 29617 if (e2.persist) { 29618 e2.persist(); 29619 } 29620 var _e$target = e2.target, name = _e$target.name, id2 = _e$target.id; 29621 _e$target.outerHTML; 29622 var field = path ? path : name ? name : id2; 29623 setFieldTouched(field, true); 29624 }, [setFieldTouched]); 29625 var handleBlur = useEventCallback(function(eventOrString) { 29626 if (isString(eventOrString)) { 29627 return function(event) { 29628 return executeBlur(event, eventOrString); 29629 }; 29630 } else { 29631 executeBlur(eventOrString); 29632 } 29633 }); 29634 var setFormikState = reactExports.useCallback(function(stateOrCb) { 29635 if (isFunction(stateOrCb)) { 29636 dispatch({ 29637 type: "SET_FORMIK_STATE", 29638 payload: stateOrCb 29639 }); 29640 } else { 29641 dispatch({ 29642 type: "SET_FORMIK_STATE", 29643 payload: function payload() { 29644 return stateOrCb; 29645 } 29646 }); 29647 } 29648 }, []); 29649 var setStatus = reactExports.useCallback(function(status) { 29650 dispatch({ 29651 type: "SET_STATUS", 29652 payload: status 29653 }); 29654 }, []); 29655 var setSubmitting = reactExports.useCallback(function(isSubmitting) { 29656 dispatch({ 29657 type: "SET_ISSUBMITTING", 29658 payload: isSubmitting 29659 }); 29660 }, []); 29661 var submitForm = useEventCallback(function() { 29662 dispatch({ 29663 type: "SUBMIT_ATTEMPT" 29664 }); 29665 return validateFormWithHighPriority().then(function(combinedErrors) { 29666 var isInstanceOfError = combinedErrors instanceof Error; 29667 var isActuallyValid = !isInstanceOfError && Object.keys(combinedErrors).length === 0; 29668 if (isActuallyValid) { 29669 var promiseOrUndefined; 29670 try { 29671 promiseOrUndefined = executeSubmit(); 29672 if (promiseOrUndefined === void 0) { 29673 return; 29674 } 29675 } catch (error) { 29676 throw error; 29677 } 29678 return Promise.resolve(promiseOrUndefined).then(function(result) { 29679 if (!!isMounted.current) { 29680 dispatch({ 29681 type: "SUBMIT_SUCCESS" 29682 }); 29683 } 29684 return result; 29685 })["catch"](function(_errors) { 29686 if (!!isMounted.current) { 29687 dispatch({ 29688 type: "SUBMIT_FAILURE" 29689 }); 29690 throw _errors; 29691 } 29692 }); 29693 } else if (!!isMounted.current) { 29694 dispatch({ 29695 type: "SUBMIT_FAILURE" 29696 }); 29697 if (isInstanceOfError) { 29698 throw combinedErrors; 29699 } 29700 } 29701 return; 29702 }); 29703 }); 29704 var handleSubmit = useEventCallback(function(e2) { 29705 if (e2 && e2.preventDefault && isFunction(e2.preventDefault)) { 29706 e2.preventDefault(); 29707 } 29708 if (e2 && e2.stopPropagation && isFunction(e2.stopPropagation)) { 29709 e2.stopPropagation(); 29710 } 29711 submitForm()["catch"](function(reason) { 29712 console.warn("Warning: An unhandled error was caught from submitForm()", reason); 29713 }); 29714 }); 29715 var imperativeMethods = { 29716 resetForm, 29717 validateForm: validateFormWithHighPriority, 29718 validateField, 29719 setErrors, 29720 setFieldError, 29721 setFieldTouched, 29722 setFieldValue, 29723 setStatus, 29724 setSubmitting, 29725 setTouched, 29726 setValues, 29727 setFormikState, 29728 submitForm 29729 }; 29730 var executeSubmit = useEventCallback(function() { 29731 return onSubmit(state.values, imperativeMethods); 29732 }); 29733 var handleReset = useEventCallback(function(e2) { 29734 if (e2 && e2.preventDefault && isFunction(e2.preventDefault)) { 29735 e2.preventDefault(); 29736 } 29737 if (e2 && e2.stopPropagation && isFunction(e2.stopPropagation)) { 29738 e2.stopPropagation(); 29739 } 29740 resetForm(); 29741 }); 29742 var getFieldMeta = reactExports.useCallback(function(name) { 29743 return { 29744 value: getIn$1(state.values, name), 29745 error: getIn$1(state.errors, name), 29746 touched: !!getIn$1(state.touched, name), 29747 initialValue: getIn$1(initialValues.current, name), 29748 initialTouched: !!getIn$1(initialTouched.current, name), 29749 initialError: getIn$1(initialErrors.current, name) 29750 }; 29751 }, [state.errors, state.touched, state.values]); 29752 var getFieldHelpers = reactExports.useCallback(function(name) { 29753 return { 29754 setValue: function setValue(value, shouldValidate) { 29755 return setFieldValue(name, value, shouldValidate); 29756 }, 29757 setTouched: function setTouched2(value, shouldValidate) { 29758 return setFieldTouched(name, value, shouldValidate); 29759 }, 29760 setError: function setError(value) { 29761 return setFieldError(name, value); 29762 } 29763 }; 29764 }, [setFieldValue, setFieldTouched, setFieldError]); 29765 var getFieldProps = reactExports.useCallback(function(nameOrOptions) { 29766 var isAnObject = isObject$2(nameOrOptions); 29767 var name = isAnObject ? nameOrOptions.name : nameOrOptions; 29768 var valueState = getIn$1(state.values, name); 29769 var field = { 29770 name, 29771 value: valueState, 29772 onChange: handleChange, 29773 onBlur: handleBlur 29774 }; 29775 if (isAnObject) { 29776 var type = nameOrOptions.type, valueProp = nameOrOptions.value, is = nameOrOptions.as, multiple = nameOrOptions.multiple; 29777 if (type === "checkbox") { 29778 if (valueProp === void 0) { 29779 field.checked = !!valueState; 29780 } else { 29781 field.checked = !!(Array.isArray(valueState) && ~valueState.indexOf(valueProp)); 29782 field.value = valueProp; 29783 } 29784 } else if (type === "radio") { 29785 field.checked = valueState === valueProp; 29786 field.value = valueProp; 29787 } else if (is === "select" && multiple) { 29788 field.value = field.value || []; 29789 field.multiple = true; 29790 } 29791 } 29792 return field; 29793 }, [handleBlur, handleChange, state.values]); 29794 var dirty = reactExports.useMemo(function() { 29795 return !isEqual$1(initialValues.current, state.values); 29796 }, [initialValues.current, state.values]); 29797 var isValid = reactExports.useMemo(function() { 29798 return typeof isInitialValid !== "undefined" ? dirty ? state.errors && Object.keys(state.errors).length === 0 : isInitialValid !== false && isFunction(isInitialValid) ? isInitialValid(props) : isInitialValid : state.errors && Object.keys(state.errors).length === 0; 29799 }, [isInitialValid, dirty, state.errors, props]); 29800 var ctx = _extends$6({}, state, { 29801 initialValues: initialValues.current, 29802 initialErrors: initialErrors.current, 29803 initialTouched: initialTouched.current, 29804 initialStatus: initialStatus.current, 29805 handleBlur, 29806 handleChange, 29807 handleReset, 29808 handleSubmit, 29809 resetForm, 29810 setErrors, 29811 setFormikState, 29812 setFieldTouched, 29813 setFieldValue, 29814 setFieldError, 29815 setStatus, 29816 setSubmitting, 29817 setTouched, 29818 setValues, 29819 submitForm, 29820 validateForm: validateFormWithHighPriority, 29821 validateField, 29822 isValid, 29823 dirty, 29824 unregisterField, 29825 registerField, 29826 getFieldProps, 29827 getFieldMeta, 29828 getFieldHelpers, 29829 validateOnBlur, 29830 validateOnChange, 29831 validateOnMount 29832 }); 29833 return ctx; 29834 } 29835 function Formik(props) { 29836 var formikbag = useFormik(props); 29837 var component = props.component, children = props.children, render = props.render, innerRef = props.innerRef; 29838 reactExports.useImperativeHandle(innerRef, function() { 29839 return formikbag; 29840 }); 29841 return reactExports.createElement(FormikProvider, { 29842 value: formikbag 29843 }, component ? reactExports.createElement(component, formikbag) : render ? render(formikbag) : children ? isFunction(children) ? children(formikbag) : !isEmptyChildren(children) ? reactExports.Children.only(children) : null : null); 29844 } 29845 function yupToFormErrors(yupError) { 29846 var errors = {}; 29847 if (yupError.inner) { 29848 if (yupError.inner.length === 0) { 29849 return setIn(errors, yupError.path, yupError.message); 29850 } 29851 for (var _iterator = yupError.inner, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ; ) { 29852 var _ref5; 29853 if (_isArray) { 29854 if (_i2 >= _iterator.length) break; 29855 _ref5 = _iterator[_i2++]; 29856 } else { 29857 _i2 = _iterator.next(); 29858 if (_i2.done) break; 29859 _ref5 = _i2.value; 29860 } 29861 var err = _ref5; 29862 if (!getIn$1(errors, err.path)) { 29863 errors = setIn(errors, err.path, err.message); 29864 } 29865 } 29866 } 29867 return errors; 29868 } 29869 function validateYupSchema(values, schema, sync, context) { 29870 if (sync === void 0) { 29871 sync = false;
29872 } 29873 var normalizedValues = prepareDataForValidation(values); 29874 return schema[sync ? "validateSync" : "validate"](normalizedValues, { 29875 abortEarly: false, 29876 context: context || normalizedValues 29877 }); 29878 } 29879 function prepareDataForValidation(values) { 29880 var data = Array.isArray(values) ? [] : {}; 29881 for (var k2 in values) { 29882 if (Object.prototype.hasOwnProperty.call(values, k2)) { 29883 var key = String(k2); 29884 if (Array.isArray(values[key]) === true) { 29885 data[key] = values[key].map(function(value) { 29886 if (Array.isArray(value) === true || isPlainObject$1(value)) { 29887 return prepareDataForValidation(value); 29888 } else { 29889 return value !== "" ? value : void 0; 29890 } 29891 }); 29892 } else if (isPlainObject$1(values[key])) { 29893 data[key] = prepareDataForValidation(values[key]); 29894 } else { 29895 data[key] = values[key] !== "" ? values[key] : void 0; 29896 } 29897 } 29898 } 29899 return data; 29900 } 29901 function arrayMerge(target, source, options2) { 29902 var destination = target.slice(); 29903 source.forEach(function merge2(e2, i2) { 29904 if (typeof destination[i2] === "undefined") { 29905 var cloneRequested = options2.clone !== false; 29906 var shouldClone = cloneRequested && options2.isMergeableObject(e2); 29907 destination[i2] = shouldClone ? deepmerge_1(Array.isArray(e2) ? [] : {}, e2, options2) : e2; 29908 } else if (options2.isMergeableObject(e2)) { 29909 destination[i2] = deepmerge_1(target[i2], e2, options2); 29910 } else if (target.indexOf(e2) === -1) { 29911 destination.push(e2); 29912 } 29913 }); 29914 return destination; 29915 } 29916 function getSelectedValues(options2) { 29917 return Array.from(options2).filter(function(el) { 29918 return el.selected; 29919 }).map(function(el) { 29920 return el.value; 29921 }); 29922 } 29923 function getValueForCheckbox(currentValue, checked, valueProp) { 29924 if (typeof currentValue === "boolean") { 29925 return Boolean(checked); 29926 } 29927 var currentArrayOfValues = []; 29928 var isValueInArray = false; 29929 var index2 = -1; 29930 if (!Array.isArray(currentValue)) { 29931 if (!valueProp || valueProp == "true" || valueProp == "false") { 29932 return Boolean(checked); 29933 } 29934 } else { 29935 currentArrayOfValues = currentValue; 29936 index2 = currentValue.indexOf(valueProp); 29937 isValueInArray = index2 >= 0; 29938 } 29939 if (checked && valueProp && !isValueInArray) { 29940 return currentArrayOfValues.concat(valueProp); 29941 } 29942 if (!isValueInArray) { 29943 return currentArrayOfValues; 29944 } 29945 return currentArrayOfValues.slice(0, index2).concat(currentArrayOfValues.slice(index2 + 1)); 29946 } 29947 var useIsomorphicLayoutEffect$3 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect; 29948 function useEventCallback(fn2) { 29949 var ref = reactExports.useRef(fn2); 29950 useIsomorphicLayoutEffect$3(function() { 29951 ref.current = fn2; 29952 }); 29953 return reactExports.useCallback(function() { 29954 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 29955 args[_key] = arguments[_key]; 29956 } 29957 return ref.current.apply(void 0, args); 29958 }, []); 29959 } 29960 function Field(_ref2) { 29961 var validate = _ref2.validate, name = _ref2.name, render = _ref2.render, children = _ref2.children, is = _ref2.as, component = _ref2.component, className = _ref2.className, props = _objectWithoutPropertiesLoose$2(_ref2, ["validate", "name", "render", "children", "as", "component", "className"]); 29962 var _useFormikContext = useFormikContext(), formik = _objectWithoutPropertiesLoose$2(_useFormikContext, ["validate", "validationSchema"]); 29963 var registerField = formik.registerField, unregisterField = formik.unregisterField; 29964 reactExports.useEffect(function() { 29965 registerField(name, { 29966 validate 29967 }); 29968 return function() { 29969 unregisterField(name); 29970 }; 29971 }, [registerField, unregisterField, name, validate]); 29972 var field = formik.getFieldProps(_extends$6({ 29973 name 29974 }, props)); 29975 var meta = formik.getFieldMeta(name); 29976 var legacyBag = { 29977 field, 29978 form: formik 29979 }; 29980 if (render) { 29981 return render(_extends$6({}, legacyBag, { 29982 meta 29983 })); 29984 } 29985 if (isFunction(children)) { 29986 return children(_extends$6({}, legacyBag, { 29987 meta 29988 })); 29989 } 29990 if (component) { 29991 if (typeof component === "string") { 29992 var innerRef = props.innerRef, rest = _objectWithoutPropertiesLoose$2(props, ["innerRef"]); 29993 return reactExports.createElement(component, _extends$6({ 29994 ref: innerRef 29995 }, field, rest, { 29996 className 29997 }), children); 29998 } 29999 return reactExports.createElement(component, _extends$6({ 30000 field, 30001 form: formik 30002 }, props, { 30003 className 30004 }), children); 30005 } 30006 var asElement = is || "input"; 30007 if (typeof asElement === "string") { 30008 var _innerRef = props.innerRef, _rest = _objectWithoutPropertiesLoose$2(props, ["innerRef"]); 30009 return reactExports.createElement(asElement, _extends$6({ 30010 ref: _innerRef 30011 }, field, _rest, { 30012 className 30013 }), children); 30014 } 30015 return reactExports.createElement(asElement, _extends$6({}, field, props, { 30016 className 30017 }), children); 30018 } 30019 var Form = /* @__PURE__ */ reactExports.forwardRef(function(props, ref) { 30020 var action = props.action, rest = _objectWithoutPropertiesLoose$2(props, ["action"]); 30021 var _action = action != null ? action : "#"; 30022 var _useFormikContext = useFormikContext(), handleReset = _useFormikContext.handleReset, handleSubmit = _useFormikContext.handleSubmit; 30023 return reactExports.createElement("form", _extends$6({ 30024 onSubmit: handleSubmit, 30025 ref, 30026 onReset: handleReset, 30027 action: _action 30028 }, rest)); 30029 }); 30030 Form.displayName = "Form"; 30031 var mapTag = "[object Map]", setTag = "[object Set]"; 30032 var objectProto$1 = Object.prototype; 30033 var hasOwnProperty$1 = objectProto$1.hasOwnProperty; 30034 function isEmpty(value) { 30035 if (value == null) { 30036 return true; 30037 } 30038 if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { 30039 return !value.length; 30040 } 30041 var tag = getTag(value); 30042 if (tag == mapTag || tag == setTag) { 30043 return !value.size; 30044 } 30045 if (isPrototype(value)) { 30046 return !baseKeys(value).length; 30047 } 30048 for (var key in value) { 30049 if (hasOwnProperty$1.call(value, key)) { 30050 return false;
30051 } 30052 } 30053 return true; 30054 } 30055 var l$2 = (r2, t2 = {}) => { 30056 let [o2, e2] = reactExports.useState(false); 30057 return reactExports.useEffect(() => { 30058 r2 && t2.hidePristineErrors && e2(true); 30059 }, [r2, t2.hidePristineErrors]), o2; 30060 }; 30061 var P$3 = (r2, t2, o2) => isObject$3(r2) ? (Object.entries(r2).forEach(([e2, n2]) => { 30062 P$3(n2, t2 ? `${t2}.${e2}` : e2, o2); 30063 }), o2) : (o2[t2] = r2, o2), u$4 = (r2, t2 = []) => P$3(r2, t2.join("."), {}), E$4 = (r2) => reduce(r2, (t2, o2, e2) => set$1(t2, e2, o2), {}); 30064 var F$3 = (r2, t2) => (o2) => { 30065 let e2 = r2.getFieldProps(o2); 30066 return __spreadProps(__spreadValues({}, e2), { onChange: (s2) => { 30067 var _a, _b; 30068 if (e2.onChange(s2), (_b = (_a = r2.status) == null ? void 0 : _a.errors) == null ? void 0 : _b[o2]) { 30069 let _c = r2.status.errors, { [o2]: i2 } = _c, a2 = __objRest(_c, [__restKey(o2)]); 30070 r2.setStatus(__spreadProps(__spreadValues({}, r2.status), { errors: a2 })); 30071 } 30072 }, error: get(t2, o2), submitCount: r2.submitCount }); 30073 }; 30074 var d$2 = (r2, t2, o2 = {}) => { 30075 var _a; 30076 let e2 = u$4(r2.touched), n2 = u$4(r2.errors), s2 = u$4(((_a = r2.status) == null ? void 0 : _a.errors) || {}); 30077 if (!t2 && o2.hidePristineErrors && r2.submitCount === 0) return {}; 30078 let i2 = mapValues(merge(s2, n2), (a2, p2) => { 30079 let c2 = !!get(r2.values, p2); 30080 return r2.submitCount > 0 || c2 && get(e2, p2) ? a2 : void 0; 30081 }); 30082 return o2.showOnlyFirstError && !isEmpty(i2) ? { [Object.keys(i2)[0]]: Object.values(i2)[0] } : E$4(i2); 30083 }; 30084 var y$4 = (r2 = {}) => { 30085 let t2 = useFormikContext(), o2 = l$2(t2.dirty, r2), e2 = d$2(t2, o2, r2), n2 = F$3(t2, e2); 30086 return __spreadProps(__spreadValues({}, t2), { errors: e2, getFieldProps: n2 }); 30087 }; 30088 var Fr$2 = (r2) => function(_a) { 30089 var _b = _a, { invalid: t2 = false, error: o2, field: e2, form: n2, onChange: s2, onBlur: i2 } = _b, a2 = __objRest(_b, ["invalid", "error", "field", "form", "onChange", "onBlur"]); 30090 let p2 = e2 && n2 && get(n2.touched, e2.name), c2 = e2 && n2 && get(n2.errors, e2.name), k2 = (m2) => { 30091 var _a2, _b2, _c, _d, _e2; 30092 return ((_a2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _a2.type) === "checkbox" ? isNil((_b2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _b2.checked) ? m2 : (_c = m2 == null ? void 0 : m2.target) == null ? void 0 : _c.checked : isNil((_d = m2 == null ? void 0 : m2.target) == null ? void 0 : _d.value) ? m2 : (_e2 = m2 == null ? void 0 : m2.target) == null ? void 0 : _e2.value; 30093 }, f2 = (m2) => (n2 && e2 && n2.setFieldValue(e2.name, k2(m2)), s2 ? s2(m2) : null), v2 = (m2) => { 30094 i2 && i2(m2), n2 && e2 && n2.setFieldTouched(e2.name, true); 30095 }; 30096 return jsxRuntimeExports.jsx(r2, __spreadProps(__spreadValues(__spreadValues({}, a2), e2), { invalid: t2 || o2 || (p2 || (n2 == null ? void 0 : n2.submitCount)) && !!c2, error: o2 || (p2 || (n2 == null ? void 0 : n2.submitCount)) && c2, onChange: f2, onBlur: v2 })); 30097 }; 30098 const INPUT_PADDING = 15; 30099 const INPUT_PADDING_XSMALL = 10; 30100 const INPUT_PADDING_SMALL = 6; 30101 const PREPEND_MARGIN = 8; 30102 const APPEND_MARGIN = 4; 30103 const ICON_SIZE = 16; 30104 const ACTION_ICON_SIZE = 12; 30105 const ICON_MARGIN = 10; 30106 const SPINNER_OFFSET = 30; 30107 const Root$3 = dt$2.div` 30108 position: relative; 30109 30110 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 30111`; 30112 const Container$q = dt$2.div` 30113 position: relative; 30114 width: 100%; 30115`; 30116 const getBoxBorderColor = ({ $invalid, $focused, $transparent }) => { 30117 if ($transparent) { 30118 return "transparent"; 30119 } 30120 if ($invalid) { 30121 return "var(--input-border-critical) !important"; 30122 } 30123 if ($focused) { 30124 return "var(--input-border-active) !important"; 30125 } 30126 return "var(--input-border, var(--border-secondary))"; 30127 }; 30128 const getBoxBackground = ({ $transparent }) => { 30129 if ($transparent) { 30130 return "transparent"; 30131 } 30132 return "var(--input-bg)"; 30133 };
30134 const getBoxDisabledBackground = ({ $transparent }) => { 30135 if ($transparent) { 30136 return "transparent"; 30137 } 30138 return "var(--bg-secondary)"; 30139 }; 30140 const Box$2 = dt$2.div` 30141 /* Input */ 30142 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 30143 background: ${getBoxBackground}; 30144 border: 1px solid ${getBoxBorderColor}; 30145 display: flex; 30146 align-items: center; 30147 30148 border-radius: var(--input-radius-normal); 30149 30150 ${({ $size, $fullHeight }) => $size === "large" && !$fullHeight && lt$2` 30151 height: 56px; 30152 `} 30153 30154 ${({ $size, $fullHeight }) => $size === "medium" && !$fullHeight && lt$2` 30155 height: 48px; 30156 `} 30157 30158 ${({ $size, $fullHeight }) => $size === "small" && !$fullHeight && lt$2` 30159 height: 40px; 30160 `} 30161 30162 ${({ $size, $fullHeight }) => $size === "xsmall" && !$fullHeight && lt$2` 30163 height: 32px; 30164 `} 30165 30166 ${({ $disabled, $hovered }) => !$disabled && lt$2` 30167 &:hover { 30168 border-color: var(--input-border-hover); 30169 } 30170 30171 ${$hovered && lt$2` 30172 border-color: var(--input-border-hover); 30173 `} 30174 `} 30175 30176 ${({ $disabled, $transparent }) => $disabled && lt$2` 30177 opacity: 0.3; 30178 background: ${getBoxDisabledBackground({ $transparent })}; 30179 cursor: not-allowed; 30180 `} 30181`; 30182 const Label$3 = dt$2.label` 30183 position: absolute; 30184 top: 50%; 30185 left: 0; 30186 width: 100%; 30187 transform: translateY(-50%); 30188 color: var(--text-secondary); 30189 pointer-events: none; 30190 font-size: var(--font-size-400); 30191 line-height: var(--font-line-height-400); 30192 letter-spacing: var(--font-letter-spacing-normal); 30193 padding-left: var(--space-400); 30194 padding-right: var(--space-400); 30195 white-space: nowrap; 30196 text-overflow: ellipsis; 30197 overflow: hidden; 30198 30199 user-select: none; 30200 30201 ${({ $size }) => $size === "xsmall" && lt$2` 30202 font-size: var(--font-size-300); 30203 line-height: var(--font-line-height-300); 30204 letter-spacing: var(--font-letter-spacing-loose); 30205 `} 30206 30207 ${({ $size, $hasValue }) => $size === "large" && $hasValue && lt$2` 30208 top: 0; 30209 transform: none; 30210 font-size: var(--font-size-200); 30211 line-height: 34px; 30212 `} 30213 30214 ${({ $size, $hasValue }) => $size === "medium" && $hasValue && lt$2` 30215 top: 0; 30216 transform: none; 30217 font-size: var(--font-size-100); 30218 line-height: var(--font-line-height-100); 30219 letter-spacing: var(--font-letter-spacing-loosest); 30220 `} 30221 30222 ${({ $size, $hasValue }) => ($size === "small" || $size === "xsmall") && $hasValue && lt$2` 30223 display: none; 30224 `} 30225 30226 ${({ $centered }) => $centered && lt$2` 30227 padding-left: ${SPINNER_OFFSET}px; 30228 padding-right: ${SPINNER_OFFSET}px; 30229 text-align: center; 30230 `} 30231`; 30232 const getTextColor = () => "var(--text-primary)"; 30233 const Input$3 = dt$2.input` 30234 width: 100%; 30235 padding: 0 var(--space-350); 30236 background: transparent; 30237 border: 0; 30238 outline: 0; 30239 vertical-align: top; 30240 30241 font-size: var(--font-size-400); 30242 color: ${getTextColor}; 30243 30244 ::placeholder { 30245 color: var(--text-secondary); 30246 } 30247 30248 &:disabled { 30249 color: ${getTextColor}; 30250 cursor: not-allowed; 30251 } 30252 30253 // https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/ 30254 &:-webkit-autofill, 30255 &:-webkit-autofill:focus, 30256 &:-webkit-autofill:hover { 30257 -webkit-text-fill-color: ${getTextColor}; 30258 -webkit-background-clip: text; 30259 caret-color: ${getTextColor}; 30260 } 30261 30262 ${({ $centered }) => $centered && lt$2` 30263 text-align: center; 30264 `} 30265 30266 ${({ $inputSize, $hasLabel }) => $inputSize === "large" && lt$2` 30267 line-height: 54px; 30268 30269 &:-webkit-autofill { 30270 & ~ ${Label$3} { 30271 top: 0; 30272 transform: none; 30273 font-size: var(--font-size-200); 30274 line-height: 34px; 30275 } 30276 } 30277 30278 ${$hasLabel && lt$2` 30279 padding-top: var(--space-400); 30280 line-height: 38px; 30281 `} 30282 `} 30283 30284 ${({ $inputSize, $hasLabel }) => $inputSize === "medium" && lt$2` 30285 line-height: 48px; 30286 30287 &:-webkit-autofill { 30288 & ~ ${Label$3} { 30289 top: 0; 30290 transform: none; 30291 font-size: var(--font-size-100); 30292 line-height: var(--font-line-height-100); 30293 letter-spacing: var(--font-letter-spacing-loosest); 30294 } 30295 } 30296 30297 ${$hasLabel && lt$2` 30298 padding-top: var(--space-350); 30299 30300 line-height: var(--font-line-height-400); /* 150% */ 30301 letter-spacing: var(--font-letter-spacing-normal); 30302 `} 30303 `} 30304 30305 ${({ $inputSize, $hasLabel }) => $inputSize === "small" && lt$2` 30306 line-height: 38px; 30307 30308 &:-webkit-autofill { 30309 & ~ ${Label$3} { 30310 display: none; 30311 } 30312 } 30313 30314 ${$hasLabel && lt$2` 30315 line-height: 38px; 30316 `} 30317 `} 30318 30319 ${({ $inputSize, $hasLabel }) => $inputSize === "xsmall" && lt$2` 30320 font-size: var(--font-size-300); 30321 line-height: var(--font-line-height-300); 30322 letter-spacing: var(--font-letter-spacing-loose); 30323 30324 &:-webkit-autofill { 30325 & ~ ${Label$3} { 30326 display: none; 30327 } 30328 } 30329 30330 ${$hasLabel && lt$2` 30331 line-height: var(--font-line-height-300); 30332 `} 30333 30334 padding: 0 var(--space-250); 30335 `} 30336 30337 ${({ type, $hasSpinner }) => type === "number" && lt$2` 30338 ${$hasSpinner && lt$2` 30339 min-width: 90px; 30340 `} 30341 30342 &[type='number'] { 30343 -webkit-appearance: textfield; 30344 -moz-appearance: textfield; 30345 appearance: textfield; 30346 } 30347 30348 &[type='number']::-webkit-inner-spin-button, 30349 &[type='number']::-webkit-outer-spin-button { 30350 -webkit-appearance: none; 30351 } 30352 `} 30353 30354 ${({ $readOnly }) => $readOnly && lt$2` 30355 caret-color: transparent; 30356 `} 30357 30358 ${({ $strikethrough }) => $strikethrough && lt$2` 30359 &:not(:focus) { 30360 text-decoration: line-through; 30361 } 30362 `} 30363 30364 ${({ $masked }) => $masked && lt$2` 30365 color: transparent; 30366 30367 &::selection { 30368 background: transparent; 30369 } 30370 `} 30371 30372 ${({ $innerPadding }) => $innerPadding === "small" && lt$2` 30373 padding: 0 ${INPUT_PADDING_SMALL}px; 30374 `} 30375 30376 ${({ $innerPadding }) => $innerPadding === "medium" && lt$2` 30377 padding: 0 ${INPUT_PADDING}px; 30378 `} 30379`; 30380 const SpinnerLeft$1 = dt$2.div` 30381 position: absolute; 30382 left: 0; 30383 top: 0; 30384 bottom: 0; 30385 display: flex; 30386 justify-content: center; 30387 align-items: center; 30388 padding: var(--space-50); 30389`; 30390 const SpinnerRight$1 = dt$2.div` 30391 position: absolute; 30392 right: 0; 30393 top: 0; 30394 bottom: 0; 30395 display: flex; 30396 justify-content: center; 30397 align-items: center; 30398 padding: var(--space-50); 30399`; 30400 const SpinnerItem$1 = dt$2.button` 30401 display: flex; 30402 justify-content: center; 30403 align-items: center; 30404 width: 24px; 30405 height: 100%; 30406 color: ${getTextColor}; 30407 background-color: var(--bg-secondary); 30408 border: none; 30409 cursor: pointer; 30410 border-radius: var(--input-radius-normal); 30411 30412 &:disabled {
30413 cursor: not-allowed; 30414 } 30415`; 30416 const Prepend$1 = dt$2.div` 30417 color: ${getTextColor}; 30418 font-size: var(--font-size-300); 30419 position: absolute; 30420 left: var(--space-400); 30421 top: 1px; 30422 bottom: 1px; 30423 user-select: none; 30424 visibility: hidden; 30425 line-height: 1.5; 30426 letter-spacing: var(--font-letter-spacing-normal); 30427 color: var(--text-secondary); 30428 30429 /* NOTE: Trim left side of prepend when its width is bigger than 50% of input */ 30430 direction: rtl; 30431 max-width: 50%; 30432 text-overflow: ellipsis; 30433 white-space: nowrap; 30434 overflow: hidden; 30435 30436 ${({ $size, $hasLabel }) => $size === "large" && lt$2` 30437 line-height: 54px; 30438 30439 ${$hasLabel && lt$2` 30440 padding-top: var(--space-400); 30441 line-height: 38px; 30442 `} 30443 `} 30444 30445 ${({ $size, $hasLabel }) => $size === "medium" && lt$2` 30446 line-height: 48px; 30447 30448 ${$hasLabel && lt$2` 30449 padding-top: var(--space-350); 30450 line-height: 32px; 30451 `} 30452 `} 30453 30454 ${({ $size }) => $size === "small" && lt$2` 30455 line-height: 38px; 30456 `} 30457 30458 ${({ $size }) => $size === "xsmall" && lt$2` 30459 line-height: 30px; 30460 `} 30461 30462 ${({ $visible }) => $visible && lt$2` 30463 visibility: visible; 30464 `} 30465`; 30466 const Append$1 = dt$2(Prepend$1)` 30467 right: var(--space-400); 30468 left: auto; 30469 direction: ltr; 30470 30471 ${({ $largeSpace }) => $largeSpace && lt$2` 30472 right: var(--space-900); 30473 `} 30474`; 30475 const getIconColor = ({ $hasValue }) => { 30476 if ($hasValue) { 30477 return "var(--text-primary)"; 30478 } 30479 return "var(--icon-secondary)"; 30480 }; 30481 const IconContainer$1 = dt$2.div` 30482 position: absolute; 30483 padding-left: var(--space-300); 30484 color: ${getIconColor}; 30485 30486 ${({ $validElement }) => $validElement && lt$2` 30487 padding: var(--space-100); 30488 cursor: pointer; 30489 color: var(--text-secondary); 30490 30491 &:hover { 30492 color: var(--text-primary); 30493 } 30494 `} 30495`; 30496 const ActionIconContainer$1 = dt$2.div` 30497 position: absolute; 30498 display: flex; 30499 align-items: center; 30500 right: 0; 30501 margin-right: var(--space-200); 30502 padding: var(--space-200); 30503 color: ${({ $iconColor }) => $iconColor || "var(--text-secondary)"}; 30504 30505 ${({ $hoverable }) => $hoverable && lt$2` 30506 cursor: pointer; 30507 30508 &:hover { 30509 color: var(--text-primary); 30510 } 30511 `} 30512 30513 ${({ $size }) => $size === "small" && lt$2` 30514 margin-right: var(--space-100); 30515 `} 30516 30517 ${({ $size }) => $size === "xsmall" && lt$2` 30518 margin-right: var(--space-100); 30519 `} 30520`; 30521 const Suggestion$1 = dt$2.div` 30522 margin-top: ${({ $withoutMargin }) => $withoutMargin ? "none" : "var(--space-200)"}; 30523 30524 color: var(--text-secondary); 30525 font-size: var(--font-size-300); 30526 font-weight: var(--font-weight-400); 30527 line-height: var(--font-line-height-300); 30528 30529 a { 30530 text-decoration-line: underline; 30531 text-decoration-skip-ink: none; 30532 text-underline-offset: var(--space-100); 30533 30534 &:hover { 30535 color: var(--text-link); 30536 } 30537 } 30538`; 30539 const Error$2 = dt$2.div` 30540 display: flex; 30541 padding: var(--space-100) var(--space-150); 30542 margin-top: ${({ $withoutMargin }) => $withoutMargin ? "0px" : "var(--space-100)"}; 30543 30544 font-size: var(--font-size-300); 30545 line-height: var(--font-line-height-300); 30546 color: var(--text-white); 30547 background: var(--bg-critical); 30548 border-radius: var(--input-radius-normal); 30549`; 30550 const Footer$4 = dt$2.div` 30551 display: flex; 30552 align-items: flex-start; 30553 gap: var(--space-400); 30554 margin-top: var(--space-200); 30555`; 30556 const Info$1 = dt$2.div` 30557 flex-shrink: 0; 30558 margin-left: auto; 30559 font-size: var(--font-size-200); 30560 line-height: var(--font-line-height-200); 30561 text-align: right; 30562 white-space: nowrap; 30563 color: var(--text-secondary); 30564`; 30565 const getMaskedPlaceholderStyles = ({ $maskType }) => { 30566 if ($maskType === "partial") { 30567 return lt$2` 30568 color: ${getTextColor}; 30569 font-size: var(--font-size-400); 30570 letter-spacing: 0.05em; 30571 `; 30572 } 30573 return lt$2` 30574 border-radius: var(--input-radius-normal); 30575 background: var(--bg-transparent-strong); 30576 height: 1.5em; 30577 `; 30578 }; 30579 const MaskedPlaceholder$1 = dt$2.div` 30580 display: inline-block; 30581 position: absolute; 30582 left: var(--space-400); 30583 width: ${({ $length }) => $length}ch; 30584 vertical-align: middle; 30585 pointer-events: none; 30586 30587 ${getMaskedPlaceholderStyles} 30588 30589 ${({ $size }) => $size === "large" && lt$2` 30590 top: calc(50% + var(--space-250)); 30591 transform: translateY(-50%); 30592 `} 30593 30594 ${({ $size }) => $size === "medium" && lt$2` 30595 top: calc(50% + var(--space-200)); 30596 transform: translateY(-50%); 30597 `} 30598 30599 ${({ $size }) => $size === "small" && lt$2` 30600 top: calc(50%); 30601 transform: translateY(-50%); 30602 `} 30603 30604 ${({ $size }) => $size === "xsmall" && lt$2` 30605 top: calc(50%); 30606 transform: translateY(-50%); 30607 `} 30608`; 30609 const Root$2 = Root$3; 30610 const Container$p = Container$q; 30611 const Box$1 = Box$2; 30612 const Input$2 = Input$3; 30613 const SpinnerLeft = SpinnerLeft$1; 30614 const SpinnerRight = SpinnerRight$1; 30615 const SpinnerItem = reactExports.forwardRef((_h, ref) => { 30616 var _i2 = _h, { icon: Icon2, iconSize } = _i2, props = __objRest(_i2, ["icon", "iconSize"]); 30617 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerItem$1, __spreadProps(__spreadValues({ ref, t
30617ype: "button" }, props), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon2, { height: iconSize }) })); 30618 }); 30619 const Prepend = Prepend$1; 30620 const Append = Append$1; 30621 const IconContainer = IconContainer$1; 30622 const ActionIconContainer = ActionIconContainer$1; 30623 const Label$2 = Label$3; 30624 const Suggestion = Suggestion$1; 30625 const Footer$3 = Footer$4; 30626 const Info = Info$1; 30627 const MaskedPlaceholder = MaskedPlaceholder$1; 30628 const Error$1 = reactExports.forwardRef( 30629 (_j, ref) => { 30630 var _k = _j, { errorTimestampKey, $withoutMargin, children } = _k, props = __objRest(_k, ["errorTimestampKey", "$withoutMargin", "children"]); 30631 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30632 Error$2, 30633 __spreadProps(__spreadValues({ 30634 ref, 30635 "aria-live": "polite", 30636 "aria-atomic": "true", 30637 role: "alert", 30638 $withoutMargin 30639 }, props), { 30640 children 30641 }), 30642 errorTimestampKey 30643 ); 30644 } 30645 ); 30646 const InputUIConsts = { 30647 INPUT_PADDING, 30648 INPUT_PADDING_XSMALL, 30649 PREPEND_MARGIN, 30650 APPEND_MARGIN, 30651 ICON_SIZE, 30652 ICON_MARGIN, 30653 ACTION_ICON_SIZE, 30654 SPINNER_OFFSET 30655 }; 30656 const triggerOnChange = (element, value) => { 30657 var _a; 30658 const nativeInputValueSetter = (_a = Object.getOwnPropertyDescriptor( 30659 window.HTMLInputElement.prototype, 30660 "value" 30661 )) == null ? void 0 : _a.set; 30662 if (nativeInputValueSetter) { 30663 nativeInputValueSetter.call(element, value); 30664 } 30665 }; 30666 const dispatchEvent = (element, event = "input") => { 30667 element.dispatchEvent(new Event(event, { bubbles: true })); 30668 }; 30669 const InputComponent = ({ 30670 label, 30671 type = "text", 30672 placeholder, 30673 prepend, 30674 append: append2, 30675 showAppend = false, 30676 suggestion, 30677 disabled, 30678 readOnly = false, 30679 focused, 30680 hovered, 30681 leftIcon, 30682 actionIcon, 30683 actionIconColor, 30684 tabIndex, 30685 fullWidth, 30686 centered = false, 30687 name, 30688 value = "", 30689 invalid = false, 30690 required, 30691 autoFocus, 30692 autoComplete, 30693 maxLength, 30694 showCharacterCount = false, 30695 size = "large", 30696 innerPadding, 30697 transparent = false, 30698 error, 30699 displayError = true, 30700 submitCount, 30701 hideSpinner = false, 30702 step, 30703 min: min2, 30704 max: max2, 30705 inputRef, 30706 role, 30707 ariaDescribedBy, 30708 strikethrough, 30709 masked, 30710 maskType, 30711 maskedVisibleChars = 4, 30712 maskedDotsCount = 4, 30713 onChange, 30714 onValueChange, 30715 onFocus, 30716 onBlur, 30717 onKeyDown, 30718 onPaste, 30719 onActionIconClick 30720 }) => { 30721 const prependEl = reactExports.useRef(null); 30722 const appendEl = reactExports.useRef(null); 30723 const labelEl = reactExports.useRef(null); 30724 const internalInputRef = reactExports.useRef(null); 30725 const localInputRef = inputRef != null ? inputRef : internalInputRef; 30726 const [prependWidth, setPrependWidth] = reactExports.useState(0); 30727 const [appendWidth, setAppendWidth] = reactExports.useState(0); 30728 const [isFocused, setIsFocused] = reactExports.useState(false); 30729 const [isLabelTruncated, setIsLabelTruncated] = reactExports.useState(false); 30730 const charactersLeft = (maxLength || Infinity) - ((value == null ? void 0 : value.length) || 0); 30731 const showSuggestion = (!displayError || !error) && !!suggestion; 30732 reactExports.useLayoutEffect(() => { 30733 if (!isUndefined(focused)) { 30734 setIsFocused(focused); 30735 } 30736 }, [focused]); 30737 reactExports.useLayoutEffect(() => { 30738 if (prependEl.current) { 30739 setPrependWidth(prependEl.current.offsetWidth); 30740 } 30741 }, [prepend]); 30742 reactExports.useLayoutEffect(() => { 30743 if (appendEl.current) { 30744 setAppendWidth(appendEl.current.offsetWidth); 30745 } 30746 }, [append2]); 30747 reactExports.useLayoutEffect(() => { 30748 if (labelEl.current) { 30749 setIsLabelTruncated(labelEl.current.scrollWidth > labelEl.current.clientWidth); 30750 } 30751 }, [label, size]); 30752 const hasValue = () => { 30753 if (type === "date" || type === "datetime-local") return true; 30754 if (isFocused) return true; 30755 return !isNil(value) && !!value.toString().length; 30756 }; 30757 const hasFocus = () => { 30758 if (readOnly) return false;
30759 return isFocused; 30760 }; 30761 const handleSetValue = (newValue) => { 30762 const inputElement = localInputRef.current; 30763 if (inputElement && !disabled) { 30764 triggerOnChange(inputElement, newValue); 30765 dispatchEvent(inputElement); 30766 } 30767 }; 30768 const handleChange = (e2) => { 30769 if (onChange) { 30770 onChange(e2); 30771 } 30772 if (onValueChange) { 30773 onValueChange(e2.target.value); 30774 } 30775 }; 30776 const handleFocus = (e2) => { 30777 if (readOnly) return; 30778 setIsFocused(true); 30779 if (onFocus) { 30780 onFocus(e2); 30781 } 30782 }; 30783 const handleBlur = (e2) => { 30784 setIsFocused(false); 30785 if (onBlur) { 30786 onBlur(e2); 30787 } 30788 }; 30789 const disableWheel = (e2) => { 30790 if (type === "number") { 30791 e2.currentTarget.blur(); 30792 } 30793 }; 30794 const handleKeyDown2 = (e2) => { 30795 if (onKeyDown) { 30796 onKeyDown(e2); 30797 } 30798 }; 30799 const getIconOffset = () => { 30800 return InputUIConsts.INPUT_PADDING + InputUIConsts.ICON_SIZE + InputUIConsts.ICON_MARGIN; 30801 }; 30802 const getPrependOffset = () => { 30803 return InputUIConsts.INPUT_PADDING + prependWidth + InputUIConsts.PREPEND_MARGIN; 30804 }; 30805 const getAppendOffset = () => { 30806 return InputUIConsts.INPUT_PADDING + appendWidth + InputUIConsts.APPEND_MARGIN + (actionIcon ? InputUIConsts.ICON_SIZE + InputUIConsts.APPEND_MARGIN : 0); 30807 }; 30808 const getInputOffset = () => { 30809 if (leftIcon && !prepend) { 30810 return getIconOffset(); 30811 } 30812 if (hasValue() && prepend && prependWidth) { 30813 return getPrependOffset(); 30814 } 30815 if (type === "number" && !hideSpinner) { 30816 return InputUIConsts.SPINNER_OFFSET; 30817 } 30818 if (innerPadding) { 30819 return void 0; 30820 } 30821 return size === "xsmall" ? InputUIConsts.INPUT_PADDING_XSMALL : InputUIConsts.INPUT_PADDING; 30822 }; 30823 const getRightInputOffset = () => { 30824 if (hasValue() && append2 && appendWidth) { 30825 return getAppendOffset(); 30826 } 30827 if (actionIcon) { 30828 return getIconOffset(); 30829 } 30830 if (type === "number" && !hideSpinner) { 30831 return InputUIConsts.SPINNER_OFFSET; 30832 } 30833 }; 30834 const getLabelOffset = () => { 30835 if (leftIcon && !prepend) { 30836 return getIconOffset(); 30837 } 30838 }; 30839 const getPlaceholder = () => { 30840 return label ? void 0 : placeholder; 30841 }; 30842 const getLabelId = () => { 30843 return name ? `${name}__label` : void 0; 30844 }; 30845 const getInputId = () => { 30846 return name ? `${name}__input` : void 0; 30847 }; 30848 const renderIcon2 = () => { 30849 if (!leftIcon || prepend) return null; 30850 const isIconValidElement = reactExports.isValidElement(leftIcon); 30851 const LeftIcon = leftIcon; 30852 return /* @__PURE__ */ jsxRuntimeExports.jsx(IconContainer, { $validElement: isIconValidElement, $hasValue: hasValue(), children: isIconValidElement ? leftIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(LeftIcon, { height: InputUIConsts.ICON_SIZE }) }); 30853 }; 30854 const renderActionIcon = () => { 30855 if (!actionIcon) return null; 30856 const ActionIcon = actionIcon; 30857 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30858 ActionIconContainer, 30859 { 30860 $size: size, 30861 $iconColor: actionIconColor, 30862 $hoverable: !disabled && !!onActionIconClick, 30863 "data-testid": "Input.ActionIcon", 30864 onClick: onActionIconClick, 30865 children: reactExports.isValidElement(actionIcon) ? actionIcon : /* @__PURE__ */ jsxRuntimeExports.jsx(ActionIcon, { height: InputUIConsts.ACTION_ICON_SIZE }) 30866 } 30867 ); 30868 }; 30869 const renderPrepend = () => { 30870 if (!prepend) return null; 30871 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30872 Prepend, 30873 { 30874 ref: prependEl, 30875 $size: size, 30876 $hasLabel: !!label, 30877 $visible: hasValue() && !!prependWidth, 30878 children: prepend 30879 } 30880 ); 30881 }; 30882 const renderAppend = () => { 30883 if (!append2) return null; 30884 return /* @__PURE__ */ jsxRuntimeExports.jsx( 30885 Append, 30886 { 30887 ref: appendEl, 30888 $size: size, 30889 $hasLabel: !!label, 30890 $visible: showAppend || hasValue() && !!appendWidth, 30891 $largeSpace: !!actionIcon, 30892 children: append2 30893 } 30894 ); 30895 }; 30896 const increaseValue = () => { 30897 handleSetValue(value ? `${parseInt(value) + 1}` : "1"); 30898 }; 30899 const decreaseValue = () => { 30900 handleSetValue(value ? `${parseInt(value) - 1}` : "-1"); 30901 }; 30902 const renderSpinnerLeft = () => { 30903 if (type === "number" && !hideSpinner) { 30904 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerLeft, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 30905 SpinnerItem, 30906 { 30907 "data-testid": "Input.SpinnerItem.Decrease", 30908 "aria-label": "Decrease", 30909 disabled: !!disabled || min2 !== void 0 && Number(value) <= min2, 30910 icon: wt$2, 30911 iconSize: 12, 30912 onClick: decreaseValue 30913 } 30914 ) }); 30915 } 30916 return null; 30917 }; 30918 const renderSpinnerRight = () => { 30919 if (type === "number" && !hideSpinner) { 30920 return /* @__PURE__ */ jsxRuntimeExports.jsx(SpinnerRight, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 30921 SpinnerItem, 30922 { 30923 "data-testid": "Input.SpinnerItem.Increase", 30924 "aria-label": "Increase", 30925 disabled: !!disabled || max2 !== void 0 && Number(value) >= max2, 30926 icon: W9, 30927 iconSize: 12, 30928 onClick: increaseValue 30929 } 30930 ) }); 30931 } 30932 return null; 30933 }; 30934 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Root$2, { $fullWidth: !!fullWidth, children: [
30935 /* @__PURE__ */ jsxRuntimeExports.jsxs( 30936 Box$1, 30937 { 30938 $invalid: invalid, 30939 $fullWidth: fullWidth, 30940 $disabled: disabled, 30941 $focused: hasFocus(), 30942 $hovered: hovered, 30943 $size: size, 30944 $transparent: transparent && !hasFocus(), 30945 children: [ 30946 renderPrepend(), 30947 /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$p, { children: [ 30948 /* @__PURE__ */ jsxRuntimeExports.jsx( 30949 Input$2, 30950 { 30951 ref: localInputRef, 30952 $inputSize: size, 30953 $hasLabel: !!label && hasValue(), 30954 $hasSpinner: !hideSpinner, 30955 $centered: centered || type === "number" && !hideSpinner, 30956 $innerPadding: innerPadding, 30957 id: getInputId(), 30958 type, 30959 name, 30960 value: masked ? "" : value, 30961 placeholder: getPlaceholder(), 30962 disabled, 30963 $readOnly: readOnly, 30964 required, 30965 autoFocus, 30966 autoComplete, 30967 maxLength, 30968 step, 30969 min: min2, 30970 max: max2, 30971 tabIndex, 30972 "aria-labelledby": getLabelId(), 30973 "aria-invalid": invalid ? "true" : "false", 30974 "data-testid": "Input", 30975 style: { paddingLeft: getInputOffset(), paddingRight: getRightInputOffset() }, 30976 role, 30977 "aria-describedby": ariaDescribedBy, 30978 $strikethrough: strikethrough, 30979 $masked: masked, 30980 onChange: handleChange, 30981 onFocus: handleFocus, 30982 onBlur: handleBlur, 30983 onWheel: disableWheel, 30984 onKeyDown: handleKeyDown2, 30985 onPaste 30986 } 30987 ),
30988 /* @__PURE__ */ jsxRuntimeExports.jsx( 30989 Label$2, 30990 { 30991 ref: labelEl, 30992 id: getLabelId(), 30993 $hasValue: hasValue(), 30994 $centered: type === "number" && !hideSpinner, 30995 htmlFor: getInputId(), 30996 $size: size, 30997 title: isLabelTruncated ? label : void 0, 30998 style: { paddingLeft: getLabelOffset() }, 30999 "data-testid": "Input.Label", 31000 children: label 31001 } 31002 ), 31003 renderSpinnerLeft(), 31004 renderSpinnerRight(), 31005 masked && !!value.length && /* @__PURE__ */ jsxRuntimeExports.jsx(MaskedPlaceholder, { $length: value.length, $size: size, $maskType: maskType, children: maskType === "partial" && M$6(value, maskedVisibleChars, maskedDotsCount) }) 31006 ] }), 31007 renderAppend(), 31008 renderIcon2(), 31009 renderActionIcon() 31010 ] 31011 } 31012 ),
31013 (showSuggestion || showCharacterCount) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer$3, { children: [ 31014 showSuggestion && /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { $withoutMargin: true, children: suggestion }), 31015 showCharacterCount && /* @__PURE__ */ jsxRuntimeExports.jsx(Info, { children: `${charactersLeft} ${I$2(charactersLeft, "character")} left` }) 31016 ] }), 31017 displayError && !!error && /* @__PURE__ */ jsxRuntimeExports.jsx(Error$1, { errorTimestampKey: submitCount, children: error }) 31018 ] }); 31019 }; 31020 const Input$1 = Fr$2(InputComponent); 31021 const DOCK_INSET_BOTTOM = "var(--dock-inset-bottom, 0px)"; 31022 const SAFE_AREA_INSET_BOTTOM = "var(--safe-area-inset-bottom, 0px)"; 31023 const SAFE_AREA_INSET_TOP = "var(--safe-area-inset-top, 0px)"; 31024 const OVERLAY_BOTTOM_INSET = `var(--overlay-inset-bottom, ${SAFE_AREA_INSET_BOTTOM})`; 31025 const OVERLAY_TOP_INSET = SAFE_AREA_INSET_TOP; 31026 const pageBottomOffset = (minSpacing = "0px") => `max(${minSpacing}, ${DOCK_INSET_BOTTOM}, ${SAFE_AREA_INSET_BOTTOM})`; 31027 const overlayBottomOffset = (minSpacing = "0px") => `max(${minSpacing}, ${OVERLAY_BOTTOM_INSET})`; 31028 function basePropertyOf(object2) { 31029 return function(key) { 31030 return object2 == null ? void 0 : object2[key]; 31031 }; 31032 } 31033 function hasWindow() { 31034 return typeof window !== "undefined"; 31035 } 31036 function getNodeName(node2) { 31037 if (isNode(node2)) { 31038 return (node2.nodeName || "").toLowerCase(); 31039 } 31040 return "#document"; 31041 } 31042 function getWindow(node2) { 31043 var _node$ownerDocument; 31044 return (node2 == null || (_node$ownerDocument = node2.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 31045 } 31046 function getDocumentElement(node2) { 31047 var _ref2; 31048 return (_ref2 = (isNode(node2) ? node2.ownerDocument : node2.document) || window.document) == null ? void 0 : _ref2.documentElement; 31049 } 31050 function isNode(value) { 31051 if (!hasWindow()) { 31052 return false; 31053 } 31054 return value instanceof Node || value instanceof getWindow(value).Node; 31055 } 31056 function isElement(value) { 31057 if (!hasWindow()) { 31058 return false; 31059 } 31060 return value instanceof Element || value instanceof getWindow(value).Element; 31061 } 31062 function isHTMLElement(value) { 31063 if (!hasWindow()) { 31064 return false; 31065 } 31066 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 31067 } 31068 function isShadowRoot(value) { 31069 if (!hasWindow() || typeof ShadowRoot === "undefined") { 31070 return false; 31071 } 31072 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 31073 } 31074 const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]); 31075 function isOverflowElement(element) { 31076 const { 31077 overflow, 31078 overflowX, 31079 overflowY, 31080 display 31081 } = getComputedStyle$2(element); 31082 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); 31083 } 31084 const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]); 31085 function isTableElement(element) { 31086 return tableElements.has(getNodeName(element)); 31087 } 31088 const topLayerSelectors = [":popover-open", ":modal"]; 31089 function isTopLayer(element) { 31090 return topLayerSelectors.some((selector) => { 31091 try { 31092 return element.matches(selector); 31093 } catch (_e2) { 31094 return false; 31095 } 31096 }); 31097 } 31098 const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"]; 31099 const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"]; 31100 const containValues = ["paint", "layout", "strict", "content"]; 31101 function isContainingBlock(elementOrCss) { 31102 const webkit = isWebKit(); 31103 const css = isElement(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss; 31104 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)); 31105 } 31106 function getContainingBlock(element) { 31107 let currentNode = getParentNode(element); 31108 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 31109 if (isContainingBlock(currentNode)) { 31110 return currentNode; 31111 } else if (isTopLayer(currentNode)) { 31112 return null; 31113 } 31114 currentNode = getParentNode(currentNode); 31115 } 31116 return null; 31117 } 31118 function isWebKit() { 31119 if (typeof CSS === "undefined" || !CSS.supports) return false;
vendor: 2,454 bytes, lines 31120-31181
31120 return CSS.supports("-webkit-backdrop-filter", "none"); 31121 } 31122 const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]); 31123 function isLastTraversableNode(node2) { 31124 return lastTraversableNodeNames.has(getNodeName(node2)); 31125 } 31126 function getComputedStyle$2(element) { 31127 return getWindow(element).getComputedStyle(element); 31128 } 31129 function getNodeScroll(element) { 31130 if (isElement(element)) { 31131 return { 31132 scrollLeft: element.scrollLeft, 31133 scrollTop: element.scrollTop 31134 }; 31135 } 31136 return { 31137 scrollLeft: element.scrollX, 31138 scrollTop: element.scrollY 31139 }; 31140 } 31141 function getParentNode(node2) { 31142 if (getNodeName(node2) === "html") { 31143 return node2; 31144 } 31145 const result = ( 31146 // Step into the shadow DOM of the parent of a slotted node. 31147 node2.assignedSlot || // DOM Element detected. 31148 node2.parentNode || // ShadowRoot detected. 31149 isShadowRoot(node2) && node2.host || // Fallback. 31150 getDocumentElement(node2) 31151 ); 31152 return isShadowRoot(result) ? result.host : result; 31153 } 31154 function getNearestOverflowAncestor(node2) { 31155 const parentNode = getParentNode(node2); 31156 if (isLastTraversableNode(parentNode)) { 31157 return node2.ownerDocument ? node2.ownerDocument.body : node2.body; 31158 } 31159 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 31160 return parentNode; 31161 } 31162 return getNearestOverflowAncestor(parentNode); 31163 } 31164 function getOverflowAncestors(node2, list, traverseIframes) { 31165 var _node$ownerDocument2; 31166 if (list === void 0) { 31167 list = []; 31168 } 31169 if (traverseIframes === void 0) { 31170 traverseIframes = true; 31171 } 31172 const scrollableAncestor = getNearestOverflowAncestor(node2); 31173 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node2.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 31174 const win = getWindow(scrollableAncestor); 31175 if (isBody) { 31176 const frameElement = getFrameElement(win); 31177 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 31178 } 31179 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 31180 } 31181 function getFrameElement(win) {
31182 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 31183 } 31184 const min = Math.min; 31185 const max = Math.max; 31186 const round = Math.round; 31187 const floor = Math.floor; 31188 const createCoords = (v2) => ({ 31189 x: v2, 31190 y: v2 31191 }); 31192 const oppositeSideMap = { 31193 left: "right", 31194 right: "left", 31195 bottom: "top", 31196 top: "bottom" 31197 }; 31198 const oppositeAlignmentMap = { 31199 start: "end", 31200 end: "start" 31201 }; 31202 function clamp$1(start, value, end) { 31203 return max(start, min(value, end)); 31204 } 31205 function evaluate(value, param) { 31206 return typeof value === "function" ? value(param) : value; 31207 } 31208 function getSide(placement) { 31209 return placement.split("-")[0]; 31210 } 31211 function getAlignment(placement) { 31212 return placement.split("-")[1]; 31213 } 31214 function getOppositeAxis(axis) { 31215 return axis === "x" ? "y" : "x"; 31216 } 31217 function getAxisLength(axis) { 31218 return axis === "y" ? "height" : "width"; 31219 } 31220 const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]); 31221 function getSideAxis(placement) { 31222 return yAxisSides.has(getSide(placement)) ? "y" : "x"; 31223 } 31224 function getAlignmentAxis(placement) { 31225 return getOppositeAxis(getSideAxis(placement)); 31226 } 31227 function getAlignmentSides(placement, rects, rtl) { 31228 if (rtl === void 0) { 31229 rtl = false; 31230 } 31231 const alignment = getAlignment(placement); 31232 const alignmentAxis = getAlignmentAxis(placement); 31233 const length2 = getAxisLength(alignmentAxis); 31234 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 31235 if (rects.reference[length2] > rects.floating[length2]) { 31236 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 31237 } 31238 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 31239 } 31240 function getExpandedPlacements(placement) { 31241 const oppositePlacement = getOppositePlacement(placement); 31242 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 31243 } 31244 function getOppositeAlignmentPlacement(placement) { 31245 return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]); 31246 } 31247 const lrPlacement = ["left", "right"]; 31248 const rlPlacement = ["right", "left"]; 31249 const tbPlacement = ["top", "bottom"]; 31250 const btPlacement = ["bottom", "top"]; 31251 function getSideList(side, isStart, rtl) { 31252 switch (side) { 31253 case "top": 31254 case "bottom": 31255 if (rtl) return isStart ? rlPlacement : lrPlacement; 31256 return isStart ? lrPlacement : rlPlacement; 31257 case "left": 31258 case "right": 31259 return isStart ? tbPlacement : btPlacement; 31260 default: 31261 return []; 31262 } 31263 } 31264 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 31265 const alignment = getAlignment(placement); 31266 let list = getSideList(getSide(placement), direction === "start", rtl); 31267 if (alignment) { 31268 list = list.map((side) => side + "-" + alignment); 31269 if (flipAlignment) { 31270 list = list.concat(list.map(getOppositeAlignmentPlacement)); 31271 } 31272 } 31273 return list; 31274 } 31275 function getOppositePlacement(placement) { 31276 return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]); 31277 } 31278 function expandPaddingObject(padding) { 31279 return __spreadValues({ 31280 top: 0, 31281 right: 0, 31282 bottom: 0, 31283 left: 0 31284 }, padding); 31285 } 31286 function getPaddingObject(padding) { 31287 return typeof padding !== "number" ? expandPaddingObject(padding) : { 31288 top: padding, 31289 right: padding, 31290 bottom: padding, 31291 left: padding 31292 }; 31293 } 31294 function rectToClientRect(rect) { 31295 const { 31296 x: x2, 31297 y: y2, 31298 width, 31299 height 31300 } = rect; 31301 return { 31302 width, 31303 height, 31304 top: y2, 31305 left: x2, 31306 right: x2 + width, 31307 bottom: y2 + height, 31308 x: x2, 31309 y: y2 31310 }; 31311 } 31312 /*! 31313 * tabbable 6.3.0 31314 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE 31315 */ 31316 var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not
vendor: 5,381 bytes, lines 31316-31427
31316(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"]; 31317 var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); 31318 var NoElement = typeof Element === "undefined"; 31319 var matches = NoElement ? function() { 31320 } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 31321 var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { 31322 var _element$getRootNode; 31323 return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); 31324 } : function(element) { 31325 return element === null || element === void 0 ? void 0 : element.ownerDocument; 31326 }; 31327 var _isInert = function isInert(node2, lookUp) { 31328 var _node$getAttribute; 31329 if (lookUp === void 0) { 31330 lookUp = true; 31331 } 31332 var inertAtt = node2 === null || node2 === void 0 ? void 0 : (_node$getAttribute = node2.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node2, "inert"); 31333 var inert = inertAtt === "" || inertAtt === "true"; 31334 var result = inert || lookUp && node2 && _isInert(node2.parentNode); 31335 return result; 31336 }; 31337 var isContentEditable = function isContentEditable2(node2) { 31338 var _node$getAttribute2; 31339 var attValue = node2 === null || node2 === void 0 ? void 0 : (_node$getAttribute2 = node2.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node2, "contenteditable"); 31340 return attValue === "" || attValue === "true"; 31341 }; 31342 var getCandidates = function getCandidates2(el, includeContainer, filter2) { 31343 if (_isInert(el)) { 31344 return []; 31345 } 31346 var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); 31347 if (includeContainer && matches.call(el, candidateSelector)) { 31348 candidates.unshift(el); 31349 } 31350 candidates = candidates.filter(filter2); 31351 return candidates; 31352 }; 31353 var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options2) { 31354 var candidates = []; 31355 var elementsToCheck = Array.from(elements); 31356 while (elementsToCheck.length) { 31357 var element = elementsToCheck.shift(); 31358 if (_isInert(element, false)) { 31359 continue; 31360 } 31361 if (element.tagName === "SLOT") { 31362 var assigned = element.assignedElements(); 31363 var content = assigned.length ? assigned : element.children; 31364 var nestedCandidates = _getCandidatesIteratively(content, true, options2); 31365 if (options2.flatten) { 31366 candidates.push.apply(candidates, nestedCandidates); 31367 } else { 31368 candidates.push({ 31369 scopeParent: element, 31370 candidates: nestedCandidates 31371 }); 31372 } 31373 } else { 31374 var validCandidate = matches.call(element, candidateSelector); 31375 if (validCandidate && options2.filter(element) && (includeContainer || !elements.includes(element))) { 31376 candidates.push(element); 31377 } 31378 var shadowRoot = element.shadowRoot || // check for an undisclosed shadow 31379 typeof options2.getShadowRoot === "function" && options2.getShadowRoot(element); 31380 var validShadowRoot = !_isInert(shadowRoot, false) && (!options2.shadowRootFilter || options2.shadowRootFilter(element)); 31381 if (shadowRoot && validShadowRoot) { 31382 var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options2); 31383 if (options2.flatten) { 31384 candidates.push.apply(candidates, _nestedCandidates); 31385 } else { 31386 candidates.push({ 31387 scopeParent: element, 31388 candidates: _nestedCandidates 31389 }); 31390 } 31391 } else { 31392 elementsToCheck.unshift.apply(elementsToCheck, element.children); 31393 } 31394 } 31395 } 31396 return candidates; 31397 }; 31398 var hasTabIndex = function hasTabIndex2(node2) { 31399 return !isNaN(parseInt(node2.getAttribute("tabindex"), 10)); 31400 }; 31401 var getTabIndex = function getTabIndex2(node2) { 31402 if (!node2) { 31403 throw new Error("No node provided"); 31404 } 31405 if (node2.tabIndex < 0) { 31406 if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node2.tagName) || isContentEditable(node2)) && !hasTabIndex(node2)) { 31407 return 0; 31408 } 31409 } 31410 return node2.tabIndex; 31411 }; 31412 var getSortOrderTabIndex = function getSortOrderTabIndex2(node2, isScope) { 31413 var tabIndex = getTabIndex(node2); 31414 if (tabIndex < 0 && isScope && !hasTabIndex(node2)) { 31415 return 0; 31416 } 31417 return tabIndex; 31418 }; 31419 var sortOrderedTabbables = function sortOrderedTabbables2(a2, b2) { 31420 return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.tabIndex; 31421 }; 31422 var isInput = function isInput2(node2) { 31423 return node2.tagName === "INPUT"; 31424 }; 31425 var isHiddenInput = function isHiddenInput2(node2) { 31426 return isInput(node2) && node2.type === "hidden"; 31427 };
vendor: 8,888 bytes, lines 31428-31618
31428 var isDetailsWithSummary = function isDetailsWithSummary2(node2) { 31429 var r2 = node2.tagName === "DETAILS" && Array.prototype.slice.apply(node2.children).some(function(child) { 31430 return child.tagName === "SUMMARY"; 31431 }); 31432 return r2; 31433 }; 31434 var getCheckedRadio = function getCheckedRadio2(nodes, form) { 31435 for (var i2 = 0; i2 < nodes.length; i2++) { 31436 if (nodes[i2].checked && nodes[i2].form === form) { 31437 return nodes[i2]; 31438 } 31439 } 31440 }; 31441 var isTabbableRadio = function isTabbableRadio2(node2) { 31442 if (!node2.name) { 31443 return true; 31444 } 31445 var radioScope = node2.form || getRootNode(node2); 31446 var queryRadios = function queryRadios2(name) { 31447 return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); 31448 }; 31449 var radioSet; 31450 if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { 31451 radioSet = queryRadios(window.CSS.escape(node2.name)); 31452 } else { 31453 try { 31454 radioSet = queryRadios(node2.name); 31455 } catch (err) { 31456 console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); 31457 return false; 31458 } 31459 } 31460 var checked = getCheckedRadio(radioSet, node2.form); 31461 return !checked || checked === node2; 31462 }; 31463 var isRadio = function isRadio2(node2) { 31464 return isInput(node2) && node2.type === "radio"; 31465 }; 31466 var isNonTabbableRadio = function isNonTabbableRadio2(node2) { 31467 return isRadio(node2) && !isTabbableRadio(node2); 31468 }; 31469 var isNodeAttached = function isNodeAttached2(node2) { 31470 var _nodeRoot; 31471 var nodeRoot = node2 && getRootNode(node2); 31472 var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host; 31473 var attached = false; 31474 if (nodeRoot && nodeRoot !== node2) { 31475 var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument; 31476 attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node2 !== null && node2 !== void 0 && (_node$ownerDocument = node2.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node2)); 31477 while (!attached && nodeRootHost) { 31478 var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD; 31479 nodeRoot = getRootNode(nodeRootHost); 31480 nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host; 31481 attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost)); 31482 } 31483 } 31484 return attached; 31485 }; 31486 var isZeroArea = function isZeroArea2(node2) { 31487 var _node$getBoundingClie = node2.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; 31488 return width === 0 && height === 0; 31489 }; 31490 var isHidden = function isHidden2(node2, _ref2) { 31491 var displayCheck = _ref2.displayCheck, getShadowRoot = _ref2.getShadowRoot; 31492 if (displayCheck === "full-native") { 31493 if ("checkVisibility" in node2) { 31494 var visible = node2.checkVisibility({ 31495 // Checking opacity might be desirable for some use cases, but natively, 31496 // opacity zero elements _are_ focusable and tabbable. 31497 checkOpacity: false, 31498 opacityProperty: false, 31499 contentVisibilityAuto: true, 31500 visibilityProperty: true, 31501 // This is an alias for `visibilityProperty`. Contemporary browsers 31502 // support both. However, this alias has wider browser support (Chrome 31503 // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so 31504 // we include it anyway. 31505 checkVisibilityCSS: true 31506 }); 31507 return !visible; 31508 } 31509 } 31510 if (getComputedStyle(node2).visibility === "hidden") { 31511 return true; 31512 } 31513 var isDirectSummary = matches.call(node2, "details>summary:first-of-type"); 31514 var nodeUnderDetails = isDirectSummary ? node2.parentElement : node2; 31515 if (matches.call(nodeUnderDetails, "details:not([open]) *")) { 31516 return true; 31517 } 31518 if (!displayCheck || displayCheck === "full" || // full-native can run this branch when it falls through in case 31519 // Element#checkVisibility is unsupported 31520 displayCheck === "full-native" || displayCheck === "legacy-full") { 31521 if (typeof getShadowRoot === "function") { 31522 var originalNode = node2; 31523 while (node2) { 31524 var parentElement = node2.parentElement; 31525 var rootNode = getRootNode(node2); 31526 if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { 31527 return isZeroArea(node2); 31528 } else if (node2.assignedSlot) { 31529 node2 = node2.assignedSlot; 31530 } else if (!parentElement && rootNode !== node2.ownerDocument) { 31531 node2 = rootNode.host; 31532 } else { 31533 node2 = parentElement; 31534 } 31535 } 31536 node2 = originalNode; 31537 } 31538 if (isNodeAttached(node2)) { 31539 return !node2.getClientRects().length; 31540 } 31541 if (displayCheck !== "legacy-full") { 31542 return true; 31543 } 31544 } else if (displayCheck === "non-zero-area") { 31545 return isZeroArea(node2); 31546 } 31547 return false; 31548 }; 31549 var isDisabledFromFieldset = function isDisabledFromFieldset2(node2) { 31550 if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node2.tagName)) { 31551 var parentNode = node2.parentElement; 31552 while (parentNode) { 31553 if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { 31554 for (var i2 = 0; i2 < parentNode.children.length; i2++) { 31555 var child = parentNode.children.item(i2); 31556 if (child.tagName === "LEGEND") { 31557 return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node2); 31558 } 31559 } 31560 return true; 31561 } 31562 parentNode = parentNode.parentElement; 31563 } 31564 } 31565 return false; 31566 }; 31567 var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options2, node2) { 31568 if (node2.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor 31569 // because we're limited in the type of selectors we can use in JSDom (see related 31570 // note related to `candidateSelectors`) 31571 _isInert(node2) || isHiddenInput(node2) || isHidden(node2, options2) || // For a details element with a summary, the summary element gets the focus 31572 isDetailsWithSummary(node2) || isDisabledFromFieldset(node2)) { 31573 return false; 31574 } 31575 return true; 31576 }; 31577 var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options2, node2) { 31578 if (isNonTabbableRadio(node2) || getTabIndex(node2) < 0 || !isNodeMatchingSelectorFocusable(options2, node2)) { 31579 return false; 31580 } 31581 return true; 31582 }; 31583 var isShadowRootTabbable = function isShadowRootTabbable2(shadowHostNode) { 31584 var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); 31585 if (isNaN(tabIndex) || tabIndex >= 0) { 31586 return true; 31587 } 31588 return false; 31589 }; 31590 var _sortByOrder = function sortByOrder(candidates) { 31591 var regularTabbables = []; 31592 var orderedTabbables = []; 31593 candidates.forEach(function(item, i2) { 31594 var isScope = !!item.scopeParent; 31595 var element = isScope ? item.scopeParent : item; 31596 var candidateTabindex = getSortOrderTabIndex(element, isScope); 31597 var elements = isScope ? _sortByOrder(item.candidates) : element; 31598 if (candidateTabindex === 0) { 31599 isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); 31600 } else { 31601 orderedTabbables.push({ 31602 documentOrder: i2, 31603 tabIndex: candidateTabindex, 31604 item, 31605 isScope, 31606 content: elements 31607 }); 31608 } 31609 }); 31610 return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { 31611 sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); 31612 return acc; 31613 }, []).concat(regularTabbables); 31614 }; 31615 var tabbable = function tabbable2(container, options2) { 31616 options2 = options2 || {}; 31617 var candidates; 31618 if (options2.getShadowRoot) {
31619 candidates = _getCandidatesIteratively([container], options2.includeContainer, { 31620 filter: isNodeMatchingSelectorTabbable.bind(null, options2), 31621 flatten: false, 31622 getShadowRoot: options2.getShadowRoot, 31623 shadowRootFilter: isShadowRootTabbable 31624 }); 31625 } else { 31626 candidates = getCandidates(container, options2.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options2)); 31627 } 31628 return _sortByOrder(candidates); 31629 }; 31630 var focusable = function focusable2(container, options2) { 31631 options2 = options2 || {}; 31632 var candidates; 31633 if (options2.getShadowRoot) { 31634 candidates = _getCandidatesIteratively([container], options2.includeContainer, { 31635 filter: isNodeMatchingSelectorFocusable.bind(null, options2), 31636 flatten: true, 31637 getShadowRoot: options2.getShadowRoot 31638 }); 31639 } else { 31640 candidates = getCandidates(container, options2.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options2)); 31641 } 31642 return candidates; 31643 }; 31644 var isTabbable = function isTabbable2(node2, options2) { 31645 options2 = options2 || {}; 31646 if (!node2) { 31647 throw new Error("No node provided"); 31648 } 31649 if (matches.call(node2, candidateSelector) === false) { 31650 return false; 31651 } 31652 return isNodeMatchingSelectorTabbable(options2, node2); 31653 }; 31654 function getPlatform() { 31655 const uaData = navigator.userAgentData; 31656 if (uaData != null && uaData.platform) { 31657 return uaData.platform; 31658 } 31659 return navigator.platform; 31660 } 31661 function getUserAgent() { 31662 const uaData = navigator.userAgentData; 31663 if (uaData && Array.isArray(uaData.brands)) { 31664 return uaData.brands.map((_ref2) => { 31665 let { 31666 brand, 31667 version 31668 } = _ref2; 31669 return brand + "/" + version; 31670 }).join(" "); 31671 } 31672 return navigator.userAgent; 31673 } 31674 function isSafari() { 31675 return /apple/i.test(navigator.vendor); 31676 } 31677 function isAndroid() { 31678 const re2 = /android/i; 31679 return re2.test(getPlatform()) || re2.test(getUserAgent()); 31680 } 31681 function isMac() { 31682 return getPlatform().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints; 31683 } 31684 function isJSDOM() { 31685 return getUserAgent().includes("jsdom/"); 31686 } 31687 const FOCUSABLE_ATTRIBUTE$1 = "data-floating-ui-focusable"; 31688 const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 31689 function activeElement(doc) { 31690 let activeElement2 = doc.activeElement; 31691 while (((_activeElement = activeElement2) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) { 31692 var _activeElement; 31693 activeElement2 = activeElement2.shadowRoot.activeElement; 31694 } 31695 return activeElement2; 31696 } 31697 function contains$1(parent, child) { 31698 if (!parent || !child) { 31699 return false; 31700 } 31701 const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); 31702 if (parent.contains(child)) { 31703 return true; 31704 } 31705 if (rootNode && isShadowRoot(rootNode)) { 31706 let next2 = child; 31707 while (next2) { 31708 if (parent === next2) { 31709 return true; 31710 } 31711 next2 = next2.parentNode || next2.host; 31712 } 31713 } 31714 return false; 31715 } 31716 function getTarget$1(event) { 31717 if ("composedPath" in event) { 31718 return event.composedPath()[0]; 31719 } 31720 return event.target; 31721 } 31722 function isEventTargetWithin(event, node2) { 31723 if (node2 == null) { 31724 return false; 31725 } 31726 if ("composedPath" in event) { 31727 return event.composedPath().includes(node2); 31728 } 31729 const e2 = event; 31730 return e2.target != null && node2.contains(e2.target); 31731 } 31732 function isRootElement(element) { 31733 return element.matches("html,body"); 31734 } 31735 function getDocument$1(node2) { 31736 return (node2 == null ? void 0 : node2.ownerDocument) || document; 31737 } 31738 function isTypeableElement(element) { 31739 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 31740 } 31741 function isTypeableCombobox(element) { 31742 if (!element) return false;
31743 return element.getAttribute("role") === "combobox" && isTypeableElement(element); 31744 } 31745 function matchesFocusVisible(element) { 31746 if (!element || isJSDOM()) return true; 31747 try { 31748 return element.matches(":focus-visible"); 31749 } catch (_e2) { 31750 return true; 31751 } 31752 } 31753 function getFloatingFocusElement(floatingElement) { 31754 if (!floatingElement) { 31755 return null; 31756 } 31757 return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE$1) ? floatingElement : floatingElement.querySelector("[" + FOCUSABLE_ATTRIBUTE$1 + "]") || floatingElement; 31758 } 31759 function getNodeChildren$1(nodes, id2, onlyOpenChildren) { 31760 if (onlyOpenChildren === void 0) { 31761 onlyOpenChildren = true; 31762 } 31763 const directChildren = nodes.filter((node2) => { 31764 var _node$context; 31765 return node2.parentId === id2 && (!onlyOpenChildren || ((_node$context = node2.context) == null ? void 0 : _node$context.open)); 31766 }); 31767 return directChildren.flatMap((child) => [child, ...getNodeChildren$1(nodes, child.id, onlyOpenChildren)]); 31768 } 31769 function getNodeAncestors(nodes, id2) { 31770 var _nodes$find; 31771 let allAncestors = []; 31772 let currentParentId = (_nodes$find = nodes.find((node2) => node2.id === id2)) == null ? void 0 : _nodes$find.parentId; 31773 while (currentParentId) { 31774 const currentNode = nodes.find((node2) => node2.id === currentParentId); 31775 currentParentId = currentNode == null ? void 0 : currentNode.parentId; 31776 if (currentNode) { 31777 allAncestors = allAncestors.concat(currentNode); 31778 } 31779 } 31780 return allAncestors; 31781 } 31782 function stopEvent(event) { 31783 event.preventDefault(); 31784 event.stopPropagation(); 31785 } 31786 function isReactEvent(event) { 31787 return "nativeEvent" in event; 31788 } 31789 function isVirtualClick(event) { 31790 if (event.mozInputSource === 0 && event.isTrusted) { 31791 return true; 31792 } 31793 if (isAndroid() && event.pointerType) { 31794 return event.type === "click" && event.buttons === 1; 31795 } 31796 return event.detail === 0 && !event.pointerType; 31797 } 31798 function isVirtualPointerEvent(event) { 31799 if (isJSDOM()) return false; 31800 return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333⢠for width/height. 31801 event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch"; 31802 } 31803 function isMouseLikePointerType(pointerType, strict2) { 31804 const values = ["mouse", "pen"]; 31805 { 31806 values.push("", void 0); 31807 } 31808 return values.includes(pointerType); 31809 } 31810 var isClient$1 = typeof document !== "undefined"; 31811 var noop$6 = function noop2() { 31812 }; 31813 var index$1 = isClient$1 ? reactExports.useLayoutEffect : noop$6; 31814 const SafeReact$1 = __spreadValues({}, React); 31815 function useLatestRef$1(value) { 31816 const ref = reactExports.useRef(value); 31817 index$1(() => { 31818 ref.current = value; 31819 }); 31820 return ref; 31821 } 31822 const useInsertionEffect = SafeReact$1.useInsertionEffect; 31823 const useSafeInsertionEffect = useInsertionEffect || ((fn2) => fn2()); 31824 function useEffectEvent(callback) { 31825 const ref = reactExports.useRef(() => { 31826 }); 31827 useSafeInsertionEffect(() => { 31828 ref.current = callback; 31829 }); 31830 return reactExports.useCallback(function() { 31831 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 31832 args[_key] = arguments[_key]; 31833 } 31834 return ref.current == null ? void 0 : ref.current(...args); 31835 }, []); 31836 } 31837 const getTabbableOptions = () => ({ 31838 getShadowRoot: true, 31839 displayCheck: ( 31840 // JSDOM does not support the `tabbable` library. To solve this we can 31841 // check if `ResizeObserver` is a real function (not polyfilled), which 31842 // determines if the current environment is JSDOM-like. 31843 typeof ResizeObserver === "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none" 31844 ) 31845 }); 31846 function getTabbableIn(container, dir) { 31847 const list = tabbable(container, getTabbableOptions()); 31848 const len = list.length; 31849 if (len === 0) return; 31850 const active = activeElement(getDocument$1(container)); 31851 const index2 = list.indexOf(active); 31852 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 31853 return list[nextIndex]; 31854 } 31855 function getNextTabbable(referenceElement) { 31856 return getTabbableIn(getDocument$1(referenceElement).body, 1) || referenceElement; 31857 } 31858 function getPreviousTabbable(referenceElement) { 31859 return getTabbableIn(getDocument$1(referenceElement).body, -1) || referenceElement; 31860 } 31861 function isOutsideEvent(event, container) { 31862 const containerElement = container || event.currentTarget; 31863 const relatedTarget = event.relatedTarget; 31864 return !relatedTarget || !contains$1(containerElement, relatedTarget); 31865 } 31866 function disableFocusInside(container) { 31867 const tabbableElements = tabbable(container, getTabbableOptions());
31868 tabbableElements.forEach((element) => { 31869 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 31870 element.setAttribute("tabindex", "-1"); 31871 }); 31872 } 31873 function enableFocusInside(container) { 31874 const elements = container.querySelectorAll("[data-tabindex]"); 31875 elements.forEach((element) => { 31876 const tabindex = element.dataset.tabindex; 31877 delete element.dataset.tabindex; 31878 if (tabindex) { 31879 element.setAttribute("tabindex", tabindex); 31880 } else { 31881 element.removeAttribute("tabindex"); 31882 } 31883 }); 31884 } 31885 function computeCoordsFromPlacement(_ref2, placement, rtl) { 31886 let { 31887 reference, 31888 floating 31889 } = _ref2; 31890 const sideAxis = getSideAxis(placement); 31891 const alignmentAxis = getAlignmentAxis(placement); 31892 const alignLength = getAxisLength(alignmentAxis); 31893 const side = getSide(placement); 31894 const isVertical = sideAxis === "y"; 31895 const commonX = reference.x + reference.width / 2 - floating.width / 2; 31896 const commonY = reference.y + reference.height / 2 - floating.height / 2; 31897 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 31898 let coords; 31899 switch (side) { 31900 case "top": 31901 coords = { 31902 x: commonX, 31903 y: reference.y - floating.height 31904 }; 31905 break; 31906 case "bottom": 31907 coords = { 31908 x: commonX, 31909 y: reference.y + reference.height 31910 }; 31911 break; 31912 case "right": 31913 coords = { 31914 x: reference.x + reference.width, 31915 y: commonY 31916 }; 31917 break; 31918 case "left": 31919 coords = { 31920 x: reference.x - floating.width, 31921 y: commonY 31922 }; 31923 break; 31924 default: 31925 coords = { 31926 x: reference.x, 31927 y: reference.y 31928 }; 31929 } 31930 switch (getAlignment(placement)) { 31931 case "start": 31932 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 31933 break; 31934 case "end": 31935 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 31936 break; 31937 } 31938 return coords; 31939 } 31940 const computePosition$1 = (reference, floating, config) => __async(null, null, function* () { 31941 const { 31942 placement = "bottom", 31943 strategy = "absolute", 31944 middleware: middleware2 = [], 31945 platform: platform2 31946 } = config; 31947 const validMiddleware = middleware2.filter(Boolean); 31948 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating); 31949 let rects = yield platform2.getElementRects({ 31950 reference, 31951 floating, 31952 strategy 31953 }); 31954 let { 31955 x: x2, 31956 y: y2 31957 } = computeCoordsFromPlacement(rects, placement, rtl); 31958 let statefulPlacement = placement; 31959 let middlewareData = {}; 31960 let resetCount = 0; 31961 for (let i2 = 0; i2 < validMiddleware.length; i2++) { 31962 const { 31963 name, 31964 fn: fn2 31965 } = validMiddleware[i2]; 31966 const { 31967 x: nextX, 31968 y: nextY, 31969 data, 31970 reset 31971 } = yield fn2({ 31972 x: x2, 31973 y: y2, 31974 initialPlacement: placement, 31975 placement: statefulPlacement, 31976 strategy, 31977 middlewareData, 31978 rects, 31979 platform: platform2, 31980 elements: { 31981 reference, 31982 floating 31983 } 31984 }); 31985 x2 = nextX != null ? nextX : x2; 31986 y2 = nextY != null ? nextY : y2; 31987 middlewareData = __spreadProps(__spreadValues({}, middlewareData), { 31988 [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data) 31989 }); 31990 if (reset && resetCount <= 50) { 31991 resetCount++; 31992 if (typeof reset === "object") { 31993 if (reset.placement) { 31994 statefulPlacement = reset.placement; 31995 } 31996 if (reset.rects) { 31997 rects = reset.rects === true ? yield platform2.getElementRects({ 31998 reference, 31999 floating, 32000 strategy 32001 }) : reset.rects; 32002 } 32003 ({ 32004 x: x2, 32005 y: y2 32006 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 32007 } 32008 i2 = -1; 32009 } 32010 } 32011 return { 32012 x: x2, 32013 y: y2, 32014 placement: statefulPlacement, 32015 strategy, 32016 middlewareData 32017 }; 32018 }); 32019 function detectOverflow(state, options2) { 32020 return __async(this, null, function* () { 32021 var _await$platform$isEle; 32022 if (options2 === void 0) { 32023 options2 = {}; 32024 } 32025 const { 32026 x: x2, 32027 y: y2, 32028 platform: platform2, 32029 rects, 32030 elements, 32031 strategy 32032 } = state; 32033 const { 32034 boundary = "clippingAncestors", 32035 rootBoundary = "viewport", 32036 elementContext = "floating", 32037 altBoundary = false, 32038 padding = 0 32039 } = evaluate(options2, state);
32040 const paddingObject = getPaddingObject(padding); 32041 const altContext = elementContext === "floating" ? "reference" : "floating"; 32042 const element = elements[altBoundary ? altContext : elementContext]; 32043 const clippingClientRect = rectToClientRect(yield platform2.getClippingRect({ 32044 element: ((_await$platform$isEle = yield platform2.isElement == null ? void 0 : platform2.isElement(element)) != null ? _await$platform$isEle : true) ? element : element.contextElement || (yield platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)), 32045 boundary, 32046 rootBoundary, 32047 strategy 32048 })); 32049 const rect = elementContext === "floating" ? { 32050 x: x2, 32051 y: y2, 32052 width: rects.floating.width, 32053 height: rects.floating.height 32054 } : rects.reference; 32055 const offsetParent = yield platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating); 32056 const offsetScale = (yield platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? (yield platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || { 32057 x: 1, 32058 y: 1 32059 } : { 32060 x: 1, 32061 y: 1 32062 }; 32063 const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? yield platform2.convertOffsetParentRelativeRectToViewportRelativeRect({ 32064 elements, 32065 rect, 32066 offsetParent, 32067 strategy 32068 }) : rect); 32069 return { 32070 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 32071 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 32072 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 32073 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 32074 }; 32075 }); 32076 } 32077 const flip$2 = function(options2) { 32078 if (options2 === void 0) { 32079 options2 = {}; 32080 } 32081 return { 32082 name: "flip", 32083 options: options2, 32084 fn(state) { 32085 return __async(this, null, function* () { 32086 var _middlewareData$arrow, _middlewareData$flip; 32087 const { 32088 placement, 32089 middlewareData, 32090 rects, 32091 initialPlacement, 32092 platform: platform2, 32093 elements 32094 } = state; 32095 const _a2 = evaluate(options2, state), { 32096 mainAxis: checkMainAxis = true, 32097 crossAxis: checkCrossAxis = true, 32098 fallbackPlacements: specifiedFallbackPlacements, 32099 fallbackStrategy = "bestFit", 32100 fallbackAxisSideDirection = "none", 32101 flipAlignment = true 32102 } = _a2, detectOverflowOptions = __objRest(_a2, [ 32103 "mainAxis", 32104 "crossAxis", 32105 "fallbackPlacements", 32106 "fallbackStrategy", 32107 "fallbackAxisSideDirection", 32108 "flipAlignment" 32109 ]); 32110 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 32111 return {}; 32112 } 32113 const side = getSide(placement); 32114 const initialSideAxis = getSideAxis(initialPlacement); 32115 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 32116 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating); 32117 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 32118 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 32119 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 32120 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 32121 } 32122 const placements = [initialPlacement, ...fallbackPlacements]; 32123 const overflow = yield detectOverflow(state, detectOverflowOptions); 32124 const overflows = []; 32125 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 32126 if (checkMainAxis) { 32127 overflows.push(overflow[side]); 32128 } 32129 if (checkCrossAxis) { 32130 const sides = getAlignmentSides(placement, rects, rtl); 32131 overflows.push(overflow[sides[0]], overflow[sides[1]]); 32132 } 32133 overflowsData = [...overflowsData, { 32134 placement, 32135 overflows 32136 }]; 32137 if (!overflows.every((side2) => side2 <= 0)) { 32138 var _middlewareData$flip2, _overflowsData$filter; 32139 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 32140 const nextPlacement = placements[nextIndex]; 32141 if (nextPlacement) { 32142 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
32143 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 32144 // overflows the main axis. 32145 overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) { 32146 return { 32147 data: { 32148 index: nextIndex, 32149 overflows: overflowsData 32150 }, 32151 reset: { 32152 placement: nextPlacement 32153 } 32154 }; 32155 } 32156 } 32157 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 32158 if (!resetPlacement) { 32159 switch (fallbackStrategy) { 32160 case "bestFit": { 32161 var _overflowsData$filter2; 32162 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => { 32163 if (hasFallbackAxisSideDirection) { 32164 const currentSideAxis = getSideAxis(d2.placement); 32165 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 32166 // reading directions favoring greater width. 32167 currentSideAxis === "y"; 32168 } 32169 return true; 32170 }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 32171 if (placement2) { 32172 resetPlacement = placement2; 32173 } 32174 break; 32175 } 32176 case "initialPlacement": 32177 resetPlacement = initialPlacement; 32178 break; 32179 } 32180 } 32181 if (placement !== resetPlacement) { 32182 return { 32183 reset: { 32184 placement: resetPlacement 32185 } 32186 }; 32187 } 32188 } 32189 return {}; 32190 }); 32191 } 32192 }; 32193 }; 32194 const originSides = /* @__PURE__ */ new Set(["left", "top"]); 32195 function convertValueToCoords(state, options2) { 32196 return __async(this, null, function* () { 32197 const { 32198 placement, 32199 platform: platform2, 32200 elements 32201 } = state; 32202 const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating); 32203 const side = getSide(placement); 32204 const alignment = getAlignment(placement); 32205 const isVertical = getSideAxis(placement) === "y"; 32206 const mainAxisMulti = originSides.has(side) ? -1 : 1; 32207 const crossAxisMulti = rtl && isVertical ? -1 : 1; 32208 const rawValue = evaluate(options2, state); 32209 let { 32210 mainAxis, 32211 crossAxis, 32212 alignmentAxis 32213 } = typeof rawValue === "number" ? { 32214 mainAxis: rawValue, 32215 crossAxis: 0, 32216 alignmentAxis: null 32217 } : { 32218 mainAxis: rawValue.mainAxis || 0, 32219 crossAxis: rawValue.crossAxis || 0, 32220 alignmentAxis: rawValue.alignmentAxis 32221 }; 32222 if (alignment && typeof alignmentAxis === "number") { 32223 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 32224 } 32225 return isVertical ? { 32226 x: crossAxis * crossAxisMulti, 32227 y: mainAxis * mainAxisMulti 32228 } : { 32229 x: mainAxis * mainAxisMulti, 32230 y: crossAxis * crossAxisMulti 32231 }; 32232 }); 32233 } 32234 const offset$2 = function(options2) { 32235 if (options2 === void 0) { 32236 options2 = 0; 32237 } 32238 return { 32239 name: "offset", 32240 options: options2, 32241 fn(state) { 32242 return __async(this, null, function* () { 32243 var _middlewareData$offse, _middlewareData$arrow; 32244 const { 32245 x: x2, 32246 y: y2, 32247 placement, 32248 middlewareData 32249 } = state; 32250 const diffCoords = yield convertValueToCoords(state, options2); 32251 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 32252 return {}; 32253 } 32254 return { 32255 x: x2 + diffCoords.x, 32256 y: y2 + diffCoords.y, 32257 data: __spreadProps(__spreadValues({}, diffCoords), { 32258 placement 32259 }) 32260 }; 32261 }); 32262 } 32263 }; 32264 }; 32265 const shift$2 = function(options2) { 32266 if (options2 === void 0) { 32267 options2 = {}; 32268 } 32269 return { 32270 name: "shift", 32271 options: options2, 32272 fn(state) { 32273 return __async(this, null, function* () { 32274 const { 32275 x: x2, 32276 y: y2, 32277 placement 32278 } = state; 32279 const _a2 = evaluate(options2, state), { 32280 mainAxis: checkMainAxis = true, 32281 crossAxis: checkCrossAxis = false, 32282 limiter = {
32283 fn: (_ref2) => { 32284 let { 32285 x: x3, 32286 y: y3 32287 } = _ref2; 32288 return { 32289 x: x3, 32290 y: y3 32291 }; 32292 } 32293 } 32294 } = _a2, detectOverflowOptions = __objRest(_a2, [ 32295 "mainAxis", 32296 "crossAxis", 32297 "limiter" 32298 ]); 32299 const coords = { 32300 x: x2, 32301 y: y2 32302 }; 32303 const overflow = yield detectOverflow(state, detectOverflowOptions); 32304 const crossAxis = getSideAxis(getSide(placement)); 32305 const mainAxis = getOppositeAxis(crossAxis); 32306 let mainAxisCoord = coords[mainAxis]; 32307 let crossAxisCoord = coords[crossAxis]; 32308 if (checkMainAxis) { 32309 const minSide = mainAxis === "y" ? "top" : "left"; 32310 const maxSide = mainAxis === "y" ? "bottom" : "right"; 32311 const min2 = mainAxisCoord + overflow[minSide]; 32312 const max2 = mainAxisCoord - overflow[maxSide]; 32313 mainAxisCoord = clamp$1(min2, mainAxisCoord, max2); 32314 } 32315 if (checkCrossAxis) { 32316 const minSide = crossAxis === "y" ? "top" : "left"; 32317 const maxSide = crossAxis === "y" ? "bottom" : "right"; 32318 const min2 = crossAxisCoord + overflow[minSide]; 32319 const max2 = crossAxisCoord - overflow[maxSide]; 32320 crossAxisCoord = clamp$1(min2, crossAxisCoord, max2); 32321 } 32322 const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), { 32323 [mainAxis]: mainAxisCoord, 32324 [crossAxis]: crossAxisCoord 32325 })); 32326 return __spreadProps(__spreadValues({}, limitedCoords), { 32327 data: { 32328 x: limitedCoords.x - x2, 32329 y: limitedCoords.y - y2, 32330 enabled: { 32331 [mainAxis]: checkMainAxis, 32332 [crossAxis]: checkCrossAxis 32333 } 32334 } 32335 }); 32336 }); 32337 } 32338 }; 32339 }; 32340 function getCssDimensions(element) { 32341 const css = getComputedStyle$2(element); 32342 let width = parseFloat(css.width) || 0; 32343 let height = parseFloat(css.height) || 0; 32344 const hasOffset = isHTMLElement(element); 32345 const offsetWidth = hasOffset ? element.offsetWidth : width; 32346 const offsetHeight = hasOffset ? element.offsetHeight : height; 32347 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 32348 if (shouldFallback) { 32349 width = offsetWidth; 32350 height = offsetHeight; 32351 } 32352 return { 32353 width, 32354 height, 32355 $: shouldFallback 32356 }; 32357 } 32358 function unwrapElement(element) { 32359 return !isElement(element) ? element.contextElement : element; 32360 } 32361 function getScale(element) { 32362 const domElement = unwrapElement(element); 32363 if (!isHTMLElement(domElement)) { 32364 return createCoords(1); 32365 } 32366 const rect = domElement.getBoundingClientRect(); 32367 const { 32368 width, 32369 height, 32370 $: $2 32371 } = getCssDimensions(domElement); 32372 let x2 = ($2 ? round(rect.width) : rect.width) / width; 32373 let y2 = ($2 ? round(rect.height) : rect.height) / height; 32374 if (!x2 || !Number.isFinite(x2)) { 32375 x2 = 1; 32376 } 32377 if (!y2 || !Number.isFinite(y2)) { 32378 y2 = 1; 32379 } 32380 return { 32381 x: x2, 32382 y: y2 32383 }; 32384 } 32385 const noOffsets = /* @__PURE__ */ createCoords(0); 32386 function getVisualOffsets(element) { 32387 const win = getWindow(element); 32388 if (!isWebKit() || !win.visualViewport) { 32389 return noOffsets; 32390 } 32391 return { 32392 x: win.visualViewport.offsetLeft, 32393 y: win.visualViewport.offsetTop 32394 }; 32395 } 32396 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 32397 if (isFixed === void 0) { 32398 isFixed = false; 32399 } 32400 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 32401 return false;
vendor: 5,338 bytes, lines 32402-32536
32402 } 32403 return isFixed; 32404 } 32405 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 32406 if (includeScale === void 0) { 32407 includeScale = false; 32408 } 32409 if (isFixedStrategy === void 0) { 32410 isFixedStrategy = false; 32411 } 32412 const clientRect = element.getBoundingClientRect(); 32413 const domElement = unwrapElement(element); 32414 let scale2 = createCoords(1); 32415 if (includeScale) { 32416 if (offsetParent) { 32417 if (isElement(offsetParent)) { 32418 scale2 = getScale(offsetParent); 32419 } 32420 } else { 32421 scale2 = getScale(element); 32422 } 32423 } 32424 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 32425 let x2 = (clientRect.left + visualOffsets.x) / scale2.x; 32426 let y2 = (clientRect.top + visualOffsets.y) / scale2.y; 32427 let width = clientRect.width / scale2.x; 32428 let height = clientRect.height / scale2.y; 32429 if (domElement) { 32430 const win = getWindow(domElement); 32431 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 32432 let currentWin = win; 32433 let currentIFrame = getFrameElement(currentWin); 32434 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 32435 const iframeScale = getScale(currentIFrame); 32436 const iframeRect = currentIFrame.getBoundingClientRect(); 32437 const css = getComputedStyle$2(currentIFrame); 32438 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 32439 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 32440 x2 *= iframeScale.x; 32441 y2 *= iframeScale.y; 32442 width *= iframeScale.x; 32443 height *= iframeScale.y; 32444 x2 += left; 32445 y2 += top; 32446 currentWin = getWindow(currentIFrame); 32447 currentIFrame = getFrameElement(currentWin); 32448 } 32449 } 32450 return rectToClientRect({ 32451 width, 32452 height, 32453 x: x2, 32454 y: y2 32455 }); 32456 } 32457 function getWindowScrollBarX(element, rect) { 32458 const leftScroll = getNodeScroll(element).scrollLeft; 32459 if (!rect) { 32460 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 32461 } 32462 return rect.left + leftScroll; 32463 } 32464 function getHTMLOffset(documentElement, scroll) { 32465 const htmlRect = documentElement.getBoundingClientRect(); 32466 const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 32467 const y2 = htmlRect.top + scroll.scrollTop; 32468 return { 32469 x: x2, 32470 y: y2 32471 }; 32472 } 32473 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref2) { 32474 let { 32475 elements, 32476 rect, 32477 offsetParent, 32478 strategy 32479 } = _ref2; 32480 const isFixed = strategy === "fixed"; 32481 const documentElement = getDocumentElement(offsetParent); 32482 const topLayer = elements ? isTopLayer(elements.floating) : false; 32483 if (offsetParent === documentElement || topLayer && isFixed) { 32484 return rect; 32485 } 32486 let scroll = { 32487 scrollLeft: 0, 32488 scrollTop: 0 32489 }; 32490 let scale2 = createCoords(1); 32491 const offsets = createCoords(0); 32492 const isOffsetParentAnElement = isHTMLElement(offsetParent); 32493 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 32494 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 32495 scroll = getNodeScroll(offsetParent); 32496 } 32497 if (isHTMLElement(offsetParent)) { 32498 const offsetRect = getBoundingClientRect(offsetParent); 32499 scale2 = getScale(offsetParent); 32500 offsets.x = offsetRect.x + offsetParent.clientLeft; 32501 offsets.y = offsetRect.y + offsetParent.clientTop; 32502 } 32503 } 32504 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 32505 return { 32506 width: rect.width * scale2.x, 32507 height: rect.height * scale2.y, 32508 x: rect.x * scale2.x - scroll.scrollLeft * scale2.x + offsets.x + htmlOffset.x, 32509 y: rect.y * scale2.y - scroll.scrollTop * scale2.y + offsets.y + htmlOffset.y 32510 }; 32511 } 32512 function getClientRects(element) { 32513 return Array.from(element.getClientRects()); 32514 } 32515 function getDocumentRect(element) { 32516 const html2 = getDocumentElement(element); 32517 const scroll = getNodeScroll(element); 32518 const body = element.ownerDocument.body; 32519 const width = max(html2.scrollWidth, html2.clientWidth, body.scrollWidth, body.clientWidth); 32520 const height = max(html2.scrollHeight, html2.clientHeight, body.scrollHeight, body.clientHeight); 32521 let x2 = -scroll.scrollLeft + getWindowScrollBarX(element); 32522 const y2 = -scroll.scrollTop; 32523 if (getComputedStyle$2(body).direction === "rtl") { 32524 x2 += max(html2.clientWidth, body.clientWidth) - width; 32525 } 32526 return { 32527 width, 32528 height, 32529 x: x2, 32530 y: y2 32531 }; 32532 } 32533 const SCROLLBAR_MAX = 25; 32534 function getViewportRect(element, strategy) { 32535 const win = getWindow(element); 32536 const html2 = getDocumentElement(element);
vendor: 4,670 bytes, lines 32537-32639
32537 const visualViewport = win.visualViewport; 32538 let width = html2.clientWidth; 32539 let height = html2.clientHeight; 32540 let x2 = 0; 32541 let y2 = 0; 32542 if (visualViewport) { 32543 width = visualViewport.width; 32544 height = visualViewport.height; 32545 const visualViewportBased = isWebKit(); 32546 if (!visualViewportBased || visualViewportBased && strategy === "fixed") { 32547 x2 = visualViewport.offsetLeft; 32548 y2 = visualViewport.offsetTop; 32549 } 32550 } 32551 const windowScrollbarX = getWindowScrollBarX(html2); 32552 if (windowScrollbarX <= 0) { 32553 const doc = html2.ownerDocument; 32554 const body = doc.body; 32555 const bodyStyles = getComputedStyle(body); 32556 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 32557 const clippingStableScrollbarWidth = Math.abs(html2.clientWidth - body.clientWidth - bodyMarginInline); 32558 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 32559 width -= clippingStableScrollbarWidth; 32560 } 32561 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 32562 width += windowScrollbarX; 32563 } 32564 return { 32565 width, 32566 height, 32567 x: x2, 32568 y: y2 32569 }; 32570 } 32571 const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]); 32572 function getInnerBoundingClientRect(element, strategy) { 32573 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 32574 const top = clientRect.top + element.clientTop; 32575 const left = clientRect.left + element.clientLeft; 32576 const scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1); 32577 const width = element.clientWidth * scale2.x; 32578 const height = element.clientHeight * scale2.y; 32579 const x2 = left * scale2.x; 32580 const y2 = top * scale2.y; 32581 return { 32582 width, 32583 height, 32584 x: x2, 32585 y: y2 32586 }; 32587 } 32588 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 32589 let rect; 32590 if (clippingAncestor === "viewport") { 32591 rect = getViewportRect(element, strategy); 32592 } else if (clippingAncestor === "document") { 32593 rect = getDocumentRect(getDocumentElement(element)); 32594 } else if (isElement(clippingAncestor)) { 32595 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 32596 } else { 32597 const visualOffsets = getVisualOffsets(element); 32598 rect = { 32599 x: clippingAncestor.x - visualOffsets.x, 32600 y: clippingAncestor.y - visualOffsets.y, 32601 width: clippingAncestor.width, 32602 height: clippingAncestor.height 32603 }; 32604 } 32605 return rectToClientRect(rect); 32606 } 32607 function hasFixedPositionAncestor(element, stopNode) { 32608 const parentNode = getParentNode(element); 32609 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 32610 return false; 32611 } 32612 return getComputedStyle$2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); 32613 } 32614 function getClippingElementAncestors(element, cache) { 32615 const cachedResult = cache.get(element); 32616 if (cachedResult) { 32617 return cachedResult; 32618 } 32619 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 32620 let currentContainingBlockComputedStyle = null; 32621 const elementIsFixed = getComputedStyle$2(element).position === "fixed"; 32622 let currentNode = elementIsFixed ? getParentNode(element) : element; 32623 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 32624 const computedStyle = getComputedStyle$2(currentNode); 32625 const currentNodeIsContaining = isContainingBlock(currentNode); 32626 if (!currentNodeIsContaining && computedStyle.position === "fixed") { 32627 currentContainingBlockComputedStyle = null; 32628 } 32629 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 32630 if (shouldDropCurrentNode) { 32631 result = result.filter((ancestor) => ancestor !== currentNode); 32632 } else { 32633 currentContainingBlockComputedStyle = computedStyle; 32634 } 32635 currentNode = getParentNode(currentNode); 32636 } 32637 cache.set(element, result); 32638 return result; 32639 }
vendor: 10,177 bytes, lines 32640-32915
32640 function getClippingRect(_ref2) { 32641 let { 32642 element, 32643 boundary, 32644 rootBoundary, 32645 strategy 32646 } = _ref2; 32647 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 32648 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 32649 const firstClippingAncestor = clippingAncestors[0]; 32650 const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { 32651 const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); 32652 accRect.top = max(rect.top, accRect.top); 32653 accRect.right = min(rect.right, accRect.right); 32654 accRect.bottom = min(rect.bottom, accRect.bottom); 32655 accRect.left = max(rect.left, accRect.left); 32656 return accRect; 32657 }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); 32658 return { 32659 width: clippingRect.right - clippingRect.left, 32660 height: clippingRect.bottom - clippingRect.top, 32661 x: clippingRect.left, 32662 y: clippingRect.top 32663 }; 32664 } 32665 function getDimensions(element) { 32666 const { 32667 width, 32668 height 32669 } = getCssDimensions(element); 32670 return { 32671 width, 32672 height 32673 }; 32674 } 32675 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 32676 const isOffsetParentAnElement = isHTMLElement(offsetParent); 32677 const documentElement = getDocumentElement(offsetParent); 32678 const isFixed = strategy === "fixed"; 32679 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 32680 let scroll = { 32681 scrollLeft: 0, 32682 scrollTop: 0 32683 }; 32684 const offsets = createCoords(0); 32685 function setLeftRTLScrollbarOffset() { 32686 offsets.x = getWindowScrollBarX(documentElement); 32687 } 32688 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 32689 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 32690 scroll = getNodeScroll(offsetParent); 32691 } 32692 if (isOffsetParentAnElement) { 32693 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 32694 offsets.x = offsetRect.x + offsetParent.clientLeft; 32695 offsets.y = offsetRect.y + offsetParent.clientTop; 32696 } else if (documentElement) { 32697 setLeftRTLScrollbarOffset(); 32698 } 32699 } 32700 if (isFixed && !isOffsetParentAnElement && documentElement) { 32701 setLeftRTLScrollbarOffset(); 32702 } 32703 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 32704 const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 32705 const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 32706 return { 32707 x: x2, 32708 y: y2, 32709 width: rect.width, 32710 height: rect.height 32711 }; 32712 } 32713 function isStaticPositioned(element) { 32714 return getComputedStyle$2(element).position === "static"; 32715 } 32716 function getTrueOffsetParent(element, polyfill) { 32717 if (!isHTMLElement(element) || getComputedStyle$2(element).position === "fixed") { 32718 return null; 32719 } 32720 if (polyfill) { 32721 return polyfill(element); 32722 } 32723 let rawOffsetParent = element.offsetParent; 32724 if (getDocumentElement(element) === rawOffsetParent) { 32725 rawOffsetParent = rawOffsetParent.ownerDocument.body; 32726 } 32727 return rawOffsetParent; 32728 } 32729 function getOffsetParent(element, polyfill) { 32730 const win = getWindow(element); 32731 if (isTopLayer(element)) { 32732 return win; 32733 } 32734 if (!isHTMLElement(element)) { 32735 let svgOffsetParent = getParentNode(element); 32736 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 32737 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 32738 return svgOffsetParent; 32739 } 32740 svgOffsetParent = getParentNode(svgOffsetParent); 32741 } 32742 return win; 32743 } 32744 let offsetParent = getTrueOffsetParent(element, polyfill); 32745 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 32746 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 32747 } 32748 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 32749 return win; 32750 } 32751 return offsetParent || getContainingBlock(element) || win; 32752 } 32753 const getElementRects = function(data) { 32754 return __async(this, null, function* () { 32755 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 32756 const getDimensionsFn = this.getDimensions; 32757 const floatingDimensions = yield getDimensionsFn(data.floating); 32758 return { 32759 reference: getRectRelativeToOffsetParent(data.reference, yield getOffsetParentFn(data.floating), data.strategy), 32760 floating: { 32761 x: 0, 32762 y: 0, 32763 width: floatingDimensions.width, 32764 height: floatingDimensions.height 32765 } 32766 }; 32767 }); 32768 }; 32769 function isRTL(element) { 32770 return getComputedStyle$2(element).direction === "rtl"; 32771 } 32772 const platform = { 32773 convertOffsetParentRelativeRectToViewportRelativeRect, 32774 getDocumentElement, 32775 getClippingRect, 32776 getOffsetParent, 32777 getElementRects, 32778 getClientRects, 32779 getDimensions, 32780 getScale, 32781 isElement, 32782 isRTL 32783 }; 32784 function rectsAreEqual(a2, b2) { 32785 return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height; 32786 } 32787 function observeMove(element, onMove) { 32788 let io2 = null; 32789 let timeoutId; 32790 const root2 = getDocumentElement(element); 32791 function cleanup() { 32792 var _io; 32793 clearTimeout(timeoutId); 32794 (_io = io2) == null || _io.disconnect(); 32795 io2 = null; 32796 } 32797 function refresh(skip, threshold) { 32798 if (skip === void 0) { 32799 skip = false; 32800 } 32801 if (threshold === void 0) { 32802 threshold = 1; 32803 } 32804 cleanup(); 32805 const elementRectForRootMargin = element.getBoundingClientRect(); 32806 const { 32807 left, 32808 top, 32809 width, 32810 height 32811 } = elementRectForRootMargin; 32812 if (!skip) { 32813 onMove(); 32814 } 32815 if (!width || !height) { 32816 return; 32817 } 32818 const insetTop = floor(top); 32819 const insetRight = floor(root2.clientWidth - (left + width)); 32820 const insetBottom = floor(root2.clientHeight - (top + height)); 32821 const insetLeft = floor(left); 32822 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 32823 const options2 = { 32824 rootMargin, 32825 threshold: max(0, min(1, threshold)) || 1 32826 }; 32827 let isFirstUpdate = true; 32828 function handleObserve(entries2) { 32829 const ratio = entries2[0].intersectionRatio; 32830 if (ratio !== threshold) { 32831 if (!isFirstUpdate) { 32832 return refresh(); 32833 } 32834 if (!ratio) { 32835 timeoutId = setTimeout(() => { 32836 refresh(false, 1e-7); 32837 }, 1e3); 32838 } else { 32839 refresh(false, ratio); 32840 } 32841 } 32842 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 32843 refresh(); 32844 } 32845 isFirstUpdate = false; 32846 } 32847 try { 32848 io2 = new IntersectionObserver(handleObserve, __spreadProps(__spreadValues({}, options2), { 32849 // Handle <iframe>s 32850 root: root2.ownerDocument 32851 })); 32852 } catch (_e2) { 32853 io2 = new IntersectionObserver(handleObserve, options2); 32854 } 32855 io2.observe(element); 32856 } 32857 refresh(true); 32858 return cleanup; 32859 } 32860 function autoUpdate(reference, floating, update2, options2) { 32861 if (options2 === void 0) { 32862 options2 = {}; 32863 } 32864 const { 32865 ancestorScroll = true, 32866 ancestorResize = true, 32867 elementResize = typeof ResizeObserver === "function", 32868 layoutShift = typeof IntersectionObserver === "function", 32869 animationFrame = false 32870 } = options2; 32871 const referenceEl = unwrapElement(reference); 32872 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : []; 32873 ancestors.forEach((ancestor) => { 32874 ancestorScroll && ancestor.addEventListener("scroll", update2, { 32875 passive: true 32876 }); 32877 ancestorResize && ancestor.addEventListener("resize", update2); 32878 }); 32879 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null; 32880 let reobserveFrame = -1; 32881 let resizeObserver = null; 32882 if (elementResize) { 32883 resizeObserver = new ResizeObserver((_ref2) => { 32884 let [firstEntry] = _ref2; 32885 if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { 32886 resizeObserver.unobserve(floating); 32887 cancelAnimationFrame(reobserveFrame); 32888 reobserveFrame = requestAnimationFrame(() => { 32889 var _resizeObserver; 32890 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 32891 }); 32892 } 32893 update2(); 32894 }); 32895 if (referenceEl && !animationFrame) { 32896 resizeObserver.observe(referenceEl); 32897 } 32898 resizeObserver.observe(floating); 32899 } 32900 let frameId; 32901 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 32902 if (animationFrame) { 32903 frameLoop(); 32904 } 32905 function frameLoop() { 32906 const nextRefRect = getBoundingClientRect(reference); 32907 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 32908 update2(); 32909 } 32910 prevRefRect = nextRefRect; 32911 frameId = requestAnimationFrame(frameLoop); 32912 } 32913 update2(); 32914 return () => { 32915 var _resizeObserver2;
vendor: 6,186 bytes, lines 32916-33094
32916 ancestors.forEach((ancestor) => { 32917 ancestorScroll && ancestor.removeEventListener("scroll", update2); 32918 ancestorResize && ancestor.removeEventListener("resize", update2); 32919 }); 32920 cleanupIo == null || cleanupIo(); 32921 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 32922 resizeObserver = null; 32923 if (animationFrame) { 32924 cancelAnimationFrame(frameId); 32925 } 32926 }; 32927 } 32928 const offset$1 = offset$2; 32929 const shift$1 = shift$2; 32930 const flip$1 = flip$2; 32931 const computePosition = (reference, floating, options2) => { 32932 const cache = /* @__PURE__ */ new Map(); 32933 const mergedOptions = __spreadValues({ 32934 platform 32935 }, options2); 32936 const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), { 32937 _c: cache 32938 }); 32939 return computePosition$1(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), { 32940 platform: platformWithCache 32941 })); 32942 }; 32943 var isClient = typeof document !== "undefined"; 32944 var noop$5 = function noop2() { 32945 }; 32946 var index = isClient ? reactExports.useLayoutEffect : noop$5; 32947 function deepEqual(a2, b2) { 32948 if (a2 === b2) { 32949 return true; 32950 } 32951 if (typeof a2 !== typeof b2) { 32952 return false; 32953 } 32954 if (typeof a2 === "function" && a2.toString() === b2.toString()) { 32955 return true; 32956 } 32957 let length2; 32958 let i2; 32959 let keys2; 32960 if (a2 && b2 && typeof a2 === "object") { 32961 if (Array.isArray(a2)) { 32962 length2 = a2.length; 32963 if (length2 !== b2.length) return false; 32964 for (i2 = length2; i2-- !== 0; ) { 32965 if (!deepEqual(a2[i2], b2[i2])) { 32966 return false; 32967 } 32968 } 32969 return true; 32970 } 32971 keys2 = Object.keys(a2); 32972 length2 = keys2.length; 32973 if (length2 !== Object.keys(b2).length) { 32974 return false; 32975 } 32976 for (i2 = length2; i2-- !== 0; ) { 32977 if (!{}.hasOwnProperty.call(b2, keys2[i2])) { 32978 return false; 32979 } 32980 } 32981 for (i2 = length2; i2-- !== 0; ) { 32982 const key = keys2[i2]; 32983 if (key === "_owner" && a2.$$typeof) { 32984 continue; 32985 } 32986 if (!deepEqual(a2[key], b2[key])) { 32987 return false; 32988 } 32989 } 32990 return true; 32991 } 32992 return a2 !== a2 && b2 !== b2; 32993 } 32994 function getDPR(element) { 32995 if (typeof window === "undefined") { 32996 return 1; 32997 } 32998 const win = element.ownerDocument.defaultView || window; 32999 return win.devicePixelRatio || 1; 33000 } 33001 function roundByDPR(element, value) { 33002 const dpr = getDPR(element); 33003 return Math.round(value * dpr) / dpr; 33004 } 33005 function useLatestRef(value) { 33006 const ref = reactExports.useRef(value); 33007 index(() => { 33008 ref.current = value; 33009 }); 33010 return ref; 33011 } 33012 function useFloating$1(options2) { 33013 if (options2 === void 0) { 33014 options2 = {}; 33015 } 33016 const { 33017 placement = "bottom", 33018 strategy = "absolute", 33019 middleware: middleware2 = [], 33020 platform: platform2, 33021 elements: { 33022 reference: externalReference, 33023 floating: externalFloating 33024 } = {}, 33025 transform: transform2 = true, 33026 whileElementsMounted, 33027 open 33028 } = options2; 33029 const [data, setData] = reactExports.useState({ 33030 x: 0, 33031 y: 0, 33032 strategy, 33033 placement, 33034 middlewareData: {}, 33035 isPositioned: false 33036 }); 33037 const [latestMiddleware, setLatestMiddleware] = reactExports.useState(middleware2); 33038 if (!deepEqual(latestMiddleware, middleware2)) { 33039 setLatestMiddleware(middleware2); 33040 } 33041 const [_reference, _setReference] = reactExports.useState(null); 33042 const [_floating, _setFloating] = reactExports.useState(null); 33043 const setReference = reactExports.useCallback((node2) => { 33044 if (node2 !== referenceRef.current) { 33045 referenceRef.current = node2; 33046 _setReference(node2); 33047 } 33048 }, []); 33049 const setFloating = reactExports.useCallback((node2) => { 33050 if (node2 !== floatingRef.current) { 33051 floatingRef.current = node2; 33052 _setFloating(node2); 33053 } 33054 }, []); 33055 const referenceEl = externalReference || _reference; 33056 const floatingEl = externalFloating || _floating; 33057 const referenceRef = reactExports.useRef(null); 33058 const floatingRef = reactExports.useRef(null); 33059 const dataRef = reactExports.useRef(data); 33060 const hasWhileElementsMounted = whileElementsMounted != null; 33061 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 33062 const platformRef = useLatestRef(platform2); 33063 const openRef = useLatestRef(open); 33064 const update2 = reactExports.useCallback(() => { 33065 if (!referenceRef.current || !floatingRef.current) { 33066 return; 33067 } 33068 const config = { 33069 placement, 33070 strategy, 33071 middleware: latestMiddleware 33072 }; 33073 if (platformRef.current) { 33074 config.platform = platformRef.current; 33075 } 33076 computePosition(referenceRef.current, floatingRef.current, config).then((data2) => { 33077 const fullData = __spreadProps(__spreadValues({}, data2), { 33078 // The floating element's position may be recomputed while it's closed 33079 // but still mounted (such as when transitioning out). To ensure 33080 // `isPositioned` will be `false` initially on the next open, avoid 33081 // setting it to `true` when `open === false` (must be specified). 33082 isPositioned: openRef.current !== false 33083 }); 33084 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 33085 dataRef.current = fullData; 33086 reactDomExports.flushSync(() => { 33087 setData(fullData); 33088 }); 33089 } 33090 }); 33091 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 33092 index(() => { 33093 if (open === false && dataRef.current.isPositioned) { 33094 dataRef.current.isPositioned = false;
33095 setData((data2) => __spreadProps(__spreadValues({}, data2), { 33096 isPositioned: false 33097 })); 33098 } 33099 }, [open]); 33100 const isMountedRef = reactExports.useRef(false); 33101 index(() => { 33102 isMountedRef.current = true; 33103 return () => { 33104 isMountedRef.current = false; 33105 }; 33106 }, []); 33107 index(() => { 33108 if (referenceEl) referenceRef.current = referenceEl; 33109 if (floatingEl) floatingRef.current = floatingEl; 33110 if (referenceEl && floatingEl) { 33111 if (whileElementsMountedRef.current) { 33112 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 33113 } 33114 update2(); 33115 } 33116 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 33117 const refs = reactExports.useMemo(() => ({ 33118 reference: referenceRef, 33119 floating: floatingRef, 33120 setReference, 33121 setFloating 33122 }), [setReference, setFloating]); 33123 const elements = reactExports.useMemo(() => ({ 33124 reference: referenceEl, 33125 floating: floatingEl 33126 }), [referenceEl, floatingEl]); 33127 const floatingStyles = reactExports.useMemo(() => { 33128 const initialStyles = { 33129 position: strategy, 33130 left: 0, 33131 top: 0 33132 }; 33133 if (!elements.floating) { 33134 return initialStyles; 33135 } 33136 const x2 = roundByDPR(elements.floating, data.x); 33137 const y2 = roundByDPR(elements.floating, data.y); 33138 if (transform2) { 33139 return __spreadValues(__spreadProps(__spreadValues({}, initialStyles), { 33140 transform: "translate(" + x2 + "px, " + y2 + "px)" 33141 }), getDPR(elements.floating) >= 1.5 && { 33142 willChange: "transform" 33143 }); 33144 } 33145 return { 33146 position: strategy, 33147 left: x2, 33148 top: y2 33149 }; 33150 }, [strategy, transform2, elements.floating, data.x, data.y]); 33151 return reactExports.useMemo(() => __spreadProps(__spreadValues({}, data), { 33152 update: update2, 33153 refs, 33154 elements, 33155 floatingStyles 33156 }), [data, update2, refs, elements, floatingStyles]); 33157 } 33158 const offset = (options2, deps) => __spreadProps(__spreadValues({}, offset$1(options2)), { 33159 options: [options2, deps] 33160 }); 33161 const shift = (options2, deps) => __spreadProps(__spreadValues({}, shift$1(options2)), { 33162 options: [options2, deps] 33163 }); 33164 const flip = (options2, deps) => __spreadProps(__spreadValues({}, flip$1(options2)), { 33165 options: [options2, deps] 33166 }); 33167 const FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable"; 33168 const ACTIVE_KEY = "active"; 33169 const SELECTED_KEY = "selected"; 33170 const SafeReact = __spreadValues({}, React); 33171 let serverHandoffComplete = false; 33172 let count = 0; 33173 const genId = () => ( 33174 // Ensure the id is unique with multiple independent versions of Floating UI 33175 // on <React 18 33176 "floating-ui-" + Math.random().toString(36).slice(2, 6) + count++ 33177 ); 33178 function useFloatingId() { 33179 const [id2, setId] = reactExports.useState(() => serverHandoffComplete ? genId() : void 0); 33180 index$1(() => { 33181 if (id2 == null) { 33182 setId(genId()); 33183 } 33184 }, []); 33185 reactExports.useEffect(() => { 33186 serverHandoffComplete = true; 33187 }, []); 33188 return id2; 33189 } 33190 const useReactId = SafeReact.useId; 33191 const useId = useReactId || useFloatingId; 33192 function createEventEmitter() { 33193 const map2 = /* @__PURE__ */ new Map(); 33194 return { 33195 emit(event, data) { 33196 var _map$get; 33197 (_map$get = map2.get(event)) == null || _map$get.forEach((listener) => listener(data)); 33198 }, 33199 on(event, listener) { 33200 if (!map2.has(event)) { 33201 map2.set(event, /* @__PURE__ */ new Set()); 33202 } 33203 map2.get(event).add(listener); 33204 }, 33205 off(event, listener) { 33206 var _map$get2; 33207 (_map$get2 = map2.get(event)) == null || _map$get2.delete(listener); 33208 } 33209 }; 33210 } 33211 const FloatingNodeContext = /* @__PURE__ */ reactExports.createContext(null); 33212 const FloatingTreeContext = /* @__PURE__ */ reactExports.createContext(null); 33213 const useFloatingParentNodeId = () => { 33214 var _React$useContext; 33215 return ((_React$useContext = reactExports.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.
33215id) || null; 33216 }; 33217 const useFloatingTree = () => reactExports.useContext(FloatingTreeContext); 33218 function createAttribute(name) { 33219 return "data-floating-ui-" + name; 33220 } 33221 function clearTimeoutIfSet(timeoutRef) { 33222 if (timeoutRef.current !== -1) { 33223 clearTimeout(timeoutRef.current); 33224 timeoutRef.current = -1; 33225 } 33226 } 33227 const safePolygonIdentifier = /* @__PURE__ */ createAttribute("safe-polygon"); 33228 function getDelay(value, prop, pointerType) { 33229 if (pointerType && !isMouseLikePointerType(pointerType)) { 33230 return 0; 33231 } 33232 if (typeof value === "number") { 33233 return value; 33234 } 33235 if (typeof value === "function") { 33236 const result = value(); 33237 if (typeof result === "number") { 33238 return result; 33239 } 33240 return result == null ? void 0 : result[prop]; 33241 } 33242 return value == null ? void 0 : value[prop]; 33243 } 33244 function getRestMs(value) { 33245 if (typeof value === "function") { 33246 return value(); 33247 } 33248 return value; 33249 } 33250 function useHover(context, props) { 33251 if (props === void 0) { 33252 props = {}; 33253 } 33254 const { 33255 open, 33256 onOpenChange, 33257 dataRef, 33258 events, 33259 elements 33260 } = context; 33261 const { 33262 enabled = true, 33263 delay: delay2 = 0, 33264 handleClose = null, 33265 mouseOnly = false, 33266 restMs = 0, 33267 move = true 33268 } = props; 33269 const tree = useFloatingTree(); 33270 const parentId = useFloatingParentNodeId(); 33271 const handleCloseRef = useLatestRef$1(handleClose); 33272 const delayRef = useLatestRef$1(delay2); 33273 const openRef = useLatestRef$1(open); 33274 const restMsRef = useLatestRef$1(restMs); 33275 const pointerTypeRef = reactExports.useRef(); 33276 const timeoutRef = reactExports.useRef(-1); 33277 const handlerRef = reactExports.useRef(); 33278 const restTimeoutRef = reactExports.useRef(-1); 33279 const blockMouseMoveRef = reactExports.useRef(true); 33280 const performedPointerEventsMutationRef = reactExports.useRef(false); 33281 const unbindMouseMoveRef = reactExports.useRef(() => { 33282 }); 33283 const restTimeoutPendingRef = reactExports.useRef(false); 33284 const isHoverOpen = useEffectEvent(() => { 33285 var _dataRef$current$open; 33286 const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type; 33287 return (type == null ? void 0 : type.includes("mouse")) && type !== "mousedown"; 33288 }); 33289 reactExports.useEffect(() => { 33290 if (!enabled) return; 33291 function onOpenChange2(_ref2) { 33292 let { 33293 open: open2 33294 } = _ref2; 33295 if (!open2) { 33296 clearTimeoutIfSet(timeoutRef); 33297 clearTimeoutIfSet(restTimeoutRef); 33298 blockMouseMoveRef.current = true; 33299 restTimeoutPendingRef.current = false; 33300 } 33301 } 33302 events.on("openchange", onOpenChange2); 33303 return () => { 33304 events.off("openchange", onOpenChange2); 33305 }; 33306 }, [enabled, events]); 33307 reactExports.useEffect(() => { 33308 if (!enabled) return; 33309 if (!handleCloseRef.current) return; 33310 if (!open) return; 33311 function onLeave(event) { 33312 if (isHoverOpen()) { 33313 onOpenChange(false, event, "hover"); 33314 } 33315 } 33316 const html2 = getDocument$1(elements.floating).documentElement; 33317 html2.addEventListener("mouseleave", onLeave); 33318 return () => { 33319 html2.removeEventListener("mouseleave", onLeave); 33320 }; 33321 }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]); 33322 const closeWithDelay = reactExports.useCallback(function(event, runElseBranch, reason) { 33323 if (runElseBranch === void 0) { 33324 runElseBranch = true; 33325 } 33326 if (reason === void 0) { 33327 reason = "hover"; 33328 } 33329 const closeDelay = getDelay(delayRef.current, "close", pointerTypeRef.current); 33330 if (closeDelay && !handlerRef.current) { 33331 clearTimeoutIfSet(timeoutRef); 33332 timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay); 33333 } else if (runElseBranch) { 33334 clearTimeoutIfSet(timeoutRef); 33335 onOpenChange(false, event, reason); 33336 } 33337 }, [delayRef, onOpenChange]); 33338 const cleanupMouseMoveHandler = useEffectEvent(() => { 33339 unbindMouseMoveRef.current(); 33340 handlerRef.current = void 0; 33341 }); 33342 const clearPointerEvents = useEffectEvent(() => { 33343 if (performedPointerEventsMutationRef.current) { 33344 const body = getDocument$1(elements.floating).body; 33345 body.style.pointerEvents = ""; 33346 body.removeAttribute(safePolygonIdentifier); 33347 performedPointerEventsMutationRef.current = false;
33348 } 33349 }); 33350 const isClickLikeOpenEvent = useEffectEvent(() => { 33351 return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false; 33352 }); 33353 reactExports.useEffect(() => { 33354 if (!enabled) return; 33355 function onReferenceMouseEnter(event) { 33356 clearTimeoutIfSet(timeoutRef); 33357 blockMouseMoveRef.current = false; 33358 if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, "open")) { 33359 return; 33360 } 33361 const openDelay = getDelay(delayRef.current, "open", pointerTypeRef.current); 33362 if (openDelay) { 33363 timeoutRef.current = window.setTimeout(() => { 33364 if (!openRef.current) { 33365 onOpenChange(true, event, "hover"); 33366 } 33367 }, openDelay); 33368 } else if (!open) { 33369 onOpenChange(true, event, "hover"); 33370 } 33371 } 33372 function onReferenceMouseLeave(event) { 33373 if (isClickLikeOpenEvent()) { 33374 clearPointerEvents(); 33375 return; 33376 } 33377 unbindMouseMoveRef.current(); 33378 const doc = getDocument$1(elements.floating); 33379 clearTimeoutIfSet(restTimeoutRef); 33380 restTimeoutPendingRef.current = false; 33381 if (handleCloseRef.current && dataRef.current.floatingContext) { 33382 if (!open) { 33383 clearTimeoutIfSet(timeoutRef); 33384 } 33385 handlerRef.current = handleCloseRef.current(__spreadProps(__spreadValues({}, dataRef.current.floatingContext), { 33386 tree, 33387 x: event.clientX, 33388 y: event.clientY, 33389 onClose() { 33390 clearPointerEvents(); 33391 cleanupMouseMoveHandler(); 33392 if (!isClickLikeOpenEvent()) { 33393 closeWithDelay(event, true, "safe-polygon"); 33394 } 33395 } 33396 })); 33397 const handler = handlerRef.current; 33398 doc.addEventListener("mousemove", handler); 33399 unbindMouseMoveRef.current = () => { 33400 doc.removeEventListener("mousemove", handler); 33401 }; 33402 return; 33403 } 33404 const shouldClose = pointerTypeRef.current === "touch" ? !contains$1(elements.floating, event.relatedTarget) : true; 33405 if (shouldClose) { 33406 closeWithDelay(event); 33407 } 33408 } 33409 function onScrollMouseLeave(event) { 33410 if (isClickLikeOpenEvent()) return; 33411 if (!dataRef.current.floatingContext) return; 33412 handleCloseRef.current == null || handleCloseRef.current(__spreadProps(__spreadValues({}, dataRef.current.floatingContext), { 33413 tree, 33414 x: event.clientX, 33415 y: event.clientY, 33416 onClose() { 33417 clearPointerEvents(); 33418 cleanupMouseMoveHandler(); 33419 if (!isClickLikeOpenEvent()) { 33420 closeWithDelay(event); 33421 } 33422 } 33423 }))(event); 33424 } 33425 function onFloatingMouseEnter() { 33426 clearTimeoutIfSet(timeoutRef); 33427 } 33428 function onFloatingMouseLeave(event) { 33429 if (!isClickLikeOpenEvent()) { 33430 closeWithDelay(event, false); 33431 } 33432 } 33433 if (isElement(elements.domReference)) { 33434 const reference2 = elements.domReference; 33435 const floating = elements.floating; 33436 if (open) { 33437 reference2.addEventListener("mouseleave", onScrollMouseLeave); 33438 } 33439 if (move) { 33440 reference2.addEventListener("mousemove", onReferenceMouseEnter, { 33441 once: true 33442 }); 33443 } 33444 reference2.addEventListener("mouseenter", onReferenceMouseEnter); 33445 reference2.addEventListener("mouseleave", onReferenceMouseLeave); 33446 if (floating) { 33447 floating.addEventListener("mouseleave", onScrollMouseLeave); 33448 floating.addEventListener("mouseenter", onFloatingMouseEnter); 33449 floating.addEventListener("mouseleave", onFloatingMouseLeave); 33450 } 33451 return () => { 33452 if (open) { 33453 reference2.removeEventListener("mouseleave", onScrollMouseLeave); 33454 } 33455 if (move) { 33456 reference2.removeEventListener("mousemove", onReferenceMouseEnter); 33457 } 33458 reference2.removeEventListener("mouseenter", onReferenceMouseEnter); 33459 reference2.removeEventListener("mouseleave", onReferenceMouseLeave); 33460 if (floating) { 33461 floating.removeEventListener("mouseleave", onScrollMouseLeave); 33462 floating.removeEventListener("mouseenter", onFloatingMouseEnter); 33463 floating.removeEventListener("mouseleave", onFloatingMouseLeave); 33464 } 33465 }; 33466 } 33467 }, [elements, enabled, context, mouseOnly, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef]); 33468 index$1(() => { 33469 var _handleCloseRef$curre; 33470 if (!enabled) return; 33471 if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && (_handleCloseRef$curre = _handleCloseRef$curre.__options) != null && _handleCloseRef$curre.blockPointerEvents && isHoverOpen()) { 33472 performedPointerEventsMutationRef.current = true; 33473 const floatingEl = elements.floating; 33474 if (isElement(elements.domReference) && floatingEl) { 33475 var _tree$nodesRef$curren; 33476 const body = getDocument$1(elements.floating).body; 33477 body.setAttribute(safePolygonIdentifier, ""); 33478 const ref = elements.domReference; 33479 const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find((node2) => node2.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating; 33480 if (parentFloating) { 33481 parentFloating.style.pointerEvents = ""; 33482 } 33483 body.style.pointerEvents = "none"; 33484 ref.style.pointerEvents = "auto"; 33485 floatingEl.style.pointerEvents = "auto"; 33486 return () => { 33487 body.style.pointerEvents = ""; 33488 ref.style.pointerEvents = ""; 33489 floatingEl.style.pointerEvents = ""; 33490 }; 33491 } 33492 } 33493 }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]); 33494 index$1(() => { 33495 if (!open) { 33496 pointerTypeRef.current = void 0; 33497 restTimeoutPendingRef.current = false;
33498 cleanupMouseMoveHandler(); 33499 clearPointerEvents(); 33500 } 33501 }, [open, cleanupMouseMoveHandler, clearPointerEvents]); 33502 reactExports.useEffect(() => { 33503 return () => { 33504 cleanupMouseMoveHandler(); 33505 clearTimeoutIfSet(timeoutRef); 33506 clearTimeoutIfSet(restTimeoutRef); 33507 clearPointerEvents(); 33508 }; 33509 }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]); 33510 const reference = reactExports.useMemo(() => { 33511 function setPointerRef(event) { 33512 pointerTypeRef.current = event.pointerType; 33513 } 33514 return { 33515 onPointerDown: setPointerRef, 33516 onPointerEnter: setPointerRef, 33517 onMouseMove(event) { 33518 const { 33519 nativeEvent 33520 } = event; 33521 function handleMouseMove() { 33522 if (!blockMouseMoveRef.current && !openRef.current) { 33523 onOpenChange(true, nativeEvent, "hover"); 33524 } 33525 } 33526 if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) { 33527 return; 33528 } 33529 if (open || getRestMs(restMsRef.current) === 0) { 33530 return; 33531 } 33532 if (restTimeoutPendingRef.current && __pow(event.movementX, 2) + __pow(event.movementY, 2) < 2) { 33533 return; 33534 } 33535 clearTimeoutIfSet(restTimeoutRef); 33536 if (pointerTypeRef.current === "touch") { 33537 handleMouseMove(); 33538 } else { 33539 restTimeoutPendingRef.current = true; 33540 restTimeoutRef.current = window.setTimeout(handleMouseMove, getRestMs(restMsRef.current)); 33541 } 33542 } 33543 }; 33544 }, [mouseOnly, onOpenChange, open, openRef, restMsRef]); 33545 return reactExports.useMemo(() => enabled ? { 33546 reference 33547 } : {}, [enabled, reference]); 33548 } 33549 let rafId = 0; 33550 function enqueueFocus(el, options2) { 33551 if (options2 === void 0) { 33552 options2 = {}; 33553 } 33554 const { 33555 preventScroll = false, 33556 cancelPrevious = true, 33557 sync = false 33558 } = options2; 33559 cancelPrevious && cancelAnimationFrame(rafId); 33560 const exec = () => el == null ? void 0 : el.focus({ 33561 preventScroll 33562 }); 33563 if (sync) { 33564 exec(); 33565 } else { 33566 rafId = requestAnimationFrame(exec); 33567 } 33568 } 33569 function contains(parent, child) { 33570 if (!parent || !child) { 33571 return false; 33572 } 33573 const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); 33574 if (parent.contains(child)) { 33575 return true; 33576 } 33577 if (rootNode && isShadowRoot(rootNode)) { 33578 let next2 = child; 33579 while (next2) { 33580 if (parent === next2) { 33581 return true; 33582 } 33583 next2 = next2.parentNode || next2.host; 33584 } 33585 } 33586 return false; 33587 } 33588 function getTarget(event) { 33589 if ("composedPath" in event) { 33590 return event.composedPath()[0]; 33591 } 33592 return event.target; 33593 } 33594 function getDocument(node2) { 33595 return (node2 == null ? void 0 : node2.ownerDocument) || document; 33596 } 33597 const counters = { 33598 inert: /* @__PURE__ */ new WeakMap(), 33599 "aria-hidden": /* @__PURE__ */ new WeakMap(), 33600 none: /* @__PURE__ */ new WeakMap() 33601 }; 33602 function getCounterMap(control) { 33603 if (control === "inert") return counters.inert; 33604 if (control === "aria-hidden") return counters["aria-hidden"]; 33605 return counters.none; 33606 } 33607 let uncontrolledElementsSet = /* @__PURE__ */ new WeakSet(); 33608 let markerMap = {}; 33609 let lockCount$1 = 0; 33610 const supportsInert = () => typeof HTMLElement !== "undefined" && "inert" in HTMLElement.prototype; 33611 const unwrapHost = (node2) => node2 && (node2.host || unwrapHost(node2.parentNode)); 33612 const correctElements = (parent, targets) => targets.map((target) => { 33613 if (parent.contains(target)) { 33614 return target; 33615 } 33616 const correctedTarget = unwrapHost(target); 33617 if (parent.contains(correctedTarget)) { 33618 return correctedTarget; 33619 } 33620 return null; 33621 }).filter((x2) => x2 != null); 33622 function applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) { 33623 const markerName = "data-floating-ui-inert"; 33624 const controlAttribute = inert ? "inert" : ariaHidden ? "aria-hidden" : null; 33625 const avoidElements = correctElements(body, uncorrectedAvoidElements); 33626 const elementsToKeep = /* @__PURE__ */ new Set(); 33627 const elementsToStop = new Set(avoidElements); 33628 const hiddenElements = []; 33629 if (!markerMap[markerName]) { 33630 markerMap[markerName] = /* @__PURE__ */ new WeakMap(); 33631 } 33632 const markerCounter = markerMap[markerName];
33633 avoidElements.forEach(keep); 33634 deep(body); 33635 elementsToKeep.clear(); 33636 function keep(el) { 33637 if (!el || elementsToKeep.has(el)) { 33638 return; 33639 } 33640 elementsToKeep.add(el); 33641 el.parentNode && keep(el.parentNode); 33642 } 33643 function deep(parent) { 33644 if (!parent || elementsToStop.has(parent)) { 33645 return; 33646 } 33647 [].forEach.call(parent.children, (node2) => { 33648 if (getNodeName(node2) === "script") return; 33649 if (elementsToKeep.has(node2)) { 33650 deep(node2); 33651 } else { 33652 const attr2 = controlAttribute ? node2.getAttribute(controlAttribute) : null; 33653 const alreadyHidden = attr2 !== null && attr2 !== "false"; 33654 const counterMap = getCounterMap(controlAttribute); 33655 const counterValue = (counterMap.get(node2) || 0) + 1; 33656 const markerValue = (markerCounter.get(node2) || 0) + 1; 33657 counterMap.set(node2, counterValue); 33658 markerCounter.set(node2, markerValue); 33659 hiddenElements.push(node2); 33660 if (counterValue === 1 && alreadyHidden) { 33661 uncontrolledElementsSet.add(node2); 33662 } 33663 if (markerValue === 1) { 33664 node2.setAttribute(markerName, ""); 33665 } 33666 if (!alreadyHidden && controlAttribute) { 33667 node2.setAttribute(controlAttribute, controlAttribute === "inert" ? "" : "true"); 33668 } 33669 } 33670 }); 33671 } 33672 lockCount$1++; 33673 return () => { 33674 hiddenElements.forEach((element) => { 33675 const counterMap = getCounterMap(controlAttribute); 33676 const currentCounterValue = counterMap.get(element) || 0; 33677 const counterValue = currentCounterValue - 1; 33678 const markerValue = (markerCounter.get(element) || 0) - 1; 33679 counterMap.set(element, counterValue); 33680 markerCounter.set(element, markerValue); 33681 if (!counterValue) { 33682 if (!uncontrolledElementsSet.has(element) && controlAttribute) { 33683 element.removeAttribute(controlAttribute); 33684 } 33685 uncontrolledElementsSet.delete(element); 33686 } 33687 if (!markerValue) { 33688 element.removeAttribute(markerName); 33689 } 33690 }); 33691 lockCount$1--; 33692 if (!lockCount$1) { 33693 counters.inert = /* @__PURE__ */ new WeakMap(); 33694 counters["aria-hidden"] = /* @__PURE__ */ new WeakMap(); 33695 counters.none = /* @__PURE__ */ new WeakMap(); 33696 uncontrolledElementsSet = /* @__PURE__ */ new WeakSet(); 33697 markerMap = {}; 33698 } 33699 }; 33700 } 33701 function markOthers(avoidElements, ariaHidden, inert) { 33702 if (ariaHidden === void 0) { 33703 ariaHidden = false; 33704 } 33705 if (inert === void 0) { 33706 inert = false; 33707 } 33708 const body = getDocument(avoidElements[0]).body; 33709 return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live],[role="status"],output'))), body, ariaHidden, inert); 33710 } 33711 const HIDDEN_STYLES = { 33712 border: 0, 33713 clip: "rect(0 0 0 0)", 33714 height: "1px", 33715 margin: "-1px", 33716 overflow: "hidden", 33717 padding: 0, 33718 position: "fixed", 33719 whiteSpace: "nowrap", 33720 width: "1px", 33721 top: 0, 33722 left: 0 33723 }; 33724 const FocusGuard = /* @__PURE__ */ reactExports.forwardRef(function FocusGuard2(props, ref) { 33725 const [role, setRole] = reactExports.useState(); 33726 index$1(() => { 33727 if (isSafari()) { 33728 setRole("button"); 33729 } 33730 }, []); 33731 const restProps = { 33732 ref, 33733 tabIndex: 0, 33734 // Role is only for VoiceOver 33735 role, 33736 "aria-hidden": role ? void 0 : true, 33737 [createAttribute("focus-guard")]: "", 33738 style: HIDDEN_STYLES 33739 }; 33740 return /* @__PURE__ */ jsxRuntimeExports.jsx("span", __spreadValues(__spreadValues({}, props), restProps)); 33741 }); 33742 const PortalContext = /* @__PURE__ */ reactExports.createContext(null); 33743 const attr = /* @__PURE__ */ createAttribute("portal");
33744 function useFloatingPortalNode(props) { 33745 if (props === void 0) { 33746 props = {}; 33747 } 33748 const { 33749 id: id2, 33750 root: root2 33751 } = props; 33752 const uniqueId = useId(); 33753 const portalContext = usePortalContext(); 33754 const [portalNode, setPortalNode] = reactExports.useState(null); 33755 const portalNodeRef = reactExports.useRef(null); 33756 index$1(() => { 33757 return () => { 33758 portalNode == null || portalNode.remove(); 33759 queueMicrotask(() => { 33760 portalNodeRef.current = null; 33761 }); 33762 }; 33763 }, [portalNode]); 33764 index$1(() => { 33765 if (!uniqueId) return; 33766 if (portalNodeRef.current) return; 33767 const existingIdRoot = id2 ? document.getElementById(id2) : null; 33768 if (!existingIdRoot) return; 33769 const subRoot = document.createElement("div"); 33770 subRoot.id = uniqueId; 33771 subRoot.setAttribute(attr, ""); 33772 existingIdRoot.appendChild(subRoot); 33773 portalNodeRef.current = subRoot; 33774 setPortalNode(subRoot); 33775 }, [id2, uniqueId]); 33776 index$1(() => { 33777 if (root2 === null) return; 33778 if (!uniqueId) return; 33779 if (portalNodeRef.current) return; 33780 let container = root2 || (portalContext == null ? void 0 : portalContext.portalNode); 33781 if (container && !isNode(container)) container = container.current; 33782 container = container || document.body; 33783 let idWrapper = null; 33784 if (id2) { 33785 idWrapper = document.createElement("div"); 33786 idWrapper.id = id2; 33787 container.appendChild(idWrapper); 33788 } 33789 const subRoot = document.createElement("div"); 33790 subRoot.id = uniqueId; 33791 subRoot.setAttribute(attr, ""); 33792 container = idWrapper || container; 33793 container.appendChild(subRoot); 33794 portalNodeRef.current = subRoot; 33795 setPortalNode(subRoot); 33796 }, [id2, root2, uniqueId, portalContext]); 33797 return portalNode; 33798 } 33799 function FloatingPortal(props) { 33800 const { 33801 children, 33802 id: id2, 33803 root: root2, 33804 preserveTabOrder = true 33805 } = props; 33806 const portalNode = useFloatingPortalNode({ 33807 id: id2, 33808 root: root2 33809 }); 33810 const [focusManagerState, setFocusManagerState] = reactExports.useState(null); 33811 const beforeOutsideRef = reactExports.useRef(null); 33812 const afterOutsideRef = reactExports.useRef(null); 33813 const beforeInsideRef = reactExports.useRef(null); 33814 const afterInsideRef = reactExports.useRef(null); 33815 const modal = focusManagerState == null ? void 0 : focusManagerState.modal; 33816 const open = focusManagerState == null ? void 0 : focusManagerState.open; 33817 const shouldRenderGuards = ( 33818 // The FocusManager and therefore floating element are currently open/ 33819 // rendered. 33820 !!focusManagerState && // Guards are only for non-modal focus management. 33821 !focusManagerState.modal && // Don't render if unmount is transitioning. 33822 focusManagerState.open && preserveTabOrder && !!(root2 || portalNode) 33823 ); 33824 reactExports.useEffect(() => { 33825 if (!portalNode || !preserveTabOrder || modal) { 33826 return; 33827 } 33828 function onFocus(event) { 33829 if (portalNode && isOutsideEvent(event)) { 33830 const focusing = event.type === "focusin"; 33831 const manageFocus = focusing ? enableFocusInside : disableFocusInside; 33832 manageFocus(portalNode); 33833 } 33834 } 33835 portalNode.addEventListener("focusin", onFocus, true); 33836 portalNode.addEventListener("focusout", onFocus, true); 33837 return () => { 33838 portalNode.removeEventListener("focusin", onFocus, true); 33839 portalNode.removeEventListener("focusout", onFocus, true); 33840 }; 33841 }, [portalNode, preserveTabOrder, modal]); 33842 reactExports.useEffect(() => { 33843 if (!portalNode) return; 33844 if (open) return; 33845 enableFocusInside(portalNode); 33846 }, [open, portalNode]); 33847 return /* @__PURE__ */ jsxRuntimeExports.jsxs(PortalContext.Provider, { 33848 value: reactExports.useMemo(() => ({ 33849 preserveTabOrder, 33850 beforeOutsideRef, 33851 afterOutsideRef, 33852 beforeInsideRef, 33853 afterInsideRef, 33854 portalNode, 33855 setFocusManagerState 33856 }), [preserveTabOrder, portalNode]),
33857 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 33858 "data-type": "outside", 33859 ref: beforeOutsideRef, 33860 onFocus: (event) => { 33861 if (isOutsideEvent(event, portalNode)) { 33862 var _beforeInsideRef$curr; 33863 (_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus(); 33864 } else { 33865 const domReference = focusManagerState ? focusManagerState.domReference : null; 33866 const prevTabbable = getPreviousTabbable(domReference); 33867 prevTabbable == null || prevTabbable.focus(); 33868 } 33869 } 33870 }), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { 33871 "aria-owns": portalNode.id, 33872 style: HIDDEN_STYLES 33873 }), portalNode && /* @__PURE__ */ reactDomExports.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 33874 "data-type": "outside", 33875 ref: afterOutsideRef, 33876 onFocus: (event) => { 33877 if (isOutsideEvent(event, portalNode)) { 33878 var _afterInsideRef$curre; 33879 (_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus(); 33880 } else { 33881 const domReference = focusManagerState ? focusManagerState.domReference : null; 33882 const nextTabbable = getNextTabbable(domReference); 33883 nextTabbable == null || nextTabbable.focus(); 33884 (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, "focus-out")); 33885 } 33886 } 33887 })] 33888 }); 33889 } 33890 const usePortalContext = () => reactExports.useContext(PortalContext); 33891 function useLiteMergeRefs(refs) { 33892 return reactExports.useMemo(() => { 33893 return (value) => { 33894 refs.forEach((ref) => { 33895 if (ref) { 33896 ref.current = value; 33897 } 33898 }); 33899 }; 33900 }, refs); 33901 } 33902 const LIST_LIMIT = 20; 33903 let previouslyFocusedElements = []; 33904 function clearDisconnectedPreviouslyFocusedElements() { 33905 previouslyFocusedElements = previouslyFocusedElements.filter((el) => el.isConnected); 33906 } 33907 function addPreviouslyFocusedElement(element) { 33908 clearDisconnectedPreviouslyFocusedElements(); 33909 if (element && getNodeName(element) !== "body") { 33910 previouslyFocusedElements.push(element); 33911 if (previouslyFocusedElements.length > LIST_LIMIT) { 33912 previouslyFocusedElements = previouslyFocusedElements.slice(-20); 33913 } 33914 } 33915 } 33916 function getPreviouslyFocusedElement() { 33917 clearDisconnectedPreviouslyFocusedElements(); 33918 return previouslyFocusedElements[previouslyFocusedElements.length - 1]; 33919 } 33920 function getFirstTabbableElement(container) { 33921 const tabbableOptions = getTabbableOptions(); 33922 if (isTabbable(container, tabbableOptions)) { 33923 return container; 33924 } 33925 return tabbable(container, tabbableOptions)[0] || container; 33926 } 33927 function handleTabIndex(floatingFocusElement, orderRef) { 33928 var _floatingFocusElement; 33929 if (!orderRef.current.includes("floating") && !((_floatingFocusElement = floatingFocusElement.getAttribute("role")) != null && _floatingFocusElement.includes("dialog"))) { 33930 return; 33931 } 33932 const options2 = getTabbableOptions(); 33933 const focusableElements2 = focusable(floatingFocusElement, options2); 33934 const tabbableContent = focusableElements2.filter((element) => { 33935 const dataTabIndex = element.getAttribute("data-tabindex") || ""; 33936 return isTabbable(element, options2) || element.hasAttribute("data-tabindex") && !dataTabIndex.startsWith("-"); 33937 }); 33938 const tabIndex = floatingFocusElement.getAttribute("tabindex"); 33939 if (orderRef.current.includes("floating") || tabbableContent.length === 0) { 33940 if (tabIndex !== "0") { 33941 floatingFocusElement.setAttribute("tabindex", "0"); 33942 } 33943 } else if (tabIndex !== "-1" || floatingFocusElement.hasAttribute("data-tabindex") && floatingFocusElement.getAttribute("data-tabindex") !== "-1") { 33944 floatingFocusElement.setAttribute("tabindex", "-1"); 33945 floatingFocusElement.setAttribute("data-tabindex", "-1"); 33946 } 33947 } 33948 const VisuallyHiddenDismiss = /* @__PURE__ */ reactExports.forwardRef(function VisuallyHiddenDismiss2(props, ref) { 33949 return /* @__PURE__ */ jsxRuntimeExports.jsx("button", __spreadProps(__spreadValues({}, props), { 33950 type: "button", 33951 ref, 33952 tabIndex: -1, 33953 style: HIDDEN_STYLES 33954 })); 33955 }); 33956 function FloatingFocusManager(props) { 33957 const { 33958 context, 33959 children, 33960 disabled = false, 33961 order = ["content"], 33962 guards: _guards = true, 33963 initialFocus = 0, 33964 returnFocus = true, 33965 restoreFocus = false, 33966 modal = true, 33967 visuallyHiddenDismiss = false, 33968 closeOnFocusOut = true, 33969 outsideElementsInert = false, 33970 getInsideElements: _getInsideElements = () => [] 33971 } = props; 33972 const { 33973 open, 33974 onOpenChange, 33975 events, 33976 dataRef, 33977 elements: { 33978 domReference, 33979 floating 33980 } 33981 } = context; 33982 const getNodeId = useEffectEvent(() => { 33983 var _dataRef$current$floa; 33984 return (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId; 33985 }); 33986 const getInsideElements = useEffectEvent(_getInsideElements); 33987 const ignoreInitialFocus = typeof initialFocus === "number" && initialFocus < 0; 33988 const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus; 33989 const inertSupported = supportsInert(); 33990 const guards = inertSupported ? _guards : true; 33991 const useInert = !guards || inertSupported && outsideElementsInert; 33992 const orderRef = useLatestRef$1(order); 33993 const initialFocusRef = useLatestRef$1(initialFocus); 33994 const returnFocusRef = useLatestRef$1(returnFocus); 33995 const tree = useFloatingTree(); 33996 const portalContext = usePortalContext(); 33997 const startDismissButtonRef = reactExports.useRef(null); 33998 const endDismissButtonRef = reactExports.useRef(null); 33999 const preventReturnFocusRef = reactExports.useRef(false); 34000 const isPointerDownRef = reactExports.useRef(false); 34001 const tabbableIndexRef = reactExports.useRef(-1); 34002 const blurTimeoutRef = reactExports.useRef(-1); 34003 const isInsidePortal = portalContext != null; 34004 const floatingFocusElement = getFloatingFocusElement(floating); 34005 const getTabbableContent = useEffectEvent(function(container) { 34006 if (container === void 0) { 34007 container = floatingFocusElement; 34008 } 34009 return container ? tabbable(container, getTabbableOptions()) : []; 34010 }); 34011 const getTabbableElements = useEffectEvent((container) => { 34012 const content = getTabbableContent(container); 34013 return orderRef.current.map((type) => { 34014 if (domReference && type === "reference") { 34015 return domReference; 34016 } 34017 if (floatingFocusElement && type === "floating") { 34018 return floatingFocusElement; 34019 } 34020 return content; 34021 }
34021).filter(Boolean).flat(); 34022 }); 34023 reactExports.useEffect(() => { 34024 if (disabled) return; 34025 if (!modal) return; 34026 function onKeyDown(event) { 34027 if (event.key === "Tab") { 34028 if (contains$1(floatingFocusElement, activeElement(getDocument$1(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) { 34029 stopEvent(event); 34030 } 34031 const els = getTabbableElements(); 34032 const target = getTarget$1(event); 34033 if (orderRef.current[0] === "reference" && target === domReference) { 34034 stopEvent(event); 34035 if (event.shiftKey) { 34036 enqueueFocus(els[els.length - 1]); 34037 } else { 34038 enqueueFocus(els[1]); 34039 } 34040 } 34041 if (orderRef.current[1] === "floating" && target === floatingFocusElement && event.shiftKey) { 34042 stopEvent(event); 34043 enqueueFocus(els[0]); 34044 } 34045 } 34046 } 34047 const doc = getDocument$1(floatingFocusElement); 34048 doc.addEventListener("keydown", onKeyDown); 34049 return () => { 34050 doc.removeEventListener("keydown", onKeyDown); 34051 }; 34052 }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]); 34053 reactExports.useEffect(() => { 34054 if (disabled) return; 34055 if (!floating) return; 34056 function handleFocusIn(event) { 34057 const target = getTarget$1(event); 34058 const tabbableContent = getTabbableContent(); 34059 const tabbableIndex = tabbableContent.indexOf(target); 34060 if (tabbableIndex !== -1) { 34061 tabbableIndexRef.current = tabbableIndex; 34062 } 34063 } 34064 floating.addEventListener("focusin", handleFocusIn); 34065 return () => { 34066 floating.removeEventListener("focusin", handleFocusIn); 34067 }; 34068 }, [disabled, floating, getTabbableContent]); 34069 reactExports.useEffect(() => { 34070 if (disabled) return; 34071 if (!closeOnFocusOut) return; 34072 function handlePointerDown() { 34073 isPointerDownRef.current = true; 34074 setTimeout(() => { 34075 isPointerDownRef.current = false; 34076 }); 34077 } 34078 function handleFocusOutside(event) { 34079 const relatedTarget = event.relatedTarget; 34080 const currentTarget = event.currentTarget; 34081 const target = getTarget$1(event); 34082 queueMicrotask(() => { 34083 const nodeId = getNodeId(); 34084 const movedToUnrelatedNode = !(contains$1(domReference, relatedTarget) || contains$1(floating, relatedTarget) || contains$1(relatedTarget, floating) || contains$1(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute("focus-guard")) || tree && (getNodeChildren$1(tree.nodesRef.current, nodeId).find((node2) => { 34085 var _node$context, _node$context2; 34086 return contains$1((_node$context = node2.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains$1((_node$context2 = node2.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget); 34087 }) || getNodeAncestors(tree.nodesRef.current, nodeId).find((node2) => { 34088 var _node$context3, _node$context4, _node$context5; 34089 return [(_node$context3 = node2.context) == null ? void 0 : _node$context3.elements.floating, getFloatingFocusElement((_node$context4 = node2.context) == null ? void 0 : _node$context4.elements.floating)].includes(relatedTarget) || ((_node$context5 = node2.context) == null ? void 0 : _node$context5.elements.domReference) === relatedTarget; 34090 }))); 34091 if (currentTarget === domReference && floatingFocusElement) { 34092 handleTabIndex(floatingFocusElement, orderRef); 34093 } 34094 if (restoreFocus && currentTarget !== domReference && !(target != null && target.isConnected) && activeElement(getDocument$1(floatingFocusElement)) === getDocument$1(floatingFocusElement).body) { 34095 if (isHTMLElement(floatingFocusElement)) { 34096 floatingFocusElement.focus(); 34097 } 34098 const prevTabbableIndex = tabbableIndexRef.current; 34099 const tabbableContent = getTabbableContent(); 34100 const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement; 34101 if (isHTMLElement(nodeToFocus)) { 34102 nodeToFocus.focus(); 34103 } 34104 } 34105 if (dataRef.current.insideReactTree) { 34106 dataRef.current.insideReactTree = false;
34107 return; 34108 } 34109 if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && // Fix React 18 Strict Mode returnFocus due to double rendering. 34110 relatedTarget !== getPreviouslyFocusedElement()) { 34111 preventReturnFocusRef.current = true; 34112 onOpenChange(false, event, "focus-out"); 34113 } 34114 }); 34115 } 34116 const shouldHandleBlurCapture = Boolean(!tree && portalContext); 34117 function markInsideReactTree() { 34118 clearTimeoutIfSet(blurTimeoutRef); 34119 dataRef.current.insideReactTree = true; 34120 blurTimeoutRef.current = window.setTimeout(() => { 34121 dataRef.current.insideReactTree = false; 34122 }); 34123 } 34124 if (floating && isHTMLElement(domReference)) { 34125 domReference.addEventListener("focusout", handleFocusOutside); 34126 domReference.addEventListener("pointerdown", handlePointerDown); 34127 floating.addEventListener("focusout", handleFocusOutside); 34128 if (shouldHandleBlurCapture) { 34129 floating.addEventListener("focusout", markInsideReactTree, true); 34130 } 34131 return () => { 34132 domReference.removeEventListener("focusout", handleFocusOutside); 34133 domReference.removeEventListener("pointerdown", handlePointerDown); 34134 floating.removeEventListener("focusout", handleFocusOutside); 34135 if (shouldHandleBlurCapture) { 34136 floating.removeEventListener("focusout", markInsideReactTree, true); 34137 } 34138 }; 34139 } 34140 }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef]); 34141 const beforeGuardRef = reactExports.useRef(null); 34142 const afterGuardRef = reactExports.useRef(null); 34143 const mergedBeforeGuardRef = useLiteMergeRefs([beforeGuardRef, portalContext == null ? void 0 : portalContext.beforeInsideRef]); 34144 const mergedAfterGuardRef = useLiteMergeRefs([afterGuardRef, portalContext == null ? void 0 : portalContext.afterInsideRef]); 34145 reactExports.useEffect(() => { 34146 var _portalContext$portal, _ancestors$find; 34147 if (disabled) return; 34148 if (!floating) return; 34149 const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll("[" + createAttribute("portal") + "]")) || []); 34150 const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : []; 34151 const rootAncestorComboboxDomReference = (_ancestors$find = ancestors.find((node2) => { 34152 var _node$context6; 34153 return isTypeableCombobox(((_node$context6 = node2.context) == null ? void 0 : _node$context6.elements.domReference) || null); 34154 })) == null || (_ancestors$find = _ancestors$find.context) == null ? void 0 : _ancestors$find.elements.domReference; 34155 const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes, ...getInsideElements(), startDismissButtonRef.current, endDismissButtonRef.current, beforeGuardRef.current, afterGuardRef.current, portalContext == null ? void 0 : portalContext.beforeOutsideRef.current, portalContext == null ? void 0 : portalContext.afterOutsideRef.current, orderRef.current.includes("reference") || isUntrappedTypeableCombobox ? domReference : null].filter((x2) => x2 != null); 34156 const cleanup2 = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, !useInert, useInert) : markOthers(insideElements); 34157 return () => { 34158 cleanup2(); 34159 }; 34160 }, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards, useInert, tree, getNodeId, getInsideElements]); 34161 index$1(() => { 34162 if (disabled || !isHTMLElement(floatingFocusElement)) return; 34163 const doc = getDocument$1(floatingFocusElement); 34164 const previouslyFocusedElement = activeElement(doc); 34165 queueMicrotask(() => { 34166 const focusableElements2 = getTabbableElements(floatingFocusElement); 34167 const initialFocusValue = initialFocusRef.current; 34168 const elToFocus = (typeof initialFocusValue === "number" ? focusableElements2[initialFocusValue] : initialFocusValue.current) || floatingFocusElement; 34169 const focusAlreadyInsideFloatingEl = contains$1(floatingFocusElement, previouslyFocusedElement); 34170 if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) { 34171 enqueueFocus(elToFocus, { 34172 preventScroll: elToFocus === floatingFocusElement 34173 }); 34174 } 34175 }); 34176 }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]); 34177 index$1(() => { 34178 if (disabled || !floatingFocusElement) return; 34179 const doc = getDocument$1(floatingFocusElement); 34180 const previouslyFocusedElement = activeElement(doc); 34181 addPreviouslyFocusedElement(previouslyFocusedElement); 34182 function onOpenChange2(_ref2) { 34183 let { 34184 reason, 34185 event, 34186 nested 34187 } = _ref2; 34188 if (["hover", "safe-polygon"].includes(reason) && event.type === "mouseleave") { 34189 preventReturnFocusRef.current = true; 34190 } 34191 if (reason !== "outside-press") return; 34192 if (nested) { 34193 preventReturnFocusRef.current = false;
34194 } else if (isVirtualClick(event) || isVirtualPointerEvent(event)) { 34195 preventReturnFocusRef.current = false; 34196 } else { 34197 let isPreventScrollSupported = false; 34198 document.createElement("div").focus({ 34199 get preventScroll() { 34200 isPreventScrollSupported = true; 34201 return false; 34202 } 34203 }); 34204 if (isPreventScrollSupported) { 34205 preventReturnFocusRef.current = false; 34206 } else { 34207 preventReturnFocusRef.current = true; 34208 } 34209 } 34210 } 34211 events.on("openchange", onOpenChange2); 34212 const fallbackEl = doc.createElement("span"); 34213 fallbackEl.setAttribute("tabindex", "-1"); 34214 fallbackEl.setAttribute("aria-hidden", "true"); 34215 Object.assign(fallbackEl.style, HIDDEN_STYLES); 34216 if (isInsidePortal && domReference) { 34217 domReference.insertAdjacentElement("afterend", fallbackEl); 34218 } 34219 function getReturnElement() { 34220 if (typeof returnFocusRef.current === "boolean") { 34221 const el = domReference || getPreviouslyFocusedElement(); 34222 return el && el.isConnected ? el : fallbackEl; 34223 } 34224 return returnFocusRef.current.current || fallbackEl; 34225 } 34226 return () => { 34227 events.off("openchange", onOpenChange2); 34228 const activeEl = activeElement(doc); 34229 const isFocusInsideFloatingTree = contains$1(floating, activeEl) || tree && getNodeChildren$1(tree.nodesRef.current, getNodeId(), false).some((node2) => { 34230 var _node$context7; 34231 return contains$1((_node$context7 = node2.context) == null ? void 0 : _node$context7.elements.floating, activeEl); 34232 }); 34233 const returnElement = getReturnElement(); 34234 queueMicrotask(() => { 34235 const tabbableReturnElement = getFirstTabbableElement(returnElement); 34236 if ( 34237 // eslint-disable-next-line react-hooks/exhaustive-deps 34238 returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && // If the focus moved somewhere else after mount, avoid returning focus 34239 // since it likely entered a different element which should be 34240 // respected: https://github.com/floating-ui/floating-ui/issues/2607 34241 (tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true) 34242 ) { 34243 tabbableReturnElement.focus({ 34244 preventScroll: true 34245 }); 34246 } 34247 fallbackEl.remove(); 34248 }); 34249 }; 34250 }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, isInsidePortal, domReference, getNodeId]); 34251 reactExports.useEffect(() => { 34252 queueMicrotask(() => { 34253 preventReturnFocusRef.current = false; 34254 }); 34255 return () => { 34256 queueMicrotask(clearDisconnectedPreviouslyFocusedElements); 34257 }; 34258 }, [disabled]); 34259 index$1(() => { 34260 if (disabled) return; 34261 if (!portalContext) return; 34262 portalContext.setFocusManagerState({ 34263 modal, 34264 closeOnFocusOut, 34265 open, 34266 onOpenChange, 34267 domReference 34268 }); 34269 return () => { 34270 portalContext.setFocusManagerState(null); 34271 }; 34272 }, [disabled, portalContext, modal, open, onOpenChange, closeOnFocusOut, domReference]); 34273 index$1(() => { 34274 if (disabled) return; 34275 if (!floatingFocusElement) return; 34276 handleTabIndex(floatingFocusElement, orderRef); 34277 }, [disabled, floatingFocusElement, orderRef]); 34278 function renderDismissButton(location) { 34279 if (disabled || !visuallyHiddenDismiss || !modal) { 34280 return null; 34281 } 34282 return /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenDismiss, { 34283 ref: location === "start" ? startDismissButtonRef : endDismissButtonRef, 34284 onClick: (event) => onOpenChange(false, event.nativeEvent), 34285 children: typeof visuallyHiddenDismiss === "string" ? visuallyHiddenDismiss : "Dismiss" 34286 }); 34287 } 34288 const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal); 34289 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
34290 children: [shouldRenderGuards && /* @__PURE__ */ jsxRuntimeExports.jsx(FocusGuard, { 34291 "data-type": "inside", 34292 ref: mergedBeforeGuardRef, 34293 onFocus: (event) => { 34294 if (modal) { 34295 const els = getTabbableElements(); 34296 enqueueFocus(order[0] === "reference" ? els[0] : els[els.length - 1]); 34297 } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) { 34298 preventReturnFocusRef.current = false; 34299 if (isOutsideEvent(event, portalContext.portalNode)) { 34300 const nextTabbable = getNextTabbable(domReference); 34301 nextTabbable == null || nextTabbable.focus(); 34302 } else { 34303 var _portalContext$before; 34304 (_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus(); 34305 } 34306 } 34307 } 34308 }), !isUntrappedTypeableCombobox && renderDismissButton("start"), children, renderDismissButton("end"), shouldRenderGuards && /* @__P
34308URE__ */ jsxRuntimeExports.jsx(FocusGuard, { 34309 "data-type": "inside", 34310 ref: mergedAfterGuardRef, 34311 onFocus: (event) => { 34312 if (modal) { 34313 enqueueFocus(getTabbableElements()[0]); 34314 } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) { 34315 if (closeOnFocusOut) { 34316 preventReturnFocusRef.current = true; 34317 } 34318 if (isOutsideEvent(event, portalContext.portalNode)) { 34319 const prevTabbable = getPreviousTabbable(domReference); 34320 prevTabbable == null || prevTabbable.focus(); 34321 } else { 34322 var _portalContext$afterO; 34323 (_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus(); 34324 } 34325 } 34326 } 34327 })] 34328 }); 34329 } 34330 const bubbleHandlerKeys = { 34331 pointerdown: "onPointerDown", 34332 mousedown: "onMouseDown", 34333 click: "onClick" 34334 }; 34335 const captureHandlerKeys = { 34336 pointerdown: "onPointerDownCapture", 34337 mousedown: "onMouseDownCapture", 34338 click: "onClickCapture" 34339 }; 34340 const normalizeProp = (normalizable) => { 34341 var _normalizable$escapeK, _normalizable$outside; 34342 return { 34343 escapeKey: typeof normalizable === "boolean" ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false, 34344 outsidePress: typeof normalizable === "boolean" ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true 34345 }; 34346 }; 34347 function useDismiss(context, props) { 34348 if (props === void 0) { 34349 props = {}; 34350 } 34351 const { 34352 open, 34353 onOpenChange, 34354 elements, 34355 dataRef 34356 } = context; 34357 const { 34358 enabled = true, 34359 escapeKey = true, 34360 outsidePress: unstable_outsidePress = true, 34361 outsidePressEvent = "pointerdown", 34362 referencePress = false, 34363 referencePressEvent = "pointerdown", 34364 ancestorScroll = false, 34365 bubbles, 34366 capture 34367 } = props; 34368 const tree = useFloatingTree(); 34369 const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === "function" ? unstable_outsidePress : () => false); 34370 const outsidePress = typeof unstable_outsidePress === "function" ? outsidePressFn : unstable_outsidePress; 34371 const endedOrStartedInsideRef = reactExports.useRef(false); 34372 const { 34373 escapeKey: escapeKeyBubbles, 34374 outsidePress: outsidePressBubbles 34375 } = normalizeProp(bubbles); 34376 const { 34377 escapeKey: escapeKeyCapture, 34378 outsidePress: outsidePressCapture 34379 } = normalizeProp(capture); 34380 const isComposingRef = reactExports.useRef(false); 34381 const closeOnEscapeKeyDown = useEffectEvent((event) => { 34382 var _dataRef$current$floa; 34383 if (!open || !enabled || !escapeKey || event.key !== "Escape") { 34384 return; 34385 } 34386 if (isComposingRef.current) { 34387 return; 34388 } 34389 const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId; 34390 const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : []; 34391 if (!escapeKeyBubbles) { 34392 event.stopPropagation(); 34393 if (children.length > 0) { 34394 let shouldDismiss = true; 34395 children.forEach((child) => { 34396 var _child$context; 34397 if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) { 34398 shouldDismiss = false; 34399 return; 34400 } 34401 }); 34402 if (!shouldDismiss) { 34403 return; 34404 } 34405 } 34406 } 34407 onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, "escape-key"); 34408 }); 34409 const closeOnEscapeKeyDownCapture = useEffectEvent((event) => { 34410 var _getTarget2; 34411 const callback = () => { 34412 var _getTarget; 34413 closeOnEscapeKeyDown(event); 34414 (_getTarget = getTarget$1(event)) == null || _getTarget.removeEventListener("keydown", callback); 34415 }; 34416 (_getTarget2 = getTarget$1(event)) == null || _getTarget2.addEventListener("keydown", callback); 34417 }); 34418 const closeOnPressOutside = useEffectEvent((event) => { 34419 var _dataRef$current$floa2; 34420 const insideReactTree = dataRef.current.insideReactTree; 34421 dataRef.current.insideReactTree = false;
34422 const endedOrStartedInside = endedOrStartedInsideRef.current; 34423 endedOrStartedInsideRef.current = false; 34424 if (outsidePressEvent === "click" && endedOrStartedInside) { 34425 return; 34426 } 34427 if (insideReactTree) { 34428 return; 34429 } 34430 if (typeof outsidePress === "function" && !outsidePress(event)) { 34431 return; 34432 } 34433 const target = getTarget$1(event); 34434 const inertSelector = "[" + createAttribute("inert") + "]"; 34435 const markers = getDocument$1(elements.floating).querySelectorAll(inertSelector); 34436 let targetRootAncestor = isElement(target) ? target : null; 34437 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 34438 const nextParent = getParentNode(targetRootAncestor); 34439 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 34440 break; 34441 } 34442 targetRootAncestor = nextParent; 34443 } 34444 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 34445 !contains$1(target, elements.floating) && // If the target root element contains none of the markers, then the 34446 // element was injected after the floating element rendered. 34447 Array.from(markers).every((marker) => !contains$1(targetRootAncestor, marker))) { 34448 return; 34449 } 34450 if (isHTMLElement(target) && floating) { 34451 const lastTraversableNode = isLastTraversableNode(target); 34452 const style = getComputedStyle$2(target); 34453 const scrollRe = /auto|scroll/; 34454 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 34455 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 34456 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 34457 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 34458 const isRTL2 = style.direction === "rtl"; 34459 const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 34460 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 34461 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 34462 return; 34463 } 34464 } 34465 const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId; 34466 const targetIsInsideChildren = tree && getNodeChildren$1(tree.nodesRef.current, nodeId).some((node2) => { 34467 var _node$context; 34468 return isEventTargetWithin(event, (_node$context = node2.context) == null ? void 0 : _node$context.elements.floating); 34469 }); 34470 if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) { 34471 return; 34472 } 34473 const children = tree ? getNodeChildren$1(tree.nodesRef.current, nodeId) : []; 34474 if (children.length > 0) { 34475 let shouldDismiss = true; 34476 children.forEach((child) => { 34477 var _child$context2; 34478 if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) { 34479 shouldDismiss = false; 34480 return; 34481 } 34482 }); 34483 if (!shouldDismiss) { 34484 return; 34485 } 34486 } 34487 onOpenChange(false, event, "outside-press"); 34488 }); 34489 const closeOnPressOutsideCapture = useEffectEvent((event) => { 34490 var _getTarget4; 34491 const callback = () => { 34492 var _getTarget3; 34493 closeOnPressOutside(event); 34494 (_getTarget3 = getTarget$1(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback); 34495 }; 34496 (_getTarget4 = getTarget$1(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback); 34497 }); 34498 reactExports.useEffect(() => { 34499 if (!open || !enabled) { 34500 return; 34501 } 34502 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 34503 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 34504 let compositionTimeout = -1; 34505 function onScroll(event) { 34506 onOpenChange(false, event, "ancestor-scroll"); 34507 } 34508 function handleCompositionStart() { 34509 window.clearTimeout(compositionTimeout); 34510 isComposingRef.current = true; 34511 } 34512 function handleCompositionEnd() { 34513 compositionTimeout = window.setTimeout( 34514 () => { 34515 isComposingRef.current = false;
34516 }, 34517 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 34518 // Only apply to WebKit for the test to remain 0ms. 34519 isWebKit() ? 5 : 0 34520 ); 34521 } 34522 const doc = getDocument$1(elements.floating); 34523 if (escapeKey) { 34524 doc.addEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture); 34525 doc.addEventListener("compositionstart", handleCompositionStart); 34526 doc.addEventListener("compositionend", handleCompositionEnd); 34527 } 34528 outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture); 34529 let ancestors = []; 34530 if (ancestorScroll) { 34531 if (isElement(elements.domReference)) { 34532 ancestors = getOverflowAncestors(elements.domReference); 34533 } 34534 if (isElement(elements.floating)) { 34535 ancestors = ancestors.concat(getOverflowAncestors(elements.floating)); 34536 } 34537 if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) { 34538 ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement)); 34539 } 34540 } 34541 ancestors = ancestors.filter((ancestor) => { 34542 var _doc$defaultView; 34543 return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport); 34544 }); 34545 ancestors.forEach((ancestor) => { 34546 ancestor.addEventListener("scroll", onScroll, { 34547 passive: true 34548 }); 34549 }); 34550 return () => { 34551 if (escapeKey) { 34552 doc.removeEventListener("keydown", escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture); 34553 doc.removeEventListener("compositionstart", handleCompositionStart); 34554 doc.removeEventListener("compositionend", handleCompositionEnd); 34555 } 34556 outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture); 34557 ancestors.forEach((ancestor) => { 34558 ancestor.removeEventListener("scroll", onScroll); 34559 }); 34560 window.clearTimeout(compositionTimeout); 34561 }; 34562 }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]); 34563 reactExports.useEffect(() => { 34564 dataRef.current.insideReactTree = false; 34565 }, [dataRef, outsidePress, outsidePressEvent]); 34566 const reference = reactExports.useMemo(() => __spreadValues({ 34567 onKeyDown: closeOnEscapeKeyDown 34568 }, referencePress && __spreadValues({ 34569 [bubbleHandlerKeys[referencePressEvent]]: (event) => { 34570 onOpenChange(false, event.nativeEvent, "reference-press"); 34571 } 34572 }, referencePressEvent !== "click" && { 34573 onClick(event) { 34574 onOpenChange(false, event.nativeEvent, "reference-press"); 34575 } 34576 })), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]); 34577 const floating = reactExports.useMemo(() => ({ 34578 onKeyDown: closeOnEscapeKeyDown, 34579 onMouseDown() { 34580 endedOrStartedInsideRef.current = true; 34581 }, 34582 onMouseUp() { 34583 endedOrStartedInsideRef.current = true; 34584 }, 34585 [captureHandlerKeys[outsidePressEvent]]: () => { 34586 dataRef.current.insideReactTree = true; 34587 } 34588 }), [closeOnEscapeKeyDown, outsidePressEvent, dataRef]); 34589 return reactExports.useMemo(() => enabled ? { 34590 reference, 34591 floating 34592 } : {}, [enabled, reference, floating]); 34593 } 34594 function useFloatingRootContext(options2) { 34595 const { 34596 open = false, 34597 onOpenChange: onOpenChangeProp, 34598 elements: elementsProp 34599 } = options2; 34600 const floatingId = useId(); 34601 const dataRef = reactExports.useRef({}); 34602 const [events] = reactExports.useState(() => createEventEmitter()); 34603 const nested = useFloatingParentNodeId() != null; 34604 const [positionReference, setPositionReference] = reactExports.useState(elementsProp.reference); 34605 const onOpenChange = useEffectEvent((open2, event, reason) => { 34606 dataRef.current.openEvent = open2 ? event : void 0; 34607 events.emit("openchange", { 34608 open: open2, 34609 event, 34610 reason, 34611 nested 34612 }); 34613 onOpenChangeProp == null || onOpenChangeProp(open2, event, reason); 34614 }); 34615 const refs = reactExports.useMemo(() => ({ 34616 setPositionReference 34617 }), []); 34618 const elements = reactExports.useMemo(() => ({ 34619 reference: positionReference || elementsProp.reference || null, 34620 floating: elementsProp.floating || null, 34621 domReference: elementsProp.reference 34622 }), [positionReference, elementsProp.reference, elementsProp.floating]); 34623 return reactExports.useMemo(() => ({ 34624 dataRef, 34625 open, 34626 onOpenChange, 34627 elements, 34628 events, 34629 floatingId, 34630 refs 34631 }), [open, onOpenChange, elements, events, floatingId, refs]); 34632 } 34633 function useFloating(options2) { 34634 if (options2 === void 0) { 34635 options2 = {}; 34636 } 34637 const { 34638 nodeId 34639 } = options2; 34640 const internalRootContext = useFloatingRootContext(__spreadProps(__spreadValues({}, options2), { 34641 elements: __spreadValues({ 34642 reference: null, 34643 floating: null 34644 }, options2.elements) 34645 })); 34646 const rootContext = options2.rootContext || internalRootContext; 34647 const computedElements = rootContext.elements; 34648 const [_domReference, setDomReference] = reactExports.useState(null); 34649 const [positionReference, _setPositionReference] = reactExports.useState(null); 34650 const optionDomReference = computedElements == null ? void 0 : computedElements.domReference; 34651 const domReference = optionDomReference || _domReference; 34652 const domReferenceRef = reactExports.useRef(null); 34653 const tree = useFloatingTree(); 34654 index$1(() => { 34655 if (domReference) { 34656 domReferenceRef.current = domReference; 34657 } 34658 }, [domReference]); 34659 const position2 = useFloating$1(__spreadProps(__spreadValues({}, options2), { 34660 elements: __spreadValues(__spreadValues({}, computedElements), positionReference && { 34661 reference: positionReference 34662 }) 34663 })); 34664 const setPositionReference = reactExports.useCallback((node2) => { 34665 const computedPositionReference = isElement(node2) ? { 34666 getBoundingClientRect: () => node2.getBoundingClientRect(), 34667 getClientRects: () => node2.getClientRects(), 34668 contextElement: node2 34669 } : node2; 34670 _setPositionReference(computedPositionReference); 34671 position2.refs.setReference(computedPositionReference); 34672 }, [position2.refs]); 34673 const setReference = reactExports.useCallback((node2) => { 34674 if (isElement(node2) || node2 === null) { 34675 domReferenceRef.current = node2; 34676 setDomReference(node2); 34677 } 34678 if (isElement(position2.refs.reference.current) || position2.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
34679 // `null` to support `positionReference` + an unstable `reference` 34680 // callback ref. 34681 node2 !== null && !isElement(node2)) { 34682 position2.refs.setReference(node2); 34683 } 34684 }, [position2.refs]); 34685 const refs = reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2.refs), { 34686 setReference, 34687 setPositionReference, 34688 domReference: domReferenceRef 34689 }), [position2.refs, setReference, setPositionReference]); 34690 const elements = reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2.elements), { 34691 domReference 34692 }), [position2.elements, domReference]); 34693 const context = reactExports.useMemo(() => __spreadProps(__spreadValues(__spreadValues({}, position2), rootContext), { 34694 refs, 34695 elements, 34696 nodeId 34697 }), [position2, refs, elements, nodeId, rootContext]); 34698 index$1(() => { 34699 rootContext.dataRef.current.floatingContext = context; 34700 const node2 = tree == null ? void 0 : tree.nodesRef.current.find((node22) => node22.id === nodeId); 34701 if (node2) { 34702 node2.context = context; 34703 } 34704 }); 34705 return reactExports.useMemo(() => __spreadProps(__spreadValues({}, position2), { 34706 context, 34707 refs, 34708 elements 34709 }), [position2, refs, elements, context]); 34710 } 34711 function isMacSafari() { 34712 return isMac() && isSafari(); 34713 } 34714 function useFocus(context, props) { 34715 if (props === void 0) { 34716 props = {}; 34717 } 34718 const { 34719 open, 34720 onOpenChange, 34721 events, 34722 dataRef, 34723 elements 34724 } = context; 34725 const { 34726 enabled = true, 34727 visibleOnly = true 34728 } = props; 34729 const blockFocusRef = reactExports.useRef(false); 34730 const timeoutRef = reactExports.useRef(-1); 34731 const keyboardModalityRef = reactExports.useRef(true); 34732 reactExports.useEffect(() => { 34733 if (!enabled) return; 34734 const win = getWindow(elements.domReference); 34735 function onBlur() { 34736 if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument$1(elements.domReference))) { 34737 blockFocusRef.current = true; 34738 } 34739 } 34740 function onKeyDown() { 34741 keyboardModalityRef.current = true; 34742 } 34743 function onPointerDown() { 34744 keyboardModalityRef.current = false; 34745 } 34746 win.addEventListener("blur", onBlur); 34747 if (isMacSafari()) { 34748 win.addEventListener("keydown", onKeyDown, true); 34749 win.addEventListener("pointerdown", onPointerDown, true); 34750 } 34751 return () => { 34752 win.removeEventListener("blur", onBlur); 34753 if (isMacSafari()) { 34754 win.removeEventListener("keydown", onKeyDown, true); 34755 win.removeEventListener("pointerdown", onPointerDown, true); 34756 } 34757 }; 34758 }, [elements.domReference, open, enabled]); 34759 reactExports.useEffect(() => { 34760 if (!enabled) return; 34761 function onOpenChange2(_ref2) { 34762 let { 34763 reason 34764 } = _ref2; 34765 if (reason === "reference-press" || reason === "escape-key") { 34766 blockFocusRef.current = true; 34767 } 34768 } 34769 events.on("openchange", onOpenChange2); 34770 return () => { 34771 events.off("openchange", onOpenChange2); 34772 }; 34773 }, [events, enabled]); 34774 reactExports.useEffect(() => { 34775 return () => { 34776 clearTimeoutIfSet(timeoutRef); 34777 }; 34778 }, []); 34779 const reference = reactExports.useMemo(() => ({ 34780 onMouseLeave() { 34781 blockFocusRef.current = false; 34782 }, 34783 onFocus(event) { 34784 if (blockFocusRef.current) return; 34785 const target = getTarget$1(event.nativeEvent); 34786 if (visibleOnly && isElement(target)) { 34787 if (isMacSafari() && !event.relatedTarget) { 34788 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 34789 return; 34790 } 34791 } else if (!matchesFocusVisible(target)) { 34792 return; 34793 } 34794 } 34795 onOpenChange(true, event.nativeEvent, "focus"); 34796 }, 34797 onBlur(event) { 34798 blockFocusRef.current = false;
34799 const relatedTarget = event.relatedTarget; 34800 const nativeEvent = event.nativeEvent; 34801 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 34802 timeoutRef.current = window.setTimeout(() => { 34803 var _dataRef$current$floa; 34804 const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document); 34805 if (!relatedTarget && activeEl === elements.domReference) return; 34806 if (contains$1((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains$1(elements.domReference, activeEl) || movedToFocusGuard) { 34807 return; 34808 } 34809 onOpenChange(false, nativeEvent, "focus"); 34810 }); 34811 } 34812 }), [dataRef, elements.domReference, onOpenChange, visibleOnly]); 34813 return reactExports.useMemo(() => enabled ? { 34814 reference 34815 } : {}, [enabled, reference]); 34816 } 34817 function mergeProps(userProps, propsList, elementKey) { 34818 const map2 = /* @__PURE__ */ new Map(); 34819 const isItem = elementKey === "item"; 34820 let domUserProps = userProps; 34821 if (isItem && userProps) { 34822 const _a = userProps, { 34823 [ACTIVE_KEY]: _2, 34824 [SELECTED_KEY]: __ 34825 } = _a, validProps = __objRest(_a, [ 34826 __restKey(ACTIVE_KEY), 34827 __restKey(SELECTED_KEY) 34828 ]); 34829 domUserProps = validProps; 34830 } 34831 return __spreadValues(__spreadValues(__spreadValues({}, elementKey === "floating" && { 34832 tabIndex: -1, 34833 [FOCUSABLE_ATTRIBUTE]: "" 34834 }), domUserProps), propsList.map((value) => { 34835 const propsOrGetProps = value ? value[elementKey] : null; 34836 if (typeof propsOrGetProps === "function") { 34837 return userProps ? propsOrGetProps(userProps) : null; 34838 } 34839 return propsOrGetProps; 34840 }).concat(userProps).reduce((acc, props) => { 34841 if (!props) { 34842 return acc; 34843 } 34844 Object.entries(props).forEach((_ref2) => { 34845 let [key, value] = _ref2; 34846 if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) { 34847 return; 34848 } 34849 if (key.indexOf("on") === 0) { 34850 if (!map2.has(key)) { 34851 map2.set(key, []); 34852 } 34853 if (typeof value === "function") { 34854 var _map$get; 34855 (_map$get = map2.get(key)) == null || _map$get.push(value); 34856 acc[key] = function() { 34857 var _map$get2; 34858 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 34859 args[_key] = arguments[_key]; 34860 } 34861 return (_map$get2 = map2.get(key)) == null ? void 0 : _map$get2.map((fn2) => fn2(...args)).find((val) => val !== void 0); 34862 }; 34863 } 34864 } else { 34865 acc[key] = value; 34866 } 34867 }); 34868 return acc; 34869 }, {})); 34870 } 34871 function useInteractions(propsList) { 34872 if (propsList === void 0) { 34873 propsList = []; 34874 } 34875 const referenceDeps = propsList.map((key) => key == null ? void 0 : key.reference); 34876 const floatingDeps = propsList.map((key) => key == null ? void 0 : key.floating); 34877 const itemDeps = propsList.map((key) => key == null ? void 0 : key.item); 34878 const getReferenceProps = reactExports.useCallback( 34879 (userProps) => mergeProps(userProps, propsList, "reference"), 34880 // eslint-disable-next-line react-hooks/exhaustive-deps 34881 referenceDeps 34882 ); 34883 const getFloatingProps = reactExports.useCallback( 34884 (userProps) => mergeProps(userProps, propsList, "floating"), 34885 // eslint-disable-next-line react-hooks/exhaustive-deps 34886 floatingDeps 34887 ); 34888 const getItemProps = reactExports.useCallback( 34889 (userProps) => mergeProps(userProps, propsList, "item"), 34890 // eslint-disable-next-line react-hooks/exhaustive-deps 34891 itemDeps 34892 ); 34893 return reactExports.useMemo(() => ({ 34894 getReferenceProps, 34895 getFloatingProps, 34896 getItemProps 34897 }), [getReferenceProps, getFloatingProps, getItemProps]); 34898 } 34899 const componentRoleToAriaRoleMap = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", false]]); 34900 function useRole(context, props) { 34901 var _elements$domReferenc, _componentRoleToAriaR; 34902 if (props === void 0) { 34903 props = {}; 34904 } 34905 const { 34906 open, 34907 elements, 34908 floatingId: defaultFloatingId 34909 } = context; 34910 const { 34911 enabled = true, 34912 role = "dialog" 34913 } = props; 34914 const defaultReferenceId = useId(); 34915 const referenceId = ((_elements$domReferenc = elements.domReference) == null ? void 0 : _elements$domReferenc.id) || defaultReferenceId; 34916 const floatingId = reactExports.useMemo(() => { 34917 var _getFloatingFocusElem; 34918 return ((_getFloatingFocusElem = getFloatingFocusElement(elements.floating)) == null ? void 0 : _getFloatingFocusElem.id) || defaultFloatingId; 34919 }, [elements.floating, defaultFloatingId]); 34920 const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role; 34921 const parentId = useFloatingParentNodeId(); 34922 const isNested = parentId != null; 34923 const reference = reactExports.useMemo(() => { 34924 if (ariaRole === "tooltip" || role === "label") { 34925 return { 34926 ["aria-" + (role === "label" ? "labelledby" : "describedby")]: open ? floatingId : void 0 34927 }; 34928 } 34929 return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({ 34930 "aria-expanded": open ? "true" : "false", 34931 "aria-haspopup": ariaRole === "alertdialog" ? "dialog" : ariaRole, 34932 "aria-controls": open ? floatingId : void 0 34933 }, ariaRole === "listbox" && { 34934 role: "combobox" 34935 }), ariaRole === "menu" && { 34936 id: referenceId 34937 }), ariaRole === "menu" && isNested && { 34938 role: "menuitem" 34939 }), role === "select" && { 34940 "aria-autocomplete": "none" 34941 }), role === "combobox" && { 34942 "aria-autocomplete": "list" 34943 }); 34944 }, [ariaRole, floatingId, isNested, open, referenceId, role]); 34945 const floating = reactExports.useMemo(() => { 34946 const floatingProps = __spreadValues({ 34947 id: floatingId 34948 }, ariaRole && { 34949 role: ariaRole 34950 }); 34951 if (ariaRole === "tooltip" || role === "label") { 34952 return floatingProps; 34953 } 34954 return __spreadValues(__spreadValues({}, floatingProps), ariaRole === "menu" && { 34955 "aria-labelledby": referenceId 34956 }); 34957 }, [ariaRole, floatingId, referenceId, role]); 34958 const item = reactExports.useCallback((_ref2) => { 34959 let { 34960 active, 34961 selected 34962 } = _ref2; 34963 const commonProps = __spreadValues({ 34964 role: "option" 34965 }, active && { 34966 id: floatingId + "-fui-option" 34967 }); 34968 switch (role) { 34969 case "select": 34970 case "combobox": 34971 return __spreadProps(__spreadValues({}, commonProps), { 34972 "aria-selected": selected 34973 }); 34974 } 34975 return {}; 34976 }, [floatingId, role]); 34977 return reactExports.useMemo(() => enabled ? { 34978 reference, 34979 floating, 34980 item 34981 } : {}, [enabled, reference, floating, item]); 34982 } 34983 const camelCaseToKebabCase = (str) => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($2, ofs) => (ofs ? "-" : "") + $2.toLowerCase()); 34984 function execWithArgsOrReturn(valueOrFn, args) { 34985 return typeof valueOrFn === "function" ? valueOrFn(args) : valueOrFn; 34986 } 34987 function useDelayUnmount(open, durationMs) { 34988 const [isMounted, setIsMounted] = reactExports.useState(open); 34989 if (open && !isMounted) { 34990 setIsMounted(true); 34991 } 34992 reactExports.useEffect(() => { 34993 if (!open && isMounted) { 34994 const timeout = setTimeout(() => setIsMounted(false), durationMs); 34995 return () => clearTimeout(timeout); 34996 } 34997 }, [open, isMounted, durationMs]); 34998 return isMounted; 34999 } 35000 function useTransitionStatus(context, props) { 35001 if (props === void 0) { 35002 props = {}; 35003 } 35004 const { 35005 open, 35006 elements: { 35007 floating 35008 } 35009 } = context; 35010 const { 35011 duration = 250 35012 } = props; 35013 const isNumberDuration = typeof duration === "number"; 35014 const closeDuration = (isNumberDuration ? duration : duration.close) || 0; 35015 const [status, setStatus] = reactExports.useState("unmounted"); 35016 const isMounted = useDelayUnmount(open, closeDuration); 35017 if (!isMounted && status === "close") { 35018 setStatus("unmounted"); 35019 } 35020 index$1(() => { 35021 if (!floating) return; 35022 if (open) { 35023 setStatus("initial"); 35024 const frame2 = requestAnimationFrame(() => { 35025 reactDomExports.flushSync(() => { 35026 setStatus("open"); 35027 }); 35028 }); 35029 return () => { 35030 cancelAnimationFrame(frame2); 35031 }; 35032 } 35033 setStatus("close"); 35034 }, [open, floating]); 35035 return { 35036 isMounted, 35037 status 35038 }; 35039 } 35040 function useTransitionStyles(context, props) { 35041 if (props === void 0) { 35042 props = {}; 35043 } 35044 const { 35045 initial: unstable_initial = { 35046 opacity: 0 35047 }, 35048 open: unstable_open, 35049 close: unstable_close, 35050 common: unstable_common, 35051 duration = 250 35052 } = props; 35053 const placement = context.placement; 35054 const side = placement.split("-")[0]; 35055 const fnArgs = reactExports.useMemo(() => ({ 35056 side, 35057 placement 35058 }), [side, placement]); 35059 const isNumberDuration = typeof duration === "number"; 35060 const openDuration = (isNumberDuration ? duration : duration.open) || 0; 35061 const closeDuration = (isNumberDuration ? duration : duration.close) || 0; 35062 const [styles, setStyles] = reactExports.useState(() => __spreadValues(__spreadValues({}, execWithArgsOrReturn(unstable_common, fnArgs)), execWithArgsOrReturn(unstable_initial, fnArgs))); 35063 const { 35064 isMounted, 35065 status 35066 } = useTransitionStatus(context, { 35067 duration 35068 }); 35069 const initialRef = useLatestRef$1(unstable_initial); 35070 const openRef = useLatestRef$1(unstable_open); 35071 const closeRef = useLatestRef$1(unstable_close); 35072 const commonRef = useLatestRef$1(unstable_common); 35073 index$1(() => { 35074 const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs); 35075 const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs); 35076 const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs); 35077 const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => { 35078 acc[key] = ""; 35079 return acc; 35080 }, {}); 35081 if (status === "initial") { 35082 setStyles((styles2) => __spreadValues(__spreadValues({ 35083 transitionProperty: styles2.transitionProperty 35084 }, commonStyles), initialStyles)); 35085 } 35086 if (status === "open") { 35087 setStyles(__spreadValues(__spreadValues({ 35088 transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(","), 35089 transitionDuration: openDuration + "ms"
35090 }, commonStyles), openStyles)); 35091 } 35092 if (status === "close") { 35093 const styles2 = closeStyles || initialStyles; 35094 setStyles(__spreadValues(__spreadValues({ 35095 transitionProperty: Object.keys(styles2).map(camelCaseToKebabCase).join(","), 35096 transitionDuration: closeDuration + "ms" 35097 }, commonStyles), styles2)); 35098 } 35099 }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]); 35100 return { 35101 isMounted, 35102 styles 35103 }; 35104 } 35105 function getNodeChildren(nodes, id2, onlyOpenChildren) { 35106 if (onlyOpenChildren === void 0) { 35107 onlyOpenChildren = true; 35108 } 35109 const directChildren = nodes.filter((node2) => { 35110 var _node$context; 35111 return node2.parentId === id2 && (!onlyOpenChildren || ((_node$context = node2.context) == null ? void 0 : _node$context.open)); 35112 }); 35113 return directChildren.flatMap((child) => [child, ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 35114 } 35115 function isPointInPolygon(point, polygon) { 35116 const [x2, y2] = point; 35117 let isInside2 = false; 35118 const length2 = polygon.length; 35119 for (let i2 = 0, j2 = length2 - 1; i2 < length2; j2 = i2++) { 35120 const [xi2, yi2] = polygon[i2] || [0, 0]; 35121 const [xj, yj] = polygon[j2] || [0, 0]; 35122 const intersect = yi2 >= y2 !== yj >= y2 && x2 <= (xj - xi2) * (y2 - yi2) / (yj - yi2) + xi2; 35123 if (intersect) { 35124 isInside2 = !isInside2; 35125 } 35126 } 35127 return isInside2; 35128 } 35129 function isInside(point, rect) { 35130 return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height; 35131 } 35132 function safePolygon(options2) { 35133 if (options2 === void 0) { 35134 options2 = {}; 35135 } 35136 const { 35137 buffer = 0.5, 35138 blockPointerEvents = false, 35139 requireIntent = true 35140 } = options2; 35141 const timeoutRef = { 35142 current: -1 35143 }; 35144 let hasLanded = false; 35145 let lastX = null; 35146 let lastY = null; 35147 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 35148 function getCursorSpeed(x2, y2) { 35149 const currentTime = performance.now(); 35150 const elapsedTime = currentTime - lastCursorTime; 35151 if (lastX === null || lastY === null || elapsedTime === 0) { 35152 lastX = x2; 35153 lastY = y2; 35154 lastCursorTime = currentTime; 35155 return null; 35156 } 35157 const deltaX = x2 - lastX; 35158 const deltaY = y2 - lastY; 35159 const distance2 = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 35160 const speed = distance2 / elapsedTime; 35161 lastX = x2; 35162 lastY = y2; 35163 lastCursorTime = currentTime; 35164 return speed; 35165 } 35166 const fn2 = (_ref2) => { 35167 let { 35168 x: x2, 35169 y: y2, 35170 placement, 35171 elements, 35172 onClose, 35173 nodeId, 35174 tree 35175 } = _ref2; 35176 return function onMouseMove(event) { 35177 function close() { 35178 clearTimeoutIfSet(timeoutRef); 35179 onClose(); 35180 } 35181 clearTimeoutIfSet(timeoutRef); 35182 if (!elements.domReference || !elements.floating || placement == null || x2 == null || y2 == null) { 35183 return; 35184 } 35185 const { 35186 clientX, 35187 clientY 35188 } = event; 35189 const clientPoint = [clientX, clientY]; 35190 const target = getTarget(event); 35191 const isLeave = event.type === "mouseleave"; 35192 const isOverFloatingEl = contains(elements.floating, target); 35193 const isOverReferenceEl = contains(elements.domReference, target); 35194 const refRect = elements.domReference.getBoundingClientRect(); 35195 const rect = elements.floating.getBoundingClientRect(); 35196 const side = placement.split("-")[0]; 35197 const cursorLeaveFromRight = x2 > rect.right - rect.width / 2; 35198 const cursorLeaveFromBottom = y2 > rect.bottom - rect.height / 2; 35199 const isOverReferenceRect = isInside(clientPoint, refRect); 35200 const isFloatingWider = rect.width > refRect.width; 35201 const isFloatingTaller = rect.height > refRect.height; 35202 const left = (isFloatingWider ? refRect : rect).left; 35203 const right = (isFloatingWider ? refRect : rect).right; 35204 const top = (isFloatingTaller ? refRect : rect).top; 35205 const bottom = (isFloatingTaller ? refRect : rect).bottom; 35206 if (isOverFloatingEl) { 35207 hasLanded = true; 35208 if (!isLeave) { 35209 return; 35210 } 35211 } 35212 if (isOverReferenceEl) { 35213 hasLanded = false;
35214 } 35215 if (isOverReferenceEl && !isLeave) { 35216 hasLanded = true; 35217 return; 35218 } 35219 if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) { 35220 return; 35221 } 35222 if (tree && getNodeChildren(tree.nodesRef.current, nodeId).length) { 35223 return; 35224 } 35225 if (side === "top" && y2 >= refRect.bottom - 1 || side === "bottom" && y2 <= refRect.top + 1 || side === "left" && x2 >= refRect.right - 1 || side === "right" && x2 <= refRect.left + 1) { 35226 return close(); 35227 } 35228 let rectPoly = []; 35229 switch (side) { 35230 case "top": 35231 rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]]; 35232 break; 35233 case "bottom": 35234 rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]]; 35235 break; 35236 case "left": 35237 rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]]; 35238 break; 35239 case "right": 35240 rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]]; 35241 break; 35242 } 35243 function getPolygon(_ref22) { 35244 let [x22, y22] = _ref22; 35245 switch (side) { 35246 case "top": { 35247 const cursorPointOne = [isFloatingWider ? x22 + buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 + buffer + 1]; 35248 const cursorPointTwo = [isFloatingWider ? x22 - buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 + buffer + 1]; 35249 const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]]; 35250 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35251 } 35252 case "bottom": { 35253 const cursorPointOne = [isFloatingWider ? x22 + buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 - buffer]; 35254 const cursorPointTwo = [isFloatingWider ? x22 - buffer / 2 : cursorLeaveFromRight ? x22 + buffer * 4 : x22 - buffer * 4, y22 - buffer]; 35255 const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]]; 35256 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35257 } 35258 case "left": { 35259 const cursorPointOne = [x22 + buffer + 1, isFloatingTaller ? y22 + buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35260 const cursorPointTwo = [x22 + buffer + 1, isFloatingTaller ? y22 - buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35261 const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]]; 35262 return [...commonPoints, cursorPointOne, cursorPointTwo]; 35263 } 35264 case "right": { 35265 const cursorPointOne = [x22 - buffer, isFloatingTaller ? y22 + buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35266 const cursorPointTwo = [x22 - buffer, isFloatingTaller ? y22 - buffer / 2 : cursorLeaveFromBottom ? y22 + buffer * 4 : y22 - buffer * 4]; 35267 const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]]; 35268 return [cursorPointOne, cursorPointTwo, ...commonPoints]; 35269 } 35270 } 35271 } 35272 if (isPointInPolygon([clientX, clientY], rectPoly)) { 35273 return; 35274 } 35275 if (hasLanded && !isOverReferenceRect) { 35276 return close(); 35277 } 35278 if (!isLeave && requireIntent) { 35279 const cursorSpeed = getCursorSpeed(event.clientX, event.clientY); 35280 const cursorSpeedThreshold = 0.1;
35281 if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) { 35282 return close(); 35283 } 35284 } 35285 if (!isPointInPolygon([clientX, clientY], getPolygon([x2, y2]))) { 35286 close(); 35287 } else if (!hasLanded && requireIntent) { 35288 timeoutRef.current = window.setTimeout(close, 40); 35289 } 35290 }; 35291 }; 35292 fn2.__options = { 35293 blockPointerEvents 35294 }; 35295 return fn2; 35296 } 35297 var lib$1 = {}; 35298 var useMedia = {}; 35299 var utilities = {}; 35300 var camelToHyphen = {}; 35301 var hasRequiredCamelToHyphen; 35302 function requireCamelToHyphen() { 35303 if (hasRequiredCamelToHyphen) return camelToHyphen; 35304 hasRequiredCamelToHyphen = 1; 35305 Object.defineProperty(camelToHyphen, "__esModule", { value: true }); 35306 function camelToHyphen$1(camelString) { 35307 return camelString.replace(/[A-Z]/g, function(string2) { 35308 return "-" + string2.toLowerCase(); 35309 }).toLowerCase(); 35310 } 35311 camelToHyphen.default = camelToHyphen$1; 35312 return camelToHyphen; 35313 } 35314 var queryObjectToString = {}; 35315 var hasRequiredQueryObjectToString; 35316 function requireQueryObjectToString() { 35317 if (hasRequiredQueryObjectToString) return queryObjectToString; 35318 hasRequiredQueryObjectToString = 1; 35319 Object.defineProperty(queryObjectToString, "__esModule", { value: true }); 35320 var camelToHyphen_1 = requireCamelToHyphen(); 35321 var QUERY_COMBINATOR = " and "; 35322 function queryObjectToString$1(query) { 35323 if (typeof query === "string") { 35324 return query; 35325 } 35326 return Object.entries(query).map(function(_a) { 35327 var feature = _a[0], value = _a[1]; 35328 var convertedFeature = camelToHyphen_1.default(feature); 35329 var convertedValue = value; 35330 if (typeof convertedValue === "boolean") { 35331 return convertedValue ? convertedFeature : "not " + convertedFeature; 35332 } 35333 if (typeof convertedValue === "number" && /[height|width]$/.test(convertedFeature)) { 35334 convertedValue = convertedValue + "px"; 35335 } 35336 return "(" + convertedFeature + ": " + convertedValue + ")"; 35337 }).join(QUERY_COMBINATOR); 35338 } 35339 queryObjectToString.default = queryObjectToString$1; 35340 return queryObjectToString; 35341 } 35342 var noop$4 = {}; 35343 var hasRequiredNoop; 35344 function requireNoop() { 35345 if (hasRequiredNoop) return noop$4; 35346 hasRequiredNoop = 1; 35347 Object.defineProperty(noop$4, "__esModule", { value: true }); 35348 function noop2() { 35349 } 35350 noop$4.default = noop2; 35351 return noop$4; 35352 } 35353 var hasRequiredUtilities; 35354 function requireUtilities() { 35355 if (hasRequiredUtilities) return utilities; 35356 hasRequiredUtilities = 1; 35357 (function(exports$1) { 35358 Object.defineProperty(exports$1, "__esModule", { value: true }); 35359 exports$1.noop = exports$1.queryObjectToString = exports$1.camelToHyphen = void 0; 35360 var camelToHyphen_1 = requireCamelToHyphen(); 35361 Object.defineProperty(exports$1, "camelToHyphen", { enumerable: true, get: function() { 35362 return camelToHyphen_1.default; 35363 } }); 35364 var queryObjectToString_1 = requireQueryObjectToString(); 35365 Object.defineProperty(exports$1, "queryObjectToString", { enumerable: true, get: function() { 35366 return queryObjectToString_1.default; 35367 } }); 35368 var noop_1 = requireNoop(); 35369 Object.defineProperty(exports$1, "noop", { enumerable: true, get: function() { 35370 return noop_1.default; 35371 } }); 35372 })(utilities); 35373 return utilities; 35374 } 35375 var hasRequiredUseMedia; 35376 function requireUseMedia() { 35377 if (hasRequiredUseMedia) return useMedia; 35378 hasRequiredUseMedia = 1; 35379 (function(exports$1) { 35380 Object.defineProperty(exports$1, "__esModule", { value: true }); 35381 exports$1.useMediaLayout = exports$1.useMedia = exports$1.mockMediaQueryList = void 0; 35382 var react_1 = requireReact(); 35383 var utilities_1 = requireUtilities(); 35384 exports$1.mockMediaQueryList = { 35385 media: "", 35386 matches: false, 35387 onchange: utilities_1.noop, 35388 addListener: utilities_1.noop, 35389 removeListener: utilities_1.noop, 35390 addEventListener: utilities_1.noop, 35391 removeEventListener: utilities_1.noop, 35392 dispatchEvent: function(_2) { 35393 return true; 35394 } 35395 }; 35396 var createUseMedia = function(effect) { 35397 return function(rawQuery, defaultState) { 35398 if (defaultState === void 0) { 35399 defaultState = false;
35400 } 35401 var _a = react_1.useState(defaultState), state = _a[0], setState = _a[1]; 35402 var query = utilities_1.queryObjectToString(rawQuery); 35403 effect(function() { 35404 var mounted = true; 35405 var mediaQueryList = typeof window === "undefined" ? exports$1.mockMediaQueryList : window.matchMedia(query); 35406 var onChange = function() { 35407 if (!mounted) { 35408 return; 35409 } 35410 setState(Boolean(mediaQueryList.matches)); 35411 }; 35412 mediaQueryList.addListener(onChange); 35413 setState(mediaQueryList.matches); 35414 return function() { 35415 mounted = false; 35416 mediaQueryList.removeListener(onChange); 35417 }; 35418 }, [query]); 35419 return state; 35420 }; 35421 }; 35422 exports$1.useMedia = createUseMedia(react_1.useEffect); 35423 exports$1.useMediaLayout = createUseMedia(react_1.useLayoutEffect); 35424 exports$1.default = exports$1.useMedia; 35425 })(useMedia); 35426 return useMedia; 35427 } 35428 var hasRequiredLib$1; 35429 function requireLib$1() { 35430 if (hasRequiredLib$1) return lib$1; 35431 hasRequiredLib$1 = 1; 35432 (function(exports$1) { 35433 Object.defineProperty(exports$1, "__esModule", { value: true }); 35434 exports$1.useMediaLayout = exports$1.useMedia = exports$1.default = void 0; 35435 var useMedia_1 = requireUseMedia(); 35436 Object.defineProperty(exports$1, "default", { enumerable: true, get: function() { 35437 return useMedia_1.default; 35438 } }); 35439 Object.defineProperty(exports$1, "useMedia", { enumerable: true, get: function() { 35440 return useMedia_1.useMedia; 35441 } }); 35442 Object.defineProperty(exports$1, "useMediaLayout", { enumerable: true, get: function() { 35443 return useMedia_1.useMediaLayout; 35444 } }); 35445 })(lib$1); 35446 return lib$1; 35447 } 35448 var libExports$1 = requireLib$1(); 35449 const initialValue = { 35450 mobileM: false, 35451 tablet: false, 35452 laptopS: false, 35453 laptop: false, 35454 desktop: false, 35455 breakpoints, 35456 currentBreakpoint: "mobileM" 35457 }; 35458 const MediaQueryContext = reactExports.createContext(initialValue); 35459 const MediaQueryProvider = ({ children }) => { 35460 const mobileM = libExports$1.useMedia(mediaQueriesExpressions.mobileM); 35461 const tablet = libExports$1.useMedia(mediaQueriesExpressions.tablet); 35462 const laptopS = libExports$1.useMedia(mediaQueriesExpressions.laptopS); 35463 const laptop = libExports$1.useMedia(mediaQueriesExpressions.laptop); 35464 const desktop = libExports$1.useMedia(mediaQueriesExpressions.desktop); 35465 const currentBreakpoint = reactExports.useMemo(() => { 35466 if (desktop) { 35467 return "desktop"; 35468 } 35469 if (laptop) { 35470 return "laptop"; 35471 } 35472 if (laptopS) { 35473 return "laptopS"; 35474 } 35475 if (tablet) { 35476 return "tablet"; 35477 } 35478 if (mobileM) { 35479 return "mobileM"; 35480 } 35481 return "mobileM"; 35482 }, [desktop, laptop, laptopS, mobileM, tablet]); 35483 const value = reactExports.useMemo( 35484 () => ({ 35485 mobileM, 35486 tablet, 35487 laptopS, 35488 laptop, 35489 desktop, 35490 breakpoints, 35491 currentBreakpoint 35492 }), 35493 [mobileM, tablet, laptopS, laptop, desktop, currentBreakpoint] 35494 ); 35495 return /* @__PURE__ */ jsxRuntimeExports.jsx(MediaQueryContext.Provider, { value, children }); 35496 }; 35497 const useMediaQueryContext = () => { 35498 return reactExports.useContext(MediaQueryContext); 35499 }; 35500 const SPRING = { type: "spring", stiffness: 400, damping: 40 }; 35501 const BACKDROP_OPACITY = 0.8; 35502 const OVERLAY_Z_INDEX = 100; 35503 const LayoutGroupContext = reactExports.createContext({}); 35504 function useConstant(init2) { 35505 const ref = reactExports.useRef(null); 35506 if (ref.current === null) { 35507 ref.current = init2(); 35508 } 35509 return ref.current; 35510 } 35511 const PresenceContext = reactExports.createContext(null); 35512 const MotionConfigContext = reactExports.createContext({ 35513 transformPagePoint: (p2) => p2, 35514 isStatic: false,
35515 reducedMotion: "never" 35516 }); 35517 class PopChildMeasure extends reactExports.Component { 35518 getSnapshotBeforeUpdate(prevProps) { 35519 const element = this.props.childRef.current; 35520 if (element && prevProps.isPresent && !this.props.isPresent) { 35521 const size = this.props.sizeRef.current; 35522 size.height = element.offsetHeight || 0; 35523 size.width = element.offsetWidth || 0; 35524 size.top = element.offsetTop; 35525 size.left = element.offsetLeft; 35526 } 35527 return null; 35528 } 35529 /** 35530 * Required with getSnapshotBeforeUpdate to stop React complaining. 35531 */ 35532 componentDidUpdate() { 35533 } 35534 render() { 35535 return this.props.children; 35536 } 35537 } 35538 function PopChild({ children, isPresent }) { 35539 const id2 = reactExports.useId(); 35540 const ref = reactExports.useRef(null); 35541 const size = reactExports.useRef({ 35542 width: 0, 35543 height: 0, 35544 top: 0, 35545 left: 0 35546 }); 35547 const { nonce } = reactExports.useContext(MotionConfigContext); 35548 reactExports.useInsertionEffect(() => { 35549 const { width, height, top, left } = size.current; 35550 if (isPresent || !ref.current || !width || !height) 35551 return; 35552 ref.current.dataset.motionPopId = id2; 35553 const style = document.createElement("style"); 35554 if (nonce) 35555 style.nonce = nonce; 35556 document.head.appendChild(style); 35557 if (style.sheet) { 35558 style.sheet.insertRule(` 35559 [data-motion-pop-id="${id2}"] { 35560 position: absolute !important; 35561 width: ${width}px !important; 35562 height: ${height}px !important; 35563 top: ${top}px !important; 35564 left: ${left}px !important; 35565 } 35566 `); 35567 } 35568 return () => { 35569 document.head.removeChild(style); 35570 }; 35571 }, [isPresent]); 35572 return jsxRuntimeExports.jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: reactExports.cloneElement(children, { ref }) }); 35573 } 35574 const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode }) => { 35575 const presenceChildren = useConstant(newChildrenMap); 35576 const id2 = reactExports.useId(); 35577 const memoizedOnExitComplete = reactExports.useCallback((childId) => { 35578 presenceChildren.set(childId, true); 35579 for (const isComplete of presenceChildren.values()) { 35580 if (!isComplete) 35581 return; 35582 } 35583 onExitComplete && onExitComplete(); 35584 }, [presenceChildren, onExitComplete]); 35585 const context = reactExports.useMemo( 35586 () => ({ 35587 id: id2, 35588 initial, 35589 isPresent, 35590 custom, 35591 onExitComplete: memoizedOnExitComplete, 35592 register: (childId) => { 35593 presenceChildren.set(childId, false); 35594 return () => presenceChildren.delete(childId); 35595 } 35596 }), 35597 /** 35598 * If the presence of a child affects the layout of the components around it, 35599 * we want to make a new context value to ensure they get re-rendered 35600 * so they can detect that layout change. 35601 */ 35602 presenceAffectsLayout ? [Math.random(), memoizedOnExitComplete] : [isPresent, memoizedOnExitComplete] 35603 ); 35604 reactExports.useMemo(() => { 35605 presenceChildren.forEach((_2, key) => presenceChildren.set(key, false)); 35606 }, [isPresent]); 35607 reactExports.useEffect(() => { 35608 !isPresent && !presenceChildren.size && onExitComplete && onExitComplete(); 35609 }, [isPresent]); 35610 if (mode === "popLayout") { 35611 children = jsxRuntimeExports.jsx(PopChild, { isPresent, children }); 35612 } 35613 return jsxRuntimeExports.jsx(PresenceContext.Provider, { value: context, children }); 35614 }; 35615 function newChildrenMap() { 35616 return /* @__PURE__ */ new Map(); 35617 } 35618 function usePresence(subscribe = true) { 35619 const context = reactExports.useContext(PresenceContext); 35620 if (context === null) 35621 return [true, null]; 35622 const { isPresent, onExitComplete, register } = context; 35623 const id2 = reactExports.useId(); 35624 reactExports.useEffect(() => { 35625 if (subscribe) 35626 register(id2); 35627 }, [subscribe]); 35628 const safeToRemove = reactExports.useCallback(() => subscribe && onExitComplete && onExitComplete(id2), [id2, onExitComplete, subscribe]); 35629 return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; 35630 } 35631 const getChildKey = (child) => child.key || ""; 35632 function onlyElements(children) { 35633 const filtered = [];
35634 reactExports.Children.forEach(children, (child) => { 35635 if (reactExports.isValidElement(child)) 35636 filtered.push(child); 35637 }); 35638 return filtered; 35639 } 35640 const isBrowser = typeof window !== "undefined"; 35641 const useIsomorphicLayoutEffect$2 = isBrowser ? reactExports.useLayoutEffect : reactExports.useEffect; 35642 const AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = "sync", propagate = false }) => { 35643 const [isParentPresent, safeToRemove] = usePresence(propagate); 35644 const presentChildren = reactExports.useMemo(() => onlyElements(children), [children]); 35645 const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey); 35646 const isInitialRender = reactExports.useRef(true); 35647 const pendingPresentChildren = reactExports.useRef(presentChildren); 35648 const exitComplete = useConstant(() => /* @__PURE__ */ new Map()); 35649 const [diffedChildren, setDiffedChildren] = reactExports.useState(presentChildren); 35650 const [renderedChildren, setRenderedChildren] = reactExports.useState(presentChildren); 35651 useIsomorphicLayoutEffect$2(() => { 35652 isInitialRender.current = false; 35653 pendingPresentChildren.current = presentChildren; 35654 for (let i2 = 0; i2 < renderedChildren.length; i2++) { 35655 const key = getChildKey(renderedChildren[i2]); 35656 if (!presentKeys.includes(key)) { 35657 if (exitComplete.get(key) !== true) { 35658 exitComplete.set(key, false); 35659 } 35660 } else { 35661 exitComplete.delete(key); 35662 } 35663 } 35664 }, [renderedChildren, presentKeys.length, presentKeys.join("-")]); 35665 const exitingChildren = []; 35666 if (presentChildren !== diffedChildren) { 35667 let nextChildren = [...presentChildren]; 35668 for (let i2 = 0; i2 < renderedChildren.length; i2++) { 35669 const child = renderedChildren[i2]; 35670 const key = getChildKey(child); 35671 if (!presentKeys.includes(key)) { 35672 nextChildren.splice(i2, 0, child); 35673 exitingChildren.push(child); 35674 } 35675 } 35676 if (mode === "wait" && exitingChildren.length) { 35677 nextChildren = exitingChildren; 35678 } 35679 setRenderedChildren(onlyElements(nextChildren)); 35680 setDiffedChildren(presentChildren); 35681 return; 35682 } 35683 const { forceRender } = reactExports.useContext(LayoutGroupContext); 35684 return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: renderedChildren.map((child) => { 35685 const key = getChildKey(child); 35686 const isPresent = propagate && !isParentPresent ? false : presentChildren === renderedChildren || presentKeys.includes(key); 35687 const onExit = () => { 35688 if (exitComplete.has(key)) { 35689 exitComplete.set(key, true); 35690 } else { 35691 return; 35692 } 35693 let isEveryExitComplete = true; 35694 exitComplete.forEach((isExitComplete) => { 35695 if (!isExitComplete) 35696 isEveryExitComplete = false; 35697 }); 35698 if (isEveryExitComplete) { 35699 forceRender === null || forceRender === void 0 ? void 0 : forceRender(); 35700 setRenderedChildren(pendingPresentChildren.current); 35701 propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove()); 35702 onExitComplete && onExitComplete(); 35703 } 35704 }; 35705 return jsxRuntimeExports.jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : false, custom: isPresent ? void 0 : custom, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key); 35706 }) }); 35707 }; 35708 const noop$3 = /* @__NO_SIDE_EFFECTS__ */ (any) => any; 35709 let invariant = noop$3; 35710 // @__NO_SIDE_EFFECTS__ 35711 function memo(callback) { 35712 let result; 35713 return () => { 35714 if (result === void 0) 35715 result = callback(); 35716 return result; 35717 }; 35718 } 35719 const progress = /* @__NO_SIDE_EFFECTS__ */ (from2, to2, value) => { 35720 const toFromDifference = to2 - from2; 35721 return toFromDifference === 0 ? 1 : (value - from2) / toFromDifference; 35722 }; 35723 const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3; 35724 const millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3; 35725 const MotionGlobalConfig = { 35726 useManualTiming: false 35727 }; 35728 function createRenderStep(runNextFrame) { 35729 let thisFrame = /* @__PURE__ */ new Set(); 35730 let nextFrame = /* @__PURE__ */ new Set(); 35731 let isProcessing = false;
35732 let flushNextFrame = false; 35733 const toKeepAlive = /* @__PURE__ */ new WeakSet(); 35734 let latestFrameData = { 35735 delta: 0, 35736 timestamp: 0, 35737 isProcessing: false 35738 }; 35739 function triggerCallback(callback) { 35740 if (toKeepAlive.has(callback)) { 35741 step.schedule(callback); 35742 runNextFrame(); 35743 } 35744 callback(latestFrameData); 35745 } 35746 const step = { 35747 /** 35748 * Schedule a process to run on the next frame. 35749 */ 35750 schedule: (callback, keepAlive = false, immediate = false) => { 35751 const addToCurrentFrame = immediate && isProcessing; 35752 const queue = addToCurrentFrame ? thisFrame : nextFrame; 35753 if (keepAlive) 35754 toKeepAlive.add(callback); 35755 if (!queue.has(callback)) 35756 queue.add(callback); 35757 return callback; 35758 }, 35759 /** 35760 * Cancel the provided callback from running on the next frame. 35761 */ 35762 cancel: (callback) => { 35763 nextFrame.delete(callback); 35764 toKeepAlive.delete(callback); 35765 }, 35766 /** 35767 * Execute all schedule callbacks. 35768 */ 35769 process: (frameData2) => { 35770 latestFrameData = frameData2; 35771 if (isProcessing) { 35772 flushNextFrame = true; 35773 return; 35774 } 35775 isProcessing = true; 35776 [thisFrame, nextFrame] = [nextFrame, thisFrame]; 35777 thisFrame.forEach(triggerCallback); 35778 thisFrame.clear(); 35779 isProcessing = false; 35780 if (flushNextFrame) { 35781 flushNextFrame = false; 35782 step.process(frameData2); 35783 } 35784 } 35785 }; 35786 return step; 35787 } 35788 const stepsOrder = [ 35789 "read", 35790 // Read 35791 "resolveKeyframes", 35792 // Write/Read/Write/Read 35793 "update", 35794 // Compute 35795 "preRender", 35796 // Compute 35797 "render", 35798 // Write 35799 "postRender" 35800 // Compute 35801 ]; 35802 const maxElapsed = 40; 35803 function createRenderBatcher(scheduleNextBatch, allowKeepAlive) { 35804 let runNextFrame = false; 35805 let useDefaultElapsed = true; 35806 const state = { 35807 delta: 0, 35808 timestamp: 0, 35809 isProcessing: false 35810 }; 35811 const flagRunNextFrame = () => runNextFrame = true; 35812 const steps = stepsOrder.reduce((acc, key) => { 35813 acc[key] = createRenderStep(flagRunNextFrame); 35814 return acc; 35815 }, {}); 35816 const { read, resolveKeyframes, update: update2, preRender, render, postRender } = steps; 35817 const processBatch = () => { 35818 const timestamp = performance.now(); 35819 runNextFrame = false; 35820 state.delta = useDefaultElapsed ? 1e3 / 60 : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1); 35821 state.timestamp = timestamp; 35822 state.isProcessing = true; 35823 read.process(state); 35824 resolveKeyframes.process(state); 35825 update2.process(state); 35826 preRender.process(state); 35827 render.process(state); 35828 postRender.process(state); 35829 state.isProcessing = false; 35830 if (runNextFrame && allowKeepAlive) { 35831 useDefaultElapsed = false; 35832 scheduleNextBatch(processBatch); 35833 } 35834 }; 35835 const wake = () => { 35836 runNextFrame = true; 35837 useDefaultElapsed = true; 35838 if (!state.isProcessing) { 35839 scheduleNextBatch(processBatch); 35840 } 35841 }; 35842 const schedule = stepsOrder.reduce((acc, key) => { 35843 const step = steps[key]; 35844 acc[key] = (process2, keepAlive = false, immediate = false) => { 35845 if (!runNextFrame) 35846 wake(); 35847 return step.schedule(process2, keepAlive, immediate); 35848 }; 35849 return acc; 35850 }, {}); 35851 const cancel = (process2) => { 35852 for (let i2 = 0; i2 < stepsOrder.length; i2++) { 35853 steps[stepsOrder[i2]].cancel(process2); 35854 } 35855 }; 35856 return { schedule, cancel, state, steps }; 35857 } 35858 const { schedule: frame, cancel: cancelFrame, state: frameData, steps: frameSteps } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop$3, true); 35859 const LazyContext = reactExports.createContext({ strict: false }); 35860 const featureProps = { 35861 animation: [ 35862 "animate", 35863 "variants", 35864 "whileHover", 35865 "whileTap", 35866 "exit", 35867 "whileInView", 35868 "whileFocus", 35869 "whileDrag" 35870 ], 35871 exit: ["exit"], 35872 drag: ["drag", "dragControls"], 35873 focus: ["whileFocus"], 35874 hover: ["whileHover", "onHoverStart", "onHoverEnd"],
35875 tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"], 35876 pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"], 35877 inView: ["whileInView", "onViewportEnter", "onViewportLeave"], 35878 layout: ["layout", "layoutId"] 35879 }; 35880 const featureDefinitions = {}; 35881 for (const key in featureProps) { 35882 featureDefinitions[key] = { 35883 isEnabled: (props) => featureProps[key].some((name) => !!props[name]) 35884 }; 35885 } 35886 function loadFeatures(features) { 35887 for (const key in features) { 35888 featureDefinitions[key] = __spreadValues(__spreadValues({}, featureDefinitions[key]), features[key]); 35889 } 35890 } 35891 const validMotionProps = /* @__PURE__ */ new Set([ 35892 "animate", 35893 "exit", 35894 "variants", 35895 "initial", 35896 "style", 35897 "values", 35898 "variants", 35899 "transition", 35900 "transformTemplate", 35901 "custom", 35902 "inherit", 35903 "onBeforeLayoutMeasure", 35904 "onAnimationStart", 35905 "onAnimationComplete", 35906 "onUpdate", 35907 "onDragStart", 35908 "onDrag", 35909 "onDragEnd", 35910 "onMeasureDragConstraints", 35911 "onDirectionLock", 35912 "onDragTransitionEnd", 35913 "_dragX", 35914 "_dragY", 35915 "onHoverStart", 35916 "onHoverEnd", 35917 "onViewportEnter", 35918 "onViewportLeave", 35919 "globalTapTarget", 35920 "ignoreStrict", 35921 "viewport" 35922 ]); 35923 function isValidMotionProp(key) { 35924 return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key); 35925 } 35926 let shouldForward = (key) => !isValidMotionProp(key); 35927 function loadExternalIsValidProp(isValidProp) { 35928 if (!isValidProp) 35929 return; 35930 shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); 35931 } 35932 try { 35933 loadExternalIsValidProp(require("@emotion/is-prop-valid").default); 35934 } catch (_a) { 35935 } 35936 function filterProps(props, isDom, forwardMotionProps) { 35937 const filteredProps = {}; 35938 for (const key in props) { 35939 if (key === "values" && typeof props.values === "object") 35940 continue; 35941 if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners 35942 props["draggable"] && key.startsWith("onDrag")) { 35943 filteredProps[key] = props[key]; 35944 } 35945 } 35946 return filteredProps; 35947 } 35948 function createDOMMotionComponentProxy(componentFactory) { 35949 if (typeof Proxy === "undefined") { 35950 return componentFactory; 35951 } 35952 const componentCache = /* @__PURE__ */ new Map(); 35953 const deprecatedFactoryFunction = (...args) => { 35954 return componentFactory(...args); 35955 }; 35956 return new Proxy(deprecatedFactoryFunction, { 35957 /** 35958 * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. 35959 * The prop name is passed through as `key` and we can use that to generate a `motion` 35960 * DOM component with that name. 35961 */ 35962 get: (_target, key) => { 35963 if (key === "create") 35964 return componentFactory; 35965 if (!componentCache.has(key)) { 35966 componentCache.set(key, componentFactory(key)); 35967 } 35968 return componentCache.get(key); 35969 } 35970 }); 35971 } 35972 const MotionContext = reactExports.createContext({}); 35973 function isVariantLabel(v2) { 35974 return typeof v2 === "string" || Array.isArray(v2); 35975 } 35976 function isAnimationControls(v2) { 35977 return v2 !== null && typeof v2 === "object" && typeof v2.start === "function"; 35978 } 35979 const variantPriorityOrder = [ 35980 "animate", 35981 "whileInView", 35982 "whileFocus", 35983 "whileHover", 35984 "whileTap", 35985 "whileDrag", 35986 "exit" 35987 ]; 35988 const variantProps = ["initial", ...variantPriorityOrder]; 35989 function isControllingVariants(props) { 35990 return isAnimationControls(props.animate) || variantProps.some((name) => isVariantLabel(props[name])); 35991 } 35992 function isVariantNode(props) { 35993 return Boolean(isControllingVariants(props) || props.variants); 35994 } 35995 function getCurrentTreeVariants(props, context) { 35996 if (isControllingVariants(props)) { 35997 const { initial, animate } = props; 35998 return { 35999 initial: initial === false || isVariantLabel(initial) ? initial : void 0, 36000 animate: isVariantLabel(animate) ? animate : void 0 36001 }; 36002 } 36003 return props.inherit !== false ? context : {}; 36004 } 36005 function useCreateMotionContext(props) { 36006 const { initial, animate } = getCurrentTreeVariants(props, reactExports.useContext(MotionContext)); 36007 return reactExports.useMemo(() => ({ initial, animate }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); 36008 } 36009 function variantLabelsAsDependency(prop) { 36010 return Array.isArray(prop) ? prop.join(" ") : prop; 36011 } 36012 const motionComponentSymbol = Symbol.for("motionComponentSymbol"); 36013 function isRefObject(ref) { 36014 return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); 36015 } 36016 function useMotionRef(visualState, visualElement, externalRef) { 36017 return reactExports.useCallback( 36018 (instance2) => { 36019 if (instance2) { 36020 visualState.onMount && visualState.onMount(instance2); 36021 } 36022 if (visualElement) { 36023 if (instance2) { 36024 visualElement.mount(instance2); 36025 } else { 36026 visualElement.unmount(); 36027 } 36028 } 36029 if (externalRef) { 36030 if (typeof externalRef === "function") { 36031 externalRef(instance2); 36032 } else if (isRefObject(externalRef)) { 36033 externalRef.current = instance2; 36034 } 36035 } 36036 }, 36037 /** 36038 * Only pass a new ref callback to React if we've received a visual element 36039 * factory. Otherwise we'll be mounting/remounting every time externalRef 36040 * or other dependencies change. 36041 */ 36042 [visualElement] 36043 ); 36044 } 36045 const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(); 36046 const optimizedAppearDataId = "framerAppearId"; 36047 const optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId); 36048 const { schedule: microtask } = createRenderBatcher(queueMicrotask, false); 36049 const SwitchLayoutGroupContext = reactExports.createContext({}); 36050 function useVisualElement(Component, visualState, props, createVisualElement, ProjectionNodeConstructor) { 36051 var _a, _b; 36052 const { visualElement: parent } = reactExports.useContext(MotionContext); 36053 const lazyContext = reactExports.useContext(LazyContext); 36054 const presenceContext = reactExports.useContext(PresenceContext); 36055 const reducedMotionConfig = reactExports.useContext(MotionConfigContext).reducedMotion; 36056 const visualElementRef = reactExports.useRef(null); 36057 createVisualElement = createVisualElement || lazyContext.renderer; 36058 if (!visualElementRef.current && createVisualElement) { 36059 visualElementRef.current = createVisualElement(Component, { 36060 visualState, 36061 parent, 36062 props, 36063 presenceContext, 36064 blockInitialAnimation: presenceContext ? presenceContext.
36064initial === false : false, 36065 reducedMotionConfig 36066 }); 36067 } 36068 const visualElement = visualElementRef.current; 36069 const initialLayoutGroupConfig = reactExports.useContext(SwitchLayoutGroupContext); 36070 if (visualElement && !visualElement.projection && ProjectionNodeConstructor && (visualElement.type === "html" || visualElement.type === "svg")) { 36071 createProjectionNode$1(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig); 36072 } 36073 const isMounted = reactExports.useRef(false); 36074 reactExports.useInsertionEffect(() => { 36075 if (visualElement && isMounted.current) { 36076 visualElement.update(props, presenceContext); 36077 } 36078 }); 36079 const optimisedAppearId = props[optimizedAppearDataAttribute]; 36080 const wantsHandoff = reactExports.useRef(Boolean(optimisedAppearId) && !((_a = window.MotionHandoffIsComplete) === null || _a === void 0 ? void 0 : _a.call(window, optimisedAppearId)) && ((_b = window.MotionHasOptimisedAnimation) === null || _b === void 0 ? void 0 : _b.call(window, optimisedAppearId))); 36081 useIsomorphicLayoutEffect$2(() => { 36082 if (!visualElement) 36083 return; 36084 isMounted.current = true; 36085 window.MotionIsMounted = true; 36086 visualElement.updateFeatures(); 36087 microtask.render(visualElement.render); 36088 if (wantsHandoff.current && visualElement.animationState) { 36089 visualElement.animationState.animateChanges(); 36090 } 36091 }); 36092 reactExports.useEffect(() => { 36093 if (!visualElement) 36094 return; 36095 if (!wantsHandoff.current && visualElement.animationState) { 36096 visualElement.animationState.animateChanges(); 36097 } 36098 if (wantsHandoff.current) { 36099 queueMicrotask(() => { 36100 var _a2; 36101 (_a2 = window.MotionHandoffMarkAsComplete) === null || _a2 === void 0 ? void 0 : _a2.call(window, optimisedAppearId); 36102 }); 36103 wantsHandoff.current = false; 36104 } 36105 }); 36106 return visualElement; 36107 } 36108 function createProjectionNode$1(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) { 36109 const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot } = props; 36110 visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(visualElement.parent)); 36111 visualElement.projection.setOptions({ 36112 layoutId, 36113 layout: layout2, 36114 alwaysMeasureLayout: Boolean(drag2) || dragConstraints && isRefObject(dragConstraints), 36115 visualElement, 36116 /** 36117 * TODO: Update options in an effect. This could be tricky as it'll be too late 36118 * to update by the time layout animations run. 36119 * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, 36120 * ensuring it gets called if there's no potential layout animations. 36121 * 36122 */ 36123 animationType: typeof layout2 === "string" ? layout2 : "both", 36124 initialPromotionConfig, 36125 layoutScroll, 36126 layoutRoot 36127 }); 36128 } 36129 function getClosestProjectingNode(visualElement) { 36130 if (!visualElement) 36131 return void 0; 36132 return visualElement.options.allowProjection !== false ? visualElement.projection : getClosestProjectingNode(visualElement.parent); 36133 } 36134 function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component }) { 36135 var _a, _b; 36136 preloadedFeatures && loadFeatures(preloadedFeatures); 36137 function MotionComponent(props, externalRef) { 36138 let MeasureLayout2; 36139 const configAndProps = __spreadProps(__spreadValues(__spreadValues({}, reactExports.useContext(MotionConfigContext)), props), { 36140 layoutId: useLayoutId(props) 36141 }); 36142 const { isStatic } = configAndProps; 36143 const context = useCreateMotionContext(props); 36144 const visualState = useVisualState(props, isStatic); 36145 if (!isStatic && isBrowser) { 36146 useStrictMode(); 36147 const layoutProjection = getProjectionFunctionality(configAndProps); 36148 MeasureLayout2 = layoutProjection.MeasureLayout; 36149 context.visualElement = useVisualElement(Component, visualState, configAndProps, createVisualElement, layoutProjection.ProjectionNode); 36150 } 36151 return jsxRuntimeExports.jsxs(MotionContext.Provider, { value: context, children: [MeasureLayout2 && context.visualElement ? jsxRuntimeExports.jsx(MeasureLayout2, __spreadValues({ visualElement: context.visualElement }, configAndProps)) : null, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)] }); 36152 } 36153 MotionComponent.displayName = `motion.${typeof Component === "string" ? Component : `create(${(_b = (_a = Component.displayName) !== null && _a !== void 0 ? _a : Component.name) !== null && _b !== void 0 ? _b : ""})`}`; 36154 const ForwardRefMotionComponent = reactExports.forwardRef(MotionComponent); 36155 ForwardRefMotionComponent[motionComponentSymbol] = Component; 36156 return ForwardRefMotionComponent; 36157 } 36158 function useLayoutId({ layoutId }) { 36159 const layoutGroupId = reactExports.useContext(LayoutGroupContext).id; 36160 return layoutGroupId && layoutId !== void 0 ? layoutGroupId + "-" + layoutId : layoutId; 36161 } 36162 function useStrictMode(configAndProps, preloadedFeatures) { 36163 reactExports.useContext(LazyContext).strict; 36164 } 36165 function getProjectionFunctionality(props) { 36166 const { drag: drag2, layout: layout2 } = featureDefinitions; 36167 if (!drag2 && !layout2) 36168 return {}; 36169 const combined = __spreadValues(__spreadValues({}, drag2), layout2); 36170 return { 36171 MeasureLayout: (drag2 === null || drag2 === void 0 ? void 0 : drag2.isEnabled(props)) || (layout2 === null || layout2 === void 0 ? void 0 : layout2.isEnabled(props)) ? combined.MeasureLayout : void 0, 36172 ProjectionNode: combined.ProjectionNode 36173 }; 36174 } 36175 const lowercaseSVGElements = [ 36176 "animate", 36177 "circle", 36178 "defs", 36179 "desc", 36180 "ellipse", 36181 "g", 36182 "image", 36183 "line", 36184 "filter", 36185 "marker", 36186 "mask", 36187 "metadata", 36188 "path", 36189 "pattern", 36190 "polygon", 36191 "polyline", 36192 "rect", 36193 "stop", 36194 "switch", 36195 "symbol", 36196 "svg", 36197 "text", 36198 "tspan", 36199 "use", 36200 "view" 36201 ]; 36202 function isSVGComponent(Component) { 36203 if ( 36204 /** 36205 * If it's not a string, it's a custom React component. Currently we only support 36206 * HTML custom React components. 36207 */ 36208 typeof Component !== "string" || /** 36209 * If it contains a dash, the element is a custom HTML webcomponent. 36210 */ 36211 Component.includes("-") 36212 ) { 36213 return false;
36214 } else if ( 36215 /** 36216 * If it's in our list of lowercase SVG tags, it's an SVG component 36217 */ 36218 lowercaseSVGElements.indexOf(Component) > -1 || /** 36219 * If it contains a capital letter, it's an SVG component 36220 */ 36221 /[A-Z]/u.test(Component) 36222 ) { 36223 return true; 36224 } 36225 return false; 36226 } 36227 function getValueState(visualElement) { 36228 const state = [{}, {}]; 36229 visualElement === null || visualElement === void 0 ? void 0 : visualElement.values.forEach((value, key) => { 36230 state[0][key] = value.get(); 36231 state[1][key] = value.getVelocity(); 36232 }); 36233 return state; 36234 } 36235 function resolveVariantFromProps(props, definition, custom, visualElement) { 36236 if (typeof definition === "function") { 36237 const [current, velocity] = getValueState(visualElement); 36238 definition = definition(custom !== void 0 ? custom : props.custom, current, velocity); 36239 } 36240 if (typeof definition === "string") { 36241 definition = props.variants && props.variants[definition]; 36242 } 36243 if (typeof definition === "function") { 36244 const [current, velocity] = getValueState(visualElement); 36245 definition = definition(custom !== void 0 ? custom : props.custom, current, velocity); 36246 } 36247 return definition; 36248 } 36249 const isKeyframesTarget = (v2) => { 36250 return Array.isArray(v2); 36251 }; 36252 const isCustomValue = (v2) => { 36253 return Boolean(v2 && typeof v2 === "object" && v2.mix && v2.toValue); 36254 }; 36255 const resolveFinalValueInKeyframes = (v2) => { 36256 return isKeyframesTarget(v2) ? v2[v2.length - 1] || 0 : v2; 36257 }; 36258 const isMotionValue = (value) => Boolean(value && value.getVelocity); 36259 function resolveMotionValue(value) { 36260 const unwrappedValue = isMotionValue(value) ? value.get() : value; 36261 return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; 36262 } 36263 function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onUpdate }, props, context, presenceContext) { 36264 const state = { 36265 latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps2), 36266 renderState: createRenderState() 36267 }; 36268 if (onUpdate) { 36269 state.onMount = (instance2) => onUpdate(__spreadValues({ props, current: instance2 }, state)); 36270 state.onUpdate = (visualElement) => onUpdate(visualElement); 36271 } 36272 return state; 36273 } 36274 const makeUseVisualState = (config) => (props, isStatic) => { 36275 const context = reactExports.useContext(MotionContext); 36276 const presenceContext = reactExports.useContext(PresenceContext); 36277 const make = () => makeState(config, props, context, presenceContext); 36278 return isStatic ? make() : useConstant(make); 36279 }; 36280 function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { 36281 const values = {}; 36282 const motionValues = scrapeMotionValues(props, {}); 36283 for (const key in motionValues) { 36284 values[key] = resolveMotionValue(motionValues[key]); 36285 } 36286 let { initial, animate } = props; 36287 const isControllingVariants$1 = isControllingVariants(props); 36288 const isVariantNode$1 = isVariantNode(props); 36289 if (context && isVariantNode$1 && !isControllingVariants$1 && props.inherit !== false) { 36290 if (initial === void 0) 36291 initial = context.initial; 36292 if (animate === void 0) 36293 animate = context.animate; 36294 } 36295 let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === false : false; 36296 isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false; 36297 const variantToSet = isInitialAnimationBlocked ? animate : initial; 36298 if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { 36299 const list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; 36300 for (let i2 = 0; i2 < list.length; i2++) { 36301 const resolved = resolveVariantFromProps(props, list[i2]); 36302 if (resolved) { 36303 const _a = resolved, { transitionEnd, transition } = _a, target = __objRest(_a, ["transitionEnd", "transition"]); 36304 for (const key in target) { 36305 let valueTarget = target[key]; 36306 if (Array.isArray(valueTarget)) { 36307 const index2 = isInitialAnimationBlocked ? valueTarget.length - 1 : 0; 36308 valueTarget = valueTarget[index2]; 36309 } 36310 if (valueTarget !== null) { 36311 values[key] = valueTarget; 36312 } 36313 } 36314 for (const key in transitionEnd) { 36315 values[key] = transitionEnd[key]; 36316 } 36317 } 36318 } 36319 } 36320 return values; 36321 } 36322 const transformPropOrder = [ 36323 "transformPerspective", 36324 "x", 36325 "y", 36326 "z", 36327 "translateX", 36328 "translateY", 36329 "translateZ", 36330 "scale", 36331 "scaleX", 36332 "scaleY", 36333 "rotate", 36334 "rotateX", 36335 "rotateY", 36336 "rotateZ", 36337 "skew", 36338 "skewX", 36339 "skewY" 36340 ]; 36341 const transformProps = new Set(transformPropOrder); 36342 const checkStringStartsWith = (token2) => (key) => typeof key === "string" && key.startsWith(token2); 36343 const isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--"); 36344 const startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--"); 36345 const isCSSVariableToken = (value) => { 36346 const startsWithToken = startsAsVariableToken(value); 36347 if (!startsWithToken) 36348 return false;
36349 return singleCssVariableRegex.test(value.split("/*")[0].trim()); 36350 }; 36351 const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu; 36352 const getValueAsType = (value, type) => { 36353 return type && typeof value === "number" ? type.transform(value) : value; 36354 }; 36355 const clamp = (min2, max2, v2) => { 36356 if (v2 > max2) 36357 return max2; 36358 if (v2 < min2) 36359 return min2; 36360 return v2; 36361 }; 36362 const number$1 = { 36363 test: (v2) => typeof v2 === "number", 36364 parse: parseFloat, 36365 transform: (v2) => v2 36366 }; 36367 const alpha = __spreadProps(__spreadValues({}, number$1), { 36368 transform: (v2) => clamp(0, 1, v2) 36369 }); 36370 const scale = __spreadProps(__spreadValues({}, number$1), { 36371 default: 1 36372 }); 36373 const createUnitType = (unit) => ({ 36374 test: (v2) => typeof v2 === "string" && v2.endsWith(unit) && v2.split(" ").length === 1, 36375 parse: parseFloat, 36376 transform: (v2) => `${v2}${unit}` 36377 }); 36378 const degrees = /* @__PURE__ */ createUnitType("deg"); 36379 const percent = /* @__PURE__ */ createUnitType("%"); 36380 const px = /* @__PURE__ */ createUnitType("px"); 36381 const vh = /* @__PURE__ */ createUnitType("vh"); 36382 const vw = /* @__PURE__ */ createUnitType("vw"); 36383 const progressPercentage = __spreadProps(__spreadValues({}, percent), { 36384 parse: (v2) => percent.parse(v2) / 100, 36385 transform: (v2) => percent.transform(v2 * 100) 36386 }); 36387 const browserNumberValueTypes = { 36388 // Border props 36389 borderWidth: px, 36390 borderTopWidth: px, 36391 borderRightWidth: px, 36392 borderBottomWidth: px, 36393 borderLeftWidth: px, 36394 borderRadius: px, 36395 radius: px, 36396 borderTopLeftRadius: px, 36397 borderTopRightRadius: px, 36398 borderBottomRightRadius: px, 36399 borderBottomLeftRadius: px, 36400 // Positioning props 36401 width: px, 36402 maxWidth: px, 36403 height: px, 36404 maxHeight: px, 36405 top: px, 36406 right: px, 36407 bottom: px, 36408 left: px, 36409 // Spacing props 36410 padding: px, 36411 paddingTop: px, 36412 paddingRight: px, 36413 paddingBottom: px, 36414 paddingLeft: px, 36415 margin: px, 36416 marginTop: px, 36417 marginRight: px, 36418 marginBottom: px, 36419 marginLeft: px, 36420 // Misc 36421 backgroundPositionX: px, 36422 backgroundPositionY: px 36423 }; 36424 const transformValueTypes = { 36425 rotate: degrees, 36426 rotateX: degrees, 36427 rotateY: degrees, 36428 rotateZ: degrees, 36429 scale, 36430 scaleX: scale, 36431 scaleY: scale, 36432 scaleZ: scale, 36433 skew: degrees, 36434 skewX: degrees, 36435 skewY: degrees, 36436 distance: px, 36437 translateX: px, 36438 translateY: px, 36439 translateZ: px, 36440 x: px, 36441 y: px, 36442 z: px, 36443 perspective: px, 36444 transformPerspective: px, 36445 opacity: alpha, 36446 originX: progressPercentage, 36447 originY: progressPercentage, 36448 originZ: px 36449 }; 36450 const int = __spreadProps(__spreadValues({}, number$1), { 36451 transform: Math.round 36452 }); 36453 const numberValueTypes = __spreadProps(__spreadValues(__spreadValues({}, browserNumberValueTypes), transformValueTypes), { 36454 zIndex: int, 36455 size: px, 36456 // SVG 36457 fillOpacity: alpha, 36458 strokeOpacity: alpha, 36459 numOctaves: int 36460 }); 36461 const translateAlias = { 36462 x: "translateX", 36463 y: "translateY", 36464 z: "translateZ", 36465 transformPerspective: "perspective" 36466 }; 36467 const numTransforms = transformPropOrder.length; 36468 function buildTransform(latestValues, transform2, transformTemplate) { 36469 let transformString = ""; 36470 let transformIsDefault = true; 36471 for (let i2 = 0; i2 < numTransforms; i2++) { 36472 const key = transformPropOrder[i2]; 36473 const value = latestValues[key]; 36474 if (value === void 0) 36475 continue; 36476 let valueIsDefault = true; 36477 if (typeof value === "number") { 36478 valueIsDefault = value === (key.startsWith("scale") ? 1 : 0); 36479 } else { 36480 valueIsDefault = parseFloat(value) === 0; 36481 } 36482 if (!valueIsDefault || transformTemplate) { 36483 const valueAsType = getValueAsType(value, numberValueTypes[key]); 36484 if (!valueIsDefault) { 36485 transformIsDefault = false;
36486 const transformName = translateAlias[key] || key; 36487 transformString += `${transformName}(${valueAsType}) `; 36488 } 36489 if (transformTemplate) { 36490 transform2[key] = valueAsType; 36491 } 36492 } 36493 } 36494 transformString = transformString.trim(); 36495 if (transformTemplate) { 36496 transformString = transformTemplate(transform2, transformIsDefault ? "" : transformString); 36497 } else if (transformIsDefault) { 36498 transformString = "none"; 36499 } 36500 return transformString; 36501 } 36502 function buildHTMLStyles(state, latestValues, transformTemplate) { 36503 const { style, vars, transformOrigin } = state; 36504 let hasTransform2 = false; 36505 let hasTransformOrigin = false; 36506 for (const key in latestValues) { 36507 const value = latestValues[key]; 36508 if (transformProps.has(key)) { 36509 hasTransform2 = true; 36510 continue; 36511 } else if (isCSSVariableName(key)) { 36512 vars[key] = value; 36513 continue; 36514 } else { 36515 const valueAsType = getValueAsType(value, numberValueTypes[key]); 36516 if (key.startsWith("origin")) { 36517 hasTransformOrigin = true; 36518 transformOrigin[key] = valueAsType; 36519 } else { 36520 style[key] = valueAsType; 36521 } 36522 } 36523 } 36524 if (!latestValues.transform) { 36525 if (hasTransform2 || transformTemplate) { 36526 style.transform = buildTransform(latestValues, state.transform, transformTemplate); 36527 } else if (style.transform) { 36528 style.transform = "none"; 36529 } 36530 } 36531 if (hasTransformOrigin) { 36532 const { originX = "50%", originY = "50%", originZ = 0 } = transformOrigin; 36533 style.transformOrigin = `${originX} ${originY} ${originZ}`; 36534 } 36535 } 36536 const dashKeys = { 36537 offset: "stroke-dashoffset", 36538 array: "stroke-dasharray" 36539 }; 36540 const camelKeys = { 36541 offset: "strokeDashoffset", 36542 array: "strokeDasharray" 36543 }; 36544 function buildSVGPath(attrs, length2, spacing = 1, offset2 = 0, useDashCase = true) { 36545 attrs.pathLength = 1; 36546 const keys2 = useDashCase ? dashKeys : camelKeys; 36547 attrs[keys2.offset] = px.transform(-offset2); 36548 const pathLength = px.transform(length2); 36549 const pathSpacing = px.transform(spacing); 36550 attrs[keys2.array] = `${pathLength} ${pathSpacing}`; 36551 } 36552 function calcOrigin$1(origin2, offset2, size) { 36553 return typeof origin2 === "string" ? origin2 : px.transform(offset2 + size * origin2); 36554 } 36555 function calcSVGTransformOrigin(dimensions, originX, originY) { 36556 const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width); 36557 const pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height); 36558 return `${pxOriginX} ${pxOriginY}`; 36559 } 36560 function buildSVGAttrs(state, _l, isSVGTag2, transformTemplate) { 36561 var _m = _l, { 36562 attrX, 36563 attrY, 36564 attrScale, 36565 originX, 36566 originY, 36567 pathLength, 36568 pathSpacing = 1, 36569 pathOffset = 0 36570 } = _m, latest = __objRest(_m, [ 36571 "attrX", 36572 "attrY", 36573 "attrScale", 36574 "originX", 36575 "originY", 36576 "pathLength", 36577 "pathSpacing", 36578 "pathOffset" 36579 ]); 36580 buildHTMLStyles(state, latest, transformTemplate); 36581 if (isSVGTag2) { 36582 if (state.style.viewBox) { 36583 state.attrs.viewBox = state.style.viewBox; 36584 } 36585 return; 36586 } 36587 state.attrs = state.style; 36588 state.style = {}; 36589 const { attrs, style, dimensions } = state; 36590 if (attrs.transform) { 36591 if (dimensions) 36592 style.transform = attrs.transform; 36593 delete attrs.transform; 36594 } 36595 if (dimensions && (originX !== void 0 || originY !== void 0 || style.transform)) { 36596 style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== void 0 ? originX : 0.5, originY !== void 0 ? originY : 0.5); 36597 } 36598 if (attrX !== void 0) 36599 attrs.x = attrX; 36600 if (attrY !== void 0) 36601 attrs.y = attrY; 36602 if (attrScale !== void 0) 36603 attrs.scale = attrScale;
36604 if (pathLength !== void 0) { 36605 buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); 36606 } 36607 } 36608 const createHtmlRenderState = () => ({ 36609 style: {}, 36610 transform: {}, 36611 transformOrigin: {}, 36612 vars: {} 36613 }); 36614 const createSvgRenderState = () => __spreadProps(__spreadValues({}, createHtmlRenderState()), { 36615 attrs: {} 36616 }); 36617 const isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg"; 36618 function renderHTML(element, { style, vars }, styleProp, projection) { 36619 Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); 36620 for (const key in vars) { 36621 element.style.setProperty(key, vars[key]); 36622 } 36623 } 36624 const camelCaseAttributes = /* @__PURE__ */ new Set([ 36625 "baseFrequency", 36626 "diffuseConstant", 36627 "kernelMatrix", 36628 "kernelUnitLength", 36629 "keySplines", 36630 "keyTimes", 36631 "limitingConeAngle", 36632 "markerHeight", 36633 "markerWidth", 36634 "numOctaves", 36635 "targetX", 36636 "targetY", 36637 "surfaceScale", 36638 "specularConstant", 36639 "specularExponent", 36640 "stdDeviation", 36641 "tableValues", 36642 "viewBox", 36643 "gradientTransform", 36644 "pathLength", 36645 "startOffset", 36646 "textLength", 36647 "lengthAdjust" 36648 ]);
36649 function renderSVG(element, renderState, _styleProp, projection) { 36650 renderHTML(element, renderState, void 0, projection); 36651 for (const key in renderState.attrs) { 36652 element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); 36653 } 36654 } 36655 const scaleCorrectors = {}; 36656 function addScaleCorrector(correctors) { 36657 Object.assign(scaleCorrectors, correctors); 36658 } 36659 function isForcedMotionValue(key, { layout: layout2, layoutId }) { 36660 return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity"); 36661 } 36662 function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) { 36663 var _a; 36664 const { style } = props; 36665 const newValues = {}; 36666 for (const key in style) { 36667 if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) { 36668 newValues[key] = style[key]; 36669 } 36670 } 36671 return newValues; 36672 } 36673 function scrapeMotionValuesFromProps(props, prevProps, visualElement) { 36674 const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement); 36675 for (const key in props) { 36676 if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) { 36677 const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key; 36678 newValues[targetKey] = props[key]; 36679 } 36680 } 36681 return newValues; 36682 } 36683 function updateSVGDimensions(instance2, renderState) { 36684 try { 36685 renderState.dimensions = typeof instance2.getBBox === "function" ? instance2.getBBox() : instance2.getBoundingClientRect(); 36686 } catch (e2) { 36687 renderState.dimensions = { 36688 x: 0, 36689 y: 0, 36690 width: 0, 36691 height: 0 36692 }; 36693 } 36694 } 36695 const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"]; 36696 const svgMotionConfig = { 36697 useVisualState: makeUseVisualState({ 36698 scrapeMotionValuesFromProps, 36699 createRenderState: createSvgRenderState, 36700 onUpdate: ({ props, prevProps, current, renderState, latestValues }) => { 36701 if (!current) 36702 return; 36703 let hasTransform2 = !!props.drag; 36704 if (!hasTransform2) { 36705 for (const key in latestValues) { 36706 if (transformProps.has(key)) { 36707 hasTransform2 = true; 36708 break; 36709 } 36710 } 36711 } 36712 if (!hasTransform2) 36713 return; 36714 let needsMeasure = !prevProps; 36715 if (prevProps) { 36716 for (let i2 = 0; i2 < layoutProps.length; i2++) { 36717 const key = layoutProps[i2]; 36718 if (props[key] !== prevProps[key]) { 36719 needsMeasure = true; 36720 } 36721 } 36722 } 36723 if (!needsMeasure) 36724 return; 36725 frame.read(() => { 36726 updateSVGDimensions(current, renderState); 36727 frame.render(() => { 36728 buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate); 36729 renderSVG(current, renderState); 36730 }); 36731 }); 36732 } 36733 }) 36734 }; 36735 const htmlMotionConfig = { 36736 useVisualState: makeUseVisualState({ 36737 scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, 36738 createRenderState: createHtmlRenderState 36739 }) 36740 }; 36741 function copyRawValuesOnly(target, source, props) { 36742 for (const key in source) { 36743 if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { 36744 target[key] = source[key]; 36745 } 36746 } 36747 } 36748 function useInitialMotionValues({ transformTemplate }, visualState) { 36749 return reactExports.useMemo(() => { 36750 const state = createHtmlRenderState(); 36751 buildHTMLStyles(state, visualState, transformTemplate); 36752 return Object.assign({}, state.vars, state.style); 36753 }, [visualState]); 36754 } 36755 function useStyle(props, visualState) { 36756 const styleProp = props.style || {}; 36757 const style = {}; 36758 copyRawValuesOnly(style, styleProp, props); 36759 Object.assign(style, useInitialMotionValues(props, visualState)); 36760 return style; 36761 } 36762 function useHTMLProps(props, visualState) { 36763 const htmlProps = {}; 36764 const style = useStyle(props, visualState); 36765 if (props.drag && props.dragListener !== false) { 36766 htmlProps.draggable = false;
36767 style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; 36768 style.touchAction = props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`; 36769 } 36770 if (props.tabIndex === void 0 && (props.onTap || props.onTapStart || props.whileTap)) { 36771 htmlProps.tabIndex = 0; 36772 } 36773 htmlProps.style = style; 36774 return htmlProps; 36775 } 36776 function useSVGProps(props, visualState, _isStatic, Component) { 36777 const visualProps = reactExports.useMemo(() => { 36778 const state = createSvgRenderState(); 36779 buildSVGAttrs(state, visualState, isSVGTag(Component), props.transformTemplate); 36780 return __spreadProps(__spreadValues({}, state.attrs), { 36781 style: __spreadValues({}, state.style) 36782 }); 36783 }, [visualState]); 36784 if (props.style) { 36785 const rawStyles = {}; 36786 copyRawValuesOnly(rawStyles, props.style, props); 36787 visualProps.style = __spreadValues(__spreadValues({}, rawStyles), visualProps.style); 36788 } 36789 return visualProps; 36790 } 36791 function createUseRender(forwardMotionProps = false) { 36792 const useRender = (Component, props, ref, { latestValues }, isStatic) => { 36793 const useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; 36794 const visualProps = useVisualProps(props, latestValues, isStatic, Component); 36795 const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); 36796 const elementProps = Component !== reactExports.Fragment ? __spreadProps(__spreadValues(__spreadValues({}, filteredProps), visualProps), { ref }) : {}; 36797 const { children } = props; 36798 const renderedChildren = reactExports.useMemo(() => isMotionValue(children) ? children.get() : children, [children]); 36799 return reactExports.createElement(Component, __spreadProps(__spreadValues({}, elementProps), { 36800 children: renderedChildren 36801 })); 36802 }; 36803 return useRender; 36804 } 36805 function createMotionComponentFactory(preloadedFeatures, createVisualElement) { 36806 return function createMotionComponent2(Component, { forwardMotionProps } = { forwardMotionProps: false }) { 36807 const baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; 36808 const config = __spreadProps(__spreadValues({}, baseConfig), { 36809 preloadedFeatures, 36810 useRender: createUseRender(forwardMotionProps), 36811 createVisualElement, 36812 Component 36813 }); 36814 return createRendererMotionComponent(config); 36815 }; 36816 } 36817 function shallowCompare(next2, prev2) { 36818 if (!Array.isArray(prev2)) 36819 return false; 36820 const prevLength = prev2.length; 36821 if (prevLength !== next2.length) 36822 return false; 36823 for (let i2 = 0; i2 < prevLength; i2++) { 36824 if (prev2[i2] !== next2[i2]) 36825 return false; 36826 } 36827 return true; 36828 } 36829 function resolveVariant(visualElement, definition, custom) { 36830 const props = visualElement.getProps(); 36831 return resolveVariantFromProps(props, definition, custom !== void 0 ? custom : props.custom, visualElement); 36832 } 36833 const supportsScrollTimeline = /* @__PURE__ */ memo(() => window.ScrollTimeline !== void 0); 36834 class BaseGroupPlaybackControls { 36835 constructor(animations2) { 36836 this.stop = () => this.runAll("stop"); 36837 this.animations = animations2.filter(Boolean); 36838 } 36839 get finished() { 36840 return Promise.all(this.animations.map((animation) => "finished" in animation ? animation.finished : animation)); 36841 } 36842 /** 36843 * TODO: Filter out cancelled or stopped animations before returning 36844 */ 36845 getAll(propName) { 36846 return this.animations[0][propName]; 36847 } 36848 setAll(propName, newValue) { 36849 for (let i2 = 0; i2 < this.animations.length; i2++) { 36850 this.animations[i2][propName] = newValue; 36851 } 36852 } 36853 attachTimeline(timeline, fallback) { 36854 const subscriptions = this.animations.map((animation) => { 36855 if (supportsScrollTimeline() && animation.attachTimeline) { 36856 return animation.attachTimeline(timeline); 36857 } else if (typeof fallback === "function") { 36858 return fallback(animation); 36859 } 36860 }); 36861 return () => { 36862 subscriptions.forEach((cancel, i2) => { 36863 cancel && cancel(); 36864 this.animations[i2].stop(); 36865 }); 36866 }; 36867 } 36868 get time() { 36869 return this.getAll("time"); 36870 } 36871 set time(time2) { 36872 this.setAll("time", time2); 36873 } 36874 get speed() { 36875 return this.getAll("speed"); 36876 } 36877 set speed(speed) { 36878 this.setAll("speed", speed); 36879 } 36880 get startTime() { 36881 return this.getAll("startTime"); 36882 } 36883 get duration() { 36884 let max2 = 0; 36885 for (let i2 = 0; i2 < this.animations.length; i2++) { 36886 max2 = Math.max(max2, this.animations[i2].duration); 36887 } 36888 return max2; 36889 } 36890 runAll(methodName) { 36891 this.animations.forEach((controls) => controls[methodName]()); 36892 } 36893 flatten() { 36894 this.runAll("flatten"); 36895 } 36896 play() { 36897 this.runAll("play"); 36898 } 36899 pause() { 36900 this.runAll("pause"); 36901 } 36902 cancel() { 36903 this.runAll("cancel"); 36904 } 36905 complete() { 36906 this.runAll("complete"); 36907 } 36908 } 36909 class GroupPlaybackControls extends BaseGroupPlaybackControls { 36910 then(onResolve, onReject) {
36911 return Promise.all(this.animations).then(onResolve).catch(onReject); 36912 } 36913 } 36914 function getValueTransition(transition, key) { 36915 return transition ? transition[key] || transition["default"] || transition : void 0; 36916 } 36917 const maxGeneratorDuration = 2e4; 36918 function calcGeneratorDuration(generator) { 36919 let duration = 0; 36920 const timeStep = 50; 36921 let state = generator.next(duration); 36922 while (!state.done && duration < maxGeneratorDuration) { 36923 duration += timeStep; 36924 state = generator.next(duration); 36925 } 36926 return duration >= maxGeneratorDuration ? Infinity : duration; 36927 } 36928 function isGenerator(type) { 36929 return typeof type === "function"; 36930 } 36931 function attachTimeline(animation, timeline) { 36932 animation.timeline = timeline; 36933 animation.onfinish = null; 36934 } 36935 const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number"; 36936 const supportsFlags = { 36937 linearEasing: void 0 36938 }; 36939 function memoSupports(callback, supportsFlag) { 36940 const memoized = /* @__PURE__ */ memo(callback); 36941 return () => { 36942 var _a; 36943 return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized(); 36944 }; 36945 } 36946 const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => { 36947 try { 36948 document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" }); 36949 } catch (e2) { 36950 return false; 36951 } 36952 return true; 36953 }, "linearEasing"); 36954 const generateLinearEasing = (easing, duration, resolution = 10) => { 36955 let points = ""; 36956 const numPoints = Math.max(Math.round(duration / resolution), 2); 36957 for (let i2 = 0; i2 < numPoints; i2++) { 36958 points += easing(/* @__PURE__ */ progress(0, numPoints - 1, i2)) + ", "; 36959 } 36960 return `linear(${points.substring(0, points.length - 2)})`; 36961 }; 36962 function isWaapiSupportedEasing(easing) { 36963 return Boolean(typeof easing === "function" && supportsLinearEasing() || !easing || typeof easing === "string" && (easing in supportedWaapiEasing || supportsLinearEasing()) || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing)); 36964 } 36965 const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`; 36966 const supportedWaapiEasing = { 36967 linear: "linear", 36968 ease: "ease", 36969 easeIn: "ease-in", 36970 easeOut: "ease-out", 36971 easeInOut: "ease-in-out", 36972 circIn: /* @__PURE__ */ cubicBezierAsString([0, 0.65, 0.55, 1]), 36973 circOut: /* @__PURE__ */ cubicBezierAsString([0.55, 0, 1, 0.45]), 36974 backIn: /* @__PURE__ */ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]), 36975 backOut: /* @__PURE__ */ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]) 36976 }; 36977 function mapEasingToNativeEasing(easing, duration) { 36978 if (!easing) { 36979 return void 0; 36980 } else if (typeof easing === "function" && supportsLinearEasing()) { 36981 return generateLinearEasing(easing, duration); 36982 } else if (isBezierDefinition(easing)) { 36983 return cubicBezierAsString(easing); 36984 } else if (Array.isArray(easing)) { 36985 return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || supportedWaapiEasing.easeOut); 36986 } else { 36987 return supportedWaapiEasing[easing]; 36988 } 36989 } 36990 const isDragging = { 36991 x: false, 36992 y: false 36993 }; 36994 function isDragActive() { 36995 return isDragging.x || isDragging.y; 36996 } 36997 function resolveElements(elementOrSelector, scope, selectorCache) { 36998 var _a; 36999 if (elementOrSelector instanceof Element) { 37000 return [elementOrSelector]; 37001 } else if (typeof elementOrSelector === "string") { 37002 let root2 = document; 37003 const elements = (_a = void 0) !== null && _a !== void 0 ? _a : root2.querySelectorAll(elementOrSelector); 37004 return elements ? Array.from(elements) : []; 37005 } 37006 return Array.from(elementOrSelector); 37007 } 37008 function setupGesture(elementOrSelector, options2) { 37009 const elements = resolveElements(elementOrSelector); 37010 const gestureAbortController = new AbortController(); 37011 const eventOptions = __spreadProps(__spreadValues({ 37012 passive: true 37013 }, options2), { 37014 signal: gestureAbortController.signal 37015 }); 37016 const cancel = () => gestureAbortController.abort(); 37017 return [elements, eventOptions, cancel]; 37018 } 37019 function filterEvents$1(callback) { 37020 return (event) => { 37021 if (event.pointerType === "touch" || isDragActive()) 37022 return; 37023 callback(event); 37024 }; 37025 } 37026 function hover(elementOrSelector, onHoverStart, options2 = {}) { 37027 const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options2); 37028 const onPointerEnter = filterEvents$1((enterEvent) => { 37029 const { target } = enterEvent; 37030 const onHoverEnd = onHoverStart(enterEvent); 37031 if (typeof onHoverEnd !== "function" || !target) 37032 return; 37033 const onPointerLeave = filterEvents$1((leaveEvent) => { 37034 onHoverEnd(leaveEvent); 37035 target.removeEventListener("pointerleave", onPointerLeave); 37036 }); 37037 target.addEventListener("pointerleave", onPointerLeave, eventOptions); 37038 });
37039 elements.forEach((element) => { 37040 element.addEventListener("pointerenter", onPointerEnter, eventOptions); 37041 }); 37042 return cancel; 37043 } 37044 const isNodeOrChild = (parent, child) => { 37045 if (!child) { 37046 return false; 37047 } else if (parent === child) { 37048 return true; 37049 } else { 37050 return isNodeOrChild(parent, child.parentElement); 37051 } 37052 }; 37053 const isPrimaryPointer = (event) => { 37054 if (event.pointerType === "mouse") { 37055 return typeof event.button !== "number" || event.button <= 0; 37056 } else { 37057 return event.isPrimary !== false; 37058 } 37059 }; 37060 const focusableElements = /* @__PURE__ */ new Set([ 37061 "BUTTON", 37062 "INPUT", 37063 "SELECT", 37064 "TEXTAREA", 37065 "A" 37066 ]); 37067 function isElementKeyboardAccessible(element) { 37068 return focusableElements.has(element.tagName) || element.tabIndex !== -1; 37069 } 37070 const isPressing = /* @__PURE__ */ new WeakSet(); 37071 function filterEvents(callback) { 37072 return (event) => { 37073 if (event.key !== "Enter") 37074 return; 37075 callback(event); 37076 }; 37077 } 37078 function firePointerEvent(target, type) { 37079 target.dispatchEvent(new PointerEvent("pointer" + type, { isPrimary: true, bubbles: true })); 37080 } 37081 const enableKeyboardPress = (focusEvent, eventOptions) => { 37082 const element = focusEvent.currentTarget; 37083 if (!element) 37084 return; 37085 const handleKeydown = filterEvents(() => { 37086 if (isPressing.has(element)) 37087 return; 37088 firePointerEvent(element, "down"); 37089 const handleKeyup = filterEvents(() => { 37090 firePointerEvent(element, "up"); 37091 }); 37092 const handleBlur = () => firePointerEvent(element, "cancel"); 37093 element.addEventListener("keyup", handleKeyup, eventOptions); 37094 element.addEventListener("blur", handleBlur, eventOptions); 37095 }); 37096 element.addEventListener("keydown", handleKeydown, eventOptions); 37097 element.addEventListener("blur", () => element.removeEventListener("keydown", handleKeydown), eventOptions); 37098 }; 37099 function isValidPressEvent(event) { 37100 return isPrimaryPointer(event) && !isDragActive(); 37101 } 37102 function press(elementOrSelector, onPressStart, options2 = {}) { 37103 const [elements, eventOptions, cancelEvents] = setupGesture(elementOrSelector, options2); 37104 const startPress = (startEvent) => { 37105 const element = startEvent.currentTarget; 37106 if (!isValidPressEvent(startEvent) || isPressing.has(element)) 37107 return; 37108 isPressing.add(element); 37109 const onPressEnd = onPressStart(startEvent); 37110 const onPointerEnd = (endEvent, success) => { 37111 window.removeEventListener("pointerup", onPointerUp); 37112 window.removeEventListener("pointercancel", onPointerCancel); 37113 if (!isValidPressEvent(endEvent) || !isPressing.has(element)) { 37114 return; 37115 } 37116 isPressing.delete(element); 37117 if (typeof onPressEnd === "function") { 37118 onPressEnd(endEvent, { success }); 37119 } 37120 }; 37121 const onPointerUp = (upEvent) => { 37122 onPointerEnd(upEvent, options2.useGlobalTarget || isNodeOrChild(element, upEvent.target)); 37123 }; 37124 const onPointerCancel = (cancelEvent) => { 37125 onPointerEnd(cancelEvent, false); 37126 }; 37127 window.addEventListener("pointerup", onPointerUp, eventOptions); 37128 window.addEventListener("pointercancel", onPointerCancel, eventOptions); 37129 }; 37130 elements.forEach((element) => { 37131 if (!isElementKeyboardAccessible(element) && element.getAttribute("tabindex") === null) { 37132 element.tabIndex = 0; 37133 } 37134 const target = options2.useGlobalTarget ? window : element; 37135 target.addEventListener("pointerdown", startPress, eventOptions); 37136 element.addEventListener("focus", (event) => enableKeyboardPress(event, eventOptions), eventOptions); 37137 }); 37138 return cancelEvents; 37139 } 37140 function setDragLock(axis) { 37141 if (axis === "x" || axis === "y") { 37142 if (isDragging[axis]) { 37143 return null; 37144 } else { 37145 isDragging[axis] = true; 37146 return () => { 37147 isDragging[axis] = false;
vendor: 15,417 bytes, lines 37148-37618
37148 }; 37149 } 37150 } else { 37151 if (isDragging.x || isDragging.y) { 37152 return null; 37153 } else { 37154 isDragging.x = isDragging.y = true; 37155 return () => { 37156 isDragging.x = isDragging.y = false; 37157 }; 37158 } 37159 } 37160 } 37161 const positionalKeys = /* @__PURE__ */ new Set([ 37162 "width", 37163 "height", 37164 "top", 37165 "left", 37166 "right", 37167 "bottom", 37168 ...transformPropOrder 37169 ]); 37170 let now; 37171 function clearTime() { 37172 now = void 0; 37173 } 37174 const time = { 37175 now: () => { 37176 if (now === void 0) { 37177 time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()); 37178 } 37179 return now; 37180 }, 37181 set: (newTime) => { 37182 now = newTime; 37183 queueMicrotask(clearTime); 37184 } 37185 }; 37186 function addUniqueItem(arr, item) { 37187 if (arr.indexOf(item) === -1) 37188 arr.push(item); 37189 } 37190 function removeItem(arr, item) { 37191 const index2 = arr.indexOf(item); 37192 if (index2 > -1) 37193 arr.splice(index2, 1); 37194 } 37195 class SubscriptionManager { 37196 constructor() { 37197 this.subscriptions = []; 37198 } 37199 add(handler) { 37200 addUniqueItem(this.subscriptions, handler); 37201 return () => removeItem(this.subscriptions, handler); 37202 } 37203 notify(a2, b2, c2) { 37204 const numSubscriptions = this.subscriptions.length; 37205 if (!numSubscriptions) 37206 return; 37207 if (numSubscriptions === 1) { 37208 this.subscriptions[0](a2, b2, c2); 37209 } else { 37210 for (let i2 = 0; i2 < numSubscriptions; i2++) { 37211 const handler = this.subscriptions[i2]; 37212 handler && handler(a2, b2, c2); 37213 } 37214 } 37215 } 37216 getSize() { 37217 return this.subscriptions.length; 37218 } 37219 clear() { 37220 this.subscriptions.length = 0; 37221 } 37222 } 37223 function velocityPerSecond(velocity, frameDuration) { 37224 return frameDuration ? velocity * (1e3 / frameDuration) : 0; 37225 } 37226 const MAX_VELOCITY_DELTA = 30; 37227 const isFloat = (value) => { 37228 return !isNaN(parseFloat(value)); 37229 }; 37230 const collectMotionValues = { 37231 current: void 0 37232 }; 37233 class MotionValue { 37234 /** 37235 * @param init - The initiating value 37236 * @param config - Optional configuration options 37237 * 37238 * - `transformer`: A function to transform incoming values with. 37239 * 37240 * @internal 37241 */ 37242 constructor(init2, options2 = {}) { 37243 this.version = "11.18.2"; 37244 this.canTrackVelocity = null; 37245 this.events = {}; 37246 this.updateAndNotify = (v2, render = true) => { 37247 const currentTime = time.now(); 37248 if (this.updatedAt !== currentTime) { 37249 this.setPrevFrameValue(); 37250 } 37251 this.prev = this.current; 37252 this.setCurrent(v2); 37253 if (this.current !== this.prev && this.events.change) { 37254 this.events.change.notify(this.current); 37255 } 37256 if (render && this.events.renderRequest) { 37257 this.events.renderRequest.notify(this.current); 37258 } 37259 }; 37260 this.hasAnimated = false; 37261 this.setCurrent(init2); 37262 this.owner = options2.owner; 37263 } 37264 setCurrent(current) { 37265 this.current = current; 37266 this.updatedAt = time.now(); 37267 if (this.canTrackVelocity === null && current !== void 0) { 37268 this.canTrackVelocity = isFloat(this.current); 37269 } 37270 } 37271 setPrevFrameValue(prevFrameValue = this.current) { 37272 this.prevFrameValue = prevFrameValue; 37273 this.prevUpdatedAt = this.updatedAt; 37274 } 37275 /** 37276 * Adds a function that will be notified when the `MotionValue` is updated. 37277 * 37278 * It returns a function that, when called, will cancel the subscription. 37279 * 37280 * When calling `onChange` inside a React component, it should be wrapped with the 37281 * `useEffect` hook. As it returns an unsubscribe function, this should be returned 37282 * from the `useEffect` function to ensure you don't add duplicate subscribers.. 37283 * 37284 * ```jsx 37285 * export const MyComponent = () => { 37286 * const x = useMotionValue(0) 37287 * const y = useMotionValue(0) 37288 * const opacity = useMotionValue(1) 37289 * 37290 * useEffect(() => { 37291 * function updateOpacity() { 37292 * const maxXY = Math.max(x.get(), y.get()) 37293 * const newOpacity = transform(maxXY, [0, 100], [1, 0]) 37294 * opacity.set(newOpacity) 37295 * } 37296 * 37297 * const unsubscribeX = x.on("change", updateOpacity) 37298 * const unsubscribeY = y.on("change", updateOpacity) 37299 * 37300 * return () => { 37301 * unsubscribeX() 37302 * unsubscribeY() 37303 * } 37304 * }, []) 37305 * 37306 * return <motion.div style={{ x }} /> 37307 * } 37308 * ``` 37309 * 37310 * @param subscriber - A function that receives the latest value. 37311 * @returns A function that, when called, will cancel this subscription. 37312 * 37313 * @deprecated 37314 */ 37315 onChange(subscription) { 37316 return this.on("change", subscription); 37317 } 37318 on(eventName, callback) { 37319 if (!this.events[eventName]) { 37320 this.events[eventName] = new SubscriptionManager(); 37321 } 37322 const unsubscribe = this.events[eventName].add(callback); 37323 if (eventName === "change") { 37324 return () => { 37325 unsubscribe(); 37326 frame.read(() => { 37327 if (!this.events.change.getSize()) { 37328 this.stop(); 37329 } 37330 }); 37331 }; 37332 } 37333 return unsubscribe; 37334 } 37335 clearListeners() { 37336 for (const eventManagers in this.events) { 37337 this.events[eventManagers].clear(); 37338 } 37339 } 37340 /** 37341 * Attaches a passive effect to the `MotionValue`. 37342 * 37343 * @internal 37344 */ 37345 attach(passiveEffect, stopPassiveEffect) { 37346 this.passiveEffect = passiveEffect; 37347 this.stopPassiveEffect = stopPassiveEffect; 37348 } 37349 /** 37350 * Sets the state of the `MotionValue`. 37351 * 37352 * @remarks 37353 * 37354 * ```jsx 37355 * const x = useMotionValue(0) 37356 * x.set(10) 37357 * ``` 37358 * 37359 * @param latest - Latest value to set. 37360 * @param render - Whether to notify render subscribers. Defaults to `true` 37361 * 37362 * @public 37363 */ 37364 set(v2, render = true) { 37365 if (!render || !this.passiveEffect) { 37366 this.updateAndNotify(v2, render); 37367 } else { 37368 this.passiveEffect(v2, this.updateAndNotify); 37369 } 37370 } 37371 setWithVelocity(prev2, current, delta) { 37372 this.set(current); 37373 this.prev = void 0; 37374 this.prevFrameValue = prev2; 37375 this.prevUpdatedAt = this.updatedAt - delta; 37376 } 37377 /** 37378 * Set the state of the `MotionValue`, stopping any active animations, 37379 * effects, and resets velocity to `0`. 37380 */ 37381 jump(v2, endAnimation = true) { 37382 this.updateAndNotify(v2); 37383 this.prev = v2; 37384 this.prevUpdatedAt = this.prevFrameValue = void 0; 37385 endAnimation && this.stop(); 37386 if (this.stopPassiveEffect) 37387 this.stopPassiveEffect(); 37388 } 37389 /** 37390 * Returns the latest state of `MotionValue` 37391 * 37392 * @returns - The latest state of `MotionValue` 37393 * 37394 * @public 37395 */ 37396 get() { 37397 if (collectMotionValues.current) { 37398 collectMotionValues.current.push(this); 37399 } 37400 return this.current; 37401 } 37402 /** 37403 * @public 37404 */ 37405 getPrevious() { 37406 return this.prev; 37407 } 37408 /** 37409 * Returns the latest velocity of `MotionValue` 37410 * 37411 * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. 37412 * 37413 * @public 37414 */ 37415 getVelocity() { 37416 const currentTime = time.now(); 37417 if (!this.canTrackVelocity || this.prevFrameValue === void 0 || currentTime - this.updatedAt > MAX_VELOCITY_DELTA) { 37418 return 0; 37419 } 37420 const delta = Math.min(this.updatedAt - this.prevUpdatedAt, MAX_VELOCITY_DELTA); 37421 return velocityPerSecond(parseFloat(this.current) - parseFloat(this.prevFrameValue), delta); 37422 } 37423 /** 37424 * Registers a new animation to control this `MotionValue`. Only one 37425 * animation can drive a `MotionValue` at one time. 37426 * 37427 * ```jsx 37428 * value.start() 37429 * ``` 37430 * 37431 * @param animation - A function that starts the provided animation 37432 * 37433 * @internal 37434 */ 37435 start(startAnimation) { 37436 this.stop(); 37437 return new Promise((resolve) => { 37438 this.hasAnimated = true; 37439 this.animation = startAnimation(resolve); 37440 if (this.events.animationStart) { 37441 this.events.animationStart.notify(); 37442 } 37443 }).then(() => { 37444 if (this.events.animationComplete) { 37445 this.events.animationComplete.notify(); 37446 } 37447 this.clearAnimation(); 37448 }); 37449 } 37450 /** 37451 * Stop the currently active animation. 37452 * 37453 * @public 37454 */ 37455 stop() { 37456 if (this.animation) { 37457 this.animation.stop(); 37458 if (this.events.animationCancel) { 37459 this.events.animationCancel.notify(); 37460 } 37461 } 37462 this.clearAnimation(); 37463 } 37464 /** 37465 * Returns `true` if this value is currently animating. 37466 * 37467 * @public 37468 */ 37469 isAnimating() { 37470 return !!this.animation; 37471 } 37472 clearAnimation() { 37473 delete this.animation; 37474 } 37475 /** 37476 * Destroy and clean up subscribers to this `MotionValue`. 37477 * 37478 * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically 37479 * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually 37480 * created a `MotionValue` via the `motionValue` function. 37481 * 37482 * @public 37483 */ 37484 destroy() { 37485 this.clearListeners(); 37486 this.stop(); 37487 if (this.stopPassiveEffect) { 37488 this.stopPassiveEffect(); 37489 } 37490 } 37491 } 37492 function motionValue(init2, options2) { 37493 return new MotionValue(init2, options2); 37494 } 37495 function setMotionValue(visualElement, key, value) { 37496 if (visualElement.hasValue(key)) { 37497 visualElement.getValue(key).set(value); 37498 } else { 37499 visualElement.addValue(key, motionValue(value)); 37500 } 37501 } 37502 function setTarget(visualElement, definition) { 37503 const resolved = resolveVariant(visualElement, definition); 37504 let _a = resolved || {}, { transitionEnd = {}, transition = {} } = _a, target = __objRest(_a, ["transitionEnd", "transition"]); 37505 target = __spreadValues(__spreadValues({}, target), transitionEnd); 37506 for (const key in target) { 37507 const value = resolveFinalValueInKeyframes(target[key]); 37508 setMotionValue(visualElement, key, value); 37509 } 37510 } 37511 function isWillChangeMotionValue(value) { 37512 return Boolean(isMotionValue(value) && value.add); 37513 } 37514 function addValueToWillChange(visualElement, key) { 37515 const willChange = visualElement.getValue("willChange"); 37516 if (isWillChangeMotionValue(willChange)) { 37517 return willChange.add(key); 37518 } 37519 } 37520 function getOptimisedAppearId(visualElement) { 37521 return visualElement.props[optimizedAppearDataAttribute]; 37522 } 37523 const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2; 37524 const subdivisionPrecision = 1e-7; 37525 const subdivisionMaxIterations = 12; 37526 function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) { 37527 let currentX; 37528 let currentT; 37529 let i2 = 0; 37530 do { 37531 currentT = lowerBound + (upperBound - lowerBound) / 2; 37532 currentX = calcBezier(currentT, mX1, mX2) - x2; 37533 if (currentX > 0) { 37534 upperBound = currentT; 37535 } else { 37536 lowerBound = currentT; 37537 } 37538 } while (Math.abs(currentX) > subdivisionPrecision && ++i2 < subdivisionMaxIterations); 37539 return currentT; 37540 } 37541 function cubicBezier(mX1, mY1, mX2, mY2) { 37542 if (mX1 === mY1 && mX2 === mY2) 37543 return noop$3; 37544 const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2); 37545 return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2); 37546 } 37547 const mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - easing(2 * (1 - p2))) / 2; 37548 const reverseEasing = (easing) => (p2) => 1 - easing(1 - p2); 37549 const backOut = /* @__PURE__ */ cubicBezier(0.33, 1.53, 0.69, 0.99); 37550 const backIn = /* @__PURE__ */ reverseEasing(backOut); 37551 const backInOut = /* @__PURE__ */ mirrorEasing(backIn); 37552 const anticipate = (p2) => (p2 *= 2) < 1 ? 0.5 * backIn(p2) : 0.5 * (2 - Math.pow(2, -10 * (p2 - 1))); 37553 const circIn = (p2) => 1 - Math.sin(Math.acos(p2)); 37554 const circOut = reverseEasing(circIn); 37555 const circInOut = mirrorEasing(circIn); 37556 const isZeroValueString = (v2) => /^0[^.\s]+$/u.test(v2); 37557 function isNone(value) { 37558 if (typeof value === "number") { 37559 return value === 0; 37560 } else if (value !== null) { 37561 return value === "none" || value === "0" || isZeroValueString(value); 37562 } else { 37563 return true; 37564 } 37565 } 37566 const sanitize = (v2) => Math.round(v2 * 1e5) / 1e5; 37567 const floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu; 37568 function isNullish(v2) { 37569 return v2 == null; 37570 } 37571 const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu; 37572 const isColorString = (type, testProp) => (v2) => { 37573 return Boolean(typeof v2 === "string" && singleColorRegex.test(v2) && v2.startsWith(type) || testProp && !isNullish(v2) && Object.prototype.hasOwnProperty.call(v2, testProp)); 37574 }; 37575 const splitColor = (aName, bName, cName) => (v2) => { 37576 if (typeof v2 !== "string") 37577 return v2; 37578 const [a2, b2, c2, alpha2] = v2.match(floatRegex); 37579 return { 37580 [aName]: parseFloat(a2), 37581 [bName]: parseFloat(b2), 37582 [cName]: parseFloat(c2), 37583 alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1 37584 }; 37585 }; 37586 const clampRgbUnit = (v2) => clamp(0, 255, v2); 37587 const rgbUnit = __spreadProps(__spreadValues({}, number$1), { 37588 transform: (v2) => Math.round(clampRgbUnit(v2)) 37589 }); 37590 const rgba = { 37591 test: /* @__PURE__ */ isColorString("rgb", "red"), 37592 parse: /* @__PURE__ */ splitColor("red", "green", "blue"), 37593 transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")" 37594 }; 37595 function parseHex(v2) { 37596 let r2 = ""; 37597 let g2 = ""; 37598 let b2 = ""; 37599 let a2 = ""; 37600 if (v2.length > 5) { 37601 r2 = v2.substring(1, 3); 37602 g2 = v2.substring(3, 5); 37603 b2 = v2.substring(5, 7); 37604 a2 = v2.substring(7, 9); 37605 } else { 37606 r2 = v2.substring(1, 2); 37607 g2 = v2.substring(2, 3); 37608 b2 = v2.substring(3, 4); 37609 a2 = v2.substring(4, 5); 37610 r2 += r2; 37611 g2 += g2; 37612 b2 += b2; 37613 a2 += a2; 37614 } 37615 return { 37616 red: parseInt(r2, 16), 37617 green: parseInt(g2, 16), 37618 blue: parseInt(b2, 16),
37619 alpha: a2 ? parseInt(a2, 16) / 255 : 1 37620 }; 37621 } 37622 const hex = { 37623 test: /* @__PURE__ */ isColorString("#"), 37624 parse: parseHex, 37625 transform: rgba.transform 37626 }; 37627 const hsla = { 37628 test: /* @__PURE__ */ isColorString("hsl", "hue"), 37629 parse: /* @__PURE__ */ splitColor("hue", "saturation", "lightness"), 37630 transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => { 37631 return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")"; 37632 } 37633 }; 37634 const color = { 37635 test: (v2) => rgba.test(v2) || hex.test(v2) || hsla.test(v2), 37636 parse: (v2) => { 37637 if (rgba.test(v2)) { 37638 return rgba.parse(v2); 37639 } else if (hsla.test(v2)) { 37640 return hsla.parse(v2); 37641 } else { 37642 return hex.parse(v2); 37643 } 37644 }, 37645 transform: (v2) => { 37646 return typeof v2 === "string" ? v2 : v2.hasOwnProperty("red") ? rgba.transform(v2) : hsla.transform(v2); 37647 } 37648 }; 37649 const colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu; 37650 function test(v2) { 37651 var _a, _b; 37652 return isNaN(v2) && typeof v2 === "string" && (((_a = v2.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = v2.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0; 37653 } 37654 const NUMBER_TOKEN = "number"; 37655 const COLOR_TOKEN = "color"; 37656 const VAR_TOKEN = "var"; 37657 const VAR_FUNCTION_TOKEN = "var("; 37658 const SPLIT_TOKEN = "${}"; 37659 const complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu; 37660 function analyseComplexValue(value) { 37661 const originalValue = value.toString(); 37662 const values = []; 37663 const indexes = { 37664 color: [], 37665 number: [], 37666 var: [] 37667 }; 37668 const types = []; 37669 let i2 = 0; 37670 const tokenised = originalValue.replace(complexRegex, (parsedValue) => { 37671 if (color.test(parsedValue)) { 37672 indexes.color.push(i2); 37673 types.push(COLOR_TOKEN); 37674 values.push(color.parse(parsedValue)); 37675 } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) { 37676 indexes.var.push(i2); 37677 types.push(VAR_TOKEN); 37678 values.push(parsedValue); 37679 } else { 37680 indexes.number.push(i2); 37681 types.push(NUMBER_TOKEN); 37682 values.push(parseFloat(parsedValue)); 37683 } 37684 ++i2; 37685 return SPLIT_TOKEN; 37686 }); 37687 const split = tokenised.split(SPLIT_TOKEN); 37688 return { values, split, indexes, types }; 37689 } 37690 function parseComplexValue(v2) { 37691 return analyseComplexValue(v2).values; 37692 } 37693 function createTransformer(source) { 37694 const { split, types } = analyseComplexValue(source); 37695 const numSections = split.length; 37696 return (v2) => { 37697 let output = ""; 37698 for (let i2 = 0; i2 < numSections; i2++) { 37699 output += split[i2]; 37700 if (v2[i2] !== void 0) { 37701 const type = types[i2]; 37702 if (type === NUMBER_TOKEN) { 37703 output += sanitize(v2[i2]); 37704 } else if (type === COLOR_TOKEN) { 37705 output += color.transform(v2[i2]); 37706 } else { 37707 output += v2[i2]; 37708 } 37709 } 37710 } 37711 return output; 37712 }; 37713 } 37714 const convertNumbersToZero = (v2) => typeof v2 === "number" ? 0 : v2; 37715 function getAnimatableNone$1(v2) { 37716 const parsed = parseComplexValue(v2); 37717 const transformer = createTransformer(v2); 37718 return transformer(parsed.map(convertNumbersToZero)); 37719 } 37720 const complex = { 37721 test, 37722 parse: parseComplexValue, 37723 createTransformer, 37724 getAnimatableNone: getAnimatableNone$1 37725 }; 37726 const maxDefaults = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]); 37727 function applyDefaultFilter(v2) { 37728 const [name, value] = v2.slice(0, -1).split("("); 37729 if (name === "drop-shadow") 37730 return v2; 37731 const [number2] = value.match(floatRegex) || []; 37732 if (!number2) 37733 return v2; 37734 const unit = value.replace(number2, ""); 37735 let defaultValue = maxDefaults.has(name) ? 1 : 0; 37736 if (number2 !== value) 37737 defaultValue *= 100; 37738 return name + "(" + defaultValue + unit + ")"; 37739 } 37740 const functionRegex = /\b([a-z-]*)\(.*?\)/gu; 37741 const filter = __spreadProps(__spreadValues({}, complex), { 37742 getAnimatableNone: (v2) => { 37743 const functions = v2.match(functionRegex); 37744 return functions ? functions.map(applyDefaultFilter).join(" ") : v2; 37745 } 37746 }); 37747 const defaultValueTypes = __spreadProps(__spreadValues({}, numberValueTypes), { 37748 // Color props 37749 color, 37750 backgroundColor: color, 37751 outlineColor: color, 37752 fill: color, 37753 stroke: color, 37754 // Border props 37755 borderColor: color, 37756 borderTopColor: color, 37757 borderRightColor: color, 37758 borderBottomColor: color, 37759 borderLeftColor: color, 37760 filter, 37761 WebkitFilter: filter 37762 }); 37763 const getDefaultValueType = (key) => defaultValueTypes[key]; 37764 function getAnimatableNone(key, value) { 37765 let defaultValueType = getDefaultValueType(key); 37766 if (defaultValueType !== filter) 37767 defaultValueType = complex; 37768 return defaultValueType.getAnimatableNone ? defaultValueType.getAnimatableNone(value) : void 0; 37769 } 37770 const invalidTemplates = /* @__PURE__ */ new Set(["auto", "none", "0"]); 37771 function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name) { 37772 let i2 = 0; 37773 let animatableTemplate = void 0; 37774 while (i2 < unresolvedKeyframes.length && !animatableTemplate) {
37775 const keyframe = unresolvedKeyframes[i2]; 37776 if (typeof keyframe === "string" && !invalidTemplates.has(keyframe) && analyseComplexValue(keyframe).values.length) { 37777 animatableTemplate = unresolvedKeyframes[i2]; 37778 } 37779 i2++; 37780 } 37781 if (animatableTemplate && name) { 37782 for (const noneIndex of noneKeyframeIndexes) { 37783 unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate); 37784 } 37785 } 37786 } 37787 const isNumOrPxType = (v2) => v2 === number$1 || v2 === px; 37788 const getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]); 37789 const getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => { 37790 if (transform2 === "none" || !transform2) 37791 return 0; 37792 const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u); 37793 if (matrix3d) { 37794 return getPosFromMatrix(matrix3d[1], pos3); 37795 } else { 37796 const matrix = transform2.match(/^matrix\((.+)\)$/u); 37797 if (matrix) { 37798 return getPosFromMatrix(matrix[1], pos2); 37799 } else { 37800 return 0; 37801 } 37802 } 37803 }; 37804 const transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]); 37805 const nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key)); 37806 function removeNonTranslationalTransform(visualElement) { 37807 const removedTransforms = []; 37808 nonTranslationalTransformKeys.forEach((key) => { 37809 const value = visualElement.getValue(key); 37810 if (value !== void 0) { 37811 removedTransforms.push([key, value.get()]); 37812 value.set(key.startsWith("scale") ? 1 : 0); 37813 } 37814 }); 37815 return removedTransforms; 37816 } 37817 const positionalValues = { 37818 // Dimensions 37819 width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight), 37820 height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom), 37821 top: (_bbox, { top }) => parseFloat(top), 37822 left: (_bbox, { left }) => parseFloat(left), 37823 bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min), 37824 right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min), 37825 // Transform 37826 x: getTranslateFromMatrix(4, 13), 37827 y: getTranslateFromMatrix(5, 14) 37828 }; 37829 positionalValues.translateX = positionalValues.x; 37830 positionalValues.translateY = positionalValues.y; 37831 const toResolve = /* @__PURE__ */ new Set(); 37832 let isScheduled = false; 37833 let anyNeedsMeasurement = false; 37834 function measureAllKeyframes() { 37835 if (anyNeedsMeasurement) { 37836 const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement); 37837 const elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)); 37838 const transformsToRestore = /* @__PURE__ */ new Map(); 37839 elementsToMeasure.forEach((element) => { 37840 const removedTransforms = removeNonTranslationalTransform(element); 37841 if (!removedTransforms.length) 37842 return; 37843 transformsToRestore.set(element, removedTransforms); 37844 element.render(); 37845 }); 37846 resolversToMeasure.forEach((resolver) => resolver.measureInitialState()); 37847 elementsToMeasure.forEach((element) => { 37848 element.render(); 37849 const restore = transformsToRestore.get(element); 37850 if (restore) { 37851 restore.forEach(([key, value]) => { 37852 var _a; 37853 (_a = element.getValue(key)) === null || _a === void 0 ? void 0 : _a.set(value); 37854 }); 37855 } 37856 }); 37857 resolversToMeasure.forEach((resolver) => resolver.measureEndState()); 37858 resolversToMeasure.forEach((resolver) => { 37859 if (resolver.suspendedScrollY !== void 0) { 37860 window.scrollTo(0, resolver.suspendedScrollY); 37861 } 37862 }); 37863 } 37864 anyNeedsMeasurement = false; 37865 isScheduled = false; 37866 toResolve.forEach((resolver) => resolver.complete()); 37867 toResolve.clear(); 37868 } 37869 function readAllKeyframes() { 37870 toResolve.forEach((resolver) => { 37871 resolver.readKeyframes(); 37872 if (resolver.needsMeasurement) { 37873 anyNeedsMeasurement = true; 37874 } 37875 }); 37876 } 37877 function flushKeyframeResolvers() { 37878 readAllKeyframes(); 37879 measureAllKeyframes(); 37880 } 37881 class KeyframeResolver { 37882 constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = false) { 37883 this.isComplete = false;
37884 this.isAsync = false; 37885 this.needsMeasurement = false; 37886 this.isScheduled = false; 37887 this.unresolvedKeyframes = [...unresolvedKeyframes]; 37888 this.onComplete = onComplete; 37889 this.name = name; 37890 this.motionValue = motionValue2; 37891 this.element = element; 37892 this.isAsync = isAsync; 37893 } 37894 scheduleResolve() { 37895 this.isScheduled = true; 37896 if (this.isAsync) { 37897 toResolve.add(this); 37898 if (!isScheduled) { 37899 isScheduled = true; 37900 frame.read(readAllKeyframes); 37901 frame.resolveKeyframes(measureAllKeyframes); 37902 } 37903 } else { 37904 this.readKeyframes(); 37905 this.complete(); 37906 } 37907 } 37908 readKeyframes() { 37909 const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this; 37910 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 37911 if (unresolvedKeyframes[i2] === null) { 37912 if (i2 === 0) { 37913 const currentValue = motionValue2 === null || motionValue2 === void 0 ? void 0 : motionValue2.get(); 37914 const finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 37915 if (currentValue !== void 0) { 37916 unresolvedKeyframes[0] = currentValue; 37917 } else if (element && name) { 37918 const valueAsRead = element.readValue(name, finalKeyframe); 37919 if (valueAsRead !== void 0 && valueAsRead !== null) { 37920 unresolvedKeyframes[0] = valueAsRead; 37921 } 37922 } 37923 if (unresolvedKeyframes[0] === void 0) { 37924 unresolvedKeyframes[0] = finalKeyframe; 37925 } 37926 if (motionValue2 && currentValue === void 0) { 37927 motionValue2.set(unresolvedKeyframes[0]); 37928 } 37929 } else { 37930 unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1]; 37931 } 37932 } 37933 } 37934 } 37935 setFinalKeyframe() { 37936 } 37937 measureInitialState() { 37938 } 37939 renderEndStyles() { 37940 } 37941 measureEndState() { 37942 } 37943 complete() { 37944 this.isComplete = true; 37945 this.onComplete(this.unresolvedKeyframes, this.finalKeyframe); 37946 toResolve.delete(this); 37947 } 37948 cancel() { 37949 if (!this.isComplete) { 37950 this.isScheduled = false; 37951 toResolve.delete(this); 37952 } 37953 } 37954 resume() { 37955 if (!this.isComplete) 37956 this.scheduleResolve(); 37957 } 37958 } 37959 const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2); 37960 const splitCSSVariableRegex = ( 37961 // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words 37962 /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u 37963 ); 37964 function parseCSSVariable(current) { 37965 const match2 = splitCSSVariableRegex.exec(current); 37966 if (!match2) 37967 return [,]; 37968 const [, token1, token2, fallback] = match2; 37969 return [`--${token1 !== null && token1 !== void 0 ? token1 : token2}`, fallback]; 37970 } 37971 function getVariableValue(current, element, depth = 1) { 37972 const [token2, fallback] = parseCSSVariable(current); 37973 if (!token2) 37974 return; 37975 const resolved = window.getComputedStyle(element).getPropertyValue(token2); 37976 if (resolved) { 37977 const trimmed = resolved.trim(); 37978 return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed; 37979 } 37980 return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback; 37981 } 37982 const testValueType = (v2) => (type) => type.test(v2); 37983 const auto = { 37984 test: (v2) => v2 === "auto", 37985 parse: (v2) => v2 37986 }; 37987 const dimensionValueTypes = [number$1, px, percent, degrees, vw, vh, auto]; 37988 const findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2)); 37989 class DOMKeyframesResolver extends KeyframeResolver { 37990 constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) { 37991 super(unresolvedKeyframes, onComplete, name, motionValue2, element, true); 37992 } 37993 readKeyframes() { 37994 const { unresolvedKeyframes, element, name } = this; 37995 if (!element || !element.current) 37996 return; 37997 super.readKeyframes(); 37998 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 37999 let keyframe = unresolvedKeyframes[i2]; 38000 if (typeof keyframe === "string") { 38001 keyframe = keyframe.trim(); 38002 if (isCSSVariableToken(keyframe)) { 38003 const resolved = getVariableValue(keyframe, element.current); 38004 if (resolved !== void 0) { 38005 unresolvedKeyframes[i2] = resolved; 38006 } 38007 if (i2 === unresolvedKeyframes.length - 1) { 38008 this.finalKeyframe = keyframe; 38009 } 38010 } 38011 } 38012 } 38013 this.resolveNoneKeyframes(); 38014 if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) { 38015 return; 38016 } 38017 const [origin2, target] = unresolvedKeyframes; 38018 const originType = findDimensionValueType(origin2); 38019 const targetType = findDimensionValueType(target); 38020 if (originType === targetType) 38021 return; 38022 if (isNumOrPxType(originType) && isNumOrPxType(targetType)) { 38023 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 38024 const value = unresolvedKeyframes[i2]; 38025 if (typeof value === "string") { 38026 unresolvedKeyframes[i2] = parseFloat(value); 38027 } 38028 } 38029 } else { 38030 this.needsMeasurement = true; 38031 } 38032 } 38033 resolveNoneKeyframes() { 38034 const { unresolvedKeyframes, name } = this; 38035 const noneKeyframeIndexes = []; 38036 for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) { 38037 if (isNone(unresolvedKeyframes[i2])) { 38038 noneKeyframeIndexes.push(i2); 38039 } 38040 } 38041 if (noneKeyframeIndexes.length) { 38042 makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, name); 38043 } 38044 } 38045 measureInitialState() { 38046 const { element, unresolvedKeyframes, name } = this; 38047 if (!element || !element.current) 38048 return; 38049 if (name === "height") { 38050 this.suspendedScrollY = window.pageYOffset; 38051 } 38052 this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 38053 unresolvedKeyframes[0] = this.measuredOrigin; 38054 const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1]; 38055 if (measureKeyframe !== void 0) { 38056 element.getValue(name, measureKeyframe).jump(measureKeyframe, false); 38057 } 38058 } 38059 measureEndState() { 38060 var _a; 38061 const { element, name, unresolvedKeyframes } = this; 38062 if (!element || !element.current) 38063 return; 38064 const value = element.getValue(name); 38065 value && value.jump(this.measuredOrigin, false); 38066 const finalKeyframeIndex = unresolvedKeyframes.length - 1; 38067 const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]; 38068 unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)); 38069 if (finalKeyframe !== null && this.finalKeyframe === void 0) { 38070 this.finalKeyframe = finalKeyframe; 38071 } 38072 if ((_a = this.removedTransforms) === null || _a === void 0 ? void 0 : _a.length) {
38073 this.removedTransforms.forEach(([unsetTransformName, unsetTransformValue]) => { 38074 element.getValue(unsetTransformName).set(unsetTransformValue); 38075 }); 38076 } 38077 this.resolveNoneKeyframes(); 38078 } 38079 } 38080 const isAnimatable = (value, name) => { 38081 if (name === "zIndex") 38082 return false; 38083 if (typeof value === "number" || Array.isArray(value)) 38084 return true; 38085 if (typeof value === "string" && // It's animatable if we have a string 38086 (complex.test(value) || value === "0") && // And it contains numbers and/or colors 38087 !value.startsWith("url(")) { 38088 return true; 38089 } 38090 return false; 38091 }; 38092 function hasKeyframesChanged(keyframes2) { 38093 const current = keyframes2[0]; 38094 if (keyframes2.length === 1) 38095 return true; 38096 for (let i2 = 0; i2 < keyframes2.length; i2++) { 38097 if (keyframes2[i2] !== current) 38098 return true; 38099 } 38100 } 38101 function canAnimate(keyframes2, name, type, velocity) { 38102 const originKeyframe = keyframes2[0]; 38103 if (originKeyframe === null) 38104 return false; 38105 if (name === "display" || name === "visibility") 38106 return true; 38107 const targetKeyframe = keyframes2[keyframes2.length - 1]; 38108 const isOriginAnimatable = isAnimatable(originKeyframe, name); 38109 const isTargetAnimatable = isAnimatable(targetKeyframe, name); 38110 if (!isOriginAnimatable || !isTargetAnimatable) { 38111 return false; 38112 } 38113 return hasKeyframesChanged(keyframes2) || (type === "spring" || isGenerator(type)) && velocity; 38114 } 38115 const isNotNull = (value) => value !== null; 38116 function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyframe) { 38117 const resolvedKeyframes = keyframes2.filter(isNotNull); 38118 const index2 = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1; 38119 return !index2 || finalKeyframe === void 0 ? resolvedKeyframes[index2] : finalKeyframe; 38120 } 38121 const MAX_RESOLVE_DELAY = 40; 38122 class BaseAnimation { 38123 constructor(_n2) { 38124 var _o2 = _n2, { autoplay = true, delay: delay2 = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop" } = _o2, options2 = __objRest(_o2, ["autoplay", "delay", "type", "repeat", "repeatDelay", "repeatType"]); 38125 this.isStopped = false; 38126 this.hasAttemptedResolve = false; 38127 this.createdAt = time.now(); 38128 this.options = __spreadValues({ 38129 autoplay, 38130 delay: delay2, 38131 type, 38132 repeat, 38133 repeatDelay, 38134 repeatType 38135 }, options2); 38136 this.updateFinishedPromise(); 38137 } 38138 /** 38139 * This method uses the createdAt and resolvedAt to calculate the 38140 * animation startTime. *Ideally*, we would use the createdAt time as t=0 38141 * as the following frame would then be the first frame of the animation in 38142 * progress, which would feel snappier. 38143 * 38144 * However, if there's a delay (main thread work) between the creation of 38145 * the animation and the first commited frame, we prefer to use resolvedAt 38146 * to avoid a sudden jump into the animation. 38147 */ 38148 calcStartTime() { 38149 if (!this.resolvedAt) 38150 return this.createdAt; 38151 return this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt; 38152 } 38153 /** 38154 * A getter for resolved data. If keyframes are not yet resolved, accessing 38155 * this.resolved will synchronously flush all pending keyframe resolvers. 38156 * This is a deoptimisation, but at its worst still batches read/writes. 38157 */ 38158 get resolved() { 38159 if (!this._resolved && !this.hasAttemptedResolve) { 38160 flushKeyframeResolvers(); 38161 } 38162 return this._resolved; 38163 } 38164 /** 38165 * A method to be called when the keyframes resolver completes. This method 38166 * will check if its possible to run the animation and, if not, skip it. 38167 * Otherwise, it will call initPlayback on the implementing class. 38168 */ 38169 onKeyframesResolved(keyframes2, finalKeyframe) { 38170 this.resolvedAt = time.now(); 38171 this.hasAttemptedResolve = true; 38172 const { name, type, velocity, delay: delay2, onComplete, onUpdate, isGenerator: isGenerator2 } = this.options;
38173 if (!isGenerator2 && !canAnimate(keyframes2, name, type, velocity)) { 38174 if (!delay2) { 38175 onUpdate && onUpdate(getFinalKeyframe(keyframes2, this.options, finalKeyframe)); 38176 onComplete && onComplete(); 38177 this.resolveFinishedPromise(); 38178 return; 38179 } else { 38180 this.options.duration = 0; 38181 } 38182 } 38183 const resolvedAnimation = this.initPlayback(keyframes2, finalKeyframe); 38184 if (resolvedAnimation === false) 38185 return; 38186 this._resolved = __spreadValues({ 38187 keyframes: keyframes2, 38188 finalKeyframe 38189 }, resolvedAnimation); 38190 this.onPostResolved(); 38191 } 38192 onPostResolved() { 38193 } 38194 /** 38195 * Allows the returned animation to be awaited or promise-chained. Currently 38196 * resolves when the animation finishes at all but in a future update could/should 38197 * reject if its cancels. 38198 */ 38199 then(resolve, reject) { 38200 return this.currentFinishedPromise.then(resolve, reject); 38201 } 38202 flatten() { 38203 this.options.type = "keyframes"; 38204 this.options.ease = "linear"; 38205 } 38206 updateFinishedPromise() { 38207 this.currentFinishedPromise = new Promise((resolve) => { 38208 this.resolveFinishedPromise = resolve; 38209 }); 38210 } 38211 } 38212 const mixNumber$1 = (from2, to2, progress2) => { 38213 return from2 + (to2 - from2) * progress2; 38214 }; 38215 function hueToRgb(p2, q2, t2) { 38216 if (t2 < 0) 38217 t2 += 1; 38218 if (t2 > 1) 38219 t2 -= 1; 38220 if (t2 < 1 / 6) 38221 return p2 + (q2 - p2) * 6 * t2; 38222 if (t2 < 1 / 2) 38223 return q2; 38224 if (t2 < 2 / 3) 38225 return p2 + (q2 - p2) * (2 / 3 - t2) * 6; 38226 return p2; 38227 } 38228 function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) { 38229 hue /= 360; 38230 saturation /= 100; 38231 lightness /= 100; 38232 let red = 0; 38233 let green = 0; 38234 let blue = 0; 38235 if (!saturation) { 38236 red = green = blue = lightness; 38237 } else { 38238 const q2 = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation; 38239 const p2 = 2 * lightness - q2; 38240 red = hueToRgb(p2, q2, hue + 1 / 3); 38241 green = hueToRgb(p2, q2, hue); 38242 blue = hueToRgb(p2, q2, hue - 1 / 3); 38243 } 38244 return { 38245 red: Math.round(red * 255), 38246 green: Math.round(green * 255), 38247 blue: Math.round(blue * 255), 38248 alpha: alpha2 38249 }; 38250 } 38251 function mixImmediate(a2, b2) { 38252 return (p2) => p2 > 0 ? b2 : a2; 38253 } 38254 const mixLinearColor = (from2, to2, v2) => { 38255 const fromExpo = from2 * from2; 38256 const expo = v2 * (to2 * to2 - fromExpo) + fromExpo; 38257 return expo < 0 ? 0 : Math.sqrt(expo); 38258 }; 38259 const colorTypes = [hex, rgba, hsla]; 38260 const getColorType = (v2) => colorTypes.find((type) => type.test(v2)); 38261 function asRGBA(color2) { 38262 const type = getColorType(color2); 38263 if (!Boolean(type)) 38264 return false; 38265 let model = type.parse(color2); 38266 if (type === hsla) { 38267 model = hslaToRgba(model); 38268 } 38269 return model; 38270 } 38271 const mixColor = (from2, to2) => { 38272 const fromRGBA = asRGBA(from2); 38273 const toRGBA = asRGBA(to2); 38274 if (!fromRGBA || !toRGBA) { 38275 return mixImmediate(from2, to2); 38276 } 38277 const blended = __spreadValues({}, fromRGBA); 38278 return (v2) => { 38279 blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v2); 38280 blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v2); 38281 blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v2); 38282 blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v2); 38283 return rgba.transform(blended); 38284 }; 38285 }; 38286 const combineFunctions = (a2, b2) => (v2) => b2(a2(v2)); 38287 const pipe = (...transformers) => transformers.reduce(combineFunctions); 38288 const invisibleValues = /* @__PURE__ */ new Set(["none", "hidden"]); 38289 function mixVisibility(origin2, target) { 38290 if (invisibleValues.has(origin2)) { 38291 return (p2) => p2 <= 0 ? origin2 : target; 38292 } else { 38293 return (p2) => p2 >= 1 ? target : origin2; 38294 } 38295 } 38296 function mixNumber(a2, b2) { 38297 return (p2) => mixNumber$1(a2, b2, p2); 38298 } 38299 function getMixer$1(a2) { 38300 if (typeof a2 === "number") { 38301 return mixNumber; 38302 } else if (typeof a2 === "string") { 38303 return isCSSVariableToken(a2) ? mixImmediate : color.test(a2) ? mixColor : mixComplex; 38304 } else if (Array.isArray(a2)) { 38305 return mixArray; 38306 } else if (typeof a2 === "object") { 38307 return color.test(a2) ? mixColor : mixObject; 38308 } 38309 return mixImmediate; 38310 } 38311 function mixArray(a2, b2) { 38312 const output = [...a2]; 38313 const numValues = output.length; 38314 const blendValue = a2.map((v2, i2) => getMixer$1(v2)(v2, b2[i2])); 38315 return (p2) => { 38316 for (let i2 = 0; i2 < numValues; i2++) { 38317 output[i2] = blendValue[i2](p2); 38318 } 38319 return output; 38320 }; 38321 } 38322 function mixObject(a2, b2) { 38323 const output = __spreadValues(__spreadValues({}, a2), b2); 38324 const blendValue = {}; 38325 for (const key in output) { 38326 if (a2[key] !== void 0 && b2[key] !== void 0) {
vendor: 18,441 bytes, lines 38327-38777
38327 blendValue[key] = getMixer$1(a2[key])(a2[key], b2[key]); 38328 } 38329 } 38330 return (v2) => { 38331 for (const key in blendValue) { 38332 output[key] = blendValue[key](v2); 38333 } 38334 return output; 38335 }; 38336 } 38337 function matchOrder(origin2, target) { 38338 var _a; 38339 const orderedOrigin = []; 38340 const pointers = { color: 0, var: 0, number: 0 }; 38341 for (let i2 = 0; i2 < target.values.length; i2++) { 38342 const type = target.types[i2]; 38343 const originIndex = origin2.indexes[type][pointers[type]]; 38344 const originValue = (_a = origin2.values[originIndex]) !== null && _a !== void 0 ? _a : 0; 38345 orderedOrigin[i2] = originValue; 38346 pointers[type]++; 38347 } 38348 return orderedOrigin; 38349 } 38350 const mixComplex = (origin2, target) => { 38351 const template = complex.createTransformer(target); 38352 const originStats = analyseComplexValue(origin2); 38353 const targetStats = analyseComplexValue(target); 38354 const canInterpolate = originStats.indexes.var.length === targetStats.indexes.var.length && originStats.indexes.color.length === targetStats.indexes.color.length && originStats.indexes.number.length >= targetStats.indexes.number.length; 38355 if (canInterpolate) { 38356 if (invisibleValues.has(origin2) && !targetStats.values.length || invisibleValues.has(target) && !originStats.values.length) { 38357 return mixVisibility(origin2, target); 38358 } 38359 return pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template); 38360 } else { 38361 return mixImmediate(origin2, target); 38362 } 38363 }; 38364 function mix(from2, to2, p2) { 38365 if (typeof from2 === "number" && typeof to2 === "number" && typeof p2 === "number") { 38366 return mixNumber$1(from2, to2, p2); 38367 } 38368 const mixer = getMixer$1(from2); 38369 return mixer(from2, to2); 38370 } 38371 const velocitySampleDuration = 5; 38372 function calcGeneratorVelocity(resolveValue, t2, current) { 38373 const prevT = Math.max(t2 - velocitySampleDuration, 0); 38374 return velocityPerSecond(current - resolveValue(prevT), t2 - prevT); 38375 } 38376 const springDefaults = { 38377 // Default spring physics 38378 stiffness: 100, 38379 damping: 10, 38380 mass: 1, 38381 velocity: 0, 38382 // Default duration/bounce-based options 38383 duration: 800, 38384 // in ms 38385 bounce: 0.3, 38386 visualDuration: 0.3, 38387 // in seconds 38388 // Rest thresholds 38389 restSpeed: { 38390 granular: 0.01, 38391 default: 2 38392 }, 38393 restDelta: { 38394 granular: 5e-3, 38395 default: 0.5 38396 }, 38397 // Limits 38398 minDuration: 0.01, 38399 // in seconds 38400 maxDuration: 10, 38401 // in seconds 38402 minDamping: 0.05, 38403 maxDamping: 1 38404 }; 38405 const safeMin = 1e-3; 38406 function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) { 38407 let envelope; 38408 let derivative; 38409 let dampingRatio = 1 - bounce; 38410 dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio); 38411 duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds(duration)); 38412 if (dampingRatio < 1) { 38413 envelope = (undampedFreq2) => { 38414 const exponentialDecay = undampedFreq2 * dampingRatio; 38415 const delta = exponentialDecay * duration; 38416 const a2 = exponentialDecay - velocity; 38417 const b2 = calcAngularFreq(undampedFreq2, dampingRatio); 38418 const c2 = Math.exp(-delta); 38419 return safeMin - a2 / b2 * c2; 38420 }; 38421 derivative = (undampedFreq2) => { 38422 const exponentialDecay = undampedFreq2 * dampingRatio; 38423 const delta = exponentialDecay * duration; 38424 const d2 = delta * velocity + velocity; 38425 const e2 = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration; 38426 const f2 = Math.exp(-delta); 38427 const g2 = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio); 38428 const factor = -envelope(undampedFreq2) + safeMin > 0 ? -1 : 1; 38429 return factor * ((d2 - e2) * f2) / g2; 38430 }; 38431 } else { 38432 envelope = (undampedFreq2) => { 38433 const a2 = Math.exp(-undampedFreq2 * duration); 38434 const b2 = (undampedFreq2 - velocity) * duration + 1; 38435 return -safeMin + a2 * b2; 38436 }; 38437 derivative = (undampedFreq2) => { 38438 const a2 = Math.exp(-undampedFreq2 * duration); 38439 const b2 = (velocity - undampedFreq2) * (duration * duration); 38440 return a2 * b2; 38441 }; 38442 } 38443 const initialGuess = 5 / duration; 38444 const undampedFreq = approximateRoot(envelope, derivative, initialGuess); 38445 duration = /* @__PURE__ */ secondsToMilliseconds(duration); 38446 if (isNaN(undampedFreq)) { 38447 return { 38448 stiffness: springDefaults.stiffness, 38449 damping: springDefaults.damping, 38450 duration 38451 }; 38452 } else { 38453 const stiffness = Math.pow(undampedFreq, 2) * mass; 38454 return { 38455 stiffness, 38456 damping: dampingRatio * 2 * Math.sqrt(mass * stiffness), 38457 duration 38458 }; 38459 } 38460 } 38461 const rootIterations = 12; 38462 function approximateRoot(envelope, derivative, initialGuess) { 38463 let result = initialGuess; 38464 for (let i2 = 1; i2 < rootIterations; i2++) { 38465 result = result - envelope(result) / derivative(result); 38466 } 38467 return result; 38468 } 38469 function calcAngularFreq(undampedFreq, dampingRatio) { 38470 return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio); 38471 } 38472 const durationKeys = ["duration", "bounce"]; 38473 const physicsKeys = ["stiffness", "damping", "mass"]; 38474 function isSpringType(options2, keys2) { 38475 return keys2.some((key) => options2[key] !== void 0); 38476 } 38477 function getSpringOptions(options2) { 38478 let springOptions = __spreadValues({ 38479 velocity: springDefaults.velocity, 38480 stiffness: springDefaults.stiffness, 38481 damping: springDefaults.damping, 38482 mass: springDefaults.mass, 38483 isResolvedFromDuration: false 38484 }, options2); 38485 if (!isSpringType(options2, physicsKeys) && isSpringType(options2, durationKeys)) { 38486 if (options2.visualDuration) { 38487 const visualDuration = options2.visualDuration; 38488 const root2 = 2 * Math.PI / (visualDuration * 1.2); 38489 const stiffness = root2 * root2; 38490 const damping = 2 * clamp(0.05, 1, 1 - (options2.bounce || 0)) * Math.sqrt(stiffness); 38491 springOptions = __spreadProps(__spreadValues({}, springOptions), { 38492 mass: springDefaults.mass, 38493 stiffness, 38494 damping 38495 }); 38496 } else { 38497 const derived = findSpring(options2); 38498 springOptions = __spreadProps(__spreadValues(__spreadValues({}, springOptions), derived), { 38499 mass: springDefaults.mass 38500 }); 38501 springOptions.isResolvedFromDuration = true; 38502 } 38503 } 38504 return springOptions; 38505 } 38506 function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) { 38507 const options2 = typeof optionsOrVisualDuration !== "object" ? { 38508 visualDuration: optionsOrVisualDuration, 38509 keyframes: [0, 1], 38510 bounce 38511 } : optionsOrVisualDuration; 38512 let { restSpeed, restDelta } = options2; 38513 const origin2 = options2.keyframes[0]; 38514 const target = options2.keyframes[options2.keyframes.length - 1]; 38515 const state = { done: false, value: origin2 }; 38516 const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions(__spreadProps(__spreadValues({}, options2), { 38517 velocity: -/* @__PURE__ */ millisecondsToSeconds(options2.velocity || 0) 38518 })); 38519 const initialVelocity = velocity || 0; 38520 const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); 38521 const initialDelta = target - origin2; 38522 const undampedAngularFreq = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(stiffness / mass)); 38523 const isGranularScale = Math.abs(initialDelta) < 5; 38524 restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default); 38525 restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default); 38526 let resolveSpring; 38527 if (dampingRatio < 1) { 38528 const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); 38529 resolveSpring = (t2) => { 38530 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2); 38531 return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t2) + initialDelta * Math.cos(angularFreq * t2)); 38532 }; 38533 } else if (dampingRatio === 1) { 38534 resolveSpring = (t2) => target - Math.exp(-undampedAngularFreq * t2) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t2); 38535 } else { 38536 const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); 38537 resolveSpring = (t2) => { 38538 const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2); 38539 const freqForT = Math.min(dampedAngularFreq * t2, 300); 38540 return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq; 38541 }; 38542 } 38543 const generator = { 38544 calculatedDuration: isResolvedFromDuration ? duration || null : null, 38545 next: (t2) => { 38546 const current = resolveSpring(t2); 38547 if (!isResolvedFromDuration) { 38548 let currentVelocity = 0; 38549 if (dampingRatio < 1) { 38550 currentVelocity = t2 === 0 ? /* @__PURE__ */ secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current); 38551 } 38552 const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; 38553 const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta; 38554 state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; 38555 } else { 38556 state.done = t2 >= duration; 38557 } 38558 state.value = state.done ? target : current; 38559 return state; 38560 }, 38561 toString: () => { 38562 const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration); 38563 const easing = generateLinearEasing((progress2) => generator.next(calculatedDuration * progress2).value, calculatedDuration, 30); 38564 return calculatedDuration + "ms " + easing; 38565 } 38566 }; 38567 return generator; 38568 } 38569 function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min: min2, max: max2, restDelta = 0.5, restSpeed }) { 38570 const origin2 = keyframes2[0]; 38571 const state = { 38572 done: false, 38573 value: origin2 38574 }; 38575 const isOutOfBounds = (v2) => min2 !== void 0 && v2 < min2 || max2 !== void 0 && v2 > max2; 38576 const nearestBoundary = (v2) => { 38577 if (min2 === void 0) 38578 return max2; 38579 if (max2 === void 0) 38580 return min2; 38581 return Math.abs(min2 - v2) < Math.abs(max2 - v2) ? min2 : max2; 38582 }; 38583 let amplitude = power * velocity; 38584 const ideal = origin2 + amplitude; 38585 const target = modifyTarget === void 0 ? ideal : modifyTarget(ideal); 38586 if (target !== ideal) 38587 amplitude = target - origin2; 38588 const calcDelta = (t2) => -amplitude * Math.exp(-t2 / timeConstant); 38589 const calcLatest = (t2) => target + calcDelta(t2); 38590 const applyFriction = (t2) => { 38591 const delta = calcDelta(t2); 38592 const latest = calcLatest(t2); 38593 state.done = Math.abs(delta) <= restDelta; 38594 state.value = state.done ? target : latest; 38595 }; 38596 let timeReachedBoundary; 38597 let spring$1; 38598 const checkCatchBoundary = (t2) => { 38599 if (!isOutOfBounds(state.value)) 38600 return; 38601 timeReachedBoundary = t2; 38602 spring$1 = spring({ 38603 keyframes: [state.value, nearestBoundary(state.value)], 38604 velocity: calcGeneratorVelocity(calcLatest, t2, state.value), 38605 // TODO: This should be passing * 1000 38606 damping: bounceDamping, 38607 stiffness: bounceStiffness, 38608 restDelta, 38609 restSpeed 38610 }); 38611 }; 38612 checkCatchBoundary(0); 38613 return { 38614 calculatedDuration: null, 38615 next: (t2) => { 38616 let hasUpdatedFrame = false; 38617 if (!spring$1 && timeReachedBoundary === void 0) { 38618 hasUpdatedFrame = true; 38619 applyFriction(t2); 38620 checkCatchBoundary(t2); 38621 } 38622 if (timeReachedBoundary !== void 0 && t2 >= timeReachedBoundary) { 38623 return spring$1.next(t2 - timeReachedBoundary); 38624 } else { 38625 !hasUpdatedFrame && applyFriction(t2); 38626 return state; 38627 } 38628 } 38629 }; 38630 } 38631 const easeIn = /* @__PURE__ */ cubicBezier(0.42, 0, 1, 1); 38632 const easeOut = /* @__PURE__ */ cubicBezier(0, 0, 0.58, 1); 38633 const easeInOut = /* @__PURE__ */ cubicBezier(0.42, 0, 0.58, 1); 38634 const isEasingArray = (ease2) => { 38635 return Array.isArray(ease2) && typeof ease2[0] !== "number"; 38636 }; 38637 const easingLookup = { 38638 linear: noop$3, 38639 easeIn, 38640 easeInOut, 38641 easeOut, 38642 circIn, 38643 circInOut, 38644 circOut, 38645 backIn, 38646 backInOut, 38647 backOut, 38648 anticipate 38649 }; 38650 const easingDefinitionToFunction = (definition) => { 38651 if (isBezierDefinition(definition)) { 38652 invariant(definition.length === 4); 38653 const [x1, y1, x2, y2] = definition; 38654 return cubicBezier(x1, y1, x2, y2); 38655 } else if (typeof definition === "string") { 38656 return easingLookup[definition]; 38657 } 38658 return definition; 38659 }; 38660 function createMixers(output, ease2, customMixer) { 38661 const mixers = []; 38662 const mixerFactory = customMixer || mix; 38663 const numMixers = output.length - 1; 38664 for (let i2 = 0; i2 < numMixers; i2++) { 38665 let mixer = mixerFactory(output[i2], output[i2 + 1]); 38666 if (ease2) { 38667 const easingFunction = Array.isArray(ease2) ? ease2[i2] || noop$3 : ease2; 38668 mixer = pipe(easingFunction, mixer); 38669 } 38670 mixers.push(mixer); 38671 } 38672 return mixers; 38673 } 38674 function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer } = {}) { 38675 const inputLength = input.length; 38676 invariant(inputLength === output.length); 38677 if (inputLength === 1) 38678 return () => output[0]; 38679 if (inputLength === 2 && output[0] === output[1]) 38680 return () => output[1]; 38681 const isZeroDeltaRange = input[0] === input[1]; 38682 if (input[0] > input[inputLength - 1]) { 38683 input = [...input].reverse(); 38684 output = [...output].reverse(); 38685 } 38686 const mixers = createMixers(output, ease2, mixer); 38687 const numMixers = mixers.length; 38688 const interpolator = (v2) => { 38689 if (isZeroDeltaRange && v2 < input[0]) 38690 return output[0]; 38691 let i2 = 0; 38692 if (numMixers > 1) { 38693 for (; i2 < input.length - 2; i2++) { 38694 if (v2 < input[i2 + 1]) 38695 break; 38696 } 38697 } 38698 const progressInRange = /* @__PURE__ */ progress(input[i2], input[i2 + 1], v2); 38699 return mixers[i2](progressInRange); 38700 }; 38701 return isClamp ? (v2) => interpolator(clamp(input[0], input[inputLength - 1], v2)) : interpolator; 38702 } 38703 function fillOffset(offset2, remaining) { 38704 const min2 = offset2[offset2.length - 1]; 38705 for (let i2 = 1; i2 <= remaining; i2++) { 38706 const offsetProgress = /* @__PURE__ */ progress(0, remaining, i2); 38707 offset2.push(mixNumber$1(min2, 1, offsetProgress)); 38708 } 38709 } 38710 function defaultOffset(arr) { 38711 const offset2 = [0]; 38712 fillOffset(offset2, arr.length - 1); 38713 return offset2; 38714 } 38715 function convertOffsetToTimes(offset2, duration) { 38716 return offset2.map((o2) => o2 * duration); 38717 } 38718 function defaultEasing(values, easing) { 38719 return values.map(() => easing || easeInOut).splice(0, values.length - 1); 38720 } 38721 function keyframes({ duration = 300, keyframes: keyframeValues, times, ease: ease2 = "easeInOut" }) { 38722 const easingFunctions = isEasingArray(ease2) ? ease2.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease2); 38723 const state = { 38724 done: false, 38725 value: keyframeValues[0] 38726 }; 38727 const absoluteTimes = convertOffsetToTimes( 38728 // Only use the provided offsets if they're the correct length 38729 // TODO Maybe we should warn here if there's a length mismatch 38730 times && times.length === keyframeValues.length ? times : defaultOffset(keyframeValues), 38731 duration 38732 ); 38733 const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, { 38734 ease: Array.isArray(easingFunctions) ? easingFunctions : defaultEasing(keyframeValues, easingFunctions) 38735 }); 38736 return { 38737 calculatedDuration: duration, 38738 next: (t2) => { 38739 state.value = mapTimeToKeyframe(t2); 38740 state.done = t2 >= duration; 38741 return state; 38742 } 38743 }; 38744 } 38745 const frameloopDriver = (update2) => { 38746 const passTimestamp = ({ timestamp }) => update2(timestamp); 38747 return { 38748 start: () => frame.update(passTimestamp, true), 38749 stop: () => cancelFrame(passTimestamp), 38750 /** 38751 * If we're processing this frame we can use the 38752 * framelocked timestamp to keep things in sync. 38753 */ 38754 now: () => frameData.isProcessing ? frameData.timestamp : time.now() 38755 }; 38756 }; 38757 const generators = { 38758 decay: inertia, 38759 inertia, 38760 tween: keyframes, 38761 keyframes, 38762 spring 38763 }; 38764 const percentToProgress = (percent2) => percent2 / 100; 38765 class MainThreadAnimation extends BaseAnimation { 38766 constructor(options2) { 38767 super(options2); 38768 this.holdTime = null; 38769 this.cancelTime = null; 38770 this.currentTime = 0; 38771 this.playbackSpeed = 1; 38772 this.pendingPlayState = "running"; 38773 this.startTime = null; 38774 this.state = "idle"; 38775 this.stop = () => { 38776 this.resolver.cancel(); 38777 this.isStopped = true;
38778 if (this.state === "idle") 38779 return; 38780 this.teardown(); 38781 const { onStop } = this.options; 38782 onStop && onStop(); 38783 }; 38784 const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options; 38785 const KeyframeResolver$1 = (element === null || element === void 0 ? void 0 : element.KeyframeResolver) || KeyframeResolver; 38786 const onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe); 38787 this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2, element); 38788 this.resolver.scheduleResolve(); 38789 } 38790 flatten() { 38791 super.flatten(); 38792 if (this._resolved) { 38793 Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes)); 38794 } 38795 } 38796 initPlayback(keyframes$1) { 38797 const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = this.options; 38798 const generatorFactory = isGenerator(type) ? type : generators[type] || keyframes; 38799 let mapPercentToKeyframes; 38800 let mirroredGenerator; 38801 if (generatorFactory !== keyframes && typeof keyframes$1[0] !== "number") { 38802 mapPercentToKeyframes = pipe(percentToProgress, mix(keyframes$1[0], keyframes$1[1])); 38803 keyframes$1 = [0, 100]; 38804 } 38805 const generator = generatorFactory(__spreadProps(__spreadValues({}, this.options), { keyframes: keyframes$1 })); 38806 if (repeatType === "mirror") { 38807 mirroredGenerator = generatorFactory(__spreadProps(__spreadValues({}, this.options), { 38808 keyframes: [...keyframes$1].reverse(), 38809 velocity: -velocity 38810 })); 38811 } 38812 if (generator.calculatedDuration === null) { 38813 generator.calculatedDuration = calcGeneratorDuration(generator); 38814 } 38815 const { calculatedDuration } = generator; 38816 const resolvedDuration = calculatedDuration + repeatDelay; 38817 const totalDuration = resolvedDuration * (repeat + 1) - repeatDelay; 38818 return { 38819 generator, 38820 mirroredGenerator, 38821 mapPercentToKeyframes, 38822 calculatedDuration, 38823 resolvedDuration, 38824 totalDuration 38825 }; 38826 } 38827 onPostResolved() { 38828 const { autoplay = true } = this.options; 38829 this.play(); 38830 if (this.pendingPlayState === "paused" || !autoplay) { 38831 this.pause(); 38832 } else { 38833 this.state = this.pendingPlayState; 38834 } 38835 } 38836 tick(timestamp, sample = false) { 38837 const { resolved } = this; 38838 if (!resolved) { 38839 const { keyframes: keyframes3 } = this.options; 38840 return { done: true, value: keyframes3[keyframes3.length - 1] }; 38841 } 38842 const { finalKeyframe, generator, mirroredGenerator, mapPercentToKeyframes, keyframes: keyframes2, calculatedDuration, totalDuration, resolvedDuration } = resolved; 38843 if (this.startTime === null) 38844 return generator.next(0); 38845 const { delay: delay2, repeat, repeatType, repeatDelay, onUpdate } = this.options; 38846 if (this.speed > 0) { 38847 this.startTime = Math.min(this.startTime, timestamp); 38848 } else if (this.speed < 0) { 38849 this.startTime = Math.min(timestamp - totalDuration / this.speed, this.startTime); 38850 } 38851 if (sample) { 38852 this.currentTime = timestamp; 38853 } else if (this.holdTime !== null) { 38854 this.currentTime = this.holdTime; 38855 } else { 38856 this.currentTime = Math.round(timestamp - this.startTime) * this.speed; 38857 } 38858 const timeWithoutDelay = this.currentTime - delay2 * (this.speed >= 0 ? 1 : -1); 38859 const isInDelayPhase = this.speed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration; 38860 this.currentTime = Math.max(timeWithoutDelay, 0); 38861 if (this.state === "finished" && this.holdTime === null) { 38862 this.currentTime = totalDuration; 38863 } 38864 let elapsed = this.currentTime; 38865 let frameGenerator = generator; 38866 if (repeat) { 38867 const progress2 = Math.min(this.currentTime, totalDuration) / resolvedDuration; 38868 let currentIteration = Math.floor(progress2); 38869 let iterationProgress = progress2 % 1; 38870 if (!iterationProgress && progress2 >= 1) { 38871 iterationProgress = 1; 38872 } 38873 iterationProgress === 1 && currentIteration--; 38874 currentIteration = Math.min(currentIteration, repeat + 1); 38875 const isOddIteration = Boolean(currentIteration % 2); 38876 if (isOddIteration) { 38877 if (repeatType === "reverse") { 38878 iterationProgress = 1 - iterationProgress; 38879 if (repeatDelay) { 38880 iterationProgress -= repeatDelay / resolvedDuration; 38881 } 38882 } else if (repeatType === "mirror") { 38883 frameGenerator = mirroredGenerator; 38884 } 38885 }
38886 elapsed = clamp(0, 1, iterationProgress) * resolvedDuration; 38887 } 38888 const state = isInDelayPhase ? { done: false, value: keyframes2[0] } : frameGenerator.next(elapsed); 38889 if (mapPercentToKeyframes) { 38890 state.value = mapPercentToKeyframes(state.value); 38891 } 38892 let { done } = state; 38893 if (!isInDelayPhase && calculatedDuration !== null) { 38894 done = this.speed >= 0 ? this.currentTime >= totalDuration : this.currentTime <= 0; 38895 } 38896 const isAnimationFinished = this.holdTime === null && (this.state === "finished" || this.state === "running" && done); 38897 if (isAnimationFinished && finalKeyframe !== void 0) { 38898 state.value = getFinalKeyframe(keyframes2, this.options, finalKeyframe); 38899 } 38900 if (onUpdate) { 38901 onUpdate(state.value); 38902 } 38903 if (isAnimationFinished) { 38904 this.finish(); 38905 } 38906 return state; 38907 } 38908 get duration() { 38909 const { resolved } = this; 38910 return resolved ? /* @__PURE__ */ millisecondsToSeconds(resolved.calculatedDuration) : 0; 38911 } 38912 get time() { 38913 return /* @__PURE__ */ millisecondsToSeconds(this.currentTime); 38914 } 38915 set time(newTime) { 38916 newTime = /* @__PURE__ */ secondsToMilliseconds(newTime); 38917 this.currentTime = newTime; 38918 if (this.holdTime !== null || this.speed === 0) { 38919 this.holdTime = newTime; 38920 } else if (this.driver) { 38921 this.startTime = this.driver.now() - newTime / this.speed; 38922 } 38923 } 38924 get speed() { 38925 return this.playbackSpeed; 38926 } 38927 set speed(newSpeed) { 38928 const hasChanged = this.playbackSpeed !== newSpeed; 38929 this.playbackSpeed = newSpeed; 38930 if (hasChanged) { 38931 this.time = /* @__PURE__ */ millisecondsToSeconds(this.currentTime); 38932 } 38933 } 38934 play() { 38935 if (!this.resolver.isScheduled) { 38936 this.resolver.resume(); 38937 } 38938 if (!this._resolved) { 38939 this.pendingPlayState = "running"; 38940 return; 38941 } 38942 if (this.isStopped) 38943 return; 38944 const { driver = frameloopDriver, onPlay, startTime } = this.options; 38945 if (!this.driver) { 38946 this.driver = driver((timestamp) => this.tick(timestamp)); 38947 } 38948 onPlay && onPlay(); 38949 const now2 = this.driver.now(); 38950 if (this.holdTime !== null) { 38951 this.startTime = now2 - this.holdTime; 38952 } else if (!this.startTime) { 38953 this.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 38954 } else if (this.state === "finished") { 38955 this.startTime = now2; 38956 } 38957 if (this.state === "finished") { 38958 this.updateFinishedPromise(); 38959 } 38960 this.cancelTime = this.startTime; 38961 this.holdTime = null; 38962 this.state = "running"; 38963 this.driver.start(); 38964 } 38965 pause() { 38966 var _a; 38967 if (!this._resolved) { 38968 this.pendingPlayState = "paused"; 38969 return; 38970 } 38971 this.state = "paused"; 38972 this.holdTime = (_a = this.currentTime) !== null && _a !== void 0 ? _a : 0; 38973 } 38974 complete() { 38975 if (this.state !== "running") { 38976 this.play(); 38977 } 38978 this.pendingPlayState = this.state = "finished"; 38979 this.holdTime = null; 38980 } 38981 finish() { 38982 this.teardown(); 38983 this.state = "finished"; 38984 const { onComplete } = this.options; 38985 onComplete && onComplete(); 38986 } 38987 cancel() { 38988 if (this.cancelTime !== null) { 38989 this.tick(this.cancelTime); 38990 } 38991 this.teardown(); 38992 this.updateFinishedPromise(); 38993 } 38994 teardown() { 38995 this.state = "idle"; 38996 this.stopDriver(); 38997 this.resolveFinishedPromise(); 38998 this.updateFinishedPromise(); 38999 this.startTime = this.cancelTime = null; 39000 this.resolver.cancel(); 39001 } 39002 stopDriver() { 39003 if (!this.driver) 39004 return; 39005 this.driver.stop(); 39006 this.driver = void 0; 39007 } 39008 sample(time2) { 39009 this.startTime = 0; 39010 return this.tick(time2, true); 39011 } 39012 } 39013 const acceleratedValues = /* @__PURE__ */ new Set([ 39014 "opacity", 39015 "clipPath", 39016 "filter", 39017 "transform" 39018 // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved 39019 // or until we implement support for linear() easing. 39020 // "background-color" 39021 ]); 39022 function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2 = "easeInOut", times } = {}) {
39023 const keyframeOptions = { [valueName]: keyframes2 }; 39024 if (times) 39025 keyframeOptions.offset = times; 39026 const easing = mapEasingToNativeEasing(ease2, duration); 39027 if (Array.isArray(easing)) 39028 keyframeOptions.easing = easing; 39029 return element.animate(keyframeOptions, { 39030 delay: delay2, 39031 duration, 39032 easing: !Array.isArray(easing) ? easing : "linear", 39033 fill: "both", 39034 iterations: repeat + 1, 39035 direction: repeatType === "reverse" ? "alternate" : "normal" 39036 }); 39037 } 39038 const supportsWaapi = /* @__PURE__ */ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate")); 39039 const sampleDelta = 10; 39040 const maxDuration = 2e4; 39041 function requiresPregeneratedKeyframes(options2) { 39042 return isGenerator(options2.type) || options2.type === "spring" || !isWaapiSupportedEasing(options2.ease); 39043 } 39044 function pregenerateKeyframes(keyframes2, options2) { 39045 const sampleAnimation = new MainThreadAnimation(__spreadProps(__spreadValues({}, options2), { 39046 keyframes: keyframes2, 39047 repeat: 0, 39048 delay: 0, 39049 isGenerator: true 39050 })); 39051 let state = { done: false, value: keyframes2[0] }; 39052 const pregeneratedKeyframes = []; 39053 let t2 = 0; 39054 while (!state.done && t2 < maxDuration) { 39055 state = sampleAnimation.sample(t2); 39056 pregeneratedKeyframes.push(state.value); 39057 t2 += sampleDelta; 39058 } 39059 return { 39060 times: void 0, 39061 keyframes: pregeneratedKeyframes, 39062 duration: t2 - sampleDelta, 39063 ease: "linear" 39064 }; 39065 } 39066 const unsupportedEasingFunctions = { 39067 anticipate, 39068 backInOut, 39069 circInOut 39070 }; 39071 function isUnsupportedEase(key) { 39072 return key in unsupportedEasingFunctions; 39073 } 39074 class AcceleratedAnimation extends BaseAnimation { 39075 constructor(options2) { 39076 super(options2); 39077 const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options; 39078 this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element); 39079 this.resolver.scheduleResolve(); 39080 } 39081 initPlayback(keyframes2, finalKeyframe) { 39082 let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options; 39083 if (!motionValue2.owner || !motionValue2.owner.current) { 39084 return false; 39085 } 39086 if (typeof ease2 === "string" && supportsLinearEasing() && isUnsupportedEase(ease2)) { 39087 ease2 = unsupportedEasingFunctions[ease2]; 39088 } 39089 if (requiresPregeneratedKeyframes(this.options)) { 39090 const _a = this.options, { onComplete, onUpdate, motionValue: motionValue3, element } = _a, options2 = __objRest(_a, ["onComplete", "onUpdate", "motionValue", "element"]); 39091 const pregeneratedAnimation = pregenerateKeyframes(keyframes2, options2); 39092 keyframes2 = pregeneratedAnimation.keyframes; 39093 if (keyframes2.length === 1) { 39094 keyframes2[1] = keyframes2[0]; 39095 } 39096 duration = pregeneratedAnimation.duration; 39097 times = pregeneratedAnimation.times; 39098 ease2 = pregeneratedAnimation.ease; 39099 type = "keyframes"; 39100 } 39101 const animation = startWaapiAnimation(motionValue2.owner.current, name, keyframes2, __spreadProps(__spreadValues({}, this.options), { duration, times, ease: ease2 })); 39102 animation.startTime = startTime !== null && startTime !== void 0 ? startTime : this.calcStartTime(); 39103 if (this.pendingTimeline) { 39104 attachTimeline(animation, this.pendingTimeline); 39105 this.pendingTimeline = void 0; 39106 } else { 39107 animation.onfinish = () => { 39108 const { onComplete } = this.options; 39109 motionValue2.set(getFinalKeyframe(keyframes2, this.options, finalKeyframe)); 39110 onComplete && onComplete(); 39111 this.cancel(); 39112 this.resolveFinishedPromise(); 39113 }; 39114 } 39115 return { 39116 animation, 39117 duration, 39118 times, 39119 type, 39120 ease: ease2, 39121 keyframes: keyframes2 39122 }; 39123 } 39124 get duration() { 39125 const { resolved } = this; 39126 if (!resolved) 39127 return 0; 39128 const { duration } = resolved; 39129 return /* @__PURE__ */ millisecondsToSeconds(duration); 39130 } 39131 get time() { 39132 const { resolved } = this; 39133 if (!resolved) 39134 return 0; 39135 const { animation } = resolved; 39136 return /* @__PURE__ */ millisecondsToSeconds(animation.currentTime || 0); 39137 } 39138 set time(newTime) { 39139 const { resolved } = this; 39140 if (!resolved) 39141 return; 39142 const { animation } = resolved; 39143 animation.currentTime = /* @__PURE__ */ secondsToMilliseconds(newTime); 39144 } 39145 get speed() { 39146 const { resolved } = this; 39147 if (!resolved) 39148 return 1; 39149 const { animation } = resolved; 39150 return animation.playbackRate; 39151 } 39152 set speed(newSpeed) { 39153 const { resolved } = this; 39154 if (!resolved) 39155 return; 39156 const { animation } = resolved; 39157 animation.playbackRate = newSpeed; 39158 } 39159 get state() { 39160 const { resolved } = this; 39161 if (!resolved) 39162 return "idle"; 39163 const { animation } = resolved; 39164 return animation.playState; 39165 } 39166 get startTime() { 39167 const { resolved } = this; 39168 if (!resolved) 39169 return null; 39170 const { animation } = resolved; 39171 return animation.startTime; 39172 } 39173 /** 39174 * Replace the default DocumentTimeline with another AnimationTimeline. 39175 * Currently used for scroll animations. 39176 */ 39177 attachTimeline(timeline) { 39178 if (!this._resolved) { 39179 this.pendingTimeline = timeline; 39180 } else { 39181 const { resolved } = this; 39182 if (!resolved) 39183 return noop$3; 39184 const { animation } = resolved; 39185 attachTimeline(animation, timeline); 39186 } 39187 return noop$3; 39188 } 39189 play() { 39190 if (this.isStopped) 39191 return; 39192 const { resolved } = this; 39193 if (!resolved) 39194 return; 39195 const { animation } = resolved; 39196 if (animation.playState === "finished") {
39197 this.updateFinishedPromise(); 39198 } 39199 animation.play(); 39200 } 39201 pause() { 39202 const { resolved } = this; 39203 if (!resolved) 39204 return; 39205 const { animation } = resolved; 39206 animation.pause(); 39207 } 39208 stop() { 39209 this.resolver.cancel(); 39210 this.isStopped = true; 39211 if (this.state === "idle") 39212 return; 39213 this.resolveFinishedPromise(); 39214 this.updateFinishedPromise(); 39215 const { resolved } = this; 39216 if (!resolved) 39217 return; 39218 const { animation, keyframes: keyframes2, duration, type, ease: ease2, times } = resolved; 39219 if (animation.playState === "idle" || animation.playState === "finished") { 39220 return; 39221 } 39222 if (this.time) { 39223 const _a = this.options, { motionValue: motionValue2, onUpdate, onComplete, element } = _a, options2 = __objRest(_a, ["motionValue", "onUpdate", "onComplete", "element"]); 39224 const sampleAnimation = new MainThreadAnimation(__spreadProps(__spreadValues({}, options2), { 39225 keyframes: keyframes2, 39226 duration, 39227 type, 39228 ease: ease2, 39229 times, 39230 isGenerator: true 39231 })); 39232 const sampleTime = /* @__PURE__ */ secondsToMilliseconds(this.time); 39233 motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta); 39234 } 39235 const { onStop } = this.options; 39236 onStop && onStop(); 39237 this.cancel(); 39238 } 39239 complete() { 39240 const { resolved } = this; 39241 if (!resolved) 39242 return; 39243 resolved.animation.finish(); 39244 } 39245 cancel() { 39246 const { resolved } = this; 39247 if (!resolved) 39248 return; 39249 resolved.animation.cancel(); 39250 } 39251 static supports(options2) { 39252 const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options2; 39253 if (!motionValue2 || !motionValue2.owner || !(motionValue2.owner.current instanceof HTMLElement)) { 39254 return false; 39255 } 39256 const { onUpdate, transformTemplate } = motionValue2.owner.getProps(); 39257 return supportsWaapi() && name && acceleratedValues.has(name) && /** 39258 * If we're outputting values to onUpdate then we can't use WAAPI as there's 39259 * no way to read the value from WAAPI every frame. 39260 */ 39261 !onUpdate && !transformTemplate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia"; 39262 } 39263 } 39264 const underDampedSpring = { 39265 type: "spring", 39266 stiffness: 500, 39267 damping: 25, 39268 restSpeed: 10 39269 }; 39270 const criticallyDampedSpring = (target) => ({ 39271 type: "spring", 39272 stiffness: 550, 39273 damping: target === 0 ? 2 * Math.sqrt(550) : 30, 39274 restSpeed: 10 39275 }); 39276 const keyframesTransition = { 39277 type: "keyframes", 39278 duration: 0.8 39279 }; 39280 const ease = { 39281 type: "keyframes", 39282 ease: [0.25, 0.1, 0.35, 1], 39283 duration: 0.3 39284 }; 39285 const getDefaultTransition = (valueKey, { keyframes: keyframes2 }) => { 39286 if (keyframes2.length > 2) { 39287 return keyframesTransition; 39288 } else if (transformProps.has(valueKey)) { 39289 return valueKey.startsWith("scale") ? criticallyDampedSpring(keyframes2[1]) : underDampedSpring; 39290 } 39291 return ease; 39292 }; 39293 function isTransitionDefined(_p) { 39294 var _q = _p, { when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from: from2, elapsed } = _q, transition = __objRest(_q, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from", "elapsed"]); 39295 return !!Object.keys(transition).length; 39296 } 39297 const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => { 39298 const valueTransition = getValueTransition(transition, name) || {}; 39299 const delay2 = valueTransition.delay || transition.delay || 0;
39300 let { elapsed = 0 } = transition; 39301 elapsed = elapsed - /* @__PURE__ */ secondsToMilliseconds(delay2); 39302 let options2 = __spreadProps(__spreadValues({ 39303 keyframes: Array.isArray(target) ? target : [null, target], 39304 ease: "easeOut", 39305 velocity: value.getVelocity() 39306 }, valueTransition), { 39307 delay: -elapsed, 39308 onUpdate: (v2) => { 39309 value.set(v2); 39310 valueTransition.onUpdate && valueTransition.onUpdate(v2); 39311 }, 39312 onComplete: () => { 39313 onComplete(); 39314 valueTransition.onComplete && valueTransition.onComplete(); 39315 }, 39316 name, 39317 motionValue: value, 39318 element: isHandoff ? void 0 : element 39319 }); 39320 if (!isTransitionDefined(valueTransition)) { 39321 options2 = __spreadValues(__spreadValues({}, options2), getDefaultTransition(name, options2)); 39322 } 39323 if (options2.duration) { 39324 options2.duration = /* @__PURE__ */ secondsToMilliseconds(options2.duration); 39325 } 39326 if (options2.repeatDelay) { 39327 options2.repeatDelay = /* @__PURE__ */ secondsToMilliseconds(options2.repeatDelay); 39328 } 39329 if (options2.from !== void 0) { 39330 options2.keyframes[0] = options2.from; 39331 } 39332 let shouldSkip = false; 39333 if (options2.type === false || options2.duration === 0 && !options2.repeatDelay) { 39334 options2.duration = 0; 39335 if (options2.delay === 0) { 39336 shouldSkip = true; 39337 } 39338 } 39339 if (shouldSkip && !isHandoff && value.get() !== void 0) { 39340 const finalKeyframe = getFinalKeyframe(options2.keyframes, valueTransition); 39341 if (finalKeyframe !== void 0) { 39342 frame.update(() => { 39343 options2.onUpdate(finalKeyframe); 39344 options2.onComplete(); 39345 }); 39346 return new GroupPlaybackControls([]); 39347 } 39348 } 39349 if (!isHandoff && AcceleratedAnimation.supports(options2)) { 39350 return new AcceleratedAnimation(options2); 39351 } else { 39352 return new MainThreadAnimation(options2); 39353 } 39354 }; 39355 function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) { 39356 const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; 39357 needsAnimating[key] = false; 39358 return shouldBlock; 39359 } 39360 function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0, transitionOverride, type } = {}) { 39361 var _a; 39362 let _a2 = targetAndTransition, { transition = visualElement.getDefaultTransition(), transitionEnd } = _a2, target = __objRest(_a2, ["transition", "transitionEnd"]); 39363 if (transitionOverride) 39364 transition = transitionOverride; 39365 const animations2 = []; 39366 const animationTypeState = type && visualElement.animationState && visualElement.animationState.getState()[type]; 39367 for (const key in target) { 39368 const value = visualElement.getValue(key, (_a = visualElement.latestValues[key]) !== null && _a !== void 0 ? _a : null); 39369 const valueTarget = target[key]; 39370 if (valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { 39371 continue; 39372 } 39373 const valueTransition = __spreadValues({ 39374 delay: delay2 39375 }, getValueTransition(transition || {}, key)); 39376 let isHandoff = false; 39377 if (window.MotionHandoffAnimation) { 39378 const appearId = getOptimisedAppearId(visualElement); 39379 if (appearId) { 39380 const startTime = window.MotionHandoffAnimation(appearId, key, frame); 39381 if (startTime !== null) { 39382 valueTransition.startTime = startTime; 39383 isHandoff = true; 39384 } 39385 } 39386 } 39387 addValueToWillChange(visualElement, key); 39388 value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key) ? { type: false } : valueTransition, visualElement, isHandoff)); 39389 const animation = value.animation; 39390 if (animation) { 39391 animations2.push(animation); 39392 } 39393 } 39394 if (transitionEnd) { 39395 Promise.all(animations2).then(() => { 39396 frame.update(() => { 39397 transitionEnd && setTarget(visualElement, transitionEnd); 39398 }); 39399 }); 39400 } 39401 return animations2; 39402 } 39403 function animateVariant(visualElement, variant, options2 = {}) { 39404 var _a; 39405 const resolved = resolveVariant(visualElement, variant, options2.type === "exit" ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom : void 0); 39406 let { transition = visualElement.getDefaultTransition() || {} } = resolved || {}; 39407 if (options2.transitionOverride) { 39408 transition = options2.transitionOverride; 39409 } 39410 const getAnimation = resolved ? () => Promise.all(animateTarget(visualElement, resolved, options2)) : () => Promise.resolve(); 39411 const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size ? (forwardDelay = 0) => { 39412 const { delayChildren = 0, staggerChildren, staggerDirection } = transition; 39413 return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options2); 39414 } : () => Promise.resolve(); 39415 const { when } = transition; 39416 if (when) { 39417 const [first, last] = when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation]; 39418 return first().then(() => last()); 39419 } else { 39420 return Promise.all([getAnimation(), getChildAnimations(options2.delay)]); 39421 } 39422 } 39423 function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options2) { 39424 const animations2 = []; 39425 const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; 39426 const generateStaggerDuration = staggerDirection === 1 ? (i2 = 0) => i2 * staggerChildren : (i2 = 0) => maxStaggerDuration - i2 * staggerChildren; 39427 Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i2) => { 39428 child.notify("AnimationStart", variant); 39429 animations2.push(animateVariant(child, variant, __spreadProps(__spreadValues({}, options2), { 39430 delay: delayChildren + generateStaggerDuration(i2) 39431 })).then(() => child.notify("AnimationComplete", variant))); 39432 }); 39433 return Promise.all(animations2); 39434 } 39435 function sortByTreeOrder(a2, b2) { 39436 return a2.sortNodePosition(b2); 39437 } 39438 function animateVisualElement(visualElement, definition, options2 = {}) { 39439 visualElement.notify("AnimationStart", definition); 39440 let animation; 39441 if (Array.isArray(definition)) { 39442 const animations2 = definition.map((variant) => animateVariant(visualElement, variant, options2)); 39443 animation = Promise.all(animations2); 39444 } else if (typeof definition === "string") { 39445 animation = animateVariant(visualElement, definition, options2); 39446 } else { 39447 const resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options2.custom) : definition; 39448 animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options2)); 39449 } 39450 return animation.then(() => { 39451 visualElement.notify("AnimationComplete", definition); 39452 }); 39453 } 39454 const numVariantProps = variantProps.length; 39455 function getVariantContext(visualElement) { 39456 if (!visualElement) 39457 return void 0; 39458 if (!visualElement.isControllingVariants) { 39459 const context2 = visualElement.parent ? getVariantContext(visualElement.parent) || {} : {}; 39460 if (visualElement.props.initial !== void 0) { 39461 context2.initial = visualElement.props.initial; 39462 } 39463 return context2; 39464 } 39465 const context = {}; 39466 for (let i2 = 0; i2 < numVariantProps; i2++) { 39467 const name = variantProps[i2]; 39468 const prop = visualElement.props[name]; 39469 if (isVariantLabel(prop) || prop === false) { 39470 context[name] = prop; 39471 } 39472 } 39473 return context; 39474 } 39475 const reversePriorityOrder = [...variantPriorityOrder].reverse(); 39476 const numAnimationTypes = variantPriorityOrder.length; 39477 function animateList(visualElement) { 39478 return (animations2) => Promise.all(animations2.map(({ animation, options: options2 }) => animateVisualElement(visualElement, animation, options2))); 39479 } 39480 function createAnimationState(visualElement) { 39481 let animate = animateList(visualElement); 39482 let state = createState(); 39483 let isInitialRender = true;
39484 const buildResolvedTypeValues = (type) => (acc, definition) => { 39485 var _a; 39486 const resolved = resolveVariant(visualElement, definition, type === "exit" ? (_a = visualElement.presenceContext) === null || _a === void 0 ? void 0 : _a.custom : void 0); 39487 if (resolved) { 39488 const _a2 = resolved, { transition, transitionEnd } = _a2, target = __objRest(_a2, ["transition", "transitionEnd"]); 39489 acc = __spreadValues(__spreadValues(__spreadValues({}, acc), target), transitionEnd); 39490 } 39491 return acc; 39492 }; 39493 function setAnimateFunction(makeAnimator) { 39494 animate = makeAnimator(visualElement); 39495 } 39496 function animateChanges(changedActiveType) { 39497 const { props } = visualElement; 39498 const context = getVariantContext(visualElement.parent) || {}; 39499 const animations2 = []; 39500 const removedKeys = /* @__PURE__ */ new Set(); 39501 let encounteredKeys = {}; 39502 let removedVariantIndex = Infinity; 39503 for (let i2 = 0; i2 < numAnimationTypes; i2++) { 39504 const type = reversePriorityOrder[i2]; 39505 const typeState = state[type]; 39506 const prop = props[type] !== void 0 ? props[type] : context[type]; 39507 const propIsVariant = isVariantLabel(prop); 39508 const activeDelta = type === changedActiveType ? typeState.isActive : null; 39509 if (activeDelta === false) 39510 removedVariantIndex = i2; 39511 let isInherited = prop === context[type] && prop !== props[type] && propIsVariant; 39512 if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { 39513 isInherited = false; 39514 } 39515 typeState.protectedKeys = __spreadValues({}, encounteredKeys); 39516 if ( 39517 // If it isn't active and hasn't *just* been set as inactive 39518 !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type 39519 !prop && !typeState.prevProp || // Or if the prop doesn't define an animation 39520 isAnimationControls(prop) || typeof prop === "boolean" 39521 ) { 39522 continue; 39523 } 39524 const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); 39525 let shouldAnimateType = variantDidChange || // If we're making this variant active, we want to always make it active 39526 type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || // If we removed a higher-priority variant (i is in reverse order) 39527 i2 > removedVariantIndex && propIsVariant; 39528 let handledRemovedValues = false; 39529 const definitionList = Array.isArray(prop) ? prop : [prop]; 39530 let resolvedValues = definitionList.reduce(buildResolvedTypeValues(type), {}); 39531 if (activeDelta === false) 39532 resolvedValues = {}; 39533 const { prevResolvedValues = {} } = typeState; 39534 const allKeys = __spreadValues(__spreadValues({}, prevResolvedValues), resolvedValues); 39535 const markToAnimate = (key) => { 39536 shouldAnimateType = true; 39537 if (removedKeys.has(key)) { 39538 handledRemovedValues = true; 39539 removedKeys.delete(key); 39540 } 39541 typeState.needsAnimating[key] = true; 39542 const motionValue2 = visualElement.getValue(key); 39543 if (motionValue2) 39544 motionValue2.liveStyle = false; 39545 }; 39546 for (const key in allKeys) { 39547 const next2 = resolvedValues[key]; 39548 const prev2 = prevResolvedValues[key]; 39549 if (encounteredKeys.hasOwnProperty(key)) 39550 continue; 39551 let valueHasChanged = false; 39552 if (isKeyframesTarget(next2) && isKeyframesTarget(prev2)) { 39553 valueHasChanged = !shallowCompare(next2, prev2); 39554 } else { 39555 valueHasChanged = next2 !== prev2; 39556 } 39557 if (valueHasChanged) { 39558 if (next2 !== void 0 && next2 !== null) { 39559 markToAnimate(key); 39560 } else { 39561 removedKeys.add(key); 39562 } 39563 } else if (next2 !== void 0 && removedKeys.has(key)) {
39564 markToAnimate(key); 39565 } else { 39566 typeState.protectedKeys[key] = true; 39567 } 39568 } 39569 typeState.prevProp = prop; 39570 typeState.prevResolvedValues = resolvedValues; 39571 if (typeState.isActive) { 39572 encounteredKeys = __spreadValues(__spreadValues({}, encounteredKeys), resolvedValues); 39573 } 39574 if (isInitialRender && visualElement.blockInitialAnimation) { 39575 shouldAnimateType = false; 39576 } 39577 const willAnimateViaParent = isInherited && variantDidChange; 39578 const needsAnimating = !willAnimateViaParent || handledRemovedValues; 39579 if (shouldAnimateType && needsAnimating) { 39580 animations2.push(...definitionList.map((animation) => ({ 39581 animation, 39582 options: { type } 39583 }))); 39584 } 39585 } 39586 if (removedKeys.size) { 39587 const fallbackAnimation = {}; 39588 removedKeys.forEach((key) => { 39589 const fallbackTarget = visualElement.getBaseTarget(key); 39590 const motionValue2 = visualElement.getValue(key); 39591 if (motionValue2) 39592 motionValue2.liveStyle = true; 39593 fallbackAnimation[key] = fallbackTarget !== null && fallbackTarget !== void 0 ? fallbackTarget : null; 39594 }); 39595 animations2.push({ animation: fallbackAnimation }); 39596 } 39597 let shouldAnimate = Boolean(animations2.length); 39598 if (isInitialRender && (props.initial === false || props.initial === props.animate) && !visualElement.manuallyAnimateOnMount) { 39599 shouldAnimate = false; 39600 } 39601 isInitialRender = false;
39602 return shouldAnimate ? animate(animations2) : Promise.resolve(); 39603 } 39604 function setActive(type, isActive) { 39605 var _a; 39606 if (state[type].isActive === isActive) 39607 return Promise.resolve(); 39608 (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach((child) => { 39609 var _a2; 39610 return (_a2 = child.animationState) === null || _a2 === void 0 ? void 0 : _a2.setActive(type, isActive); 39611 }); 39612 state[type].isActive = isActive; 39613 const animations2 = animateChanges(type); 39614 for (const key in state) { 39615 state[key].protectedKeys = {}; 39616 } 39617 return animations2; 39618 } 39619 return { 39620 animateChanges, 39621 setActive, 39622 setAnimateFunction, 39623 getState: () => state, 39624 reset: () => { 39625 state = createState(); 39626 isInitialRender = true; 39627 } 39628 }; 39629 } 39630 function checkVariantsDidChange(prev2, next2) { 39631 if (typeof next2 === "string") { 39632 return next2 !== prev2; 39633 } else if (Array.isArray(next2)) { 39634 return !shallowCompare(next2, prev2); 39635 } 39636 return false; 39637 } 39638 function createTypeState(isActive = false) { 39639 return { 39640 isActive, 39641 protectedKeys: {}, 39642 needsAnimating: {}, 39643 prevResolvedValues: {} 39644 }; 39645 } 39646 function createState() { 39647 return { 39648 animate: createTypeState(true), 39649 whileInView: createTypeState(), 39650 whileHover: createTypeState(), 39651 whileTap: createTypeState(), 39652 whileDrag: createTypeState(), 39653 whileFocus: createTypeState(), 39654 exit: createTypeState() 39655 }; 39656 } 39657 class Feature { 39658 constructor(node2) { 39659 this.isMounted = false; 39660 this.node = node2; 39661 } 39662 update() { 39663 } 39664 } 39665 class AnimationFeature extends Feature { 39666 /** 39667 * We dynamically generate the AnimationState manager as it contains a reference 39668 * to the underlying animation library. We only want to load that if we load this, 39669 * so people can optionally code split it out using the `m` component. 39670 */ 39671 constructor(node2) { 39672 super(node2); 39673 node2.animationState || (node2.animationState = createAnimationState(node2)); 39674 } 39675 updateAnimationControlsSubscription() { 39676 const { animate } = this.node.getProps(); 39677 if (isAnimationControls(animate)) { 39678 this.unmountControls = animate.subscribe(this.node); 39679 } 39680 } 39681 /** 39682 * Subscribe any provided AnimationControls to the component's VisualElement 39683 */ 39684 mount() { 39685 this.updateAnimationControlsSubscription(); 39686 } 39687 update() { 39688 const { animate } = this.node.getProps(); 39689 const { animate: prevAnimate } = this.node.prevProps || {}; 39690 if (animate !== prevAnimate) { 39691 this.updateAnimationControlsSubscription(); 39692 } 39693 } 39694 unmount() { 39695 var _a; 39696 this.node.animationState.reset(); 39697 (_a = this.unmountControls) === null || _a === void 0 ? void 0 : _a.call(this); 39698 } 39699 } 39700 let id$1 = 0; 39701 class ExitAnimationFeature extends Feature { 39702 constructor() { 39703 super(...arguments); 39704 this.id = id$1++; 39705 } 39706 update() { 39707 if (!this.node.presenceContext) 39708 return; 39709 const { isPresent, onExitComplete } = this.node.presenceContext; 39710 const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}; 39711 if (!this.node.animationState || isPresent === prevIsPresent) { 39712 return; 39713 } 39714 const exitAnimation = this.node.animationState.setActive("exit", !isPresent); 39715 if (onExitComplete && !isPresent) { 39716 exitAnimation.then(() => onExitComplete(this.id)); 39717 } 39718 } 39719 mount() { 39720 const { register } = this.node.presenceContext || {}; 39721 if (register) { 39722 this.unmount = register(this.id); 39723 } 39724 } 39725 unmount() { 39726 } 39727 } 39728 const animations = { 39729 animation: { 39730 Feature: AnimationFeature 39731 }, 39732 exit: { 39733 Feature: ExitAnimationFeature 39734 } 39735 }; 39736 function addDomEvent(target, eventName, handler, options2 = { passive: true }) { 39737 target.addEventListener(eventName, handler, options2); 39738 return () => target.removeEventListener(eventName, handler); 39739 } 39740 function extractEventInfo(event) { 39741 return { 39742 point: { 39743 x: event.pageX, 39744 y: event.pageY 39745 } 39746 }; 39747 } 39748 const addPointerInfo = (handler) => { 39749 return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event)); 39750 }; 39751 function addPointerEvent(target, eventName, handler, options2) { 39752 return addDomEvent(target, eventName, addPointerInfo(handler), options2); 39753 } 39754 const distance = (a2, b2) => Math.abs(a2 - b2); 39755 function distance2D(a2, b2) { 39756 const xDelta = distance(a2.x, b2.x); 39757 const yDelta = distance(a2.y, b2.y); 39758 return Math.sqrt(__pow(xDelta, 2) + __pow(yDelta, 2)); 39759 } 39760 class PanSession { 39761 constructor(event, handlers2, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) { 39762 this.startEvent = null; 39763 this.lastMoveEvent = null; 39764 this.lastMoveEventInfo = null; 39765 this.handlers = {}; 39766 this.contextWindow = window; 39767 this.updatePoint = () => { 39768 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 39769 return; 39770 const info2 = getPanInfo(this.lastMoveEventInfo, this.history); 39771 const isPanStarted = this.startEvent !== null; 39772 const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3; 39773 if (!isPanStarted && !isDistancePastThreshold) 39774 return; 39775 const { point: point2 } = info2; 39776 const { timestamp: timestamp2 } = frameData; 39777 this.history.push(__spreadProps(__spreadValues({}, point2), { timestamp: timestamp2 })); 39778 const { onStart, onMove } = this.handlers; 39779 if (!isPanStarted) { 39780 onStart && onStart(this.lastMoveEvent, info2); 39781 this.startEvent = this.lastMoveEvent; 39782 } 39783 onMove && onMove(this.lastMoveEvent, info2); 39784 }; 39785 this.handlePointerMove = (event2, info2) => { 39786 this.lastMoveEvent = event2; 39787 this.lastMoveEventInfo = transformPoint(info2, this.transformPagePoint); 39788 frame.update(this.updatePoint, true); 39789 }; 39790 this.handlePointerUp = (event2, info2) => { 39791 this.end(); 39792 const { onEnd, onSessionEnd, resumeAnimation } = this.handlers; 39793 if (this.dragSnapToOrigin) 39794 resumeAnimation && resumeAnimation(); 39795 if (!(this.lastMoveEvent && this.lastMoveEventInfo)) 39796 return; 39797 const panInfo = getPanInfo(event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint), this.history); 39798 if (this.startEvent && onEnd) { 39799 onEnd(event2, panInfo); 39800 } 39801 onSessionEnd && onSessionEnd(event2, panInfo); 39802 }; 39803 if (!isPrimaryPointer(event)) 39804 return; 39805 this.dragSnapToOrigin = dragSnapToOrigin; 39806 this.handlers = handlers2; 39807 this.transformPagePoint = transformPagePoint; 39808 this.contextWindow = contextWindow || window; 39809 const info = extractEventInfo(event); 39810 const initialInfo = transformPoint(info, this.transformPagePoint); 39811 const { point } = initialInfo; 39812 const { timestamp } = frameData; 39813 this.history = [__spreadProps(__spreadValues({}, point), { timestamp })]; 39814 const { onSessionStart } = handlers2; 39815 onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history));
39816 this.removeListeners = pipe(addPointerEvent(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent(this.contextWindow, "pointercancel", this.handlePointerUp)); 39817 } 39818 updateHandlers(handlers2) { 39819 this.handlers = handlers2; 39820 } 39821 end() { 39822 this.removeListeners && this.removeListeners(); 39823 cancelFrame(this.updatePoint); 39824 } 39825 } 39826 function transformPoint(info, transformPagePoint) { 39827 return transformPagePoint ? { point: transformPagePoint(info.point) } : info; 39828 } 39829 function subtractPoint(a2, b2) { 39830 return { x: a2.x - b2.x, y: a2.y - b2.y }; 39831 } 39832 function getPanInfo({ point }, history) { 39833 return { 39834 point, 39835 delta: subtractPoint(point, lastDevicePoint(history)), 39836 offset: subtractPoint(point, startDevicePoint(history)), 39837 velocity: getVelocity(history, 0.1) 39838 }; 39839 } 39840 function startDevicePoint(history) { 39841 return history[0]; 39842 } 39843 function lastDevicePoint(history) { 39844 return history[history.length - 1]; 39845 } 39846 function getVelocity(history, timeDelta) { 39847 if (history.length < 2) { 39848 return { x: 0, y: 0 }; 39849 } 39850 let i2 = history.length - 1; 39851 let timestampedPoint = null; 39852 const lastPoint = lastDevicePoint(history); 39853 while (i2 >= 0) { 39854 timestampedPoint = history[i2]; 39855 if (lastPoint.timestamp - timestampedPoint.timestamp > /* @__PURE__ */ secondsToMilliseconds(timeDelta)) { 39856 break; 39857 } 39858 i2--; 39859 } 39860 if (!timestampedPoint) { 39861 return { x: 0, y: 0 }; 39862 } 39863 const time2 = /* @__PURE__ */ millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp); 39864 if (time2 === 0) { 39865 return { x: 0, y: 0 }; 39866 } 39867 const currentVelocity = { 39868 x: (lastPoint.x - timestampedPoint.x) / time2, 39869 y: (lastPoint.y - timestampedPoint.y) / time2 39870 }; 39871 if (currentVelocity.x === Infinity) { 39872 currentVelocity.x = 0; 39873 } 39874 if (currentVelocity.y === Infinity) { 39875 currentVelocity.y = 0; 39876 } 39877 return currentVelocity; 39878 } 39879 const SCALE_PRECISION = 1e-4; 39880 const SCALE_MIN = 1 - SCALE_PRECISION; 39881 const SCALE_MAX = 1 + SCALE_PRECISION; 39882 const TRANSLATE_PRECISION = 0.01; 39883 const TRANSLATE_MIN = 0 - TRANSLATE_PRECISION; 39884 const TRANSLATE_MAX = 0 + TRANSLATE_PRECISION; 39885 function calcLength(axis) { 39886 return axis.max - axis.min; 39887 } 39888 function isNear(value, target, maxDistance) { 39889 return Math.abs(value - target) <= maxDistance; 39890 } 39891 function calcAxisDelta(delta, source, target, origin2 = 0.5) { 39892 delta.origin = origin2; 39893 delta.originPoint = mixNumber$1(source.min, source.max, delta.origin); 39894 delta.scale = calcLength(target) / calcLength(source); 39895 delta.translate = mixNumber$1(target.min, target.max, delta.origin) - delta.originPoint; 39896 if (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX || isNaN(delta.scale)) { 39897 delta.scale = 1; 39898 } 39899 if (delta.translate >= TRANSLATE_MIN && delta.translate <= TRANSLATE_MAX || isNaN(delta.translate)) { 39900 delta.translate = 0; 39901 } 39902 } 39903 function calcBoxDelta(delta, source, target, origin2) { 39904 calcAxisDelta(delta.x, source.x, target.x, origin2 ? origin2.originX : void 0); 39905 calcAxisDelta(delta.y, source.y, target.y, origin2 ? origin2.originY : void 0); 39906 } 39907 function calcRelativeAxis(target, relative, parent) { 39908 target.min = parent.min + relative.min; 39909 target.max = target.min + calcLength(relative); 39910 } 39911 function calcRelativeBox(target, relative, parent) { 39912 calcRelativeAxis(target.x, relative.x, parent.x); 39913 calcRelativeAxis(target.y, relative.y, parent.y); 39914 } 39915 function calcRelativeAxisPosition(target, layout2, parent) { 39916 target.min = layout2.min - parent.min; 39917 target.max = target.min + calcLength(layout2); 39918 } 39919 function calcRelativePosition(target, layout2, parent) { 39920 calcRelativeAxisPosition(target.x, layout2.x, parent.x); 39921 calcRelativeAxisPosition(target.y, layout2.y, parent.y); 39922 } 39923 function applyConstraints(point, { min: min2, max: max2 }, elastic) { 39924 if (min2 !== void 0 && point < min2) { 39925 point = elastic ? mixNumber$1(min2, point, elastic.min) : Math.max(point, min2); 39926 } else if (max2 !== void 0 && point > max2) { 39927 point = elastic ? mixNumber$1(max2, point, elastic.max) : Math.min(point, max2); 39928 } 39929 return point; 39930 } 39931 function calcRelativeAxisConstraints(axis, min2, max2) { 39932 return { 39933 min: min2 !== void 0 ? axis.min + min2 : void 0, 39934 max: max2 !== void 0 ? axis.max + max2 - (axis.max - axis.min) : void 0 39935 }; 39936 } 39937 function calcRelativeConstraints(layoutBox, { top, left, bottom, right }) { 39938 return { 39939 x: calcRelativeAxisConstraints(layoutBox.x, left, right), 39940 y: calcRelativeAxisConstraints(layoutBox.y, top, bottom) 39941 }; 39942 } 39943 function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { 39944 let min2 = constraintsAxis.min - layoutAxis.min; 39945 let max2 = constraintsAxis.max - layoutAxis.max; 39946 if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) { 39947 [min2, max2] = [max2, min2]; 39948 } 39949 return { min: min2, max: max2 }; 39950 } 39951 function calcViewportConstraints(layoutBox, constraintsBox) { 39952 return { 39953 x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), 39954 y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y) 39955 }; 39956 } 39957 function calcOrigin(source, target) { 39958 let origin2 = 0.5; 39959 const sourceLength = calcLength(source); 39960 const targetLength = calcLength(target); 39961 if (targetLength > sourceLength) { 39962 origin2 = /* @__PURE__ */ progress(target.min, target.max - sourceLength, source.min); 39963 } else if (sourceLength > targetLength) { 39964 origin2 = /* @__PURE__ */ progress(source.min, source.max - targetLength, target.min); 39965 } 39966 return clamp(0, 1, origin2); 39967 } 39968 function rebaseAxisConstraints(layout2, constraints) { 39969 const relativeConstraints = {}; 39970 if (constraints.min !== void 0) { 39971 relativeConstraints.min = constraints.min - layout2.min; 39972 } 39973 if (constraints.max !== void 0) { 39974 relativeConstraints.max = constraints.max - layout2.min; 39975 } 39976 return relativeConstraints; 39977 } 39978 const defaultElastic = 0.35; 39979 function resolveDragElastic(dragElastic = defaultElastic) { 39980 if (dragElastic === false) { 39981 dragElastic = 0; 39982 } else if (dragElastic === true) { 39983 dragElastic = defaultElastic; 39984 } 39985 return { 39986 x: resolveAxisElastic(dragElastic, "left", "right"), 39987 y: resolveAxisElastic(dragElastic, "top", "bottom") 39988 }; 39989 } 39990 function resolveAxisElastic(dragElastic, minLabel, maxLabel) { 39991 return { 39992 min: resolvePointElastic(dragElastic, minLabel), 39993 max: resolvePointElastic(dragElastic, maxLabel) 39994 }; 39995 } 39996 function resolvePointElastic(dragElastic, label) { 39997 return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0; 39998 } 39999 const createAxisDelta = () => ({ 40000 translate: 0, 40001 scale: 1, 40002 origin: 0, 40003 originPoint: 0 40004 }); 40005 const createDelta = () => ({ 40006 x: createAxisDelta(), 40007 y: createAxisDelta() 40008 }); 40009 const createAxis = () => ({ min: 0, max: 0 }); 40010 const createBox = () => ({ 40011 x: createAxis(), 40012 y: createAxis() 40013 }); 40014 function eachAxis(callback) { 40015 return [callback("x"), callback("y")]; 40016 } 40017 function convertBoundingBoxToBox({ top, left, right, bottom }) { 40018 return { 40019 x: { min: left, max: right }, 40020 y: { min: top, max: bottom } 40021 }; 40022 } 40023 function convertBoxToBoundingBox({ x: x2, y: y2 }) { 40024 return { top: y2.min, right: x2.max, bottom: y2.max, left: x2.min }; 40025 } 40026 function transformBoxPoints(point, transformPoint2) { 40027 if (!transformPoint2) 40028 return point; 40029 const topLeft = transformPoint2({ x: point.left, y: point.top }); 40030 const bottomRight = transformPoint2({ x: point.right, y: point.bottom }); 40031 return { 40032 top: topLeft.y, 40033 left: topLeft.x, 40034 bottom: bottomRight.y, 40035 right: bottomRight.x 40036 }; 40037 } 40038 function isIdentityScale(scale2) { 40039 return scale2 === void 0 || scale2 === 1; 40040 } 40041 function hasScale({ scale: scale2, scaleX, scaleY }) { 40042 return !isIdentityScale(scale2) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY); 40043 } 40044 function hasTransform(values) { 40045 return hasScale(values) || has2DTranslate(values) || values.z || values.rotate || values.rotateX || values.rotateY || values.skewX || values.skewY; 40046 } 40047 function has2DTranslate(values) { 40048 return is2DTranslate(values.x) || is2DTranslate(values.y); 40049 } 40050 function is2DTranslate(value) { 40051 return value && value !== "0%"; 40052 } 40053 function scalePoint(point, scale2, originPoint) { 40054 const distanceFromOrigin = point - originPoint; 40055 const scaled = scale2 * distanceFromOrigin; 40056 return originPoint + scaled; 40057 } 40058 function applyPointDelta(point, translate, scale2, originPoint, boxScale) { 40059 if (boxScale !== void 0) { 40060 point = scalePoint(point, boxScale, originPoint); 40061 } 40062 return scalePoint(point, scale2, originPoint) + translate; 40063 } 40064 function applyAxisDelta(axis, translate = 0, scale2 = 1, originPoint, boxScale) { 40065 axis.min = applyPointDelta(axis.min, translate, scale2, originPoint, boxScale); 40066 axis.max = applyPointDelta(axis.max, translate, scale2, originPoint, boxScale); 40067 } 40068 function applyBoxDelta(box, { x: x2, y: y2 }) { 40069 applyAxisDelta(box.x, x2.translate, x2.scale, x2.originPoint); 40070 applyAxisDelta(box.y, y2.translate, y2.scale, y2.originPoint); 40071 } 40072 const TREE_SCALE_SNAP_MIN = 0.999999999999; 40073 const TREE_SCALE_SNAP_MAX = 1.0000000000001; 40074 function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) { 40075 const treeLength = treePath.length; 40076 if (!treeLength) 40077 return; 40078 treeScale.x = treeScale.y = 1; 40079 let node2; 40080 let delta; 40081 for (let i2 = 0; i2 < treeLength; i2++) { 40082 node2 = treePath[i2]; 40083 delta = node2.projectionDelta; 40084 const { visualElement } = node2.options; 40085 if (visualElement && visualElement.props.style && visualElement.props.style.display === "contents") { 40086 continue; 40087 } 40088 if (isSharedTransition && node2.options.layoutScroll && node2.scroll && node2 !== no
40088de2.root) { 40089 transformBox(box, { 40090 x: -node2.scroll.offset.x, 40091 y: -node2.scroll.offset.y 40092 }); 40093 } 40094 if (delta) { 40095 treeScale.x *= delta.x.scale; 40096 treeScale.y *= delta.y.scale; 40097 applyBoxDelta(box, delta); 40098 } 40099 if (isSharedTransition && hasTransform(node2.latestValues)) { 40100 transformBox(box, node2.latestValues); 40101 } 40102 } 40103 if (treeScale.x < TREE_SCALE_SNAP_MAX && treeScale.x > TREE_SCALE_SNAP_MIN) { 40104 treeScale.x = 1; 40105 } 40106 if (treeScale.y < TREE_SCALE_SNAP_MAX && treeScale.y > TREE_SCALE_SNAP_MIN) { 40107 treeScale.y = 1; 40108 } 40109 } 40110 function translateAxis(axis, distance2) { 40111 axis.min = axis.min + distance2; 40112 axis.max = axis.max + distance2; 40113 } 40114 function transformAxis(axis, axisTranslate, axisScale, boxScale, axisOrigin = 0.5) { 40115 const originPoint = mixNumber$1(axis.min, axis.max, axisOrigin); 40116 applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale); 40117 } 40118 function transformBox(box, transform2) { 40119 transformAxis(box.x, transform2.x, transform2.scaleX, transform2.scale, transform2.originX); 40120 transformAxis(box.y, transform2.y, transform2.scaleY, transform2.scale, transform2.originY); 40121 } 40122 function measureViewportBox(instance2, transformPoint2) { 40123 return convertBoundingBoxToBox(transformBoxPoints(instance2.getBoundingClientRect(), transformPoint2)); 40124 } 40125 function measurePageBox(element, rootProjectionNode2, transformPagePoint) { 40126 const viewportBox = measureViewportBox(element, transformPagePoint); 40127 const { scroll } = rootProjectionNode2; 40128 if (scroll) { 40129 translateAxis(viewportBox.x, scroll.offset.x); 40130 translateAxis(viewportBox.y, scroll.offset.y); 40131 } 40132 return viewportBox; 40133 } 40134 const getContextWindow = ({ current }) => { 40135 return current ? current.ownerDocument.defaultView : null; 40136 }; 40137 const elementDragControls = /* @__PURE__ */ new WeakMap(); 40138 class VisualElementDragControls { 40139 constructor(visualElement) { 40140 this.openDragLock = null; 40141 this.isDragging = false; 40142 this.currentDirection = null; 40143 this.originPoint = { x: 0, y: 0 }; 40144 this.constraints = false; 40145 this.hasMutatedConstraints = false; 40146 this.elastic = createBox(); 40147 this.visualElement = visualElement; 40148 } 40149 start(originEvent, { snapToCursor = false } = {}) { 40150 const { presenceContext } = this.visualElement; 40151 if (presenceContext && presenceContext.isPresent === false) 40152 return; 40153 const onSessionStart = (event) => { 40154 const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps(); 40155 dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation(); 40156 if (snapToCursor) { 40157 this.snapToCursor(extractEventInfo(event).point); 40158 } 40159 }; 40160 const onStart = (event, info) => { 40161 const { drag: drag2, dragPropagation, onDragStart } = this.getProps(); 40162 if (drag2 && !dragPropagation) { 40163 if (this.openDragLock) 40164 this.openDragLock(); 40165 this.openDragLock = setDragLock(drag2); 40166 if (!this.openDragLock) 40167 return; 40168 } 40169 this.isDragging = true; 40170 this.currentDirection = null; 40171 this.resolveConstraints(); 40172 if (this.visualElement.projection) { 40173 this.visualElement.projection.isAnimationBlocked = true; 40174 this.visualElement.projection.target = void 0; 40175 } 40176 eachAxis((axis) => { 40177 let current = this.getAxisMotionValue(axis).get() || 0; 40178 if (percent.test(current)) { 40179 const { projection } = this.visualElement; 40180 if (projection && projection.layout) { 40181 const measuredAxis = projection.layout.layoutBox[axis]; 40182 if (measuredAxis) { 40183 const length2 = calcLength(measuredAxis); 40184 current = length2 * (parseFloat(current) / 100); 40185 } 40186 } 40187 } 40188 this.originPoint[axis] = current; 40189 }); 40190 if (onDragStart) { 40191 frame.postRender(() => onDragStart(event, info)); 40192 } 40193 addValueToWillChange(this.visualElement, "transform"); 40194 const { animationState } = this.visualElement; 40195 animationState && animationState.setActive("whileDrag", true); 40196 }; 40197 const onMove = (event, info) => { 40198 const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps(); 40199 if (!dragPropagation && !this.openDragLock) 40200 return; 40201 const { offset: offset2 } = info; 40202 if (dragDirectionLock && this.currentDirection === null) { 40203 this.currentDirection = getCurrentDirection(offset2); 40204 if (this.currentDirection !== null) { 40205 onDirectionLock && onDirectionLock(this.currentDirection); 40206 } 40207 return; 40208 } 40209 this.updateAxis("x", info.point, offset2); 40210 this.updateAxis("y", info.point, offset2); 40211 this.visualElement.render(); 40212 onDrag && onDrag(event, info); 40213 }; 40214 const onSessionEnd = (event, info) => this.stop(event, info); 40215 const resumeAnimation = () => eachAxis((axis) => { 40216 var _a; 40217 return this.getAnimationState(axis) === "paused" && ((_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.play()); 40218 }); 40219 const { dragSnapToOrigin } = this.getProps(); 40220 this.panSession = new PanSession(originEvent, { 40221 onSessionStart, 40222 onStart, 40223 onMove, 40224 onSessionEnd, 40225 resumeAnimation 40226 }, { 40227 transformPagePoint: this.visualElement.getTransformPagePoint(), 40228 dragSnapToOrigin, 40229 contextWindow: getContextWindow(this.visualElement) 40230 }); 40231 } 40232 stop(event, info) { 40233 const isDragging2 = this.isDragging; 40234 this.cancel(); 40235 if (!isDragging2) 40236 return; 40237 const { velocity } = info; 40238 this.startAnimation(velocity); 40239 const { onDragEnd } = this.getProps(); 40240 if (onDragEnd) { 40241 frame.postRender(() => onDragEnd(event, info)); 40242 } 40243 } 40244 cancel() { 40245 this.isDragging = false;
vendor: 14,698 bytes, lines 40246-40598
40246 const { projection, animationState } = this.visualElement; 40247 if (projection) { 40248 projection.isAnimationBlocked = false; 40249 } 40250 this.panSession && this.panSession.end(); 40251 this.panSession = void 0; 40252 const { dragPropagation } = this.getProps(); 40253 if (!dragPropagation && this.openDragLock) { 40254 this.openDragLock(); 40255 this.openDragLock = null; 40256 } 40257 animationState && animationState.setActive("whileDrag", false); 40258 } 40259 updateAxis(axis, _point, offset2) { 40260 const { drag: drag2 } = this.getProps(); 40261 if (!offset2 || !shouldDrag(axis, drag2, this.currentDirection)) 40262 return; 40263 const axisValue = this.getAxisMotionValue(axis); 40264 let next2 = this.originPoint[axis] + offset2[axis]; 40265 if (this.constraints && this.constraints[axis]) { 40266 next2 = applyConstraints(next2, this.constraints[axis], this.elastic[axis]); 40267 } 40268 axisValue.set(next2); 40269 } 40270 resolveConstraints() { 40271 var _a; 40272 const { dragConstraints, dragElastic } = this.getProps(); 40273 const layout2 = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a = this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout; 40274 const prevConstraints = this.constraints; 40275 if (dragConstraints && isRefObject(dragConstraints)) { 40276 if (!this.constraints) { 40277 this.constraints = this.resolveRefConstraints(); 40278 } 40279 } else { 40280 if (dragConstraints && layout2) { 40281 this.constraints = calcRelativeConstraints(layout2.layoutBox, dragConstraints); 40282 } else { 40283 this.constraints = false; 40284 } 40285 } 40286 this.elastic = resolveDragElastic(dragElastic); 40287 if (prevConstraints !== this.constraints && layout2 && this.constraints && !this.hasMutatedConstraints) { 40288 eachAxis((axis) => { 40289 if (this.constraints !== false && this.getAxisMotionValue(axis)) { 40290 this.constraints[axis] = rebaseAxisConstraints(layout2.layoutBox[axis], this.constraints[axis]); 40291 } 40292 }); 40293 } 40294 } 40295 resolveRefConstraints() { 40296 const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps(); 40297 if (!constraints || !isRefObject(constraints)) 40298 return false; 40299 const constraintsElement = constraints.current; 40300 const { projection } = this.visualElement; 40301 if (!projection || !projection.layout) 40302 return false; 40303 const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); 40304 let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox); 40305 if (onMeasureDragConstraints) { 40306 const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); 40307 this.hasMutatedConstraints = !!userConstraints; 40308 if (userConstraints) { 40309 measuredConstraints = convertBoundingBoxToBox(userConstraints); 40310 } 40311 } 40312 return measuredConstraints; 40313 } 40314 startAnimation(velocity) { 40315 const { drag: drag2, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd } = this.getProps(); 40316 const constraints = this.constraints || {}; 40317 const momentumAnimations = eachAxis((axis) => { 40318 if (!shouldDrag(axis, drag2, this.currentDirection)) { 40319 return; 40320 } 40321 let transition = constraints && constraints[axis] || {}; 40322 if (dragSnapToOrigin) 40323 transition = { min: 0, max: 0 }; 40324 const bounceStiffness = dragElastic ? 200 : 1e6; 40325 const bounceDamping = dragElastic ? 40 : 1e7; 40326 const inertia2 = __spreadValues(__spreadValues({ 40327 type: "inertia", 40328 velocity: dragMomentum ? velocity[axis] : 0, 40329 bounceStiffness, 40330 bounceDamping, 40331 timeConstant: 750, 40332 restDelta: 1, 40333 restSpeed: 10 40334 }, dragTransition), transition); 40335 return this.startAxisValueAnimation(axis, inertia2); 40336 }); 40337 return Promise.all(momentumAnimations).then(onDragTransitionEnd); 40338 } 40339 startAxisValueAnimation(axis, transition) { 40340 const axisValue = this.getAxisMotionValue(axis); 40341 addValueToWillChange(this.visualElement, axis); 40342 return axisValue.start(animateMotionValue(axis, axisValue, 0, transition, this.visualElement, false)); 40343 } 40344 stopAnimation() { 40345 eachAxis((axis) => this.getAxisMotionValue(axis).stop()); 40346 } 40347 pauseAnimation() { 40348 eachAxis((axis) => { 40349 var _a; 40350 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.pause(); 40351 }); 40352 } 40353 getAnimationState(axis) { 40354 var _a; 40355 return (_a = this.getAxisMotionValue(axis).animation) === null || _a === void 0 ? void 0 : _a.state; 40356 } 40357 /** 40358 * Drag works differently depending on which props are provided. 40359 * 40360 * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values. 40361 * - Otherwise, we apply the delta to the x/y motion values. 40362 */ 40363 getAxisMotionValue(axis) { 40364 const dragKey = `_drag${axis.toUpperCase()}`; 40365 const props = this.visualElement.getProps(); 40366 const externalMotionValue = props[dragKey]; 40367 return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : void 0) || 0); 40368 } 40369 snapToCursor(point) { 40370 eachAxis((axis) => { 40371 const { drag: drag2 } = this.getProps(); 40372 if (!shouldDrag(axis, drag2, this.currentDirection)) 40373 return; 40374 const { projection } = this.visualElement; 40375 const axisValue = this.getAxisMotionValue(axis); 40376 if (projection && projection.layout) { 40377 const { min: min2, max: max2 } = projection.layout.layoutBox[axis]; 40378 axisValue.set(point[axis] - mixNumber$1(min2, max2, 0.5)); 40379 } 40380 }); 40381 } 40382 /** 40383 * When the viewport resizes we want to check if the measured constraints 40384 * have changed and, if so, reposition the element within those new constraints 40385 * relative to where it was before the resize. 40386 */ 40387 scalePositionWithinConstraints() { 40388 if (!this.visualElement.current) 40389 return; 40390 const { drag: drag2, dragConstraints } = this.getProps(); 40391 const { projection } = this.visualElement; 40392 if (!isRefObject(dragConstraints) || !projection || !this.constraints) 40393 return; 40394 this.stopAnimation(); 40395 const boxProgress = { x: 0, y: 0 }; 40396 eachAxis((axis) => { 40397 const axisValue = this.getAxisMotionValue(axis); 40398 if (axisValue && this.constraints !== false) { 40399 const latest = axisValue.get(); 40400 boxProgress[axis] = calcOrigin({ min: latest, max: latest }, this.constraints[axis]); 40401 } 40402 }); 40403 const { transformTemplate } = this.visualElement.getProps(); 40404 this.visualElement.current.style.transform = transformTemplate ? transformTemplate({}, "") : "none"; 40405 projection.root && projection.root.updateScroll(); 40406 projection.updateLayout(); 40407 this.resolveConstraints(); 40408 eachAxis((axis) => { 40409 if (!shouldDrag(axis, drag2, null)) 40410 return; 40411 const axisValue = this.getAxisMotionValue(axis); 40412 const { min: min2, max: max2 } = this.constraints[axis]; 40413 axisValue.set(mixNumber$1(min2, max2, boxProgress[axis])); 40414 }); 40415 } 40416 addListeners() { 40417 if (!this.visualElement.current) 40418 return; 40419 elementDragControls.set(this.visualElement, this); 40420 const element = this.visualElement.current; 40421 const stopPointerListener = addPointerEvent(element, "pointerdown", (event) => { 40422 const { drag: drag2, dragListener = true } = this.getProps(); 40423 drag2 && dragListener && this.start(event); 40424 }); 40425 const measureDragConstraints = () => { 40426 const { dragConstraints } = this.getProps(); 40427 if (isRefObject(dragConstraints) && dragConstraints.current) { 40428 this.constraints = this.resolveRefConstraints(); 40429 } 40430 }; 40431 const { projection } = this.visualElement; 40432 const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); 40433 if (projection && !projection.layout) { 40434 projection.root && projection.root.updateScroll(); 40435 projection.updateLayout(); 40436 } 40437 frame.read(measureDragConstraints); 40438 const stopResizeListener = addDomEvent(window, "resize", () => this.scalePositionWithinConstraints()); 40439 const stopLayoutUpdateListener = projection.addEventListener("didUpdate", (({ delta, hasLayoutChanged }) => { 40440 if (this.isDragging && hasLayoutChanged) { 40441 eachAxis((axis) => { 40442 const motionValue2 = this.getAxisMotionValue(axis); 40443 if (!motionValue2) 40444 return; 40445 this.originPoint[axis] += delta[axis].translate; 40446 motionValue2.set(motionValue2.get() + delta[axis].translate); 40447 }); 40448 this.visualElement.render(); 40449 } 40450 })); 40451 return () => { 40452 stopResizeListener(); 40453 stopPointerListener(); 40454 stopMeasureLayoutListener(); 40455 stopLayoutUpdateListener && stopLayoutUpdateListener(); 40456 }; 40457 } 40458 getProps() { 40459 const props = this.visualElement.getProps(); 40460 const { drag: drag2 = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true } = props; 40461 return __spreadProps(__spreadValues({}, props), { 40462 drag: drag2, 40463 dragDirectionLock, 40464 dragPropagation, 40465 dragConstraints, 40466 dragElastic, 40467 dragMomentum 40468 }); 40469 } 40470 } 40471 function shouldDrag(direction, drag2, currentDirection) { 40472 return (drag2 === true || drag2 === direction) && (currentDirection === null || currentDirection === direction); 40473 } 40474 function getCurrentDirection(offset2, lockThreshold = 10) { 40475 let direction = null; 40476 if (Math.abs(offset2.y) > lockThreshold) { 40477 direction = "y"; 40478 } else if (Math.abs(offset2.x) > lockThreshold) { 40479 direction = "x"; 40480 } 40481 return direction; 40482 } 40483 class DragGesture extends Feature { 40484 constructor(node2) { 40485 super(node2); 40486 this.removeGroupControls = noop$3; 40487 this.removeListeners = noop$3; 40488 this.controls = new VisualElementDragControls(node2); 40489 } 40490 mount() { 40491 const { dragControls } = this.node.getProps(); 40492 if (dragControls) { 40493 this.removeGroupControls = dragControls.subscribe(this.controls); 40494 } 40495 this.removeListeners = this.controls.addListeners() || noop$3; 40496 } 40497 unmount() { 40498 this.removeGroupControls(); 40499 this.removeListeners(); 40500 } 40501 } 40502 const asyncHandler = (handler) => (event, info) => { 40503 if (handler) { 40504 frame.postRender(() => handler(event, info)); 40505 } 40506 }; 40507 class PanGesture extends Feature { 40508 constructor() { 40509 super(...arguments); 40510 this.removePointerDownListener = noop$3; 40511 } 40512 onPointerDown(pointerDownEvent) { 40513 this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), { 40514 transformPagePoint: this.node.getTransformPagePoint(), 40515 contextWindow: getContextWindow(this.node) 40516 }); 40517 } 40518 createPanHandlers() { 40519 const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps(); 40520 return { 40521 onSessionStart: asyncHandler(onPanSessionStart), 40522 onStart: asyncHandler(onPanStart), 40523 onMove: onPan, 40524 onEnd: (event, info) => { 40525 delete this.session; 40526 if (onPanEnd) { 40527 frame.postRender(() => onPanEnd(event, info)); 40528 } 40529 } 40530 }; 40531 } 40532 mount() { 40533 this.removePointerDownListener = addPointerEvent(this.node.current, "pointerdown", (event) => this.onPointerDown(event)); 40534 } 40535 update() { 40536 this.session && this.session.updateHandlers(this.createPanHandlers()); 40537 } 40538 unmount() { 40539 this.removePointerDownListener(); 40540 this.session && this.session.end(); 40541 } 40542 } 40543 const globalProjectionState = { 40544 /** 40545 * Global flag as to whether the tree has animated since the last time 40546 * we resized the window 40547 */ 40548 hasAnimatedSinceResize: true, 40549 /** 40550 * We set this to true once, on the first update. Any nodes added to the tree beyond that 40551 * update will be given a `data-projection-id` attribute. 40552 */ 40553 hasEverUpdated: false 40554 }; 40555 function pixelsToPercent(pixels, axis) { 40556 if (axis.max === axis.min) 40557 return 0; 40558 return pixels / (axis.max - axis.min) * 100; 40559 } 40560 const correctBorderRadius = { 40561 correct: (latest, node2) => { 40562 if (!node2.target) 40563 return latest; 40564 if (typeof latest === "string") { 40565 if (px.test(latest)) { 40566 latest = parseFloat(latest); 40567 } else { 40568 return latest; 40569 } 40570 } 40571 const x2 = pixelsToPercent(latest, node2.target.x); 40572 const y2 = pixelsToPercent(latest, node2.target.y); 40573 return `${x2}% ${y2}%`; 40574 } 40575 }; 40576 const correctBoxShadow = { 40577 correct: (latest, { treeScale, projectionDelta }) => { 40578 const original = latest; 40579 const shadow = complex.parse(latest); 40580 if (shadow.length > 5) 40581 return original; 40582 const template = complex.createTransformer(latest); 40583 const offset2 = typeof shadow[0] !== "number" ? 1 : 0; 40584 const xScale = projectionDelta.x.scale * treeScale.x; 40585 const yScale = projectionDelta.y.scale * treeScale.y; 40586 shadow[0 + offset2] /= xScale; 40587 shadow[1 + offset2] /= yScale; 40588 const averageScale = mixNumber$1(xScale, yScale, 0.5); 40589 if (typeof shadow[2 + offset2] === "number") 40590 shadow[2 + offset2] /= averageScale; 40591 if (typeof shadow[3 + offset2] === "number") 40592 shadow[3 + offset2] /= averageScale; 40593 return template(shadow); 40594 } 40595 }; 40596 class MeasureLayoutWithContext extends reactExports.Component { 40597 /** 40598 * This only mounts projection nodes for components that
40599 * need measuring, we might want to do it for all components 40600 * in order to incorporate transforms 40601 */ 40602 componentDidMount() { 40603 const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props; 40604 const { projection } = visualElement; 40605 addScaleCorrector(defaultScaleCorrectors); 40606 if (projection) { 40607 if (layoutGroup.group) 40608 layoutGroup.group.add(projection); 40609 if (switchLayoutGroup && switchLayoutGroup.register && layoutId) { 40610 switchLayoutGroup.register(projection); 40611 } 40612 projection.root.didUpdate(); 40613 projection.addEventListener("animationComplete", () => { 40614 this.safeToRemove(); 40615 }); 40616 projection.setOptions(__spreadProps(__spreadValues({}, projection.options), { 40617 onExitComplete: () => this.safeToRemove() 40618 })); 40619 } 40620 globalProjectionState.hasEverUpdated = true; 40621 } 40622 getSnapshotBeforeUpdate(prevProps) { 40623 const { layoutDependency, visualElement, drag: drag2, isPresent } = this.props; 40624 const projection = visualElement.projection; 40625 if (!projection) 40626 return null; 40627 projection.isPresent = isPresent; 40628 if (drag2 || prevProps.layoutDependency !== layoutDependency || layoutDependency === void 0) { 40629 projection.willUpdate(); 40630 } else { 40631 this.safeToRemove(); 40632 } 40633 if (prevProps.isPresent !== isPresent) { 40634 if (isPresent) { 40635 projection.promote(); 40636 } else if (!projection.relegate()) { 40637 frame.postRender(() => { 40638 const stack = projection.getStack(); 40639 if (!stack || !stack.members.length) { 40640 this.safeToRemove(); 40641 } 40642 }); 40643 } 40644 } 40645 return null; 40646 } 40647 componentDidUpdate() { 40648 const { projection } = this.props.visualElement; 40649 if (projection) { 40650 projection.root.didUpdate(); 40651 microtask.postRender(() => { 40652 if (!projection.currentAnimation && projection.isLead()) { 40653 this.safeToRemove(); 40654 } 40655 }); 40656 } 40657 } 40658 componentWillUnmount() { 40659 const { visualElement, layoutGroup, switchLayoutGroup: promoteContext } = this.props; 40660 const { projection } = visualElement; 40661 if (projection) { 40662 projection.scheduleCheckAfterUnmount(); 40663 if (layoutGroup && layoutGroup.group) 40664 layoutGroup.group.remove(projection); 40665 if (promoteContext && promoteContext.deregister) 40666 promoteContext.deregister(projection); 40667 } 40668 } 40669 safeToRemove() { 40670 const { safeToRemove } = this.props; 40671 safeToRemove && safeToRemove(); 40672 } 40673 render() { 40674 return null; 40675 } 40676 } 40677 function MeasureLayout(props) { 40678 const [isPresent, safeToRemove] = usePresence(); 40679 const layoutGroup = reactExports.useContext(LayoutGroupContext); 40680 return jsxRuntimeExports.jsx(MeasureLayoutWithContext, __spreadProps(__spreadValues({}, props), { layoutGroup, switchLayoutGroup: reactExports.useContext(SwitchLayoutGroupContext), isPresent, safeToRemove })); 40681 } 40682 const defaultScaleCorrectors = { 40683 borderRadius: __spreadProps(__spreadValues({}, correctBorderRadius), { 40684 applyTo: [ 40685 "borderTopLeftRadius", 40686 "borderTopRightRadius", 40687 "borderBottomLeftRadius", 40688 "borderBottomRightRadius" 40689 ] 40690 }), 40691 borderTopLeftRadius: correctBorderRadius, 40692 borderTopRightRadius: correctBorderRadius, 40693 borderBottomLeftRadius: correctBorderRadius, 40694 borderBottomRightRadius: correctBorderRadius, 40695 boxShadow: correctBoxShadow 40696 }; 40697 function animateSingleValue(value, keyframes2, options2) { 40698 const motionValue$1 = isMotionValue(value) ? value : motionValue(value); 40699 motionValue$1.start(animateMotionValue("", motionValue$1, keyframes2, options2)); 40700 return motionValue$1.animation; 40701 } 40702 function isSVGElement(element) { 40703 return element instanceof SVGElement && element.tagName !== "svg"; 40704 } 40705 const compareByDepth = (a2, b2) => a2.depth - b2.depth; 40706 class FlatTree { 40707 constructor() { 40708 this.children = []; 40709 this.isDirty = false;
40710 } 40711 add(child) { 40712 addUniqueItem(this.children, child); 40713 this.isDirty = true; 40714 } 40715 remove(child) { 40716 removeItem(this.children, child); 40717 this.isDirty = true; 40718 } 40719 forEach(callback) { 40720 this.isDirty && this.children.sort(compareByDepth); 40721 this.isDirty = false; 40722 this.children.forEach(callback); 40723 } 40724 } 40725 function delay(callback, timeout) { 40726 const start = time.now(); 40727 const checkElapsed = ({ timestamp }) => { 40728 const elapsed = timestamp - start; 40729 if (elapsed >= timeout) { 40730 cancelFrame(checkElapsed); 40731 callback(elapsed - timeout); 40732 } 40733 }; 40734 frame.read(checkElapsed, true); 40735 return () => cancelFrame(checkElapsed); 40736 } 40737 const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; 40738 const numBorders = borders.length; 40739 const asNumber = (value) => typeof value === "string" ? parseFloat(value) : value; 40740 const isPx = (value) => typeof value === "number" || px.test(value); 40741 function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember) { 40742 if (shouldCrossfadeOpacity) { 40743 target.opacity = mixNumber$1( 40744 0, 40745 // TODO Reinstate this if only child 40746 lead.opacity !== void 0 ? lead.opacity : 1, 40747 easeCrossfadeIn(progress2) 40748 ); 40749 target.opacityExit = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, 0, easeCrossfadeOut(progress2)); 40750 } else if (isOnlyMember) { 40751 target.opacity = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, lead.opacity !== void 0 ? lead.opacity : 1, progress2); 40752 } 40753 for (let i2 = 0; i2 < numBorders; i2++) { 40754 const borderLabel = `border${borders[i2]}Radius`; 40755 let followRadius = getRadius(follow, borderLabel); 40756 let leadRadius = getRadius(lead, borderLabel); 40757 if (followRadius === void 0 && leadRadius === void 0) 40758 continue; 40759 followRadius || (followRadius = 0); 40760 leadRadius || (leadRadius = 0); 40761 const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius); 40762 if (canMix) { 40763 target[borderLabel] = Math.max(mixNumber$1(asNumber(followRadius), asNumber(leadRadius), progress2), 0); 40764 if (percent.test(leadRadius) || percent.test(followRadius)) { 40765 target[borderLabel] += "%"; 40766 } 40767 } else { 40768 target[borderLabel] = leadRadius; 40769 } 40770 } 40771 if (follow.rotate || lead.rotate) { 40772 target.rotate = mixNumber$1(follow.rotate || 0, lead.rotate || 0, progress2); 40773 } 40774 } 40775 function getRadius(values, radiusName) { 40776 return values[radiusName] !== void 0 ? values[radiusName] : values.borderRadius; 40777 } 40778 const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut); 40779 const easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop$3); 40780 function compress(min2, max2, easing) { 40781 return (p2) => { 40782 if (p2 < min2) 40783 return 0; 40784 if (p2 > max2) 40785 return 1; 40786 return easing(/* @__PURE__ */ progress(min2, max2, p2)); 40787 }; 40788 } 40789 function copyAxisInto(axis, originAxis) { 40790 axis.min = originAxis.min; 40791 axis.max = originAxis.max; 40792 } 40793 function copyBoxInto(box, originBox) { 40794 copyAxisInto(box.x, originBox.x); 40795 copyAxisInto(box.y, originBox.y); 40796 } 40797 function copyAxisDeltaInto(delta, originDelta) { 40798 delta.translate = originDelta.translate; 40799 delta.scale = originDelta.scale; 40800 delta.originPoint = originDelta.originPoint; 40801 delta.origin = originDelta.origin; 40802 } 40803 function removePointDelta(point, translate, scale2, originPoint, boxScale) { 40804 point -= translate; 40805 point = scalePoint(point, 1 / scale2, originPoint); 40806 if (boxScale !== void 0) { 40807 point = scalePoint(point, 1 / boxScale, originPoint); 40808 } 40809 return point; 40810 } 40811 function removeAxisDelta(axis, translate = 0, scale2 = 1, origin2 = 0.5, boxScale, originAxis = axis, sourceAxis = axis) { 40812 if (percent.test(translate)) { 40813 translate = parseFloat(translate); 40814 const relativeProgress = mixNumber$1(sourceAxis.min, sourceAxis.max, translate / 100); 40815 translate = relativeProgress - sourceAxis.min; 40816 }
40817 if (typeof translate !== "number") 40818 return; 40819 let originPoint = mixNumber$1(originAxis.min, originAxis.max, origin2); 40820 if (axis === originAxis) 40821 originPoint -= translate; 40822 axis.min = removePointDelta(axis.min, translate, scale2, originPoint, boxScale); 40823 axis.max = removePointDelta(axis.max, translate, scale2, originPoint, boxScale); 40824 } 40825 function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin2, sourceAxis) { 40826 removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin2, sourceAxis); 40827 } 40828 const xKeys = ["x", "scaleX", "originX"]; 40829 const yKeys = ["y", "scaleY", "originY"]; 40830 function removeBoxTransforms(box, transforms, originBox, sourceBox) { 40831 removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : void 0, sourceBox ? sourceBox.x : void 0); 40832 removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : void 0, sourceBox ? sourceBox.y : void 0); 40833 } 40834 function isAxisDeltaZero(delta) { 40835 return delta.translate === 0 && delta.scale === 1; 40836 } 40837 function isDeltaZero(delta) { 40838 return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y); 40839 } 40840 function axisEquals(a2, b2) { 40841 return a2.min === b2.min && a2.max === b2.max; 40842 } 40843 function boxEquals(a2, b2) { 40844 return axisEquals(a2.x, b2.x) && axisEquals(a2.y, b2.y); 40845 } 40846 function axisEqualsRounded(a2, b2) { 40847 return Math.round(a2.min) === Math.round(b2.min) && Math.round(a2.max) === Math.round(b2.max); 40848 } 40849 function boxEqualsRounded(a2, b2) { 40850 return axisEqualsRounded(a2.x, b2.x) && axisEqualsRounded(a2.y, b2.y); 40851 } 40852 function aspectRatio(box) { 40853 return calcLength(box.x) / calcLength(box.y); 40854 } 40855 function axisDeltaEquals(a2, b2) { 40856 return a2.translate === b2.translate && a2.scale === b2.scale && a2.originPoint === b2.originPoint; 40857 } 40858 class NodeStack { 40859 constructor() { 40860 this.members = []; 40861 } 40862 add(node2) { 40863 addUniqueItem(this.members, node2); 40864 node2.scheduleRender(); 40865 } 40866 remove(node2) { 40867 removeItem(this.members, node2); 40868 if (node2 === this.prevLead) { 40869 this.prevLead = void 0; 40870 } 40871 if (node2 === this.lead) { 40872 const prevLead = this.members[this.members.length - 1]; 40873 if (prevLead) { 40874 this.promote(prevLead); 40875 } 40876 } 40877 } 40878 relegate(node2) {
40879 const indexOfNode = this.members.findIndex((member) => node2 === member); 40880 if (indexOfNode === 0) 40881 return false; 40882 let prevLead; 40883 for (let i2 = indexOfNode; i2 >= 0; i2--) { 40884 const member = this.members[i2]; 40885 if (member.isPresent !== false) { 40886 prevLead = member; 40887 break; 40888 } 40889 } 40890 if (prevLead) { 40891 this.promote(prevLead); 40892 return true; 40893 } else { 40894 return false; 40895 } 40896 } 40897 promote(node2, preserveFollowOpacity) { 40898 const prevLead = this.lead; 40899 if (node2 === prevLead) 40900 return; 40901 this.prevLead = prevLead; 40902 this.lead = node2; 40903 node2.show(); 40904 if (prevLead) { 40905 prevLead.instance && prevLead.scheduleRender(); 40906 node2.scheduleRender(); 40907 node2.resumeFrom = prevLead; 40908 if (preserveFollowOpacity) { 40909 node2.resumeFrom.preserveOpacity = true; 40910 } 40911 if (prevLead.snapshot) { 40912 node2.snapshot = prevLead.snapshot; 40913 node2.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues; 40914 } 40915 if (node2.root && node2.root.isUpdating) { 40916 node2.isLayoutDirty = true; 40917 } 40918 const { crossfade } = node2.options; 40919 if (crossfade === false) { 40920 prevLead.hide(); 40921 } 40922 } 40923 } 40924 exitAnimationComplete() { 40925 this.members.forEach((node2) => { 40926 const { options: options2, resumingFrom } = node2; 40927 options2.onExitComplete && options2.onExitComplete(); 40928 if (resumingFrom) { 40929 resumingFrom.options.onExitComplete && resumingFrom.options.onExitComplete(); 40930 } 40931 }); 40932 } 40933 scheduleRender() { 40934 this.members.forEach((node2) => { 40935 node2.instance && node2.scheduleRender(false); 40936 }); 40937 } 40938 /** 40939 * Clear any leads that have been removed this render to prevent them from being 40940 * used in future animations and to prevent memory leaks 40941 */ 40942 removeLeadSnapshot() { 40943 if (this.lead && this.lead.snapshot) { 40944 this.lead.snapshot = void 0; 40945 } 40946 } 40947 } 40948 function buildProjectionTransform(delta, treeScale, latestTransform) { 40949 let transform2 = ""; 40950 const xTranslate = delta.x.translate / treeScale.x; 40951 const yTranslate = delta.y.translate / treeScale.y; 40952 const zTranslate = (latestTransform === null || latestTransform === void 0 ? void 0 : latestTransform.z) || 0; 40953 if (xTranslate || yTranslate || zTranslate) { 40954 transform2 = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `; 40955 } 40956 if (treeScale.x !== 1 || treeScale.y !== 1) { 40957 transform2 += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `; 40958 } 40959 if (latestTransform) { 40960 const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } = latestTransform; 40961 if (transformPerspective) 40962 transform2 = `perspective(${transformPerspective}px) ${transform2}`; 40963 if (rotate) 40964 transform2 += `rotate(${rotate}deg) `; 40965 if (rotateX) 40966 transform2 += `rotateX(${rotateX}deg) `; 40967 if (rotateY) 40968 transform2 += `rotateY(${rotateY}deg) `; 40969 if (skewX) 40970 transform2 += `skewX(${skewX}deg) `; 40971 if (skewY) 40972 transform2 += `skewY(${skewY}deg) `; 40973 } 40974 const elementScaleX = delta.x.scale * treeScale.x; 40975 const elementScaleY = delta.y.scale * treeScale.y; 40976 if (elementScaleX !== 1 || elementScaleY !== 1) { 40977 transform2 += `scale(${elementScaleX}, ${elementScaleY})`; 40978 } 40979 return transform2 || "none"; 40980 } 40981 const metrics = { 40982 type: "projectionFrame", 40983 totalNodes: 0, 40984 resolvedTargetDeltas: 0, 40985 recalculatedProjection: 0 40986 }; 40987 const isDebug = typeof window !== "undefined" && window.MotionDebug !== void 0; 40988 const transformAxes = ["", "X", "Y", "Z"]; 40989 const hiddenVisibility = { visibility: "hidden" }; 40990 const animationTarget = 1e3; 40991 let id = 0; 40992 function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) { 40993 const { latestValues } = visualElement; 40994 if (latestValues[key]) { 40995 values[key] = latestValues[key]; 40996 visualElement.setStaticValue(key, 0); 40997 if (sharedAnimationValues) { 40998 sharedAnimationValues[key] = 0; 40999 } 41000 } 41001 } 41002 function cancelTreeOptimisedTransformAnimations(projectionNode) { 41003 projectionNode.hasCheckedOptimisedAppear = true; 41004 if (projectionNode.root === projectionNode) 41005 return; 41006 const { visualElement } = projectionNode.options; 41007 if (!visualElement) 41008 return; 41009 const appearId = getOptimisedAppearId(visualElement); 41010 if (window.MotionHasOptimisedAnimation(appearId, "transform")) { 41011 const { layout: layout2, layoutId } = projectionNode.options; 41012 window.MotionCancelOptimisedAnimation(appearId, "transform", frame, !(layout2 || layoutId)); 41013 } 41014 const { parent } = projectionNode; 41015 if (parent && !parent.hasCheckedOptimisedAppear) { 41016 cancelTreeOptimisedTransformAnimations(parent); 41017 } 41018 } 41019 function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform }) { 41020 return class ProjectionNode { 41021 constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) { 41022 this.id = id++; 41023 this.animationId = 0; 41024 this.children = /* @__PURE__ */ new Set(); 41025 this.options = {}; 41026 this.isTreeAnimating = false;
41027 this.isAnimationBlocked = false; 41028 this.isLayoutDirty = false; 41029 this.isProjectionDirty = false; 41030 this.isSharedProjectionDirty = false; 41031 this.isTransformDirty = false; 41032 this.updateManuallyBlocked = false; 41033 this.updateBlockedByResize = false; 41034 this.isUpdating = false; 41035 this.isSVG = false; 41036 this.needsReset = false; 41037 this.shouldResetTransform = false; 41038 this.hasCheckedOptimisedAppear = false; 41039 this.treeScale = { x: 1, y: 1 }; 41040 this.eventHandlers = /* @__PURE__ */ new Map(); 41041 this.hasTreeAnimated = false; 41042 this.updateScheduled = false; 41043 this.scheduleUpdate = () => this.update(); 41044 this.projectionUpdateScheduled = false; 41045 this.checkUpdateFailed = () => { 41046 if (this.isUpdating) { 41047 this.isUpdating = false; 41048 this.clearAllSnapshots(); 41049 } 41050 }; 41051 this.updateProjection = () => { 41052 this.projectionUpdateScheduled = false; 41053 if (isDebug) { 41054 metrics.totalNodes = metrics.resolvedTargetDeltas = metrics.recalculatedProjection = 0; 41055 } 41056 this.nodes.forEach(propagateDirtyNodes); 41057 this.nodes.forEach(resolveTargetDelta); 41058 this.nodes.forEach(calcProjection); 41059 this.nodes.forEach(cleanDirtyNodes); 41060 if (isDebug) { 41061 window.MotionDebug.record(metrics); 41062 } 41063 }; 41064 this.resolvedRelativeTargetAt = 0; 41065 this.hasProjected = false; 41066 this.isVisible = true; 41067 this.animationProgress = 0; 41068 this.sharedNodes = /* @__PURE__ */ new Map(); 41069 this.latestValues = latestValues; 41070 this.root = parent ? parent.root || parent : this; 41071 this.path = parent ? [...parent.path, parent] : []; 41072 this.parent = parent; 41073 this.depth = parent ? parent.depth + 1 : 0; 41074 for (let i2 = 0; i2 < this.path.length; i2++) { 41075 this.path[i2].shouldResetTransform = true; 41076 } 41077 if (this.root === this) 41078 this.nodes = new FlatTree(); 41079 } 41080 addEventListener(name, handler) { 41081 if (!this.eventHandlers.has(name)) { 41082 this.eventHandlers.set(name, new SubscriptionManager()); 41083 } 41084 return this.eventHandlers.get(name).add(handler); 41085 } 41086 notifyListeners(name, ...args) { 41087 const subscriptionManager = this.eventHandlers.get(name); 41088 subscriptionManager && subscriptionManager.notify(...args); 41089 } 41090 hasListeners(name) { 41091 return this.eventHandlers.has(name); 41092 } 41093 /** 41094 * Lifecycles 41095 */ 41096 mount(instance2, isLayoutDirty = this.root.hasTreeAnimated) { 41097 if (this.instance) 41098 return; 41099 this.isSVG = isSVGElement(instance2); 41100 this.instance = instance2; 41101 const { layoutId, layout: layout2, visualElement } = this.options; 41102 if (visualElement && !visualElement.current) { 41103 visualElement.mount(instance2); 41104 } 41105 this.root.nodes.add(this); 41106 this.parent && this.parent.children.add(this); 41107 if (isLayoutDirty && (layout2 || layoutId)) { 41108 this.isLayoutDirty = true; 41109 } 41110 if (attachResizeListener) { 41111 let cancelDelay; 41112 const resizeUnblockUpdate = () => this.root.updateBlockedByResize = false; 41113 attachResizeListener(instance2, () => { 41114 this.root.updateBlockedByResize = true; 41115 cancelDelay && cancelDelay(); 41116 cancelDelay = delay(resizeUnblockUpdate, 250); 41117 if (globalProjectionState.hasAnimatedSinceResize) { 41118 globalProjectionState.hasAnimatedSinceResize = false; 41119 this.nodes.forEach(finishAnimation); 41120 } 41121 }); 41122 } 41123 if (layoutId) { 41124 this.root.registerSharedNode(layoutId, this); 41125 } 41126 if (this.options.animate !== false && visualElement && (layoutId || layout2)) { 41127 this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout }) => { 41128 if (this.isTreeAnimationBlocked()) { 41129 this.target = void 0; 41130 this.relativeTarget = void 0; 41131 return; 41132 } 41133 const layoutTransition = this.options.transition || visualElement.getDefaultTransition() || defaultLayoutTransition; 41134 const { onLayoutAnimationStart, onLayoutAnimationComplete } = visualElement.getProps(); 41135 const targetChanged = !this.targetLayout || !boxEqualsRounded(this.targetLayout, newLayout) || hasRelativeTargetChanged; 41136 const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; 41137 if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || hasOnlyRelativeTargetChanged || hasLayoutChanged && (targetChanged || !this.currentAnimation)) { 41138 if (this.resumeFrom) { 41139 this.resumingFrom = this.resumeFrom; 41140 this.resumingFrom.resumingFrom = void 0; 41141 } 41142 this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); 41143 const animationOptions = __spreadProps(__spreadValues({}, getValueTransition(layoutTransition, "layout")), { 41144 onPlay: onLayoutAnimationStart, 41145 onComplete: onLayoutAnimationComplete 41146 }); 41147 if (visualElement.shouldReduceMotion || this.options.layoutRoot) { 41148 animationOptions.delay = 0; 41149 animationOptions.type = false;
41150 } 41151 this.startAnimation(animationOptions); 41152 } else { 41153 if (!hasLayoutChanged) { 41154 finishAnimation(this); 41155 } 41156 if (this.isLead() && this.options.onExitComplete) { 41157 this.options.onExitComplete(); 41158 } 41159 } 41160 this.targetLayout = newLayout; 41161 }); 41162 } 41163 } 41164 unmount() { 41165 this.options.layoutId && this.willUpdate(); 41166 this.root.nodes.remove(this); 41167 const stack = this.getStack(); 41168 stack && stack.remove(this); 41169 this.parent && this.parent.children.delete(this); 41170 this.instance = void 0; 41171 cancelFrame(this.updateProjection); 41172 } 41173 // only on the root 41174 blockUpdate() { 41175 this.updateManuallyBlocked = true; 41176 } 41177 unblockUpdate() { 41178 this.updateManuallyBlocked = false; 41179 } 41180 isUpdateBlocked() { 41181 return this.updateManuallyBlocked || this.updateBlockedByResize; 41182 } 41183 isTreeAnimationBlocked() { 41184 return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || false; 41185 } 41186 // Note: currently only running on root node 41187 startUpdate() { 41188 if (this.isUpdateBlocked()) 41189 return; 41190 this.isUpdating = true; 41191 this.nodes && this.nodes.forEach(resetSkewAndRotation); 41192 this.animationId++; 41193 } 41194 getTransformTemplate() { 41195 const { visualElement } = this.options; 41196 return visualElement && visualElement.getProps().transformTemplate; 41197 } 41198 willUpdate(shouldNotifyListeners = true) { 41199 this.root.hasTreeAnimated = true; 41200 if (this.root.isUpdateBlocked()) { 41201 this.options.onExitComplete && this.options.onExitComplete(); 41202 return; 41203 } 41204 if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear) { 41205 cancelTreeOptimisedTransformAnimations(this); 41206 } 41207 !this.root.isUpdating && this.root.startUpdate(); 41208 if (this.isLayoutDirty) 41209 return; 41210 this.isLayoutDirty = true; 41211 for (let i2 = 0; i2 < this.path.length; i2++) { 41212 const node2 = this.path[i2]; 41213 node2.shouldResetTransform = true; 41214 node2.updateScroll("snapshot"); 41215 if (node2.options.layoutRoot) { 41216 node2.willUpdate(false); 41217 } 41218 } 41219 const { layoutId, layout: layout2 } = this.options; 41220 if (layoutId === void 0 && !layout2) 41221 return; 41222 const transformTemplate = this.getTransformTemplate(); 41223 this.prevTransformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : void 0; 41224 this.updateSnapshot(); 41225 shouldNotifyListeners && this.notifyListeners("willUpdate"); 41226 } 41227 update() { 41228 this.updateScheduled = false; 41229 const updateWasBlocked = this.isUpdateBlocked(); 41230 if (updateWasBlocked) { 41231 this.unblockUpdate(); 41232 this.clearAllSnapshots(); 41233 this.nodes.forEach(clearMeasurements); 41234 return; 41235 } 41236 if (!this.isUpdating) { 41237 this.nodes.forEach(clearIsLayoutDirty); 41238 } 41239 this.isUpdating = false; 41240 this.nodes.forEach(resetTransformStyle); 41241 this.nodes.forEach(updateLayout); 41242 this.nodes.forEach(notifyLayoutUpdate); 41243 this.clearAllSnapshots(); 41244 const now2 = time.now(); 41245 frameData.delta = clamp(0, 1e3 / 60, now2 - frameData.timestamp); 41246 frameData.timestamp = now2; 41247 frameData.isProcessing = true; 41248 frameSteps.update.process(frameData); 41249 frameSteps.preRender.process(frameData); 41250 frameSteps.render.process(frameData); 41251 frameData.isProcessing = false; 41252 } 41253 didUpdate() { 41254 if (!this.updateScheduled) { 41255 this.updateScheduled = true; 41256 microtask.read(this.scheduleUpdate); 41257 } 41258 } 41259 clearAllSnapshots() {
41260 this.nodes.forEach(clearSnapshot); 41261 this.sharedNodes.forEach(removeLeadSnapshots); 41262 } 41263 scheduleUpdateProjection() { 41264 if (!this.projectionUpdateScheduled) { 41265 this.projectionUpdateScheduled = true; 41266 frame.preRender(this.updateProjection, false, true); 41267 } 41268 } 41269 scheduleCheckAfterUnmount() { 41270 frame.postRender(() => { 41271 if (this.isLayoutDirty) { 41272 this.root.didUpdate(); 41273 } else { 41274 this.root.checkUpdateFailed(); 41275 } 41276 }); 41277 } 41278 /** 41279 * Update measurements 41280 */ 41281 updateSnapshot() { 41282 if (this.snapshot || !this.instance) 41283 return; 41284 this.snapshot = this.measure(); 41285 } 41286 updateLayout() { 41287 if (!this.instance) 41288 return; 41289 this.updateScroll(); 41290 if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) { 41291 return; 41292 } 41293 if (this.resumeFrom && !this.resumeFrom.instance) { 41294 for (let i2 = 0; i2 < this.path.length; i2++) { 41295 const node2 = this.path[i2]; 41296 node2.updateScroll(); 41297 } 41298 } 41299 const prevLayout = this.layout; 41300 this.layout = this.measure(false); 41301 this.layoutCorrected = createBox(); 41302 this.isLayoutDirty = false; 41303 this.projectionDelta = void 0; 41304 this.notifyListeners("measure", this.layout.layoutBox); 41305 const { visualElement } = this.options; 41306 visualElement && visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : void 0); 41307 } 41308 updateScroll(phase = "measure") { 41309 let needsMeasurement = Boolean(this.options.layoutScroll && this.instance); 41310 if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === phase) { 41311 needsMeasurement = false; 41312 } 41313 if (needsMeasurement) { 41314 const isRoot = checkIsScrollRoot(this.instance); 41315 this.scroll = { 41316 animationId: this.root.animationId, 41317 phase, 41318 isRoot, 41319 offset: measureScroll(this.instance), 41320 wasRoot: this.scroll ? this.scroll.isRoot : isRoot 41321 }; 41322 } 41323 } 41324 resetTransform() { 41325 if (!resetTransform) 41326 return; 41327 const isResetRequested = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout; 41328 const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); 41329 const transformTemplate = this.getTransformTemplate(); 41330 const transformTemplateValue = transformTemplate ? transformTemplate(this.latestValues, "") : void 0; 41331 const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; 41332 if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) { 41333 resetTransform(this.instance, transformTemplateValue); 41334 this.shouldResetTransform = false; 41335 this.scheduleRender(); 41336 } 41337 } 41338 measure(removeTransform = true) { 41339 const pageBox = this.measurePageBox(); 41340 let layoutBox = this.removeElementScroll(pageBox); 41341 if (removeTransform) { 41342 layoutBox = this.removeTransform(layoutBox); 41343 } 41344 roundBox(layoutBox); 41345 return { 41346 animationId: this.root.animationId, 41347 measuredBox: pageBox, 41348 layoutBox, 41349 latestValues: {}, 41350 source: this.id 41351 }; 41352 } 41353 measurePageBox() { 41354 var _a; 41355 const { visualElement } = this.options; 41356 if (!visualElement) 41357 return createBox(); 41358 const box = visualElement.measureViewportBox(); 41359 const wasInScrollRoot = ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) || this.path.some(checkNodeWasScrollRoot); 41360 if (!wasInScrollRoot) { 41361 const { scroll } = this.root; 41362 if (scroll) { 41363 translateAxis(box.x, scroll.offset.x); 41364 translateAxis(box.y, scroll.offset.y); 41365 } 41366 } 41367 return box; 41368 } 41369 removeElementScroll(box) { 41370 var _a; 41371 const boxWithoutScroll = createBox(); 41372 copyBoxInto(boxWithoutScroll, box); 41373 if ((_a = this.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot) { 41374 return boxWithoutScroll; 41375 } 41376 for (let i2 = 0; i2 < this.path.length; i2++) { 41377 const node2 = this.path[i2]; 41378 const { scroll, options: options2 } = node2; 41379 if (node2 !== this.root && scroll && options2.layoutScroll) { 41380 if (scroll.wasRoot) { 41381 copyBoxInto(boxWithoutScroll, box); 41382 } 41383 translateAxis(boxWithoutScroll.x, scroll.offset.x); 41384 translateAxis(boxWithoutScroll.y, scroll.offset.y); 41385 } 41386 } 41387 return boxWithoutScroll; 41388 } 41389 applyTransform(box, transformOnly = false) { 41390 const withTransforms = createBox(); 41391 copyBoxInto(withTransforms, box); 41392 for (let i2 = 0; i2 < this.path.length; i2++) { 41393 const node2 = this.path[i2]; 41394 if (!transformOnly && node2.options.layoutScroll && node2.scroll && node2 !== no
41394de2.root) { 41395 transformBox(withTransforms, { 41396 x: -node2.scroll.offset.x, 41397 y: -node2.scroll.offset.y 41398 }); 41399 } 41400 if (!hasTransform(node2.latestValues)) 41401 continue; 41402 transformBox(withTransforms, node2.latestValues); 41403 } 41404 if (hasTransform(this.latestValues)) { 41405 transformBox(withTransforms, this.latestValues); 41406 } 41407 return withTransforms; 41408 } 41409 removeTransform(box) { 41410 const boxWithoutTransform = createBox(); 41411 copyBoxInto(boxWithoutTransform, box); 41412 for (let i2 = 0; i2 < this.path.length; i2++) { 41413 const node2 = this.path[i2]; 41414 if (!node2.instance) 41415 continue; 41416 if (!hasTransform(node2.latestValues)) 41417 continue; 41418 hasScale(node2.latestValues) && node2.updateSnapshot(); 41419 const sourceBox = createBox(); 41420 const nodeBox = node2.measurePageBox(); 41421 copyBoxInto(sourceBox, nodeBox); 41422 removeBoxTransforms(boxWithoutTransform, node2.latestValues, node2.snapshot ? node2.snapshot.layoutBox : void 0, sourceBox); 41423 } 41424 if (hasTransform(this.latestValues)) { 41425 removeBoxTransforms(boxWithoutTransform, this.latestValues); 41426 } 41427 return boxWithoutTransform; 41428 } 41429 setTargetDelta(delta) { 41430 this.targetDelta = delta; 41431 this.root.scheduleUpdateProjection(); 41432 this.isProjectionDirty = true; 41433 } 41434 setOptions(options2) { 41435 this.options = __spreadProps(__spreadValues(__spreadValues({}, this.options), options2), { 41436 crossfade: options2.crossfade !== void 0 ? options2.crossfade : true 41437 }); 41438 } 41439 clearMeasurements() { 41440 this.scroll = void 0; 41441 this.layout = void 0; 41442 this.snapshot = void 0; 41443 this.prevTransformTemplateValue = void 0; 41444 this.targetDelta = void 0; 41445 this.target = void 0; 41446 this.isLayoutDirty = false; 41447 } 41448 forceRelativeParentToResolveTarget() { 41449 if (!this.relativeParent) 41450 return; 41451 if (this.relativeParent.resolvedRelativeTargetAt !== frameData.timestamp) { 41452 this.relativeParent.resolveTargetDelta(true); 41453 } 41454 } 41455 resolveTargetDelta(forceRecalculation = false) { 41456 var _a; 41457 const lead = this.getLead(); 41458 this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty); 41459 this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty); 41460 this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty); 41461 const isShared = Boolean(this.resumingFrom) || this !== lead; 41462 const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize); 41463 if (canSkip) 41464 return; 41465 const { layout: layout2, layoutId } = this.options; 41466 if (!this.layout || !(layout2 || layoutId)) 41467 return; 41468 this.resolvedRelativeTargetAt = frameData.timestamp; 41469 if (!this.targetDelta && !this.relativeTarget) { 41470 const relativeParent = this.getClosestProjectingParent(); 41471 if (relativeParent && relativeParent.layout && this.animationProgress !== 1) { 41472 this.relativeParent = relativeParent; 41473 this.forceRelativeParentToResolveTarget(); 41474 this.relativeTarget = createBox(); 41475 this.relativeTargetOrigin = createBox(); 41476 calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox); 41477 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 41478 } else { 41479 this.relativeParent = this.relativeTarget = void 0; 41480 } 41481 } 41482 if (!this.relativeTarget && !this.targetDelta) 41483 return; 41484 if (!this.target) { 41485 this.target = createBox(); 41486 this.targetWithTransforms = createBox(); 41487 } 41488 if (this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target) { 41489 this.forceRelativeParentToResolveTarget(); 41490 calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); 41491 } else if (this.targetDelta) { 41492 if (Boolean(this.resumingFrom)) { 41493 this.target = this.applyTransform(this.layout.layoutBox); 41494 } else { 41495 copyBoxInto(this.target, this.layout.layoutBox); 41496 } 41497 applyBoxDelta(this.target, this.targetDelta); 41498 } else { 41499 copyBoxInto(this.target, this.layout.layoutBox); 41500 } 41501 if (this.attemptToResolveRelativeTarget) { 41502 this.attemptToResolveRelativeTarget = false;
41503 const relativeParent = this.getClosestProjectingParent(); 41504 if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) { 41505 this.relativeParent = relativeParent; 41506 this.forceRelativeParentToResolveTarget(); 41507 this.relativeTarget = createBox(); 41508 this.relativeTargetOrigin = createBox(); 41509 calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target); 41510 copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); 41511 } else { 41512 this.relativeParent = this.relativeTarget = void 0; 41513 } 41514 } 41515 if (isDebug) { 41516 metrics.resolvedTargetDeltas++; 41517 } 41518 } 41519 getClosestProjectingParent() { 41520 if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) { 41521 return void 0; 41522 } 41523 if (this.parent.isProjecting()) { 41524 return this.parent; 41525 } else { 41526 return this.parent.getClosestProjectingParent(); 41527 } 41528 } 41529 isProjecting() { 41530 return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout); 41531 } 41532 calcProjection() { 41533 var _a; 41534 const lead = this.getLead(); 41535 const isShared = Boolean(this.resumingFrom) || this !== lead; 41536 let canSkip = true; 41537 if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) { 41538 canSkip = false; 41539 } 41540 if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) { 41541 canSkip = false; 41542 } 41543 if (this.resolvedRelativeTargetAt === frameData.timestamp) { 41544 canSkip = false; 41545 } 41546 if (canSkip) 41547 return; 41548 const { layout: layout2, layoutId } = this.options; 41549 this.isTreeAnimating = Boolean(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation); 41550 if (!this.isTreeAnimating) { 41551 this.targetDelta = this.relativeTarget = void 0; 41552 } 41553 if (!this.layout || !(layout2 || layoutId)) 41554 return; 41555 copyBoxInto(this.layoutCorrected, this.layout.layoutBox); 41556 const prevTreeScaleX = this.treeScale.x; 41557 const prevTreeScaleY = this.treeScale.y; 41558 applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared); 41559 if (lead.layout && !lead.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1)) { 41560 lead.target = lead.layout.layoutBox; 41561 lead.targetWithTransforms = createBox(); 41562 } 41563 const { target } = lead; 41564 if (!target) { 41565 if (this.prevProjectionDelta) { 41566 this.createProjectionDeltas(); 41567 this.scheduleRender(); 41568 } 41569 return; 41570 } 41571 if (!this.projectionDelta || !this.prevProjectionDelta) { 41572 this.createProjectionDeltas(); 41573 } else { 41574 copyAxisDeltaInto(this.prevProjectionDelta.x, this.projectionDelta.x); 41575 copyAxisDeltaInto(this.prevProjectionDelta.y, this.projectionDelta.y); 41576 } 41577 calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues); 41578 if (this.treeScale.x !== prevTreeScaleX || this.treeScale.y !== prevTreeScaleY || !axisDeltaEquals(this.projectionDelta.x, this.prevProjectionDelta.x) || !axisDeltaEquals(this.projectionDelta.y, this.prevProjectionDelta.y)) { 41579 this.hasProjected = true; 41580 this.scheduleRender(); 41581 this.notifyListeners("projectionUpdate", target); 41582 } 41583 if (isDebug) { 41584 metrics.recalculatedProjection++; 41585 } 41586 } 41587 hide() { 41588 this.isVisible = false; 41589 } 41590 show() { 41591 this.isVisible = true; 41592 } 41593 scheduleRender(notifyAll = true) { 41594 var _a; 41595 (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.scheduleRender(); 41596 if (notifyAll) {
41597 const stack = this.getStack(); 41598 stack && stack.scheduleRender(); 41599 } 41600 if (this.resumingFrom && !this.resumingFrom.instance) { 41601 this.resumingFrom = void 0; 41602 } 41603 } 41604 createProjectionDeltas() { 41605 this.prevProjectionDelta = createDelta(); 41606 this.projectionDelta = createDelta(); 41607 this.projectionDeltaWithTransform = createDelta(); 41608 } 41609 setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) { 41610 const snapshot = this.snapshot; 41611 const snapshotLatestValues = snapshot ? snapshot.latestValues : {}; 41612 const mixedValues = __spreadValues({}, this.latestValues); 41613 const targetDelta = createDelta(); 41614 if (!this.relativeParent || !this.relativeParent.options.layoutRoot) { 41615 this.relativeTarget = this.relativeTargetOrigin = void 0; 41616 } 41617 this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; 41618 const relativeLayout = createBox(); 41619 const snapshotSource = snapshot ? snapshot.source : void 0; 41620 const layoutSource = this.layout ? this.layout.source : void 0; 41621 const isSharedLayoutAnimation = snapshotSource !== layoutSource; 41622 const stack = this.getStack(); 41623 const isOnlyMember = !stack || stack.members.length <= 1; 41624 const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade)); 41625 this.animationProgress = 0; 41626 let prevRelativeTarget; 41627 this.mixTargetDelta = (latest) => { 41628 const progress2 = latest / 1e3; 41629 mixAxisDelta(targetDelta.x, delta.x, progress2); 41630 mixAxisDelta(targetDelta.y, delta.y, progress2); 41631 this.setTargetDelta(targetDelta); 41632 if (this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout) { 41633 calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox); 41634 mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress2); 41635 if (prevRelativeTarget && boxEquals(this.relativeTarget, prevRelativeTarget)) { 41636 this.isProjectionDirty = false; 41637 } 41638 if (!prevRelativeTarget) 41639 prevRelativeTarget = createBox(); 41640 copyBoxInto(prevRelativeTarget, this.relativeTarget); 41641 } 41642 if (isSharedLayoutAnimation) { 41643 this.animationValues = mixedValues; 41644 mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress2, shouldCrossfadeOpacity, isOnlyMember); 41645 } 41646 this.root.scheduleUpdateProjection(); 41647 this.scheduleRender(); 41648 this.animationProgress = progress2; 41649 }; 41650 this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0); 41651 } 41652 startAnimation(options2) { 41653 this.notifyListeners("animationStart"); 41654 this.currentAnimation && this.currentAnimation.stop(); 41655 if (this.resumingFrom && this.resumingFrom.currentAnimation) { 41656 this.resumingFrom.currentAnimation.stop(); 41657 } 41658 if (this.pendingAnimation) { 41659 cancelFrame(this.pendingAnimation); 41660 this.pendingAnimation = void 0; 41661 } 41662 this.pendingAnimation = frame.update(() => { 41663 globalProjectionState.hasAnimatedSinceResize = true; 41664 this.currentAnimation = animateSingleValue(0, animationTarget, __spreadProps(__spreadValues({}, options2), { 41665 onUpdate: (latest) => { 41666 this.mixTargetDelta(latest); 41667 options2.onUpdate && options2.onUpdate(latest); 41668 }, 41669 onComplete: () => { 41670 options2.onComplete && options2.onComplete(); 41671 this.completeAnimation(); 41672 } 41673 })); 41674 if (this.resumingFrom) { 41675 this.resumingFrom.currentAnimation = this.currentAnimation; 41676 } 41677 this.pendingAnimation = void 0; 41678 }); 41679 } 41680 completeAnimation() { 41681 if (this.resumingFrom) { 41682 this.resumingFrom.currentAnimation = void 0; 41683 this.resumingFrom.preserveOpacity = void 0; 41684 }
41685 const stack = this.getStack(); 41686 stack && stack.exitAnimationComplete(); 41687 this.resumingFrom = this.currentAnimation = this.animationValues = void 0; 41688 this.notifyListeners("animationComplete"); 41689 } 41690 finishAnimation() { 41691 if (this.currentAnimation) { 41692 this.mixTargetDelta && this.mixTargetDelta(animationTarget); 41693 this.currentAnimation.stop(); 41694 } 41695 this.completeAnimation(); 41696 } 41697 applyTransformsToTarget() { 41698 const lead = this.getLead(); 41699 let { targetWithTransforms, target, layout: layout2, latestValues } = lead; 41700 if (!targetWithTransforms || !target || !layout2) 41701 return; 41702 if (this !== lead && this.layout && layout2 && shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout2.layoutBox)) { 41703 target = this.target || createBox(); 41704 const xLength = calcLength(this.layout.layoutBox.x); 41705 target.x.min = lead.target.x.min; 41706 target.x.max = target.x.min + xLength; 41707 const yLength = calcLength(this.layout.layoutBox.y); 41708 target.y.min = lead.target.y.min; 41709 target.y.max = target.y.min + yLength; 41710 } 41711 copyBoxInto(targetWithTransforms, target); 41712 transformBox(targetWithTransforms, latestValues); 41713 calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); 41714 } 41715 registerSharedNode(layoutId, node2) { 41716 if (!this.sharedNodes.has(layoutId)) { 41717 this.sharedNodes.set(layoutId, new NodeStack()); 41718 } 41719 const stack = this.sharedNodes.get(layoutId); 41720 stack.add(node2); 41721 const config = node2.options.initialPromotionConfig; 41722 node2.promote({ 41723 transition: config ? config.transition : void 0, 41724 preserveFollowOpacity: config && config.shouldPreserveFollowOpacity ? config.shouldPreserveFollowOpacity(node2) : void 0 41725 }); 41726 } 41727 isLead() { 41728 const stack = this.getStack(); 41729 return stack ? stack.lead === this : true; 41730 } 41731 getLead() { 41732 var _a; 41733 const { layoutId } = this.options; 41734 return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; 41735 } 41736 getPrevLead() { 41737 var _a; 41738 const { layoutId } = this.options; 41739 return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : void 0; 41740 } 41741 getStack() { 41742 const { layoutId } = this.options; 41743 if (layoutId) 41744 return this.root.sharedNodes.get(layoutId); 41745 } 41746 promote({ needsReset, transition, preserveFollowOpacity } = {}) { 41747 const stack = this.getStack(); 41748 if (stack) 41749 stack.promote(this, preserveFollowOpacity); 41750 if (needsReset) { 41751 this.projectionDelta = void 0; 41752 this.needsReset = true; 41753 } 41754 if (transition) 41755 this.setOptions({ transition }); 41756 } 41757 relegate() { 41758 const stack = this.getStack(); 41759 if (stack) { 41760 return stack.relegate(this); 41761 } else { 41762 return false; 41763 } 41764 } 41765 resetSkewAndRotation() { 41766 const { visualElement } = this.options; 41767 if (!visualElement) 41768 return; 41769 let hasDistortingTransform = false; 41770 const { latestValues } = visualElement; 41771 if (latestValues.z || latestValues.rotate || latestValues.rotateX || latestValues.rotateY || latestValues.rotateZ || latestValues.skewX || latestValues.skewY) { 41772 hasDistortingTransform = true; 41773 } 41774 if (!hasDistortingTransform) 41775 return; 41776 const resetValues = {}; 41777 if (latestValues.z) { 41778 resetDistortingTransform("z", visualElement, resetValues, this.animationValues); 41779 } 41780 for (let i2 = 0; i2 < transformAxes.length; i2++) { 41781 resetDistortingTransform(`rotate${transformAxes[i2]}`, visualElement, resetValues, this.animationValues); 41782 resetDistortingTransform(`skew${transformAxes[i2]}`, visualElement, resetValues, this.animationValues); 41783 } 41784 visualElement.render(); 41785 for (const key in resetValues) { 41786 visualElement.setStaticValue(key, resetValues[key]); 41787 if (this.animationValues) { 41788 this.animationValues[key] = resetValues[key]; 41789 } 41790 } 41791 visualElement.scheduleRender(); 41792 } 41793 getProjectionStyles(styleProp) { 41794 var _a, _b; 41795 if (!this.instance || this.isSVG) 41796 return void 0; 41797 if (!this.isVisible) { 41798 return hiddenVisibility; 41799 } 41800 const styles = { 41801 visibility: "" 41802 }; 41803 const transformTemplate = this.getTransformTemplate(); 41804 if (this.needsReset) { 41805 this.needsReset = false;
41806 styles.opacity = ""; 41807 styles.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 41808 styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none"; 41809 return styles; 41810 } 41811 const lead = this.getLead(); 41812 if (!this.projectionDelta || !this.layout || !lead.target) { 41813 const emptyStyles = {}; 41814 if (this.options.layoutId) { 41815 emptyStyles.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1; 41816 emptyStyles.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || ""; 41817 } 41818 if (this.hasProjected && !hasTransform(this.latestValues)) { 41819 emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none"; 41820 this.hasProjected = false; 41821 } 41822 return emptyStyles; 41823 } 41824 const valuesToRender = lead.animationValues || lead.latestValues; 41825 this.applyTransformsToTarget(); 41826 styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); 41827 if (transformTemplate) { 41828 styles.transform = transformTemplate(valuesToRender, styles.transform); 41829 } 41830 const { x: x2, y: y2 } = this.projectionDelta; 41831 styles.transformOrigin = `${x2.origin * 100}% ${y2.origin * 100}% 0`; 41832 if (lead.animationValues) { 41833 styles.opacity = lead === this ? (_b = (_a = valuesToRender.opacity) !== null && _a !== void 0 ? _a : this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit; 41834 } else { 41835 styles.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0; 41836 } 41837 for (const key in scaleCorrectors) { 41838 if (valuesToRender[key] === void 0) 41839 continue; 41840 const { correct, applyTo } = scaleCorrectors[key]; 41841 const corrected = styles.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead); 41842 if (applyTo) { 41843 const num = applyTo.length; 41844 for (let i2 = 0; i2 < num; i2++) { 41845 styles[applyTo[i2]] = corrected; 41846 } 41847 } else { 41848 styles[key] = corrected; 41849 } 41850 } 41851 if (this.options.layoutId) { 41852 styles.pointerEvents = lead === this ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "" : "none"; 41853 } 41854 return styles; 41855 } 41856 clearSnapshot() { 41857 this.resumeFrom = this.snapshot = void 0; 41858 } 41859 // Only run on root 41860 resetTree() { 41861 this.root.nodes.forEach((node2) => { 41862 var _a; 41863 return (_a = node2.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); 41864 }); 41865 this.root.nodes.forEach(clearMeasurements); 41866 this.root.sharedNodes.clear(); 41867 } 41868 }; 41869 } 41870 function updateLayout(node2) { 41871 node2.updateLayout(); 41872 } 41873 function notifyLayoutUpdate(node2) { 41874 var _a; 41875 const snapshot = ((_a = node2.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) || node2.snapshot; 41876 if (node2.isLead() && node2.layout && snapshot && node2.hasListeners("didUpdate")) { 41877 const { layoutBox: layout2, measuredBox: measuredLayout } = node2.layout; 41878 const { animationType } = node2.options; 41879 const isShared = snapshot.source !== node2.layout.source; 41880 if (animationType === "size") { 41881 eachAxis((axis) => { 41882 const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; 41883 const length2 = calcLength(axisSnapshot); 41884 axisSnapshot.min = layout2[axis].min; 41885 axisSnapshot.max = axisSnapshot.min + length2; 41886 }); 41887 } else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout2)) { 41888 eachAxis((axis) => { 41889 const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis]; 41890 const length2 = calcLength(layout2[axis]); 41891 axisSnapshot.max = axisSnapshot.min + length2; 41892 if (node2.relativeTarget && !node2.currentAnimation) { 41893 node2.isProjectionDirty = true;
41894 node2.relativeTarget[axis].max = node2.relativeTarget[axis].min + length2; 41895 } 41896 }); 41897 } 41898 const layoutDelta = createDelta(); 41899 calcBoxDelta(layoutDelta, layout2, snapshot.layoutBox); 41900 const visualDelta = createDelta(); 41901 if (isShared) { 41902 calcBoxDelta(visualDelta, node2.applyTransform(measuredLayout, true), snapshot.measuredBox); 41903 } else { 41904 calcBoxDelta(visualDelta, layout2, snapshot.layoutBox); 41905 } 41906 const hasLayoutChanged = !isDeltaZero(layoutDelta); 41907 let hasRelativeTargetChanged = false; 41908 if (!node2.resumeFrom) { 41909 const relativeParent = node2.getClosestProjectingParent(); 41910 if (relativeParent && !relativeParent.resumeFrom) { 41911 const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent; 41912 if (parentSnapshot && parentLayout) { 41913 const relativeSnapshot = createBox(); 41914 calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox); 41915 const relativeLayout = createBox(); 41916 calcRelativePosition(relativeLayout, layout2, parentLayout.layoutBox); 41917 if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) { 41918 hasRelativeTargetChanged = true; 41919 } 41920 if (relativeParent.options.layoutRoot) { 41921 node2.relativeTarget = relativeLayout; 41922 node2.relativeTargetOrigin = relativeSnapshot; 41923 node2.relativeParent = relativeParent; 41924 } 41925 } 41926 } 41927 } 41928 node2.notifyListeners("didUpdate", { 41929 layout: layout2, 41930 snapshot, 41931 delta: visualDelta, 41932 layoutDelta, 41933 hasLayoutChanged, 41934 hasRelativeTargetChanged 41935 }); 41936 } else if (node2.isLead()) { 41937 const { onExitComplete } = node2.options; 41938 onExitComplete && onExitComplete(); 41939 } 41940 node2.options.transition = void 0; 41941 } 41942 function propagateDirtyNodes(node2) { 41943 if (isDebug) { 41944 metrics.totalNodes++; 41945 } 41946 if (!node2.parent) 41947 return; 41948 if (!node2.isProjecting()) { 41949 node2.isProjectionDirty = node2.parent.isProjectionDirty; 41950 } 41951 node2.isSharedProjectionDirty || (node2.isSharedProjectionDirty = Boolean(node2.isProjectionDirty || node2.parent.isProjectionDirty || node2.parent.isSharedProjectionDirty)); 41952 node2.isTransformDirty || (node2.isTransformDirty = node2.parent.isTransformDirty); 41953 } 41954 function cleanDirtyNodes(node2) { 41955 node2.isProjectionDirty = node2.isSharedProjectionDirty = node2.isTransformDirty = false; 41956 } 41957 function clearSnapshot(node2) { 41958 node2.clearSnapshot(); 41959 } 41960 function clearMeasurements(node2) { 41961 node2.clearMeasurements(); 41962 } 41963 function clearIsLayoutDirty(node2) { 41964 node2.isLayoutDirty = false; 41965 } 41966 function resetTransformStyle(node2) { 41967 const { visualElement } = node2.options; 41968 if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) { 41969 visualElement.notify("BeforeLayoutMeasure"); 41970 } 41971 node2.resetTransform(); 41972 } 41973 function finishAnimation(node2) { 41974 node2.finishAnimation(); 41975 node2.targetDelta = node2.relativeTarget = node2.target = void 0; 41976 node2.isProjectionDirty = true; 41977 } 41978 function resolveTargetDelta(node2) { 41979 node2.resolveTargetDelta(); 41980 } 41981 function calcProjection(node2) { 41982 node2.calcProjection(); 41983 } 41984 function resetSkewAndRotation(node2) { 41985 node2.resetSkewAndRotation(); 41986 } 41987 function removeLeadSnapshots(stack) { 41988 stack.removeLeadSnapshot(); 41989 } 41990 function mixAxisDelta(output, delta, p2) { 41991 output.translate = mixNumber$1(delta.translate, 0, p2); 41992 output.scale = mixNumber$1(delta.scale, 1, p2); 41993 output.origin = delta.origin; 41994 output.originPoint = delta.originPoint; 41995 } 41996 function mixAxis(output, from2, to2, p2) { 41997 output.min = mixNumber$1(from2.min, to2.min, p2); 41998 output.max = mixNumber$1(from2.max, to2.max, p2); 41999 } 42000 function mixBox(output, from2, to2, p2) { 42001 mixAxis(output.x, from2.x, to2.x, p2); 42002 mixAxis(output.y, from2.y, to2.y, p2); 42003 } 42004 function hasOpacityCrossfade(node2) { 42005 return node2.animationValues && node2.animationValues.opacityExit !== void 0; 42006 } 42007 const defaultLayoutTransition = { 42008 duration: 0.45, 42009 ease: [0.4, 0, 0.1, 1] 42010 }; 42011 const userAgentContains = (string2) => typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(string2); 42012 const roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") ? Math.round : noop$3; 42013 function roundAxis(axis) { 42014 axis.min = roundPoint(axis.min); 42015 axis.max = roundPoint(axis.max); 42016 } 42017 function roundBox(box) { 42018 roundAxis(box.x); 42019 roundAxis(box.y); 42020 } 42021 function shouldAnimatePositionOnly(animationType, snapshot, layout2) { 42022 return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout2), 0.2); 42023 } 42024 function checkNodeWasScrollRoot(node2) { 42025 var _a;
42026 return node2 !== node2.root && ((_a = node2.scroll) === null || _a === void 0 ? void 0 : _a.wasRoot); 42027 } 42028 const DocumentProjectionNode = createProjectionNode({ 42029 attachResizeListener: (ref, notify2) => addDomEvent(ref, "resize", notify2), 42030 measureScroll: () => ({ 42031 x: document.documentElement.scrollLeft || document.body.scrollLeft, 42032 y: document.documentElement.scrollTop || document.body.scrollTop 42033 }), 42034 checkIsScrollRoot: () => true 42035 }); 42036 const rootProjectionNode = { 42037 current: void 0 42038 }; 42039 const HTMLProjectionNode = createProjectionNode({ 42040 measureScroll: (instance2) => ({ 42041 x: instance2.scrollLeft, 42042 y: instance2.scrollTop 42043 }), 42044 defaultParent: () => { 42045 if (!rootProjectionNode.current) { 42046 const documentNode = new DocumentProjectionNode({}); 42047 documentNode.mount(window); 42048 documentNode.setOptions({ layoutScroll: true }); 42049 rootProjectionNode.current = documentNode; 42050 } 42051 return rootProjectionNode.current; 42052 }, 42053 resetTransform: (instance2, value) => { 42054 instance2.style.transform = value !== void 0 ? value : "none"; 42055 }, 42056 checkIsScrollRoot: (instance2) => Boolean(window.getComputedStyle(instance2).position === "fixed") 42057 }); 42058 const drag = { 42059 pan: { 42060 Feature: PanGesture 42061 }, 42062 drag: { 42063 Feature: DragGesture, 42064 ProjectionNode: HTMLProjectionNode, 42065 MeasureLayout 42066 } 42067 }; 42068 function handleHoverEvent(node2, event, lifecycle) { 42069 const { props } = node2; 42070 if (node2.animationState && props.whileHover) { 42071 node2.animationState.setActive("whileHover", lifecycle === "Start"); 42072 } 42073 const eventName = "onHover" + lifecycle; 42074 const callback = props[eventName]; 42075 if (callback) { 42076 frame.postRender(() => callback(event, extractEventInfo(event))); 42077 } 42078 } 42079 class HoverGesture extends Feature { 42080 mount() { 42081 const { current } = this.node; 42082 if (!current) 42083 return; 42084 this.unmount = hover(current, (startEvent) => { 42085 handleHoverEvent(this.node, startEvent, "Start"); 42086 return (endEvent) => handleHoverEvent(this.node, endEvent, "End"); 42087 }); 42088 } 42089 unmount() { 42090 } 42091 } 42092 class FocusGesture extends Feature { 42093 constructor() { 42094 super(...arguments); 42095 this.isActive = false; 42096 } 42097 onFocus() { 42098 let isFocusVisible = false; 42099 try { 42100 isFocusVisible = this.node.current.matches(":focus-visible"); 42101 } catch (e2) { 42102 isFocusVisible = true; 42103 } 42104 if (!isFocusVisible || !this.node.animationState) 42105 return; 42106 this.node.animationState.setActive("whileFocus", true); 42107 this.isActive = true; 42108 } 42109 onBlur() { 42110 if (!this.isActive || !this.node.animationState) 42111 return; 42112 this.node.animationState.setActive("whileFocus", false); 42113 this.isActive = false; 42114 } 42115 mount() { 42116 this.unmount = pipe(addDomEvent(this.node.current, "focus", () => this.onFocus()), addDomEvent(this.node.current, "blur", () => this.onBlur())); 42117 } 42118 unmount() { 42119 } 42120 } 42121 function handlePressEvent(node2, event, lifecycle) { 42122 const { props } = node2; 42123 if (node2.animationState && props.whileTap) { 42124 node2.animationState.setActive("whileTap", lifecycle === "Start"); 42125 } 42126 const eventName = "onTap" + (lifecycle === "End" ? "" : lifecycle); 42127 const callback = props[eventName]; 42128 if (callback) { 42129 frame.postRender(() => callback(event, extractEventInfo(event))); 42130 } 42131 } 42132 class PressGesture extends Feature { 42133 mount() { 42134 const { current } = this.node; 42135 if (!current) 42136 return; 42137 this.unmount = press(current, (startEvent) => { 42138 handlePressEvent(this.node, startEvent, "Start"); 42139 return (endEvent, { success }) => handlePressEvent(this.node, endEvent, success ? "End" : "Cancel"); 42140 }, { useGlobalTarget: this.node.props.globalTapTarget }); 42141 } 42142 unmount() { 42143 } 42144 } 42145 const observerCallbacks = /* @__PURE__ */ new WeakMap(); 42146 const observers = /* @__PURE__ */ new WeakMap(); 42147 const fireObserverCallback = (entry) => { 42148 const callback = observerCallbacks.get(entry.target); 42149 callback && callback(entry); 42150 }; 42151 const fireAllObserverCallbacks = (entries2) => {
42152 entries2.forEach(fireObserverCallback); 42153 }; 42154 function initIntersectionObserver(_r2) { 42155 var _s = _r2, { root: root2 } = _s, options2 = __objRest(_s, ["root"]); 42156 const lookupRoot = root2 || document; 42157 if (!observers.has(lookupRoot)) { 42158 observers.set(lookupRoot, {}); 42159 } 42160 const rootObservers = observers.get(lookupRoot); 42161 const key = JSON.stringify(options2); 42162 if (!rootObservers[key]) { 42163 rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __spreadValues({ root: root2 }, options2)); 42164 } 42165 return rootObservers[key]; 42166 } 42167 function observeIntersection(element, options2, callback) { 42168 const rootInteresectionObserver = initIntersectionObserver(options2); 42169 observerCallbacks.set(element, callback); 42170 rootInteresectionObserver.observe(element); 42171 return () => { 42172 observerCallbacks.delete(element); 42173 rootInteresectionObserver.unobserve(element); 42174 }; 42175 } 42176 const thresholdNames = { 42177 some: 0, 42178 all: 1 42179 }; 42180 class InViewFeature extends Feature { 42181 constructor() { 42182 super(...arguments); 42183 this.hasEnteredView = false; 42184 this.isInView = false; 42185 } 42186 startObserver() { 42187 this.unmount(); 42188 const { viewport = {} } = this.node.getProps(); 42189 const { root: root2, margin: rootMargin, amount = "some", once: once2 } = viewport; 42190 const options2 = { 42191 root: root2 ? root2.current : void 0, 42192 rootMargin, 42193 threshold: typeof amount === "number" ? amount : thresholdNames[amount] 42194 }; 42195 const onIntersectionUpdate = (entry) => { 42196 const { isIntersecting } = entry; 42197 if (this.isInView === isIntersecting) 42198 return; 42199 this.isInView = isIntersecting; 42200 if (once2 && !isIntersecting && this.hasEnteredView) { 42201 return; 42202 } else if (isIntersecting) { 42203 this.hasEnteredView = true; 42204 } 42205 if (this.node.animationState) { 42206 this.node.animationState.setActive("whileInView", isIntersecting); 42207 } 42208 const { onViewportEnter, onViewportLeave } = this.node.getProps(); 42209 const callback = isIntersecting ? onViewportEnter : onViewportLeave; 42210 callback && callback(entry); 42211 }; 42212 return observeIntersection(this.node.current, options2, onIntersectionUpdate); 42213 } 42214 mount() { 42215 this.startObserver(); 42216 } 42217 update() { 42218 if (typeof IntersectionObserver === "undefined") 42219 return; 42220 const { props, prevProps } = this.node; 42221 const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps)); 42222 if (hasOptionsChanged) { 42223 this.startObserver(); 42224 } 42225 } 42226 unmount() { 42227 } 42228 } 42229 function hasViewportOptionChanged({ viewport = {} }, { viewport: prevViewport = {} } = {}) { 42230 return (name) => viewport[name] !== prevViewport[name]; 42231 } 42232 const gestureAnimations = { 42233 inView: { 42234 Feature: InViewFeature 42235 }, 42236 tap: { 42237 Feature: PressGesture 42238 }, 42239 focus: { 42240 Feature: FocusGesture 42241 }, 42242 hover: { 42243 Feature: HoverGesture 42244 } 42245 }; 42246 const layout = { 42247 layout: { 42248 ProjectionNode: HTMLProjectionNode, 42249 MeasureLayout 42250 } 42251 }; 42252 const prefersReducedMotion = { current: null }; 42253 const hasReducedMotionListener = { current: false }; 42254 function initPrefersReducedMotion() { 42255 hasReducedMotionListener.current = true; 42256 if (!isBrowser) 42257 return; 42258 if (window.matchMedia) { 42259 const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)"); 42260 const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches; 42261 motionMediaQuery.addListener(setReducedMotionPreferences); 42262 setReducedMotionPreferences(); 42263 } else { 42264 prefersReducedMotion.current = false; 42265 } 42266 } 42267 const valueTypes = [...dimensionValueTypes, color, complex]; 42268 const findValueType = (v2) => valueTypes.find(testValueType(v2)); 42269 const visualElementStore = /* @__PURE__ */ new WeakMap(); 42270 function updateMotionValuesFromProps(element, next2, prev2) { 42271 for (const key in next2) { 42272 const nextValue = next2[key]; 42273 const prevValue = prev2[key];
42274 if (isMotionValue(nextValue)) { 42275 element.addValue(key, nextValue); 42276 } else if (isMotionValue(prevValue)) { 42277 element.addValue(key, motionValue(nextValue, { owner: element })); 42278 } else if (prevValue !== nextValue) { 42279 if (element.hasValue(key)) { 42280 const existingValue = element.getValue(key); 42281 if (existingValue.liveStyle === true) { 42282 existingValue.jump(nextValue); 42283 } else if (!existingValue.hasAnimated) { 42284 existingValue.set(nextValue); 42285 } 42286 } else { 42287 const latestValue = element.getStaticValue(key); 42288 element.addValue(key, motionValue(latestValue !== void 0 ? latestValue : nextValue, { owner: element })); 42289 } 42290 } 42291 } 42292 for (const key in prev2) { 42293 if (next2[key] === void 0) 42294 element.removeValue(key); 42295 } 42296 return next2; 42297 } 42298 const propEventHandlers = [ 42299 "AnimationStart", 42300 "AnimationComplete", 42301 "Update", 42302 "BeforeLayoutMeasure", 42303 "LayoutMeasure", 42304 "LayoutAnimationStart", 42305 "LayoutAnimationComplete" 42306 ]; 42307 class VisualElement { 42308 /** 42309 * This method takes React props and returns found MotionValues. For example, HTML 42310 * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays. 42311 * 42312 * This isn't an abstract method as it needs calling in the constructor, but it is 42313 * intended to be one. 42314 */ 42315 scrapeMotionValuesFromProps(_props, _prevProps, _visualElement) { 42316 return {}; 42317 } 42318 constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState }, options2 = {}) { 42319 this.current = null; 42320 this.children = /* @__PURE__ */ new Set(); 42321 this.isVariantNode = false; 42322 this.isControllingVariants = false; 42323 this.shouldReduceMotion = null; 42324 this.values = /* @__PURE__ */ new Map(); 42325 this.KeyframeResolver = KeyframeResolver; 42326 this.features = {}; 42327 this.valueSubscriptions = /* @__PURE__ */ new Map(); 42328 this.prevMotionValues = {}; 42329 this.events = {}; 42330 this.propEventSubscriptions = {}; 42331 this.notifyUpdate = () => this.notify("Update", this.latestValues); 42332 this.render = () => { 42333 if (!this.current) 42334 return; 42335 this.triggerBuild(); 42336 this.renderInstance(this.current, this.renderState, this.props.style, this.projection); 42337 }; 42338 this.renderScheduledAt = 0; 42339 this.scheduleRender = () => { 42340 const now2 = time.now(); 42341 if (this.renderScheduledAt < now2) { 42342 this.renderScheduledAt = now2; 42343 frame.render(this.render, false, true); 42344 } 42345 }; 42346 const { latestValues, renderState, onUpdate } = visualState; 42347 this.onUpdate = onUpdate; 42348 this.latestValues = latestValues; 42349 this.baseTarget = __spreadValues({}, latestValues); 42350 this.initialValues = props.initial ? __spreadValues({}, latestValues) : {}; 42351 this.renderState = renderState; 42352 this.parent = parent; 42353 this.props = props; 42354 this.presenceContext = presenceContext; 42355 this.depth = parent ? parent.depth + 1 : 0; 42356 this.reducedMotionConfig = reducedMotionConfig; 42357 this.options = options2; 42358 this.blockInitialAnimation = Boolean(blockInitialAnimation); 42359 this.isControllingVariants = isControllingVariants(props); 42360 this.isVariantNode = isVariantNode(props); 42361 if (this.isVariantNode) { 42362 this.variantChildren = /* @__PURE__ */ new Set(); 42363 } 42364 this.manuallyAnimateOnMount = Boolean(parent && parent.current); 42365 const _a = this.scrapeMotionValuesFromProps(props, {}, this), { willChange } = _a, initialMotionValues = __objRest(_a, ["willChange"]); 42366 for (const key in initialMotionValues) { 42367 const value = initialMotionValues[key]; 42368 if (latestValues[key] !== void 0 && isMotionValue(value)) { 42369 value.set(latestValues[key], false); 42370 } 42371 } 42372 } 42373 mount(instance2) { 42374 this.current = instance2; 42375 visualElementStore.set(instance2, this); 42376 if (this.projection && !this.projection.instance) { 42377 this.projection.mount(instance2); 42378 } 42379 if (this.parent && this.isVariantNode && !this.isControllingVariants) { 42380 this.removeFromVariantTree = this.parent.addVariantChild(this); 42381 }
42382 this.values.forEach((value, key) => this.bindToMotionValue(key, value)); 42383 if (!hasReducedMotionListener.current) { 42384 initPrefersReducedMotion(); 42385 } 42386 this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current; 42387 if (this.parent) 42388 this.parent.children.add(this); 42389 this.update(this.props, this.presenceContext); 42390 } 42391 unmount() { 42392 visualElementStore.delete(this.current); 42393 this.projection && this.projection.unmount(); 42394 cancelFrame(this.notifyUpdate); 42395 cancelFrame(this.render); 42396 this.valueSubscriptions.forEach((remove) => remove()); 42397 this.valueSubscriptions.clear(); 42398 this.removeFromVariantTree && this.removeFromVariantTree(); 42399 this.parent && this.parent.children.delete(this); 42400 for (const key in this.events) { 42401 this.events[key].clear(); 42402 } 42403 for (const key in this.features) { 42404 const feature = this.features[key]; 42405 if (feature) { 42406 feature.unmount(); 42407 feature.isMounted = false; 42408 } 42409 } 42410 this.current = null; 42411 } 42412 bindToMotionValue(key, value) { 42413 if (this.valueSubscriptions.has(key)) { 42414 this.valueSubscriptions.get(key)(); 42415 } 42416 const valueIsTransform = transformProps.has(key); 42417 const removeOnChange = value.on("change", (latestValue) => { 42418 this.latestValues[key] = latestValue; 42419 this.props.onUpdate && frame.preRender(this.notifyUpdate); 42420 if (valueIsTransform && this.projection) { 42421 this.projection.isTransformDirty = true; 42422 } 42423 }); 42424 const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender); 42425 let removeSyncCheck; 42426 if (window.MotionCheckAppearSync) { 42427 removeSyncCheck = window.MotionCheckAppearSync(this, key, value); 42428 } 42429 this.valueSubscriptions.set(key, () => { 42430 removeOnChange(); 42431 removeOnRenderRequest(); 42432 if (removeSyncCheck) 42433 removeSyncCheck(); 42434 if (value.owner) 42435 value.stop(); 42436 }); 42437 } 42438 sortNodePosition(other) { 42439 if (!this.current || !this.sortInstanceNodePosition || this.type !== other.type) { 42440 return 0; 42441 } 42442 return this.sortInstanceNodePosition(this.current, other.current); 42443 } 42444 updateFeatures() { 42445 let key = "animation"; 42446 for (key in featureDefinitions) { 42447 const featureDefinition = featureDefinitions[key]; 42448 if (!featureDefinition) 42449 continue; 42450 const { isEnabled: isEnabled2, Feature: FeatureConstructor } = featureDefinition; 42451 if (!this.features[key] && FeatureConstructor && isEnabled2(this.props)) { 42452 this.features[key] = new FeatureConstructor(this); 42453 } 42454 if (this.features[key]) { 42455 const feature = this.features[key]; 42456 if (feature.isMounted) { 42457 feature.update(); 42458 } else { 42459 feature.mount(); 42460 feature.isMounted = true; 42461 } 42462 } 42463 } 42464 } 42465 triggerBuild() { 42466 this.build(this.renderState, this.latestValues, this.props); 42467 } 42468 /** 42469 * Measure the current viewport box with or without transforms. 42470 * Only measures axis-aligned boxes, rotate and skew must be manually 42471 * removed with a re-render to work. 42472 */ 42473 measureViewportBox() { 42474 return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox(); 42475 } 42476 getStaticValue(key) { 42477 return this.latestValues[key]; 42478 } 42479 setStaticValue(key, value) { 42480 this.latestValues[key] = value; 42481 } 42482 /** 42483 * Update the provided props. Ensure any newly-added motion values are 42484 * added to our map, old ones removed, and listeners updated. 42485 */ 42486 update(props, presenceContext) { 42487 if (props.transformTemplate || this.props.transformTemplate) { 42488 this.scheduleRender(); 42489 } 42490 this.prevProps = this.props; 42491 this.props = props; 42492 this.prevPresenceContext = this.presenceContext; 42493 this.presenceContext = presenceContext; 42494 for (let i2 = 0; i2 < propEventHandlers.length; i2++) {
vendor: 7,993 bytes, lines 42495-42708
42495 const key = propEventHandlers[i2]; 42496 if (this.propEventSubscriptions[key]) { 42497 this.propEventSubscriptions[key](); 42498 delete this.propEventSubscriptions[key]; 42499 } 42500 const listenerName = "on" + key; 42501 const listener = props[listenerName]; 42502 if (listener) { 42503 this.propEventSubscriptions[key] = this.on(key, listener); 42504 } 42505 } 42506 this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues); 42507 if (this.handleChildMotionValue) { 42508 this.handleChildMotionValue(); 42509 } 42510 this.onUpdate && this.onUpdate(this); 42511 } 42512 getProps() { 42513 return this.props; 42514 } 42515 /** 42516 * Returns the variant definition with a given name. 42517 */ 42518 getVariant(name) { 42519 return this.props.variants ? this.props.variants[name] : void 0; 42520 } 42521 /** 42522 * Returns the defined default transition on this component. 42523 */ 42524 getDefaultTransition() { 42525 return this.props.transition; 42526 } 42527 getTransformPagePoint() { 42528 return this.props.transformPagePoint; 42529 } 42530 getClosestVariantNode() { 42531 return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0; 42532 } 42533 /** 42534 * Add a child visual element to our set of children. 42535 */ 42536 addVariantChild(child) { 42537 const closestVariantNode = this.getClosestVariantNode(); 42538 if (closestVariantNode) { 42539 closestVariantNode.variantChildren && closestVariantNode.variantChildren.add(child); 42540 return () => closestVariantNode.variantChildren.delete(child); 42541 } 42542 } 42543 /** 42544 * Add a motion value and bind it to this visual element. 42545 */ 42546 addValue(key, value) { 42547 const existingValue = this.values.get(key); 42548 if (value !== existingValue) { 42549 if (existingValue) 42550 this.removeValue(key); 42551 this.bindToMotionValue(key, value); 42552 this.values.set(key, value); 42553 this.latestValues[key] = value.get(); 42554 } 42555 } 42556 /** 42557 * Remove a motion value and unbind any active subscriptions. 42558 */ 42559 removeValue(key) { 42560 this.values.delete(key); 42561 const unsubscribe = this.valueSubscriptions.get(key); 42562 if (unsubscribe) { 42563 unsubscribe(); 42564 this.valueSubscriptions.delete(key); 42565 } 42566 delete this.latestValues[key]; 42567 this.removeValueFromRenderState(key, this.renderState); 42568 } 42569 /** 42570 * Check whether we have a motion value for this key 42571 */ 42572 hasValue(key) { 42573 return this.values.has(key); 42574 } 42575 getValue(key, defaultValue) { 42576 if (this.props.values && this.props.values[key]) { 42577 return this.props.values[key]; 42578 } 42579 let value = this.values.get(key); 42580 if (value === void 0 && defaultValue !== void 0) { 42581 value = motionValue(defaultValue === null ? void 0 : defaultValue, { owner: this }); 42582 this.addValue(key, value); 42583 } 42584 return value; 42585 } 42586 /** 42587 * If we're trying to animate to a previously unencountered value, 42588 * we need to check for it in our state and as a last resort read it 42589 * directly from the instance (which might have performance implications). 42590 */ 42591 readValue(key, target) { 42592 var _a; 42593 let value = this.latestValues[key] !== void 0 || !this.current ? this.latestValues[key] : (_a = this.getBaseTargetFromProps(this.props, key)) !== null && _a !== void 0 ? _a : this.readValueFromInstance(this.current, key, this.options); 42594 if (value !== void 0 && value !== null) { 42595 if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { 42596 value = parseFloat(value); 42597 } else if (!findValueType(value) && complex.test(target)) { 42598 value = getAnimatableNone(key, target); 42599 } 42600 this.setBaseTarget(key, isMotionValue(value) ? value.get() : value); 42601 } 42602 return isMotionValue(value) ? value.get() : value; 42603 } 42604 /** 42605 * Set the base target to later animate back to. This is currently 42606 * only hydrated on creation and when we first read a value. 42607 */ 42608 setBaseTarget(key, value) { 42609 this.baseTarget[key] = value; 42610 } 42611 /** 42612 * Find the base target for a value thats been removed from all animation 42613 * props. 42614 */ 42615 getBaseTarget(key) { 42616 var _a; 42617 const { initial } = this.props; 42618 let valueFromInitial; 42619 if (typeof initial === "string" || typeof initial === "object") { 42620 const variant = resolveVariantFromProps(this.props, initial, (_a = this.presenceContext) === null || _a === void 0 ? void 0 : _a.custom); 42621 if (variant) { 42622 valueFromInitial = variant[key]; 42623 } 42624 } 42625 if (initial && valueFromInitial !== void 0) { 42626 return valueFromInitial; 42627 } 42628 const target = this.getBaseTargetFromProps(this.props, key); 42629 if (target !== void 0 && !isMotionValue(target)) 42630 return target; 42631 return this.initialValues[key] !== void 0 && valueFromInitial === void 0 ? void 0 : this.baseTarget[key]; 42632 } 42633 on(eventName, callback) { 42634 if (!this.events[eventName]) { 42635 this.events[eventName] = new SubscriptionManager(); 42636 } 42637 return this.events[eventName].add(callback); 42638 } 42639 notify(eventName, ...args) { 42640 if (this.events[eventName]) { 42641 this.events[eventName].notify(...args); 42642 } 42643 } 42644 } 42645 class DOMVisualElement extends VisualElement { 42646 constructor() { 42647 super(...arguments); 42648 this.KeyframeResolver = DOMKeyframesResolver; 42649 } 42650 sortInstanceNodePosition(a2, b2) { 42651 return a2.compareDocumentPosition(b2) & 2 ? 1 : -1; 42652 } 42653 getBaseTargetFromProps(props, key) { 42654 return props.style ? props.style[key] : void 0; 42655 } 42656 removeValueFromRenderState(key, { vars, style }) { 42657 delete vars[key]; 42658 delete style[key]; 42659 } 42660 handleChildMotionValue() { 42661 if (this.childSubscription) { 42662 this.childSubscription(); 42663 delete this.childSubscription; 42664 } 42665 const { children } = this.props; 42666 if (isMotionValue(children)) { 42667 this.childSubscription = children.on("change", (latest) => { 42668 if (this.current) { 42669 this.current.textContent = `${latest}`; 42670 } 42671 }); 42672 } 42673 } 42674 } 42675 function getComputedStyle$1(element) { 42676 return window.getComputedStyle(element); 42677 } 42678 class HTMLVisualElement extends DOMVisualElement { 42679 constructor() { 42680 super(...arguments); 42681 this.type = "html"; 42682 this.renderInstance = renderHTML; 42683 } 42684 readValueFromInstance(instance2, key) { 42685 if (transformProps.has(key)) { 42686 const defaultType = getDefaultValueType(key); 42687 return defaultType ? defaultType.default || 0 : 0; 42688 } else { 42689 const computedStyle = getComputedStyle$1(instance2); 42690 const value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0; 42691 return typeof value === "string" ? value.trim() : value; 42692 } 42693 } 42694 measureInstanceViewportBox(instance2, { transformPagePoint }) { 42695 return measureViewportBox(instance2, transformPagePoint); 42696 } 42697 build(renderState, latestValues, props) { 42698 buildHTMLStyles(renderState, latestValues, props.transformTemplate); 42699 } 42700 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 42701 return scrapeMotionValuesFromProps$1(props, prevProps, visualElement); 42702 } 42703 } 42704 class SVGVisualElement extends DOMVisualElement { 42705 constructor() { 42706 super(...arguments); 42707 this.type = "svg"; 42708 this.isSVGTag = false;
42709 this.measureInstanceViewportBox = createBox; 42710 } 42711 getBaseTargetFromProps(props, key) { 42712 return props[key]; 42713 } 42714 readValueFromInstance(instance2, key) { 42715 if (transformProps.has(key)) { 42716 const defaultType = getDefaultValueType(key); 42717 return defaultType ? defaultType.default || 0 : 0; 42718 } 42719 key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; 42720 return instance2.getAttribute(key); 42721 } 42722 scrapeMotionValuesFromProps(props, prevProps, visualElement) { 42723 return scrapeMotionValuesFromProps(props, prevProps, visualElement); 42724 } 42725 build(renderState, latestValues, props) { 42726 buildSVGAttrs(renderState, latestValues, this.isSVGTag, props.transformTemplate); 42727 } 42728 renderInstance(instance2, renderState, styleProp, projection) { 42729 renderSVG(instance2, renderState, styleProp, projection); 42730 } 42731 mount(instance2) { 42732 this.isSVGTag = isSVGTag(instance2.tagName); 42733 super.mount(instance2); 42734 } 42735 } 42736 const createDomVisualElement = (Component, options2) => { 42737 return isSVGComponent(Component) ? new SVGVisualElement(options2) : new HTMLVisualElement(options2, { 42738 allowProjection: Component !== reactExports.Fragment 42739 }); 42740 }; 42741 const createMotionComponent = /* @__PURE__ */ createMotionComponentFactory(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, animations), gestureAnimations), drag), layout), createDomVisualElement); 42742 const motion = /* @__PURE__ */ createDOMMotionComponentProxy(createMotionComponent); 42743 function useMotionValue(initial) { 42744 const value = useConstant(() => motionValue(initial)); 42745 const { isStatic } = reactExports.useContext(MotionConfigContext); 42746 if (isStatic) { 42747 const [, setLatest] = reactExports.useState(initial); 42748 reactExports.useEffect(() => value.on("change", setLatest), []); 42749 } 42750 return value; 42751 } 42752 function useCombineMotionValues(values, combineValues) { 42753 const value = useMotionValue(combineValues()); 42754 const updateValue = () => value.set(combineValues()); 42755 updateValue(); 42756 useIsomorphicLayoutEffect$2(() => { 42757 const scheduleUpdate = () => frame.preRender(updateValue, false, true); 42758 const subscriptions = values.map((v2) => v2.on("change", scheduleUpdate)); 42759 return () => { 42760 subscriptions.forEach((unsubscribe) => unsubscribe()); 42761 cancelFrame(updateValue); 42762 }; 42763 }); 42764 return value; 42765 } 42766 const isCustomValueType = (v2) => { 42767 return v2 && typeof v2 === "object" && v2.mix; 42768 }; 42769 const getMixer = (v2) => isCustomValueType(v2) ? v2.mix : void 0; 42770 function transform(...args) { 42771 const useImmediate = !Array.isArray(args[0]); 42772 const argOffset = useImmediate ? 0 : -1; 42773 const inputValue = args[0 + argOffset]; 42774 const inputRange = args[1 + argOffset]; 42775 const outputRange = args[2 + argOffset]; 42776 const options2 = args[3 + argOffset]; 42777 const interpolator = interpolate(inputRange, outputRange, __spreadValues({ 42778 mixer: getMixer(outputRange[0]) 42779 }, options2)); 42780 return useImmediate ? interpolator(inputValue) : interpolator; 42781 } 42782 function useComputed(compute) { 42783 collectMotionValues.current = []; 42784 compute(); 42785 const value = useCombineMotionValues(collectMotionValues.current, compute); 42786 collectMotionValues.current = void 0; 42787 return value; 42788 } 42789 function useTransform(input, inputRangeOrTransformer, outputRange, options2) { 42790 if (typeof input === "function") { 42791 return useComputed(input); 42792 } 42793 const transformer = typeof inputRangeOrTransformer === "function" ? inputRangeOrTransformer : transform(inputRangeOrTransformer, outputRange, options2); 42794 return Array.isArray(input) ? useListTransform(input, transformer) : useListTransform([input], ([latest]) => transformer(latest)); 42795 } 42796 function useListTransform(values, transformer) { 42797 const latest = useConstant(() => []); 42798 return useCombineMotionValues(values, () => { 42799 latest.length = 0; 42800 const numValues = values.length; 42801 for (let i2 = 0; i2 < numValues; i2++) { 42802 latest[i2] = values[i2].get(); 42803 } 42804 return transformer(latest); 42805 }); 42806 } 42807 class DragControls { 42808 constructor() { 42809 this.componentControls = /* @__PURE__ */ new Set(); 42810 } 42811 /** 42812 * Subscribe a component's internal `VisualElementDragControls` to the user-facing API. 42813 * 42814 * @internal 42815 */
42816 subscribe(controls) { 42817 this.componentControls.add(controls); 42818 return () => this.componentControls.delete(controls); 42819 } 42820 /** 42821 * Start a drag gesture on every `motion` component that has this set of drag controls 42822 * passed into it via the `dragControls` prop. 42823 * 42824 * ```jsx 42825 * dragControls.start(e, { 42826 * snapToCursor: true 42827 * }) 42828 * ``` 42829 * 42830 * @param event - PointerEvent 42831 * @param options - Options 42832 * 42833 * @public 42834 */ 42835 start(event, options2) { 42836 this.componentControls.forEach((controls) => { 42837 controls.start(event.nativeEvent || event, options2); 42838 }); 42839 } 42840 } 42841 const createDragControls = () => new DragControls(); 42842 function useDragControls() { 42843 return useConstant(createDragControls); 42844 } 42845 var __assign = function() { 42846 __assign = Object.assign || function __assign2(t2) { 42847 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 42848 s2 = arguments[i2]; 42849 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 42850 } 42851 return t2; 42852 }; 42853 return __assign.apply(this, arguments); 42854 }; 42855 function __rest(s2, e2) { 42856 var t2 = {}; 42857 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0) 42858 t2[p2] = s2[p2]; 42859 if (s2 != null && typeof Object.getOwnPropertySymbols === "function") 42860 for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) { 42861 if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2])) 42862 t2[p2[i2]] = s2[p2[i2]]; 42863 } 42864 return t2; 42865 } 42866 function __awaiter(thisArg, _arguments, P2, generator) { 42867 function adopt(value) { 42868 return value instanceof P2 ? value : new P2(function(resolve) { 42869 resolve(value); 42870 }); 42871 } 42872 return new (P2 || (P2 = Promise))(function(resolve, reject) { 42873 function fulfilled(value) { 42874 try { 42875 step(generator.next(value)); 42876 } catch (e2) { 42877 reject(e2); 42878 } 42879 } 42880 function rejected(value) { 42881 try { 42882 step(generator["throw"](value)); 42883 } catch (e2) { 42884 reject(e2); 42885 } 42886 } 42887 function step(result) { 42888 result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); 42889 } 42890 step((generator = generator.apply(thisArg, _arguments || [])).next()); 42891 }); 42892 } 42893 function __spreadArray(to2, from2, pack) { 42894 if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) { 42895 if (ar2 || !(i2 in from2)) { 42896 if (!ar2) ar2 = Array.prototype.slice.call(from2, 0, i2); 42897 ar2[i2] = from2[i2]; 42898 } 42899 } 42900 return to2.concat(ar2 || Array.prototype.slice.call(from2)); 42901 } 42902 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 42903 var e2 = new Error(message); 42904 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 42905 }; 42906 var zeroRightClassName = "right-scroll-bar-position"; 42907 var fullWidthClassName = "width-before-scroll-bar"; 42908 var noScrollbarsClassName = "with-scroll-bars-hidden"; 42909 var removedBarSizeVariable = "--removed-body-scroll-bar-size"; 42910 function assignRef(ref, value) { 42911 if (typeof ref === "function") { 42912 ref(value); 42913 } else if (ref) { 42914 ref.current = value; 42915 } 42916 return ref; 42917 } 42918 function useCallbackRef(initialValue2, callback) { 42919 var ref = reactExports.useState(function() { 42920 return { 42921 // value 42922 value: initialValue2, 42923 // last callback 42924 callback, 42925 // "memoized" public interface 42926 facade: { 42927 get current() { 42928 return ref.value; 42929 }, 42930 set current(value) { 42931 var last = ref.value; 42932 if (last !== value) { 42933 ref.value = value; 42934 ref.callback(value, last); 42935 } 42936 } 42937 } 42938 }; 42939 })[0]; 42940 ref.callback = callback; 42941 return ref.facade; 42942 } 42943 var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect; 42944 var currentValues = /* @__PURE__ */ new WeakMap(); 42945 function useMergeRefs(refs, defaultValue) { 42946 var callbackRef = useCallbackRef(null, function(newValue) {
vendor: 4,984 bytes, lines 42947-43090
42947 return refs.forEach(function(ref) { 42948 return assignRef(ref, newValue); 42949 }); 42950 }); 42951 useIsomorphicLayoutEffect$1(function() { 42952 var oldValue = currentValues.get(callbackRef); 42953 if (oldValue) { 42954 var prevRefs_1 = new Set(oldValue); 42955 var nextRefs_1 = new Set(refs); 42956 var current_1 = callbackRef.current; 42957 prevRefs_1.forEach(function(ref) { 42958 if (!nextRefs_1.has(ref)) { 42959 assignRef(ref, null); 42960 } 42961 }); 42962 nextRefs_1.forEach(function(ref) { 42963 if (!prevRefs_1.has(ref)) { 42964 assignRef(ref, current_1); 42965 } 42966 }); 42967 } 42968 currentValues.set(callbackRef, refs); 42969 }, [refs]); 42970 return callbackRef; 42971 } 42972 function ItoI(a2) { 42973 return a2; 42974 } 42975 function innerCreateMedium(defaults2, middleware2) { 42976 if (middleware2 === void 0) { 42977 middleware2 = ItoI; 42978 } 42979 var buffer = []; 42980 var assigned = false; 42981 var medium = { 42982 read: function() { 42983 if (assigned) { 42984 throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); 42985 } 42986 if (buffer.length) { 42987 return buffer[buffer.length - 1]; 42988 } 42989 return defaults2; 42990 }, 42991 useMedium: function(data) { 42992 var item = middleware2(data, assigned); 42993 buffer.push(item); 42994 return function() { 42995 buffer = buffer.filter(function(x2) { 42996 return x2 !== item; 42997 }); 42998 }; 42999 }, 43000 assignSyncMedium: function(cb) { 43001 assigned = true; 43002 while (buffer.length) { 43003 var cbs = buffer; 43004 buffer = []; 43005 cbs.forEach(cb); 43006 } 43007 buffer = { 43008 push: function(x2) { 43009 return cb(x2); 43010 }, 43011 filter: function() { 43012 return buffer; 43013 } 43014 }; 43015 }, 43016 assignMedium: function(cb) { 43017 assigned = true; 43018 var pendingQueue = []; 43019 if (buffer.length) { 43020 var cbs = buffer; 43021 buffer = []; 43022 cbs.forEach(cb); 43023 pendingQueue = buffer; 43024 } 43025 var executeQueue = function() { 43026 var cbs2 = pendingQueue; 43027 pendingQueue = []; 43028 cbs2.forEach(cb); 43029 }; 43030 var cycle = function() { 43031 return Promise.resolve().then(executeQueue); 43032 }; 43033 cycle(); 43034 buffer = { 43035 push: function(x2) { 43036 pendingQueue.push(x2); 43037 cycle(); 43038 }, 43039 filter: function(filter2) { 43040 pendingQueue = pendingQueue.filter(filter2); 43041 return buffer; 43042 } 43043 }; 43044 } 43045 }; 43046 return medium; 43047 } 43048 function createSidecarMedium(options2) { 43049 if (options2 === void 0) { 43050 options2 = {}; 43051 } 43052 var medium = innerCreateMedium(null); 43053 medium.options = __assign({ async: true, ssr: false }, options2); 43054 return medium; 43055 } 43056 var SideCar$1 = function(_a) { 43057 var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); 43058 if (!sideCar) { 43059 throw new Error("Sidecar: please provide `sideCar` property to import the right car"); 43060 } 43061 var Target = sideCar.read(); 43062 if (!Target) { 43063 throw new Error("Sidecar medium not found"); 43064 } 43065 return reactExports.createElement(Target, __assign({}, rest)); 43066 }; 43067 SideCar$1.isSideCarExport = true; 43068 function exportSidecar(medium, exported) { 43069 medium.useMedium(exported); 43070 return SideCar$1; 43071 } 43072 var effectCar = createSidecarMedium(); 43073 var nothing = function() { 43074 return; 43075 }; 43076 var RemoveScroll = reactExports.forwardRef(function(props, parentRef) { 43077 var ref = reactExports.useRef(null); 43078 var _a = reactExports.useState({ 43079 onScrollCapture: nothing, 43080 onWheelCapture: nothing, 43081 onTouchMoveCapture: nothing 43082 }), callbacks = _a[0], setCallbacks = _a[1]; 43083 var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); 43084 var SideCar2 = sideCar; 43085 var containerRef = useMergeRefs([ref, parentRef]); 43086 var containerProps = __assign(__assign({}, rest), callbacks); 43087 return reactExports.createElement( 43088 reactExports.Fragment, 43089 null, 43090 enabled && reactExports.createElement(SideCar2, { sideCar: effectC
43090ar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }), 43091 forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container2, __assign({}, containerProps, { className, ref: containerRef }), children) 43092 ); 43093 }); 43094 RemoveScroll.defaultProps = { 43095 enabled: true, 43096 removeScrollBar: true, 43097 inert: false 43098 }; 43099 RemoveScroll.classNames = { 43100 fullWidth: fullWidthClassName, 43101 zeroRight: zeroRightClassName 43102 }; 43103 var getNonce = function() { 43104 if (typeof __webpack_nonce__ !== "undefined") { 43105 return __webpack_nonce__; 43106 } 43107 return void 0; 43108 }; 43109 function makeStyleTag() { 43110 if (!document) 43111 return null; 43112 var tag = document.createElement("style"); 43113 tag.type = "text/css"; 43114 var nonce = getNonce(); 43115 if (nonce) { 43116 tag.setAttribute("nonce", nonce); 43117 } 43118 return tag; 43119 } 43120 function injectStyles(tag, css) { 43121 if (tag.styleSheet) { 43122 tag.styleSheet.cssText = css; 43123 } else { 43124 tag.appendChild(document.createTextNode(css)); 43125 } 43126 } 43127 function insertStyleTag(tag) { 43128 var head = document.head || document.getElementsByTagName("head")[0]; 43129 head.appendChild(tag); 43130 } 43131 var stylesheetSingleton = function() { 43132 var counter = 0; 43133 var stylesheet = null; 43134 return { 43135 add: function(style) { 43136 if (counter == 0) { 43137 if (stylesheet = makeStyleTag()) { 43138 injectStyles(stylesheet, style); 43139 insertStyleTag(stylesheet); 43140 } 43141 } 43142 counter++; 43143 }, 43144 remove: function() { 43145 counter--; 43146 if (!counter && stylesheet) { 43147 stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); 43148 stylesheet = null; 43149 } 43150 } 43151 }; 43152 }; 43153 var styleHookSingleton = function() { 43154 var sheet = stylesheetSingleton(); 43155 return function(styles, isDynamic) { 43156 reactExports.useEffect(function() { 43157 sheet.add(styles); 43158 return function() { 43159 sheet.remove(); 43160 }; 43161 }, [styles && isDynamic]); 43162 }; 43163 }; 43164 var styleSingleton = function() { 43165 var useStyle2 = styleHookSingleton(); 43166 var Sheet = function(_a) { 43167 var styles = _a.styles, dynamic = _a.dynamic; 43168 useStyle2(styles, dynamic); 43169 return null; 43170 }; 43171 return Sheet; 43172 }; 43173 var zeroGap = { 43174 left: 0, 43175 top: 0, 43176 right: 0, 43177 gap: 0 43178 }; 43179 var parse$1 = function(x2) { 43180 return parseInt(x2 || "", 10) || 0; 43181 }; 43182 var getOffset = function(gapMode) { 43183 var cs = window.getComputedStyle(document.body); 43184 var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"]; 43185 var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"]; 43186 var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"]; 43187 return [parse$1(left), parse$1(top), parse$1(right)]; 43188 }; 43189 var getGapWidth = function(gapMode) { 43190 if (gapMode === void 0) { 43191 gapMode = "margin"; 43192 } 43193 if (typeof window === "undefined") { 43194 return zeroGap; 43195 } 43196 var offsets = getOffset(gapMode); 43197 var documentWidth = document.documentElement.clientWidth; 43198 var windowWidth = window.innerWidth; 43199 return { 43200 left: offsets[0], 43201 top: offsets[1], 43202 right: offsets[2], 43203 gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]) 43204 }; 43205 }; 43206 var Style = styleSingleton(); 43207 var lockAttribute = "data-scroll-locked"; 43208 var getStyles = function(_a, allowRelative, gapMode, important) { 43209 var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; 43210 if (gapMode === void 0) { 43211 gapMode = "margin"; 43212 } 43213 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([ 43214 allowRelative && "position: relative ".concat(important, ";"), 43215 gapMode === "margin" && "\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 "), 43216 gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
vendor: 9,214 bytes, lines 43217-43426
43217 ].filter(Boolean).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"); 43218 }; 43219 var getCurrentUseCounter = function() { 43220 var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10); 43221 return isFinite(counter) ? counter : 0; 43222 }; 43223 var useLockAttribute = function() { 43224 reactExports.useEffect(function() { 43225 document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()); 43226 return function() { 43227 var newCounter = getCurrentUseCounter() - 1; 43228 if (newCounter <= 0) { 43229 document.body.removeAttribute(lockAttribute); 43230 } else { 43231 document.body.setAttribute(lockAttribute, newCounter.toString()); 43232 } 43233 }; 43234 }, []); 43235 }; 43236 var RemoveScrollBar = function(_a) { 43237 var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b; 43238 useLockAttribute(); 43239 var gap = reactExports.useMemo(function() { 43240 return getGapWidth(gapMode); 43241 }, [gapMode]); 43242 return reactExports.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") }); 43243 }; 43244 var passiveSupported = false; 43245 if (typeof window !== "undefined") { 43246 try { 43247 var options = Object.defineProperty({}, "passive", { 43248 get: function() { 43249 passiveSupported = true; 43250 return true; 43251 } 43252 }); 43253 window.addEventListener("test", options, options); 43254 window.removeEventListener("test", options, options); 43255 } catch (err) { 43256 passiveSupported = false; 43257 } 43258 } 43259 var nonPassive = passiveSupported ? { passive: false } : false; 43260 var alwaysContainsScroll = function(node2) { 43261 return node2.tagName === "TEXTAREA"; 43262 }; 43263 var elementCanBeScrolled = function(node2, overflow) { 43264 if (!(node2 instanceof Element)) { 43265 return false; 43266 } 43267 var styles = window.getComputedStyle(node2); 43268 return ( 43269 // not-not-scrollable 43270 styles[overflow] !== "hidden" && // contains scroll inside self 43271 !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node2) && styles[overflow] === "visible") 43272 ); 43273 }; 43274 var elementCouldBeVScrolled = function(node2) { 43275 return elementCanBeScrolled(node2, "overflowY"); 43276 }; 43277 var elementCouldBeHScrolled = function(node2) { 43278 return elementCanBeScrolled(node2, "overflowX"); 43279 }; 43280 var locationCouldBeScrolled = function(axis, node2) { 43281 var ownerDocument = node2.ownerDocument; 43282 var current = node2; 43283 do { 43284 if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) { 43285 current = current.host; 43286 } 43287 var isScrollable = elementCouldBeScrolled(axis, current); 43288 if (isScrollable) { 43289 var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2]; 43290 if (scrollHeight > clientHeight) { 43291 return true; 43292 } 43293 } 43294 current = current.parentNode; 43295 } while (current && current !== ownerDocument.body); 43296 return false; 43297 }; 43298 var getVScrollVariables = function(_a) { 43299 var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; 43300 return [ 43301 scrollTop, 43302 scrollHeight, 43303 clientHeight 43304 ]; 43305 }; 43306 var getHScrollVariables = function(_a) { 43307 var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; 43308 return [ 43309 scrollLeft, 43310 scrollWidth, 43311 clientWidth 43312 ]; 43313 }; 43314 var elementCouldBeScrolled = function(axis, node2) { 43315 return axis === "v" ? elementCouldBeVScrolled(node2) : elementCouldBeHScrolled(node2); 43316 }; 43317 var getScrollVariables = function(axis, node2) { 43318 return axis === "v" ? getVScrollVariables(node2) : getHScrollVariables(node2); 43319 }; 43320 var getDirectionFactor = function(axis, direction) { 43321 return axis === "h" && direction === "rtl" ? -1 : 1; 43322 }; 43323 var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) { 43324 var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); 43325 var delta = directionFactor * sourceDelta; 43326 var target = event.target; 43327 var targetInLock = endTarget.contains(target); 43328 var shouldCancelScroll = false; 43329 var isDeltaPositive = delta > 0; 43330 var availableScroll = 0; 43331 var availableScrollTop = 0; 43332 do { 43333 var _a = getScrollVariables(axis, target), position2 = _a[0], scroll_1 = _a[1], capacity = _a[2]; 43334 var elementScroll = scroll_1 - capacity - directionFactor * position2; 43335 if (position2 || elementScroll) { 43336 if (elementCouldBeScrolled(axis, target)) { 43337 availableScroll += elementScroll; 43338 availableScrollTop += position2; 43339 } 43340 } 43341 if (target instanceof ShadowRoot) { 43342 target = target.host; 43343 } else { 43344 target = target.parentNode; 43345 } 43346 } while ( 43347 // portaled content 43348 !targetInLock && target !== document.body || // self content 43349 targetInLock && (endTarget.contains(target) || endTarget === target) 43350 ); 43351 if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) { 43352 shouldCancelScroll = true; 43353 } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) { 43354 shouldCancelScroll = true; 43355 } 43356 return shouldCancelScroll; 43357 }; 43358 var getTouchXY = function(event) { 43359 return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; 43360 }; 43361 var getDeltaXY = function(event) { 43362 return [event.deltaX, event.deltaY]; 43363 }; 43364 var extractRef = function(ref) { 43365 return ref && "current" in ref ? ref.current : ref; 43366 }; 43367 var deltaCompare = function(x2, y2) { 43368 return x2[0] === y2[0] && x2[1] === y2[1]; 43369 }; 43370 var generateStyle = function(id2) { 43371 return "\n .block-interactivity-".concat(id2, " {pointer-events: none;}\n .allow-interactivity-").concat(id2, " {pointer-events: all;}\n"); 43372 }; 43373 var idCounter = 0; 43374 var lockStack = []; 43375 function RemoveScrollSideCar(props) { 43376 var shouldPreventQueue = reactExports.useRef([]); 43377 var touchStartRef = reactExports.useRef([0, 0]); 43378 var activeAxis = reactExports.useRef(); 43379 var id2 = reactExports.useState(idCounter++)[0]; 43380 var Style2 = reactExports.useState(styleSingleton)[0]; 43381 var lastProps = reactExports.useRef(props); 43382 reactExports.useEffect(function() { 43383 lastProps.current = props; 43384 }, [props]); 43385 reactExports.useEffect(function() { 43386 if (props.inert) { 43387 document.body.classList.add("block-interactivity-".concat(id2)); 43388 var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean); 43389 allow_1.forEach(function(el) { 43390 return el.classList.add("allow-interactivity-".concat(id2)); 43391 }); 43392 return function() { 43393 document.body.classList.remove("block-interactivity-".concat(id2)); 43394 allow_1.forEach(function(el) { 43395 return el.classList.remove("allow-interactivity-".concat(id2)); 43396 }); 43397 }; 43398 } 43399 return; 43400 }, [props.inert, props.lockRef.current, props.shards]); 43401 var shouldCancelEvent = reactExports.useCallback(function(event, parent) { 43402 if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) { 43403 return !lastProps.current.allowPinchZoom; 43404 } 43405 var touch = getTouchXY(event); 43406 var touchStart = touchStartRef.current; 43407 var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0]; 43408 var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1]; 43409 var currentAxis; 43410 var target = event.target; 43411 var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v"; 43412 if ("touches" in event && moveDirection === "h" && target.type === "range") { 43413 return false; 43414 } 43415 var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 43416 if (!canBeScrolledInMainDirection) { 43417 return true; 43418 } 43419 if (canBeScrolledInMainDirection) { 43420 currentAxis = moveDirection; 43421 } else { 43422 currentAxis = moveDirection === "v" ? "h" : "v"; 43423 canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); 43424 } 43425 if (!canBeScrolledInMainDirection) { 43426 return false;
43427 } 43428 if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) { 43429 activeAxis.current = currentAxis; 43430 } 43431 if (!currentAxis) { 43432 return true; 43433 } 43434 var cancelingAxis = activeAxis.current || currentAxis; 43435 return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY); 43436 }, []); 43437 var shouldPrevent = reactExports.useCallback(function(_event) { 43438 var event = _event; 43439 if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) { 43440 return; 43441 } 43442 var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event); 43443 var sourceEvent = shouldPreventQueue.current.filter(function(e2) { 43444 return e2.name === event.type && (e2.target === event.target || event.target === e2.shadowParent) && deltaCompare(e2.delta, delta); 43445 })[0]; 43446 if (sourceEvent && sourceEvent.should) { 43447 if (event.cancelable) { 43448 event.preventDefault(); 43449 } 43450 return; 43451 } 43452 if (!sourceEvent) { 43453 var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node2) { 43454 return node2.contains(event.target); 43455 }); 43456 var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; 43457 if (shouldStop) { 43458 if (event.cancelable) { 43459 event.preventDefault(); 43460 } 43461 } 43462 } 43463 }, []); 43464 var shouldCancel = reactExports.useCallback(function(name, delta, target, should) { 43465 var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) }; 43466 shouldPreventQueue.current.push(event); 43467 setTimeout(function() { 43468 shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e2) { 43469 return e2 !== event; 43470 }); 43471 }, 1); 43472 }, []); 43473 var scrollTouchStart = reactExports.useCallback(function(event) { 43474 touchStartRef.current = getTouchXY(event); 43475 activeAxis.current = void 0; 43476 }, []); 43477 var scrollWheel = reactExports.useCallback(function(event) { 43478 shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 43479 }, []); 43480 var scrollTouchMove = reactExports.useCallback(function(event) { 43481 shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); 43482 }, []); 43483 reactExports.useEffect(function() { 43484 lockStack.push(Style2); 43485 props.setCallbacks({ 43486 onScrollCapture: scrollWheel, 43487 onWheelCapture: scrollWheel, 43488 onTouchMoveCapture: scrollTouchMove 43489 }); 43490 document.addEventListener("wheel", shouldPrevent, nonPassive); 43491 document.addEventListener("touchmove", shouldPrevent, nonPassive); 43492 document.addEventListener("touchstart", scrollTouchStart, nonPassive); 43493 return function() { 43494 lockStack = lockStack.filter(function(inst) { 43495 return inst !== Style2; 43496 }); 43497 document.removeEventListener("wheel", shouldPrevent, nonPassive); 43498 document.removeEventListener("touchmove", shouldPrevent, nonPassive); 43499 document.removeEventListener("touchstart", scrollTouchStart, nonPassive); 43500 }; 43501 }, []); 43502 var removeScrollBar = props.removeScrollBar, inert = props.inert; 43503 return reactExports.createElement( 43504 reactExports.Fragment, 43505 null, 43506 inert ? reactExports.createElement(Style2, { styles: generateStyle(id2) }) : null, 43507 removeScrollBar ? reactExports.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null 43508 ); 43509 } 43510 function getOutermostShadowParent(node2) { 43511 var shadowParent = null; 43512 while (node2 !== null) { 43513 if (node2 instanceof ShadowRoot) { 43514 shadowParent = node2.host; 43515 node2 = node2.host; 43516 } 43517 node2 = node2.parentNode; 43518 } 43519 return shadowParent; 43520 } 43521 const SideCar = exportSidecar(effectCar, RemoveScrollSideCar); 43522 var ReactRemoveScroll = reactExports.forwardRef(function(props, ref) { 43523 return reactExports.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar })); 43524 }); 43525 ReactRemoveScroll.classNames = RemoveScroll.classNames; 43526 const escapeStack = []; 43527 const handleKeyDown = (event) => { 43528 var _a; 43529 if (event.key !== "Escape") return; 43530 (_a = escapeStack[escapeStack.length - 1]) == null ? void 0 : _a.call(escapeStack); 43531 }; 43532 const attach = () => { 43533 if (escapeStack.length === 1) document.addEventListener("keydown", handleKeyDown); 43534 }; 43535 const detach = () => { 43536 if (escapeStack.length === 0) document.removeEventListener("keydown", handleKeyDown); 43537 }; 43538 const useEscapeKey = (isActive, onEscape) => { 43539 const onEscapeRef = reactExports.useRef(onEscape); 43540 reactExports.useEffect(() => { 43541 onEscapeRef.current = onEscape; 43542 }); 43543 reactExports.useEffect(() => { 43544 if (!isActive) return void 0; 43545 const handler = () => onEscapeRef.current(); 43546 escapeStack.push(handler); 43547 attach(); 43548 return () => { 43549 const index2 = escapeStack.indexOf(handler); 43550 if (index2 !== -1) escapeStack.splice(index2, 1); 43551 detach(); 43552 }; 43553 }, [isActive]); 43554 }; 43555 const ZOOM_TOLERANCE = 0.01; 43556 const useIsomorphicLayoutEffect = typeof document === "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect; 43557 const useOverlayViewport = (isOpen) => { 43558 const ref = reactExports.useRef(null); 43559 useIsomorphicLayoutEffect(() => { 43560 const element = ref.current;
43561 const viewport = window.visualViewport; 43562 if (!isOpen || !element || !viewport) return void 0; 43563 let frameId = 0; 43564 let written = ""; 43565 const write = () => { 43566 if (viewport.scale > 1 + ZOOM_TOLERANCE) { 43567 if (!written) return; 43568 written = ""; 43569 element.style.removeProperty("--overlay-viewport-top"); 43570 element.style.removeProperty("--overlay-viewport-height"); 43571 element.style.removeProperty("--overlay-keyboard-inset-bottom"); 43572 return; 43573 } 43574 const height = Math.min(viewport.height, window.innerHeight); 43575 const top = Math.max(0, viewport.offsetTop); 43576 const keyboard = Math.max(0, window.innerHeight - top - height); 43577 const next2 = `${top}/${height}/${keyboard}`; 43578 if (next2 === written) return; 43579 written = next2; 43580 element.style.setProperty("--overlay-viewport-top", `${top}px`); 43581 element.style.setProperty("--overlay-viewport-height", `${height}px`); 43582 element.style.setProperty("--overlay-keyboard-inset-bottom", `${keyboard}px`); 43583 }; 43584 write(); 43585 const schedule = () => { 43586 cancelAnimationFrame(frameId); 43587 frameId = requestAnimationFrame(write); 43588 }; 43589 viewport.addEventListener("resize", schedule); 43590 viewport.addEventListener("scroll", schedule); 43591 return () => { 43592 cancelAnimationFrame(frameId); 43593 viewport.removeEventListener("resize", schedule); 43594 viewport.removeEventListener("scroll", schedule); 43595 }; 43596 }, [isOpen]); 43597 return ref; 43598 }; 43599 const OverlayContext = reactExports.createContext(void 0); 43600 const useOverlayRegistry = () => reactExports.useContext(OverlayContext); 43601 const useOverlayVisibility = () => { 43602 const registry = useOverlayRegistry(); 43603 const removeRef = reactExports.useRef(void 0); 43604 const set2 = reactExports.useCallback( 43605 (visible) => { 43606 var _a; 43607 if (visible === !!removeRef.current) return; 43608 if (visible) { 43609 removeRef.current = registry == null ? void 0 : registry.add(); 43610 } else { 43611 (_a = removeRef.current) == null ? void 0 : _a.call(removeRef); 43612 removeRef.current = void 0; 43613 } 43614 }, 43615 [registry] 43616 ); 43617 return { set: set2 }; 43618 }; 43619 const Backdrop$1 = dt$2(motion.div)` 43620 position: absolute; 43621 inset: 0; 43622 background: var(--color-black-alpha-1500); 43623`; 43624 const Backdrop = ({ onClick, opacity, animated = true }) => /* @__PURE__ */ jsxRuntimeExports.jsx( 43625 Backdrop$1, 43626 { 43627 style: opacity ? { opacity } : void 0, 43628 initial: opacity || !animated ? false : { opacity: 0 }, 43629 animate: opacity ? void 0 : { opacity: BACKDROP_OPACITY }, 43630 exit: opacity ? void 0 : { opacity: 0 }, 43631 transition: animated ? SPRING : { duration: 0 }, 43632 onClick: (event) => { 43633 event.stopPropagation(); 43634 onClick == null ? void 0 : onClick(); 43635 } 43636 } 43637 ); 43638 const Root$1 = dt$2.div` 43639 /* Sized to the band the browser shows rather than the layout viewport, so the on-screen 43640 keyboard can't cover the overlay's trailing edge â see docs/frontend-principles/overlays.md 43641 â The On-Screen Keyboard. Without useOverlayViewport's properties this is inset: 0. */ 43642 position: fixed; 43643 top: var(--overlay-viewport-top, 0px); 43644 left: 0; 43645 right: 0; 43646 height: var(--overlay-viewport-height, 100%); 43647 z-index: ${OVERLAY_Z_INDEX}; 43648 43649 /* Read by panels and their content through OVERLAY_BOTTOM_INSET (styles/insets.ts). */ 43650 --overlay-inset-bottom: max( 43651 0px, 43652 calc(var(--safe-area-inset-bottom, 0px) - var(--overlay-keyboard-inset-bottom, 0px)) 43653 ); 43654 43655 display: flex; 43656 43657 ${({ $align }) => $align === "bottom" && lt$2` 43658 flex-direction: column; 43659 justify-content: flex-end; 43660 `} 43661`; 43662 const OverlayShell = ({ 43663 isOpen, 43664 children, 43665 align = "fill", 43666 backdrop = true, 43667 backdropOpacity, 43668 testId, 43669 onClose, 43670 onExited 43671 }) => { 43672 const { set: setOverlayVisible } = useOverlayVisibility(); 43673 const viewportRef = useOverlayViewport(isOpen); 43674 reactExports.useEffect(() => { 43675 setOverlayVisible(isOpen); 43676 return () => setOverlayVisible(false); 43677 }, [isOpen, setOverlayVisible]); 43678 useEscapeKey(isOpen && !!onClose, () => onClose == null ? void 0 : onClose()); 43679 if (typeof document === "undefined") return null; 43680 return reactDomExports.createPortal(
43681 /* @__PURE__ */ jsxRuntimeExports.jsx(AnimatePresence, { onExitComplete: onExited, children: isOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Root$1, { ref: viewportRef, "data-testid": testId, $align: align, children: [ 43682 backdrop && /* @__PURE__ */ jsxRuntimeExports.jsx(Backdrop, { opacity: backdropOpacity, onClick: onClose }), 43683 children 43684 ] }) }) }), 43685 document.body 43686 ); 43687 }; 43688 const Grabber = dt$2.div` 43689 position: relative; 43690 flex-shrink: 0; 43691 touch-action: none; 43692 cursor: grab; 43693 43694 &:active { 43695 cursor: grabbing; 43696 } 43697`; 43698 const Handle = dt$2.div` 43699 position: absolute; 43700 top: 5px; 43701 left: 50%; 43702 transform: translateX(-50%); 43703 width: 54px; 43704 height: 2px; 43705 border-radius: var(--radius-full); 43706 background: var(--bg-transparent-strongest); 43707`; 43708 const Header$1 = dt$2.header` 43709 height: 70px; 43710 display: grid; 43711 grid-template-columns: 1fr minmax(0, auto) 1fr; 43712 column-gap: var(--space-400); 43713 align-items: center; 43714 padding: 0 var(--space-400); 43715`; 43716 const HeaderSide = dt$2.div` 43717 display: flex; 43718 min-width: var(--space-800); 43719 43720 &:last-child { 43721 grid-column: 3; 43722 justify-content: flex-end; 43723 } 43724`; 43725 const Title$2 = dt$2.div` 43726 font-family: var(--font-family-heading); 43727 font-size: var(--font-size-400); 43728 font-weight: var(--font-weight-500); 43729 line-height: var(--font-line-height-300); 43730 letter-spacing: var(--font-letter-spacing-dense); 43731 overflow: hidden; 43732 white-space: nowrap; 43733 text-overflow: ellipsis; 43734 text-align: center; 43735`; 43736 const BottomSheetHeader = ({ 43737 title, 43738 onBack, 43739 leftAction, 43740 rightAction, 43741 showHandle, 43742 onClose, 43743 onGrabberPointerDown 43744 }) => { 43745 const renderLeftAction = () => { 43746 if (leftAction) return leftAction; 43747 if (onBack) { 43748 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43749 IconButton, 43750 { 43751 icon: X4, 43752 size: "small", 43753 variant: "transparent", 43754 "aria-label": "Back", 43755 onClick: onBack 43756 } 43757 ); 43758 } 43759 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43760 IconButton, 43761 { 43762 icon: $4, 43763 size: "small", 43764 variant: "transparent", 43765 "aria-label": "Close", 43766 onClick: onClose 43767 } 43768 ); 43769 }; 43770 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Grabber, { onPointerDown: onGrabberPointerDown, children: [ 43771 showHandle && /* @__PURE__ */ jsxRuntimeExports.jsx(Handle, {}),
43772 /* @__PURE__ */ jsxRuntimeExports.jsxs(Header$1, { children: [ 43773 /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderSide, { children: renderLeftAction() }), 43774 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$2, { children: title }), 43775 /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderSide, { children: rightAction }) 43776 ] }) 43777 ] }); 43778 }; 43779 const CLOSE_THRESHOLD = 0.5; 43780 const FLING_VELOCITY = 600; 43781 const FLING_MIN_DISTANCE = 40; 43782 const useBottomSheetDrag = (onClose) => { 43783 const panelRef = reactExports.useRef(null); 43784 const dragControls = useDragControls(); 43785 const y2 = useMotionValue("100%"); 43786 const backdropOpacity = useTransform(y2, (value) => { 43787 var _a; 43788 const progress2 = typeof value === "string" ? 1 - parseFloat(value) / 100 : 1 - value / (((_a = panelRef.current) == null ? void 0 : _a.offsetHeight) || window.innerHeight); 43789 return Math.min(Math.max(progress2, 0), 1) * BACKDROP_OPACITY; 43790 }); 43791 const handleDragEnd = (_2, info) => { 43792 var _a, _b; 43793 const height = (_b = (_a = panelRef.current) == null ? void 0 : _a.offsetHeight) != null ? _b : 0; 43794 const flings = info.offset.y > FLING_MIN_DISTANCE && info.velocity.y > FLING_VELOCITY; 43795 const passedHalf = height > 0 && info.offset.y > height * CLOSE_THRESHOLD; 43796 if (flings || passedHalf) onClose(); 43797 }; 43798 return { panelRef, dragControls, y: y2, backdropOpacity, handleDragEnd }; 43799 }; 43800 const BOTTOM_OFFSET = overlayBottomOffset("var(--space-400)"); 43801 const Panel = dt$2(motion.div)` 43802 position: relative; 43803 display: flex; 43804 flex-direction: column; 43805 max-height: calc(100% - 96px); 43806 43807 ${({ $fill }) => $fill && lt$2` 43808 height: calc(100% - 96px); 43809 `} 43810 43811 background: var(--bg-primary); 43812 border-radius: var(--panel-radius-large) var(--panel-radius-large) 0 0; 43813 color: var(--text-primary); 43814 43815 /* covers the gap under the panel when the enter spring overshoots */ 43816 &::after { 43817 display: block; 43818 content: ''; 43819 position: absolute; 43820 top: 100%; 43821 height: 50px; 43822 width: 100%; 43823 background: var(--bg-primary); 43824 } 43825`; 43826 const Content$3 = dt$2.div` 43827 flex: 1; 43828 min-height: 0; 43829 43830 ${({ $scrollable }) => $scrollable ? lt$2` 43831 overflow-y: auto; 43832 overscroll-behavior: contain; 43833 scroll-padding-bottom: ${BOTTOM_OFFSET}; 43834 ` : lt$2` 43835 display: flex; 43836 flex-direction: column; 43837 overflow: hidden; 43838 `} 43839 43840 ${({ $hasFooter }) => !$hasFooter && lt$2` 43841 padding-bottom: ${BOTTOM_OFFSET}; 43842 `} 43843`; 43844 const Footer$2 = dt$2.div` 43845 flex-shrink: 0; 43846 padding: var(--space-400) var(--space-400) ${BOTTOM_OFFSET}; 43847`; 43848 const BottomSheet = ({ 43849 isOpen, 43850 title, 43851 onBack, 43852 leftAction, 43853 rightAction, 43854 children, 43855 footer, 43856 scrollable = true, 43857 showHandle = false, 43858 onClose, 43859 onExited 43860 }) => { 43861 const { panelRef, dragControls, y: y2, backdropOpacity, handleDragEnd } = useBottomSheetDrag(onClose); 43862 return /* @__PURE__ */ jsxRuntimeExports.jsx( 43863 OverlayShell, 43864 { 43865 isOpen, 43866 align: "bottom", 43867 backdropOpacity, 43868 testId: "BottomSheet", 43869 onClose, 43870 onExited, 43871 children: /* @__PURE__ */ jsxRuntimeExports.jsxs( 43872 Panel, 43873 { 43874 ref: panelRef, 43875 role: "dialog", 43876 "aria-modal": "true", 43877 "data-testid": "BottomSheet.Panel", 43878 $fill: !scrollable, 43879 style: { y: y2 }, 43880 initial: { y: "100%" }, 43881 animate: { y: 0 }, 43882 exit: { y: "100%" }, 43883 transition: SPRING, 43884 drag: "y", 43885 dragListener: false, 43886 dragControls, 43887 dragConstraints: { top: 0, bottom: 0 }, 43888 dragElastic: { top: 0, bottom: 1 }, 43889 onDragEnd: handleDragEnd, 43890 children: [
43891 /* @__PURE__ */ jsxRuntimeExports.jsx( 43892 BottomSheetHeader, 43893 { 43894 title, 43895 onBack, 43896 leftAction, 43897 rightAction, 43898 showHandle, 43899 onClose, 43900 onGrabberPointerDown: (event) => dragControls.start(event) 43901 } 43902 ), 43903 /* @__PURE__ */ jsxRuntimeExports.jsx(Content$3, { $scrollable: scrollable, $hasFooter: !!footer, children }), 43904 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer$2, { children: footer }) 43905 ] 43906 } 43907 ) 43908 } 43909 ); 43910 }; 43911 const Container$o = dt$2.h1` 43912 color: var(--text-primary); 43913 font-family: var(--font-family-heading); 43914 font-style: var(--font-style-heading); 43915 text-transform: var(--text-transform-heading); 43916 43917 ${({ $type }) => $type === "h1" && lt$2` 43918 font-weight: var(--font-weight-440); 43919 font-size: var(--font-size-800); 43920 line-height: var(--font-line-height-700); 43921 letter-spacing: var(--font-letter-spacing-densest); 43922 `}; 43923 43924 ${({ $type }) => $type === "h2" && lt$2` 43925 font-weight: var(--font-weight-460); 43926 font-size: var(--font-size-700); 43927 line-height: var(--font-line-height-600); 43928 letter-spacing: var(--font-letter-spacing-denser); 43929 `}; 43930 43931 ${({ $type }) => $type === "h3" && lt$2` 43932 font-weight: var(--font-weight-480); 43933 font-size: var(--font-size-600); 43934 line-height: var(--font-line-height-500); 43935 letter-spacing: var(--font-letter-spacing-dense); 43936 `}; 43937 43938 ${({ $type }) => $type === "h4" && lt$2` 43939 font-weight: var(--font-weight-480); 43940 font-size: var(--font-size-500); 43941 line-height: var(--font-line-height-400); 43942 letter-spacing: var(--font-letter-spacing-dense); 43943 `}; 43944 43945 ${({ $type }) => $type === "h5" && lt$2` 43946 font-weight: var(--font-weight-500); 43947 font-size: var(--font-size-400); 43948 line-height: var(--font-line-height-300); 43949 letter-spacing: var(--font-letter-spacing-dense); 43950 `}; 43951 43952 ${({ $type }) => $type === "h6" && lt$2` 43953 font-weight: var(--font-weight-500); 43954 font-size: var(--font-size-300); 43955 line-height: var(--font-line-height-200); 43956 letter-spacing: var(--font-letter-spacing-normal); 43957 `}; 43958 43959 ${({ $type }) => $type === "h7" && lt$2` 43960 font-weight: var(--font-weight-460); 43961 font-size: var(--font-size-200); 43962 line-height: var(--font-line-height-100); 43963 letter-spacing: var(--font-letter-spacing-denser); 43964 `}; 43965`; 43966 const supportedHTMLElements = ["h1", "h2", "h3", "h4", "h5", "h6", "legend"]; 43967 const Heading = (_t2) => { 43968 var _u = _t2, { type, asTag, children } = _u, props = __objRest(_u, ["type", "asTag", "children"]); 43969 const getType = () => { 43970 if (asTag) { 43971 return asTag; 43972 } 43973 if (supportedHTMLElements.find((element) => element === type)) { 43974 return type; 43975 } 43976 return "div"; 43977 }; 43978 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$o, __spreadProps(__spreadValues({ as: getType(), $type: type, "data-testid": "Heading" }, props), { children })); 43979 }; 43980 const Container$n = dt$2.div` 43981 min-height: 100vh; 43982 43983 display: flex; 43984 align-items: center; 43985 justify-content: center; 43986 43987 position: relative; 43988`; 43989 const LogoContainer = dt$2.div` 43990 position: absolute; 43991 top: 0; 43992 left: 0; 43993 padding: var(--space-600); 43994 43995 display: block; 43996`; 43997 const Main = dt$2.div` 43998 max-width: ${({ $maxWidth = 498 }) => $maxWidth}px; 43999 44000 text-align: center; 44001`; 44002 const LoaderContainer$1 = dt$2.div` 44003 margin-bottom: var(--space-400); 44004 44005 display: flex; 44006 justify-content: center; 44007`; 44008 const Description$3 = dt$2.div` 44009 margin-top: var(--space-400); 44010 44011 font-size: var(--font-size-400); 44012 color: var(--text-primary); 44013`; 44014 const ActionsContainer = dt$2.div` 44015 margin-top: var(--space-600); 44016 44017 display: flex; 44018 justify-content: center; 44019`; 44020 const ErrorPage = ({ to: to2, heading, description, actions, loader, maxWidth }) => { 44021 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$n, { children: [
44022 to2 && /* @__PURE__ */ jsxRuntimeExports.jsx(LogoContainer, { as: Link, to: to2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(u8, { height: 28, width: 28 }) }), 44023 !to2 && /* @__PURE__ */ jsxRuntimeExports.jsx(LogoContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(u8, { height: 28, width: 28 }) }), 44024 /* @__PURE__ */ jsxRuntimeExports.jsxs(Main, { $maxWidth: maxWidth, children: [ 44025 loader && /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }), 44026 /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: "h2", children: heading }), 44027 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$3, { children: description }), 44028 actions && /* @__PURE__ */ jsxRuntimeExports.jsx(ActionsContainer, { children: actions }) 44029 ] }) 44030 ] }); 44031 }; 44032 const Container$m = dt$2.div( 44033 ({ $variant, $flex, $alignRight, $alignCenter }) => lt$2` 44034 flex-grow: 1; 44035 flex: ${$flex}; 44036 44037 & + & { 44038 ${$variant === "small" && lt$2` 44039 margin-top: var(--space-200); 44040 `}; 44041 44042 ${$variant === "regular" && lt$2` 44043 margin-top: var(--space-300); 44044 `}; 44045 44046 ${$variant === "medium" && lt$2` 44047 margin-top: var(--space-400); 44048 `}; 44049 44050 ${$variant === "large" && lt$2` 44051 margin-top: var(--space-800); 44052 `}; 44053 44054 ${mediaQueries.tablet} { 44055 margin-top: 0; 44056 width: auto; 44057 margin-left: var(--space-400); 44058 } 44059 } 44060 44061 ${$alignRight && lt$2` 44062 display: flex; 44063 justify-content: flex-end; 44064 `}; 44065 44066 ${$alignCenter && lt$2` 44067 display: flex; 44068 align-items: center; 44069 `}; 44070 ` 44071 ); 44072 const Footer$1 = dt$2.div` 44073 margin-top: var(--space-50); 44074`; 44075 const FieldsetItem = ({ 44076 variant = "medium", 44077 flex = 1, 44078 footerContent, 44079 alignRight, 44080 alignCenter, 44081 children 44082 }) => { 44083 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 44084 Container$m, 44085 { 44086 $variant: variant, 44087 $flex: flex, 44088 $alignRight: alignRight, 44089 $alignCenter: alignCenter, 44090 children: [
44091 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children }), 44092 footerContent && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer$1, { children: footerContent }) 44093 ] 44094 } 44095 ); 44096 }; 44097 const Container$l = dt$2.div` 44098 ${mediaQueries.tablet} { 44099 display: flex; 44100 } 44101 44102 ${({ $inner }) => $inner && lt$2` 44103 margin-top: var(--space-300) !important; 44104 margin-left: var(--space-900); 44105 `}; 44106 44107 ${({ $variant, $noMargin }) => $variant === "small" && !$noMargin && lt$2` 44108 margin-top: var(--space-200); 44109 `}; 44110 44111 ${({ $variant, $noMargin }) => $variant === "regular" && !$noMargin && lt$2` 44112 margin-top: var(--space-300); 44113 `}; 44114 44115 ${({ $variant, $noMargin }) => $variant === "medium" && !$noMargin && lt$2` 44116 margin-top: var(--space-400); 44117 `}; 44118 44119 ${({ $variant, $noMargin }) => $variant === "large" && !$noMargin && lt$2` 44120 margin-top: var(--space-800); 44121 `}; 44122 44123 &:first-of-type { 44124 margin-top: 0; 44125 } 44126`; 44127 const FieldsetRow = ({ 44128 variant = "medium", 44129 inner, 44130 noMargin = false, 44131 children 44132 }) => { 44133 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$l, { $variant: variant, $inner: inner, $noMargin: noMargin, children }); 44134 }; 44135 const Container$k = dt$2.fieldset` 44136 padding: 0; 44137 44138 & & { 44139 padding-top: var(--space-200); 44140 padding-left: var(--space-900); 44141 } 44142`; 44143 const Fieldset = ({ children }) => { 44144 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$k, { children }); 44145 }; 44146 Fieldset.Item = FieldsetItem; 44147 Fieldset.Row = FieldsetRow; 44148 var propTypes = { exports: {} }; 44149 var ReactPropTypesSecret_1; 44150 var hasRequiredReactPropTypesSecret; 44151 function requireReactPropTypesSecret() { 44152 if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1; 44153 hasRequiredReactPropTypesSecret = 1; 44154 var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; 44155 ReactPropTypesSecret_1 = ReactPropTypesSecret; 44156 return ReactPropTypesSecret_1; 44157 } 44158 var factoryWithThrowingShims; 44159 var hasRequiredFactoryWithThrowingShims; 44160 function requireFactoryWithThrowingShims() { 44161 if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims; 44162 hasRequiredFactoryWithThrowingShims = 1; 44163 var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret(); 44164 function emptyFunction() { 44165 } 44166 function emptyFunctionWithReset() { 44167 } 44168 emptyFunctionWithReset.resetWarningCache = emptyFunction; 44169 factoryWithThrowingShims = function() { 44170 function shim2(props, propName, componentName, location, propFullName, secret) { 44171 if (secret === ReactPropTypesSecret) { 44172 return; 44173 } 44174 var err = new Error( 44175 "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" 44176 ); 44177 err.name = "Invariant Violation"; 44178 throw err; 44179 } 44180 shim2.isRequired = shim2; 44181 function getShim() { 44182 return shim2; 44183 } 44184 var ReactPropTypes = { 44185 array: shim2, 44186 bigint: shim2, 44187 bool: shim2, 44188 func: shim2, 44189 number: shim2, 44190 object: shim2, 44191 string: shim2, 44192 symbol: shim2, 44193 any: shim2, 44194 arrayOf: getShim, 44195 element: shim2, 44196 elementType: shim2, 44197 instanceOf: getShim, 44198 node: shim2, 44199 objectOf: getShim, 44200 oneOf: getShim, 44201 oneOfType: getShim, 44202 shape: getShim, 44203 exact: getShim, 44204 checkPropTypes: emptyFunctionWithReset, 44205 resetWarningCache: emptyFunction 44206 }; 44207 ReactPropTypes.PropTypes = ReactPropTypes; 44208 return ReactPropTypes; 44209 }; 44210 return factoryWithThrowingShims; 44211 } 44212 var hasRequiredPropTypes; 44213 function requirePropTypes() { 44214 if (hasRequiredPropTypes) return propTypes.exports; 44215 hasRequiredPropTypes = 1; 44216 { 44217 propTypes.exports = /* @__PURE__ */ requireFactoryWithThrowingShims()(); 44218 }
44219 return propTypes.exports; 44220 } 44221 var propTypesExports = /* @__PURE__ */ requirePropTypes(); 44222 const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports); 44223 const COMMON_MIME_TYPES = /* @__PURE__ */ new Map([ 44224 // https://github.com/guzzle/psr7/blob/2d9260799e713f1c475d3c5fdc3d6561ff7441b2/src/MimeType.php 44225 ["1km", "application/vnd.1000minds.decision-model+xml"], 44226 ["3dml", "text/vnd.in3d.3dml"], 44227 ["3ds", "image/x-3ds"], 44228 ["3g2", "video/3gpp2"], 44229 ["3gp", "video/3gp"], 44230 ["3gpp", "video/3gpp"], 44231 ["3mf", "model/3mf"], 44232 ["7z", "application/x-7z-compressed"], 44233 ["7zip", "application/x-7z-compressed"], 44234 ["123", "application/vnd.lotus-1-2-3"], 44235 ["aab", "application/x-authorware-bin"], 44236 ["aac", "audio/x-acc"], 44237 ["aam", "application/x-authorware-map"], 44238 ["aas", "application/x-authorware-seg"], 44239 ["abw", "application/x-abiword"], 44240 ["ac", "application/vnd.nokia.n-gage.ac+xml"], 44241 ["ac3", "audio/ac3"], 44242 ["acc", "application/vnd.americandynamics.acc"], 44243 ["ace", "application/x-ace-compressed"], 44244 ["acu", "application/vnd.acucobol"], 44245 ["acutc", "application/vnd.acucorp"], 44246 ["adp", "audio/adpcm"], 44247 ["aep", "application/vnd.audiograph"], 44248 ["afm", "application/x-font-type1"], 44249 ["afp", "application/vnd.ibm.modcap"], 44250 ["ahead", "application/vnd.ahead.space"], 44251 ["ai", "application/pdf"], 44252 ["aif", "audio/x-aiff"], 44253 ["aifc", "audio/x-aiff"], 44254 ["aiff", "audio/x-aiff"], 44255 ["air", "application/vnd.adobe.air-application-installer-package+zip"], 44256 ["ait", "application/vnd.dvb.ait"], 44257 ["ami", "application/vnd.amiga.ami"], 44258 ["amr", "audio/amr"], 44259 ["apk", "application/vnd.android.package-archive"], 44260 ["apng", "image/apng"], 44261 ["appcache", "text/cache-manifest"], 44262 ["application", "application/x-ms-application"], 44263 ["apr", "application/vnd.lotus-approach"], 44264 ["arc", "application/x-freearc"], 44265 ["arj", "application/x-arj"], 44266 ["asc", "application/pgp-signature"], 44267 ["asf", "video/x-ms-asf"], 44268 ["asm", "text/x-asm"], 44269 ["aso", "application/vnd.accpac.simply.aso"], 44270 ["asx", "video/x-ms-asf"], 44271 ["atc", "application/vnd.acucorp"], 44272 ["atom", "application/atom+xml"], 44273 ["atomcat", "application/atomcat+xml"], 44274 ["atomdeleted", "application/atomdeleted+xml"], 44275 ["atomsvc", "application/atomsvc+xml"], 44276 ["atx", "application/vnd.antix.game-component"], 44277 ["au", "audio/x-au"], 44278 ["avi", "video/x-msvideo"], 44279 ["avif", "image/avif"], 44280 ["aw", "application/applixware"], 44281 ["azf", "application/vnd.airzip.filesecure.azf"], 44282 ["azs", "application/vnd.airzip.filesecure.azs"], 44283 ["azv", "image/vnd.airzip.accelerator.azv"], 44284 ["azw", "application/vnd.amazon.ebook"], 44285 ["b16", "image/vnd.pco.b16"], 44286 ["bat", "application/x-msdownload"], 44287 ["bcpio", "application/x-bcpio"], 44288 ["bdf", "application/x-font-bdf"], 44289 ["bdm", "application/vnd.syncml.dm+wbxml"], 44290 ["bdoc", "application/x-bdoc"], 44291 ["bed", "application/vnd.realvnc.bed"], 44292 ["bh2", "application/vnd.fujitsu.oasysprs"], 44293 ["bin", "application/octet-stream"], 44294 ["blb", "application/x-blorb"], 44295 ["blorb", "application/x-blorb"], 44296 ["bmi", "application/vnd.bmi"], 44297 ["bmml", "application/vnd.balsamiq.bmml+xml"], 44298 ["bmp", "image/bmp"], 44299 ["book", "application/vnd.framemaker"], 44300 ["box", "application/vnd.previewsystems.box"], 44301 ["boz", "application/x-bzip2"], 44302 ["bpk", "application/octet-stream"], 44303 ["bpmn", "application/octet-stream"], 44304 ["bsp", "model/vnd.valve.source.compiled-map"], 44305 ["btif", "image/prs.btif"], 44306 ["buffer", "application/octet-stream"], 44307 ["bz", "application/x-bzip"], 44308 ["bz2", "application/x-bzip2"], 44309 ["c", "text/x-c"], 44310 ["c4d", "application/vnd.clonk.c4group"], 44311 ["c4f", "application/vnd.clonk.c4group"], 44312 ["c4g", "application/vnd.clonk.c4group"], 44313 ["c4p", "application/vnd.clonk.c4group"], 44314 ["c4u", "application/vnd.clonk.c4group"], 44315 ["c11amc", "application/vnd.cluetrust.cartomobile-config"], 44316 ["c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"], 44317 ["cab", "application/vnd.ms-cab-compressed"], 44318 ["caf", "audio/x-caf"], 44319 ["cap", "application/vnd.tcpdump.pcap"], 44320 ["car", "application/vnd.curl.car"], 44321 ["cat", "application/vnd.ms-pki.seccat"], 44322 ["cb7", "application/x-cbr"], 44323 ["cba", "application/x-cbr"], 44324 ["cbr", "application/x-cbr"], 44325 ["cbt", "application/x-cbr"], 44326 ["cbz", "application/x-cbr"], 44327 ["cc", "text/x-c"], 44328 ["cco", "application/x-cocoa"], 44329 ["cct", "application/x-director"], 44330 ["ccxml", "application/ccxml+xml"], 44331 ["cdbcmsg", "application/vnd.contact.cmsg"],
44332 ["cda", "application/x-cdf"], 44333 ["cdf", "application/x-netcdf"], 44334 ["cdfx", "application/cdfx+xml"], 44335 ["cdkey", "application/vnd.mediastation.cdkey"], 44336 ["cdmia", "application/cdmi-capability"], 44337 ["cdmic", "application/cdmi-container"], 44338 ["cdmid", "application/cdmi-domain"], 44339 ["cdmio", "application/cdmi-object"], 44340 ["cdmiq", "application/cdmi-queue"], 44341 ["cdr", "application/cdr"], 44342 ["cdx", "chemical/x-cdx"], 44343 ["cdxml", "application/vnd.chemdraw+xml"], 44344 ["cdy", "application/vnd.cinderella"], 44345 ["cer", "application/pkix-cert"], 44346 ["cfs", "application/x-cfs-compressed"], 44347 ["cgm", "image/cgm"], 44348 ["chat", "application/x-chat"], 44349 ["chm", "application/vnd.ms-htmlhelp"], 44350 ["chrt", "application/vnd.kde.kchart"], 44351 ["cif", "chemical/x-cif"], 44352 ["cii", "application/vnd.anser-web-certificate-issue-initiation"], 44353 ["cil", "application/vnd.ms-artgalry"], 44354 ["cjs", "application/node"], 44355 ["cla", "application/vnd.claymore"], 44356 ["class", "application/octet-stream"], 44357 ["clkk", "application/vnd.crick.clicker.keyboard"], 44358 ["clkp", "application/vnd.crick.clicker.palette"], 44359 ["clkt", "application/vnd.crick.clicker.template"], 44360 ["clkw", "application/vnd.crick.clicker.wordbank"], 44361 ["clkx", "application/vnd.crick.clicker"], 44362 ["clp", "application/x-msclip"], 44363 ["cmc", "application/vnd.cosmocaller"], 44364 ["cmdf", "chemical/x-cmdf"], 44365 ["cml", "chemical/x-cml"], 44366 ["cmp", "application/vnd.yellowriver-custom-menu"], 44367 ["cmx", "image/x-cmx"], 44368 ["cod", "application/vnd.rim.cod"], 44369 ["coffee", "text/coffeescript"], 44370 ["com", "application/x-msdownload"], 44371 ["conf", "text/plain"], 44372 ["cpio", "application/x-cpio"], 44373 ["cpp", "text/x-c"], 44374 ["cpt", "application/mac-compactpro"], 44375 ["crd", "application/x-mscardfile"], 44376 ["crl", "application/pkix-crl"], 44377 ["crt", "application/x-x509-ca-cert"], 44378 ["crx", "application/x-chrome-extension"], 44379 ["cryptonote", "application/vnd.rig.cryptonote"], 44380 ["csh", "application/x-csh"], 44381 ["csl", "application/vnd.citationstyles.style+xml"], 44382 ["csml", "chemical/x-csml"], 44383 ["csp", "application/vnd.commonspace"], 44384 ["csr", "application/octet-stream"], 44385 ["css", "text/css"], 44386 ["cst", "application/x-director"], 44387 ["csv", "text/csv"], 44388 ["cu", "application/cu-seeme"], 44389 ["curl", "text/vnd.curl"], 44390 ["cww", "application/prs.cww"], 44391 ["cxt", "application/x-director"], 44392 ["cxx", "text/x-c"], 44393 ["dae", "model/vnd.collada+xml"], 44394 ["daf", "application/vnd.mobius.daf"], 44395 ["dart", "application/vnd.dart"], 44396 ["dataless", "application/vnd.fdsn.seed"], 44397 ["davmount", "application/davmount+xml"], 44398 ["dbf", "application/vnd.dbf"], 44399 ["dbk", "application/docbook+xml"], 44400 ["dcr", "application/x-director"], 44401 ["dcurl", "text/vnd.curl.dcurl"], 44402 ["dd2", "application/vnd.oma.dd2+xml"], 44403 ["ddd", "application/vnd.fujixerox.ddd"], 44404 ["ddf", "application/vnd.syncml.dmddf+xml"], 44405 ["dds", "image/vnd.ms-dds"], 44406 ["deb", "application/x-debian-package"], 44407 ["def", "text/plain"], 44408 ["deploy", "application/octet-stream"], 44409 ["der", "application/x-x509-ca-cert"], 44410 ["dfac", "application/vnd.dreamfactory"], 44411 ["dgc", "application/x-dgc-compressed"], 44412 ["dic", "text/x-c"], 44413 ["dir", "application/x-director"], 44414 ["dis", "application/vnd.mobius.dis"], 44415 ["disposition-notification", "message/disposition-notification"], 44416 ["dist", "application/octet-stream"], 44417 ["distz", "application/octet-stream"], 44418 ["djv", "image/vnd.djvu"], 44419 ["djvu", "image/vnd.djvu"], 44420 ["dll", "application/octet-stream"], 44421 ["dmg", "application/x-apple-diskimage"], 44422 ["dmn", "application/octet-stream"], 44423 ["dmp", "application/vnd.tcpdump.pcap"], 44424 ["dms", "application/octet-stream"], 44425 ["dna", "application/vnd.dna"], 44426 ["doc", "application/msword"], 44427 ["docm", "application/vnd.ms-word.template.macroEnabled.12"], 44428 ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"], 44429 ["dot", "application/msword"], 44430 ["dotm", "application/vnd.ms-word.template.macroEnabled.12"], 44431 ["dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"], 44432 ["dp", "application/vnd.osgi.dp"], 44433 ["dpg", "application/vnd.dpgraph"], 44434 ["dra", "audio/vnd.dra"], 44435 ["drle", "image/dicom-rle"], 44436 ["dsc", "text/prs.lines.tag"], 44437 ["dssc", "application/dssc+der"], 44438 ["dtb", "application/x-dtbook+xml"], 44439 ["dtd", "application/xml-dtd"], 44440 ["dts", "audio/vnd.dts"], 44441 ["dtshd", "audio/vnd.dts.hd"], 44442 ["dump", "application/octet-stream"], 44443 ["dvb", "video/vnd.dvb.file"], 44444 ["dvi", "application/x-dvi"], 44445 ["dwd", "application/atsc-dwd+xml"], 44446 ["dwf", "model/vnd.dwf"], 44447 ["dwg", "image/vnd.dwg"], 44448 ["dxf", "image/vnd.dxf"], 44449 ["dxp", "application/vnd.spotfire.dxp"], 44450 ["dxr", "application/x-director"], 44451 ["ear", "application/java-archive"], 44452 ["ecelp4800", "audio/vnd.nuera.ecelp4800"], 44453 ["ecelp7470", "audio/vnd.nuera.ecelp7470"], 44454 ["ecelp9600", "audio/vnd.nuera.ecelp9600"], 44455 ["ecma", "application/ecmascript"], 44456 ["edm", "application/vnd.novadigm.edm"], 44457 ["edx", "application/vnd.novadigm.edx"], 44458 ["efif", "application/vnd.picsel"], 44459 ["ei6", "application/vnd.pg.osasli"], 44460 ["elc", "application/octet-stream"], 44461 ["emf", "image/emf"], 44462 ["eml", "message/rfc822"], 44463 ["emma", "application/emma+xml"], 44464 ["emotionml", "application/emotionml+xml"], 44465 ["emz", "application/x-msmetafile"], 44466 ["eol", "audio/vnd.digital-winds"], 44467 ["eot", "application/vnd.ms-fontobject"],
44468 ["eps", "application/postscript"], 44469 ["epub", "application/epub+zip"], 44470 ["es", "application/ecmascript"], 44471 ["es3", "application/vnd.eszigno3+xml"], 44472 ["esa", "application/vnd.osgi.subsystem"], 44473 ["esf", "application/vnd.epson.esf"], 44474 ["et3", "application/vnd.eszigno3+xml"], 44475 ["etx", "text/x-setext"], 44476 ["eva", "application/x-eva"], 44477 ["evy", "application/x-envoy"], 44478 ["exe", "application/octet-stream"], 44479 ["exi", "application/exi"], 44480 ["exp", "application/express"], 44481 ["exr", "image/aces"], 44482 ["ext", "application/vnd.novadigm.ext"], 44483 ["ez", "application/andrew-inset"], 44484 ["ez2", "application/vnd.ezpix-album"], 44485 ["ez3", "application/vnd.ezpix-package"], 44486 ["f", "text/x-fortran"], 44487 ["f4v", "video/mp4"], 44488 ["f77", "text/x-fortran"], 44489 ["f90", "text/x-fortran"], 44490 ["fbs", "image/vnd.fastbidsheet"], 44491 ["fcdt", "application/vnd.adobe.formscentral.fcdt"], 44492 ["fcs", "application/vnd.isac.fcs"], 44493 ["fdf", "application/vnd.fdf"], 44494 ["fdt", "application/fdt+xml"], 44495 ["fe_launch", "application/vnd.denovo.fcselayout-link"], 44496 ["fg5", "application/vnd.fujitsu.oasysgp"], 44497 ["fgd", "application/x-director"], 44498 ["fh", "image/x-freehand"], 44499 ["fh4", "image/x-freehand"], 44500 ["fh5", "image/x-freehand"], 44501 ["fh7", "image/x-freehand"], 44502 ["fhc", "image/x-freehand"], 44503 ["fig", "application/x-xfig"], 44504 ["fits", "image/fits"], 44505 ["flac", "audio/x-flac"], 44506 ["fli", "video/x-fli"], 44507 ["flo", "application/vnd.micrografx.flo"], 44508 ["flv", "video/x-flv"], 44509 ["flw", "application/vnd.kde.kivio"], 44510 ["flx", "text/vnd.fmi.flexstor"], 44511 ["fly", "text/vnd.fly"], 44512 ["fm", "application/vnd.framemaker"], 44513 ["fnc", "application/vnd.frogans.fnc"], 44514 ["fo", "application/vnd.software602.filler.form+xml"], 44515 ["for", "text/x-fortran"], 44516 ["fpx", "image/vnd.fpx"], 44517 ["frame", "application/vnd.framemaker"], 44518 ["fsc", "application/vnd.fsc.weblaunch"], 44519 ["fst", "image/vnd.fst"], 44520 ["ftc", "application/vnd.fluxtime.clip"], 44521 ["fti", "application/vnd.anser-web-funds-transfer-initiation"], 44522 ["fvt", "video/vnd.fvt"], 44523 ["fxp", "application/vnd.adobe.fxp"], 44524 ["fxpl", "application/vnd.adobe.fxp"], 44525 ["fzs", "application/vnd.fuzzysheet"], 44526 ["g2w", "application/vnd.geoplan"], 44527 ["g3", "image/g3fax"], 44528 ["g3w", "application/vnd.geospace"], 44529 ["gac", "application/vnd.groove-account"], 44530 ["gam", "application/x-tads"], 44531 ["gbr", "application/rpki-ghostbusters"], 44532 ["gca", "application/x-gca-compressed"], 44533 ["gdl", "model/vnd.gdl"], 44534 ["gdoc", "application/vnd.google-apps.document"], 44535 ["geo", "application/vnd.dynageo"], 44536 ["geojson", "application/geo+json"], 44537 ["gex", "application/vnd.geometry-explorer"], 44538 ["ggb", "application/vnd.geogebra.file"], 44539 ["ggt", "application/vnd.geogebra.tool"], 44540 ["ghf", "application/vnd.groove-help"], 44541 ["gif", "image/gif"], 44542 ["gim", "application/vnd.groove-identity-message"], 44543 ["glb", "model/gltf-binary"], 44544 ["gltf", "model/gltf+json"], 44545 ["gml", "application/gml+xml"], 44546 ["gmx", "application/vnd.gmx"], 44547 ["gnumeric", "application/x-gnumeric"], 44548 ["gpg", "application/gpg-keys"], 44549 ["gph", "application/vnd.flographit"], 44550 ["gpx", "application/gpx+xml"], 44551 ["gqf", "application/vnd.grafeq"], 44552 ["gqs", "application/vnd.grafeq"], 44553 ["gram", "application/srgs"], 44554 ["gramps", "application/x-gramps-xml"], 44555 ["gre", "application/vnd.geometry-explorer"], 44556 ["grv", "application/vnd.groove-injector"], 44557 ["grxml", "application/srgs+xml"], 44558 ["gsf", "application/x-font-ghostscript"], 44559 ["gsheet", "application/vnd.google-apps.spreadsheet"], 44560 ["gslides", "application/vnd.google-apps.presentation"], 44561 ["gtar", "application/x-gtar"], 44562 ["gtm", "application/vnd.groove-tool-message"], 44563 ["gtw", "model/vnd.gtw"], 44564 ["gv", "text/vnd.graphviz"], 44565 ["gxf", "application/gxf"], 44566 ["gxt", "application/vnd.geonext"], 44567 ["gz", "application/gzip"], 44568 ["gzip", "application/gzip"], 44569 ["h", "text/x-c"], 44570 ["h261", "video/h261"], 44571 ["h263", "video/h263"], 44572 ["h264", "video/h264"], 44573 ["hal", "application/vnd.hal+xml"], 44574 ["hbci", "application/vnd.hbci"], 44575 ["hbs", "text/x-handlebars-template"], 44576 ["hdd", "application/x-virtualbox-hdd"], 44577 ["hdf", "application/x-hdf"], 44578 ["heic", "image/heic"], 44579 ["heics", "image/heic-sequence"], 44580 ["heif", "image/heif"],
44581 ["heifs", "image/heif-sequence"], 44582 ["hej2", "image/hej2k"], 44583 ["held", "application/atsc-held+xml"], 44584 ["hh", "text/x-c"], 44585 ["hjson", "application/hjson"], 44586 ["hlp", "application/winhlp"], 44587 ["hpgl", "application/vnd.hp-hpgl"], 44588 ["hpid", "application/vnd.hp-hpid"], 44589 ["hps", "application/vnd.hp-hps"], 44590 ["hqx", "application/mac-binhex40"], 44591 ["hsj2", "image/hsj2"], 44592 ["htc", "text/x-component"], 44593 ["htke", "application/vnd.kenameaapp"], 44594 ["htm", "text/html"], 44595 ["html", "text/html"], 44596 ["hvd", "application/vnd.yamaha.hv-dic"], 44597 ["hvp", "application/vnd.yamaha.hv-voice"], 44598 ["hvs", "application/vnd.yamaha.hv-script"], 44599 ["i2g", "application/vnd.intergeo"], 44600 ["icc", "application/vnd.iccprofile"], 44601 ["ice", "x-conference/x-cooltalk"], 44602 ["icm", "application/vnd.iccprofile"], 44603 ["ico", "image/x-icon"], 44604 ["ics", "text/calendar"], 44605 ["ief", "image/ief"], 44606 ["ifb", "text/calendar"], 44607 ["ifm", "application/vnd.shana.informed.formdata"], 44608 ["iges", "model/iges"], 44609 ["igl", "application/vnd.igloader"], 44610 ["igm", "application/vnd.insors.igm"], 44611 ["igs", "model/iges"], 44612 ["igx", "application/vnd.micrografx.igx"], 44613 ["iif", "application/vnd.shana.informed.interchange"], 44614 ["img", "application/octet-stream"], 44615 ["imp", "application/vnd.accpac.simply.imp"], 44616 ["ims", "application/vnd.ms-ims"], 44617 ["in", "text/plain"], 44618 ["ini", "text/plain"], 44619 ["ink", "application/inkml+xml"], 44620 ["inkml", "application/inkml+xml"], 44621 ["install", "application/x-install-instructions"], 44622 ["iota", "application/vnd.astraea-software.iota"], 44623 ["ipfix", "application/ipfix"], 44624 ["ipk", "application/vnd.shana.informed.package"], 44625 ["irm", "application/vnd.ibm.rights-management"], 44626 ["irp", "application/vnd.irepository.package+xml"], 44627 ["iso", "application/x-iso9660-image"], 44628 ["itp", "application/vnd.shana.informed.formtemplate"], 44629 ["its", "application/its+xml"], 44630 ["ivp", "application/vnd.immervision-ivp"], 44631 ["ivu", "application/vnd.immervision-ivu"], 44632 ["jad", "text/vnd.sun.j2me.app-descriptor"], 44633 ["jade", "text/jade"], 44634 ["jam", "application/vnd.jam"], 44635 ["jar", "application/java-archive"], 44636 ["jardiff", "application/x-java-archive-diff"], 44637 ["java", "text/x-java-source"], 44638 ["jhc", "image/jphc"], 44639 ["jisp", "application/vnd.jisp"], 44640 ["jls", "image/jls"], 44641 ["jlt", "application/vnd.hp-jlyt"], 44642 ["jng", "image/x-jng"], 44643 ["jnlp", "application/x-java-jnlp-file"], 44644 ["joda", "application/vnd.joost.joda-archive"], 44645 ["jp2", "image/jp2"], 44646 ["jpe", "image/jpeg"], 44647 ["jpeg", "image/jpeg"], 44648 ["jpf", "image/jpx"], 44649 ["jpg", "image/jpeg"], 44650 ["jpg2", "image/jp2"], 44651 ["jpgm", "video/jpm"], 44652 ["jpgv", "video/jpeg"], 44653 ["jph", "image/jph"], 44654 ["jpm", "video/jpm"], 44655 ["jpx", "image/jpx"], 44656 ["js", "application/javascript"], 44657 ["json", "application/json"], 44658 ["json5", "application/json5"], 44659 ["jsonld", "application/ld+json"], 44660 // https://jsonlines.org/ 44661 ["jsonl", "application/jsonl"], 44662 ["jsonml", "application/jsonml+json"], 44663 ["jsx", "text/jsx"], 44664 ["jxr", "image/jxr"], 44665 ["jxra", "image/jxra"], 44666 ["jxrs", "image/jxrs"], 44667 ["jxs", "image/jxs"], 44668 ["jxsc", "image/jxsc"], 44669 ["jxsi", "image/jxsi"], 44670 ["jxss", "image/jxss"], 44671 ["kar", "audio/midi"], 44672 ["karbon", "application/vnd.kde.karbon"], 44673 ["kdb", "application/octet-stream"], 44674 ["kdbx", "application/x-keepass2"], 44675 ["key", "application/x-iwork-keynote-sffkey"], 44676 ["kfo", "application/vnd.kde.kformula"], 44677 ["kia", "application/vnd.kidspiration"], 44678 ["kml", "application/vnd.google-earth.kml+xml"], 44679 ["kmz", "application/vnd.google-earth.kmz"], 44680 ["kne", "application/vnd.kinar"], 44681 ["knp", "application/vnd.kinar"], 44682 ["kon", "application/vnd.kde.kontour"], 44683 ["kpr", "application/vnd.kde.kpresenter"], 44684 ["kpt", "application/vnd.kde.kpresenter"], 44685 ["kpxx", "application/vnd.ds-keypoint"], 44686 ["ksp", "application/vnd.kde.kspread"], 44687 ["ktr", "application/vnd.kahootz"], 44688 ["ktx", "image/ktx"], 44689 ["ktx2", "image/ktx2"], 44690 ["ktz", "application/vnd.kahootz"], 44691 ["kwd", "application/vnd.kde.kword"], 44692 ["kwt", "application/vnd.kde.kword"], 44693 ["lasxml", "application/vnd.las.las+xml"], 44694 ["latex", "application/x-latex"], 44695 ["lbd", "application/vnd.llamagraphics.life-balance.desktop"], 44696 ["lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"], 44697 ["les", "application/vnd.hhe.lesson-player"], 44698 ["less", "text/less"], 44699 ["lgr", "application/lgr+xml"], 44700 ["lha", "application/octet-stream"], 44701 ["link66", "application/vnd.route66.link66+xml"], 44702 ["list", "text/plain"], 44703 ["list3820", "application/vnd.ibm.modcap"], 44704 ["listafp", "application/vnd.ibm.modcap"], 44705 ["litcoffee", "text/coffeescript"], 44706 ["lnk", "application/x-ms-shortcut"], 44707 ["log", "text/plain"], 44708 ["lostxml", "application/lost+xml"], 44709 ["lrf", "application/octet-stream"], 44710 ["lrm", "application/vnd.ms-lrm"], 44711 ["ltf", "application/vnd.frogans.ltf"], 44712 ["lua", "text/x-lua"], 44713 ["luac", "application/x-lua-bytecode"], 44714 ["lvp", "audio/vnd.lucent.voice"], 44715 ["lwp", "application/vnd.lotus-wordpro"], 44716 ["lzh", "application/octet-stream"], 44717 ["m1v", "video/mpeg"], 44718 ["m2a", "audio/mpeg"], 44719 ["m2v", "video/mpeg"], 44720 ["m3a", "audio/mpeg"], 44721 ["m3u", "text/plain"], 44722 ["m3u8", "application/vnd.apple.mpegurl"], 44723 ["m4a", "audio/x-m4a"], 44724 ["m4p", "application/mp4"], 44725 ["m4s", "video/iso.segment"], 44726 ["m4u", "application/vnd.mpegurl"], 44727 ["m4v", "video/x-m4v"], 44728 ["m13", "application/x-msmediaview"], 44729 ["m14", "application/x-msmediaview"], 44730 ["m21", "application/mp21"], 44731 ["ma", "application/mathematica"], 44732 ["mads", "application/mads+xml"], 44733 ["maei", "application/mmt-aei+xml"], 44734 ["mag", "application/vnd.ecowin.chart"], 44735 ["maker", "application/vnd.framemaker"], 44736 ["man", "text/troff"], 44737 ["manifest", "text/cache-manifest"], 44738 ["map", "application/json"], 44739 ["mar", "application/octet-stream"], 44740 ["markdown", "text/markdown"], 44741 ["mathml", "application/mathml+xml"], 44742 ["mb", "application/mathematica"], 44743 ["mbk", "application/vnd.mobius.mbk"], 44744 ["mbox", "application/mbox"], 44745 ["mc1", "application/vnd.medcalcdata"], 44746 ["mcd", "application/vnd.mcd"], 44747 ["mcurl", "text/vnd.curl.mcurl"], 44748 ["md", "text/markdown"], 44749 ["mdb", "application/x-msaccess"], 44750 ["mdi", "image/vnd.ms-modi"], 44751 ["mdx", "text/mdx"], 44752 ["me", "text/troff"], 44753 ["mesh", "model/mesh"], 44754 ["meta4", "application/metalink4+xml"], 44755 ["metalink", "application/metalink+xml"], 44756 ["mets", "application/mets+xml"], 44757 ["mfm", "application/vnd.mfmp"], 44758 ["mft", "application/rpki-manifest"], 44759 ["mgp", "application/vnd.osgeo.mapguide.package"], 44760 ["mgz", "application/vnd.proteus.magazine"], 44761 ["mid", "audio/midi"], 44762 ["midi", "audio/midi"], 44763 ["mie", "application/x-mie"], 44764 ["mif", "application/vnd.mif"], 44765 ["mime", "message/rfc822"], 44766 ["mj2", "video/mj2"], 44767 ["mjp2", "video/mj2"], 44768 ["mjs", "application/javascript"], 44769 ["mk3d", "video/x-matroska"], 44770 ["mka", "audio/x-matroska"], 44771 ["mkd", "text/x-markdown"], 44772 ["mks", "video/x-matroska"], 44773 ["mkv", "video/x-matroska"], 44774 ["mlp", "application/vnd.dolby.mlp"], 44775 ["mmd", "application/vnd.chipnuts.karaoke-mmd"], 44776 ["mmf", "application/vnd.smaf"], 44777 ["mml", "text/mathml"],
44778 ["mmr", "image/vnd.fujixerox.edmics-mmr"], 44779 ["mng", "video/x-mng"], 44780 ["mny", "application/x-msmoney"], 44781 ["mobi", "application/x-mobipocket-ebook"], 44782 ["mods", "application/mods+xml"], 44783 ["mov", "video/quicktime"], 44784 ["movie", "video/x-sgi-movie"], 44785 ["mp2", "audio/mpeg"], 44786 ["mp2a", "audio/mpeg"], 44787 ["mp3", "audio/mpeg"], 44788 ["mp4", "video/mp4"], 44789 ["mp4a", "audio/mp4"], 44790 ["mp4s", "application/mp4"], 44791 ["mp4v", "video/mp4"], 44792 ["mp21", "application/mp21"], 44793 ["mpc", "application/vnd.mophun.certificate"], 44794 ["mpd", "application/dash+xml"], 44795 ["mpe", "video/mpeg"], 44796 ["mpeg", "video/mpeg"], 44797 ["mpg", "video/mpeg"], 44798 ["mpg4", "video/mp4"], 44799 ["mpga", "audio/mpeg"], 44800 ["mpkg", "application/vnd.apple.installer+xml"], 44801 ["mpm", "application/vnd.blueice.multipass"], 44802 ["mpn", "application/vnd.mophun.application"], 44803 ["mpp", "application/vnd.ms-project"], 44804 ["mpt", "application/vnd.ms-project"], 44805 ["mpy", "application/vnd.ibm.minipay"], 44806 ["mqy", "application/vnd.mobius.mqy"], 44807 ["mrc", "application/marc"], 44808 ["mrcx", "application/marcxml+xml"], 44809 ["ms", "text/troff"], 44810 ["mscml", "application/mediaservercontrol+xml"], 44811 ["mseed", "application/vnd.fdsn.mseed"], 44812 ["mseq", "application/vnd.mseq"], 44813 ["msf", "application/vnd.epson.msf"], 44814 ["msg", "application/vnd.ms-outlook"], 44815 ["msh", "model/mesh"], 44816 ["msi", "application/x-msdownload"], 44817 ["msl", "application/vnd.mobius.msl"], 44818 ["msm", "application/octet-stream"], 44819 ["msp", "application/octet-stream"], 44820 ["msty", "application/vnd.muvee.style"], 44821 ["mtl", "model/mtl"], 44822 ["mts", "model/vnd.mts"], 44823 ["mus", "application/vnd.musician"], 44824 ["musd", "application/mmt-usd+xml"], 44825 ["musicxml", "application/vnd.recordare.musicxml+xml"], 44826 ["mvb", "application/x-msmediaview"], 44827 ["mvt", "application/vnd.mapbox-vector-tile"], 44828 ["mwf", "application/vnd.mfer"], 44829 ["mxf", "application/mxf"], 44830 ["mxl", "application/vnd.recordare.musicxml"], 44831 ["mxmf", "audio/mobile-xmf"], 44832 ["mxml", "application/xv+xml"], 44833 ["mxs", "application/vnd.triscape.mxs"], 44834 ["mxu", "video/vnd.mpegurl"], 44835 ["n-gage", "application/vnd.nokia.n-gage.symbian.install"], 44836 ["n3", "text/n3"], 44837 ["nb", "application/mathematica"], 44838 ["nbp", "application/vnd.wolfram.player"], 44839 ["nc", "application/x-netcdf"],
44840 ["ncx", "application/x-dtbncx+xml"], 44841 ["nfo", "text/x-nfo"], 44842 ["ngdat", "application/vnd.nokia.n-gage.data"], 44843 ["nitf", "application/vnd.nitf"], 44844 ["nlu", "application/vnd.neurolanguage.nlu"], 44845 ["nml", "application/vnd.enliven"], 44846 ["nnd", "application/vnd.noblenet-directory"], 44847 ["nns", "application/vnd.noblenet-sealer"], 44848 ["nnw", "application/vnd.noblenet-web"], 44849 ["npx", "image/vnd.net-fpx"], 44850 ["nq", "application/n-quads"], 44851 ["nsc", "application/x-conference"], 44852 ["nsf", "application/vnd.lotus-notes"], 44853 ["nt", "application/n-triples"], 44854 ["ntf", "application/vnd.nitf"], 44855 ["numbers", "application/x-iwork-numbers-sffnumbers"], 44856 ["nzb", "application/x-nzb"], 44857 ["oa2", "application/vnd.fujitsu.oasys2"], 44858 ["oa3", "application/vnd.fujitsu.oasys3"], 44859 ["oas", "application/vnd.fujitsu.oasys"], 44860 ["obd", "application/x-msbinder"], 44861 ["obgx", "application/vnd.openblox.game+xml"], 44862 ["obj", "model/obj"], 44863 ["oda", "application/oda"], 44864 ["odb", "application/vnd.oasis.opendocument.database"], 44865 ["odc", "application/vnd.oasis.opendocument.chart"], 44866 ["odf", "application/vnd.oasis.opendocument.formula"], 44867 ["odft", "application/vnd.oasis.opendocument.formula-template"], 44868 ["odg", "application/vnd.oasis.opendocument.graphics"], 44869 ["odi", "application/vnd.oasis.opendocument.image"], 44870 ["odm", "application/vnd.oasis.opendocument.text-master"], 44871 ["odp", "application/vnd.oasis.opendocument.presentation"], 44872 ["ods", "application/vnd.oasis.opendocument.spreadsheet"], 44873 ["odt", "application/vnd.oasis.opendocument.text"], 44874 ["oga", "audio/ogg"], 44875 ["ogex", "model/vnd.opengex"], 44876 ["ogg", "audio/ogg"], 44877 ["ogv", "video/ogg"], 44878 ["ogx", "application/ogg"], 44879 ["omdoc", "application/omdoc+xml"], 44880 ["onepkg", "application/onenote"], 44881 ["onetmp", "application/onenote"], 44882 ["onetoc", "application/onenote"], 44883 ["onetoc2", "application/onenote"], 44884 ["opf", "application/oebps-package+xml"], 44885 ["opml", "text/x-opml"], 44886 ["oprc", "application/vnd.palm"], 44887 ["opus", "audio/ogg"], 44888 ["org", "text/x-org"], 44889 ["osf", "application/vnd.yamaha.openscoreformat"], 44890 ["osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"], 44891 ["osm", "application/vnd.openstreetmap.data+xml"], 44892 ["otc", "application/vnd.oasis.opendocument.chart-template"], 44893 ["otf", "font/otf"], 44894 ["otg", "application/vnd.oasis.opendocument.graphics-template"], 44895 ["oth", "application/vnd.oasis.opendocument.text-web"], 44896 ["oti", "application/vnd.oasis.opendocument.image-template"], 44897 ["otp", "application/vnd.oasis.opendocument.presentation-template"], 44898 ["ots", "application/vnd.oasis.opendocument.spreadsheet-template"], 44899 ["ott", "application/vnd.oasis.opendocument.text-template"], 44900 ["ova", "application/x-virtualbox-ova"], 44901 ["ovf", "application/x-virtualbox-ovf"], 44902 ["owl", "application/rdf+xml"], 44903 ["oxps", "application/oxps"], 44904 ["oxt", "application/vnd.openofficeorg.extension"], 44905 ["p", "text/x-pascal"], 44906 ["p7a", "application/x-pkcs7-signature"], 44907 ["p7b", "application/x-pkcs7-certificates"], 44908 ["p7c", "application/pkcs7-mime"], 44909 ["p7m", "application/pkcs7-mime"], 44910 ["p7r", "application/x-pkcs7-certreqresp"], 44911 ["p7s", "application/pkcs7-signature"], 44912 ["p8", "application/pkcs8"], 44913 ["p10", "application/x-pkcs10"], 44914 ["p12", "application/x-pkcs12"], 44915 ["pac", "application/x-ns-proxy-autoconfig"], 44916 ["pages", "application/x-iwork-pages-sffpages"], 44917 ["pas", "text/x-pascal"], 44918 ["paw", "application/vnd.pawaafile"], 44919 ["pbd", "application/vnd.powerbuilder6"], 44920 ["pbm", "image/x-portable-bitmap"], 44921 ["pcap", "application/vnd.tcpdump.pcap"], 44922 ["pcf", "application/x-font-pcf"], 44923 ["pcl", "application/vnd.hp-pcl"], 44924 ["pclxl", "application/vnd.hp-pclxl"], 44925 ["pct", "image/x-pict"], 44926 ["pcurl", "application/vnd.curl.pcurl"], 44927 ["pcx", "image/x-pcx"], 44928 ["pdb", "application/x-pilot"], 44929 ["pde", "text/x-processing"], 44930 ["pdf", "application/pdf"],
44931 ["pem", "application/x-x509-user-cert"], 44932 ["pfa", "application/x-font-type1"], 44933 ["pfb", "application/x-font-type1"], 44934 ["pfm", "application/x-font-type1"], 44935 ["pfr", "application/font-tdpfr"], 44936 ["pfx", "application/x-pkcs12"], 44937 ["pgm", "image/x-portable-graymap"], 44938 ["pgn", "application/x-chess-pgn"], 44939 ["pgp", "application/pgp"], 44940 ["php", "application/x-httpd-php"], 44941 ["php3", "application/x-httpd-php"], 44942 ["php4", "application/x-httpd-php"], 44943 ["phps", "application/x-httpd-php-source"], 44944 ["phtml", "application/x-httpd-php"], 44945 ["pic", "image/x-pict"], 44946 ["pkg", "application/octet-stream"], 44947 ["pki", "application/pkixcmp"], 44948 ["pkipath", "application/pkix-pkipath"], 44949 ["pkpass", "application/vnd.apple.pkpass"], 44950 ["pl", "application/x-perl"], 44951 ["plb", "application/vnd.3gpp.pic-bw-large"], 44952 ["plc", "application/vnd.mobius.plc"], 44953 ["plf", "application/vnd.pocketlearn"], 44954 ["pls", "application/pls+xml"], 44955 ["pm", "application/x-perl"], 44956 ["pml", "application/vnd.ctc-posml"], 44957 ["png", "image/png"], 44958 ["pnm", "image/x-portable-anymap"], 44959 ["portpkg", "application/vnd.macports.portpkg"], 44960 ["pot", "application/vnd.ms-powerpoint"], 44961 ["potm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"], 44962 ["potx", "application/vnd.openxmlformats-officedocument.presentationml.template"], 44963 ["ppa", "application/vnd.ms-powerpoint"], 44964 ["ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"], 44965 ["ppd", "application/vnd.cups-ppd"], 44966 ["ppm", "image/x-portable-pixmap"], 44967 ["pps", "application/vnd.ms-powerpoint"], 44968 ["ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"], 44969 ["ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"], 44970 ["ppt", "application/powerpoint"], 44971 ["pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"], 44972 ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"], 44973 ["pqa", "application/vnd.palm"], 44974 ["prc", "application/x-pilot"], 44975 ["pre", "application/vnd.lotus-freelance"], 44976 ["prf", "application/pics-rules"], 44977 ["provx", "application/provenance+xml"], 44978 ["ps", "application/postscript"], 44979 ["psb", "application/vnd.3gpp.pic-bw-small"], 44980 ["psd", "application/x-photoshop"], 44981 ["psf", "application/x-font-linux-psf"], 44982 ["pskcxml", "application/pskc+xml"], 44983 ["pti", "image/prs.pti"], 44984 ["ptid", "application/vnd.pvi.ptid1"], 44985 ["pub", "application/x-mspublisher"], 44986 ["pvb", "application/vnd.3gpp.pic-bw-var"], 44987 ["pwn", "application/vnd.3m.post-it-notes"], 44988 ["pya", "audio/vnd.ms-playready.media.pya"], 44989 ["pyv", "video/vnd.ms-playready.media.pyv"], 44990 ["qam", "application/vnd.epson.quickanime"], 44991 ["qbo", "application/vnd.intu.qbo"], 44992 ["qfx", "application/vnd.intu.qfx"], 44993 ["qps", "application/vnd.publishare-delta-tree"], 44994 ["qt", "video/quicktime"], 44995 ["qwd", "application/vnd.quark.quarkxpress"], 44996 ["qwt", "application/vnd.quark.quarkxpress"], 44997 ["qxb", "application/vnd.quark.quarkxpress"], 44998 ["qxd", "application/vnd.quark.quarkxpress"], 44999 ["qxl", "application/vnd.quark.quarkxpress"], 45000 ["qxt", "application/vnd.quark.quarkxpress"], 45001 ["ra", "audio/x-realaudio"], 45002 ["ram", "audio/x-pn-realaudio"], 45003 ["raml", "application/raml+yaml"], 45004 ["rapd", "application/route-apd+xml"], 45005 ["rar", "application/x-rar"], 45006 ["ras", "image/x-cmu-raster"], 45007 ["rcprofile", "application/vnd.ipunplugged.rcprofile"], 45008 ["rdf", "application/rdf+xml"], 45009 ["rdz", "application/vnd.data-vision.rdz"], 45010 ["relo", "application/p2p-overlay+xml"], 45011 ["rep", "application/vnd.businessobjects"], 45012 ["res", "application/x-dtbresource+xml"], 45013 ["rgb", "image/x-rgb"], 45014 ["rif", "application/reginfo+xml"], 45015 ["rip", "audio/vnd.rip"], 45016 ["ris", "application/x-research-info-systems"], 45017 ["rl", "application/resource-lists+xml"], 45018 ["rlc", "image/vnd.fujixerox.edmics-rlc"], 45019 ["rld", "application/resource-lists-diff+xml"], 45020 ["rm", "audio/x-pn-realaudio"], 45021 ["rmi", "audio/midi"], 45022 ["rmp", "audio/x-pn-realaudio-plugin"], 45023 ["rms", "application/vnd.jcp.javame.midlet-rms"], 45024 ["rmvb", "application/vnd.rn-realmedia-vbr"], 45025 ["rnc", "application/relax-ng-compact-syntax"], 45026 ["rng", "application/xml"], 45027 ["roa", "application/rpki-roa"], 45028 ["roff", "text/troff"], 45029 ["rp9", "application/vnd.cloanto.rp9"], 45030 ["rpm", "audio/x-pn-realaudio-plugin"], 45031 ["rpss", "application/vnd.nokia.radio-presets"], 45032 ["rpst", "application/vnd.nokia.radio-preset"], 45033 ["rq", "application/sparql-query"], 45034 ["rs", "application/rls-services+xml"], 45035 ["rsa", "application/x-pkcs7"], 45036 ["rsat", "application/atsc-rsat+xml"], 45037 ["rsd", "application/rsd+xml"], 45038 ["rsheet", "application/urc-ressheet+xml"], 45039 ["rss", "application/rss+xml"], 45040 ["rtf", "text/rtf"], 45041 ["rtx", "text/richtext"], 45042 ["run", "application/x-makeself"], 45043 ["rusd", "application/route-usd+xml"], 45044 ["rv", "video/vnd.rn-realvideo"], 45045 ["s", "text/x-asm"], 45046 ["s3m", "audio/s3m"], 45047 ["saf", "application/vnd.yamaha.smaf-audio"], 45048 ["sass", "text/x-sass"], 45049 ["sbml", "application/sbml+xml"], 45050 ["sc", "application/vnd.ibm.secure-container"], 45051 ["scd", "application/x-msschedule"], 45052 ["scm", "application/vnd.lotus-screencam"], 45053 ["scq", "application/scvp-cv-request"], 45054 ["scs", "application/scvp-cv-response"], 45055 ["scss", "text/x-scss"], 45056 ["scurl", "text/vnd.curl.scurl"], 45057 ["sda", "application/vnd.stardivision.draw"], 45058 ["sdc", "application/vnd.stardivision.calc"], 45059 ["sdd", "application/vnd.stardivision.impress"], 45060 ["sdkd", "application/vnd.solent.sdkm+xml"], 45061 ["sdkm", "application/vnd.solent.sdkm+xml"], 45062 ["sdp", "application/sdp"], 45063 ["sdw", "application/vnd.stardivision.writer"], 45064 ["sea", "application/octet-stream"], 45065 ["see", "application/vnd.seemail"], 45066 ["seed", "application/vnd.fdsn.seed"], 45067 ["sema", "application/vnd.sema"], 45068 ["semd", "application/vnd.semd"], 45069 ["semf", "application/vnd.semf"], 45070 ["senmlx", "application/senml+xml"], 45071 ["sensmlx", "application/sensml+xml"], 45072 ["ser", "application/java-serialized-object"],
45073 ["setpay", "application/set-payment-initiation"], 45074 ["setreg", "application/set-registration-initiation"], 45075 ["sfd-hdstx", "application/vnd.hydrostatix.sof-data"], 45076 ["sfs", "application/vnd.spotfire.sfs"], 45077 ["sfv", "text/x-sfv"], 45078 ["sgi", "image/sgi"], 45079 ["sgl", "application/vnd.stardivision.writer-global"], 45080 ["sgm", "text/sgml"], 45081 ["sgml", "text/sgml"], 45082 ["sh", "application/x-sh"], 45083 ["shar", "application/x-shar"], 45084 ["shex", "text/shex"], 45085 ["shf", "application/shf+xml"], 45086 ["shtml", "text/html"], 45087 ["sid", "image/x-mrsid-image"], 45088 ["sieve", "application/sieve"], 45089 ["sig", "application/pgp-signature"], 45090 ["sil", "audio/silk"], 45091 ["silo", "model/mesh"], 45092 ["sis", "application/vnd.symbian.install"], 45093 ["sisx", "application/vnd.symbian.install"], 45094 ["sit", "application/x-stuffit"], 45095 ["sitx", "application/x-stuffitx"], 45096 ["siv", "application/sieve"], 45097 ["skd", "application/vnd.koan"], 45098 ["skm", "application/vnd.koan"], 45099 ["skp", "application/vnd.koan"], 45100 ["skt", "application/vnd.koan"], 45101 ["sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"], 45102 ["sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"], 45103 ["slim", "text/slim"], 45104 ["slm", "text/slim"], 45105 ["sls", "application/route-s-tsid+xml"], 45106 ["slt", "application/vnd.epson.salt"], 45107 ["sm", "application/vnd.stepmania.stepchart"], 45108 ["smf", "application/vnd.stardivision.math"], 45109 ["smi", "application/smil"], 45110 ["smil", "application/smil"], 45111 ["smv", "video/x-smv"], 45112 ["smzip", "application/vnd.stepmania.package"], 45113 ["snd", "audio/basic"], 45114 ["snf", "application/x-font-snf"], 45115 ["so", "application/octet-stream"], 45116 ["spc", "application/x-pkcs7-certificates"], 45117 ["spdx", "text/spdx"], 45118 ["spf", "application/vnd.yamaha.smaf-phrase"], 45119 ["spl", "application/x-futuresplash"], 45120 ["spot", "text/vnd.in3d.spot"], 45121 ["spp", "application/scvp-vp-response"], 45122 ["spq", "application/scvp-vp-request"], 45123 ["spx", "audio/ogg"], 45124 ["sql", "application/x-sql"], 45125 ["src", "application/x-wais-source"], 45126 ["srt", "application/x-subrip"], 45127 ["sru", "application/sru+xml"], 45128 ["srx", "application/sparql-results+xml"], 45129 ["ssdl", "application/ssdl+xml"], 45130 ["sse", "application/vnd.kodak-descriptor"], 45131 ["ssf", "application/vnd.epson.ssf"], 45132 ["ssml", "application/ssml+xml"], 45133 ["sst", "application/octet-stream"], 45134 ["st", "application/vnd.sailingtracker.track"], 45135 ["stc", "application/vnd.sun.xml.calc.template"], 45136 ["std", "application/vnd.sun.xml.draw.template"], 45137 ["stf", "application/vnd.wt.stf"], 45138 ["sti", "application/vnd.sun.xml.impress.template"], 45139 ["stk", "application/hyperstudio"], 45140 ["stl", "model/stl"], 45141 ["stpx", "model/step+xml"], 45142 ["stpxz", "model/step-xml+zip"], 45143 ["stpz", "model/step+zip"], 45144 ["str", "application/vnd.pg.format"], 45145 ["stw", "application/vnd.sun.xml.writer.template"], 45146 ["styl", "text/stylus"], 45147 ["stylus", "text/stylus"], 45148 ["sub", "text/vnd.dvb.subtitle"], 45149 ["sus", "application/vnd.sus-calendar"], 45150 ["susp", "application/vnd.sus-calendar"], 45151 ["sv4cpio", "application/x-sv4cpio"], 45152 ["sv4crc", "application/x-sv4crc"], 45153 ["svc", "application/vnd.dvb.service"], 45154 ["svd", "application/vnd.svd"], 45155 ["svg", "image/svg+xml"], 45156 ["svgz", "image/svg+xml"], 45157 ["swa", "application/x-director"], 45158 ["swf", "application/x-shockwave-flash"], 45159 ["swi", "application/vnd.aristanetworks.swi"], 45160 ["swidtag", "application/swid+xml"], 45161 ["sxc", "application/vnd.sun.xml.calc"], 45162 ["sxd", "application/vnd.sun.xml.draw"], 45163 ["sxg", "application/vnd.sun.xml.writer.global"], 45164 ["sxi", "application/vnd.sun.xml.impress"], 45165 ["sxm", "application/vnd.sun.xml.math"], 45166 ["sxw", "application/vnd.sun.xml.writer"], 45167 ["t", "text/troff"], 45168 ["t3", "application/x-t3vm-image"], 45169 ["t38", "image/t38"], 45170 ["taglet", "application/vnd.mynfc"], 45171 ["tao", "application/vnd.tao.intent-module-archive"], 45172 ["tap", "image/vnd.tencent.tap"], 45173 ["tar", "application/x-tar"], 45174 ["tcap", "application/vnd.3gpp2.tcap"], 45175 ["tcl", "application/x-tcl"], 45176 ["td", "application/urc-targetdesc+xml"], 45177 ["teacher", "application/vnd.smart.teacher"], 45178 ["tei", "application/tei+xml"], 45179 ["teicorpus", "application/tei+xml"], 45180 ["tex", "application/x-tex"], 45181 ["texi", "application/x-texinfo"], 45182 ["texinfo", "application/x-texinfo"], 45183 ["text", "text/plain"], 45184 ["tfi", "application/thraud+xml"], 45185 ["tfm", "application/x-tex-tfm"], 45186 ["tfx", "image/tiff-fx"], 45187 ["tga", "image/x-tga"], 45188 ["tgz", "application/x-tar"], 45189 ["thmx", "application/vnd.ms-officetheme"], 45190 ["tif", "image/tiff"], 45191 ["tiff", "image/tiff"], 45192 ["tk", "application/x-tcl"], 45193 ["tmo", "application/vnd.tmobile-livetv"], 45194 ["toml", "application/toml"], 45195 ["torrent", "application/x-bittorrent"],
45196 ["tpl", "application/vnd.groove-tool-template"], 45197 ["tpt", "application/vnd.trid.tpt"], 45198 ["tr", "text/troff"], 45199 ["tra", "application/vnd.trueapp"], 45200 ["trig", "application/trig"], 45201 ["trm", "application/x-msterminal"], 45202 ["ts", "video/mp2t"], 45203 ["tsd", "application/timestamped-data"], 45204 ["tsv", "text/tab-separated-values"], 45205 ["ttc", "font/collection"], 45206 ["ttf", "font/ttf"], 45207 ["ttl", "text/turtle"], 45208 ["ttml", "application/ttml+xml"], 45209 ["twd", "application/vnd.simtech-mindmapper"], 45210 ["twds", "application/vnd.simtech-mindmapper"], 45211 ["txd", "application/vnd.genomatix.tuxedo"], 45212 ["txf", "application/vnd.mobius.txf"], 45213 ["txt", "text/plain"], 45214 ["u8dsn", "message/global-delivery-status"], 45215 ["u8hdr", "message/global-headers"], 45216 ["u8mdn", "message/global-disposition-notification"], 45217 ["u8msg", "message/global"], 45218 ["u32", "application/x-authorware-bin"], 45219 ["ubj", "application/ubjson"], 45220 ["udeb", "application/x-debian-package"], 45221 ["ufd", "application/vnd.ufdl"], 45222 ["ufdl", "application/vnd.ufdl"], 45223 ["ulx", "application/x-glulx"], 45224 ["umj", "application/vnd.umajin"], 45225 ["unityweb", "application/vnd.unity"], 45226 ["uoml", "application/vnd.uoml+xml"], 45227 ["uri", "text/uri-list"], 45228 ["uris", "text/uri-list"], 45229 ["urls", "text/uri-list"], 45230 ["usdz", "model/vnd.usdz+zip"], 45231 ["ustar", "application/x-ustar"], 45232 ["utz", "application/vnd.uiq.theme"], 45233 ["uu", "text/x-uuencode"], 45234 ["uva", "audio/vnd.dece.audio"], 45235 ["uvd", "application/vnd.dece.data"], 45236 ["uvf", "application/vnd.dece.data"], 45237 ["uvg", "image/vnd.dece.graphic"], 45238 ["uvh", "video/vnd.dece.hd"], 45239 ["uvi", "image/vnd.dece.graphic"], 45240 ["uvm", "video/vnd.dece.mobile"], 45241 ["uvp", "video/vnd.dece.pd"], 45242 ["uvs", "video/vnd.dece.sd"], 45243 ["uvt", "application/vnd.dece.ttml+xml"], 45244 ["uvu", "video/vnd.uvvu.mp4"], 45245 ["uvv", "video/vnd.dece.video"], 45246 ["uvva", "audio/vnd.dece.audio"], 45247 ["uvvd", "application/vnd.dece.data"], 45248 ["uvvf", "application/vnd.dece.data"], 45249 ["uvvg", "image/vnd.dece.graphic"], 45250 ["uvvh", "video/vnd.dece.hd"], 45251 ["uvvi", "image/vnd.dece.graphic"], 45252 ["uvvm", "video/vnd.dece.mobile"], 45253 ["uvvp", "video/vnd.dece.pd"], 45254 ["uvvs", "video/vnd.dece.sd"], 45255 ["uvvt", "application/vnd.dece.ttml+xml"], 45256 ["uvvu", "video/vnd.uvvu.mp4"], 45257 ["uvvv", "video/vnd.dece.video"], 45258 ["uvvx", "application/vnd.dece.unspecified"], 45259 ["uvvz", "application/vnd.dece.zip"], 45260 ["uvx", "application/vnd.dece.unspecified"], 45261 ["uvz", "application/vnd.dece.zip"], 45262 ["vbox", "application/x-virtualbox-vbox"], 45263 ["vbox-extpack", "application/x-virtualbox-vbox-extpack"], 45264 ["vcard", "text/vcard"], 45265 ["vcd", "application/x-cdlink"], 45266 ["vcf", "text/x-vcard"], 45267 ["vcg", "application/vnd.groove-vcard"], 45268 ["vcs", "text/x-vcalendar"], 45269 ["vcx", "application/vnd.vcx"], 45270 ["vdi", "application/x-virtualbox-vdi"], 45271 ["vds", "model/vnd.sap.vds"], 45272 ["vhd", "application/x-virtualbox-vhd"], 45273 ["vis", "application/vnd.visionary"], 45274 ["viv", "video/vnd.vivo"], 45275 ["vlc", "application/videolan"], 45276 ["vmdk", "application/x-virtualbox-vmdk"], 45277 ["vob", "video/x-ms-vob"], 45278 ["vor", "application/vnd.stardivision.writer"], 45279 ["vox", "application/x-authorware-bin"], 45280 ["vrml", "model/vrml"], 45281 ["vsd", "application/vnd.visio"], 45282 ["vsf", "application/vnd.vsf"], 45283 ["vss", "application/vnd.visio"], 45284 ["vst", "application/vnd.visio"], 45285 ["vsw", "application/vnd.visio"], 45286 ["vtf", "image/vnd.valve.source.texture"], 45287 ["vtt", "text/vtt"], 45288 ["vtu", "model/vnd.vtu"], 45289 ["vxml", "application/voicexml+xml"], 45290 ["w3d", "application/x-director"], 45291 ["wad", "application/x-doom"], 45292 ["wadl", "application/vnd.sun.wadl+xml"], 45293 ["war", "application/java-archive"], 45294 ["wasm", "application/wasm"], 45295 ["wav", "audio/x-wav"], 45296 ["wax", "audio/x-ms-wax"], 45297 ["wbmp", "image/vnd.wap.wbmp"], 45298 ["wbs", "application/vnd.criticaltools.wbs+xml"], 45299 ["wbxml", "application/wbxml"], 45300 ["wcm", "application/vnd.ms-works"], 45301 ["wdb", "application/vnd.ms-works"], 45302 ["wdp", "image/vnd.ms-photo"], 45303 ["weba", "audio/webm"], 45304 ["webapp", "application/x-web-app-manifest+json"], 45305 ["webm", "video/webm"], 45306 ["webmanifest", "application/manifest+json"], 45307 ["webp", "image/webp"], 45308 ["wg", "application/vnd.pmi.widget"], 45309 ["wgt", "application/widget"], 45310 ["wks", "application/vnd.ms-works"], 45311 ["wm", "video/x-ms-wm"], 45312 ["wma", "audio/x-ms-wma"], 45313 ["wmd", "application/x-ms-wmd"], 45314 ["wmf", "image/wmf"], 45315 ["wml", "text/vnd.wap.wml"], 45316 ["wmlc", "application/wmlc"], 45317 ["wmls", "text/vnd.wap.wmlscript"], 45318 ["wmlsc", "application/vnd.wap.wmlscriptc"], 45319 ["wmv", "video/x-ms-wmv"], 45320 ["wmx", "video/x-ms-wmx"], 45321 ["wmz", "application/x-msmetafile"], 45322 ["woff", "font/woff"], 45323 ["woff2", "font/woff2"], 45324 ["word", "application/msword"], 45325 ["wpd", "application/vnd.wordperfect"], 45326 ["wpl", "application/vnd.ms-wpl"], 45327 ["wps", "application/vnd.ms-works"], 45328 ["wqd", "application/vnd.wqd"], 45329 ["wri", "application/x-mswrite"], 45330 ["wrl", "model/vrml"], 45331 ["wsc", "message/vnd.wfa.wsc"], 45332 ["wsdl", "application/wsdl+xml"], 45333 ["wspolicy", "application/wspolicy+xml"], 45334 ["wtb", "application/vnd.webturbo"], 45335 ["wvx", "video/x-ms-wvx"], 45336 ["x3d", "model/x3d+xml"], 45337 ["x3db", "model/x3d+fastinfoset"], 45338 ["x3dbz", "model/x3d+binary"], 45339 ["x3dv", "model/x3d-vrml"], 45340 ["x3dvz", "model/x3d+vrml"], 45341 ["x3dz", "model/x3d+xml"], 45342 ["x32", "application/x-authorware-bin"], 45343 ["x_b", "model/vnd.parasolid.transmit.binary"], 45344 ["x_t", "model/vnd.parasolid.transmit.text"], 45345 ["xaml", "application/xaml+xml"], 45346 ["xap", "application/x-silverlight-app"], 45347 ["xar", "application/vnd.xara"], 45348 ["xav", "application/xcap-att+xml"], 45349 ["xbap", "application/x-ms-xbap"], 45350 ["xbd", "application/vnd.fujixerox.docuworks.binder"], 45351 ["xbm", "image/x-xbitmap"], 45352 ["xca", "application/xcap-caps+xml"], 45353 ["xcs", "application/calendar+xml"], 45354 ["xdf", "application/xcap-diff+xml"], 45355 ["xdm", "application/vnd.syncml.dm+xml"], 45356 ["xdp", "application/vnd.adobe.xdp+xml"], 45357 ["xdssc", "application/dssc+xml"], 45358 ["xdw", "application/vnd.fujixerox.docuworks"], 45359 ["xel", "application/xcap-el+xml"], 45360 ["xenc", "application/xenc+xml"], 45361 ["xer", "application/patch-ops-error+xml"], 45362 ["xfdf", "application/vnd.adobe.xfdf"], 45363 ["xfdl", "application/vnd.xfdl"], 45364 ["xht", "application/xhtml+xml"], 45365 ["xhtml", "application/xhtml+xml"], 45366 ["xhvml", "application/xv+xml"], 45367 ["xif", "image/vnd.xiff"], 45368 ["xl", "application/excel"],
45369 ["xla", "application/vnd.ms-excel"], 45370 ["xlam", "application/vnd.ms-excel.addin.macroEnabled.12"], 45371 ["xlc", "application/vnd.ms-excel"], 45372 ["xlf", "application/xliff+xml"], 45373 ["xlm", "application/vnd.ms-excel"], 45374 ["xls", "application/vnd.ms-excel"], 45375 ["xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"], 45376 ["xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"], 45377 ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], 45378 ["xlt", "application/vnd.ms-excel"], 45379 ["xltm", "application/vnd.ms-excel.template.macroEnabled.12"], 45380 ["xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"], 45381 ["xlw", "application/vnd.ms-excel"], 45382 ["xm", "audio/xm"], 45383 ["xml", "application/xml"], 45384 ["xns", "application/xcap-ns+xml"], 45385 ["xo", "application/vnd.olpc-sugar"], 45386 ["xop", "application/xop+xml"], 45387 ["xpi", "application/x-xpinstall"], 45388 ["xpl", "application/xproc+xml"], 45389 ["xpm", "image/x-xpixmap"], 45390 ["xpr", "application/vnd.is-xpr"], 45391 ["xps", "application/vnd.ms-xpsdocument"], 45392 ["xpw", "application/vnd.intercon.formnet"], 45393 ["xpx", "application/vnd.intercon.formnet"], 45394 ["xsd", "application/xml"], 45395 ["xsl", "application/xml"], 45396 ["xslt", "application/xslt+xml"], 45397 ["xsm", "application/vnd.syncml+xml"], 45398 ["xspf", "application/xspf+xml"], 45399 ["xul", "application/vnd.mozilla.xul+xml"], 45400 ["xvm", "application/xv+xml"], 45401 ["xvml", "application/xv+xml"], 45402 ["xwd", "image/x-xwindowdump"], 45403 ["xyz", "chemical/x-xyz"], 45404 ["xz", "application/x-xz"], 45405 ["yaml", "text/yaml"], 45406 ["yang", "application/yang"], 45407 ["yin", "application/yin+xml"], 45408 ["yml", "text/yaml"], 45409 ["ymp", "text/x-suse-ymp"], 45410 ["z", "application/x-compress"], 45411 ["z1", "application/x-zmachine"], 45412 ["z2", "application/x-zmachine"], 45413 ["z3", "application/x-zmachine"], 45414 ["z4", "application/x-zmachine"], 45415 ["z5", "application/x-zmachine"], 45416 ["z6", "application/x-zmachine"], 45417 ["z7", "application/x-zmachine"], 45418 ["z8", "application/x-zmachine"], 45419 ["zaz", "application/vnd.zzazz.deck+xml"], 45420 ["zip", "application/zip"], 45421 ["zir", "application/vnd.zul"], 45422 ["zirz", "application/vnd.zul"], 45423 ["zmm", "application/vnd.handheld-entertainment+xml"], 45424 ["zsh", "text/x-scriptzsh"] 45425 ]); 45426 function toFileWithPath(file, path, h2) { 45427 const f2 = withMimeType(file); 45428 const { webkitRelativePath } = file; 45429 const p2 = typeof path === "string" ? path : typeof webkitRelativePath === "string" && webkitRelativePath.length > 0 ? webkitRelativePath : `./${file.name}`; 45430 if (typeof f2.path !== "string") { 45431 setObjProp(f2, "path", p2); 45432 } 45433 setObjProp(f2, "relativePath", p2); 45434 return f2; 45435 } 45436 function withMimeType(file) { 45437 const { name } = file; 45438 const hasExtension = name && name.lastIndexOf(".") !== -1; 45439 if (hasExtension && !file.type) { 45440 const ext = name.split(".").pop().toLowerCase(); 45441 const type = COMMON_MIME_TYPES.get(ext); 45442 if (type) { 45443 Object.defineProperty(file, "type", { 45444 value: type, 45445 writable: false, 45446 configurable: false, 45447 enumerable: true 45448 }); 45449 } 45450 } 45451 return file; 45452 } 45453 function setObjProp(f2, key, value) { 45454 Object.defineProperty(f2, key, { 45455 value, 45456 writable: false, 45457 configurable: false, 45458 enumerable: true 45459 }); 45460 } 45461 const FILES_TO_IGNORE = [ 45462 // Thumbnail cache files for macOS and Windows 45463 ".DS_Store", 45464 // macOs 45465 "Thumbs.db" 45466 // Windows 45467 ]; 45468 function fromEvent(evt) { 45469 return __awaiter(this, void 0, void 0, function* () { 45470 if (isObject$1(evt) && isDataTransfer(evt.dataTransfer)) { 45471 return getDataTransferFiles(evt.dataTransfer, evt.type); 45472 } else if (isChangeEvt(evt)) { 45473 return getInputFiles(evt); 45474 } else if (Array.isArray(evt) && evt.every((item) => "getFile" in item && typeof item.getFile === "function")) { 45475 return getFsHandleFiles(evt); 45476 } 45477 return []; 45478 }); 45479 } 45480 function isDataTransfer(value) { 45481 return isObject$1(value); 45482 } 45483 function isChangeEvt(value) { 45484 return isObject$1(value) && isObject$1(value.target); 45485 } 45486 function isObject$1(v2) { 45487 return typeof v2 === "object" && v2 !== null; 45488 } 45489 function getInputFiles(evt) { 45490 return fromList(evt.target.files).map((file) => toFileWithPath(file)); 45491 } 45492 function getFsHandleFiles(handles) { 45493 return __awaiter(this, void 0, void 0, function* () { 45494 const files = yield Promise.all(handles.map((h2) => h2.getFile())); 45495 return files.map((file) => toFileWithPath(file)); 45496 }); 45497 } 45498 function getDataTransferFiles(dt2, type) { 45499 return __awaiter(this, void 0, void 0, function* () { 45500 if (dt2.items) { 45501 const items = fromList(dt2.items).filter((item) => item.kind === "file"); 45502 if (type !== "drop") { 45503 return items; 45504 } 45505 const files = yield Promise.all(items.map(toFilePromises)); 45506 return noIgnoredFiles(flatten(files)); 45507 } 45508 return noIgnoredFiles(fromList(dt2.files).map((file) => toFileWithPath(file))); 45509 }); 45510 } 45511 function noIgnoredFiles(files) { 45512 return files.filter((file) => FILES_TO_IGNORE.indexOf(file.name) === -1); 45513 } 45514 function fromList(items) { 45515 if (items === null) { 45516 return []; 45517 } 45518 const files = []; 45519 for (let i2 = 0; i2 < items.length; i2++) { 45520 const file = items[i2]; 45521 files.push(file); 45522 } 45523 return files; 45524 } 45525 function toFilePromises(item) { 45526 if (typeof item.webkitGetAsEntry !== "function") { 45527 return fromDataTransferItem(item); 45528 } 45529 const entry = item.webkitGetAsEntry(); 45530 if (entry && entry.isDirectory) { 45531 return fromDirEntry(entry); 45532 } 45533 return fromDataTransferItem(item, entry); 45534 } 45535 function flatten(items) { 45536 return items.reduce((acc, files) => [ 45537 ...acc, 45538 ...Array.isArray(files) ? flatten(files) : [files] 45539 ], []); 45540 } 45541 function fromDataTransferItem(item, entry) { 45542 return __awaiter(this, void 0, void 0, function* () { 45543 var _a; 45544 if (globalThis.isSecureContext && typeof item.getAsFileSystemHandle === "function") { 45545 const h2 = yield item.getAsFileSystemHandle(); 45546 if (h2 === null) { 45547 throw new Error(`${item} is not a File`); 45548 } 45549 if (h2 !== void 0) { 45550 const file2 = yield h2.getFile(); 45551 file2.handle = h2; 45552 return toFileWithPath(file2); 45553 } 45554 } 45555 const file = item.getAsFile(); 45556 if (!file) { 45557 throw new Error(`${item} is not a File`); 45558 } 45559 const fwp = toFileWithPath(file, (_a = entry === null || entry === void 0 ? void 0 : entry.fullPath) !== null && _a !== void 0 ? _a : void 0); 45560 return fwp; 45561 }); 45562 }
45563 function fromEntry(entry) { 45564 return __awaiter(this, void 0, void 0, function* () { 45565 return entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry); 45566 }); 45567 } 45568 function fromDirEntry(entry) { 45569 const reader = entry.createReader(); 45570 return new Promise((resolve, reject) => { 45571 const entries2 = []; 45572 function readEntries() { 45573 reader.readEntries((batch) => __awaiter(this, void 0, void 0, function* () { 45574 if (!batch.length) { 45575 try { 45576 const files = yield Promise.all(entries2); 45577 resolve(files); 45578 } catch (err) { 45579 reject(err); 45580 } 45581 } else { 45582 const items = Promise.all(batch.map(fromEntry)); 45583 entries2.push(items); 45584 readEntries(); 45585 } 45586 }), (err) => { 45587 reject(err); 45588 }); 45589 } 45590 readEntries(); 45591 }); 45592 } 45593 function fromFileEntry(entry) { 45594 return __awaiter(this, void 0, void 0, function* () { 45595 return new Promise((resolve, reject) => { 45596 entry.file((file) => { 45597 const fwp = toFileWithPath(file, entry.fullPath); 45598 resolve(fwp); 45599 }, (err) => { 45600 reject(err); 45601 }); 45602 }); 45603 }); 45604 } 45605 var es = {}; 45606 var hasRequiredEs; 45607 function requireEs() { 45608 if (hasRequiredEs) return es; 45609 hasRequiredEs = 1; 45610 es.__esModule = true; 45611 es.default = function(file, acceptedFiles) { 45612 if (file && acceptedFiles) { 45613 var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(","); 45614 if (acceptedFilesArray.length === 0) { 45615 return true; 45616 } 45617 var fileName = file.name || ""; 45618 var mimeType = (file.type || "").toLowerCase(); 45619 var baseMimeType = mimeType.replace(/\/.*$/, ""); 45620 return acceptedFilesArray.some(function(type) { 45621 var validType = type.trim().toLowerCase(); 45622 if (validType.charAt(0) === ".") { 45623 return fileName.toLowerCase().endsWith(validType); 45624 } else if (validType.endsWith("/*")) { 45625 return baseMimeType === validType.replace(/\/.*$/, ""); 45626 } 45627 return mimeType === validType; 45628 }); 45629 } 45630 return true; 45631 }; 45632 return es; 45633 } 45634 var esExports = requireEs(); 45635 const _accepts = /* @__PURE__ */ getDefaultExportFromCjs(esExports); 45636 function _toConsumableArray$1(arr) { 45637 return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); 45638 } 45639 function _nonIterableSpread$1() { 45640 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45641 } 45642 function _iterableToArray$1(iter) { 45643 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 45644 } 45645 function _arrayWithoutHoles$1(arr) { 45646 if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); 45647 } 45648 function ownKeys$1(object2, enumerableOnly) { 45649 var keys2 = Object.keys(object2); 45650 if (Object.getOwnPropertySymbols) { 45651 var symbols = Object.getOwnPropertySymbols(object2); 45652 enumerableOnly && (symbols = symbols.filter(function(sym) { 45653 return Object.getOwnPropertyDescriptor(object2, sym).enumerable; 45654 })), keys2.push.apply(keys2, symbols); 45655 } 45656 return keys2; 45657 } 45658 function _objectSpread$1(target) { 45659 for (var i2 = 1; i2 < arguments.length; i2++) { 45660 var source = null != arguments[i2] ? arguments[i2] : {}; 45661 i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) { 45662 _defineProperty$1(target, key, source[key]); 45663 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) { 45664 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 45665 }); 45666 } 45667 return target; 45668 } 45669 function _defineProperty$1(obj, key, value) { 45670 if (key in obj) { 45671 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 45672 } else { 45673 obj[key] = value; 45674 } 45675 return obj; 45676 } 45677 function _slicedToArray$1(arr, i2) { 45678 return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$1(arr, i2) || _nonIterableRest$1(); 45679 } 45680 function _nonIterableRest$1() {
45681 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45682 } 45683 function _unsupportedIterableToArray$1(o2, minLen) { 45684 if (!o2) return; 45685 if (typeof o2 === "string") return _arrayLikeToArray$1(o2, minLen); 45686 var n2 = Object.prototype.toString.call(o2).slice(8, -1); 45687 if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; 45688 if (n2 === "Map" || n2 === "Set") return Array.from(o2); 45689 if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$1(o2, minLen); 45690 } 45691 function _arrayLikeToArray$1(arr, len) { 45692 if (len == null || len > arr.length) len = arr.length; 45693 for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { 45694 arr2[i2] = arr[i2]; 45695 } 45696 return arr2; 45697 } 45698 function _iterableToArrayLimit$1(arr, i2) { 45699 var _i2 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; 45700 if (_i2 == null) return; 45701 var _arr = []; 45702 var _n2 = true; 45703 var _d = false; 45704 var _s, _e2; 45705 try { 45706 for (_i2 = _i2.call(arr); !(_n2 = (_s = _i2.next()).done); _n2 = true) { 45707 _arr.push(_s.value); 45708 if (i2 && _arr.length === i2) break; 45709 } 45710 } catch (err) { 45711 _d = true; 45712 _e2 = err; 45713 } finally { 45714 try { 45715 if (!_n2 && _i2["return"] != null) _i2["return"](); 45716 } finally { 45717 if (_d) throw _e2; 45718 } 45719 } 45720 return _arr; 45721 } 45722 function _arrayWithHoles$1(arr) { 45723 if (Array.isArray(arr)) return arr; 45724 } 45725 var accepts = typeof _accepts === "function" ? _accepts : _accepts.default; 45726 var FILE_INVALID_TYPE = "file-invalid-type"; 45727 var FILE_TOO_LARGE = "file-too-large"; 45728 var FILE_TOO_SMALL = "file-too-small"; 45729 var TOO_MANY_FILES = "too-many-files"; 45730 var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr2() { 45731 var accept = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; 45732 var acceptArr = accept.split(","); 45733 var msg = acceptArr.length > 1 ? "one of ".concat(acceptArr.join(", ")) : acceptArr[0]; 45734 return { 45735 code: FILE_INVALID_TYPE, 45736 message: "File type must be ".concat(msg) 45737 }; 45738 }; 45739 var getTooLargeRejectionErr = function getTooLargeRejectionErr2(maxSize) { 45740 return { 45741 code: FILE_TOO_LARGE, 45742 message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes") 45743 }; 45744 }; 45745 var getTooSmallRejectionErr = function getTooSmallRejectionErr2(minSize) { 45746 return { 45747 code: FILE_TOO_SMALL, 45748 message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes") 45749 }; 45750 }; 45751 var TOO_MANY_FILES_REJECTION = { 45752 code: TOO_MANY_FILES, 45753 message: "Too many files" 45754 }; 45755 function fileAccepted(file, accept) { 45756 var isAcceptable = file.type === "application/x-moz-file" || accepts(file, accept); 45757 return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)]; 45758 } 45759 function fileMatchSize(file, minSize, maxSize) { 45760 if (isDefined(file.size)) { 45761 if (isDefined(minSize) && isDefined(maxSize)) { 45762 if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)]; 45763 if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)]; 45764 } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)]; 45765 else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)]; 45766 } 45767 return [true, null]; 45768 } 45769 function isDefined(value) { 45770 return value !== void 0 && value !== null; 45771 } 45772 function allFilesAccepted(_ref2) { 45773 var files = _ref2.files, accept = _ref2.accept, minSize = _ref2.minSize, maxSize = _ref2.maxSize, multiple = _ref2.multiple, maxFiles = _ref2.maxFiles, validator2 = _ref2.validator; 45774 if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) { 45775 return false;
45776 } 45777 return files.every(function(file) { 45778 var _fileAccepted = fileAccepted(file, accept), _fileAccepted2 = _slicedToArray$1(_fileAccepted, 1), accepted = _fileAccepted2[0]; 45779 var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 1), sizeMatch = _fileMatchSize2[0]; 45780 var customErrors = validator2 ? validator2(file) : null; 45781 return accepted && sizeMatch && !customErrors; 45782 }); 45783 } 45784 function isPropagationStopped(event) { 45785 if (typeof event.isPropagationStopped === "function") { 45786 return event.isPropagationStopped(); 45787 } else if (typeof event.cancelBubble !== "undefined") { 45788 return event.cancelBubble; 45789 } 45790 return false; 45791 } 45792 function isEvtWithFiles(event) { 45793 if (!event.dataTransfer) { 45794 return !!event.target && !!event.target.files; 45795 } 45796 return Array.prototype.some.call(event.dataTransfer.types, function(type) { 45797 return type === "Files" || type === "application/x-moz-file"; 45798 }); 45799 } 45800 function onDocumentDragOver(event) { 45801 event.preventDefault(); 45802 } 45803 function isIe(userAgent) { 45804 return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1; 45805 } 45806 function isEdge(userAgent) { 45807 return userAgent.indexOf("Edge/") !== -1; 45808 } 45809 function isIeOrEdge() { 45810 var userAgent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent; 45811 return isIe(userAgent) || isEdge(userAgent); 45812 } 45813 function composeEventHandlers() { 45814 for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { 45815 fns[_key] = arguments[_key]; 45816 } 45817 return function(event) { 45818 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 45819 args[_key2 - 1] = arguments[_key2]; 45820 } 45821 return fns.some(function(fn2) { 45822 if (!isPropagationStopped(event) && fn2) { 45823 fn2.apply(void 0, [event].concat(args)); 45824 } 45825 return isPropagationStopped(event); 45826 }); 45827 }; 45828 } 45829 function canUseFileSystemAccessAPI() { 45830 return "showOpenFilePicker" in window; 45831 } 45832 function pickerOptionsFromAccept(accept) { 45833 if (isDefined(accept)) { 45834 var acceptForPicker = Object.entries(accept).filter(function(_ref2) { 45835 var _ref3 = _slicedToArray$1(_ref2, 2), mimeType = _ref3[0], ext = _ref3[1]; 45836 var ok = true; 45837 if (!isMIMEType(mimeType)) { 45838 console.warn('Skipped "'.concat(mimeType, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')); 45839 ok = false; 45840 } 45841 if (!Array.isArray(ext) || !ext.every(isExt)) { 45842 console.warn('Skipped "'.concat(mimeType, '" because an invalid file extension was provided.')); 45843 ok = false; 45844 } 45845 return ok; 45846 }).reduce(function(agg, _ref4) { 45847 var _ref5 = _slicedToArray$1(_ref4, 2), mimeType = _ref5[0], ext = _ref5[1]; 45848 return _objectSpread$1(_objectSpread$1({}, agg), {}, _defineProperty$1({}, mimeType, ext)); 45849 }, {}); 45850 return [{ 45851 // description is required due to https://crbug.com/1264708 45852 description: "Files", 45853 accept: acceptForPicker 45854 }]; 45855 } 45856 return accept; 45857 } 45858 function acceptPropAsAcceptAttr(accept) { 45859 if (isDefined(accept)) { 45860 return Object.entries(accept).reduce(function(a2, _ref6) { 45861 var _ref7 = _slicedToArray$1(_ref6, 2), mimeType = _ref7[0], ext = _ref7[1]; 45862 return [].concat(_toConsumableArray$1(a2), [mimeType], _toConsumableArray$1(ext)); 45863 }, []).filter(function(v2) { 45864 return isMIMEType(v2) || isExt(v2); 45865 }).join(","); 45866 } 45867 return void 0; 45868 } 45869 function isAbort(v2) { 45870 return v2 instanceof DOMException && (v2.name === "AbortError" || v2.code === v2.ABORT_ERR); 45871 } 45872 function isSecurityError(v2) { 45873 return v2 instanceof DOMException && (v2.name === "SecurityError" || v2.code === v2.SECURITY_ERR); 45874 } 45875 function isMIMEType(v2) { 45876 return v2 === "audio/*" || v2 === "video/*" || v2 === "image/*" || v2 === "text/*" || v2 === "application/*" || /\w+\/[-+.\w]+/g.test(v2); 45877 } 45878 function isExt(v2) { 45879 return /^.*\.[\w]+$/.test(v2); 45880 } 45881 var _excluded = ["children"], _excluded2 = ["open"], _excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], _excluded4 = ["refKey", "onChange", "onClick"]; 45882 function _toConsumableArray(arr) { 45883 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); 45884 } 45885 function _nonIterableSpread() { 45886 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45887 } 45888 function _iterableToArray(iter) { 45889 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 45890 } 45891 function _arrayWithoutHoles(arr) { 45892 if (Array.isArray(arr)) return _arrayLikeToArray(arr); 45893 } 45894 function _slicedToArray(arr, i2) { 45895 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest(); 45896 } 45897 function _nonIterableRest() {
45898 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 45899 } 45900 function _unsupportedIterableToArray(o2, minLen) { 45901 if (!o2) return; 45902 if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); 45903 var n2 = Object.prototype.toString.call(o2).slice(8, -1); 45904 if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name; 45905 if (n2 === "Map" || n2 === "Set") return Array.from(o2); 45906 if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen); 45907 } 45908 function _arrayLikeToArray(arr, len) { 45909 if (len == null || len > arr.length) len = arr.length; 45910 for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) { 45911 arr2[i2] = arr[i2]; 45912 } 45913 return arr2; 45914 } 45915 function _iterableToArrayLimit(arr, i2) { 45916 var _i2 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; 45917 if (_i2 == null) return; 45918 var _arr = []; 45919 var _n2 = true; 45920 var _d = false; 45921 var _s, _e2; 45922 try { 45923 for (_i2 = _i2.call(arr); !(_n2 = (_s = _i2.next()).done); _n2 = true) { 45924 _arr.push(_s.value); 45925 if (i2 && _arr.length === i2) break; 45926 } 45927 } catch (err) { 45928 _d = true; 45929 _e2 = err; 45930 } finally { 45931 try { 45932 if (!_n2 && _i2["return"] != null) _i2["return"](); 45933 } finally { 45934 if (_d) throw _e2; 45935 } 45936 } 45937 return _arr; 45938 } 45939 function _arrayWithHoles(arr) { 45940 if (Array.isArray(arr)) return arr; 45941 } 45942 function ownKeys(object2, enumerableOnly) { 45943 var keys2 = Object.keys(object2); 45944 if (Object.getOwnPropertySymbols) { 45945 var symbols = Object.getOwnPropertySymbols(object2); 45946 enumerableOnly && (symbols = symbols.filter(function(sym) { 45947 return Object.getOwnPropertyDescriptor(object2, sym).enumerable; 45948 })), keys2.push.apply(keys2, symbols); 45949 } 45950 return keys2; 45951 } 45952 function _objectSpread(target) { 45953 for (var i2 = 1; i2 < arguments.length; i2++) { 45954 var source = null != arguments[i2] ? arguments[i2] : {}; 45955 i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { 45956 _defineProperty(target, key, source[key]); 45957 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { 45958 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 45959 }); 45960 } 45961 return target; 45962 } 45963 function _defineProperty(obj, key, value) { 45964 if (key in obj) { 45965 Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); 45966 } else { 45967 obj[key] = value; 45968 } 45969 return obj; 45970 } 45971 function _objectWithoutProperties(source, excluded) { 45972 if (source == null) return {}; 45973 var target = _objectWithoutPropertiesLoose$1(source, excluded); 45974 var key, i2; 45975 if (Object.getOwnPropertySymbols) { 45976 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 45977 for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) { 45978 key = sourceSymbolKeys[i2]; 45979 if (excluded.indexOf(key) >= 0) continue; 45980 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 45981 target[key] = source[key]; 45982 } 45983 } 45984 return target; 45985 } 45986 function _objectWithoutPropertiesLoose$1(source, excluded) { 45987 if (source == null) return {}; 45988 var target = {}; 45989 var sourceKeys = Object.keys(source); 45990 var key, i2; 45991 for (i2 = 0; i2 < sourceKeys.length; i2++) { 45992 key = sourceKeys[i2]; 45993 if (excluded.indexOf(key) >= 0) continue; 45994 target[key] = source[key]; 45995 } 45996 return target; 45997 } 45998 var Dropzone = /* @__PURE__ */ reactExports.forwardRef(function(_ref2, ref) { 45999 var children = _ref2.children, params = _objectWithoutProperties(_ref2, _excluded); 46000 var _useDropzone = useDropzone(params), open = _useDropzone.open, props = _objectWithoutProperties(_useDropzone, _excluded2); 46001 reactExports.useImperativeHandle(ref, function() { 46002 return { 46003 open 46004 }; 46005 }, [open]); 46006 return /* @__PURE__ */ e$3.createElement(reactExports.Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, { 46007 open 46008 }))); 46009 }); 46010 Dropzone.displayName = "Dropzone"; 46011 var defaultProps = { 46012 disabled: false, 46013 getFilesFromEvent: fromEvent, 46014 maxSize: Infinity, 46015 minSize: 0, 46016 multiple: true, 46017 maxFiles: 0, 46018 preventDropOnDocument: true, 46019 noClick: false, 46020 noKeyboard: false, 46021 noDrag: false, 46022 noDragEventsBubbling: false, 46023 validator: null, 46024 useFsAccessApi: false, 46025 autoFocus: false 46026 }; 46027 Dropzone.defaultProps = defaultProps; 46028 Dropzone.propTypes = { 46029 /**
46030 * Render function that exposes the dropzone state and prop getter fns 46031 * 46032 * @param {object} params 46033 * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render 46034 * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render 46035 * @param {Function} params.open Open the native file selection dialog 46036 * @param {boolean} params.isFocused Dropzone area is in focus 46037 * @param {boolean} params.isFileDialogActive File dialog is opened 46038 * @param {boolean} params.isDragActive Active drag is in progress 46039 * @param {boolean} params.isDragAccept Dragged files are accepted 46040 * @param {boolean} params.isDragReject Some dragged files are rejected 46041 * @param {File[]} params.acceptedFiles Accepted files 46042 * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected 46043 */ 46044 children: PropTypes.func, 46045 /** 46046 * Set accepted file types. 46047 * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information. 46048 * Keep in mind that mime type determination is not reliable across platforms. CSV files, 46049 * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under 46050 * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276). 46051 */ 46052 accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)), 46053 /** 46054 * Allow drag 'n' drop (or selection from the file dialog) of multiple files 46055 */ 46056 multiple: PropTypes.bool, 46057 /** 46058 * If false, allow dropped items to take over the current browser window 46059 */ 46060 preventDropOnDocument: PropTypes.bool, 46061 /** 46062 * If true, disables click to open the native file selection dialog 46063 */ 46064 noClick: PropTypes.bool, 46065 /** 46066 * If true, disables SPACE/ENTER to open the native file selection dialog. 46067 * Note that it also stops tracking the focus state. 46068 */ 46069 noKeyboard: PropTypes.bool, 46070 /** 46071 * If true, disables drag 'n' drop 46072 */ 46073 noDrag: PropTypes.bool, 46074 /** 46075 * If true, stops drag event propagation to parents 46076 */ 46077 noDragEventsBubbling: PropTypes.bool, 46078 /** 46079 * Minimum file size (in bytes) 46080 */ 46081 minSize: PropTypes.number, 46082 /** 46083 * Maximum file size (in bytes) 46084 */ 46085 maxSize: PropTypes.number, 46086 /** 46087 * Maximum accepted number of files 46088 * The default value is 0 which means there is no limitation to how many files are accepted. 46089 */ 46090 maxFiles: PropTypes.number, 46091 /** 46092 * Enable/disable the dropzone 46093 */ 46094 disabled: PropTypes.bool, 46095 /** 46096 * Use this to provide a custom file aggregator 46097 * 46098 * @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog) 46099 */ 46100 getFilesFromEvent: PropTypes.func, 46101 /** 46102 * Cb for when closing the file dialog with no selection 46103 */ 46104 onFileDialogCancel: PropTypes.func, 46105 /** 46106 * Cb for when opening the file dialog 46107 */ 46108 onFileDialogOpen: PropTypes.func, 46109 /** 46110 * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API 46111 * to open the file picker instead of using an `<input type="file">` click event. 46112 */ 46113 useFsAccessApi: PropTypes.bool, 46114 /** 46115 * Set to true to focus the root element on render 46116 */ 46117 autoFocus: PropTypes.bool, 46118 /** 46119 * Cb for when the `dragenter` event occurs. 46120 * 46121 * @param {DragEvent} event 46122 */ 46123 onDragEnter: PropTypes.func, 46124 /** 46125 * Cb for when the `dragleave` event occurs 46126 * 46127 * @param {DragEvent} event 46128 */ 46129 onDragLeave: PropTypes.func, 46130 /** 46131 * Cb for when the `dragover` event occurs 46132 * 46133 * @param {DragEvent} event 46134 */ 46135 onDragOver: PropTypes.func, 46136 /** 46137 * Cb for when the `drop` event occurs. 46138 * Note that this callback is invoked after the `getFilesFromEvent` callback is done. 46139 * 46140 * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props. 46141 * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension. 46142 * If `multiple` is set to false and additional files are dropped, 46143 * all files besides the first will be rejected. 46144 * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well. 46145 * 46146 * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
46147 * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props. 46148 * 46149 * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server. 46150 * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library: 46151 * 46152 * ```js 46153 * function onDrop(acceptedFiles) { 46154 * const req = request.post('/upload') 46155 * acceptedFiles.forEach(file => { 46156 * req.attach(file.name, file) 46157 * }) 46158 * req.end(callback) 46159 * } 46160 * ``` 46161 * 46162 * @param {File[]} acceptedFiles 46163 * @param {FileRejection[]} fileRejections 46164 * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog) 46165 */ 46166 onDrop: PropTypes.func, 46167 /** 46168 * Cb for when the `drop` event occurs. 46169 * Note that if no files are accepted, this callback is not invoked. 46170 * 46171 * @param {File[]} files 46172 * @param {(DragEvent|Event)} event 46173 */ 46174 onDropAccepted: PropTypes.func, 46175 /** 46176 * Cb for when the `drop` event occurs. 46177 * Note that if no files are rejected, this callback is not invoked. 46178 * 46179 * @param {FileRejection[]} fileRejections 46180 * @param {(DragEvent|Event)} event 46181 */ 46182 onDropRejected: PropTypes.func, 46183 /** 46184 * Cb for when there's some error from any of the promises. 46185 * 46186 * @param {Error} error 46187 */ 46188 onError: PropTypes.func, 46189 /** 46190 * Custom validation function. It must return null if there's no errors. 46191 * @param {File} file 46192 * @returns {FileError|FileError[]|null} 46193 */ 46194 validator: PropTypes.func 46195 }; 46196 var initialState = { 46197 isFocused: false, 46198 isFileDialogActive: false, 46199 isDragActive: false, 46200 isDragAccept: false, 46201 isDragReject: false, 46202 acceptedFiles: [], 46203 fileRejections: [] 46204 }; 46205 function useDropzone() { 46206 var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 46207 var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), accept = _defaultProps$props.accept, disabled = _defaultProps$props.disabled, getFilesFromEvent = _defaultProps$props.getFilesFromEvent, maxSize = _defaultProps$props.maxSize, minSize = _defaultProps$props.minSize, multiple = _defaultProps$props.multiple, maxFiles = _defaultProps$props.maxFiles, onDragEnter = _defaultProps$props.onDragEnter, onDragLeave = _defaultProps$props.onDragLeave, onDragOver = _defaultProps$props.onDragOver, onDrop = _defaultProps$props.onDrop, onDropAccepted = _defaultProps$props.onDropAccepted, onDropRejected = _defaultProps$props.onDropRejected, onFileDialogCancel = _defaultProps$props.onFileDialogCancel, onFileDialogOpen = _defaultProps$props.onFileDialogOpen, useFsAccessApi = _defaultProps$props.useFsAccessApi, autoFocus = _defaultProps$props.autoFocus, preventDropOnDocument = _defaultProps$props.preventDropOnDocument, noClick = _defaultProps$props.noClick, noKeyboard = _defaultProps$props.noKeyboard, noDrag = _defaultProps$props.noDrag, noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling, onError = _defaultProps$props.onError, validator2 = _defaultProps$props.validator; 46208 var acceptAttr = reactExports.useMemo(function() { 46209 return acceptPropAsAcceptAttr(accept); 46210 }, [accept]); 46211 var pickerTypes = reactExports.useMemo(function() { 46212 return pickerOptionsFromAccept(accept); 46213 }, [accept]); 46214 var onFileDialogOpenCb = reactExports.useMemo(function() { 46215 return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop$2; 46216 }, [onFileDialogOpen]); 46217 var onFileDialogCancelCb = reactExports.useMemo(function() { 46218 return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop$2; 46219 }, [onFileDialogCancel]); 46220 var rootRef = reactExports.useRef(null); 46221 var inputRef = reactExports.useRef(null); 46222 var _useReducer = reactExports.useReducer(reducer, initialState), _useReducer2 = _slicedToArray(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; 46223 var isFocused = state.isFocused, isFileDialogActive = state.isFileDialogActive; 46224 var fsAccessApiWorksRef = reactExports.useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); 46225 var onWindowFocus = function onWindowFocus2() { 46226 if (!fsAccessApiWorksRef.current && isFileDialogActive) { 46227 setTimeout(function() { 46228 if (inputRef.current) { 46229 var files = inputRef.current.files; 46230 if (!files.length) { 46231 dispatch({ 46232 type: "closeDialog" 46233 }); 46234 onFileDialogCancelCb(); 46235 } 46236 } 46237 }, 300); 46238 } 46239 }; 46240 reactExports.useEffect(function() { 46241 window.addEventListener("focus", onWindowFocus, false); 46242 return function() { 46243 window.removeEventListener("focus", onWindowFocus, false); 46244 }; 46245 }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]); 46246 var dragTargetsRef = reactExports.useRef([]); 46247 var onDocumentDrop = function onDocumentDrop2(event) { 46248 if (rootRef.current && rootRef.current.contains(event.target)) { 46249 return; 46250 } 46251 event.preventDefault(); 46252 dragTargetsRef.current = []; 46253 }; 46254 reactExports.useEffect(function() { 46255 if (preventDropOnDocument) { 46256 document.addEventListener("dragover", onDocumentDragOver, false); 46257 document.addEventListener("drop", onDocumentDrop, false); 46258 } 46259 return function() { 46260 if (preventDropOnDocument) { 46261 document.removeEventListener("dragover", onDocumentDragOver); 46262 document.removeEventListener("drop", onDocumentDrop); 46263 } 46264 }; 46265 }, [rootRef, preventDropOnDocument]); 46266 reactExports.useEffect(function() { 46267 if (!disabled && autoFocus && rootRef.current) { 46268 rootRef.current.focus(); 46269 } 46270 return function() { 46271 }; 46272 }, [rootRef, autoFocus, disabled]); 46273 var onErrCb = reactExports.useCallback(function(e2) { 46274 if (onError) { 46275 onError(e2); 46276 } else { 46277 console.error(e2); 46278 } 46279 }, [onError]); 46280 var onDragEnterCb = reactExports.useCallback(function(event) { 46281 event.preventDefault(); 46282 event.persist(); 46283 stopPropagation(event); 46284 dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]); 46285 if (isEvtWithFiles(event)) { 46286 Promise.resolve(getFilesFromEvent(event)).then(function(files) { 46287 if (isPropagationStopped(event) && !noDragEventsBubbling) { 46288 return; 46289 } 46290 var fileCount = files.length; 46291 var isDragAccept = fileCount > 0 && allFilesAccepted({ 46292 files, 46293 accept: acceptAttr, 46294 minSize, 46295 maxSize, 46296 multiple, 46297 maxFiles, 46298 validator: validator2 46299 }); 46300 var isDragReject = fileCount > 0 && !isDragAccept; 46301 dispatch({ 46302 isDragAccept, 46303 isDragReject, 46304 isDragActive: true, 46305 type: "setDraggedFiles" 46306 }); 46307 if (onDragEnter) { 46308 onDragEnter(event); 46309 } 46310 }).catch(function(e2) { 46311 return onErrCb(e2); 46312 }); 46313 } 46314 }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator2]); 46315 var onDragOverCb = reactExports.useCallback(function(event) { 46316 event.preventDefault(); 46317 event.persist(); 46318 stopPropagation(event); 46319 var hasFiles = isEvtWithFiles(event); 46320 if (hasFiles && event.dataTransfer) { 46321 try { 46322 event.dataTransfer.dropEffect = "copy"; 46323 } catch (_unused) { 46324 } 46325 } 46326 if (hasFiles && onDragOver) { 46327 onDragOver(event); 46328 } 46329 return false;
46330 }, [onDragOver, noDragEventsBubbling]); 46331 var onDragLeaveCb = reactExports.useCallback(function(event) { 46332 event.preventDefault(); 46333 event.persist(); 46334 stopPropagation(event); 46335 var targets = dragTargetsRef.current.filter(function(target) { 46336 return rootRef.current && rootRef.current.contains(target); 46337 }); 46338 var targetIdx = targets.indexOf(event.target); 46339 if (targetIdx !== -1) { 46340 targets.splice(targetIdx, 1); 46341 } 46342 dragTargetsRef.current = targets; 46343 if (targets.length > 0) { 46344 return; 46345 } 46346 dispatch({ 46347 type: "setDraggedFiles", 46348 isDragActive: false, 46349 isDragAccept: false, 46350 isDragReject: false 46351 }); 46352 if (isEvtWithFiles(event) && onDragLeave) { 46353 onDragLeave(event); 46354 } 46355 }, [rootRef, onDragLeave, noDragEventsBubbling]); 46356 var setFiles = reactExports.useCallback(function(files, event) { 46357 var acceptedFiles = []; 46358 var fileRejections = []; 46359 files.forEach(function(file) { 46360 var _fileAccepted = fileAccepted(file, acceptAttr), _fileAccepted2 = _slicedToArray(_fileAccepted, 2), accepted = _fileAccepted2[0], acceptError = _fileAccepted2[1]; 46361 var _fileMatchSize = fileMatchSize(file, minSize, maxSize), _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2), sizeMatch = _fileMatchSize2[0], sizeError = _fileMatchSize2[1]; 46362 var customErrors = validator2 ? validator2(file) : null; 46363 if (accepted && sizeMatch && !customErrors) { 46364 acceptedFiles.push(file); 46365 } else { 46366 var errors = [acceptError, sizeError]; 46367 if (customErrors) { 46368 errors = errors.concat(customErrors); 46369 } 46370 fileRejections.push({ 46371 file, 46372 errors: errors.filter(function(e2) { 46373 return e2; 46374 }) 46375 }); 46376 } 46377 }); 46378 if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) { 46379 acceptedFiles.forEach(function(file) { 46380 fileRejections.push({ 46381 file, 46382 errors: [TOO_MANY_FILES_REJECTION] 46383 }); 46384 }); 46385 acceptedFiles.splice(0); 46386 } 46387 dispatch({ 46388 acceptedFiles, 46389 fileRejections, 46390 isDragReject: fileRejections.length > 0, 46391 type: "setFiles" 46392 }); 46393 if (onDrop) { 46394 onDrop(acceptedFiles, fileRejections, event); 46395 } 46396 if (fileRejections.length > 0 && onDropRejected) { 46397 onDropRejected(fileRejections, event); 46398 } 46399 if (acceptedFiles.length > 0 && onDropAccepted) { 46400 onDropAccepted(acceptedFiles, event); 46401 } 46402 }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator2]); 46403 var onDropCb = reactExports.useCallback(function(event) { 46404 event.preventDefault(); 46405 event.persist(); 46406 stopPropagation(event); 46407 dragTargetsRef.current = []; 46408 if (isEvtWithFiles(event)) { 46409 Promise.resolve(getFilesFromEvent(event)).then(function(files) { 46410 if (isPropagationStopped(event) && !noDragEventsBubbling) { 46411 return; 46412 } 46413 setFiles(files, event); 46414 }).catch(function(e2) { 46415 return onErrCb(e2); 46416 }); 46417 } 46418 dispatch({ 46419 type: "reset" 46420 }); 46421 }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); 46422 var openFileDialog = reactExports.useCallback(function() { 46423 if (fsAccessApiWorksRef.current) { 46424 dispatch({ 46425 type: "openDialog" 46426 }); 46427 onFileDialogOpenCb(); 46428 var opts = { 46429 multiple, 46430 types: pickerTypes 46431 }; 46432 window.showOpenFilePicker(opts).then(function(handles) { 46433 return getFilesFromEvent(handles); 46434 }).then(function(files) { 46435 setFiles(files, null); 46436 dispatch({ 46437 type: "closeDialog" 46438 }); 46439 }).catch(function(e2) { 46440 if (isAbort(e2)) { 46441 onFileDialogCancelCb(e2); 46442 dispatch({ 46443 type: "closeDialog" 46444 }); 46445 } else if (isSecurityError(e2)) { 46446 fsAccessApiWorksRef.current = false;
46447 if (inputRef.current) { 46448 inputRef.current.value = null; 46449 inputRef.current.click(); 46450 } else { 46451 onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.")); 46452 } 46453 } else { 46454 onErrCb(e2); 46455 } 46456 }); 46457 return; 46458 } 46459 if (inputRef.current) { 46460 dispatch({ 46461 type: "openDialog" 46462 }); 46463 onFileDialogOpenCb(); 46464 inputRef.current.value = null; 46465 inputRef.current.click(); 46466 } 46467 }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); 46468 var onKeyDownCb = reactExports.useCallback(function(event) { 46469 if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) { 46470 return; 46471 } 46472 if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) { 46473 event.preventDefault(); 46474 openFileDialog(); 46475 } 46476 }, [rootRef, openFileDialog]); 46477 var onFocusCb = reactExports.useCallback(function() { 46478 dispatch({ 46479 type: "focus" 46480 }); 46481 }, []); 46482 var onBlurCb = reactExports.useCallback(function() { 46483 dispatch({ 46484 type: "blur" 46485 }); 46486 }, []); 46487 var onClickCb = reactExports.useCallback(function() { 46488 if (noClick) { 46489 return; 46490 } 46491 if (isIeOrEdge()) { 46492 setTimeout(openFileDialog, 0); 46493 } else { 46494 openFileDialog(); 46495 } 46496 }, [noClick, openFileDialog]); 46497 var composeHandler = function composeHandler2(fn2) { 46498 return disabled ? null : fn2; 46499 }; 46500 var composeKeyboardHandler = function composeKeyboardHandler2(fn2) { 46501 return noKeyboard ? null : composeHandler(fn2); 46502 }; 46503 var composeDragHandler = function composeDragHandler2(fn2) { 46504 return noDrag ? null : composeHandler(fn2); 46505 }; 46506 var stopPropagation = function stopPropagation2(event) { 46507 if (noDragEventsBubbling) { 46508 event.stopPropagation(); 46509 } 46510 }; 46511 var getRootProps = reactExports.useMemo(function() { 46512 return function() { 46513 var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref2$refKey = _ref2.refKey, refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey, role = _ref2.role, onKeyDown = _ref2.onKeyDown, onFocus = _ref2.onFocus, onBlur = _ref2.onBlur, onClick = _ref2.onClick, onDragEnter2 = _ref2.onDragEnter, onDragOver2 = _ref2.onDragOver, onDragLeave2 = _ref2.onDragLeave, onDrop2 = _ref2.onDrop, rest = _objectWithoutProperties(_ref2, _excluded3); 46514 return _objectSpread(_objectSpread(_defineProperty({ 46515 onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)), 46516 onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)), 46517 onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)), 46518 onClick: composeHandler(composeEventHandlers(onClick, onClickCb)), 46519 onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter2, onDragEnterCb)), 46520 onDragOver: composeDragHandler(composeEventHandlers(onDragOver2, onDragOverCb)), 46521 onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave2, onDragLeaveCb)), 46522 onDrop: composeDragHandler(composeEventHandlers(onDrop2, onDropCb)), 46523 role: typeof role === "string" && role !== "" ? role : "presentation" 46524 }, refKey, rootRef), !disabled && !noKeyboard ? { 46525 tabIndex: 0 46526 } : {}), rest); 46527 }; 46528 }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]); 46529 var onInputElementClick = reactExports.useCallback(function(event) { 46530 event.stopPropagation(); 46531 }, []); 46532 var getInputProps = reactExports.useMemo(function() { 46533 return function() { 46534 var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref3$refKey = _ref3.refKey, refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey, onChange = _ref3.onChange, onClick = _ref3.onClick, rest = _objectWithoutProperties(_ref3, _excluded4); 46535 var inputProps = _defineProperty({ 46536 accept: acceptAttr, 46537 multiple, 46538 type: "file", 46539 style: { 46540 border: 0, 46541 clip: "rect(0, 0, 0, 0)", 46542 clipPath: "inset(50%)", 46543 height: "1px", 46544 margin: "0 -1px -1px 0", 46545 overflow: "hidden", 46546 padding: 0, 46547 position: "absolute", 46548 width: "1px", 46549 whiteSpace: "nowrap" 46550 }, 46551 onChange: composeHandler(composeEventHandlers(onChange, onDropCb)), 46552 onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)), 46553 tabIndex: -1 46554 }, refKey, inputRef); 46555 return _objectSpread(_objectSpread({}, inputProps), rest); 46556 }; 46557 }, [inputRef, accept, multiple, onDropCb, disabled]); 46558 return _objectSpread(_objectSpread({}, state), {}, { 46559 isFocused: isFocused && !disabled, 46560 getRootProps, 46561 getInputProps, 46562 rootRef, 46563 inputRef, 46564 open: composeHandler(openFileDialog) 46565 }); 46566 } 46567 function reducer(state, action) { 46568 switch (action.type) { 46569 case "focus": 46570 return _objectSpread(_objectSpread({}, state), {}, { 46571 isFocused: true 46572 }); 46573 case "blur": 46574 return _objectSpread(_objectSpread({}, state), {}, { 46575 isFocused: false 46576 }); 46577 case "openDialog": 46578 return _objectSpread(_objectSpread({}, initialState), {}, { 46579 isFileDialogActive: true 46580 }); 46581 case "closeDialog": 46582 return _objectSpread(_objectSpread({}, state), {}, { 46583 isFileDialogActive: false 46584 }); 46585 case "setDraggedFiles": 46586 return _objectSpread(_objectSpread({}, state), {}, { 46587 isDragActive: action.isDragActive, 46588 isDragAccept: action.isDragAccept, 46589 isDragReject: action.isDragReject 46590 }); 46591 case "setFiles": 46592 return _objectSpread(_objectSpread({}, state), {}, { 46593 acceptedFiles: action.acceptedFiles, 46594 fileRejections: action.fileRejections, 46595 isDragReject: action.isDragReject 46596 }); 46597 case "reset": 46598 return _objectSpread({}, initialState); 46599 default: 46600 return state; 46601 } 46602 } 46603 function noop$2() { 46604 } 46605 const variantStyles = { 46606 primary: lt$2` 46607 max-width: 200px; 46608 padding: var(--space-100) var(--space-200); 46609 border-radius: var(--panel-radius-normal); 46610 border: 1px solid var(--border-transparent); 46611 background: var(--bg-primary-invert); 46612 color: var(--text-primary-invert); 46613 font-size: var(--font-size-300); 46614 font-weight: var(--font-weight-500); 46615 line-height: var(--font-line-height-300); 46616 letter-spacing: var(--font-letter-spacing-loose); 46617 `, 46618 secondary: lt$2` 46619 max-width: 252px; 46620 padding: var(--space-200) var(--space-300); 46621 border-radius: var(--panel-radius-normal); 46622 border: 1px solid var(--border-secondary); 46623 background: var(--bg-primary); 46624 box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12); 46625 color: var(--text-secondary); 46626 font-size: var(--font-size-300); 46627 font-weight: var(--font-weight-400); 46628 line-height: var(--font-line-height-300); 46629 letter-spacing: var(--font-letter-spacing-loose); 46630 ` 46631 }; 46632 const Trigger = dt$2.div` 46633 display: inline-flex; 46634`; 46635 const Content$2 = dt$2.div( 46636 ({ $variant, $maxWidth }) => lt$2` 46637 display: inline-flex; 46638 justify-content: center;
46639 align-items: center; 46640 white-space: normal; 46641 text-align: left; 46642 46643 ${variantStyles[$variant]} 46644 46645 ${$maxWidth !== void 0 && lt$2` 46646 max-width: ${$maxWidth}px; 46647 `} 46648 ` 46649 ); 46650 const Tooltip = ({ 46651 content, 46652 children, 46653 variant = "primary", 46654 placement = variant === "secondary" ? "top" : "bottom", 46655 offset: offsetValue = 8, 46656 maxWidth, 46657 disabled = false, 46658 portal = true, 46659 interactive = false 46660 }) => { 46661 const [isOpen, setIsOpen] = reactExports.useState(false); 46662 const [dismissedByClick, setDismissedByClick] = reactExports.useState(false); 46663 const handleOpenChange = (open) => { 46664 setIsOpen(open); 46665 if (!open) setDismissedByClick(false); 46666 }; 46667 const { refs, floatingStyles, context } = useFloating({ 46668 open: isOpen && !disabled && !dismissedByClick, 46669 onOpenChange: handleOpenChange, 46670 placement, 46671 middleware: [ 46672 offset(offsetValue), 46673 flip({ fallbackPlacements: ["top", "bottom", "left", "right"] }), 46674 shift({ padding: 8 }) 46675 ], 46676 whileElementsMounted: autoUpdate 46677 }); 46678 const hover2 = useHover(context, { 46679 move: !interactive, 46680 handleClose: interactive ? safePolygon() : void 0 46681 }); 46682 const focus = useFocus(context); 46683 const dismiss2 = useDismiss(context, { ancestorScroll: true }); 46684 const role = useRole(context, { role: "tooltip" }); 46685 const { getReferenceProps, getFloatingProps } = useInteractions([hover2, focus, dismiss2, role]); 46686 const { isMounted, styles: transitionStyles } = useTransitionStyles(context, { 46687 duration: 150 46688 }); 46689 const floating = isMounted && content && /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadProps(__spreadValues({ ref: refs.setFloating, style: __spreadProps(__spreadValues({}, floatingStyles), { zIndex: 1100 }) }, getFloatingProps()), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Content$2, { $variant: variant, $maxWidth: maxWidth, style: transitionStyles, children: content }) })); 46690 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
46691 /* @__PURE__ */ jsxRuntimeExports.jsx( 46692 Trigger, 46693 __spreadProps(__spreadValues({ 46694 ref: refs.setReference 46695 }, getReferenceProps({ 46696 onClick: () => setDismissedByClick(true), 46697 onMouseLeave: () => setDismissedByClick(false) 46698 })), { 46699 children 46700 }) 46701 ), 46702 portal ? /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingPortal, { children: floating }) : floating 46703 ] }); 46704 }; 46705 const Container$j = dt$2.span` 46706 display: inline-flex; 46707 align-items: center; 46708 vertical-align: middle; 46709 color: inherit; 46710 cursor: default; 46711`; 46712 const TooltipIcon = ({ 46713 size = 16, 46714 tooltipContent, 46715 placement, 46716 maxWidth 46717 }) => { 46718 if (!tooltipContent) { 46719 return null; 46720 } 46721 return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { content: tooltipContent, placement, maxWidth, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container$j, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(fr$2, { height: size, width: size }) }) }); 46722 }; 46723 const getDimension = (dimension) => { 46724 if (typeof dimension === "string") return dimension; 46725 if (typeof dimension === "number") return `${dimension}px`; 46726 }; 46727 const animationPulse = mt$2` 46728 0% { 46729 opacity: 1; 46730 } 46731 50% { 46732 opacity: 0.5; 46733 } 46734 100% { 46735 opacity: 1; 46736 } 46737`; 46738 const Skeleton$1 = dt$2.div` 46739 display: grid; 46740 46741 ${({ $gap }) => $gap && lt$2` 46742 gap: ${$gap}px; 46743 `} 46744 46745 ${({ $aligment }) => $aligment === "horizontal" && lt$2` 46746 grid-auto-columns: min-content; 46747 grid-auto-flow: column; 46748 `} 46749`; 46750 const Shape = dt$2.div` 46751 background-color: var(--bg-transparent-strong); 46752 background-size: 300% 300%; 46753 animation: ${animationPulse} 1s ease-in-out infinite alternate; 46754 width: ${({ $width }) => getDimension($width)}; 46755 height: ${({ $height }) => getDimension($height)}; 46756 border-radius: var(--panel-radius-normal); 46757 46758 ${({ $radius }) => $radius && lt$2` 46759 border-radius: ${$radius}; 46760 `} 46761`; 46762 const Skeleton = (_v) => { 46763 var _w = _v, { gap = 0, aligment = "vertical", children } = _w, props = __objRest(_w, ["gap", "aligment", "children"]); 46764 return /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton$1, __spreadProps(__spreadValues({ $gap: gap, $aligment: aligment, "data-testid": "Skeleton" }, props), { children })); 46765 }; 46766 const SkeletonShape = (_x) => { 46767 var _y = _x, { 46768 variant = "rectangle", 46769 radius, 46770 width = "100%", 46771 height = "auto" 46772 } = _y, props = __objRest(_y, [ 46773 "variant", 46774 "radius", 46775 "width", 46776 "height" 46777 ]); 46778 return /* @__PURE__ */ jsxRuntimeExports.jsx( 46779 Shape, 46780 __spreadProps(__spreadValues({ 46781 $variant: variant, 46782 $radius: radius, 46783 $width: width, 46784 $height: height, 46785 "data-testid": "Skeleton.Shape" 46786 }, props), { 46787 children: "â" 46788 }) 46789 ); 46790 }; 46791 Skeleton.Shape = SkeletonShape; 46792 var FUNC_ERROR_TEXT = "Expected a function"; 46793 function negate(predicate) { 46794 if (typeof predicate != "function") { 46795 throw new TypeError(FUNC_ERROR_TEXT); 46796 } 46797 return function() { 46798 var args = arguments; 46799 switch (args.length) { 46800 case 0: 46801 return !predicate.call(this); 46802 case 1: 46803 return !predicate.call(this, args[0]); 46804 case 2: 46805 return !predicate.call(this, args[0], args[1]); 46806 case 3: 46807 return !predicate.call(this, args[0], args[1], args[2]); 46808 } 46809 return !predicate.apply(this, args); 46810 }; 46811 } 46812 function basePickBy(object2, paths, predicate) { 46813 var index2 = -1, length2 = paths.length, result = {}; 46814 while (++index2 < length2) { 46815 var path = paths[index2], value = baseGet(object2, path); 46816 if (predicate(value, path)) { 46817 baseSet(result, castPath(path, object2), value); 46818 } 46819 } 46820 return result; 46821 } 46822 function pickBy(object2, predicate) { 46823 if (object2 == null) { 46824 return {}; 46825 } 46826 var props = arrayMap(getAllKeysIn(object2), function(prop) { 46827 return [prop]; 46828 }); 46829 predicate = baseIteratee(predicate); 46830 return basePickBy(object2, props, function(value, path) { 46831 return predicate(value, path[0]); 46832 }); 46833 } 46834 function omitBy(object2, predicate) { 46835 return pickBy(object2, negate(baseIteratee(predicate))); 46836 } 46837 var lib; 46838 var hasRequiredLib;
vendor: 37,715 bytes, lines 46839-47669
46839 function requireLib() { 46840 if (hasRequiredLib) return lib; 46841 hasRequiredLib = 1; 46842 function _interopDefault(ex) { 46843 return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; 46844 } 46845 var React2 = requireReact(); 46846 var React__default = _interopDefault(React2); 46847 function _defineProperty2(obj, key, value) { 46848 if (key in obj) { 46849 Object.defineProperty(obj, key, { 46850 value, 46851 enumerable: true, 46852 configurable: true, 46853 writable: true 46854 }); 46855 } else { 46856 obj[key] = value; 46857 } 46858 return obj; 46859 } 46860 function _inheritsLoose(subClass, superClass) { 46861 subClass.prototype = Object.create(superClass.prototype); 46862 subClass.prototype.constructor = subClass; 46863 subClass.__proto__ = superClass; 46864 } 46865 var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); 46866 function withSideEffect2(reducePropsToState2, handleStateChangeOnClient, mapStateOnServer2) { 46867 if (typeof reducePropsToState2 !== "function") { 46868 throw new Error("Expected reducePropsToState to be a function."); 46869 } 46870 if (typeof handleStateChangeOnClient !== "function") { 46871 throw new Error("Expected handleStateChangeOnClient to be a function."); 46872 } 46873 if (typeof mapStateOnServer2 !== "undefined" && typeof mapStateOnServer2 !== "function") { 46874 throw new Error("Expected mapStateOnServer to either be undefined or a function."); 46875 } 46876 function getDisplayName(WrappedComponent) { 46877 return WrappedComponent.displayName || WrappedComponent.name || "Component"; 46878 } 46879 return function wrap2(WrappedComponent) { 46880 if (typeof WrappedComponent !== "function") { 46881 throw new Error("Expected WrappedComponent to be a React component."); 46882 } 46883 var mountedInstances = []; 46884 var state; 46885 function emitChange() { 46886 state = reducePropsToState2(mountedInstances.map(function(instance2) { 46887 return instance2.props; 46888 })); 46889 if (SideEffect.canUseDOM) { 46890 handleStateChangeOnClient(state); 46891 } else if (mapStateOnServer2) { 46892 state = mapStateOnServer2(state); 46893 } 46894 } 46895 var SideEffect = /* @__PURE__ */ (function(_PureComponent) { 46896 _inheritsLoose(SideEffect2, _PureComponent); 46897 function SideEffect2() { 46898 return _PureComponent.apply(this, arguments) || this; 46899 } 46900 SideEffect2.peek = function peek2() { 46901 return state; 46902 }; 46903 SideEffect2.rewind = function rewind() { 46904 if (SideEffect2.canUseDOM) { 46905 throw new Error("You may only call rewind() on the server. Call peek() to read the current state."); 46906 } 46907 var recordedState = state; 46908 state = void 0; 46909 mountedInstances = []; 46910 return recordedState; 46911 }; 46912 var _proto = SideEffect2.prototype; 46913 _proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { 46914 mountedInstances.push(this); 46915 emitChange(); 46916 }; 46917 _proto.componentDidUpdate = function componentDidUpdate() { 46918 emitChange(); 46919 }; 46920 _proto.componentWillUnmount = function componentWillUnmount() { 46921 var index2 = mountedInstances.indexOf(this); 46922 mountedInstances.splice(index2, 1); 46923 emitChange(); 46924 }; 46925 _proto.render = function render() { 46926 return React__default.createElement(WrappedComponent, this.props); 46927 }; 46928 return SideEffect2; 46929 })(React2.PureComponent); 46930 _defineProperty2(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")"); 46931 _defineProperty2(SideEffect, "canUseDOM", canUseDOM); 46932 return SideEffect; 46933 }; 46934 } 46935 lib = withSideEffect2; 46936 return lib; 46937 } 46938 var libExports = requireLib(); 46939 const withSideEffect = /* @__PURE__ */ getDefaultExportFromCjs(libExports); 46940 var reactFastCompare; 46941 var hasRequiredReactFastCompare; 46942 function requireReactFastCompare() { 46943 if (hasRequiredReactFastCompare) return reactFastCompare; 46944 hasRequiredReactFastCompare = 1; 46945 var hasElementType = typeof Element !== "undefined"; 46946 var hasMap = typeof Map === "function"; 46947 var hasSet = typeof Set === "function"; 46948 var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView; 46949 function equal(a2, b2) { 46950 if (a2 === b2) return true; 46951 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 46952 if (a2.constructor !== b2.constructor) return false; 46953 var length2, i2, keys2; 46954 if (Array.isArray(a2)) { 46955 length2 = a2.length; 46956 if (length2 != b2.length) return false; 46957 for (i2 = length2; i2-- !== 0; ) 46958 if (!equal(a2[i2], b2[i2])) return false; 46959 return true; 46960 } 46961 var it2; 46962 if (hasMap && a2 instanceof Map && b2 instanceof Map) { 46963 if (a2.size !== b2.size) return false; 46964 it2 = a2.entries(); 46965 while (!(i2 = it2.next()).done) 46966 if (!b2.has(i2.value[0])) return false; 46967 it2 = a2.entries(); 46968 while (!(i2 = it2.next()).done) 46969 if (!equal(i2.value[1], b2.get(i2.value[0]))) return false; 46970 return true; 46971 } 46972 if (hasSet && a2 instanceof Set && b2 instanceof Set) { 46973 if (a2.size !== b2.size) return false; 46974 it2 = a2.entries(); 46975 while (!(i2 = it2.next()).done) 46976 if (!b2.has(i2.value[0])) return false; 46977 return true; 46978 } 46979 if (hasArrayBuffer && ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 46980 length2 = a2.length; 46981 if (length2 != b2.length) return false; 46982 for (i2 = length2; i2-- !== 0; ) 46983 if (a2[i2] !== b2[i2]) return false; 46984 return true; 46985 } 46986 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 46987 if (a2.valueOf !== Object.prototype.valueOf && typeof a2.valueOf === "function" && typeof b2.valueOf === "function") return a2.valueOf() === b2.valueOf(); 46988 if (a2.toString !== Object.prototype.toString && typeof a2.toString === "function" && typeof b2.toString === "function") return a2.toString() === b2.toString(); 46989 keys2 = Object.keys(a2); 46990 length2 = keys2.length; 46991 if (length2 !== Object.keys(b2).length) return false; 46992 for (i2 = length2; i2-- !== 0; ) 46993 if (!Object.prototype.hasOwnProperty.call(b2, keys2[i2])) return false; 46994 if (hasElementType && a2 instanceof Element) return false; 46995 for (i2 = length2; i2-- !== 0; ) { 46996 if ((keys2[i2] === "_owner" || keys2[i2] === "__v" || keys2[i2] === "__o") && a2.$$typeof) { 46997 continue; 46998 } 46999 if (!equal(a2[keys2[i2]], b2[keys2[i2]])) return false; 47000 } 47001 return true; 47002 } 47003 return a2 !== a2 && b2 !== b2; 47004 } 47005 reactFastCompare = function isEqual2(a2, b2) { 47006 try { 47007 return equal(a2, b2); 47008 } catch (error) { 47009 if ((error.message || "").match(/stack|recursion/i)) { 47010 console.warn("react-fast-compare cannot handle circular refs"); 47011 return false; 47012 } 47013 throw error; 47014 } 47015 }; 47016 return reactFastCompare; 47017 } 47018 var reactFastCompareExports = requireReactFastCompare(); 47019 const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(reactFastCompareExports); 47020 /* 47021 object-assign 47022 (c) Sindre Sorhus 47023 @license MIT 47024 */ 47025 var objectAssign$1; 47026 var hasRequiredObjectAssign; 47027 function requireObjectAssign() { 47028 if (hasRequiredObjectAssign) return objectAssign$1; 47029 hasRequiredObjectAssign = 1; 47030 var getOwnPropertySymbols = Object.getOwnPropertySymbols; 47031 var hasOwnProperty2 = Object.prototype.hasOwnProperty; 47032 var propIsEnumerable = Object.prototype.propertyIsEnumerable; 47033 function toObject(val) { 47034 if (val === null || val === void 0) { 47035 throw new TypeError("Object.assign cannot be called with null or undefined"); 47036 } 47037 return Object(val); 47038 } 47039 function shouldUseNative() { 47040 try { 47041 if (!Object.assign) { 47042 return false; 47043 } 47044 var test1 = new String("abc"); 47045 test1[5] = "de"; 47046 if (Object.getOwnPropertyNames(test1)[0] === "5") { 47047 return false; 47048 } 47049 var test2 = {}; 47050 for (var i2 = 0; i2 < 10; i2++) { 47051 test2["_" + String.fromCharCode(i2)] = i2; 47052 } 47053 var order2 = Object.getOwnPropertyNames(test2).map(function(n2) { 47054 return test2[n2]; 47055 }); 47056 if (order2.join("") !== "0123456789") { 47057 return false; 47058 } 47059 var test3 = {}; 47060 "abcdefghijklmnopqrst".split("").forEach(function(letter) { 47061 test3[letter] = letter; 47062 }); 47063 if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { 47064 return false; 47065 } 47066 return true; 47067 } catch (err) { 47068 return false; 47069 } 47070 } 47071 objectAssign$1 = shouldUseNative() ? Object.assign : function(target, source) { 47072 var from2; 47073 var to2 = toObject(target); 47074 var symbols; 47075 for (var s2 = 1; s2 < arguments.length; s2++) { 47076 from2 = Object(arguments[s2]); 47077 for (var key in from2) { 47078 if (hasOwnProperty2.call(from2, key)) { 47079 to2[key] = from2[key]; 47080 } 47081 } 47082 if (getOwnPropertySymbols) { 47083 symbols = getOwnPropertySymbols(from2); 47084 for (var i2 = 0; i2 < symbols.length; i2++) { 47085 if (propIsEnumerable.call(from2, symbols[i2])) { 47086 to2[symbols[i2]] = from2[symbols[i2]]; 47087 } 47088 } 47089 } 47090 } 47091 return to2; 47092 }; 47093 return objectAssign$1; 47094 } 47095 var objectAssignExports = requireObjectAssign(); 47096 const objectAssign = /* @__PURE__ */ getDefaultExportFromCjs(objectAssignExports); 47097 var ATTRIBUTE_NAMES = { 47098 BODY: "bodyAttributes", 47099 HTML: "htmlAttributes", 47100 TITLE: "titleAttributes" 47101 }; 47102 var TAG_NAMES = { 47103 BASE: "base", 47104 BODY: "body", 47105 HEAD: "head", 47106 HTML: "html", 47107 LINK: "link", 47108 META: "meta", 47109 NOSCRIPT: "noscript", 47110 SCRIPT: "script", 47111 STYLE: "style", 47112 TITLE: "title" 47113 }; 47114 Object.keys(TAG_NAMES).map(function(name) { 47115 return TAG_NAMES[name]; 47116 }); 47117 var TAG_PROPERTIES = { 47118 CHARSET: "charset", 47119 CSS_TEXT: "cssText", 47120 HREF: "href", 47121 HTTPEQUIV: "http-equiv", 47122 INNER_HTML: "innerHTML", 47123 ITEM_PROP: "itemprop", 47124 NAME: "name", 47125 PROPERTY: "property", 47126 REL: "rel", 47127 SRC: "src", 47128 TARGET: "target" 47129 }; 47130 var REACT_TAG_MAP = { 47131 accesskey: "accessKey", 47132 charset: "charSet", 47133 class: "className", 47134 contenteditable: "contentEditable", 47135 contextmenu: "contextMenu", 47136 "http-equiv": "httpEquiv", 47137 itemprop: "itemProp", 47138 tabindex: "tabIndex" 47139 }; 47140 var HELMET_PROPS = { 47141 DEFAULT_TITLE: "defaultTitle", 47142 DEFER: "defer", 47143 ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters", 47144 ON_CHANGE_CLIENT_STATE: "onChangeClientState", 47145 TITLE_TEMPLATE: "titleTemplate" 47146 }; 47147 var HTML_TAG_MAP = Object.keys(REACT_TAG_MAP).reduce(function(obj, key) { 47148 obj[REACT_TAG_MAP[key]] = key; 47149 return obj; 47150 }, {}); 47151 var SELF_CLOSING_TAGS = [TAG_NAMES.NOSCRIPT, TAG_NAMES.SCRIPT, TAG_NAMES.STYLE]; 47152 var HELMET_ATTRIBUTE = "data-react-helmet"; 47153 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 47154 return typeof obj; 47155 } : function(obj) { 47156 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 47157 }; 47158 var classCallCheck = function(instance2, Constructor) { 47159 if (!(instance2 instanceof Constructor)) { 47160 throw new TypeError("Cannot call a class as a function"); 47161 } 47162 }; 47163 var createClass = /* @__PURE__ */ (function() { 47164 function defineProperties(target, props) { 47165 for (var i2 = 0; i2 < props.length; i2++) { 47166 var descriptor = props[i2]; 47167 descriptor.enumerable = descriptor.enumerable || false; 47168 descriptor.configurable = true; 47169 if ("value" in descriptor) descriptor.writable = true; 47170 Object.defineProperty(target, descriptor.key, descriptor); 47171 } 47172 } 47173 return function(Constructor, protoProps, staticProps) { 47174 if (protoProps) defineProperties(Constructor.prototype, protoProps); 47175 if (staticProps) defineProperties(Constructor, staticProps); 47176 return Constructor; 47177 }; 47178 })(); 47179 var _extends$5 = Object.assign || function(target) { 47180 for (var i2 = 1; i2 < arguments.length; i2++) { 47181 var source = arguments[i2]; 47182 for (var key in source) { 47183 if (Object.prototype.hasOwnProperty.call(source, key)) { 47184 target[key] = source[key]; 47185 } 47186 } 47187 } 47188 return target; 47189 }; 47190 var inherits = function(subClass, superClass) { 47191 if (typeof superClass !== "function" && superClass !== null) { 47192 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 47193 } 47194 subClass.prototype = Object.create(superClass && superClass.prototype, { 47195 constructor: { 47196 value: subClass, 47197 enumerable: false, 47198 writable: true, 47199 configurable: true 47200 } 47201 }); 47202 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 47203 }; 47204 var objectWithoutProperties = function(obj, keys2) { 47205 var target = {}; 47206 for (var i2 in obj) { 47207 if (keys2.indexOf(i2) >= 0) continue; 47208 if (!Object.prototype.hasOwnProperty.call(obj, i2)) continue; 47209 target[i2] = obj[i2]; 47210 } 47211 return target; 47212 }; 47213 var possibleConstructorReturn = function(self2, call) { 47214 if (!self2) { 47215 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 47216 } 47217 return call && (typeof call === "object" || typeof call === "function") ? call : self2; 47218 }; 47219 var encodeSpecialCharacters = function encodeSpecialCharacters2(str) { 47220 var encode2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; 47221 if (encode2 === false) { 47222 return String(str); 47223 } 47224 return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); 47225 }; 47226 var getTitleFromPropsList = function getTitleFromPropsList2(propsList) { 47227 var innermostTitle = getInnermostProperty(propsList, TAG_NAMES.TITLE); 47228 var innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE); 47229 if (innermostTemplate && innermostTitle) { 47230 return innermostTemplate.replace(/%s/g, function() { 47231 return Array.isArray(innermostTitle) ? innermostTitle.join("") : innermostTitle; 47232 }); 47233 } 47234 var innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE); 47235 return innermostTitle || innermostDefaultTitle || void 0; 47236 }; 47237 var getOnChangeClientState = function getOnChangeClientState2(propsList) { 47238 return getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || function() { 47239 }; 47240 }; 47241 var getAttributesFromPropsList = function getAttributesFromPropsList2(tagType, propsList) { 47242 return propsList.filter(function(props) { 47243 return typeof props[tagType] !== "undefined"; 47244 }).map(function(props) { 47245 return props[tagType]; 47246 }).reduce(function(tagAttrs, current) { 47247 return _extends$5({}, tagAttrs, current); 47248 }, {}); 47249 }; 47250 var getBaseTagFromPropsList = function getBaseTagFromPropsList2(primaryAttributes, propsList) { 47251 return propsList.filter(function(props) { 47252 return typeof props[TAG_NAMES.BASE] !== "undefined"; 47253 }).map(function(props) { 47254 return props[TAG_NAMES.BASE]; 47255 }).reverse().reduce(function(innermostBaseTag, tag) { 47256 if (!innermostBaseTag.length) { 47257 var keys2 = Object.keys(tag); 47258 for (var i2 = 0; i2 < keys2.length; i2++) { 47259 var attributeKey = keys2[i2]; 47260 var lowerCaseAttributeKey = attributeKey.toLowerCase(); 47261 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) { 47262 return innermostBaseTag.concat(tag); 47263 } 47264 } 47265 } 47266 return innermostBaseTag; 47267 }, []); 47268 }; 47269 var getTagsFromPropsList = function getTagsFromPropsList2(tagName, primaryAttributes, propsList) { 47270 var approvedSeenTags = {}; 47271 return propsList.filter(function(props) { 47272 if (Array.isArray(props[tagName])) { 47273 return true; 47274 } 47275 if (typeof props[tagName] !== "undefined") { 47276 warn$1("Helmet: " + tagName + ' should be of type "Array". Instead found type "' + _typeof(props[tagName]) + '"'); 47277 } 47278 return false; 47279 }).map(function(props) { 47280 return props[tagName]; 47281 }).reverse().reduce(function(approvedTags, instanceTags) { 47282 var instanceSeenTags = {}; 47283 instanceTags.filter(function(tag) { 47284 var primaryAttributeKey = void 0; 47285 var keys22 = Object.keys(tag); 47286 for (var i22 = 0; i22 < keys22.length; i22++) { 47287 var attributeKey2 = keys22[i22]; 47288 var lowerCaseAttributeKey = attributeKey2.toLowerCase(); 47289 if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) { 47290 primaryAttributeKey = lowerCaseAttributeKey; 47291 } 47292 if (primaryAttributes.indexOf(attributeKey2) !== -1 && (attributeKey2 === TAG_PROPERTIES.INNER_HTML || attributeKey2 === TAG_PROPERTIES.CSS_TEXT || attributeKey2 === TAG_PROPERTIES.ITEM_PROP)) { 47293 primaryAttributeKey = attributeKey2; 47294 } 47295 } 47296 if (!primaryAttributeKey || !tag[primaryAttributeKey]) { 47297 return false; 47298 } 47299 var value = tag[primaryAttributeKey].toLowerCase(); 47300 if (!approvedSeenTags[primaryAttributeKey]) { 47301 approvedSeenTags[primaryAttributeKey] = {}; 47302 } 47303 if (!instanceSeenTags[primaryAttributeKey]) { 47304 instanceSeenTags[primaryAttributeKey] = {}; 47305 } 47306 if (!approvedSeenTags[primaryAttributeKey][value]) { 47307 instanceSeenTags[primaryAttributeKey][value] = true; 47308 return true; 47309 } 47310 return false; 47311 }).reverse().forEach(function(tag) { 47312 return approvedTags.push(tag); 47313 }); 47314 var keys2 = Object.keys(instanceSeenTags); 47315 for (var i2 = 0; i2 < keys2.length; i2++) { 47316 var attributeKey = keys2[i2]; 47317 var tagUnion = objectAssign({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]); 47318 approvedSeenTags[attributeKey] = tagUnion; 47319 } 47320 return approvedTags; 47321 }, []).reverse(); 47322 }; 47323 var getInnermostProperty = function getInnermostProperty2(propsList, property2) { 47324 for (var i2 = propsList.length - 1; i2 >= 0; i2--) { 47325 var props = propsList[i2]; 47326 if (props.hasOwnProperty(property2)) { 47327 return props[property2]; 47328 } 47329 } 47330 return null; 47331 }; 47332 var reducePropsToState = function reducePropsToState2(propsList) { 47333 return { 47334 baseTag: getBaseTagFromPropsList([TAG_PROPERTIES.HREF, TAG_PROPERTIES.TARGET], propsList), 47335 bodyAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.BODY, propsList), 47336 defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER), 47337 encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS), 47338 htmlAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.HTML, propsList), 47339 linkTags: getTagsFromPropsList(TAG_NAMES.LINK, [TAG_PROPERTIES.REL, TAG_PROPERTIES.HREF], propsList), 47340 metaTags: getTagsFromPropsList(TAG_NAMES.META, [TAG_PROPERTIES.NAME, TAG_PROPERTIES.CHARSET, TAG_PROPERTIES.HTTPEQUIV, TAG_PROPERTIES.PROPERTY, TAG_PROPERTIES.ITEM_PROP], propsList), 47341 noscriptTags: getTagsFromPropsList(TAG_NAMES.NOSCRIPT, [TAG_PROPERTIES.INNER_HTML], propsList), 47342 onChangeClientState: getOnChangeClientState(propsList), 47343 scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML], propsList), 47344 styleTags: getTagsFromPropsList(TAG_NAMES.STYLE, [TAG_PROPERTIES.CSS_TEXT], propsList), 47345 title: getTitleFromPropsList(propsList), 47346 titleAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.TITLE, propsList) 47347 }; 47348 }; 47349 var rafPolyfill = (function() { 47350 var clock = Date.now(); 47351 return function(callback) { 47352 var currentTime = Date.now(); 47353 if (currentTime - clock > 16) { 47354 clock = currentTime; 47355 callback(currentTime); 47356 } else { 47357 setTimeout(function() { 47358 rafPolyfill(callback); 47359 }, 0); 47360 } 47361 }; 47362 })(); 47363 var cafPolyfill = function cafPolyfill2(id2) { 47364 return clearTimeout(id2); 47365 }; 47366 var requestAnimationFrame$1 = typeof window !== "undefined" ? window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || rafPolyfill : global.requestAnimationFrame || rafPolyfill; 47367 var cancelAnimationFrame$1 = typeof window !== "undefined" ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || cafPolyfill : global.cancelAnimationFrame || cafPolyfill; 47368 var warn$1 = function warn2(msg) { 47369 return console && typeof console.warn === "function" && console.warn(msg); 47370 }; 47371 var _helmetCallback = null; 47372 var handleClientStateChange = function handleClientStateChange2(newState) { 47373 if (_helmetCallback) { 47374 cancelAnimationFrame$1(_helmetCallback); 47375 } 47376 if (newState.defer) { 47377 _helmetCallback = requestAnimationFrame$1(function() { 47378 commitTagChanges(newState, function() { 47379 _helmetCallback = null; 47380 }); 47381 }); 47382 } else { 47383 commitTagChanges(newState); 47384 _helmetCallback = null; 47385 } 47386 }; 47387 var commitTagChanges = function commitTagChanges2(newState, cb) { 47388 var baseTag = newState.baseTag, bodyAttributes = newState.bodyAttributes, htmlAttributes = newState.htmlAttributes, linkTags = newState.linkTags, metaTags = newState.metaTags, noscriptTags = newState.noscriptTags, onChangeClientState = newState.onChangeClientState, scriptTags = newState.scriptTags, styleTags = newState.styleTags, title = newState.title, titleAttributes = newState.titleAttributes; 47389 updateAttributes(TAG_NAMES.BODY, bodyAttributes); 47390 updateAttributes(TAG_NAMES.HTML, htmlAttributes); 47391 updateTitle(title, titleAttributes); 47392 var tagUpdates = { 47393 baseTag: updateTags(TAG_NAMES.BASE, baseTag), 47394 linkTags: updateTags(TAG_NAMES.LINK, linkTags), 47395 metaTags: updateTags(TAG_NAMES.META, metaTags), 47396 noscriptTags: updateTags(TAG_NAMES.NOSCRIPT, noscriptTags), 47397 scriptTags: updateTags(TAG_NAMES.SCRIPT, scriptTags), 47398 styleTags: updateTags(TAG_NAMES.STYLE, styleTags) 47399 }; 47400 var addedTags = {}; 47401 var removedTags = {}; 47402 Object.keys(tagUpdates).forEach(function(tagType) { 47403 var _tagUpdates$tagType = tagUpdates[tagType], newTags = _tagUpdates$tagType.newTags, oldTags = _tagUpdates$tagType.oldTags; 47404 if (newTags.length) { 47405 addedTags[tagType] = newTags; 47406 } 47407 if (oldTags.length) { 47408 removedTags[tagType] = tagUpdates[tagType].oldTags; 47409 } 47410 }); 47411 cb && cb(); 47412 onChangeClientState(newState, addedTags, removedTags); 47413 }; 47414 var flattenArray = function flattenArray2(possibleArray) { 47415 return Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray; 47416 }; 47417 var updateTitle = function updateTitle2(title, attributes) { 47418 if (typeof title !== "undefined" && document.title !== title) { 47419 document.title = flattenArray(title); 47420 } 47421 updateAttributes(TAG_NAMES.TITLE, attributes); 47422 }; 47423 var updateAttributes = function updateAttributes2(tagName, attributes) { 47424 var elementTag = document.getElementsByTagName(tagName)[0]; 47425 if (!elementTag) { 47426 return; 47427 } 47428 var helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE); 47429 var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : []; 47430 var attributesToRemove = [].concat(helmetAttributes); 47431 var attributeKeys = Object.keys(attributes); 47432 for (var i2 = 0; i2 < attributeKeys.length; i2++) { 47433 var attribute2 = attributeKeys[i2]; 47434 var value = attributes[attribute2] || ""; 47435 if (elementTag.getAttribute(attribute2) !== value) { 47436 elementTag.setAttribute(attribute2, value); 47437 } 47438 if (helmetAttributes.indexOf(attribute2) === -1) { 47439 helmetAttributes.push(attribute2); 47440 } 47441 var indexToSave = attributesToRemove.indexOf(attribute2); 47442 if (indexToSave !== -1) { 47443 attributesToRemove.splice(indexToSave, 1); 47444 } 47445 } 47446 for (var _i2 = attributesToRemove.length - 1; _i2 >= 0; _i2--) { 47447 elementTag.removeAttribute(attributesToRemove[_i2]); 47448 } 47449 if (helmetAttributes.length === attributesToRemove.length) { 47450 elementTag.removeAttribute(HELMET_ATTRIBUTE); 47451 } else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(",")) { 47452 elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(",")); 47453 } 47454 }; 47455 var updateTags = function updateTags2(type, tags) { 47456 var headElement = document.head || document.querySelector(TAG_NAMES.HEAD); 47457 var tagNodes = headElement.querySelectorAll(type + "[" + HELMET_ATTRIBUTE + "]"); 47458 var oldTags = Array.prototype.slice.call(tagNodes); 47459 var newTags = []; 47460 var indexToDelete = void 0; 47461 if (tags && tags.length) { 47462 tags.forEach(function(tag) { 47463 var newElement = document.createElement(type); 47464 for (var attribute2 in tag) { 47465 if (tag.hasOwnProperty(attribute2)) { 47466 if (attribute2 === TAG_PROPERTIES.INNER_HTML) { 47467 newElement.innerHTML = tag.innerHTML; 47468 } else if (attribute2 === TAG_PROPERTIES.CSS_TEXT) { 47469 if (newElement.styleSheet) { 47470 newElement.styleSheet.cssText = tag.cssText; 47471 } else { 47472 newElement.appendChild(document.createTextNode(tag.cssText)); 47473 } 47474 } else { 47475 var value = typeof tag[attribute2] === "undefined" ? "" : tag[attribute2]; 47476 newElement.setAttribute(attribute2, value); 47477 } 47478 } 47479 } 47480 newElement.setAttribute(HELMET_ATTRIBUTE, "true"); 47481 if (oldTags.some(function(existingTag, index2) { 47482 indexToDelete = index2; 47483 return newElement.isEqualNode(existingTag); 47484 })) { 47485 oldTags.splice(indexToDelete, 1); 47486 } else { 47487 newTags.push(newElement); 47488 } 47489 }); 47490 } 47491 oldTags.forEach(function(tag) { 47492 return tag.parentNode.removeChild(tag); 47493 }); 47494 newTags.forEach(function(tag) { 47495 return headElement.appendChild(tag); 47496 }); 47497 return { 47498 oldTags, 47499 newTags 47500 }; 47501 }; 47502 var generateElementAttributesAsString = function generateElementAttributesAsString2(attributes) { 47503 return Object.keys(attributes).reduce(function(str, key) { 47504 var attr2 = typeof attributes[key] !== "undefined" ? key + '="' + attributes[key] + '"' : "" + key; 47505 return str ? str + " " + attr2 : attr2; 47506 }, ""); 47507 }; 47508 var generateTitleAsString = function generateTitleAsString2(type, title, attributes, encode2) { 47509 var attributeString = generateElementAttributesAsString(attributes); 47510 var flattenedTitle = flattenArray(title); 47511 return attributeString ? "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeString + ">" + encodeSpecialCharacters(flattenedTitle, encode2) + "</" + type + ">" : "<" + type + " " + HELMET_ATTRIBUTE + '="true">' + encodeSpecialCharacters(flattenedTitle, encode2) + "</" + type + ">"; 47512 }; 47513 var generateTagsAsString = function generateTagsAsString2(type, tags, encode2) { 47514 return tags.reduce(function(str, tag) { 47515 var attributeHtml = Object.keys(tag).filter(function(attribute2) { 47516 return !(attribute2 === TAG_PROPERTIES.INNER_HTML || attribute2 === TAG_PROPERTIES.CSS_TEXT); 47517 }).reduce(function(string2, attribute2) { 47518 var attr2 = typeof tag[attribute2] === "undefined" ? attribute2 : attribute2 + '="' + encodeSpecialCharacters(tag[attribute2], encode2) + '"'; 47519 return string2 ? string2 + " " + attr2 : attr2; 47520 }, ""); 47521 var tagContent = tag.innerHTML || tag.cssText || ""; 47522 var isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1; 47523 return str + "<" + type + " " + HELMET_ATTRIBUTE + '="true" ' + attributeHtml + (isSelfClosing ? "/>" : ">" + tagContent + "</" + type + ">"); 47524 }, ""); 47525 }; 47526 var convertElementAttributestoReactProps = function convertElementAttributestoReactProps2(attributes) { 47527 var initProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 47528 return Object.keys(attributes).reduce(function(obj, key) { 47529 obj[REACT_TAG_MAP[key] || key] = attributes[key]; 47530 return obj; 47531 }, initProps); 47532 }; 47533 var convertReactPropstoHtmlAttributes = function convertReactPropstoHtmlAttributes2(props) { 47534 var initAttributes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 47535 return Object.keys(props).reduce(function(obj, key) { 47536 obj[HTML_TAG_MAP[key] || key] = props[key]; 47537 return obj; 47538 }, initAttributes); 47539 }; 47540 var generateTitleAsReactComponent = function generateTitleAsReactComponent2(type, title, attributes) { 47541 var _initProps; 47542 var initProps = (_initProps = { 47543 key: title 47544 }, _initProps[HELMET_ATTRIBUTE] = true, _initProps); 47545 var props = convertElementAttributestoReactProps(attributes, initProps); 47546 return [e$3.createElement(TAG_NAMES.TITLE, props, title)]; 47547 }; 47548 var generateTagsAsReactComponent = function generateTagsAsReactComponent2(type, tags) { 47549 return tags.map(function(tag, i2) { 47550 var _mappedTag; 47551 var mappedTag = (_mappedTag = { 47552 key: i2 47553 }, _mappedTag[HELMET_ATTRIBUTE] = true, _mappedTag); 47554 Object.keys(tag).forEach(function(attribute2) { 47555 var mappedAttribute = REACT_TAG_MAP[attribute2] || attribute2; 47556 if (mappedAttribute === TAG_PROPERTIES.INNER_HTML || mappedAttribute === TAG_PROPERTIES.CSS_TEXT) { 47557 var content = tag.innerHTML || tag.cssText; 47558 mappedTag.dangerouslySetInnerHTML = { __html: content }; 47559 } else { 47560 mappedTag[mappedAttribute] = tag[attribute2]; 47561 } 47562 }); 47563 return e$3.createElement(type, mappedTag); 47564 }); 47565 }; 47566 var getMethodsForTag = function getMethodsForTag2(type, tags, encode2) { 47567 switch (type) { 47568 case TAG_NAMES.TITLE: 47569 return { 47570 toComponent: function toComponent() { 47571 return generateTitleAsReactComponent(type, tags.title, tags.titleAttributes); 47572 }, 47573 toString: function toString2() { 47574 return generateTitleAsString(type, tags.title, tags.titleAttributes, encode2); 47575 } 47576 }; 47577 case ATTRIBUTE_NAMES.BODY: 47578 case ATTRIBUTE_NAMES.HTML: 47579 return { 47580 toComponent: function toComponent() { 47581 return convertElementAttributestoReactProps(tags); 47582 }, 47583 toString: function toString2() { 47584 return generateElementAttributesAsString(tags); 47585 } 47586 }; 47587 default: 47588 return { 47589 toComponent: function toComponent() { 47590 return generateTagsAsReactComponent(type, tags); 47591 }, 47592 toString: function toString2() { 47593 return generateTagsAsString(type, tags, encode2); 47594 } 47595 }; 47596 } 47597 }; 47598 var mapStateOnServer = function mapStateOnServer2(_ref2) { 47599 var baseTag = _ref2.baseTag, bodyAttributes = _ref2.bodyAttributes, encode2 = _ref2.encode, htmlAttributes = _ref2.htmlAttributes, linkTags = _ref2.linkTags, metaTags = _ref2.metaTags, noscriptTags = _ref2.noscriptTags, scriptTags = _ref2.scriptTags, styleTags = _ref2.styleTags, _ref$title = _ref2.title, title = _ref$title === void 0 ? "" : _ref$title, titleAttributes = _ref2.titleAttributes; 47600 return { 47601 base: getMethodsForTag(TAG_NAMES.BASE, baseTag, encode2), 47602 bodyAttributes: getMethodsForTag(ATTRIBUTE_NAMES.BODY, bodyAttributes, encode2), 47603 htmlAttributes: getMethodsForTag(ATTRIBUTE_NAMES.HTML, htmlAttributes, encode2), 47604 link: getMethodsForTag(TAG_NAMES.LINK, linkTags, encode2), 47605 meta: getMethodsForTag(TAG_NAMES.META, metaTags, encode2), 47606 noscript: getMethodsForTag(TAG_NAMES.NOSCRIPT, noscriptTags, encode2), 47607 script: getMethodsForTag(TAG_NAMES.SCRIPT, scriptTags, encode2), 47608 style: getMethodsForTag(TAG_NAMES.STYLE, styleTags, encode2), 47609 title: getMethodsForTag(TAG_NAMES.TITLE, { title, titleAttributes }, encode2) 47610 }; 47611 }; 47612 var Helmet = function Helmet2(Component) { 47613 var _class, _temp; 47614 return _temp = _class = (function(_React$Component) { 47615 inherits(HelmetWrapper, _React$Component); 47616 function HelmetWrapper() { 47617 classCallCheck(this, HelmetWrapper); 47618 return possibleConstructorReturn(this, _React$Component.apply(this, arguments)); 47619 } 47620 HelmetWrapper.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { 47621 return !isEqual(this.props, nextProps); 47622 }; 47623 HelmetWrapper.prototype.mapNestedChildrenToProps = function mapNestedChildrenToProps(child, nestedChildren) { 47624 if (!nestedChildren) { 47625 return null; 47626 } 47627 switch (child.type) { 47628 case TAG_NAMES.SCRIPT: 47629 case TAG_NAMES.NOSCRIPT: 47630 return { 47631 innerHTML: nestedChildren 47632 }; 47633 case TAG_NAMES.STYLE: 47634 return { 47635 cssText: nestedChildren 47636 }; 47637 } 47638 throw new Error("<" + child.type + " /> elements are self-closing and can not contain children. Refer to our API for more information."); 47639 }; 47640 HelmetWrapper.prototype.flattenArrayTypeChildren = function flattenArrayTypeChildren(_ref2) { 47641 var _babelHelpers$extends; 47642 var child = _ref2.child, arrayTypeChildren = _ref2.arrayTypeChildren, newChildProps = _ref2.newChildProps, nestedChildren = _ref2.nestedChildren; 47643 return _extends$5({}, arrayTypeChildren, (_babelHelpers$extends = {}, _babelHelpers$extends[child.type] = [].concat(arrayTypeChildren[child.type] || [], [_extends$5({}, newChildProps, this.mapNestedChildrenToProps(child, nestedChildren))]), _babelHelpers$extends)); 47644 }; 47645 HelmetWrapper.prototype.mapObjectTypeChildren = function mapObjectTypeChildren(_ref2) { 47646 var _babelHelpers$extends2, _babelHelpers$extends3; 47647 var child = _ref2.child, newProps = _ref2.newProps, newChildProps = _ref2.newChildProps, nestedChildren = _ref2.nestedChildren; 47648 switch (child.type) { 47649 case TAG_NAMES.TITLE: 47650 return _extends$5({}, newProps, (_babelHelpers$extends2 = {}, _babelHelpers$extends2[child.type] = nestedChildren, _babelHelpers$extends2.titleAttributes = _extends$5({}, newChildProps), _babelHelpers$extends2)); 47651 case TAG_NAMES.BODY: 47652 return _extends$5({}, newProps, { 47653 bodyAttributes: _extends$5({}, newChildProps) 47654 }); 47655 case TAG_NAMES.HTML: 47656 return _extends$5({}, newProps, { 47657 htmlAttributes: _extends$5({}, newChildProps) 47658 }); 47659 } 47660 return _extends$5({}, newProps, (_babelHelpers$extends3 = {}, _babelHelpers$extends3[child.type] = _extends$5({}, newChildProps), _babelHelpers$extends3)); 47661 }; 47662 HelmetWrapper.prototype.mapArrayTypeChildrenToProps = function mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) { 47663 var newFlattenedProps = _extends$5({}, newProps); 47664 Object.keys(arrayTypeChildren).forEach(function(arrayChildName) { 47665 var _babelHelpers$extends4; 47666 newFlattenedProps = _extends$5({}, newFlattenedProps, (_babelHelpers$extends4 = {}, _babelHelpers$extends4[arrayChildName] = arrayTypeChildren[arrayChildName], _babelHelpers$extends4)); 47667 }); 47668 return newFlattenedProps; 47669 };
47670 HelmetWrapper.prototype.warnOnInvalidChildren = function warnOnInvalidChildren(child, nestedChildren) { 47671 return true; 47672 }; 47673 HelmetWrapper.prototype.mapChildrenToProps = function mapChildrenToProps(children, newProps) { 47674 var _this2 = this; 47675 var arrayTypeChildren = {}; 47676 e$3.Children.forEach(children, function(child) { 47677 if (!child || !child.props) { 47678 return; 47679 } 47680 var _child$props = child.props, nestedChildren = _child$props.children, childProps = objectWithoutProperties(_child$props, ["children"]); 47681 var newChildProps = convertReactPropstoHtmlAttributes(childProps); 47682 _this2.warnOnInvalidChildren(child, nestedChildren); 47683 switch (child.type) { 47684 case TAG_NAMES.LINK: 47685 case TAG_NAMES.META: 47686 case TAG_NAMES.NOSCRIPT: 47687 case TAG_NAMES.SCRIPT: 47688 case TAG_NAMES.STYLE: 47689 arrayTypeChildren = _this2.flattenArrayTypeChildren({ 47690 child, 47691 arrayTypeChildren, 47692 newChildProps, 47693 nestedChildren 47694 }); 47695 break; 47696 default: 47697 newProps = _this2.mapObjectTypeChildren({ 47698 child, 47699 newProps, 47700 newChildProps, 47701 nestedChildren 47702 }); 47703 break; 47704 } 47705 }); 47706 newProps = this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps); 47707 return newProps; 47708 }; 47709 HelmetWrapper.prototype.render = function render() { 47710 var _props = this.props, children = _props.children, props = objectWithoutProperties(_props, ["children"]); 47711 var newProps = _extends$5({}, props); 47712 if (children) { 47713 newProps = this.mapChildrenToProps(children, newProps); 47714 } 47715 return e$3.createElement(Component, newProps); 47716 }; 47717 createClass(HelmetWrapper, null, [{ 47718 key: "canUseDOM", 47719 // Component.peek comes from react-side-effect: 47720 // For testing, you may use a static peek() method available on the returned component. 47721 // It lets you get the current state without resetting the mounted instance stack. 47722 // Donât use it for anything other than testing. 47723 /** 47724 * @param {Object} base: {"target": "_blank", "href": "http://mysite.com/"} 47725 * @param {Object} bodyAttributes: {"className": "root"} 47726 * @param {String} defaultTitle: "Default Title" 47727 * @param {Boolean} defer: true 47728 * @param {Boolean} encodeSpecialCharacters: true 47729 * @param {Object} htmlAttributes: {"lang": "en", "amp": undefined} 47730 * @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example"}] 47731 * @param {Array} meta: [{"name": "description", "content": "Test description"}] 47732 * @param {Array} noscript: [{"innerHTML": "<img src='http://mysite.com/js/test.js'"}] 47733 * @param {Function} onChangeClientState: "(newState) => console.log(newState)" 47734 * @param {Array} script: [{"type": "text/javascript", "src": "http://mysite.com/js/test.js"}] 47735 * @param {Array} style: [{"type": "text/css", "cssText": "div { display: block; color: blue; }"}] 47736 * @param {String} title: "Title" 47737 * @param {Object} titleAttributes: {"itemprop": "name"} 47738 * @param {String} titleTemplate: "MySite.com - %s" 47739 */ 47740 set: function set$$1(canUseDOM) { 47741 Component.canUseDOM = canUseDOM; 47742 } 47743 }]); 47744 return HelmetWrapper; 47745 })(e$3.Component), _class.propTypes = { 47746 base: PropTypes.object, 47747 bodyAttributes: PropTypes.object, 47748 children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]), 47749 defaultTitle: PropTypes.string, 47750 defer: PropTypes.bool, 47751 encodeSpecialCharacters: PropTypes.bool, 47752 htmlAttributes: PropTypes.object, 47753 link: PropTypes.arrayOf(PropTypes.object), 47754 meta: PropTypes.arrayOf(PropTypes.object), 47755 noscript: PropTypes.arrayOf(PropTypes.object), 47756 onChangeClientState: PropTypes.func, 47757 script: PropTypes.arrayOf(PropTypes.object), 47758 style: PropTypes.arrayOf(PropTypes.object), 47759 title: PropTypes.string, 47760 titleAttributes: PropTypes.object, 47761 titleTemplate: PropTypes.string 47762 }, _class.defaultProps = { 47763 defer: true, 47764 encodeSpecialCharacters: true 47765 }, _class.peek = Component.peek, _class.rewind = function() { 47766 var mappedState = Component.rewind(); 47767 if (!mappedState) { 47768 mappedState = mapStateOnServer({ 47769 baseTag: [], 47770 bodyAttributes: {}, 47771 htmlAttributes: {}, 47772 linkTags: [], 47773 metaTags: [], 47774 noscriptTags: [], 47775 scriptTags: [], 47776 styleTags: [], 47777 title: "", 47778 titleAttributes: {} 47779 }); 47780 } 47781 return mappedState; 47782 }, _temp; 47783 }; 47784 var NullComponent = function NullComponent2() { 47785 return null; 47786 }; 47787 var HelmetSideEffects = withSideEffect(reducePropsToState, handleClientStateChange, mapStateOnServer)(NullComponent); 47788 var HelmetExport = Helmet(HelmetSideEffects); 47789 HelmetExport.renderStatic = HelmetExport.rewind; 47790 var p$3 = "iOSFourthwall", n$1 = "AndroidFourthwall"; 47791 var f$4 = (t2) => t2.includes(p$3), c$3 = (t2) => t2.includes(n$1), O$4 = (t2) => f$4(t2) || c$3(t2); 47792 var E$3 = reactExports.createContext(void 0), z$3 = (e2, o2) => o2 ? "android" : e2 ? "ios" : null, $$5 = (e2, o2) => !e2 || !o2 ? {} : (Array.isArray(e2) ? e2 : [e2]).reduce((s2, i2) => __spreadValues(__spreadValues({}, s2), i2[o2]), {}), Q$3 = ({ userAgent: e2, methods: o2, children: t2 }) => { 47793 let s2 = f$4(e2), i2 = c$3(e2), d2 = O$4(e2); 47794 reactExports.useEffect(() => { 47795 if (d2) return document.body.classList.add("webview"), () => { 47796 document.body.classList.remove("webview"); 47797 }; 47798 }, [d2]); 47799 let p2 = reactExports.useMemo(() => ({ userAgent: e2, isWebView: d2, isIos: s2, isAndroid: i2, methods: $$5(o2, z$3(s2, i2)) }), [e2, d2, s2, i2, o2]); 47800 return jsxRuntimeExports.jsx(E$3.Provider, { value: p2, children: t2 }); 47801 }, w$6 = () => { 47802 let e2 = reactExports.useContext(E$3); 47803 if (e2 === void 0) throw new Error("useWebViewBridge must be used within a WebViewBridgeProvider"); 47804 return e2; 47805 }; 47806 const HeadContent = ({ 47807 meta, 47808 title, 47809 titleTemplate, 47810 defaultTitle, 47811 stylesUrl, 47812 children 47813 }) => { 47814 const { isWebView } = w$6(); 47815 const props = omitBy({ title, titleTemplate, defaultTitle, meta }, isEmpty); 47816 return /* @__PURE__ */ jsxRuntimeExports.jsxs(HelmetExport, __spreadProps(__spreadValues({}, props), { children: [
47817 stylesUrl && /* @__PURE__ */ jsxRuntimeExports.jsx("link", { rel: "stylesheet", href: stylesUrl }), 47818 isWebView && /* @__PURE__ */ jsxRuntimeExports.jsx( 47819 "meta", 47820 { 47821 name: "viewport", 47822 content: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" 47823 } 47824 ), 47825 children 47826 ] })); 47827 }; 47828 const Container$i = dt$2.div` 47829 align-self: flex-start; 47830 display: flex; 47831 justify-content: center; 47832 align-items: center; 47833 background: var(--bg-primary); 47834 border: 1px solid var(--input-border, var(--border-secondary)); 47835 color: transparent; 47836 border-radius: var(--panel-radius-static); 47837 47838 ${({ $size }) => $size === "small" && lt$2` 47839 width: 20px; 47840 min-width: 20px; 47841 height: 20px; 47842 min-height: 20px; 47843 `} 47844 47845 ${({ $size }) => $size === "medium" && lt$2` 47846 width: 24px; 47847 min-width: 24px; 47848 height: 24px; 47849 min-height: 24px; 47850 `} 47851 47852 ${({ $size }) => $size === "large" && lt$2` 47853 width: 32px; 47854 min-width: 32px; 47855 height: 32px; 47856 min-height: 32px; 47857 `} 47858 47859 &:hover { 47860 border: 1px solid var(--input-border-hover); 47861 } 47862 47863 input:checked + & { 47864 background: var(--bg-brand); 47865 border-color: var(--bg-brand); 47866 color: var(--text-primary-invert); 47867 } 47868 47869 input:disabled + & { 47870 cursor: not-allowed; 47871 background: var(--bg-tertiary); 47872 border-color: var(--border-secondary); 47873 } 47874 47875 input:checked:disabled + & { 47876 background: var(--bg-tertiary); 47877 color: var(--border-secondary); 47878 } 47879 47880 input:focus-visible + & { 47881 outline: 1px solid color-mix(in oklab, var(--border-active) 40%, transparent); 47882 outline-offset: 2px; 47883 } 47884 47885 input:indeterminate + & { 47886 background: var(--bg-brand); 47887 border-color: var(--bg-brand); 47888 color: var(--text-primary-invert); 47889 } 47890`; 47891 const TICK_ICON_SIZE = { 47892 small: 10, 47893 medium: 12, 47894 large: 16 47895 }; 47896 const CheckboxIcon = ({ size = "medium", indeterminate }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Container$i, { $size: size, "aria-hidden": "true", children: indeterminate ? /* @__P
47896URE__ */ jsxRuntimeExports.jsx(wt$2, { height: TICK_ICON_SIZE[size] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(yc, { height: TICK_ICON_SIZE[size] }) }); 47897 const Container$h = dt$2.div` 47898 position: relative; 47899 user-select: none; 47900`; 47901 const TooltipWrapper = dt$2.span` 47902 display: inline-flex; 47903 vertical-align: middle; 47904 margin-left: var(--space-150); 47905 color: var(--text-primary); 47906 47907 ${({ $disabled }) => $disabled && lt$2` 47908 color: var(--text-secondary); 47909 `} 47910`; 47911 const Label$1 = dt$2.label` 47912 display: flex; 47913 47914 & > * + * { 47915 margin-left: var(--space-300); 47916 } 47917 47918 ${({ $labelAlign }) => $labelAlign === "start" && lt$2` 47919 align-items: flex-start; 47920 `} 47921 47922 ${({ $labelAlign }) => $labelAlign === "center" && lt$2` 47923 align-items: center; 47924 `} 47925 47926 ${({ $labelAlign }) => $labelAlign === "end" && lt$2` 47927 align-items: flex-end; 47928 `} 47929 47930 ${({ $disabled }) => !$disabled && lt$2` 47931 cursor: pointer; 47932 47933 &:hover:not(:has(${TooltipWrapper}:hover)) { 47934 ${Container$i} { 47935 border-color: var(--border-active); 47936 } 47937 } 47938 `} 47939 47940 ${({ $disabled }) => $disabled && lt$2` 47941 cursor: not-allowed; 47942 `} 47943`; 47944 const CheckboxLabel = dt$2.div` 47945 cursor: inherit; 47946`; 47947 const Input = dt$2.input` 47948 clip: rect(1px, 1px, 1px, 1px); 47949 47950 position: absolute; 47951`; 47952 const LabelText = dt$2.span` 47953 font-size: var(--font-size-400); 47954 line-height: var(--font-line-height-400); 47955 47956 color: var(--text-primary); 47957 47958 ${({ $disabled }) => $disabled && lt$2` 47959 color: var(--text-secondary); 47960 `} 47961`; 47962 const Description$2 = dt$2.div` 47963 color: var(--text-secondary); 47964 font-size: var(--font-size-300); 47965 47966 a { 47967 text-decoration: underline; 47968 47969 &:hover { 47970 color: var(--text-link); 47971 } 47972 } 47973`; 47974 const Container$g = dt$2.div` 47975 display: flex; 47976 flex-direction: column; 47977 align-items: center; 47978 justify-content: center; 47979 47980 width: 100vw; 47981 height: 100vh; 47982`; 47983 const LoaderSuspenseFallback = () => { 47984 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$g, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }); 47985 }; 47986 const ShopName = dt$2.h1` 47987 color: var(--text-primary); 47988 font-size: var(--font-size-600); 47989 line-height: var(--font-line-height-500); 47990 letter-spacing: var(--font-letter-spacing-dense); 47991 47992 font-family: var(--font-family-heading); 47993 font-style: var(--font-style-heading); 47994 font-weight: var(--font-weight-480); 47995 text-transform: var(--text-transform-heading); 47996`; 47997 const Image$2 = dt$2.img` 47998 width: 100%; 47999 max-width: var(--logo-width, 350px); 48000 max-height: 100px; 48001 48002 object-fit: contain; 48003`; 48004 const ShopLogo = ({ name, url }) => { 48005 return /* @__PURE__ */ jsxRuntimeExports.jsx(ShopName, { children: url ? /* @__PURE__ */ jsxRuntimeExports.jsx(Image$2, { src: url, alt: name, "data-testid": "ShopLogo.Image" }) : name }); 48006 }; 48007 const CheckboxComponent = ({ 48008 label, 48009 labelAlign = "start", 48010 description, 48011 tooltip, 48012 size = "medium", 48013 indeterminate, 48014 id: id2, 48015 name, 48016 value, 48017 checked, 48018 disabled, 48019 native, 48020 onChange, 48021 onValueChange, 48022 onBlur 48023 }) => { 48024 const handleChange = (e2) => { 48025 if (onChange) { 48026 onChange(e2); 48027 } 48028 if (onValueChange) { 48029 onValueChange(e2.target.checked); 48030 } 48031 }; 48032 const handleBlur = (e2) => { 48033 if (onBlur) { 48034 onBlur(e2); 48035 } 48036 }; 48037 const getChecked = () => { 48038 if (native) return checked; 48039 return typeof value === "boolean" ? value : void 0; 48040 }; 48041 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$h, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { $disabled: Boolean(disabled), $labelAlign: labelAlign, "data-testid": "Checkbox", children: [
48042 /* @__PURE__ */ jsxRuntimeExports.jsxs(CheckboxLabel, { children: [ 48043 /* @__PURE__ */ jsxRuntimeExports.jsx( 48044 Input, 48045 { 48046 type: "checkbox", 48047 id: id2, 48048 name, 48049 value: typeof value === "string" ? value : void 0, 48050 checked: getChecked(), 48051 disabled, 48052 onChange: handleChange, 48053 onBlur: handleBlur 48054 } 48055 ), 48056 /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxIcon, { size, indeterminate }) 48057 ] }), 48058 (label || description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ 48059 label && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48060 /* @__PURE__ */ jsxRuntimeExports.jsx(LabelText, { $disabled: Boolean(disabled), children: label }), 48061 tooltip && /* @__PURE__ */ jsxRuntimeExports.jsx( 48062 TooltipWrapper, 48063 { 48064 $disabled: Boolean(disabled), 48065 onClick: (e2) => e2.stopPropagation(), 48066 children: /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipIcon, { tooltipContent: tooltip }) 48067 } 48068 ) 48069 ] }),
vendor: 10,350 bytes, lines 48070-48259
48070 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$2, { children: description }) 48071 ] }) 48072 ] }) }); 48073 }; 48074 const Checkbox = Fr$2(CheckboxComponent); 48075 function r$1(e2) { 48076 var t2, f2, n2 = ""; 48077 if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; 48078 else if ("object" == typeof e2) if (Array.isArray(e2)) { 48079 var o2 = e2.length; 48080 for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2); 48081 } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); 48082 return n2; 48083 } 48084 function clsx() { 48085 for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2); 48086 return n2; 48087 } 48088 var dayjs_min$1 = { exports: {} }; 48089 var dayjs_min = dayjs_min$1.exports; 48090 var hasRequiredDayjs_min; 48091 function requireDayjs_min() { 48092 if (hasRequiredDayjs_min) return dayjs_min$1.exports; 48093 hasRequiredDayjs_min = 1; 48094 (function(module2, exports$1) { 48095 !(function(t2, e2) { 48096 module2.exports = e2(); 48097 })(dayjs_min, (function() { 48098 var t2 = 1e3, e2 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y2 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) { 48099 var e3 = ["th", "st", "nd", "rd"], n3 = t3 % 100; 48100 return "[" + t3 + (e3[(n3 - 20) % 10] || e3[n3] || e3[0]) + "]"; 48101 } }, m2 = function(t3, e3, n3) { 48102 var r3 = String(t3); 48103 return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n3) + t3; 48104 }, v2 = { s: m2, z: function(t3) { 48105 var e3 = -t3.utcOffset(), n3 = Math.abs(e3), r3 = Math.floor(n3 / 60), i3 = n3 % 60; 48106 return (e3 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0"); 48107 }, m: function t3(e3, n3) { 48108 if (e3.date() < n3.date()) return -t3(n3, e3); 48109 var r3 = 12 * (n3.year() - e3.year()) + (n3.month() - e3.month()), i3 = e3.clone().add(r3, c2), s3 = n3 - i3 < 0, u3 = e3.clone().add(r3 + (s3 ? -1 : 1), c2); 48110 return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0); 48111 }, a: function(t3) { 48112 return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3); 48113 }, p: function(t3) { 48114 return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f2 }[t3] || String(t3 || "").toLowerCase().replace(/s$/, ""); 48115 }, u: function(t3) { 48116 return void 0 === t3; 48117 } }, g2 = "en", D2 = {}; 48118 D2[g2] = M2; 48119 var p2 = "$isDayjsObject", S2 = function(t3) { 48120 return t3 instanceof _2 || !(!t3 || !t3[p2]); 48121 }, w2 = function t3(e3, n3, r3) { 48122 var i3; 48123 if (!e3) return g2; 48124 if ("string" == typeof e3) { 48125 var s3 = e3.toLowerCase(); 48126 D2[s3] && (i3 = s3), n3 && (D2[s3] = n3, i3 = s3); 48127 var u3 = e3.split("-"); 48128 if (!i3 && u3.length > 1) return t3(u3[0]); 48129 } else { 48130 var a3 = e3.name; 48131 D2[a3] = e3, i3 = a3; 48132 } 48133 return !r3 && i3 && (g2 = i3), i3 || !r3 && g2; 48134 }, O2 = function(t3, e3) { 48135 if (S2(t3)) return t3.clone(); 48136 var n3 = "object" == typeof e3 ? e3 : {}; 48137 return n3.date = t3, n3.args = arguments, new _2(n3); 48138 }, b2 = v2; 48139 b2.l = w2, b2.i = S2, b2.w = function(t3, e3) { 48140 return O2(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset }); 48141 }; 48142 var _2 = (function() { 48143 function M3(t3) { 48144 this.$L = w2(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p2] = true; 48145 } 48146 var m3 = M3.prototype; 48147 return m3.parse = function(t3) { 48148 this.$d = (function(t4) { 48149 var e3 = t4.date, n3 = t4.utc; 48150 if (null === e3) return /* @__PURE__ */ new Date(NaN); 48151 if (b2.u(e3)) return /* @__PURE__ */ new Date(); 48152 if (e3 instanceof Date) return new Date(e3); 48153 if ("string" == typeof e3 && !/Z$/i.test(e3)) { 48154 var r3 = e3.match($2); 48155 if (r3) { 48156 var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3); 48157 return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3); 48158 } 48159 } 48160 return new Date(e3); 48161 })(t3), this.init(); 48162 }, m3.init = function() { 48163 var t3 = this.$d; 48164 this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds(); 48165 }, m3.$utils = function() { 48166 return b2; 48167 }, m3.isValid = function() { 48168 return !(this.$d.toString() === l2); 48169 }, m3.isSame = function(t3, e3) { 48170 var n3 = O2(t3); 48171 return this.startOf(e3) <= n3 && n3 <= this.endOf(e3); 48172 }, m3.isAfter = function(t3, e3) { 48173 return O2(t3) < this.startOf(e3); 48174 }, m3.isBefore = function(t3, e3) { 48175 return this.endOf(e3) < O2(t3); 48176 }, m3.$g = function(t3, e3, n3) { 48177 return b2.u(t3) ? this[e3] : this.set(n3, t3); 48178 }, m3.unix = function() { 48179 return Math.floor(this.valueOf() / 1e3); 48180 }, m3.valueOf = function() { 48181 return this.$d.getTime(); 48182 }, m3.startOf = function(t3, e3) { 48183 var n3 = this, r3 = !!b2.u(e3) || e3, f3 = b2.p(t3), l3 = function(t4, e4) { 48184 var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e4, t4) : new Date(n3.$y, e4, t4), n3); 48185 return r3 ? i3 : i3.endOf(a2); 48186 }, $3 = function(t4, e4) { 48187 return b2.w(n3.toDate()[t4].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n3); 48188 }, y3 = this.$W, M4 = this.$M, m4 = this.$D, v3 = "set" + (this.$u ? "UTC" : ""); 48189 switch (f3) { 48190 case h2: 48191 return r3 ? l3(1, 0) : l3(31, 11); 48192 case c2: 48193 return r3 ? l3(1, M4) : l3(0, M4 + 1); 48194 case o2: 48195 var g3 = this.$locale().weekStart || 0, D3 = (y3 < g3 ? y3 + 7 : y3) - g3; 48196 return l3(r3 ? m4 - D3 : m4 + (6 - D3), M4); 48197 case a2: 48198 case d2: 48199 return $3(v3 + "Hours", 0); 48200 case u2: 48201 return $3(v3 + "Minutes", 1); 48202 case s2: 48203 return $3(v3 + "Seconds", 2); 48204 case i2: 48205 return $3(v3 + "Milliseconds", 3); 48206 default: 48207 return this.clone(); 48208 } 48209 }, m3.endOf = function(t3) { 48210 return this.startOf(t3, false); 48211 }, m3.$set = function(t3, e3) { 48212 var n3, o3 = b2.p(t3), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f3 + "Date", n3[d2] = f3 + "Date", n3[c2] = f3 + "Month", n3[h2] = f3 + "FullYear", n3[u2] = f3 + "Hours", n3[s2] = f3 + "Minutes", n3[i2] = f3 + "Seconds", n3[r2] = f3 + "Milliseconds", n3)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3; 48213 if (o3 === c2 || o3 === h2) { 48214 var y3 = this.clone().set(d2, 1); 48215 y3.$d[l3]($3), y3.init(), this.$d = y3.set(d2, Math.min(this.$D, y3.daysInMonth())).$d; 48216 } else l3 && this.$d[l3]($3); 48217 return this.init(), this; 48218 }, m3.set = function(t3, e3) { 48219 return this.clone().$set(t3, e3); 48220 }, m3.get = function(t3) { 48221 return this[b2.p(t3)](); 48222 }, m3.add = function(r3, f3) { 48223 var d3, l3 = this; 48224 r3 = Number(r3); 48225 var $3 = b2.p(f3), y3 = function(t3) { 48226 var e3 = O2(l3); 48227 return b2.w(e3.date(e3.date() + Math.round(t3 * r3)), l3); 48228 }; 48229 if ($3 === c2) return this.set(c2, this.$M + r3); 48230 if ($3 === h2) return this.set(h2, this.$y + r3); 48231 if ($3 === a2) return y3(1); 48232 if ($3 === o2) return y3(7); 48233 var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n2, d3[i2] = t2, d3)[$3] || 1, m4 = this.$d.getTime() + r3 * M4; 48234 return b2.w(m4, this); 48235 }, m3.subtract = function(t3, e3) { 48236 return this.add(-1 * t3, e3); 48237 }, m3.format = function(t3) { 48238 var e3 = this, n3 = this.$locale(); 48239 if (!this.isValid()) return n3.invalidDate || l2; 48240 var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c3 = n3.months, f3 = n3.meridiem, h3 = function(t4, n4, i4, s4) { 48241 return t4 && (t4[n4] || t4(e3, r3)) || i4[n4].slice(0, s4); 48242 }, d3 = function(t4) { 48243 return b2.s(s3 % 12 || 12, t4, "0"); 48244 }, $3 = f3 || function(t4, e4, n4) { 48245 var r4 = t4 < 12 ? "AM" : "PM"; 48246 return n4 ? r4.toLowerCase() : r4; 48247 }; 48248 return r3.replace(y2, (function(t4, r4) { 48249 return r4 || (function(t5) { 48250 switch (t5) { 48251 case "YY": 48252 return String(e3.$y).slice(-2); 48253 case "YYYY": 48254 return b2.s(e3.$y, 4, "0"); 48255 case "M": 48256 return a3 + 1; 48257 case "MM": 48258 return b2.s(a3 + 1, 2, "0"); 48259 case "MMM":
48260 return h3(n3.monthsShort, a3, c3, 3); 48261 case "MMMM": 48262 return h3(c3, a3); 48263 case "D": 48264 return e3.$D; 48265 case "DD": 48266 return b2.s(e3.$D, 2, "0"); 48267 case "d": 48268 return String(e3.$W); 48269 case "dd": 48270 return h3(n3.weekdaysMin, e3.$W, o3, 2); 48271 case "ddd": 48272 return h3(n3.weekdaysShort, e3.$W, o3, 3); 48273 case "dddd": 48274 return o3[e3.$W]; 48275 case "H": 48276 return String(s3); 48277 case "HH": 48278 return b2.s(s3, 2, "0"); 48279 case "h": 48280 return d3(1); 48281 case "hh": 48282 return d3(2); 48283 case "a": 48284 return $3(s3, u3, true); 48285 case "A": 48286 return $3(s3, u3, false); 48287 case "m": 48288 return String(u3); 48289 case "mm": 48290 return b2.s(u3, 2, "0"); 48291 case "s": 48292 return String(e3.$s); 48293 case "ss": 48294 return b2.s(e3.$s, 2, "0"); 48295 case "SSS": 48296 return b2.s(e3.$ms, 3, "0"); 48297 case "Z": 48298 return i3; 48299 } 48300 return null; 48301 })(t4) || i3.replace(":", ""); 48302 })); 48303 }, m3.utcOffset = function() { 48304 return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); 48305 }, m3.diff = function(r3, d3, l3) { 48306 var $3, y3 = this, M4 = b2.p(d3), m4 = O2(r3), v3 = (m4.utcOffset() - this.utcOffset()) * e2, g3 = this - m4, D3 = function() { 48307 return b2.m(y3, m4); 48308 }; 48309 switch (M4) { 48310 case h2: 48311 $3 = D3() / 12; 48312 break; 48313 case c2: 48314 $3 = D3(); 48315 break; 48316 case f2: 48317 $3 = D3() / 3; 48318 break; 48319 case o2: 48320 $3 = (g3 - v3) / 6048e5; 48321 break; 48322 case a2: 48323 $3 = (g3 - v3) / 864e5; 48324 break; 48325 case u2: 48326 $3 = g3 / n2; 48327 break; 48328 case s2: 48329 $3 = g3 / e2; 48330 break; 48331 case i2: 48332 $3 = g3 / t2; 48333 break; 48334 default: 48335 $3 = g3; 48336 } 48337 return l3 ? $3 : b2.a($3); 48338 }, m3.daysInMonth = function() { 48339 return this.endOf(c2).$D; 48340 }, m3.$locale = function() { 48341 return D2[this.$L]; 48342 }, m3.locale = function(t3, e3) { 48343 if (!t3) return this.$L; 48344 var n3 = this.clone(), r3 = w2(t3, e3, true); 48345 return r3 && (n3.$L = r3), n3; 48346 }, m3.clone = function() { 48347 return b2.w(this.$d, this); 48348 }, m3.toDate = function() { 48349 return new Date(this.valueOf()); 48350 }, m3.toJSON = function() { 48351 return this.isValid() ? this.toISOString() : null; 48352 }, m3.toISOString = function() { 48353 return this.$d.toISOString(); 48354 }, m3.toString = function() { 48355 return this.$d.toUTCString(); 48356 }, M3; 48357 })(), k2 = _2.prototype; 48358 return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach((function(t3) { 48359 k2[t3[1]] = function(e3) { 48360 return this.$g(e3, t3[0], t3[1]); 48361 }; 48362 })), O2.extend = function(t3, e3) { 48363 return t3.$i || (t3(e3, _2, O2), t3.$i = true), O2; 48364 }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t3) { 48365 return O2(1e3 * t3); 48366 }, O2.en = D2[g2], O2.Ls = D2, O2.p = {}, O2; 48367 })); 48368 })(dayjs_min$1); 48369 return dayjs_min$1.exports; 48370 } 48371 var dayjs_minExports = requireDayjs_min(); 48372 const Un$1 = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports); 48373 const NotFoundErrorPage = ({ to: to2 }) => { 48374 return /* @__PURE__ */ jsxRuntimeExports.jsx( 48375 ErrorPage, 48376 { 48377 to: to2, 48378 heading: "404", 48379 description: "We canât seem to find the page youâre looking for." 48380 } 48381 ); 48382 }; 48383 const Container$f = dt$2.div` 48384 outline: none; 48385`; 48386 const AutoFocusableContainer = ({ id: id2, enabled = true, children }) => { 48387 const containerRef = reactExports.useRef(null); 48388 const timeoutRef = reactExports.useRef(); 48389 reactExports.useEffect(() => { 48390 if (enabled) { 48391 timeoutRef.current = setTimeout(() => { 48392 var _a; 48393 (_a = containerRef.current) == null ? void 0 : _a.focus({ preventScroll: true }); 48394 }, 0); 48395 } else { 48396 clearTimeout(timeoutRef.current); 48397 } 48398 return () => { 48399 clearTimeout(timeoutRef.current); 48400 }; 48401 }, [id2, enabled]); 48402 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$f, { ref: containerRef, tabIndex: -1, "data-testid": "AutoFocusableContainer", children }); 48403 }; 48404 const ModalContext = reactExports.createContext({ 48405 open: () => { 48406 }, 48407 close: () => { 48408 } 48409 }); 48410 const ModalAnimationContext = reactExports.createContext({ 48411 isOpen: true, 48412 onExited: void 0 48413 }); 48414 const EXIT_FALLBACK_MS = 500; 48415 const ModalProvider = ({ children }) => { 48416 const media = useMediaQueryContext(); 48417 const [modalState, setModalState] = reactExports.useState(); 48418 const [open, setOpen] = reactExports.useState(false); 48419 const exitTimer = reactExports.useRef(); 48420 const modalId = reactExports.useRef(0); 48421 const clearExitTimer = reactExports.useCallback(() => { 48422 if (exitTimer.current) clearTimeout(exitTimer.current); 48423 exitTimer.current = void 0; 48424 }, []); 48425 reactExports.useEffect(() => clearExitTimer, [clearExitTimer]); 48426 const finalizeClose = reactExports.useCallback( 48427 (id2) => { 48428 if (id2 !== modalId.current) return; 48429 clearExitTimer(); 48430 setOpen(false); 48431 setModalState({ id: id2, component: null, props: {} }); 48432 }, 48433 [clearExitTimer] 48434 ); 48435 const openModal = reactExports.useCallback( 48436 (component, props2) => { 48437 clearExitTimer(); 48438 modalId.current += 1; 48439 setModalState({ id: modalId.current, component, props: props2 }); 48440 setOpen(true); 48441 }, 48442 [clearExitTimer] 48443 ); 48444 const closeModal = reactExports.useCallback(() => { 48445 const id2 = modalId.current; 48446 if (media.tablet) { 48447 finalizeClose(id2); 48448 return; 48449 } 48450 setOpen(false); 48451 clearExitTimer(); 48452 exitTimer.current = setTimeout(() => finalizeClose(id2), EXIT_FALLBACK_MS); 48453 }, [media.tablet, finalizeClose, clearExitTimer]); 48454 const value = reactExports.useMemo( 48455 () => ({ 48456 open: openModal, 48457 close: closeModal 48458 }), 48459 [openModal, closeModal] 48460 ); 48461 const Component = modalState == null ? void 0 : modalState.component; 48462 const props = (modalState == null ? void 0 : modalState.props) || {}; 48463 const mounted = !!Component; 48464 const currentId = modalState == null ? void 0 : modalState.id; 48465 const animation = reactExports.useMemo( 48466 () => ({ 48467 isOpen: open, 48468 onExited: currentId === void 0 ? void 0 : () => finalizeClose(currentId) 48469 }), 48470 [open, finalizeClose, currentId] 48471 ); 48472 const { refs, context } = useFloating({ open: mounted }); 48473 const role = useRole(context, { role: "dialog" }); 48474 const { getFloatingProps } = useInteractions([role]); 48475 useEscapeKey(mounted && media.tablet, () => { 48476 var _a; 48477 return ((_a = props == null ? void 0 : props.onRequestClose) != null ? _a : closeModal)(); 48478 });
48479 const modal = mounted && Component && /* @__PURE__ */ jsxRuntimeExports.jsx( 48480 "div", 48481 __spreadProps(__spreadValues({ 48482 ref: refs.setFloating, 48483 style: { zIndex: 1e3 }, 48484 "aria-labelledby": "modal-box", 48485 "aria-describedby": "modal-box" 48486 }, getFloatingProps()), { 48487 children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalAnimationContext.Provider, { value: animation, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Component, __spreadValues({ close: closeModal }, props)) }) 48488 }) 48489 ); 48490 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ModalContext.Provider, { value, children: [ 48491 children, 48492 /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingPortal, { children: media.tablet ? modal && /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingFocusManager, { context, modal: true, children: modal }) : modal }) 48493 ] }); 48494 }; 48495 const useModalContext = () => { 48496 return reactExports.useContext(ModalContext); 48497 }; 48498 const useModalAnimation = () => { 48499 return reactExports.useContext(ModalAnimationContext); 48500 }; 48501 const BOTTOM_SPACING = overlayBottomOffset("var(--space-600)"); 48502 const FOOTER_BOTTOM_SPACING = overlayBottomOffset("var(--space-500)"); 48503 const Container$e = dt$2.div` 48504 position: fixed; 48505 top: 0; 48506 left: 0; 48507 z-index: 10; 48508 48509 display: flex; 48510 align-items: center; 48511 justify-content: center; 48512 48513 width: 100vw; 48514 height: 100vh; 48515 padding: var(--space-400); 48516 48517 &::after { 48518 display: block; 48519 content: ''; 48520 position: absolute; 48521 height: 50px; 48522 width: 100%; 48523 top: 100%; 48524 background: var(--bg-primary); 48525 } 48526 48527 ${mediaQueries.tablet} { 48528 flex-direction: row; 48529 padding: var(--space-1200); 48530 48531 &::after { 48532 display: none; 48533 } 48534 } 48535 48536 ${({ $blurOverlay }) => $blurOverlay && lt$2` 48537 backdrop-filter: blur(100px); 48538 `}; 48539`; 48540 const Overlay = dt$2.div` 48541 position: absolute; 48542 top: 0; 48543 left: 0; 48544 right: 0; 48545 bottom: 0; 48546 48547 background: var(--color-black-alpha-1500); 48548`; 48549 const getMaxWidth = ({ $size, $maxWidth, $width }) => { 48550 const maxWidths = { 48551 small: "480px", 48552 medium: "600px", 48553 large: "800px", 48554 xlarge: "960px", 48555 fullScreen: "none" 48556 }; 48557 if ($width) return "100%"; 48558 return $maxWidth ? `${$maxWidth}px` : maxWidths[$size]; 48559 }; 48560 const Box = dt$2.div` 48561 flex: ${({ $width }) => $width ? "0 1 auto" : "1 0 auto"}; 48562 display: flex; 48563 flex-direction: column; 48564 position: fixed; 48565 bottom: 0; 48566 left: 0; 48567 right: 0; 48568 48569 padding: var(--space-600) var(--space-500); 48570 padding-bottom: ${BOTTOM_SPACING}; 48571 background: var(--bg-primary); 48572 width: ${({ $width }) => $width || "100%"}; 48573 max-height: calc(100% - 96px); 48574 overflow-y: auto; 48575 overflow-x: hidden; 48576 48577 border-radius: var(--panel-radius-normal); 48578 48579 color: var(--text-primary); 48580 48581 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48582 padding: var(--space-0); 48583 padding-bottom: ${OVERLAY_BOTTOM_INSET}; 48584 `}; 48585 48586 ${({ $size }) => $size === "fullScreen" && lt$2` 48587 max-height: none; 48588 top: 0; 48589 `}; 48590 48591 ${mediaQueries.tablet} { 48592 position: relative; 48593 padding: var(--space-600); 48594 bottom: auto; 48595 left: auto; 48596 right: auto; 48597 top: auto; 48598 overflow: auto; 48599 max-width: ${getMaxWidth}; 48600 max-height: calc(100vh - 96px); 48601 48602 ${({ $height }) => $height && lt$2` 48603 height: min(${$height}px, calc(100vh - 96px)); 48604 `}; 48605 48606 ${({ $size }) => $size === "fullScreen" && lt$2` 48607 height: 100%; 48608 `}; 48609 48610 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48611 padding: var(--space-0); 48612 `}; 48613 48614 ${({ $disableScrolling }) => $disableScrolling && lt$2` 48615 overflow: visible; 48616 `}; 48617 } 48618`; 48619 const FullscreenCoverBody = dt$2.div` 48620 flex: 1; 48621 min-height: 0; 48622 display: flex; 48623 flex-direction: column; 48624 48625 padding: var(--space-600) var(--space-500); 48626 padding-bottom: ${BOTTOM_SPACING}; 48627 overflow-y: auto; 48628 overflow-x: hidden; 48629 48630 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48631 padding: var(--space-0); 48632 padding-bottom: ${OVERLAY_BOTTOM_INSET}; 48633 `}; 48634`; 48635 const MobileBody = dt$2.div` 48636 padding: 0 var(--space-400) var(--space-600); 48637 48638 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48639 padding: 0; 48640 `}; 48641`; 48642 const MobileFooter = dt$2.div` 48643 display: flex; 48644 flex-direction: column; 48645 gap: var(--space-300); 48646`; 48647 const FormAnchor = dt$2.span` 48648 display: none; 48649`; 48650 const CloseButtonWrapper = dt$2.div` 48651 position: absolute; 48652 top: var(--space-100); 48653 right: var(--space-100); 48654 z-index: 1; 48655`; 48656 const TopContentContainer = dt$2.div` 48657 margin: var(--space-n600) var(--space-n600) var(--space-600); 48658 48659 ${({ $withoutPadding }) => $withoutPadding && lt$2` 48660 margin: var(--space-0) var(--space-0) var(--space-600); 48661 `}; 48662`; 48663 const TitleContainer = dt$2.div` 48664 margin-bottom: var(--space-300); 48665 48666 word-break: break-word; 48667 color: var(--text-primary); 48668 48669 ${mediaQueries.tablet} { 48670 margin-bottom: var(--space-600); 48671 } 48672`; 48673 const Footer = dt$2.div` 48674 display: flex; 48675 flex-direction: column; 48676 position: sticky; 48677 z-index: 10; 48678 margin: var(--space-300) var(--space-n500) var(--space-n600); 48679 padding: var(--space-300) var(--space-500) var(--space-500); 48680 bottom: calc(-1 * ${BOTTOM_SPACING}); 48681 margin-bottom: calc(-1 * ${BOTTOM_SPACING}); 48682 padding-bottom: ${FOOTER_BOTTOM_SPACING}; 48683 background: var(--bg-primary); 48684 border-bottom-left-radius: var(--panel-radius-normal); 48685 border-bottom-right-radius: var(--panel-radius-normal); 48686 48687 ${({ $withDivider }) => $withDivider && lt$2` 48688 border-top: 1px solid var(--border-secondary); 48689 `}; 48690 48691 ${mediaQueries.tablet} { 48692 bottom: var(--space-n600); 48693 margin: var(--space-n600); 48694 margin-top: var(--space-400); 48695 padding: var(--space-300) var(--space-600) var(--space-500); 48696 z-index: 2; 48697 flex-direction: row; 48698 } 48699`; 48700 const FooterContent = dt$2.div` 48701 display: flex; 48702 padding: var(--space-400) var(--space-0); 48703 justify-content: center; 48704 width: 100%; 48705 48706 ${mediaQueries.tablet} { 48707 justify-content: flex-start;
48708 align-items: center; 48709 padding: var(--space-0); 48710 } 48711`; 48712 const ButtonsContent = dt$2.div` 48713 flex: 1; 48714`; 48715 const ChildrenContainer = dt$2.div` 48716 flex: 1; 48717 48718 flex-direction: column; 48719 display: flex; 48720 48721 /* body/md/regular */ 48722 font-size: var(--font-size-400); 48723 font-weight: var(--font-weight-400); 48724 line-height: var(--font-line-height-400); 48725 letter-spacing: var(--font-letter-spacing-normal); 48726 48727 text-underline-offset: var(--space-100); 48728 text-decoration-skip-ink: none; 48729 48730 p + p { 48731 margin-top: var(--space-400); 48732 } 48733 48734 ${({ $disableScrolling }) => $disableScrolling && lt$2` 48735 max-height: 100%; 48736 min-height: 0; 48737 `}; 48738`; 48739 const Cover = dt$2(motion.div)` 48740 position: absolute; 48741 inset: 0; 48742 display: flex; 48743 flex-direction: column; 48744 background: var(--bg-primary); 48745 color: var(--text-primary); 48746 48747 padding-top: ${OVERLAY_TOP_INSET}; 48748`; 48749 const Content$1 = dt$2.div` 48750 position: relative; 48751 flex: 1; 48752 min-height: 0; 48753 display: flex; 48754 flex-direction: column; 48755`; 48756 const OFFSCREEN = { 48757 bottom: { y: "100%" }, 48758 left: { x: "-100%" } 48759 }; 48760 const FullscreenCover = ({ 48761 children, 48762 isOpen, 48763 onClose, 48764 direction = "bottom", 48765 backdrop = true, 48766 onExited 48767 }) => { 48768 const offscreen = OFFSCREEN[direction]; 48769 return /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayShell, { isOpen, backdrop, onClose, onExited, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 48770 Cover, 48771 { 48772 role: "dialog", 48773 "aria-modal": "true", 48774 "data-testid": "FullscreenCover", 48775 initial: offscreen, 48776 animate: { x: 0, y: 0 }, 48777 exit: offscreen, 48778 transition: SPRING, 48779 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Content$1, { children }) 48780 } 48781 ) }); 48782 }; 48783 const Actions = dt$2.div` 48784 display: flex; 48785 flex-direction: column-reverse; 48786 gap: var(--space-200); 48787 width: 100%; 48788 48789 ${mediaQueries.tablet} { 48790 ${({ $align }) => $align === "right" && lt$2` 48791 flex-direction: row; 48792 justify-content: flex-end; 48793 align-items: center; 48794 `} 48795 48796 ${({ $align }) => $align === "spread" && lt$2` 48797 flex-direction: row; 48798 justify-content: space-between; 48799 `} 48800 48801 ${({ $align }) => $align === "stretch" && lt$2` 48802 flex-direction: row; 48803 48804 & > * { 48805 flex: 1; 48806 } 48807 `} 48808 48809 ${({ $align }) => $align === "stack" && lt$2` 48810 flex-direction: column-reverse; 48811 `} 48812 } 48813`; 48814 const OverlayActions = ({ align = "right", children }) => { 48815 const { tablet } = useMediaQueryContext(); 48816 const items = tablet ? children : reactExports.Children.map( 48817 children, 48818 (child) => reactExports.isValidElement(child) && child.type === Button$1 ? reactExports.cloneElement(child, { size: "medium", fullWidth: true }) : child 48819 ); 48820 return /* @__PURE__ */ jsxRuntimeExports.jsx(Actions, { $align: align, children: items }); 48821 }; 48822 const ModalMobile = ({ 48823 title, 48824 mobileTitleInHeader = false, 48825 size, 48826 withoutPadding = false, 48827 withoutCloseButton = false, 48828 disableScrolling = false, 48829 topContent, 48830 withFooterDivider = false, 48831 footer, 48832 buttons, 48833 loading = false, 48834 children, 48835 isOpen, 48836 onClose, 48837 onExited 48838 }) => { 48839 const formAnchorRef = reactExports.useRef(null); 48840 const formAnchor = /* @__PURE__ */ jsxRuntimeExports.jsx(FormAnchor, { ref: formAnchorRef, "aria-hidden": true }); 48841 const withFormSubmit = (button, index2) => { 48842 const needsSubmitBridge = button.type === Button$1 && button.props.type === "submit" && !button.props.onClick; 48843 return reactExports.cloneElement(button, __spreadValues({ 48844 key: index2 48845 }, needsSubmitBridge && { 48846 onClick: () => { 48847 var _a, _b; 48848 return (_b = (_a = formAnchorRef.current) == null ? void 0 : _a.closest("form")) == null ? void 0 : _b.requestSubmit(); 48849 } 48850 })); 48851 }; 48852 const renderActions = () =>
48852 buttons && /* @__PURE__ */ jsxRuntimeExports.jsx(OverlayActions, { align: "stack", children: buttons.map(withFormSubmit) }); 48853 const renderFooter = () => buttons || footer ? /* @__PURE__ */ jsxRuntimeExports.jsxs(MobileFooter, { children: [ 48854 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }), 48855 renderActions() 48856 ] }) : void 0; 48857 const titleInHeader = !!title && mobileTitleInHeader; 48858 const renderTitle = () => !!title && !titleInHeader && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: "h4", children: title }) }); 48859 const renderBody = ($disableScrolling) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48860 topContent && /* @__PURE__ */ jsxRuntimeExports.jsx(TopContentContainer, { $withoutPadding: withoutPadding, children: topContent }), 48861 renderTitle(), 48862 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling, children }) 48863 ] }); 48864 const skeletonShapes = /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 16, children: [
48865 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "60%", height: "24px" }), 48866 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "20px" }), 48867 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "80%", height: "20px" }), 48868 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "90%", height: "20px" }) 48869 ] }); 48870 if (size === "fullScreen") { 48871 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48872 formAnchor, 48873 /* @__PURE__ */ jsxRuntimeExports.jsx(FullscreenCover, { isOpen, onClose, onExited, children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(FullscreenCoverBody, { $withoutPadding: withoutPadding, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48874 onClose && !withoutCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 48875 IconButton, 48876 { 48877 icon: $4, 48878 size: "micro", 48879 variant: "transparent", 48880 "aria-label": "Close", 48881 onClick: onClose, 48882 autoFocus: true 48883 } 48884 ) }),
48885 /* @__PURE__ */ jsxRuntimeExports.jsxs(FullscreenCoverBody, { $withoutPadding: withoutPadding, children: [ 48886 renderBody(disableScrolling), 48887 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer, { $withDivider: withFooterDivider, children: [ 48888 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }), 48889 renderActions() 48890 ] }) 48891 ] }) 48892 ] }) }) 48893 ] }); 48894 } 48895 if (!onClose) return null; 48896 if (disableScrolling) { 48897 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48898 formAnchor, 48899 /* @__PURE__ */ jsxRuntimeExports.jsx( 48900 BottomSheet, 48901 { 48902 isOpen, 48903 scrollable: false, 48904 title: titleInHeader ? title : void 0, 48905 footer: renderFooter(), 48906 onClose, 48907 onExited, 48908 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: false, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48909 renderTitle(), 48910 children 48911 ] }) 48912 } 48913 ) 48914 ] }); 48915 } 48916 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 48917 formAnchor,
48918 /* @__PURE__ */ jsxRuntimeExports.jsx( 48919 BottomSheet, 48920 { 48921 isOpen, 48922 title: titleInHeader ? title : void 0, 48923 footer: renderFooter(), 48924 onClose, 48925 onExited, 48926 children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: false, children: skeletonShapes }) : /* @__PURE__ */ jsxRuntimeExports.jsx(MobileBody, { $withoutPadding: withoutPadding, children: renderBody(true) }) 48927 } 48928 ) 48929 ] }); 48930 }; 48931 const ModalBox = (props) => { 48932 const { 48933 title, 48934 size = "medium", 48935 maxWidth, 48936 height, 48937 width, 48938 withoutPadding = false, 48939 withoutCloseButton = false, 48940 disableScrolling = false, 48941 blurOverlay = false, 48942 topContent, 48943 fullWidth, 48944 withFooterDivider = false, 48945 footer, 48946 buttons, 48947 buttonsDirection, 48948 loading = false, 48949 children, 48950 onClose 48951 } = props; 48952 const media = useMediaQueryContext(); 48953 const { set: setOverlayVisible } = useOverlayVisibility(); 48954 const { isOpen: overlayOpen, onExited } = useModalAnimation(); 48955 const rendersMobileOverlay = !media.tablet && (size === "fullScreen" || !!onClose); 48956 reactExports.useEffect(() => { 48957 if (rendersMobileOverlay) return void 0; 48958 setOverlayVisible(overlayOpen); 48959 return () => setOverlayVisible(false); 48960 }, [rendersMobileOverlay, overlayOpen, setOverlayVisible]); 48961 reactExports.useEffect(() => { 48962 if (!rendersMobileOverlay && !overlayOpen) onExited == null ? void 0 : onExited(); 48963 }, [rendersMobileOverlay, overlayOpen, onExited]); 48964 if (rendersMobileOverlay) { 48965 return /* @__PURE__ */ jsxRuntimeExports.jsx(ModalMobile, __spreadProps(__spreadValues({}, props), { isOpen: overlayOpen, onExited })); 48966 } 48967 if (loading) { 48968 return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$e, { $blurOverlay: blurOverlay, children: [
48969 /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { "data-testid": "ModalBox.Overlay", onPointerDown: onClose }), 48970 /* @__PURE__ */ jsxRuntimeExports.jsx( 48971 ModalBoxSkeleton, 48972 __spreadValues({}, { 48973 size, 48974 maxWidth, 48975 height, 48976 width, 48977 title, 48978 buttons, 48979 footer, 48980 withoutPadding, 48981 withFooterDivider 48982 }) 48983 ) 48984 ] }) }); 48985 } 48986 return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$e, { $blurOverlay: blurOverlay, children: [ 48987 /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { "data-testid": "ModalBox.Overlay", onPointerDown: onClose }), 48988 /* @__PURE__ */ jsxRuntimeExports.jsxs( 48989 Box, 48990 { 48991 $size: size, 48992 $maxWidth: maxWidth, 48993 $height: height, 48994 $width: width, 48995 $withoutPadding: withoutPadding, 48996 $disableScrolling: disableScrolling, 48997 role: "dialog", 48998 "aria-modal": "true", 48999 "data-testid": "ModalBox.Content", 49000 id: "modal-box", 49001 children: [
49002 onClose && !withoutCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButtonWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 49003 IconButton, 49004 { 49005 icon: $4, 49006 size: media.tablet ? "small" : "micro", 49007 variant: "transparent", 49008 "aria-label": "Close", 49009 onClick: onClose, 49010 autoFocus: true 49011 } 49012 ) }), 49013 topContent && /* @__PURE__ */ jsxRuntimeExports.jsx(TopContentContainer, { $withoutPadding: withoutPadding, children: topContent }), 49014 title && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Heading, { type: media.tablet ? "h3" : "h4", children: title }) }), 49015 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling: disableScrolling, children }), 49016 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer, { $withDivider: withFooterDivider, children: [ 49017 footer && /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, { children: footer }),
49018 buttons && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonsContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 49019 ButtonGroup, 49020 { 49021 justify: "right", 49022 align: "center", 49023 space: media.tablet ? "large" : "medium", 49024 fullWidth: fullWidth || !media.tablet, 49025 direction: buttonsDirection || (media.tablet ? "row" : "column-reverse"), 49026 children: buttons.map( 49027 (button, index2) => button.type === Button$1 ? reactExports.cloneElement(button, { 49028 key: index2, 49029 fullWidth: fullWidth || !media.tablet, 49030 size: "medium" 49031 }) : reactExports.cloneElement(button, { key: index2 }) 49032 ) 49033 } 49034 ) }) 49035 ] }) 49036 ] 49037 } 49038 ) 49039 ] }) }); 49040 }; 49041 const ModalBoxSkeleton = ({ 49042 size = "medium", 49043 maxWidth, 49044 height, 49045 width, 49046 title, 49047 buttons, 49048 footer, 49049 withoutPadding, 49050 withFooterDivider 49051 }) => { 49052 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 49053 Box, 49054 { 49055 $size: size, 49056 $maxWidth: maxWidth, 49057 $height: height, 49058 $withoutPadding: withoutPadding, 49059 $width: width, 49060 role: "dialog", 49061 "aria-modal": "true", 49062 "data-testid": "ModalBox.Content", 49063 $disableScrolling: true, 49064 id: "modal-box", 49065 children: [ 49066 title && /* @__PURE__ */ jsxRuntimeExports.jsx(TitleContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 12, children: [
49067 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "25px" }), 49068 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "25px" }) 49069 ] }) }), 49070 /* @__PURE__ */ jsxRuntimeExports.jsx(ChildrenContainer, { $disableScrolling: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Skeleton, { gap: 16, children: [ 49071 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "0", height: "20px" }), 49072 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "80%", height: "20px" }), 49073 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "70%", height: "20px" }), 49074 /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton.Shape, { width: "100%", height: "20px" }) 49075 ] }) }), 49076 (buttons || footer) && /* @__PURE__ */ jsxRuntimeExports.jsx(Footer, { $withDivider: withFooterDivider, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FooterContent, {}) }) 49077 ] 49078 } 49079 ); 49080 }; 49081 const Container$d = dt$2.div` 49082 position: relative; 49083 49084 ${({ $fullWidth }) => $fullWidth && lt$2` 49085 width: 100%; 49086 `} 49087`; 49088 dt$2.select``; 49089 const getSelectHeight = ({ $inputSize }) => { 49090 if ($inputSize === "large") { 49091 return "56px"; 49092 } 49093 if ($inputSize === "medium") { 49094 return "48px"; 49095 } 49096 if ($inputSize === "small") { 49097 return "40px"; 49098 } 49099 }; 49100 const Select$1 = dt$2.select` 49101 position: absolute; 49102 top: 0; 49103 left: 0; 49104 width: 100%; 49105 height: ${getSelectHeight}; 49106 opacity: 0; 49107 cursor: pointer; 49108 appearance: none; // NOTE: Fix height on Safari 49109 49110 ${({ disabled }) => disabled && lt$2` 49111 cursor: not-allowed; 49112 `} 49113`; 49114 const ActionIconsContainer = dt$2.div` 49115 display: flex; 49116 gap: var(--space-400); 49117`; 49118 const ArrowIconContainer = dt$2.div` 49119 color: var(--text-secondary); 49120 49121 ${({ $hovered }) => $hovered && lt$2` 49122 color: var(--text-primary); 49123 `} 49124`; 49125 const ClearIcon = dt$2.button` 49126 position: relative; 49127 z-index: 1; 49128 cursor: pointer; 49129 width: 18px; 49130 height: 18px; 49131 border-radius: 50%; 49132 display: flex; 49133 align-items: center; 49134 justify-content: center; 49135 background-color: var(--text-primary); 49136 color: var(--bg-primary); 49137`; 49138 const SelectComponent = ({ 49139 options: options2, 49140 name, 49141 disabled, 49142 invalid, 49143 label, 49144 value = "", 49145 error, 49146 displayError = true, 49147 submitCount, 49148 autoComplete, 49149 prepend, 49150 suggestion, 49151 size = "large", 49152 transparent = false, 49153 fullWidth = false, 49154 onClear, 49155 onChange, 49156 onBlur, 49157 onValueChange 49158 }) => { 49159 const [isFocused, setIsFocused] = reactExports.useState(false); 49160 const [isHovered, setIsHovered] = reactExports.useState(false); 49161 const renderOptions = () => { 49162 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
49163 /* @__PURE__ */ jsxRuntimeExports.jsx("option", { hidden: true, disabled: true, value: "" }), 49164 options2.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx( 49165 "option", 49166 { 49167 value: item.value, 49168 disabled: item.disabled, 49169 children: item.label 49170 }, 49171 !isNil(item.key) ? item.key : item.value 49172 )) 49173 ] }); 49174 }; 49175 const getInputValue = () => { 49176 if (!value) return ""; 49177 const selectedOption = options2.find((item) => item.value === value); 49178 return selectedOption ? selectedOption.label : ""; 49179 }; 49180 const handleFocus = () => { 49181 setIsFocused(true); 49182 }; 49183 const handleBlur = (e2) => { 49184 if (onBlur) { 49185 onBlur(e2); 49186 } 49187 setIsFocused(false); 49188 }; 49189 const handleChange = (e2) => { 49190 if (onChange) { 49191 onChange(e2); 49192 } 49193 if (onValueChange) { 49194 onValueChange(e2.target.value); 49195 } 49196 }; 49197 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$d, { $fullWidth: fullWidth, children: [
49198 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx( 49199 Input$1, 49200 { 49201 disabled, 49202 label, 49203 value: getInputValue(), 49204 error, 49205 displayError, 49206 submitCount, 49207 prepend, 49208 suggestion, 49209 size, 49210 transparent, 49211 invalid, 49212 focused: isFocused, 49213 hovered: isHovered, 49214 fullWidth, 49215 tabIndex: -1, 49216 autoComplete: "off", 49217 actionIcon: /* @__PURE__ */ jsxRuntimeExports.jsxs(ActionIconsContainer, { children: [ 49218 !!getInputValue() && onClear && /* @__PURE__ */ jsxRuntimeExports.jsx(ClearIcon, { onClick: onClear, children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 10 }) }), 49219 (!transparent || isFocused) && /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowIconContainer, { $hovered: isHovered, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Z4, { height: size === "small" ? 12 : 15 }) }) 49220 ] }) 49221 } 49222 ) }),
49223 /* @__PURE__ */ jsxRuntimeExports.jsx( 49224 Select$1, 49225 { 49226 name, 49227 disabled, 49228 value: value != null ? value : "", 49229 $inputSize: size, 49230 autoComplete, 49231 "aria-label": label, 49232 "data-testid": "Select.Select", 49233 onFocus: handleFocus, 49234 onBlur: handleBlur, 49235 onChange: handleChange, 49236 onMouseEnter: () => setIsHovered(true), 49237 onMouseLeave: () => setIsHovered(false), 49238 children: renderOptions() 49239 } 49240 ) 49241 ] }); 49242 }; 49243 const Select = Fr$2(SelectComponent); 49244 const Container$c = dt$2.div` 49245 position: relative; 49246 49247 width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"}; 49248`; 49249 const Textarea$1 = dt$2.textarea` 49250 width: 100%; 49251 padding: var(--space-350); 49252 background: transparent; 49253 border: 0; 49254 outline: 0; 49255 49256 font-size: var(--font-size-400); 49257 color: var(--text-primary); 49258 line-height: var(--font-line-height-400); 49259 vertical-align: top; 49260 resize: ${({ $resize }) => $resize ? "vertical" : "none"}; 49261 49262 &::placeholder { 49263 color: var(--text-secondary); 49264 } 49265 49266 :disabled { 49267 cursor: not-allowed; 49268 } 49269 49270 // https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/ 49271 &:-webkit-autofill, 49272 &:-webkit-autofill:focus, 49273 &:-webkit-autofill:hover { 49274 -webkit-text-fill-color: var(--text-primary); 49275 -webkit-background-clip: text; 49276 caret-color: var(--text-primary); 49277 } 49278`; 49279 const Label = dt$2.label` 49280 clip: rect(1px, 1px, 1px, 1px); 49281 49282 position: absolute; 49283`; 49284 const TextareaComponent = ({ 49285 placeholder, 49286 disabled, 49287 focused, 49288 tabIndex, 49289 fullWidth, 49290 label, 49291 name, 49292 value = "", 49293 rows = 2, 49294 resize = false, 49295 invalid = false, 49296 required, 49297 maxLength, 49298 info, 49299 error, 49300 displayError = true, 49301 submitCount, 49302 suggestion, 49303 onChange, 49304 onValueChange, 49305 onBlur, 49306 onFocus 49307 }) => { 49308 const [isFocused, setIsFocused] = reactExports.useState(false); 49309 reactExports.useLayoutEffect(() => { 49310 if (!isUndefined(focused)) { 49311 setIsFocused(focused); 49312 } 49313 }, [focused]); 49314 const handleChange = (e2) => { 49315 if (onChange) { 49316 onChange(e2); 49317 } 49318 if (onValueChange) { 49319 onValueChange(e2.target.value); 49320 } 49321 }; 49322 const handleFocus = (e2) => { 49323 setIsFocused(true); 49324 if (onFocus) { 49325 onFocus(e2); 49326 } 49327 }; 49328 const handleBlur = (e2) => { 49329 setIsFocused(false); 49330 if (onBlur) { 49331 onBlur(e2); 49332 } 49333 }; 49334 const getTextareaId = () => { 49335 if (!name) { 49336 return void 0; 49337 } 49338 return `${name}__textarea`; 49339 }; 49340 const charactersLeft = (maxLength || Infinity) - ((value == null ? void 0 : value.length) || 0); 49341 const showSuggestion = (!displayError || !error) && !!suggestion; 49342 const showInfo = !!maxLength || !!info; 49343 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$c, { $fullWidth: fullWidth, children: [
49344 /* @__PURE__ */ jsxRuntimeExports.jsxs( 49345 Box$1, 49346 { 49347 $invalid: invalid, 49348 $fullWidth: fullWidth, 49349 $fullHeight: true, 49350 $disabled: disabled, 49351 $focused: isFocused, 49352 children: [ 49353 /* @__PURE__ */ jsxRuntimeExports.jsx( 49354 Textarea$1, 49355 { 49356 rows, 49357 $resize: resize, 49358 placeholder, 49359 disabled, 49360 required, 49361 name, 49362 tabIndex, 49363 id: getTextareaId(), 49364 value, 49365 "aria-invalid": invalid ? "true" : "false", 49366 maxLength, 49367 onChange: handleChange, 49368 onFocus: handleFocus, 49369 onBlur: handleBlur, 49370 "data-testid": "Textarea" 49371 } 49372 ), 49373 /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { htmlFor: getTextareaId(), children: label }) 49374 ] 49375 } 49376 ), 49377 (showSuggestion || showInfo) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Footer$3, { children: [
49378 showSuggestion && /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { $withoutMargin: true, children: suggestion }), 49379 showInfo && /* @__PURE__ */ jsxRuntimeExports.jsx(Info, { children: info || `${charactersLeft} ${I$2(charactersLeft, "character")} left` }) 49380 ] }), 49381 displayError && !!error && /* @__PURE__ */ jsxRuntimeExports.jsx(Error$1, { errorTimestampKey: submitCount, children: error }) 49382 ] }); 49383 }; 49384 const Textarea = Fr$2(TextareaComponent); 49385 const c$2 = (e2) => "number" == typeof e2 && !isNaN(e2), d$1 = (e2) => "string" == typeof e2, u$3 = (e2) => "function" == typeof e2, p$2 = (e2) => d$1(e2) || u$3(e2) ? e2 : null, m$2 = (e2) => reactExports.isValidElement(e2) || d$1(e2) || u$3(e2) || c$2(e2); 49386 function f$3(e2, t2, n2) { 49387 void 0 === n2 && (n2 = 300); 49388 const { scrollHeight: o2, style: s2 } = e2; 49389 requestAnimationFrame(() => { 49390 s2.minHeight = "initial", s2.height = o2 + "px", s2.transition = `all ${n2}ms`, requestAnimationFrame(() => { 49391 s2.height = "0", s2.padding = "0", s2.margin = "0", setTimeout(t2, n2); 49392 }); 49393 }); 49394 } 49395 function g$2(t2) { 49396 let { enter: a2, exit: r2, appendPosition: i2 = false, collapse: l2 = true, collapseDuration: c2 = 300 } = t2; 49397 return function(t3) { 49398 let { children: d2, position: u2, preventExitTransition: p2, done: m2, nodeRef: g2, isIn: y2, playToast: v2 } = t3; 49399 const h2 = i2 ? `${a2}--${u2}` : a2, T2 = i2 ? `${r2}--${u2}` : r2, E2 = reactExports.useRef(0); 49400 return reactExports.useLayoutEffect(() => { 49401 const e2 = g2.current, t4 = h2.split(" "), n2 = (o2) => { 49402 o2.target === g2.current && (v2(), e2.removeEventListener("animationend", n2), e2.removeEventListener("animationcancel", n2), 0 === E2.current && "animationcancel" !== o2.type && e2.classList.remove(...t4)); 49403 }; 49404 e2.classList.add(...t4), e2.addEventListener("animationend", n2), e2.addEventListener("animationcancel", n2); 49405 }, []), reactExports.useEffect(() => { 49406 const e2 = g2.current, t4 = () => { 49407 e2.removeEventListener("animationend", t4), l2 ? f$3(e2, m2, c2) : m2(); 49408 }; 49409 y2 || (p2 ? t4() : (E2.current = 1, e2.className += ` ${T2}`, e2.addEventListener("animationend", t4))); 49410 }, [y2]), e$3.createElement(e$3.Fragment, null, d2); 49411 }; 49412 } 49413 function y$3(e2, t2) { 49414 return null != e2 ? { content: e2.content, containerId: e2.props.containerId, id: e2.props.toastId, theme: e2.props.theme, type: e2.props.type, data: e2.props.data || {}, isLoading: e2.props.isLoading, icon: e2.props.icon, status: t2 } : {}; 49415 } 49416 const v$4 = /* @__PURE__ */ new Map(); 49417 let h$2 = []; 49418 const T$2 = /* @__PURE__ */ new Set(), E$2 = (e2) => T$2.forEach((t2) => t2(e2)), b$2 = () => v$4.size > 0; 49419 function I$1(e2, t2) { 49420 var n2; 49421 if (t2) return !(null == (n2 = v$4.get(t2)) || !n2.isToastActive(e2)); 49422 let o2 = false; 49423 return v$4.forEach((t3) => { 49424 t3.isToastActive(e2) && (o2 = true); 49425 }), o2; 49426 } 49427 function _$3(e2, t2) { 49428 m$2(e2) && (b$2() || h$2.push({ content: e2, options: t2 }), v$4.forEach((n2) => { 49429 n2.buildToast(e2, t2); 49430 })); 49431 } 49432 function C$3(e2, t2) { 49433 v$4.forEach((n2) => { 49434 null != t2 && null != t2 && t2.containerId ? (null == t2 ? void 0 : t2.containerId) === n2.id && n2.toggle(e2, null == t2 ? void 0 : t2.id) : n2.toggle(e2, null == t2 ? void 0 : t2.id); 49435 }); 49436 } 49437 function L$3(e2) { 49438 const { subscribe: o2, getSnapshot: s2, setProps: i2 } = reactExports.useRef((function(e3) { 49439 const n2 = e3.containerId || 1; 49440 return { subscribe(o3) { 49441 const s3 = /* @__PURE__ */ (function(e4, n3, o4) { 49442 let s4 = 1, r3 = 0, i3 = [], l3 = [], f2 = [], g2 = n3; 49443 const v2 = /* @__PURE__ */ new Map(), h2 = /* @__PURE__ */ new Set(), T2 = () => { 49444 f2 = Array.from(v2.values()), h2.forEach((e5) => e5()); 49445 }, E2 = (e5) => { 49446 l3 = null == e5 ? [] : l3.filter((t2) => t2 !== e5), T2(); 49447 }, b2 = (e5) => { 49448 const { toastId: n4, onOpen: s5, updateId: a2, children: r4 } = e5.props, i4 = null == a2; 49449 e5.staleId && v2.delete(e5.staleId), v2.set(n4, e5), l3 = [...l3, e5.props.toastId].filter((t2) => t2 !== e5.staleId), T2(), o4(y$3(e5, i4 ? "added" : "updated")), i4 && u$3(s5) && s5(reactExports.isValidElement(r4) && r4.props); 49450 }; 49451 return { id: e4, props: g2, observe: (e5) => (h2.add(e5), () => h2.delete(e5)), toggle: (e5, t2) => { 49452 v2.forEach((n4) => { 49453 null != t2 && t2 !== n4.props.toastId || u$3(n4.toggle) && n4.toggle(e5); 49454 }); 49455 }, removeToast: E2, toasts: v2, clearQueue: () => { 49456 r3 -= i3.length, i3 = []; 49457 }, buildToast: (n4, l4) => { 49458 if (((t2) => { 49459 let { containerId: n5, toastId: o5, updateId: s5 } = t2; 49460 const a2 = n5 ? n5 !== e4 : 1 !== e4, r4 = v2.has(o5) && null == s5; 49461 return a2 || r4; 49462 })(l4)) return; 49463 const { toastId: f3, updateId: h3, data: I2, staleId: _2, delay: C2 } = l4, L2 = () => { 49464 E2(f3); 49465 }, N2 = null == h3; 49466 N2 && r3++; 49467 const $2 = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, g2), { style: g2.toastStyle, key: s4++ }), Object.fromEntries(Object.entries(l4).filter((e5) => { 49468 let [t2, n5] = e5; 49469 return null != n5; 49470 }))), { toastId: f3, updateId: h3, data: I2, closeToast: L2, isIn: false, className: p$2(l4.className || g2.toastClassName), bodyClassName: p$2(l4.bodyClassName || g2.bodyClassName), progressClassName: p$2(l4.progressClassName || g2.progressClassName), autoClose: !l4.isLoading && (w2 = l4.autoClose, k2 = g2.autoClose, false === w2 || c$2(w2) && w2 > 0 ? w2 : k2), deleteToast() { 49471 const e5 = v2.get(f3), { onClose: n5, children: s5 } = e5.props; 49472 u$3(n5) && n5(reactExports.isValidElement(s5) && s5.props), o4
49472(y$3(e5, "removed")), v2.delete(f3), r3--, r3 < 0 && (r3 = 0), i3.length > 0 ? b2(i3.shift()) : T2(); 49473 } }); 49474 var w2, k2; 49475 $2.closeButton = g2.closeButton, false === l4.closeButton || m$2(l4.closeButton) ? $2.closeButton = l4.closeButton : true === l4.closeButton && ($2.closeButton = !m$2(g2.closeButton) || g2.closeButton); 49476 let P2 = n4; 49477 reactExports.isValidElement(n4) && !d$1(n4.type) ? P2 = reactExports.cloneElement(n4, { closeToast: L2, toastProps: $2, data: I2 }) : u$3(n4) && (P2 = n4({ closeToast: L2, toastProps: $2, data: I2 })); 49478 const M2 = { content: P2, props: $2, staleId: _2 }; 49479 g2.limit && g2.limit > 0 && r3 > g2.limit && N2 ? i3.push(M2) : c$2(C2) ? setTimeout(() => { 49480 b2(M2); 49481 }, C2) : b2(M2); 49482 }, setProps(e5) { 49483 g2 = e5; 49484 }, setToggle: (e5, t2) => { 49485 v2.get(e5).toggle = t2; 49486 }, isToastActive: (e5) => l3.some((t2) => t2 === e5), getSnapshot: () => f2 }; 49487 })(n2, e3, E$2); 49488 v$4.set(n2, s3); 49489 const r2 = s3.observe(o3); 49490 return h$2.forEach((e4) => _$3(e4.content, e4.options)), h$2 = [], () => { 49491 r2(), v$4.delete(n2); 49492 }; 49493 }, setProps(e4) { 49494 var t2; 49495 null == (t2 = v$4.get(n2)) || t2.setProps(e4); 49496 }, getSnapshot() { 49497 var e4; 49498 return null == (e4 = v$4.get(n2)) ? void 0 : e4.getSnapshot(); 49499 } }; 49500 })(e2)).current; 49501 i2(e2); 49502 const l2 = reactExports.useSyncExternalStore(o2, s2, s2); 49503 return { getToastToRender: function(t2) { 49504 if (!l2) return []; 49505 const n2 = /* @__PURE__ */ new Map(); 49506 return e2.newestOnTop && l2.reverse(), l2.forEach((e3) => { 49507 const { position: t3 } = e3.props; 49508 n2.has(t3) || n2.set(t3, []), n2.get(t3).push(e3); 49509 }), Array.from(n2, (e3) => t2(e3[0], e3[1])); 49510 }, isToastActive: I$1, count: null == l2 ? void 0 : l2.length }; 49511 } 49512 function N$2(e2) { 49513 const [t2, o2] = reactExports.useState(false), [a2, r2] = reactExports.useState(false), l2 = reactExports.useRef(null), c2 = reactExports.useRef({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: true, canDrag: false, didMove: false }).current, { autoClose: d2, pauseOnHover: u2, closeToast: p2, onClick: m2, closeOnClick: f2 } = e2; 49514 var g2, y2; 49515 function h2() { 49516 o2(true); 49517 } 49518 function T2() { 49519 o2(false); 49520 } 49521 function E2(n2) { 49522 const o3 = l2.current; 49523 c2.canDrag && o3 && (c2.didMove = true, t2 && T2(), c2.delta = "x" === e2.draggableDirection ? n2.clientX - c2.start : n2.clientY - c2.start, c2.start !== n2.clientX && (c2.canCloseOnClick = false), o3.style.transform = `translate3d(${"x" === e2.draggableDirection ? `${c2.delta}px, var(--y)` : `0, calc(${c2.delta}px + var(--y))`},0)`, o3.style.opacity = "" + (1 - Math.abs(c2.delta / c2.removalDistance))); 49524 } 49525 function b2() { 49526 document.removeEventListener("pointermove", E2), document.removeEventListener("pointerup", b2); 49527 const t3 = l2.current; 49528 if (c2.canDrag && c2.didMove && t3) { 49529 if (c2.canDrag = false, Math.abs(c2.delta) > c2.removalDistance) return r2(true), e2.closeToast(), void e2.collapseAll(); 49530 t3.style.transition = "transform 0.2s, opacity 0.2s", t3.style.removeProperty("transform"), t3.style.removeProperty("opacity"); 49531 } 49532 } 49533 null == (y2 = v$4.get((g2 = { id: e2.toastId, containerId: e2.containerId, fn: o2 }).containerId || 1)) || y2.setToggle(g2.id, g2.fn), reactExports.useEffect(() => { 49534 if (e2.pauseOnFocusLoss) return document.hasFocus() || T2(), window.addEventListener("focus", h2), window.addEventListener("blur", T2), () => { 49535 window.removeEventListener("focus", h2), window.removeEventListener("blur", T2); 49536 }; 49537 }, [e2.pauseOnFocusLoss]); 49538 const I2 = { onPointerDown: function(t3) { 49539 if (true === e2.draggable || e2.draggable === t3.pointerType) { 49540 c2.didMove = false, document.addEventListener("pointermove", E2), document.addEventListener("pointerup", b2); 49541 const n2 = l2.current; 49542 c2.canCloseOnClick = true, c2.canDrag = true, n2.style.transition = "none", "x" === e2.draggableDirection ? (c2.start = t3.clientX, c2.removalDistance = n2.offsetWidth * (e2.draggablePercent / 100)) : (c2.start = t3.clientY, c2.removalDistance = n2.offsetHeight * (80 === e2.draggablePercent ? 1.5 * e2.draggablePercent : e2.draggablePercent) / 100); 49543 } 49544 }, onPointerUp: function(t3) { 49545 const { top: n2, bottom: o3, left: s2, right: a3 } = l2.current.getBoundingClientRect(); 49546 "touchend" !== t3.nativeEvent.type && e2.pauseOnHover && t3.clientX >= s2 && t3.clientX <= a3 && t3.clientY >= n2 && t3.clientY <= o3 ? T2() : h2(); 49547 } }; 49548 return d2 && u2 && (I2.onMouseEnter = T2, e2.stacked || (I2.onMouseLeave = h2)), f2 && (I2.onClick = (e3) => { 49549 m2 && m2(e3), c2.canCloseOnClick && p2(); 49550 }), { playToast: h2, pauseToast: T2, isRunning: t2, preventExitTransition: a2, toastRef: l2, eventHandlers: I2 }; 49551 } 49552 function $$4(t2) { 49553 let { delay: n2, isRunning: o2, closeToast: s2, type: a2 = "default", hide: r2, className: i2, style: c2, controlledProgress: d2, progress: p2, rtl: m2, isIn: f2, theme: g2 } = t2; 49554 const y2 = r2 || d2 && 0 === p2, v2 = __spreadProps(__spreadValues({}, c2), { animationDuration: `${n2}ms`, animationPlayState: o2 ? "running" : "paused" }); 49555 d2 && (v2.transform = `scaleX(${p2})`); 49556 const h2 = clsx("Toastify__progress-bar", d2 ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${g2}`, `Toastify__progress-bar--${a2}`, { "Toastify__progress-bar--rtl": m2 }), T2 = u$3(i2) ? i2({ rtl: m2, type: a2, defaultClassName: h2 }) : clsx(h2, i2), E2 = { [d2 && p2 >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: d2 && p2 < 1 ? null : () => { 49557 f2 && s2(); 49558 } }; 49559 return e$3.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": y2 }, e$3.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${g2} Toastify__progress-bar--${a2}` }), e$3.createElement("div", __spreadValues({ role: "progressbar", "aria-hidden": y2 ? "true" : "false", "aria-label": "notification timer", className: T2, style: v2 }, E2))); 49560 } 49561 let w$5 = 1;
49562 const k$3 = () => "" + w$5++; 49563 function P$2(e2) { 49564 return e2 && (d$1(e2.toastId) || c$2(e2.toastId)) ? e2.toastId : k$3(); 49565 } 49566 function M$5(e2, t2) { 49567 return _$3(e2, t2), t2.toastId; 49568 } 49569 function x$3(e2, t2) { 49570 return __spreadProps(__spreadValues({}, t2), { type: t2 && t2.type || e2, toastId: P$2(t2) }); 49571 } 49572 function A$4(e2) { 49573 return (t2, n2) => M$5(t2, x$3(e2, n2)); 49574 } 49575 function B$1(e2, t2) { 49576 return M$5(e2, x$3("default", t2)); 49577 } 49578 B$1.loading = (e2, t2) => M$5(e2, x$3("default", __spreadValues({ isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false }, t2))), B$1.promise = function(e2, t2, n2) { 49579 let o2, { pending: s2, error: a2, success: r2 } = t2; 49580 s2 && (o2 = d$1(s2) ? B$1.loading(s2, n2) : B$1.loading(s2.render, __spreadValues(__spreadValues({}, n2), s2))); 49581 const i2 = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, l2 = (e3, t3, s3) => { 49582 if (null == t3) return void B$1.dismiss(o2); 49583 const a3 = __spreadProps(__spreadValues(__spreadValues({ type: e3 }, i2), n2), { data: s3 }), r3 = d$1(t3) ? { render: t3 } : t3; 49584 return o2 ? B$1.update(o2, __spreadValues(__spreadValues({}, a3), r3)) : B$1(r3.render, __spreadValues(__spreadValues({}, a3), r3)), s3; 49585 }, c2 = u$3(e2) ? e2() : e2; 49586 return c2.then((e3) => l2("success", r2, e3)).catch((e3) => l2("error", a2, e3)), c2; 49587 }, B$1.success = A$4("success"), B$1.info = A$4("info"), B$1.error = A$4("error"), B$1.warning = A$4("warning"), B$1.warn = B$1.warning, B$1.dark = (e2, t2) => M$5(e2, x$3("default", __spreadValues({ theme: "dark" }, t2))), B$1.dismiss = function(e2) { 49588 !(function(e3) { 49589 var t2; 49590 if (b$2()) { 49591 if (null == e3 || d$1(t2 = e3) || c$2(t2)) v$4.forEach((t3) => { 49592 t3.removeToast(e3); 49593 }); 49594 else if (e3 && ("containerId" in e3 || "id" in e3)) { 49595 const t3 = v$4.get(e3.containerId); 49596 t3 ? t3.removeToast(e3.id) : v$4.forEach((t4) => { 49597 t4.removeToast(e3.id); 49598 }); 49599 } 49600 } else h$2 = h$2.filter((t3) => null != e3 && t3.options.toastId !== e3); 49601 })(e2); 49602 }, B$1.clearWaitingQueue = function(e2) { 49603 void 0 === e2 && (e2 = {}), v$4.forEach((t2) => { 49604 !t2.props.limit || e2.containerId && t2.id !== e2.containerId || t2.clearQueue(); 49605 }); 49606 }, B$1.isActive = I$1, B$1.update = function(e2, t2) { 49607 void 0 === t2 && (t2 = {}); 49608 const n2 = ((e3, t3) => { 49609 var n3; 49610 let { containerId: o2 } = t3; 49611 return null == (n3 = v$4.get(o2 || 1)) ? void 0 : n3.toasts.get(e3); 49612 })(e2, t2); 49613 if (n2) { 49614 const { props: o2, content: s2 } = n2, a2 = __spreadProps(__spreadValues(__spreadValues({ delay: 100 }, o2), t2), { toastId: t2.toastId || e2, updateId: k$3() }); 49615 a2.toastId !== e2 && (a2.staleId = e2); 49616 const r2 = a2.render || s2; 49617 delete a2.render, M$5(r2, a2); 49618 } 49619 }, B$1.done = (e2) => { 49620 B$1.update(e2, { progress: 1 }); 49621 }, B$1.onChange = function(e2) { 49622 return T$2.add(e2), () => { 49623 T$2.delete(e2); 49624 }; 49625 }, B$1.play = (e2) => C$3(true, e2), B$1.pause = (e2) => C$3(false, e2); 49626 const O$3 = "undefined" != typeof window ? reactExports.useLayoutEffect : reactExports.useEffect, D$4 = (t2) => { 49627 let _a = t2, { theme: n2, type: o2, isLoading: s2 } = _a, a2 = __objRest(_a, ["theme", "type", "isLoading"]); 49628 return e$3.createElement("svg", __spreadValues({ viewBox: "0 0 24 24", width: "100%", height: "100%", fill: "colored" === n2 ? "currentColor" : `var(--toastify-icon-color-${o2})` }, a2)); 49629 }, z$2 = { info: function(t2) { 49630 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" })); 49631 }, warning: function(t2) { 49632 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" })); 49633 }, success: function(t2) { 49634 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" })); 49635 }, error: function(t2) { 49636 return e$3.createElement(D$4, __spreadValues({}, t2), e$3.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" })); 49637 }, spinner: function() { 49638 return e$3.createElement("div", { className: "Toastify__spinner" }); 49639 } }, R$4 = (n2) => { 49640 const { isRunning: o2, preventExitTransition: s2, toastRef: r2, eventHandlers: i2, playToast: c2 } = N$2(n2), { closeButton: d2, children: p2, autoClose: m2, onClick: f2, type: g2, hideProgressBar: y2, closeToast: v2, transition: h2, position: T2, className: E2, style: b2, bodyClassName: I2, bodyStyle: _2, progressClassName: C2, progressStyle: L2, updateId: w2, role: k2, progress: P2, rtl: M2, toastId: x2, deleteToast: A2, isIn: B2, isLoading: O2, closeOnClick: D2, theme: R2 } = n2, S2 = clsx("Toastify__toast", `Toastify__toast-theme--${R2}`, `Toastify__toast--${g2}`, { "Toastify__toast--rtl": M2 }, { "Toastify__toast--close-on-click": D2 }), H2 = u$3(E2) ? E2({ rtl: M2, position: T2, type: g2, defaultClassName: S2 }) : clsx(S2, E2), F2 = (function(e2) { 49641 let { theme: n3, type: o3, isLoading: s3, icon: r3 } = e2, i3 = null; 49642 const l2 = { theme: n3, type: o3 }; 49643 return false === r3 || (u$3(r3) ? i3 = r3(__spreadProps(__spreadValues({}, l2), { isLoading: s3 })) : reactExports.isValidElement(r3) ? i3 = reactExports.cloneElement(r3, l2) : s3 ? i3 = z$2.spinner() : ((e3) => e3 in z$2)(o3) && (i3 = z$2[o3](l2))), i3; 49644 })(n2), X2 = !!P2 || !m2, Y2 = { closeToast: v2, type: g2, theme: R2 }; 49645 let q2 = null; 49646 return false === d2 || (q2 = u$3(d2) ? d2(Y2) : reactExports.isValidElement(d2) ? reactExports.cloneElement(d2, Y2) : (function(t2) { 49647 let { closeToast: n3, theme: o3, ariaLabel: s3 = "close" } = t2; 49648 return e$3.createElement("button", { className: `Toastify__close-button Toastify__close-button--${o3}`, type: "button", onClick: (e2) => { 49649 e2.stopPropagation(), n3(e2); 49650 }, "aria-label": s3 }, e$3.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, e$3.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" }))); 49651 })(Y2)), e$3.createElement(h2, { isIn: B2, done: A2, position: T2, preventExitTransition: s2, nodeRef: r2, playToast: c2 }, e$3.createElement("div", __spreadProps(__spreadValues({ id: x2, onClick: f2, "data-in": B2, className: H2 }, i2), { style: b2, ref: r2 }), e$3.createElement("div", __spreadProps(__spreadValues({}, B2 && { role: k2 }), { className: u$3(I2) ? I2({ type: g2 }) : clsx("Toastify__toast-body", I2), style: _2 }), null != F2 && e$3.createElement("div", { className: clsx("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter"
49651: !O2 }) }, F2), e$3.createElement("div", null, p2)), q2, e$3.createElement($$4, __spreadProps(__spreadValues({}, w2 && !X2 ? { key: `pb-${w2}` } : {}), { rtl: M2, theme: R2, delay: m2, isRunning: o2, isIn: B2, closeToast: v2, hide: y2, type: g2, style: L2, className: C2, controlledProgress: X2, progress: P2 || 0 })))); 49652 }, S$1 = function(e2, t2) { 49653 return void 0 === t2 && (t2 = false), { enter: `Toastify--animate Toastify__${e2}-enter`, exit: `Toastify--animate Toastify__${e2}-exit`, appendPosition: t2 }; 49654 }, H$2 = g$2(S$1("bounce", true)), F$2 = g$2(S$1("slide", true)); 49655 g$2(S$1("zoom")); 49656 g$2(S$1("flip")); 49657 const q$2 = { position: "top-right", transition: H$2, autoClose: 5e3, closeButton: true, pauseOnHover: true, pauseOnFocusLoss: true, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" }; 49658 function Q$2(t2) { 49659 let o2 = __spreadValues(__spreadValues({}, q$2), t2); 49660 const s2 = t2.stacked, [a2, r2] = reactExports.useState(true), c2 = reactExports.useRef(null), { getToastToRender: d2, isToastActive: m2, count: f2 } = L$3(o2), { className: g2, style: y2, rtl: v2, containerId: h2 } = o2; 49661 function T2(e2) { 49662 const t3 = clsx("Toastify__toast-container", `Toastify__toast-container--${e2}`, { "Toastify__toast-container--rtl": v2 }); 49663 return u$3(g2) ? g2({ position: e2, rtl: v2, defaultClassName: t3 }) : clsx(t3, p$2(g2)); 49664 } 49665 function E2() { 49666 s2 && (r2(true), B$1.play()); 49667 } 49668 return O$3(() => { 49669 if (s2) { 49670 var e2; 49671 const t3 = c2.current.querySelectorAll('[data-in="true"]'), n2 = 12, s3 = null == (e2 = o2.position) ? void 0 : e2.includes("top"); 49672 let r3 = 0, i2 = 0; 49673 Array.from(t3).reverse().forEach((e3, t4) => { 49674 const o3 = e3; 49675 o3.classList.add("Toastify__toast--stacked"), t4 > 0 && (o3.dataset.collapsed = `${a2}`), o3.dataset.pos || (o3.dataset.pos = s3 ? "top" : "bot"); 49676 const l2 = r3 * (a2 ? 0.2 : 1) + (a2 ? 0 : n2 * t4); 49677 o3.style.setProperty("--y", `${s3 ? l2 : -1 * l2}px`), o3.style.setProperty("--g", `${n2}`), o3.style.setProperty("--s", "" + (1 - (a2 ? i2 : 0))), r3 += o3.offsetHeight, i2 += 0.025; 49678 }); 49679 } 49680 }, [a2, f2, s2]), e$3.createElement("div", { ref: c2, className: "Toastify", id: h2, onMouseEnter: () => { 49681 s2 && (r2(false), B$1.pause()); 49682 }, onMouseLeave: E2 }, d2((t3, n2) => { 49683 const o3 = n2.length ? __spreadValues({}, y2) : __spreadProps(__spreadValues({}, y2), { pointerEvents: "none" }); 49684 return e$3.createElement("div", { className: T2(t3), style: o3, key: `container-${t3}` }, n2.map((t4) => { 49685 let { content: n3, props: o4 } = t4; 49686 return e$3.createElement(R$4, __spreadProps(__spreadValues({}, o4), { stacked: s2, collapseAll: E2, isIn: m2(o4.toastId, o4.containerId), style: o4.style, key: `toast-${o4.key}` }), n3); 49687 })); 49688 })); 49689 } 49690 const notify = (message, options2) => { 49691 return B$1( 49692 ({ closeToast }) => { 49693 var _a; 49694 return /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message, type: (_a = options2 == null ? void 0 : options2.type) != null ? _a : "error", onClose: closeToast }); 49695 }, 49696 options2 49697 ); 49698 }; 49699 const update = (toastId, options2) => { 49700 B$1.update(toastId, options2); 49701 }; 49702 const dismiss = (toastId) => { 49703 B$1.dismiss(toastId); 49704 }; 49705 const dismissAll = () => { 49706 B$1.dismiss(); 49707 }; 49708 function injectStyle() { 49709 var style = `:root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-offset:16px;
49709--toastify-toast-top:max(var(--toastify-toast-offset),env(safe-area-inset-top));--toastify-toast-right:max(var(--toastify-toast-offset),env(safe-area-inset-right));--toastify-toast-left:max(var(--toastify-toast-offset),env(safe-area-inset-left));--toastify-toast-bottom:max(var(--toastify-toast-offset),env(safe-area-inset-bottom));--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-toast-bd-radius:6px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error);--toastify-color-progress-bgo:0.2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translateX(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:auto}}.Toastify__toast{--y:0;position:relative;-ms-touch-action:none;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__close-button,.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}
49709.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right;border-bottom-left-radius:0;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}
49709}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}`; 49710 var css = document.createElement("style"); 49711 css.innerText = style; 49712 document.head.appendChild(css); 49713 } 49714 const GlobalStyles = ft$2` 49715 .Toastify__toast-container { 49716 ${mediaQueries.tablet} { 49717 width: auto !important; 49718 } 49719 } 49720 49721 .Toastify__toast { 49722 padding: 0 !important; 49723 box-shadow: none !important; 49724 background: none !important; 49725 } 49726 49727 /* body prefix only to outrank react-toastify's own bottom: 1em */ 49728 body .Toastify__toast-container--bottom-left, 49729 body .Toastify__toast-container--bottom-center, 49730 body .Toastify__toast-container--bottom-right { 49731 bottom: ${pageBottomOffset("var(--space-400)")}; 49732 } 49733`; 49734 const toastContainerPositionMap = { 49735 bottom: "bottom-center", 49736 top: "top-center", 49737 "top-right": "top-right", 49738 "top-left": "top-left", 49739 "bottom-right": "bottom-right", 49740 "bottom-left": "bottom-left" 49741 }; 49742 const ToastsContext = reactExports.createContext({ 49743 notify, 49744 update,
49745 dismiss, 49746 dismissAll, 49747 toast: B$1 49748 }); 49749 const ToastsProvider = ({ 49750 position: position2 = "bottom", 49751 autoClose = 5e3, 49752 children 49753 }) => { 49754 const value = reactExports.useMemo(() => ({ notify, update, dismiss, dismissAll, toast: B$1 }), []); 49755 reactExports.useEffect(() => { 49756 injectStyle(); 49757 }, []); 49758 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ToastsContext.Provider, { value, children: [ 49759 /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStyles, {}), 49760 children, 49761 /* @__PURE__ */ jsxRuntimeExports.jsx( 49762 Q$2, 49763 { 49764 autoClose, 49765 hideProgressBar: true, 49766 closeButton: false, 49767 closeOnClick: false, 49768 draggable: false, 49769 icon: false, 49770 position: toastContainerPositionMap[position2], 49771 role: void 0, 49772 transition: F$2 49773 } 49774 ) 49775 ] }); 49776 }; 49777 var a = { shippableRegions: [{ country: "US" }] }; 49778 var s$3 = { shippableRegions: [{ country: "US" }] }; 49779 var p$1 = { productsWithShippableRegions: { "3accbf28-7684-479a-9a2f-40963b8812d8": [{ country: "US" }], "1bff2f75-3c5d-4491-9b07-98c7026737ff": [{ country: "US" }], "6896df8c-b735-4795-9e9a-e0cf1f1684fa": [{ country: "US" }] } }; 49780 var b$1 = { productsWithShippableRegions: { "c939e8a1-c4f7-4f25-a4bd-82fd94bdd42c": [{ country: "US" }] } }; 49781 var n = { productsWithShippableRegions: { "0f018477-173c-421d-839b-cd4984b657fb": [{ country: "US" }] } }; 49782 var i = { productsWithShippableRegions: { "c7e1d90c-51ad-4345-ad8a-9b842b393216": [{ country: "US" }], "122981aa-015f-4724-91ca-29c6dd3b3cdd": [{ country: "US" }] } }; 49783 var f$2 = { membershipPerks: ["access to private feed, community, and exclusive content (ab pics, tweet drafts, crazy dms, BTS, singing covers, and other funny shenanigans)"] }; 49784 var y$2 = { productsWithNonShippableRegions: { "3a286f08-d30f-46ea-a0b1-6a79b0d17b98": [{ country: "AF" }, { country: "BY" }, { country: "CF" }, { country: "CU" }, { country: "EH" }, { country: "FK" }, { country: "GQ" }, { country: "GW" }, { country: "HM" }, { country: "IR" }, { country: "KI" }, { country: "KM" }, { country: "KP" }, { country: "MM" }, { country: "NR" }, { country: "NU" }, { country: "PM" }, { country: "RU" }, { country: "SB" }, { country: "SD" }, { country: "SH" }, { country: "SL" }, { country: "SO" }, { country: "ST" }, { country: "SY" }, { country: "TJ" }, { country: "TK" }, { country: "TM" }, { country: "TV" }, { country: "UA" }, { country: "UM" }, { country: "VE" }, { country: "YE" }] } }; 49785 var u$2 = { productsWithShippableRegions: { "eb8b31b5-5d83-4673-8294-758751ab0d8e": [{ country: "US" }], "e3d1a1af-aa3b-40cd-8fcb-2bbc43882ce3": [{ country: "US" }], "1baed108-3bf0-41c9-a1a3-6426b8201dc9": [{ country: "US" }], "4331253e-e651-4c88-af63-549255653c6e": [{ country: "US" }], "e2d330c0-d7e8-4d29-82fc-daf72ba8260f": [{ country: "US" }], "dfe88db0-9612-48e1-a299-55b53a3a8de3": [{ country: "US" }], "9b1a117d-0885-4dfe-ab8c-9ced58d5f612": [{ country: "US" }], "295ca860-cfdb-4fea-877b-16ce9202b4c9": [{ country: "US" }], "54ad1784-8340-4061-8b47-2cfe8e17b489": [{ country: "US" }] } }; 49786 var o = [{ country: "US" }, { country: "CA" }, { country: "AU" }, { country: "NZ" }, { country: "AT" }, { country: "BE" }, { country: "BG" }, { country: "HR" }, { country: "CY" }, { country: "CZ" }, { country: "DK" }, { country: "EE" }, { country: "FI" }, { country: "FR" }, { country: "DE" }, { country: "GB" }, { country: "GR" }, { country: "HU" }, { country: "IS" }, { country: "IT" }, { country: "IE" }, { country: "LV" }, { country: "LT" }, { country: "LU" }, { country: "MT" }, { country: "NL" }, { country: "NO" }, { country: "PL" }, { country: "PT" }, { country: "RO" }, { country: "SK" }, { country: "SI" }, { country: "ES" }, { country: "SE" }], h$1 = { productsWithShippableRegions: { "a3b721e3-2b30-4b18-b99e-c0dcc7320ffe": o, "79f3acb6-ec84
49786-412b-82c4-2ac89b49c6e8": o, "8eba7465-770b-4744-855e-f6356cb93c8f": o, "c9551902-181c-4fc6-97ee-a4ba04b049af": o, "84e93e79-7717-49fd-be7e-6f9f15b82ddd": o, "0849323e-9864-4cb4-a13b-527bd5e7d265": o, "e4542e30-3c7a-425e-a0b4-be59216fb440": o, "0fb48dab-17f0-428f-ad9f-617755b5b182": o, "b71f60a2-12c8-49da-b505-4a5d70ce17b6": o } }; 49787 var S = { productsWithShippableRegions: { "7dab841e-ab6e-48a6-bb51-77ebcb7838a1": [{ country: "US" }] } }; 49788 var m$1 = { productsWithShippableRegions: { "516a97b1-05f6-418b-9a54-077595949c0a": [{ country: "US" }] } }; 49789 var v$3 = { disablePayPalWithMembershipsUpselling: true }; 49790 var t$1 = { layout: { platformLogo: true } }; 49791 var e$1 = { shippableRegions: [{ country: "US" }, { country: "CA" }], productsWithShippableRegions: { "6ef896a4-eb9b-407f-b585-0957ed55d193": [{ country: "US" }], "3045ee52-9768-40e2-afbe-a4a7698fec64": [{ country: "US" }] }, disableAddressAutocomplete: true, formAccessibilityMode: true }; 49792 var l$1 = { productsWithShippableRegions: { "ba5fbdd4-a701-4100-a3cd-7a9e4daff991": [{ country: "US" }], "6497a337-1f0b-4d48-99e0-a5bec9912ca0": [{ country: "US" }], "a9bf82aa-e55a-4c21-88e8-e71b85631682": [{ country: "US" }] } }; 49793 var O$2 = [{ country: "US" }, { country: "CA" }, { country: "MX" }], g$1 = { productsWithShippableRegions: { "0e344ee5-d14e-4805-8740-b653998888d1": O$2, "4d7f5325-d01e-4f96-8658-9c19139e43dc": O$2 } }; 49794 var U$3 = { membershipPerks: ["Access to all TMG Studios shows - Ad Free!", "Exclusive Access to T.I.T. & Insanely Chill", "Bonus episodes every week", "Members-only Discord", "Immediate access to the full archive of all shows", "Discounts, early access, & exclusive merch drops", "Members Only Ad Free RSS Feed", "Insanely Chill RSS Feed"] }; 49795 var _$2 = { productsWithShippableRegions: { "13d44df7-3744-43a0-a410-6c597a267966": [{ country: "US" }], "811e9152-ce14-4c79-9933-571791ba0723": [{ country: "US" }], "38093b19-54a7-412b-8cfb-a376dfc745e4": [{ country: "US" }], "acdeb6a1-21f0-4ae8-b43d-b819c883dca0": [{ country: "US" }], "969dc0d3-a690-4fdd-a738-192824be8739": [{ country: "US" }], "3fac0491-381a-4c40-8e9a-3b1059575430": [{ country: "US" }], "68af6865-7ee3-44fd-a3a6-f682fde55767": [{ country: "US" }], "22090df3-c490-4881-8846-e6449371c37f": [{ country: "US" }] } }; 49796 var R$3 = { dialects: ["latin", "japanese"] }; 49797 var r = { nonShippableRegions: [{ country: "CN" }, { country: "BR" }, { country: "TW" }, { country: "HK" }, { country: "MO" }] }; 49798 var x$2 = { shippableRegions: [{ country: "US", states: ["CA"] }] }; 49799 var c$1 = [{ country: "US" }, { country: "CA" }, { country: "MX" }], M$4 = { productsWithShippableRegions: { "9f13f09a-c851-4eb6-a5fa-27ea8a08c786": c$1, "2a6860e3-ee9b-40da-9d9a-a6563b87aa6a": c$1, "d416a635-3a61-447c-8000-c92a2757c052": [{ country: "US" }], "7269c3ef-9b2c-4d9f-a190-ea914e0db0cd": [{ country: "US" }], "a506c773-f3aa-4a55-ad47-16b0a368897b": [{ country: "US" }], "230c68e4-275d-49ad-97fc-b0b62d3d2f9d": c$1, "d064488b-c437-48fa-878c-eadc244f4633": c$1, "29bb8000-c081-4880-af8c-50e601587c36": c$1, "1e14dd15-1ff1-44cb-b24e-e496be9d28cd": c$1, "2e18665c-b9e9-4572-8cb9-acc975227787": c$1 }, productsWithNonShippableRegions: { "cb94f788-a28e-4e32-ae17-3383846dffa2": c$1, "d57863af-e5a0-4bbe-bc54-111aa90a007a": [{ country: "UA" }, { country: "BM" }], "63394731-bdd0-4c39-966b-3707b978bff6": [{ country: "UA" }, { country: "BM" }], "0b335d61-955b-4e56-ab1e-670c76532a13": [{ country: "UA" }, { country: "BM" }], "10bea90e-6a3b-453d-a036-18fe4e4e4be2": [{ country: "UA" }, { country: "BM" }], "806e6e62-b695-4861-8d40-f63232ae99c7": [{ country: "UA" }, { country: "BM" }] } }; 49800 var T$1 = { "sh_00dced06-a45b-4aa6-89e3-c917a6155a79": a, "sh_93110e49-77b4-4d22-a09a-330354fd0c46": s$3, "sh_12c8d857-6660-4c55-83b2-0248b1c07792": p$1, "sh_d8553b21-8dab-4e74-9de4-0d09ca7d7d0e": b$1, "sh_d33d2b15-2819-4a9e-a7a2-bd3c27cea93c": n, "sh_269a39fe-32c3-4295-b26f-4be57a8ed3be": i, "sh_7978d999-c742-4bc4-9ec4-b96434102d5c": y$2, "sh_bc9e3a6d-03d3-4546-b03c-46f8dfd9d79f": u$2, "sh_6cdb0a1a-8619-4490-913b-2d1d0cee48d5": S, "sh_1b053ca4-73d6-431c-bd9a-5b0253026c47": h$1, "sh_9dbbc8ed-b585-4978-a865-713b1876bd2a": m$1, "sh_91cf8dd7-d4f0-4d19-9145-d31ac2bf5163": e$1, "sh_a149996b-6470-4779-89a3-291019d301fe": e$1, "sh_4c0e1c35-39b8-41b2-b143-fd009e1734b5": e$1, "sh_3bfdf06e-78e7-4f76-b617-2ed453ea062c": e$1, "sh_216afd99-30a2-44c3-8dd1-8db7938e5058": e$1, "sh_d2d05da6-4d8a-4a17-bf16-8dadc845fbbe": e$1, "sh_760fff51-2df9-4055-910d-b48fe4c0698f": e$1, "sh_f29ebb5c-7578-475f-b1f4-8797b944ddd3": e$1, "sh_b34403e9-427e-46a0-afca-72e018c39909": e$1, "sh_780f70e2-40e0-4f3b-92d2-f3920a480b3b": e$1, "sh_06e7a31d-9c2b-4fb0-945d-5e727c241555": e$1, "sh_ae7374ce-770f-4430-ba21-ac3afb64d80b": e$1, "sh_7d739f1c-cf5e-4a1f-8886-a22bc107e59c": l$1, "sh_f787d79d-e3f8-4234-a59a-2258d183270d": g$1, "sh_e6aa97a7-cbc8-4852-935f-cac743960953": _$2, "sh_d935a9f8-c5df-4bb3-ad20-456f717fefe4": R$3, "sh_c6758292-c0eb-4354-9588-e577e859ccba": r, "sh_2ba6ff5a-fb08-4bd9-89c6-3084cf0adaeb": r, "sh_baa9ba65-b453-48d2-9b66-b445bea4cd58": r, "sh_5508ffc0-fe93-4d82-b9ea-f5bb4abd629c": r, "sh_2047147f-7dfd-4510-b09d-a3ce5d52d9ab": r, "sh_742f04ea-50bb-4a4b-b71f-407ac13f253e": r, "sh_7a484f64-e468-4a20-84c6-ffe77dbebe96": r, "sh_ef07a63c-d4be-4c6e-bdde-e64f4c8afdd6": r, "sh_87d0ebf3-4cd2-4241-bc51-d7b274466f83": M$4, "sh_01e38772-32e8-4476-832c-cb4c94de74ea": x$2, "sh_9c17c8d8-a2e7-45ab-8e02-7dee57366b2b": v$3, "sh_e3c48072-ff77-49ca-840a-5c72ee2519b0": t$1, "sh_1f2fcdc8-2842-479d-b3d9-b2e0a1f51f14": t$1, "sh_10a20816-d098-4f06-b2f7-ec47a4d5602f": U$3, "sh_ea6d124d-8b50-4d5b-ba2e-87818220e248": f$2, "sh_94e99f91-3c93-4c4a-b843-3f527f4c4ca3": { dialects: ["latin", "japanese"] } }, A$3 = reactExports.createContext({}), E$1 = ({ shopId: d2, children: C2 }) => { 49801 var _a;
49802 let P2 = (_a = d2 ? T$1[d2] : void 0) != null ? _a : {}; 49803 return jsxRuntimeExports.jsx(A$3.Provider, { value: P2, children: C2 }); 49804 }, w$4 = () => reactExports.useContext(A$3); 49805 const Container$b = dt$2.div` 49806 display: flex; 49807 align-items: center; 49808 justify-content: center; 49809 padding: var(--space-800) 0; 49810`; 49811 const LayoutLoader = () => { 49812 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$b, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "large" }) }); 49813 }; 49814 const Container$a = dt$2.div` 49815 display: flex; 49816 gap: var(--space-400); 49817 flex-direction: column; 49818 49819 ${mediaQueries.tablet} { 49820 flex-direction: row; 49821 } 49822`; 49823 const LayoutTabs = ({ children }) => { 49824 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$a, { children }); 49825 }; 49826 const BackButton = dt$2.button` 49827 margin-bottom: var(--space-200); 49828`; 49829 const Container$9 = dt$2.h1` 49830 color: var(--text-primary); 49831 49832 font-size: var(--font-size-600); 49833 font-family: var(--font-family-heading); 49834 font-weight: var(--font-weight-480); 49835 line-height: var(--font-line-height-500); 49836 letter-spacing: var(--font-letter-spacing-dense); 49837 font-style: var(--font-style-heading); 49838 text-transform: var(--text-transform-heading); 49839 49840 ${mediaQueries.laptop} { 49841 font-size: var(--font-size-700); 49842 font-weight: var(--font-weight-460); 49843 line-height: var(--font-line-height-600); 49844 letter-spacing: var(--font-letter-spacing-denser); 49845 } 49846`; 49847 const LayoutTitle = ({ children, backLocation }) => { 49848 const { t: t2 } = useTranslation("components", { keyPrefix: "layout" }); 49849 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
49850 backLocation && /* @__PURE__ */ jsxRuntimeExports.jsx(BackButton, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BackButton$1, { label: t2("back_label"), to: backLocation }) }), 49851 /* @__PURE__ */ jsxRuntimeExports.jsx(Container$9, { children }) 49852 ] }); 49853 }; 49854 const Container$8 = dt$2.div``; 49855 const Inner = dt$2.div` 49856 display: flex; 49857 flex-direction: column; 49858 position: relative; 49859 gap: var(--space-400); 49860 padding: 0 var(--space-600); 49861 margin-bottom: var(--space-600); 49862 49863 ${mediaQueries.laptop} { 49864 max-width: 664px; 49865 padding: 0 var(--space-800); 49866 margin: 0 auto var(--space-800); 49867 gap: var(--space-600); 49868 } 49869`; 49870 const Top = dt$2.nav` 49871 padding: var(--space-500) var(--space-600) 0; 49872 margin-bottom: var(--space-1000); 49873 display: flex; 49874 justify-content: center; 49875 align-items: center; 49876 49877 ${mediaQueries.tablet} { 49878 padding: var(--space-500) var(--space-800) 0; 49879 } 49880 49881 ${mediaQueries.laptop} { 49882 padding-left: 0; 49883 padding-right: 0; 49884 } 49885`; 49886 const PlatformLogo = dt$2.h1` 49887 display: inline-flex; 49888 align-items: center; 49889 color: var(--text-primary); 49890`; 49891 const Layout = ({ logoName, logoUrl, externalStoreUrl, children }) => { 49892 const { t: t2 } = useTranslation("components", { keyPrefix: "layout" }); 49893 const { layout: layout2 } = w$4(); 49894 const renderLogo = () => { 49895 if (layout2 == null ? void 0 : layout2.platformLogo) { 49896 return /* @__PURE__ */ jsxRuntimeExports.jsx(PlatformLogo, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(P8, { width: 113, height: 20, "aria-label": "Fourthwall" }) }); 49897 } 49898 return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: externalStoreUrl || "/", title: t2("logo_title"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ShopLogo, { name: logoName, url: logoUrl }) }); 49899 }; 49900 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$8, { children: [
49901 /* @__PURE__ */ jsxRuntimeExports.jsx(Top, { children: renderLogo() }), 49902 /* @__PURE__ */ jsxRuntimeExports.jsx(Inner, { children }) 49903 ] }); 49904 }; 49905 Layout.Title = LayoutTitle; 49906 Layout.Loader = LayoutLoader; 49907 Layout.Tabs = LayoutTabs; 49908 const buildContactMetaTags = ({ 49909 title, 49910 description, 49911 siteName, 49912 url, 49913 imageUrl 49914 }) => [ 49915 { name: "description", content: description }, 49916 { property: "og:site_name", content: siteName }, 49917 { property: "og:url", content: url }, 49918 { property: "og:title", content: title }, 49919 { property: "og:type", content: "website" }, 49920 { property: "og:description", content: description }, 49921 ...imageUrl ? [ 49922 { property: "og:image", content: imageUrl }, 49923 { property: "og:image:secure_url", content: imageUrl }, 49924 { name: "twitter:image", content: imageUrl } 49925 ] : [], 49926 { name: "twitter:card", content: "summary_large_image" }, 49927 { name: "twitter:title", content: title }, 49928 { name: "twitter:description", content: description } 49929 ]; 49930 const buildOrganizationSchema = ({ 49931 name, 49932 url, 49933 contactUrl, 49934 logoUrl, 49935 contactEmail 49936 }) => __spreadProps(__spreadValues({ 49937 "@context": "https://schema.org", 49938 "@type": "Organization", 49939 name, 49940 url 49941 }, logoUrl ? { logo: logoUrl } : {}), { 49942 contactPoint: __spreadValues({ 49943 "@type": "ContactPoint", 49944 contactType: "customer support", 49945 url: contactUrl 49946 }, contactEmail ? { email: contactEmail } : {}) 49947 }); 49948 const TITLE_SEPARATOR = " â "; 49949 const ContactHead = ({ 49950 shopName, 49951 contactEmail, 49952 logoUrl, 49953 externalStoreUrl 49954 }) => { 49955 const { t: t2 } = useTranslation("modules", { keyPrefix: "contact" }); 49956 const title = t2("page_title"); 49957 if (!shopName) { 49958 return /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, { title }); 49959 } 49960 const pageUrl = `${window.location.origin}/contact`; 49961 const fullTitle = `${title}${TITLE_SEPARATOR}${shopName}`; 49962 const description = t2("meta_description", { shopName, interpolation: { escapeValue: false } }); 49963 const metaTags = buildContactMetaTags({ 49964 title: fullTitle, 49965 description, 49966 siteName: shopName, 49967 url: pageUrl, 49968 imageUrl: logoUrl 49969 }); 49970 const organizationSchema = buildOrganizationSchema({ 49971 name: shopName, 49972 url: externalStoreUrl != null ? externalStoreUrl : window.location.origin, 49973 contactUrl: pageUrl, 49974 logoUrl, 49975 contactEmail 49976 }); 49977 return /* @__PURE__ */ jsxRuntimeExports.jsxs(HeadContent, { title, titleTemplate: `%s${TITLE_SEPARATOR}${shopName}`, children: [
49978 /* @__PURE__ */ jsxRuntimeExports.jsx("link", { rel: "canonical", href: pageUrl }), 49979 metaTags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx("meta", __spreadValues({}, tag), "name" in tag ? tag.name : tag.property)), 49980 /* @__PURE__ */ jsxRuntimeExports.jsx("script", { type: "application/ld+json", children: me$2(JSON.stringify(organizationSchema)) }) 49981 ] }); 49982 }; 49983 var warn = {}; 49984 var hasRequiredWarn; 49985 function requireWarn() { 49986 if (hasRequiredWarn) return warn; 49987 hasRequiredWarn = 1; 49988 Object.defineProperty(warn, "__esModule", { 49989 value: true 49990 }); 49991 var warn$12 = function warn2(s2) { 49992 console.warn("[react-gtm]", s2); 49993 }; 49994 warn.default = warn$12; 49995 return warn; 49996 } 49997 var Snippets_1; 49998 var hasRequiredSnippets; 49999 function requireSnippets() { 50000 if (hasRequiredSnippets) return Snippets_1; 50001 hasRequiredSnippets = 1; 50002 var _warn = requireWarn(); 50003 var _warn2 = _interopRequireDefault(_warn); 50004 function _interopRequireDefault(obj) { 50005 return obj && obj.__esModule ? obj : { default: obj }; 50006 } 50007 var Snippets = { 50008 tags: function tags(_ref2) { 50009 var id2 = _ref2.id, events = _ref2.events, dataLayer = _ref2.dataLayer, dataLayerName = _ref2.dataLayerName, preview = _ref2.preview, auth = _ref2.auth; 50010 var gtm_auth = ">m_auth=" + auth; 50011 var gtm_preview = ">m_preview=" + preview; 50012 if (!id2) (0, _warn2.default)("GTM Id is required"); 50013 var iframe = '\n <iframe src="https://www.googletagmanager.com/ns.html?id=' + id2 + gtm_auth + gtm_preview + '>m_cookies_win=x"\n height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>'; 50014 var script = "\n (function(w,d,s,l,i){w[l]=w[l]||[];\n w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', " + JSON.stringify(events).slice(1, -1) + "});\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n j.async=true;
50014j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'" + gtm_auth + gtm_preview + ">m_cookies_win=x';\n f.parentNode.insertBefore(j,f);\n })(window,document,'script','" + dataLayerName + "','" + id2 + "');"; 50015 var dataLayerVar = this.dataLayer(dataLayer, dataLayerName); 50016 return { 50017 iframe, 50018 script, 50019 dataLayerVar 50020 }; 50021 }, 50022 dataLayer: function dataLayer(_dataLayer, dataLayerName) { 50023 return "\n window." + dataLayerName + " = window." + dataLayerName + " || [];\n window." + dataLayerName + ".push(" + JSON.stringify(_dataLayer) + ")"; 50024 } 50025 }; 50026 Snippets_1 = Snippets; 50027 return Snippets_1; 50028 } 50029 var TagManager_1; 50030 var hasRequiredTagManager; 50031 function requireTagManager() { 50032 if (hasRequiredTagManager) return TagManager_1; 50033 hasRequiredTagManager = 1; 50034 var _Snippets = requireSnippets(); 50035 var _Snippets2 = _interopRequireDefault(_Snippets); 50036 function _interopRequireDefault(obj) { 50037 return obj && obj.__esModule ? obj : { default: obj }; 50038 } 50039 var TagManager2 = { 50040 dataScript: function dataScript(dataLayer) { 50041 var script = document.createElement("script"); 50042 script.innerHTML = dataLayer; 50043 return script; 50044 }, 50045 gtm: function gtm(args) { 50046 var snippets = _Snippets2.default.tags(args); 50047 var noScript = function noScript2() { 50048 var noscript = document.createElement("noscript"); 50049 noscript.innerHTML = snippets.iframe; 50050 return noscript; 50051 }; 50052 var script = function script2() { 50053 var script3 = document.createElement("script"); 50054 script3.innerHTML = snippets.script; 50055 return script3; 50056 }; 50057 var dataScript = this.dataScript(snippets.dataLayerVar); 50058 return { 50059 noScript, 50060 script, 50061 dataScript 50062 }; 50063 }, 50064 initialize: function initialize(_ref2) { 50065 var gtmId = _ref2.gtmId, _ref$events = _ref2.events, events = _ref$events === void 0 ? {} : _ref$events, dataLayer = _ref2.dataLayer, _ref$dataLayerName = _ref2.dataLayerName, dataLayerName = _ref$dataLayerName === void 0 ? "dataLayer" : _ref$dataLayerName, _ref$auth = _ref2.auth, auth = _ref$auth === void 0 ? "" : _ref$auth, _ref$preview = _ref2.preview, preview = _ref$preview === void 0 ? "" : _ref$preview; 50066 var gtm = this.gtm({ 50067 id: gtmId, 50068 events, 50069 dataLayer: dataLayer || void 0, 50070 dataLayerName, 50071 auth, 50072 preview 50073 }); 50074 if (dataLayer) document.head.appendChild(gtm.dataScript); 50075 document.head.insertBefore(gtm.script(), document.head.childNodes[0]); 50076 document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]); 50077 }, 50078 dataLayer: function dataLayer(_ref2) { 50079 var _dataLayer = _ref2.dataLayer, _ref2$dataLayerName = _ref2.dataLayerName, dataLayerName = _ref2$dataLayerName === void 0 ? "dataLayer" : _ref2$dataLayerName; 50080 if (window[dataLayerName]) return window[dataLayerName].push(_dataLayer); 50081 var snippets = _Snippets2.default.dataLayer(_dataLayer, dataLayerName); 50082 var dataScript = this.dataScript(snippets); 50083 document.head.insertBefore(dataScript, document.head.childNodes[0]); 50084 } 50085 }; 50086 TagManager_1 = TagManager2; 50087 return TagManager_1; 50088 } 50089 var dist$1; 50090 var hasRequiredDist$1; 50091 function requireDist$1() { 50092 if (hasRequiredDist$1) return dist$1; 50093 hasRequiredDist$1 = 1; 50094 var _TagManager = requireTagManager(); 50095 var _TagManager2 = _interopRequireDefault(_TagManager); 50096 function _interopRequireDefault(obj) { 50097 return obj && obj.__esModule ? obj : { default: obj }; 50098 } 50099 dist$1 = _TagManager2.default; 50100 return dist$1; 50101 } 50102 var distExports = requireDist$1(); 50103 const TagManager = /* @__PURE__ */ getDefaultExportFromCjs(distExports); 50104 var dist = {}; 50105 function lexer(str) { 50106 var tokens = []; 50107 var i2 = 0; 50108 while (i2 < str.length) { 50109 var char2 = str[i2]; 50110 if (char2 === "*" || char2 === "+" || char2 === "?") { 50111 tokens.push({ type: "MODIFIER", index: i2, value: str[i2++] }); 50112 continue; 50113 } 50114 if (char2 === "\\") { 50115 tokens.push({ type: "ESCAPED_CHAR", index: i2++, value: str[i2++] }); 50116 continue; 50117 } 50118 if (char2 === "{") { 50119 tokens.push({ type: "OPEN", index: i2, value: str[i2++] }); 50120 continue; 50121 } 50122 if (char2 === "}") { 50123 tokens.push({ type: "CLOSE", index: i2, value: str[i2++] }); 50124 continue; 50125 } 50126 if (char2 === ":") { 50127 var name = ""; 50128 var j2 = i2 + 1; 50129 while (j2 < str.length) { 50130 var code = str.charCodeAt(j2); 50131 if ( 50132 // `0-9` 50133 code >= 48 && code <= 57 || // `A-Z` 50134 code >= 65 && code <= 90 || // `a-z` 50135 code >= 97 && code <= 122 || // `_` 50136 code === 95 50137 ) { 50138 name += str[j2++]; 50139 continue; 50140 } 50141 break; 50142 } 50143 if (!name) 50144 throw new TypeError("Missing parameter name at ".concat(i2)); 50145 tokens.push({ type: "NAME", index: i2, value: name }); 50146 i2 = j2; 50147 continue; 50148 } 50149 if (char2 === "(") { 50150 var count2 = 1; 50151 var pattern = ""; 50152 var j2 = i2 + 1; 50153 if (str[j2] === "?") { 50154 throw new TypeError('Pattern cannot start with "?" at '.concat(j2)); 50155 } 50156 while (j2 < str.length) { 50157 if (str[j2] === "\\") { 50158 pattern += str[j2++] + str[j2++]; 50159 continue; 50160 } 50161 if (str[j2] === ")") { 50162 count2--; 50163 if (count2 === 0) { 50164 j2++; 50165 break; 50166 } 50167 } else if (str[j2] === "(") { 50168 count2++; 50169 if (str[j2 + 1] !== "?") { 50170 throw new TypeError("Capturing groups are not allowed at ".concat(j2)); 50171 } 50172 } 50173 pattern += str[j2++]; 50174 } 50175 if (count2) 50176 throw new TypeError("Unbalanced pattern at ".concat(i2)); 50177 if (!pattern) 50178 throw new TypeError("Missing pattern at ".concat(i2)); 50179 tokens.push({ type: "PATTERN", index: i2, value: pattern }); 50180 i2 = j2; 50181 continue; 50182 } 50183 tokens.push({ type: "CHAR", index: i2, value: str[i2++] }); 50184 } 50185 tokens.push({ type: "END", index: i2, value: "" }); 50186 return tokens; 50187 } 50188 function parse(str, options2) { 50189 if (options2 === void 0) { 50190 options2 = {}; 50191 } 50192 var tokens = lexer(str); 50193 var _a = options2.prefixes, prefixes2 = _a === void 0 ? "./" : _a, _b = options2.delimiter, delimiter2 = _b === void 0 ? "/#?" : _b; 50194 var result = []; 50195 var key = 0; 50196 var i2 = 0; 50197 var path = ""; 50198 var tryConsume = function(type) { 50199 if (i2 < tokens.length && tokens[i2].type === type) 50200 return tokens[i2++].value; 50201 }; 50202 var mustConsume = function(type) { 50203 var value2 = tryConsume(type); 50204 if (value2 !== void 0) 50205 return value2; 50206 var _a2 = tokens[i2], nextType = _a2.type, index2 = _a2.index; 50207 throw new TypeError("Unexpected ".concat(nextType, " at ").concat(index2, ", expected ").concat(type)); 50208 }; 50209 var consumeText = function() { 50210 var result2 = ""; 50211 var value2;
vendor: 5,625 bytes, lines 50212-50363
50212 while (value2 = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR")) { 50213 result2 += value2; 50214 } 50215 return result2; 50216 }; 50217 var isSafe = function(value2) { 50218 for (var _i2 = 0, delimiter_1 = delimiter2; _i2 < delimiter_1.length; _i2++) { 50219 var char3 = delimiter_1[_i2]; 50220 if (value2.indexOf(char3) > -1) 50221 return true; 50222 } 50223 return false; 50224 }; 50225 var safePattern = function(prefix3) { 50226 var prev2 = result[result.length - 1]; 50227 var prevText = prefix3 || (prev2 && typeof prev2 === "string" ? prev2 : ""); 50228 if (prev2 && !prevText) { 50229 throw new TypeError('Must have text between two parameters, missing text after "'.concat(prev2.name, '"')); 50230 } 50231 if (!prevText || isSafe(prevText)) 50232 return "[^".concat(escapeString(delimiter2), "]+?"); 50233 return "(?:(?!".concat(escapeString(prevText), ")[^").concat(escapeString(delimiter2), "])+?"); 50234 }; 50235 while (i2 < tokens.length) { 50236 var char2 = tryConsume("CHAR"); 50237 var name = tryConsume("NAME"); 50238 var pattern = tryConsume("PATTERN"); 50239 if (name || pattern) { 50240 var prefix2 = char2 || ""; 50241 if (prefixes2.indexOf(prefix2) === -1) { 50242 path += prefix2; 50243 prefix2 = ""; 50244 } 50245 if (path) { 50246 result.push(path); 50247 path = ""; 50248 } 50249 result.push({ 50250 name: name || key++, 50251 prefix: prefix2, 50252 suffix: "", 50253 pattern: pattern || safePattern(prefix2), 50254 modifier: tryConsume("MODIFIER") || "" 50255 }); 50256 continue; 50257 } 50258 var value = char2 || tryConsume("ESCAPED_CHAR"); 50259 if (value) { 50260 path += value; 50261 continue; 50262 } 50263 if (path) { 50264 result.push(path); 50265 path = ""; 50266 } 50267 var open = tryConsume("OPEN"); 50268 if (open) { 50269 var prefix2 = consumeText(); 50270 var name_1 = tryConsume("NAME") || ""; 50271 var pattern_1 = tryConsume("PATTERN") || ""; 50272 var suffix = consumeText(); 50273 mustConsume("CLOSE"); 50274 result.push({ 50275 name: name_1 || (pattern_1 ? key++ : ""), 50276 pattern: name_1 && !pattern_1 ? safePattern(prefix2) : pattern_1, 50277 prefix: prefix2, 50278 suffix, 50279 modifier: tryConsume("MODIFIER") || "" 50280 }); 50281 continue; 50282 } 50283 mustConsume("END"); 50284 } 50285 return result; 50286 } 50287 function compile(str, options2) { 50288 return tokensToFunction(parse(str, options2), options2); 50289 } 50290 function tokensToFunction(tokens, options2) { 50291 if (options2 === void 0) { 50292 options2 = {}; 50293 } 50294 var reFlags2 = flags(options2); 50295 var _a = options2.encode, encode2 = _a === void 0 ? function(x2) { 50296 return x2; 50297 } : _a, _b = options2.validate, validate = _b === void 0 ? true : _b; 50298 var matches2 = tokens.map(function(token2) { 50299 if (typeof token2 === "object") { 50300 return new RegExp("^(?:".concat(token2.pattern, ")$"), reFlags2); 50301 } 50302 }); 50303 return function(data) { 50304 var path = ""; 50305 for (var i2 = 0; i2 < tokens.length; i2++) { 50306 var token2 = tokens[i2]; 50307 if (typeof token2 === "string") { 50308 path += token2; 50309 continue; 50310 } 50311 var value = data ? data[token2.name] : void 0; 50312 var optional = token2.modifier === "?" || token2.modifier === "*"; 50313 var repeat = token2.modifier === "*" || token2.modifier === "+"; 50314 if (Array.isArray(value)) { 50315 if (!repeat) { 50316 throw new TypeError('Expected "'.concat(token2.name, '" to not repeat, but got an array')); 50317 } 50318 if (value.length === 0) { 50319 if (optional) 50320 continue; 50321 throw new TypeError('Expected "'.concat(token2.name, '" to not be empty')); 50322 } 50323 for (var j2 = 0; j2 < value.length; j2++) { 50324 var segment = encode2(value[j2], token2); 50325 if (validate && !matches2[i2].test(segment)) { 50326 throw new TypeError('Expected all "'.concat(token2.name, '" to match "').concat(token2.pattern, '", but got "').concat(segment, '"')); 50327 } 50328 path += token2.prefix + segment + token2.suffix; 50329 } 50330 continue; 50331 } 50332 if (typeof value === "string" || typeof value === "number") { 50333 var segment = encode2(String(value), token2); 50334 if (validate && !matches2[i2].test(segment)) { 50335 throw new TypeError('Expected "'.concat(token2.name, '" to match "').concat(token2.pattern, '", but got "').concat(segment, '"')); 50336 } 50337 path += token2.prefix + segment + token2.suffix; 50338 continue; 50339 } 50340 if (optional) 50341 continue; 50342 var typeOfMessage = repeat ? "an array" : "a string"; 50343 throw new TypeError('Expected "'.concat(token2.name, '" to be ').concat(typeOfMessage)); 50344 } 50345 return path; 50346 }; 50347 } 50348 function match(str, options2) { 50349 var keys2 = []; 50350 var re2 = pathToRegexp(str, keys2, options2); 50351 return regexpToFunction(re2, keys2, options2); 50352 } 50353 function regexpToFunction(re2, keys2, options2) { 50354 if (options2 === void 0) { 50355 options2 = {}; 50356 } 50357 var _a = options2.decode, decode2 = _a === void 0 ? function(x2) { 50358 return x2; 50359 } : _a; 50360 return function(pathname) { 50361 var m2 = re2.exec(pathname); 50362 if (!m2) 50363 return false;
vendor: 6,174 bytes, lines 50364-50512
50364 var path = m2[0], index2 = m2.index; 50365 var params = /* @__PURE__ */ Object.create(null); 50366 var _loop_1 = function(i3) { 50367 if (m2[i3] === void 0) 50368 return "continue"; 50369 var key = keys2[i3 - 1]; 50370 if (key.modifier === "*" || key.modifier === "+") { 50371 params[key.name] = m2[i3].split(key.prefix + key.suffix).map(function(value) { 50372 return decode2(value, key); 50373 }); 50374 } else { 50375 params[key.name] = decode2(m2[i3], key); 50376 } 50377 }; 50378 for (var i2 = 1; i2 < m2.length; i2++) { 50379 _loop_1(i2); 50380 } 50381 return { path, index: index2, params }; 50382 }; 50383 } 50384 function escapeString(str) { 50385 return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); 50386 } 50387 function flags(options2) { 50388 return options2 && options2.sensitive ? "" : "i"; 50389 } 50390 function regexpToRegexp(path, keys2) { 50391 if (!keys2) 50392 return path; 50393 var groupsRegex = /\((?:\?<(.*?)>)?(?!\?)/g; 50394 var index2 = 0; 50395 var execResult = groupsRegex.exec(path.source); 50396 while (execResult) { 50397 keys2.push({ 50398 // Use parenthesized substring match if available, index otherwise 50399 name: execResult[1] || index2++, 50400 prefix: "", 50401 suffix: "", 50402 modifier: "", 50403 pattern: "" 50404 }); 50405 execResult = groupsRegex.exec(path.source); 50406 } 50407 return path; 50408 } 50409 function arrayToRegexp(paths, keys2, options2) { 50410 var parts = paths.map(function(path) { 50411 return pathToRegexp(path, keys2, options2).source; 50412 }); 50413 return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options2)); 50414 } 50415 function stringToRegexp(path, keys2, options2) { 50416 return tokensToRegexp(parse(path, options2), keys2, options2); 50417 } 50418 function tokensToRegexp(tokens, keys2, options2) { 50419 if (options2 === void 0) { 50420 options2 = {}; 50421 } 50422 var _a = options2.strict, strict2 = _a === void 0 ? false : _a, _b = options2.start, start = _b === void 0 ? true : _b, _c = options2.end, end = _c === void 0 ? true : _c, _d = options2.encode, encode2 = _d === void 0 ? function(x2) { 50423 return x2; 50424 } : _d, _e2 = options2.delimiter, delimiter2 = _e2 === void 0 ? "/#?" : _e2, _f = options2.endsWith, endsWith2 = _f === void 0 ? "" : _f; 50425 var endsWithRe = "[".concat(escapeString(endsWith2), "]|$"); 50426 var delimiterRe = "[".concat(escapeString(delimiter2), "]"); 50427 var route = start ? "^" : ""; 50428 for (var _i2 = 0, tokens_1 = tokens; _i2 < tokens_1.length; _i2++) { 50429 var token2 = tokens_1[_i2]; 50430 if (typeof token2 === "string") { 50431 route += escapeString(encode2(token2)); 50432 } else { 50433 var prefix2 = escapeString(encode2(token2.prefix)); 50434 var suffix = escapeString(encode2(token2.suffix)); 50435 if (token2.pattern) { 50436 if (keys2) 50437 keys2.push(token2); 50438 if (prefix2 || suffix) { 50439 if (token2.modifier === "+" || token2.modifier === "*") { 50440 var mod = token2.modifier === "*" ? "?" : ""; 50441 route += "(?:".concat(prefix2, "((?:").concat(token2.pattern, ")(?:").concat(suffix).concat(prefix2, "(?:").concat(token2.pattern, "))*)").concat(suffix, ")").concat(mod); 50442 } else { 50443 route += "(?:".concat(prefix2, "(").concat(token2.pattern, ")").concat(suffix, ")").concat(token2.modifier); 50444 } 50445 } else { 50446 if (token2.modifier === "+" || token2.modifier === "*") { 50447 throw new TypeError('Can not repeat "'.concat(token2.name, '" without a prefix and suffix')); 50448 } 50449 route += "(".concat(token2.pattern, ")").concat(token2.modifier); 50450 } 50451 } else { 50452 route += "(?:".concat(prefix2).concat(suffix, ")").concat(token2.modifier); 50453 } 50454 } 50455 } 50456 if (end) { 50457 if (!strict2) 50458 route += "".concat(delimiterRe, "?"); 50459 route += !options2.endsWith ? "$" : "(?=".concat(endsWithRe, ")"); 50460 } else { 50461 var endToken = tokens[tokens.length - 1]; 50462 var isEndDelimited = typeof endToken === "string" ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1 : endToken === void 0; 50463 if (!strict2) { 50464 route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?"); 50465 } 50466 if (!isEndDelimited) { 50467 route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")"); 50468 } 50469 } 50470 return new RegExp(route, flags(options2)); 50471 } 50472 function pathToRegexp(path, keys2, options2) { 50473 if (path instanceof RegExp) 50474 return regexpToRegexp(path, keys2); 50475 if (Array.isArray(path)) 50476 return arrayToRegexp(path, keys2, options2); 50477 return stringToRegexp(path, keys2, options2); 50478 } 50479 const dist_es2015 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 50480 __proto__: null, 50481 compile, 50482 match, 50483 parse, 50484 pathToRegexp, 50485 regexpToFunction, 50486 tokensToFunction, 50487 tokensToRegexp 50488 }, Symbol.toStringTag, { value: "Module" })); 50489 const require$$0 = /* @__PURE__ */ getAugmentedNamespace(dist_es2015); 50490 var hasRequiredDist; 50491 function requireDist() { 50492 if (hasRequiredDist) return dist; 50493 hasRequiredDist = 1; 50494 Object.defineProperty(dist, "__esModule", { value: true }); 50495 var pathToRegexp2 = require$$0; 50496 var include = function include2(base, routes2) { 50497 var mappedRoutes = { 50498 toString: function toString2() { 50499 return base; 50500 } 50501 }; 50502 Object.keys(routes2).forEach(function(route) { 50503 var url = routes2[route]; 50504 if (typeof url === "function" && route === "toString") { 50505 mappedRoutes.toString = function() { 50506 return base + routes2.toString(); 50507 }; 50508 } else if (typeof url === "object") { 50509 mappedRoutes[route] = include2(base, url); 50510 } else if (typeof url === "string") { 50511 mappedRoutes[route] = url.indexOf("/") === 0 ? url : [base, url].join("/").replace("//", "/"); 50512 } else {
50513 throw new TypeError('"' + route + '" is not valid. A routes object can only contain a string, an object or the "toString" method as values.'); 50514 } 50515 }); 50516 return mappedRoutes; 50517 }; 50518 function compileWithParams(pattern, params) { 50519 var reversed = pathToRegexp2.compile(pattern); 50520 return reversed(params); 50521 } 50522 var reverse = function reverse2(pattern, params) { 50523 if (params === void 0) { 50524 params = {}; 50525 } 50526 try { 50527 return compileWithParams(pattern, params); 50528 } catch (err) { 50529 return pattern; 50530 } 50531 }; 50532 var reverseForce = function reverseForce2(pattern, params) { 50533 if (params === void 0) { 50534 params = {}; 50535 } 50536 try { 50537 return compileWithParams(pattern, params); 50538 } catch (err) { 50539 var tokens = pathToRegexp2.parse(pattern); 50540 return tokens.filter(function(token2) { 50541 return typeof token2 === "string"; 50542 }).join(""); 50543 } 50544 }; 50545 dist.include = include; 50546 dist.reverse = reverse; 50547 dist.reverseForce = reverseForce; 50548 return dist; 50549 } 50550 requireDist(); 50551 const routes = { 50552 contact: { 50553 self: "/contact", 50554 orderPlaced: { 50555 self: "/contact/order-placed", 50556 variants: "/contact/order-placed/variants", 50557 details: "/contact/order-placed/details", 50558 somethingElse: "/contact/order-placed/something-else" 50559 }, 50560 somethingElse: "/contact/something-else", 50561 success: "/contact/success", 50562 logout: "/contact/logout" 50563 } 50564 }; 50565 const getScreenId = (pathname) => { 50566 if (pathname === routes.contact.orderPlaced.details) { 50567 return "ORDER_ITEMS_FORM"; 50568 } 50569 if (pathname === routes.contact.orderPlaced.somethingElse) { 50570 return "ORDER_OTHER"; 50571 } 50572 if (pathname === routes.contact.orderPlaced.variants) { 50573 return "ORDER_ITEMS_SELECTION"; 50574 } 50575 if (pathname === routes.contact.orderPlaced.self) { 50576 return "START_ORDER"; 50577 } 50578 if (pathname === routes.contact.somethingElse) { 50579 return "START_OTHER"; 50580 } 50581 if (pathname === routes.contact.success) { 50582 return "SUCCESS"; 50583 } 50584 return null; 50585 }; 50586 const GTM_MASTER_PROD_ID = "GTM-PV2BBNN"; 50587 const GTM_MASTER_STG_ID = "GTM-W8XP9DK"; 50588 const AnalyticsContext = reactExports.createContext(null); 50589 const AnalyticsProvider = ({ children }) => { 50590 const { pathname } = useLocation(); 50591 reactExports.useEffect(() => { 50592 const env = getCurrentEnvironment(); 50593 if (env === "development") return; 50594 TagManager.initialize({ gtmId: env === "production" ? GTM_MASTER_PROD_ID : GTM_MASTER_STG_ID }); 50595 }, []); 50596 const screenId = getScreenId(pathname); 50597 const value = reactExports.useMemo( 50598 () => ({ 50599 trackEvent: (eventName, params) => { 50600 if (getCurrentEnvironment() === "development") return; 50601 TagManager.dataLayer({ 50602 dataLayer: __spreadValues({ 50603 event: eventName 50604 }, params) 50605 }); 50606 }, 50607 screenId 50608 }), 50609 [screenId] 50610 ); 50611 return /* @__PURE__ */ jsxRuntimeExports.jsx(AnalyticsContext.Provider, { value, children }); 50612 }; 50613 const useAnalytics = () => { 50614 const context = reactExports.useContext(AnalyticsContext); 50615 if (!context) { 50616 throw new Error("useAnalytics must be used within an AnalyticsProvider"); 50617 } 50618 return context; 50619 }; 50620 const OrderAuthContext = reactExports.createContext({ 50621 isAuthorized: false, 50622 login: () => { 50623 }, 50624 logout: () => { 50625 } 50626 }); 50627 const LOCAL_STORAGE_KEY = "fourthwall.com:contact-login"; 50628 const OrderAuthProvider = ({ children }) => { 50629 const [searchParams, setSearchParams] = useSearchParams(); 50630 const [credentials, setCredentials] = reactExports.useState(null); 50631 const { localStorage: localStorage2 } = H$3(LOCAL_STORAGE_KEY); 50632 const readCredentials = () => { 50633 const email = localStorage2.get("email"); 50634 const friendlyId = localStorage2.get("friendlyId"); 50635 if (email && friendlyId) { 50636 setCredentials({ email, friendlyId }); 50637 } 50638 }; 50639 const login = reactExports.useCallback( 50640 (orderAuthCredentials) => { 50641 localStorage2.set("email", orderAuthCredentials.email); 50642 localStorage2.set("friendlyId", orderAuthCredentials.friendlyId); 50643 setCredentials(orderAuthCredentials); 50644 }, 50645 [localStorage2] 50646 ); 50647 const logout = reactExports.useCallback(() => { 50648 localStorage2.clear(); 50649 setCredentials(null); 50650 }, [localStorage2]); 50651 reactExports.useEffect(() => { 50652 const email = searchParams.get("email"); 50653 const friendlyId = searchParams.get("friendlyId"); 50654 if (email && friendlyId) { 50655 login({ email, friendlyId }); 50656 searchParams.delete("email"); 50657 searchParams.delete("friendlyId"); 50658 setSearchParams(searchParams); 50659 } else { 50660 readCredentials(); 50661 } 50662 }, []); 50663 const value = reactExports.useMemo( 50664 () => ({ 50665 isAuthorized: !!(credentials == null ? void 0 : credentials.email) && !!(credentials == null ? void 0 : credentials.friendlyId), 50666 email: credentials == null ? void 0 : credentials.email, 50667 friendlyId: credentials == null ? void 0 : credentials.friendlyId, 50668 login, 50669 logout 50670 }), 50671 [credentials, login, logout] 50672 ); 50673 return /* @__PURE__ */ jsxRuntimeExports.jsx(OrderAuthContext.Provider, { value, children }); 50674 }; 50675 const useOrderAuth = () => { 50676 return reactExports.useContext(OrderAuthContext); 50677 }; 50678 class Subscribable { 50679 constructor() { 50680 this.listeners = /* @__PURE__ */ new Set(); 50681 this.subscribe = this.subscribe.bind(this); 50682 } 50683 subscribe(listener) { 50684 const identity2 = { 50685 listener 50686 }; 50687 this.listeners.add(identity2); 50688 this.onSubscribe(); 50689 return () => { 50690 this.listeners.delete(identity2); 50691 this.onUnsubscribe(); 50692 }; 50693 } 50694 hasListeners() { 50695 return this.listeners.size > 0; 50696 } 50697 onSubscribe() { 50698 } 50699 onUnsubscribe() { 50700 } 50701 } 50702 const isServer = typeof window === "undefined" || "Deno" in window; 50703 function noop$1() { 50704 return void 0; 50705 } 50706 function functionalUpdate(updater, input) { 50707 return typeof updater === "function" ? updater(input) : updater; 50708 } 50709 function isValidTimeout(value) { 50710 return typeof value === "number" && value >= 0 && value !== Infinity; 50711 } 50712 function timeUntilStale(updatedAt, staleTime) { 50713 return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 50714 } 50715 function parseQueryArgs(arg1, arg2, arg3) { 50716 if (!isQueryKey(arg1)) { 50717 return arg1; 50718 } 50719 if (typeof arg2 === "function") { 50720 return __spreadProps(__spreadValues({}, arg3), { 50721 queryKey: arg1, 50722 queryFn: arg2 50723 }); 50724 } 50725 return __spreadProps(__spreadValues({}, arg2), { 50726 queryKey: arg1 50727 }); 50728 } 50729 function parseMutationArgs(arg1, arg2, arg3) { 50730 if (isQueryKey(arg1)) { 50731 return __spreadProps(__spreadValues({}, arg2), { 50732 mutationKey: arg1 50733 }); 50734 } 50735 if (typeof arg1 === "function") { 50736 return __spreadProps(__spreadValues({}, arg2), { 50737 mutationFn: arg1 50738 }); 50739 } 50740 return __spreadValues({}, arg1); 50741 } 50742 function parseFilterArgs(arg1, arg2, arg3) { 50743 return isQueryKey(arg1) ? [__spreadProps(__spreadValues({}, arg2), { 50744 queryKey: arg1 50745 }), arg3] : [arg1 || {}, arg2]; 50746 } 50747 function parseMutationFilterArgs(arg1, arg2, arg3) { 50748 return isQueryKey(arg1) ? [__spreadProps(__spreadValues({}, arg2), { 50749 mutationKey: arg1 50750 }), arg3] : [arg1 || {}, arg2]; 50751 }
50752 function matchQuery(filters, query) { 50753 const { 50754 type = "all", 50755 exact, 50756 fetchStatus, 50757 predicate, 50758 queryKey, 50759 stale 50760 } = filters; 50761 if (isQueryKey(queryKey)) { 50762 if (exact) { 50763 if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 50764 return false; 50765 } 50766 } else if (!partialMatchKey(query.queryKey, queryKey)) { 50767 return false; 50768 } 50769 } 50770 if (type !== "all") { 50771 const isActive = query.isActive(); 50772 if (type === "active" && !isActive) { 50773 return false; 50774 } 50775 if (type === "inactive" && isActive) { 50776 return false; 50777 } 50778 } 50779 if (typeof stale === "boolean" && query.isStale() !== stale) { 50780 return false; 50781 } 50782 if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) { 50783 return false; 50784 } 50785 if (predicate && !predicate(query)) { 50786 return false; 50787 } 50788 return true; 50789 } 50790 function matchMutation(filters, mutation) { 50791 const { 50792 exact, 50793 fetching, 50794 predicate, 50795 mutationKey 50796 } = filters; 50797 if (isQueryKey(mutationKey)) { 50798 if (!mutation.options.mutationKey) { 50799 return false; 50800 } 50801 if (exact) { 50802 if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) { 50803 return false; 50804 } 50805 } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 50806 return false; 50807 } 50808 } 50809 if (typeof fetching === "boolean" && mutation.state.status === "loading" !== fetching) { 50810 return false; 50811 } 50812 if (predicate && !predicate(mutation)) { 50813 return false; 50814 } 50815 return true; 50816 } 50817 function hashQueryKeyByOptions(queryKey, options2) { 50818 const hashFn = (options2 == null ? void 0 : options2.queryKeyHashFn) || hashQueryKey; 50819 return hashFn(queryKey); 50820 } 50821 function hashQueryKey(queryKey) { 50822 return JSON.stringify(queryKey, (_2, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { 50823 result[key] = val[key]; 50824 return result; 50825 }, {}) : val); 50826 } 50827 function partialMatchKey(a2, b2) { 50828 return partialDeepEqual(a2, b2); 50829 } 50830 function partialDeepEqual(a2, b2) { 50831 if (a2 === b2) { 50832 return true; 50833 } 50834 if (typeof a2 !== typeof b2) { 50835 return false; 50836 } 50837 if (a2 && b2 && typeof a2 === "object" && typeof b2 === "object") { 50838 return !Object.keys(b2).some((key) => !partialDeepEqual(a2[key], b2[key])); 50839 } 50840 return false; 50841 } 50842 function replaceEqualDeep(a2, b2) { 50843 if (a2 === b2) { 50844 return a2; 50845 } 50846 const array2 = isPlainArray(a2) && isPlainArray(b2); 50847 if (array2 || isPlainObject(a2) && isPlainObject(b2)) { 50848 const aSize = array2 ? a2.length : Object.keys(a2).length; 50849 const bItems = array2 ? b2 : Object.keys(b2); 50850 const bSize = bItems.length; 50851 const copy2 = array2 ? [] : {}; 50852 let equalItems = 0; 50853 for (let i2 = 0; i2 < bSize; i2++) { 50854 const key = array2 ? i2 : bItems[i2]; 50855 copy2[key] = replaceEqualDeep(a2[key], b2[key]); 50856 if (copy2[key] === a2[key]) { 50857 equalItems++; 50858 } 50859 } 50860 return aSize === bSize && equalItems === aSize ? a2 : copy2; 50861 } 50862 return b2; 50863 } 50864 function shallowEqualObjects(a2, b2) { 50865 if (a2 && !b2 || b2 && !a2) { 50866 return false; 50867 } 50868 for (const key in a2) { 50869 if (a2[key] !== b2[key]) { 50870 return false; 50871 } 50872 } 50873 return true; 50874 } 50875 function isPlainArray(value) { 50876 return Array.isArray(value) && value.length === Object.keys(value).length; 50877 } 50878 function isPlainObject(o2) { 50879 if (!hasObjectPrototype(o2)) { 50880 return false; 50881 } 50882 const ctor = o2.constructor; 50883 if (typeof ctor === "undefined") { 50884 return true; 50885 } 50886 const prot = ctor.prototype; 50887 if (!hasObjectPrototype(prot)) { 50888 return false;
50889 } 50890 if (!prot.hasOwnProperty("isPrototypeOf")) { 50891 return false; 50892 } 50893 return true; 50894 } 50895 function hasObjectPrototype(o2) { 50896 return Object.prototype.toString.call(o2) === "[object Object]"; 50897 } 50898 function isQueryKey(value) { 50899 return Array.isArray(value); 50900 } 50901 function sleep(timeout) { 50902 return new Promise((resolve) => { 50903 setTimeout(resolve, timeout); 50904 }); 50905 } 50906 function scheduleMicrotask(callback) { 50907 sleep(0).then(callback); 50908 } 50909 function getAbortController() { 50910 if (typeof AbortController === "function") { 50911 return new AbortController(); 50912 } 50913 return; 50914 } 50915 function replaceData(prevData, data, options2) { 50916 if (options2.isDataEqual != null && options2.isDataEqual(prevData, data)) { 50917 return prevData; 50918 } else if (typeof options2.structuralSharing === "function") { 50919 return options2.structuralSharing(prevData, data); 50920 } else if (options2.structuralSharing !== false) { 50921 return replaceEqualDeep(prevData, data); 50922 } 50923 return data; 50924 } 50925 class FocusManager extends Subscribable { 50926 constructor() { 50927 super(); 50928 this.setup = (onFocus) => { 50929 if (!isServer && window.addEventListener) { 50930 const listener = () => onFocus(); 50931 window.addEventListener("visibilitychange", listener, false); 50932 window.addEventListener("focus", listener, false); 50933 return () => { 50934 window.removeEventListener("visibilitychange", listener); 50935 window.removeEventListener("focus", listener); 50936 }; 50937 } 50938 return; 50939 }; 50940 } 50941 onSubscribe() { 50942 if (!this.cleanup) { 50943 this.setEventListener(this.setup); 50944 } 50945 } 50946 onUnsubscribe() { 50947 if (!this.hasListeners()) { 50948 var _this$cleanup; 50949 (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); 50950 this.cleanup = void 0; 50951 } 50952 } 50953 setEventListener(setup) { 50954 var _this$cleanup2; 50955 this.setup = setup; 50956 (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); 50957 this.cleanup = setup((focused) => { 50958 if (typeof focused === "boolean") { 50959 this.setFocused(focused); 50960 } else { 50961 this.onFocus(); 50962 } 50963 }); 50964 } 50965 setFocused(focused) { 50966 const changed = this.focused !== focused; 50967 if (changed) { 50968 this.focused = focused; 50969 this.onFocus(); 50970 } 50971 } 50972 onFocus() { 50973 this.listeners.forEach(({ 50974 listener 50975 }) => { 50976 listener(); 50977 }); 50978 } 50979 isFocused() { 50980 if (typeof this.focused === "boolean") { 50981 return this.focused; 50982 } 50983 if (typeof document === "undefined") { 50984 return true; 50985 } 50986 return [void 0, "visible", "prerender"].includes(document.visibilityState); 50987 } 50988 } 50989 const focusManager = new FocusManager(); 50990 const onlineEvents = ["online", "offline"]; 50991 class OnlineManager extends Subscribable { 50992 constructor() { 50993 super(); 50994 this.setup = (onOnline) => { 50995 if (!isServer && window.addEventListener) { 50996 const listener = () => onOnline(); 50997 onlineEvents.forEach((event) => { 50998 window.addEventListener(event, listener, false); 50999 }); 51000 return () => { 51001 onlineEvents.forEach((event) => { 51002 window.removeEventListener(event, listener); 51003 }); 51004 }; 51005 } 51006 return; 51007 }; 51008 } 51009 onSubscribe() { 51010 if (!this.cleanup) { 51011 this.setEventListener(this.setup); 51012 } 51013 } 51014 onUnsubscribe() { 51015 if (!this.hasListeners()) { 51016 var _this$cleanup; 51017 (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); 51018 this.cleanup = void 0; 51019 } 51020 } 51021 setEventListener(setup) { 51022 var _this$cleanup2; 51023 this.setup = setup; 51024 (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); 51025 this.cleanup = setup((online) => { 51026 if (typeof online === "boolean") { 51027 this.setOnline(online); 51028 } else { 51029 this.onOnline(); 51030 } 51031 }); 51032 } 51033 setOnline(online) { 51034 const changed = this.online !== online; 51035 if (changed) { 51036 this.online = online; 51037 this.onOnline(); 51038 } 51039 } 51040 onOnline() {
51041 this.listeners.forEach(({ 51042 listener 51043 }) => { 51044 listener(); 51045 }); 51046 } 51047 isOnline() { 51048 if (typeof this.online === "boolean") { 51049 return this.online; 51050 } 51051 if (typeof navigator === "undefined" || typeof navigator.onLine === "undefined") { 51052 return true; 51053 } 51054 return navigator.onLine; 51055 } 51056 } 51057 const onlineManager = new OnlineManager(); 51058 function defaultRetryDelay(failureCount) { 51059 return Math.min(1e3 * __pow(2, failureCount), 3e4); 51060 } 51061 function canFetch(networkMode) { 51062 return (networkMode != null ? networkMode : "online") === "online" ? onlineManager.isOnline() : true; 51063 } 51064 class CancelledError { 51065 constructor(options2) { 51066 this.revert = options2 == null ? void 0 : options2.revert; 51067 this.silent = options2 == null ? void 0 : options2.silent; 51068 } 51069 } 51070 function isCancelledError(value) { 51071 return value instanceof CancelledError; 51072 } 51073 function createRetryer(config) { 51074 let isRetryCancelled = false; 51075 let failureCount = 0; 51076 let isResolved = false; 51077 let continueFn; 51078 let promiseResolve;
51079 let promiseReject; 51080 const promise = new Promise((outerResolve, outerReject) => { 51081 promiseResolve = outerResolve; 51082 promiseReject = outerReject; 51083 }); 51084 const cancel = (cancelOptions) => { 51085 if (!isResolved) { 51086 reject(new CancelledError(cancelOptions)); 51087 config.abort == null ? void 0 : config.abort(); 51088 } 51089 }; 51090 const cancelRetry = () => { 51091 isRetryCancelled = true; 51092 }; 51093 const continueRetry = () => { 51094 isRetryCancelled = false; 51095 }; 51096 const shouldPause = () => !focusManager.isFocused() || config.networkMode !== "always" && !onlineManager.isOnline(); 51097 const resolve = (value) => { 51098 if (!isResolved) { 51099 isResolved = true; 51100 config.onSuccess == null ? void 0 : config.onSuccess(value); 51101 continueFn == null ? void 0 : continueFn(); 51102 promiseResolve(value); 51103 } 51104 }; 51105 const reject = (value) => { 51106 if (!isResolved) { 51107 isResolved = true; 51108 config.onError == null ? void 0 : config.onError(value); 51109 continueFn == null ? void 0 : continueFn(); 51110 promiseReject(value); 51111 } 51112 }; 51113 const pause = () => { 51114 return new Promise((continueResolve) => { 51115 continueFn = (value) => { 51116 const canContinue = isResolved || !shouldPause(); 51117 if (canContinue) { 51118 continueResolve(value); 51119 } 51120 return canContinue; 51121 }; 51122 config.onPause == null ? void 0 : config.onPause(); 51123 }).then(() => { 51124 continueFn = void 0; 51125 if (!isResolved) { 51126 config.onContinue == null ? void 0 : config.onContinue(); 51127 } 51128 }); 51129 }; 51130 const run = () => { 51131 if (isResolved) { 51132 return; 51133 } 51134 let promiseOrValue; 51135 try { 51136 promiseOrValue = config.fn(); 51137 } catch (error) { 51138 promiseOrValue = Promise.reject(error); 51139 } 51140 Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 51141 var _config$retry, _config$retryDelay; 51142 if (isResolved) { 51143 return; 51144 } 51145 const retry = (_config$retry = config.retry) != null ? _config$retry : 3; 51146 const retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay; 51147 const delay2 = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 51148 const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 51149 if (isRetryCancelled || !shouldRetry) { 51150 reject(error); 51151 return; 51152 } 51153 failureCount++; 51154 config.onFail == null ? void 0 : config.onFail(failureCount, error); 51155 sleep(delay2).then(() => { 51156 if (shouldPause()) { 51157 return pause(); 51158 } 51159 return; 51160 }).then(() => { 51161 if (isRetryCancelled) { 51162 reject(error); 51163 } else { 51164 run(); 51165 } 51166 }); 51167 }); 51168 }; 51169 if (canFetch(config.networkMode)) { 51170 run(); 51171 } else { 51172 pause().then(run); 51173 } 51174 return { 51175 promise, 51176 cancel, 51177 continue: () => { 51178 const didContinue = continueFn == null ? void 0 : continueFn(); 51179 return didContinue ? promise : Promise.resolve(); 51180 }, 51181 cancelRetry, 51182 continueRetry 51183 }; 51184 } 51185 const defaultLogger = console; 51186 function createNotifyManager() { 51187 let queue = []; 51188 let transactions = 0; 51189 let notifyFn = (callback) => { 51190 callback(); 51191 }; 51192 let batchNotifyFn = (callback) => { 51193 callback(); 51194 }; 51195 const batch = (callback) => { 51196 let result; 51197 transactions++; 51198 try { 51199 result = callback(); 51200 } finally { 51201 transactions--; 51202 if (!transactions) { 51203 flush(); 51204 } 51205 } 51206 return result; 51207 }; 51208 const schedule = (callback) => { 51209 if (transactions) { 51210 queue.push(callback); 51211 } else { 51212 scheduleMicrotask(() => { 51213 notifyFn(callback); 51214 }); 51215 } 51216 }; 51217 const batchCalls = (callback) => { 51218 return (...args) => { 51219 schedule(() => { 51220 callback(...args); 51221 }); 51222 }; 51223 }; 51224 const flush = () => { 51225 const originalQueue = queue; 51226 queue = []; 51227 if (originalQueue.length) { 51228 scheduleMicrotask(() => { 51229 batchNotifyFn(() => { 51230 originalQueue.forEach((callback) => { 51231 notifyFn(callback); 51232 }); 51233 }); 51234 }); 51235 } 51236 }; 51237 const setNotifyFunction = (fn2) => { 51238 notifyFn = fn2; 51239 }; 51240 const setBatchNotifyFunction = (fn2) => { 51241 batchNotifyFn = fn2; 51242 }; 51243 return { 51244 batch, 51245 batchCalls, 51246 schedule, 51247 setNotifyFunction, 51248 setBatchNotifyFunction 51249 }; 51250 } 51251 const notifyManager = createNotifyManager(); 51252 class Removable { 51253 destroy() { 51254 this.clearGcTimeout(); 51255 } 51256 scheduleGc() { 51257 this.clearGcTimeout(); 51258 if (isValidTimeout(this.cacheTime)) { 51259 this.gcTimeout = setTimeout(() => { 51260 this.optionalRemove(); 51261 }, this.cacheTime); 51262 } 51263 } 51264 updateCacheTime(newCacheTime) { 51265 this.cacheTime = Math.max(this.cacheTime || 0, newCacheTime != null ? newCacheTime : isServer ? Infinity : 5 * 60 * 1e3); 51266 } 51267 clearGcTimeout() { 51268 if (this.gcTimeout) { 51269 clearTimeout(this.gcTimeout); 51270 this.gcTimeout = void 0; 51271 } 51272 } 51273 } 51274 class Query extends Removable { 51275 constructor(config) { 51276 super();
51277 this.abortSignalConsumed = false; 51278 this.defaultOptions = config.defaultOptions; 51279 this.setOptions(config.options); 51280 this.observers = []; 51281 this.cache = config.cache; 51282 this.logger = config.logger || defaultLogger; 51283 this.queryKey = config.queryKey; 51284 this.queryHash = config.queryHash; 51285 this.initialState = config.state || getDefaultState$1(this.options); 51286 this.state = this.initialState; 51287 this.scheduleGc(); 51288 } 51289 get meta() { 51290 return this.options.meta; 51291 } 51292 setOptions(options2) { 51293 this.options = __spreadValues(__spreadValues({}, this.defaultOptions), options2); 51294 this.updateCacheTime(this.options.cacheTime); 51295 } 51296 optionalRemove() { 51297 if (!this.observers.length && this.state.fetchStatus === "idle") { 51298 this.cache.remove(this); 51299 } 51300 } 51301 setData(newData, options2) { 51302 const data = replaceData(this.state.data, newData, this.options); 51303 this.dispatch({ 51304 data, 51305 type: "success", 51306 dataUpdatedAt: options2 == null ? void 0 : options2.updatedAt, 51307 manual: options2 == null ? void 0 : options2.manual 51308 }); 51309 return data; 51310 } 51311 setState(state, setStateOptions) { 51312 this.dispatch({ 51313 type: "setState", 51314 state, 51315 setStateOptions 51316 }); 51317 } 51318 cancel(options2) { 51319 var _this$retryer; 51320 const promise = this.promise; 51321 (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options2); 51322 return promise ? promise.then(noop$1).catch(noop$1) : Promise.resolve(); 51323 } 51324 destroy() { 51325 super.destroy(); 51326 this.cancel({ 51327 silent: true 51328 }); 51329 } 51330 reset() { 51331 this.destroy(); 51332 this.setState(this.initialState); 51333 } 51334 isActive() { 51335 return this.observers.some((observer) => observer.options.enabled !== false); 51336 } 51337 isDisabled() { 51338 return this.getObserversCount() > 0 && !this.isActive(); 51339 } 51340 isStale() { 51341 return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some((observer) => observer.getCurrentResult().isStale); 51342 } 51343 isStaleByTime(staleTime = 0) { 51344 return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime); 51345 } 51346 onFocus() { 51347 var _this$retryer2; 51348 const observer = this.observers.find((x2) => x2.shouldFetchOnWindowFocus()); 51349 if (observer) { 51350 observer.refetch({ 51351 cancelRefetch: false 51352 }); 51353 } 51354 (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue(); 51355 } 51356 onOnline() { 51357 var _this$retryer3; 51358 const observer = this.observers.find((x2) => x2.shouldFetchOnReconnect()); 51359 if (observer) { 51360 observer.refetch({ 51361 cancelRefetch: false 51362 }); 51363 } 51364 (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue(); 51365 } 51366 addObserver(observer) { 51367 if (!this.observers.includes(observer)) { 51368 this.observers.push(observer); 51369 this.clearGcTimeout(); 51370 this.cache.notify({ 51371 type: "observerAdded", 51372 query: this, 51373 observer 51374 }); 51375 } 51376 } 51377 removeObserver(observer) { 51378 if (this.observers.includes(observer)) { 51379 this.observers = this.observers.filter((x2) => x2 !== observer); 51380 if (!this.observers.length) { 51381 if (this.retryer) { 51382 if (this.abortSignalConsumed) { 51383 this.retryer.cancel({ 51384 revert: true 51385 }); 51386 } else { 51387 this.retryer.cancelRetry(); 51388 } 51389 } 51390 this.scheduleGc(); 51391 } 51392 this.cache.notify({ 51393 type: "observerRemoved", 51394 query: this, 51395 observer 51396 }); 51397 } 51398 } 51399 getObserversCount() { 51400 return this.observers.length; 51401 } 51402 invalidate() { 51403 if (!this.state.isInvalidated) { 51404 this.dispatch({
51405 type: "invalidate" 51406 }); 51407 } 51408 } 51409 fetch(options2, fetchOptions) { 51410 var _this$options$behavio, _context$fetchOptions; 51411 if (this.state.fetchStatus !== "idle") { 51412 if (this.state.dataUpdatedAt && fetchOptions != null && fetchOptions.cancelRefetch) { 51413 this.cancel({ 51414 silent: true 51415 }); 51416 } else if (this.promise) { 51417 var _this$retryer4; 51418 (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); 51419 return this.promise; 51420 } 51421 } 51422 if (options2) { 51423 this.setOptions(options2); 51424 } 51425 if (!this.options.queryFn) { 51426 const observer = this.observers.find((x2) => x2.options.queryFn); 51427 if (observer) { 51428 this.setOptions(observer.options); 51429 } 51430 } 51431 const abortController = getAbortController(); 51432 const queryFnContext = { 51433 queryKey: this.queryKey, 51434 pageParam: void 0, 51435 meta: this.meta 51436 }; 51437 const addSignalProperty = (object2) => { 51438 Object.defineProperty(object2, "signal", { 51439 enumerable: true, 51440 get: () => { 51441 if (abortController) { 51442 this.abortSignalConsumed = true; 51443 return abortController.signal; 51444 } 51445 return void 0; 51446 } 51447 }); 51448 }; 51449 addSignalProperty(queryFnContext); 51450 const fetchFn = () => { 51451 if (!this.options.queryFn) { 51452 return Promise.reject("Missing queryFn for queryKey '" + this.options.queryHash + "'"); 51453 } 51454 this.abortSignalConsumed = false; 51455 return this.options.queryFn(queryFnContext); 51456 }; 51457 const context = { 51458 fetchOptions, 51459 options: this.options, 51460 queryKey: this.queryKey, 51461 state: this.state, 51462 fetchFn 51463 }; 51464 addSignalProperty(context); 51465 (_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch(context); 51466 this.revertState = this.state; 51467 if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) { 51468 var _context$fetchOptions2; 51469 this.dispatch({ 51470 type: "fetch", 51471 meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta 51472 }); 51473 } 51474 const onError = (error) => { 51475 if (!(isCancelledError(error) && error.silent)) { 51476 this.dispatch({ 51477 type: "error", 51478 error 51479 }); 51480 } 51481 if (!isCancelledError(error)) { 51482 var _this$cache$config$on, _this$cache$config, _this$cache$config$on2, _this$cache$config2; 51483 (_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this); 51484 (_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, this.state.data, error, this); 51485 } 51486 if (!this.isFetchingOptimistic) { 51487 this.scheduleGc(); 51488 } 51489 this.isFetchingOptimistic = false; 51490 }; 51491 this.retryer = createRetryer({ 51492 fn: context.fetchFn, 51493 abort: abortController == null ? void 0 : abortController.abort.bind(abortController), 51494 onSuccess: (data) => { 51495 var _this$cache$config$on3, _this$cache$config3, _this$cache$config$on4, _this$cache$config4; 51496 if (typeof data === "undefined") { 51497 onError(new Error(this.queryHash + " data is undefined")); 51498 return; 51499 } 51500 this.setData(data); 51501 (_this$cache$config$on3 = (_this$cache$config3 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on3.call(_this$cache$config3, data, this); 51502 (_this$cache$config$on4 = (_this$cache$config4 = this.cache.config).onSettled) == null ? void 0 : _this$cache$config$on4.call(_this$cache$config4, data, this.state.error, this); 51503 if (!this.isFetchingOptimistic) { 51504 this.scheduleGc(); 51505 } 51506 this.isFetchingOptimistic = false;
51507 }, 51508 onError, 51509 onFail: (failureCount, error) => { 51510 this.dispatch({ 51511 type: "failed", 51512 failureCount, 51513 error 51514 }); 51515 }, 51516 onPause: () => { 51517 this.dispatch({ 51518 type: "pause" 51519 }); 51520 }, 51521 onContinue: () => { 51522 this.dispatch({ 51523 type: "continue" 51524 }); 51525 }, 51526 retry: context.options.retry, 51527 retryDelay: context.options.retryDelay, 51528 networkMode: context.options.networkMode 51529 }); 51530 this.promise = this.retryer.promise; 51531 return this.promise; 51532 } 51533 dispatch(action) { 51534 const reducer2 = (state) => { 51535 var _action$meta, _action$dataUpdatedAt; 51536 switch (action.type) { 51537 case "failed": 51538 return __spreadProps(__spreadValues({}, state), { 51539 fetchFailureCount: action.failureCount, 51540 fetchFailureReason: action.error 51541 }); 51542 case "pause": 51543 return __spreadProps(__spreadValues({}, state), { 51544 fetchStatus: "paused" 51545 }); 51546 case "continue": 51547 return __spreadProps(__spreadValues({}, state), { 51548 fetchStatus: "fetching" 51549 }); 51550 case "fetch": 51551 return __spreadValues(__spreadProps(__spreadValues({}, state), { 51552 fetchFailureCount: 0, 51553 fetchFailureReason: null, 51554 fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null, 51555 fetchStatus: canFetch(this.options.networkMode) ? "fetching" : "paused" 51556 }), !state.dataUpdatedAt && { 51557 error: null, 51558 status: "loading" 51559 }); 51560 case "success": 51561 return __spreadValues(__spreadProps(__spreadValues({}, state), { 51562 data: action.data, 51563 dataUpdateCount: state.dataUpdateCount + 1, 51564 dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(), 51565 error: null, 51566 isInvalidated: false, 51567 status: "success" 51568 }), !action.manual && { 51569 fetchStatus: "idle", 51570 fetchFailureCount: 0, 51571 fetchFailureReason: null 51572 }); 51573 case "error": 51574 const error = action.error; 51575 if (isCancelledError(error) && error.revert && this.revertState) { 51576 return __spreadProps(__spreadValues({}, this.revertState), { 51577 fetchStatus: "idle" 51578 }); 51579 } 51580 return __spreadProps(__spreadValues({}, state), { 51581 error, 51582 errorUpdateCount: state.errorUpdateCount + 1, 51583 errorUpdatedAt: Date.now(), 51584 fetchFailureCount: state.fetchFailureCount + 1, 51585 fetchFailureReason: error, 51586 fetchStatus: "idle", 51587 status: "error" 51588 }); 51589 case "invalidate": 51590 return __spreadProps(__spreadValues({}, state), { 51591 isInvalidated: true 51592 }); 51593 case "setState": 51594 return __spreadValues(__spreadValues({}, state), action.state); 51595 } 51596 }; 51597 this.state = reducer2(this.state); 51598 notifyManager.batch(() => { 51599 this.observers.forEach((observer) => { 51600 observer.onQueryUpdate(action); 51601 }); 51602 this.cache.notify({ 51603 query: this, 51604 type: "updated", 51605 action 51606 }); 51607 }); 51608 } 51609 } 51610 function getDefaultState$1(options2) { 51611 const data = typeof options2.initialData === "function" ? options2.initialData() : options2.initialData; 51612 const hasData = typeof data !== "undefined"; 51613 const initialDataUpdatedAt = hasData ? typeof options2.initialDataUpdatedAt === "function" ? options2.initialDataUpdatedAt() : options2.initialDataUpdatedAt : 0; 51614 return { 51615 data, 51616 dataUpdateCount: 0, 51617 dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0, 51618 error: null,
51619 errorUpdateCount: 0, 51620 errorUpdatedAt: 0, 51621 fetchFailureCount: 0, 51622 fetchFailureReason: null, 51623 fetchMeta: null, 51624 isInvalidated: false, 51625 status: hasData ? "success" : "loading", 51626 fetchStatus: "idle" 51627 }; 51628 } 51629 class QueryCache extends Subscribable { 51630 constructor(config) { 51631 super(); 51632 this.config = config || {}; 51633 this.queries = []; 51634 this.queriesMap = {}; 51635 } 51636 build(client2, options2, state) { 51637 var _options$queryHash; 51638 const queryKey = options2.queryKey; 51639 const queryHash = (_options$queryHash = options2.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options2); 51640 let query = this.get(queryHash); 51641 if (!query) { 51642 query = new Query({ 51643 cache: this, 51644 logger: client2.getLogger(), 51645 queryKey, 51646 queryHash, 51647 options: client2.defaultQueryOptions(options2), 51648 state, 51649 defaultOptions: client2.getQueryDefaults(queryKey) 51650 }); 51651 this.add(query); 51652 } 51653 return query; 51654 } 51655 add(query) { 51656 if (!this.queriesMap[query.queryHash]) { 51657 this.queriesMap[query.queryHash] = query; 51658 this.queries.push(query); 51659 this.notify({ 51660 type: "added", 51661 query 51662 }); 51663 } 51664 } 51665 remove(query) { 51666 const queryInMap = this.queriesMap[query.queryHash]; 51667 if (queryInMap) { 51668 query.destroy(); 51669 this.queries = this.queries.filter((x2) => x2 !== query); 51670 if (queryInMap === query) { 51671 delete this.queriesMap[query.queryHash]; 51672 } 51673 this.notify({ 51674 type: "removed", 51675 query 51676 }); 51677 } 51678 } 51679 clear() { 51680 notifyManager.batch(() => { 51681 this.queries.forEach((query) => { 51682 this.remove(query); 51683 }); 51684 }); 51685 } 51686 get(queryHash) { 51687 return this.queriesMap[queryHash]; 51688 } 51689 getAll() { 51690 return this.queries; 51691 } 51692 find(arg1, arg2) { 51693 const [filters] = parseFilterArgs(arg1, arg2); 51694 if (typeof filters.exact === "undefined") { 51695 filters.exact = true; 51696 } 51697 return this.queries.find((query) => matchQuery(filters, query)); 51698 } 51699 findAll(arg1, arg2) { 51700 const [filters] = parseFilterArgs(arg1, arg2); 51701 return Object.keys(filters).length > 0 ? this.queries.filter((query) => matchQuery(filters, query)) : this.queries; 51702 } 51703 notify(event) { 51704 notifyManager.batch(() => { 51705 this.listeners.forEach(({ 51706 listener 51707 }) => { 51708 listener(event); 51709 }); 51710 }); 51711 } 51712 onFocus() { 51713 notifyManager.batch(() => { 51714 this.queries.forEach((query) => { 51715 query.onFocus(); 51716 }); 51717 }); 51718 } 51719 onOnline() { 51720 notifyManager.batch(() => { 51721 this.queries.forEach((query) => { 51722 query.onOnline(); 51723 }); 51724 }); 51725 } 51726 } 51727 class Mutation extends Removable { 51728 constructor(config) { 51729 super(); 51730 this.defaultOptions = config.defaultOptions; 51731 this.mutationId = config.mutationId; 51732 this.mutationCache = config.mutationCache; 51733 this.logger = config.logger || defaultLogger; 51734 this.observers = []; 51735 this.state = config.state || getDefaultState(); 51736 this.setOptions(config.options); 51737 this.scheduleGc(); 51738 } 51739 setOptions(options2) { 51740 this.options = __spreadValues(__spreadValues({}, this.defaultOptions), options2); 51741 this.updateCacheTime(this.options.cacheTime); 51742 } 51743 get meta() { 51744 return this.options.meta; 51745 } 51746 setState(state) { 51747 this.dispatch({ 51748 type: "setState", 51749 state 51750 }); 51751 } 51752 addObserver(observer) { 51753 if (!this.observers.includes(observer)) { 51754 this.observers.push(observer); 51755 this.clearGcTimeout(); 51756 this.mutationCache.notify({ 51757 type: "observerAdded", 51758 mutation: this, 51759 observer 51760 }); 51761 } 51762 } 51763 removeObserver(observer) { 51764 this.observers = this.observers.filter((x2) => x2 !== observer); 51765 this.scheduleGc(); 51766 this.mutationCache.notify({ 51767 type: "observerRemoved", 51768 mutation: this, 51769 observer 51770 }); 51771 } 51772 optionalRemove() { 51773 if (!this.observers.length) { 51774 if (this.state.status === "loading") { 51775 this.scheduleGc(); 51776 } else { 51777 this.mutationCache.remove(this); 51778 } 51779 } 51780 } 51781 continue() { 51782 var _this$retryer$continu, _this$retryer; 51783 return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute(); 51784 } 51785 execute() { 51786 return __async(this, null, function* () { 51787 const executeMutation = () => { 51788 var _this$options$retry; 51789 this.retryer = createRetryer({ 51790 fn: () => { 51791 if (!this.options.mutationFn) { 51792 return Promise.reject("No mutationFn found"); 51793 } 51794 return this.options.mutationFn(this.state.variables); 51795 }, 51796 onFail: (failureCount, error) => { 51797 this.dispatch({ 51798 type: "failed", 51799 failureCount, 51800 error 51801 }); 51802 }, 51803 onPause: () => { 51804 this.dispatch({ 51805 type: "pause" 51806 }); 51807 }, 51808 onContinue: () => { 51809 this.dispatch({ 51810 type: "continue" 51811 }); 51812 }, 51813 retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0, 51814 retryDelay: this.options.retryDelay, 51815 networkMode: this.options.networkMode 51816 }); 51817 return this.retryer.promise; 51818 }; 51819 const restored = this.state.status === "loading"; 51820 try { 51821 var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onSettl, _this$options3; 51822 if (!restored) { 51823 var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options; 51824 this.dispatch({ 51825 type: "loading", 51826 variables: this.options.variables 51827 }); 51828 yield (_this$mutationCache$c = (_this$mutationCache$c2 = this.mutationCache.config).onMutate) == null ? void 0 : _this$mutationCache$c.call(_this$mutationCache$c2, this.state.variables, this); 51829 const context = yield (_this$options$onMutat = (_this$options = this.options).onMutate) == null ? void 0 : _this$options$onMutat.call(_this$options, this.state.variables); 51830 if (context !== this.state.context) { 51831 this.dispatch({ 51832 type: "loading", 51833 context, 51834 variables: this.state.variables 51835 }); 51836 } 51837 } 51838 const data = yield executeMutation(); 51839 yield (_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this); 51840 yield (_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context); 51841 yield (_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, data, null, this.state.variables, this.state.context, this); 51842 yield (_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context); 51843 this.dispatch({ 51844 type: "success", 51845 data 51846 }); 51847 return data; 51848 } catch (error) { 51849 try { 51850 var _this$mutationCache$c7, _this$mutationCache$c8, _this$options$onError, _this$options4, _this$mutationCache$c9, _this$mutationCache$c10, _this$options$onSettl2, _this$options5; 51851 yield (_this$mutationCache$c7 = (_this$mutationCache$c8 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c7.call(_this$mutationCache$c8, error, this.state.variables, this.state.context, this); 51852 if (false) ; 51853 yield (_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context); 51854 yield (_this$mutationCache$c9 = (_this$mutationCache$c10 = this.mutationCache.config).onSettled) == null ? void 0 : _this$mutationCache$c9.call(_this$mutationCache$c10, void 0, error, this.state.variables, this.state.context, this); 51855 yield (_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, void 0, error, this.state.variables, this.state.context); 51856 throw error; 51857 } finally { 51858 this.dispatch({ 51859 type: "error", 51860 error 51861 }); 51862 } 51863 } 51864 }); 51865 } 51866 dispatch(action) { 51867 const reducer2 = (state) => { 51868 switch (action.type) { 51869 case "failed": 51870 return __spreadProps(__spreadValues({}, state), { 51871 failureCount: action.failureCount, 51872 failureReason: action.error 51873 }); 51874 case "pause": 51875 return __spreadProps(__spreadValues({}, state), { 51876 isPaused: true 51877 }); 51878 case "continue": 51879 return __spreadProps(__spreadValues({}, state), { 51880 isPaused: false 51881 }); 51882 case "loading": 51883 return __spreadProps(__spreadValues({}, state), { 51884 context: action.context, 51885 data: void 0, 51886 failureCount: 0, 51887 failureReason: null, 51888 error: null, 51889 isPaused: !canFetch(this.options.networkMode), 51890 status: "loading", 51891 variables: action.variables 51892 }); 51893 case "success": 51894 return __spreadProps(__spreadValues({}, state), { 51895 data: action.data, 51896 failureCount: 0, 51897 failureReason: null, 51898 error: null, 51899 status: "success", 51900 isPaused: false 51901 }); 51902 case "error": 51903 return __spreadProps(__spreadValues({}, state), { 51904 data: void 0, 51905 error: action.error, 51906 failureCount: state.failureCount + 1, 51907 failureReason: action.error, 51908 isPaused: false, 51909 status: "error" 51910 }); 51911 case "setState": 51912 return __spreadValues(__spreadValues({}, state), action.state); 51913 } 51914 }; 51915 this.state = reducer2(this.state); 51916 notifyManager.batch(() => {
51917 this.observers.forEach((observer) => { 51918 observer.onMutationUpdate(action); 51919 }); 51920 this.mutationCache.notify({ 51921 mutation: this, 51922 type: "updated", 51923 action 51924 }); 51925 }); 51926 } 51927 } 51928 function getDefaultState() { 51929 return { 51930 context: void 0, 51931 data: void 0, 51932 error: null, 51933 failureCount: 0, 51934 failureReason: null, 51935 isPaused: false, 51936 status: "idle", 51937 variables: void 0 51938 }; 51939 } 51940 class MutationCache extends Subscribable { 51941 constructor(config) { 51942 super(); 51943 this.config = config || {}; 51944 this.mutations = []; 51945 this.mutationId = 0; 51946 } 51947 build(client2, options2, state) { 51948 const mutation = new Mutation({ 51949 mutationCache: this, 51950 logger: client2.getLogger(), 51951 mutationId: ++this.mutationId, 51952 options: client2.defaultMutationOptions(options2), 51953 state, 51954 defaultOptions: options2.mutationKey ? client2.getMutationDefaults(options2.mutationKey) : void 0 51955 }); 51956 this.add(mutation); 51957 return mutation; 51958 } 51959 add(mutation) { 51960 this.mutations.push(mutation); 51961 this.notify({ 51962 type: "added", 51963 mutation 51964 }); 51965 } 51966 remove(mutation) { 51967 this.mutations = this.mutations.filter((x2) => x2 !== mutation); 51968 this.notify({ 51969 type: "removed", 51970 mutation 51971 }); 51972 } 51973 clear() { 51974 notifyManager.batch(() => { 51975 this.mutations.forEach((mutation) => { 51976 this.remove(mutation); 51977 }); 51978 }); 51979 } 51980 getAll() { 51981 return this.mutations; 51982 } 51983 find(filters) { 51984 if (typeof filters.exact === "undefined") { 51985 filters.exact = true; 51986 } 51987 return this.mutations.find((mutation) => matchMutation(filters, mutation)); 51988 } 51989 findAll(filters) { 51990 return this.mutations.filter((mutation) => matchMutation(filters, mutation)); 51991 } 51992 notify(event) { 51993 notifyManager.batch(() => { 51994 this.listeners.forEach(({ 51995 listener 51996 }) => { 51997 listener(event); 51998 }); 51999 }); 52000 } 52001 resumePausedMutations() { 52002 var _this$resuming; 52003 this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => { 52004 const pausedMutations = this.mutations.filter((x2) =>
52004 x2.state.isPaused); 52005 return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop$1)), Promise.resolve())); 52006 }).then(() => { 52007 this.resuming = void 0; 52008 }); 52009 return this.resuming; 52010 } 52011 } 52012 function infiniteQueryBehavior() { 52013 return { 52014 onFetch: (context) => { 52015 context.fetchFn = () => { 52016 var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2; 52017 const refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage; 52018 const fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore; 52019 const pageParam = fetchMore == null ? void 0 : fetchMore.pageParam; 52020 const isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === "forward"; 52021 const isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === "backward"; 52022 const oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || []; 52023 const oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || []; 52024 let newPageParams = oldPageParams; 52025 let cancelled = false; 52026 const addSignalProperty = (object2) => { 52027 Object.defineProperty(object2, "signal", { 52028 enumerable: true, 52029 get: () => { 52030 var _context$signal; 52031 if ((_context$signal = context.signal) != null && _context$signal.aborted) { 52032 cancelled = true; 52033 } else { 52034 var _context$signal2; 52035 (_context$signal2 = context.signal) == null ? void 0 : _context$signal2.addEventListener("abort", () => { 52036 cancelled = true; 52037 }); 52038 } 52039 return context.signal; 52040 } 52041 }); 52042 }; 52043 const queryFn = context.options.queryFn || (() => Promise.reject("Missing queryFn for queryKey '" + context.options.queryHash + "'")); 52044 const buildNewPages = (pages, param, page, previous) => { 52045 newPageParams = previous ? [param, ...newPageParams] : [...newPageParams, param]; 52046 return previous ? [page, ...pages] : [...pages, page]; 52047 }; 52048 const fetchPage = (pages, manual, param, previous) => { 52049 if (cancelled) { 52050 return Promise.reject("Cancelled"); 52051 } 52052 if (typeof param === "undefined" && !manual && pages.length) { 52053 return Promise.resolve(pages); 52054 } 52055 const queryFnContext = { 52056 queryKey: context.queryKey, 52057 pageParam: param, 52058 meta: context.options.meta 52059 }; 52060 addSignalProperty(queryFnContext); 52061 const queryFnResult = queryFn(queryFnContext); 52062 const promise2 = Promise.resolve(queryFnResult).then((page) => buildNewPages(pages, param, page, previous)); 52063 return promise2; 52064 }; 52065 let promise; 52066 if (!oldPages.length) { 52067 promise = fetchPage([]); 52068 } else if (isFetchingNextPage) { 52069 const manual = typeof pageParam !== "undefined"; 52070 const param = manual ? pageParam : getNextPageParam(context.options, oldPages); 52071 promise = fetchPage(oldPages, manual, param); 52072 } else if (isFetchingPreviousPage) { 52073 const manual = typeof pageParam !== "undefined"; 52074 const param = manual ? pageParam : getPreviousPageParam(context.options, oldPages); 52075 promise = fetchPage(oldPages, manual, param, true); 52076 } else { 52077 newPageParams = []; 52078 const manual = typeof context.options.getNextPageParam === "undefined"; 52079 const shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; 52080 promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); 52081 for (let i2 = 1; i2 < oldPages.length; i2++) { 52082 promise = promise.then((pages) => { 52083 const shouldFetchNextPage = refetchPage && oldPages[i2] ? refetchPage(oldPages[i2], i2, oldPages) : true; 52084 if (shouldFetchNextPage) { 52085 const param = manual ? oldPageParams[i2] : getNextPageParam(context.options, pages); 52086 return fetchPage(pages, manual, param); 52087 } 52088 return Promise.resolve(buildNewPages(pages, oldPageParams[i2], oldPages[i2])); 52089 }); 52090 } 52091 } 52092 const finalPromise = promise.then((pages) => ({ 52093 pages, 52094 pageParams: newPageParams 52095 })); 52096 return finalPromise; 52097 }; 52098 } 52099 }; 52100 } 52101 function getNextPageParam(options2, pages) { 52102 return options2.getNextPageParam == null ? void 0 : options2.getNextPageParam(pages[pages.length - 1], pages); 52103 } 52104 function getPreviousPageParam(options2, pages) { 52105 return options2.getPreviousPageParam == null ? void 0 : options2.getPreviousPageParam(pages[0], pages); 52106 } 52107 class QueryClient { 52108 constructor(config = {}) { 52109 this.queryCache = config.queryCache || new QueryCache(); 52110 this.mutationCache = config.mutationCache || new MutationCache(); 52111 this.logger = config.logger || defaultLogger; 52112 this.defaultOptions = config.defaultOptions || {}; 52113 this.queryDefaults = []; 52114 this.mutationDefaults = []; 52115 this.mountCount = 0; 52116 } 52117 mount() { 52118 this.mountCount++; 52119 if (this.mountCount !== 1) return;
52120 this.unsubscribeFocus = focusManager.subscribe(() => { 52121 if (focusManager.isFocused()) { 52122 this.resumePausedMutations(); 52123 this.queryCache.onFocus(); 52124 } 52125 }); 52126 this.unsubscribeOnline = onlineManager.subscribe(() => { 52127 if (onlineManager.isOnline()) { 52128 this.resumePausedMutations(); 52129 this.queryCache.onOnline(); 52130 } 52131 }); 52132 } 52133 unmount() { 52134 var _this$unsubscribeFocu, _this$unsubscribeOnli; 52135 this.mountCount--; 52136 if (this.mountCount !== 0) return; 52137 (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this); 52138 this.unsubscribeFocus = void 0; 52139 (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this); 52140 this.unsubscribeOnline = void 0; 52141 } 52142 isFetching(arg1, arg2) { 52143 const [filters] = parseFilterArgs(arg1, arg2); 52144 filters.fetchStatus = "fetching"; 52145 return this.queryCache.findAll(filters).length; 52146 } 52147 isMutating(filters) { 52148 return this.mutationCache.findAll(__spreadProps(__spreadValues({}, filters), { 52149 fetching: true 52150 })).length; 52151 } 52152 getQueryData(queryKey, filters) { 52153 var _this$queryCache$find; 52154 return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data; 52155 } 52156 ensureQueryData(arg1, arg2, arg3) { 52157 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 52158 const cachedData = this.getQueryData(parsedOptions.queryKey); 52159 return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions); 52160 } 52161 getQueriesData(queryKeyOrFilters) { 52162 return this.getQueryCache().findAll(queryKeyOrFilters).map(({ 52163 queryKey, 52164 state 52165 }) => { 52166 const data = state.data; 52167 return [queryKey, data]; 52168 }); 52169 } 52170 setQueryData(queryKey, updater, options2) { 52171 const query = this.queryCache.find(queryKey); 52172 const prevData = query == null ? void 0 : query.state.data; 52173 const data = functionalUpdate(updater, prevData); 52174 if (typeof data === "undefined") { 52175 return void 0; 52176 } 52177 const parsedOptions = parseQueryArgs(queryKey); 52178 const defaultedOptions = this.defaultQueryOptions(parsedOptions); 52179 return this.queryCache.build(this, defaultedOptions).setData(data, __spreadProps(__spreadValues({}, options2), { 52180 manual: true 52181 })); 52182 } 52183 setQueriesData(queryKeyOrFilters, updater, options2) { 52184 return notifyManager.batch(() => this.getQueryCache().findAll(queryKeyOrFilters).map(({ 52185 queryKey 52186 }) => [queryKey, this.setQueryData(queryKey, updater, options2)])); 52187 } 52188 getQueryState(queryKey, filters) { 52189 var _this$queryCache$find2; 52190 return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state; 52191 } 52192 removeQueries(arg1, arg2) { 52193 const [filters] = parseFilterArgs(arg1, arg2); 52194 const queryCache = this.queryCache; 52195 notifyManager.batch(() => { 52196 queryCache.findAll(filters).forEach((query) => { 52197 queryCache.remove(query); 52198 }); 52199 }); 52200 } 52201 resetQueries(arg1, arg2, arg3) { 52202 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 52203 const queryCache = this.queryCache; 52204 const refetchFilters = __spreadValues({ 52205 type: "active" 52206 }, filters); 52207 return notifyManager.batch(() => { 52208 queryCache.findAll(filters).forEach((query) => { 52209 query.reset(); 52210 }); 52211 return this.refetchQueries(refetchFilters, options2); 52212 }); 52213 } 52214 cancelQueries(arg1, arg2, arg3) { 52215 const [filters, cancelOptions = {}] = parseFilterArgs(arg1, arg2, arg3); 52216 if (typeof cancelOptions.revert === "undefined") { 52217 cancelOptions.revert = true; 52218 } 52219 const promises = notifyManager.batch(() => this.queryCache.findAll(filters).map((query) => query.cancel(cancelOptions))); 52220 return Promise.all(promises).then(noop$1).catch(noop$1); 52221 } 52222 invalidateQueries(arg1, arg2, arg3) { 52223 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 52224 return notifyManager.batch(() => { 52225 var _ref2, _filters$refetchType;
52226 this.queryCache.findAll(filters).forEach((query) => { 52227 query.invalidate(); 52228 }); 52229 if (filters.refetchType === "none") { 52230 return Promise.resolve(); 52231 } 52232 const refetchFilters = __spreadProps(__spreadValues({}, filters), { 52233 type: (_ref2 = (_filters$refetchType = filters.refetchType) != null ? _filters$refetchType : filters.type) != null ? _ref2 : "active" 52234 }); 52235 return this.refetchQueries(refetchFilters, options2); 52236 }); 52237 } 52238 refetchQueries(arg1, arg2, arg3) { 52239 const [filters, options2] = parseFilterArgs(arg1, arg2, arg3); 52240 const promises = notifyManager.batch(() => this.queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => { 52241 var _options$cancelRefetc; 52242 return query.fetch(void 0, __spreadProps(__spreadValues({}, options2), { 52243 cancelRefetch: (_options$cancelRefetc = options2 == null ? void 0 : options2.cancelRefetch) != null ? _options$cancelRefetc : true, 52244 meta: { 52245 refetchPage: filters.refetchPage 52246 } 52247 })); 52248 })); 52249 let promise = Promise.all(promises).then(noop$1); 52250 if (!(options2 != null && options2.throwOnError)) { 52251 promise = promise.catch(noop$1); 52252 } 52253 return promise; 52254 } 52255 fetchQuery(arg1, arg2, arg3) { 52256 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 52257 const defaultedOptions = this.defaultQueryOptions(parsedOptions); 52258 if (typeof defaultedOptions.retry === "undefined") { 52259 defaultedOptions.retry = false; 52260 } 52261 const query = this.queryCache.build(this, defaultedOptions); 52262 return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 52263 } 52264 prefetchQuery(arg1, arg2, arg3) { 52265 return this.fetchQuery(arg1, arg2, arg3).then(noop$1).catch(noop$1); 52266 } 52267 fetchInfiniteQuery(arg1, arg2, arg3) { 52268 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 52269 parsedOptions.behavior = infiniteQueryBehavior(); 52270 return this.fetchQuery(parsedOptions); 52271 } 52272 prefetchInfiniteQuery(arg1, arg2, arg3) { 52273 return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop$1).catch(noop$1); 52274 } 52275 resumePausedMutations() { 52276 return this.mutationCache.resumePausedMutations(); 52277 } 52278 getQueryCache() { 52279 return this.queryCache; 52280 } 52281 getMutationCache() { 52282 return this.mutationCache; 52283 } 52284 getLogger() { 52285 return this.logger; 52286 } 52287 getDefaultOptions() { 52288 return this.defaultOptions; 52289 } 52290 setDefaultOptions(options2) { 52291 this.defaultOptions = options2; 52292 } 52293 setQueryDefaults(queryKey, options2) { 52294 const result = this.queryDefaults.find((x2) => hashQueryKey(queryKey) === hashQueryKey(x2.queryKey)); 52295 if (result) { 52296 result.defaultOptions = options2; 52297 } else { 52298 this.queryDefaults.push({ 52299 queryKey, 52300 defaultOptions: options2 52301 }); 52302 } 52303 } 52304 getQueryDefaults(queryKey) { 52305 if (!queryKey) { 52306 return void 0; 52307 } 52308 const firstMatchingDefaults = this.queryDefaults.find((x2) => partialMatchKey(queryKey, x2.queryKey)); 52309 return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions; 52310 } 52311 setMutationDefaults(mutationKey, options2) { 52312 const result = this.mutationDefaults.find((x2) => hashQueryKey(mutationKey) === hashQueryKey(x2.mutationKey)); 52313 if (result) { 52314 result.defaultOptions = options2; 52315 } else { 52316 this.mutationDefaults.push({ 52317 mutationKey, 52318 defaultOptions: options2 52319 }); 52320 } 52321 } 52322 getMutationDefaults(mutationKey) { 52323 if (!mutationKey) { 52324 return void 0; 52325 } 52326 const firstMatchingDefaults = this.mutationDefaults.find((x2) => partialMatchKey(mutationKey, x2.mutationKey)); 52327 return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions; 52328 } 52329 defaultQueryOptions(options2) { 52330 if (options2 != null && options2._defaulted) { 52331 return options2; 52332 } 52333 const defaultedOptions = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, this.defaultOptions.queries), this.getQueryDefaults(options2 == null ? void 0 : options2.queryKey)), options2), { 52334 _defaulted: true 52335 }); 52336 if (!defaultedOptions.queryHash && defaultedOptions.queryKey) { 52337 defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions); 52338 } 52339 if (typeof defaultedOptions.refetchOnReconnect === "undefined") { 52340 defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 52341 } 52342 if (typeof defaultedOptions.useErrorBoundary === "undefined") { 52343 defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense; 52344 } 52345 return defaultedOptions; 52346 } 52347 defaultMutationOptions(options2) { 52348 if (options2 != null && options2._defaulted) { 52349 return options2; 52350 } 52351 return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, this.defaultOptions.mutations), this.getMutationDefaults(options2 == null ? void 0 : options2.mutationKey)), options2), { 52352 _defaulted: true 52353 }); 52354 } 52355 clear() { 52356 this.queryCache.clear(); 52357 this.mutationCache.clear(); 52358 } 52359 } 52360 class QueryObserver extends Subscribable { 52361 constructor(client2, options2) { 52362 super(); 52363 this.client = client2; 52364 this.options = options2; 52365 this.trackedProps = /* @__PURE__ */ new Set(); 52366 this.selectError = null; 52367 this.bindMethods(); 52368 this.setOptions(options2); 52369 } 52370 bindMethods() { 52371 this.remove = this.remove.bind(this); 52372 this.refetch = this.refetch.bind(this); 52373 } 52374 onSubscribe() { 52375 if (this.listeners.size === 1) { 52376 this.currentQuery.addObserver(this); 52377 if (shouldFetchOnMount(this.currentQuery, this.options)) { 52378 this.executeFetch(); 52379 } 52380 this.updateTimers(); 52381 } 52382 } 52383 onUnsubscribe() { 52384 if (!this.hasListeners()) { 52385 this.destroy(); 52386 } 52387 } 52388 shouldFetchOnReconnect() { 52389 return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect); 52390 } 52391 shouldFetchOnWindowFocus() { 52392 return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus); 52393 } 52394 destroy() { 52395 this.listeners = /* @__PURE__ */ new Set(); 52396 this.clearStaleTimeout(); 52397 this.clearRefetchInterval(); 52398 this.currentQuery.removeObserver(this); 52399 } 52400 setOptions(options2, notifyOptions) { 52401 const prevOptions = this.options; 52402 const prevQuery = this.currentQuery; 52403 this.options = this.client.defaultQueryOptions(options2); 52404 if (!shallowEqualObjects(prevOptions, this.options)) { 52405 this.client.getQueryCache().notify({ 52406 type: "observerOptionsUpdated", 52407 query: this.currentQuery, 52408 observer: this 52409 }); 52410 } 52411 if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") { 52412 throw new Error("Expected enabled to be a boolean"); 52413 } 52414 if (!this.options.queryKey) { 52415 this.options.queryKey = prevOptions.queryKey; 52416 } 52417 this.updateQuery(); 52418 const mounted = this.hasListeners(); 52419 if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) { 52420 this.executeFetch(); 52421 } 52422 this.updateResult(notifyOptions); 52423 if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) { 52424 this.updateStaleTimeout(); 52425 } 52426 const nextRefetchInterval = this.computeRefetchInterval(); 52427 if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) { 52428 this.updateRefetchInterval(nextRefetchInterval); 52429 } 52430 } 52431 getOptimisticResult(options2) { 52432 const query = this.client.getQueryCache().build(this.client, options2); 52433 const result = this.createResult(query, options2); 52434 if (shouldAssignObserverCurrentProperties(this, result, options2)) { 52435 this.currentResult = result; 52436 this.currentResultOptions = this.options; 52437 this.currentResultState = this.currentQuery.state; 52438 } 52439 return result; 52440 } 52441 getCurrentResult() { 52442 return this.currentResult; 52443 } 52444 trackResult(result) { 52445 const trackedResult = {}; 52446 Object.keys(result).forEach((key) => { 52447 Object.defineProperty(trackedResult, key, { 52448 configurable: false, 52449 enumerable: true, 52450 get: () => { 52451 this.trackedProps.add(key); 52452 return result[key]; 52453 } 52454 }); 52455 }); 52456 return trackedResult; 52457 } 52458 getCurrentQuery() { 52459 return this.currentQuery; 52460 } 52461 remove() { 52462 this.client.getQueryCache().remove(this.currentQuery); 52463 } 52464 refetch(_z = {}) { 52465 var _A = _z, { 52466 refetchPage 52467 } = _A, options2 = __objRest(_A, [ 52468 "refetchPage" 52469 ]); 52470 return this.fetch(__spreadProps(__spreadValues({}, options2), { 52471 meta: { 52472 refetchPage 52473 } 52474 })); 52475 } 52476 fetchOptimistic(options2) { 52477 const defaultedOptions = this.client.defaultQueryOptions(options2); 52478 const query = this.client.getQueryCache().build(this.client, defaultedOptions); 52479 query.isFetchingOptimistic = true; 52480 return query.fetch().then(() => this.createResult(query, defaultedOptions)); 52481 } 52482 fetch(fetchOptions) { 52483 var _fetchOptions$cancelR; 52484 return this.executeFetch(__spreadProps(__spreadValues({}, fetchOptions), { 52485 cancelRefetch: (_fetchOptions$cancelR = fetchOptions.cancelRefetch) != null ? _fetchOptions$cancelR : true 52486 })).then(() => { 52487 this.updateResult(); 52488 return this.currentResult; 52489 }); 52490 } 52491 executeFetch(fetchOptions) { 52492 this.updateQuery(); 52493 let promise = this.currentQuery.fetch(this.options, fetchOptions); 52494 if (!(fetchOptions != null && fetchOptions.throwOnError)) { 52495 promise = promise.catch(noop$1); 52496 } 52497 return promise; 52498 } 52499 updateStaleTimeout() { 52500 this.clearStaleTimeout(); 52501 if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) { 52502 return; 52503 } 52504 const time2 = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); 52505 const timeout = time2 + 1; 52506 this.staleTimeoutId = setTimeout(() => { 52507 if (!this.currentResult.isStale) { 52508 this.updateResult(); 52509 } 52510 }, timeout); 52511 } 52512 computeRefetchInterval() { 52513 var _this$options$refetch; 52514 return typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;
52515 } 52516 updateRefetchInterval(nextInterval) { 52517 this.clearRefetchInterval(); 52518 this.currentRefetchInterval = nextInterval; 52519 if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) { 52520 return; 52521 } 52522 this.refetchIntervalId = setInterval(() => { 52523 if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { 52524 this.executeFetch(); 52525 } 52526 }, this.currentRefetchInterval); 52527 } 52528 updateTimers() { 52529 this.updateStaleTimeout(); 52530 this.updateRefetchInterval(this.computeRefetchInterval()); 52531 } 52532 clearStaleTimeout() { 52533 if (this.staleTimeoutId) { 52534 clearTimeout(this.staleTimeoutId); 52535 this.staleTimeoutId = void 0; 52536 } 52537 } 52538 clearRefetchInterval() { 52539 if (this.refetchIntervalId) { 52540 clearInterval(this.refetchIntervalId); 52541 this.refetchIntervalId = void 0; 52542 } 52543 } 52544 createResult(query, options2) { 52545 const prevQuery = this.currentQuery; 52546 const prevOptions = this.options; 52547 const prevResult = this.currentResult; 52548 const prevResultState = this.currentResultState; 52549 const prevResultOptions = this.currentResultOptions; 52550 const queryChange = query !== prevQuery; 52551 const queryInitialState = queryChange ? query.state : this.currentQueryInitialState; 52552 const prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult; 52553 const { 52554 state 52555 } = query; 52556 let { 52557 dataUpdatedAt, 52558 error, 52559 errorUpdatedAt, 52560 fetchStatus, 52561 status 52562 } = state; 52563 let isPreviousData = false; 52564 let isPlaceholderData = false; 52565 let data; 52566 if (options2._optimisticResults) { 52567 const mounted = this.hasListeners(); 52568 const fetchOnMount = !mounted && shouldFetchOnMount(query, options2); 52569 const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options2, prevOptions); 52570 if (fetchOnMount || fetchOptionally) { 52571 fetchStatus = canFetch(query.options.networkMode) ? "fetching" : "paused"; 52572 if (!dataUpdatedAt) { 52573 status = "loading"; 52574 } 52575 } 52576 if (options2._optimisticResults === "isRestoring") { 52577 fetchStatus = "idle"; 52578 } 52579 } 52580 if (options2.keepPreviousData && !state.dataUpdatedAt && prevQueryResult != null && prevQueryResult.isSuccess && status !== "error") { 52581 data = prevQueryResult.data; 52582 dataUpdatedAt = prevQueryResult.dataUpdatedAt; 52583 status = prevQueryResult.status; 52584 isPreviousData = true; 52585 } else if (options2.select && typeof state.data !== "undefined") { 52586 if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options2.select === this.selectFn) { 52587 data = this.selectResult; 52588 } else { 52589 try { 52590 this.selectFn = options2.select; 52591 data = options2.select(state.data); 52592 data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options2); 52593 this.selectResult = data; 52594 this.selectError = null; 52595 } catch (selectError) { 52596 this.selectError = selectError; 52597 } 52598 } 52599 } else { 52600 data = state.data; 52601 } 52602 if (typeof options2.placeholderData !== "undefined" && typeof data === "undefined" && status === "loading") { 52603 let placeholderData; 52604 if (prevResult != null && prevResult.isPlaceholderData && options2.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { 52605 placeholderData = prevResult.data; 52606 } else { 52607 placeholderData = typeof options2.placeholderData === "function" ? options2.placeholderData() : options2.placeholderData; 52608 if (options2.select && typeof placeholderData !== "undefined") { 52609 try { 52610 placeholderData = options2.select(placeholderData); 52611 this.selectError = null; 52612 } catch (selectError) { 52613 this.selectError = selectError; 52614 } 52615 } 52616 } 52617 if (typeof placeholderData !== "undefined") { 52618 status = "success"; 52619 data = replaceData(prevResult == null ? void 0 : prevResult.data, placeholderData, options2); 52620 isPlaceholderData = true; 52621 } 52622 } 52623 if (this.selectError) { 52624 error = this.selectError; 52625 data = this.selectResult; 52626 errorUpdatedAt = Date.now(); 52627 status = "error"; 52628 } 52629 const isFetching = fetchStatus === "fetching"; 52630 const isLoading = status === "loading"; 52631 const isError2 = status === "error"; 52632 const result = { 52633 status, 52634 fetchStatus, 52635 isLoading, 52636 isSuccess: status === "success", 52637 isError: isError2, 52638 isInitialLoading: isLoading && isFetching, 52639 data, 52640 dataUpdatedAt, 52641 error, 52642 errorUpdatedAt, 52643 failureCount: state.fetchFailureCount, 52644 failureReason: state.fetchFailureReason,
52645 errorUpdateCount: state.errorUpdateCount, 52646 isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, 52647 isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, 52648 isFetching, 52649 isRefetching: isFetching && !isLoading, 52650 isLoadingError: isError2 && state.dataUpdatedAt === 0, 52651 isPaused: fetchStatus === "paused", 52652 isPlaceholderData, 52653 isPreviousData, 52654 isRefetchError: isError2 && state.dataUpdatedAt !== 0, 52655 isStale: isStale(query, options2), 52656 refetch: this.refetch, 52657 remove: this.remove 52658 }; 52659 return result; 52660 } 52661 updateResult(notifyOptions) { 52662 const prevResult = this.currentResult; 52663 const nextResult = this.createResult(this.currentQuery, this.options); 52664 this.currentResultState = this.currentQuery.state; 52665 this.currentResultOptions = this.options; 52666 if (shallowEqualObjects(nextResult, prevResult)) { 52667 return; 52668 } 52669 this.currentResult = nextResult; 52670 const defaultNotifyOptions = { 52671 cache: true 52672 }; 52673 const shouldNotifyListeners = () => { 52674 if (!prevResult) { 52675 return true; 52676 } 52677 const { 52678 notifyOnChangeProps 52679 } = this.options; 52680 const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 52681 if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.trackedProps.size) { 52682 return true; 52683 } 52684 const includedProps = new Set(notifyOnChangePropsValue != null ? notifyOnChangePropsValue : this.trackedProps); 52685 if (this.options.useErrorBoundary) { 52686 includedProps.add("error"); 52687 } 52688 return Object.keys(this.currentResult).some((key) => { 52689 const typedKey = key; 52690 const changed = this.currentResult[typedKey] !== prevResult[typedKey]; 52691 return changed && includedProps.has(typedKey); 52692 }); 52693 }; 52694 if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && shouldNotifyListeners()) { 52695 defaultNotifyOptions.listeners = true; 52696 } 52697 this.notify(__spreadValues(__spreadValues({}, defaultNotifyOptions), notifyOptions)); 52698 } 52699 updateQuery() { 52700 const query = this.client.getQueryCache().build(this.client, this.options); 52701 if (query === this.currentQuery) { 52702 return; 52703 } 52704 const prevQuery = this.currentQuery; 52705 this.currentQuery = query; 52706 this.currentQueryInitialState = query.state; 52707 this.previousQueryResult = this.currentResult; 52708 if (this.hasListeners()) { 52709 prevQuery == null ? void 0 : prevQuery.removeObserver(this); 52710 query.addObserver(this); 52711 } 52712 } 52713 onQueryUpdate(action) { 52714 const notifyOptions = {}; 52715 if (action.type === "success") { 52716 notifyOptions.onSuccess = !action.manual; 52717 } else if (action.type === "error" && !isCancelledError(action.error)) { 52718 notifyOptions.onError = true; 52719 } 52720 this.updateResult(notifyOptions); 52721 if (this.hasListeners()) { 52722 this.updateTimers(); 52723 } 52724 } 52725 notify(notifyOptions) { 52726 notifyManager.batch(() => { 52727 if (notifyOptions.onSuccess) { 52728 var _this$options$onSucce, _this$options, _this$options$onSettl, _this$options2; 52729 (_this$options$onSucce = (_this$options = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options, this.currentResult.data); 52730 (_this$options$onSettl = (_this$options2 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options2, this.currentResult.data, null); 52731 } else if (notifyOptions.onError) { 52732 var _this$options$onError, _this$options3, _this$options$onSettl2, _this$options4; 52733 (_this$options$onError = (_this$options3 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options3, this.currentResult.error); 52734 (_this$options$onSettl2 = (_this$options4 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options4, void 0, this.currentResult.error); 52735 } 52736 if (notifyOptions.listeners) {
52737 this.listeners.forEach(({ 52738 listener 52739 }) => { 52740 listener(this.currentResult); 52741 }); 52742 } 52743 if (notifyOptions.cache) { 52744 this.client.getQueryCache().notify({ 52745 query: this.currentQuery, 52746 type: "observerResultsUpdated" 52747 }); 52748 } 52749 }); 52750 } 52751 } 52752 function shouldLoadOnMount(query, options2) { 52753 return options2.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options2.retryOnMount === false); 52754 } 52755 function shouldFetchOnMount(query, options2) { 52756 return shouldLoadOnMount(query, options2) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options2, options2.refetchOnMount); 52757 } 52758 function shouldFetchOn(query, options2, field) { 52759 if (options2.enabled !== false) { 52760 const value = typeof field === "function" ? field(query) : field; 52761 return value === "always" || value !== false && isStale(query, options2); 52762 } 52763 return false; 52764 } 52765 function shouldFetchOptionally(query, prevQuery, options2, prevOptions) { 52766 return options2.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options2.suspense || query.state.status !== "error") && isStale(query, options2); 52767 } 52768 function isStale(query, options2) { 52769 return query.isStaleByTime(options2.staleTime); 52770 } 52771 function shouldAssignObserverCurrentProperties(observer, optimisticResult, options2) { 52772 if (options2.keepPreviousData) { 52773 return false; 52774 } 52775 if (options2.placeholderData !== void 0) { 52776 return optimisticResult.isPlaceholderData; 52777 } 52778 if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { 52779 return true; 52780 } 52781 return false; 52782 } 52783 let MutationObserver$1 = class MutationObserver extends Subscribable { 52784 constructor(client2, options2) { 52785 super(); 52786 this.client = client2; 52787 this.setOptions(options2); 52788 this.bindMethods(); 52789 this.updateResult(); 52790 } 52791 bindMethods() { 52792 this.mutate = this.mutate.bind(this); 52793 this.reset = this.reset.bind(this); 52794 } 52795 setOptions(options2) { 52796 var _this$currentMutation; 52797 const prevOptions = this.options; 52798 this.options = this.client.defaultMutationOptions(options2); 52799 if (!shallowEqualObjects(prevOptions, this.options)) { 52800 this.client.getMutationCache().notify({ 52801 type: "observerOptionsUpdated", 52802 mutation: this.currentMutation, 52803 observer: this 52804 }); 52805 } 52806 (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.setOptions(this.options); 52807 } 52808 onUnsubscribe() { 52809 if (!this.hasListeners()) { 52810 var _this$currentMutation2; 52811 (_this$currentMutation2 = this.currentMutation) == null ? void 0 : _this$currentMutation2.removeObserver(this); 52812 } 52813 } 52814 onMutationUpdate(action) { 52815 this.updateResult(); 52816 const notifyOptions = { 52817 listeners: true 52818 }; 52819 if (action.type === "success") { 52820 notifyOptions.onSuccess = true; 52821 } else if (action.type === "error") { 52822 notifyOptions.onError = true; 52823 } 52824 this.notify(notifyOptions); 52825 } 52826 getCurrentResult() { 52827 return this.currentResult; 52828 } 52829 reset() { 52830 this.currentMutation = void 0; 52831 this.updateResult(); 52832 this.notify({ 52833 listeners: true 52834 }); 52835 } 52836 mutate(variables, options2) { 52837 this.mutateOptions = options2; 52838 if (this.currentMutation) { 52839 this.currentMutation.removeObserver(this); 52840 } 52841 this.currentMutation = this.client.getMutationCache().build(this.client, __spreadProps(__spreadValues({}, this.options), { 52842 variables: typeof variables !== "undefined" ? variables : this.options.variables 52843 })); 52844 this.currentMutation.addObserver(this); 52845 return this.currentMutation.execute(); 52846 } 52847 updateResult() { 52848 const state = this.currentMutation ? this.currentMutation.state : getDefaultState(); 52849 const result = __spreadProps(__spreadValues({}, state), { 52850 isLoading: state.status === "loading", 52851 isSuccess: state.status === "success", 52852 isError: state.status === "error", 52853 isIdle: state.status === "idle", 52854 mutate: this.mutate, 52855 reset: this.reset 52856 }); 52857 this.currentResult = result; 52858 } 52859 notify(options2) { 52860 notifyManager.batch(() => { 52861 if (this.mutateOptions && this.hasListeners()) { 52862 if (options2.onSuccess) { 52863 var _this$mutateOptions$o, _this$mutateOptions, _this$mutateOptions$o2, _this$mutateOptions2; 52864 (_this$mutateOptions$o = (_this$mutateOptions = this.mutateOptions).onSuccess) == null ? void 0 : _this$mutateOptions$o.call(_this$mutateOptions, this.currentResult.data, this.currentResult.variables, this.currentResult.context); 52865 (_this$mutateOptions$o2 = (_this$mutateOptions2 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o2.call(_this$mutateOptions2, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context); 52866 } else if (options2.onError) { 52867 var _this$mutateOptions$o3, _this$mutateOptions3, _this$mutateOptions$o4, _this$mutateOptions4; 52868 (_this$mutateOptions$o3 = (_this$mutateOptions3 = this.mutateOptions).onError) == null ? void 0 : _this$mutateOptions$o3.call(_this$mutateOptions3, this.currentResult.error, this.currentResult.variables, this.currentResult.context); 52869 (_this$mutateOptions$o4 = (_this$mutateOptions4 = this.mutateOptions).onSettled) == null ? void 0 : _this$mutateOptions$o4.call(_this$mutateOptions4, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context); 52870 } 52871 } 52872 if (options2.listeners) {
52873 this.listeners.forEach(({ 52874 listener 52875 }) => { 52876 listener(this.currentResult); 52877 }); 52878 } 52879 }); 52880 } 52881 }; 52882 const useSyncExternalStore = shimExports.useSyncExternalStore; 52883 const defaultContext = /* @__PURE__ */ reactExports.createContext(void 0); 52884 const QueryClientSharingContext = /* @__PURE__ */ reactExports.createContext(false); 52885 function getQueryClientContext(context, contextSharing) { 52886 if (context) { 52887 return context; 52888 } 52889 if (contextSharing && typeof window !== "undefined") { 52890 if (!window.ReactQueryClientContext) { 52891 window.ReactQueryClientContext = defaultContext; 52892 } 52893 return window.ReactQueryClientContext; 52894 } 52895 return defaultContext; 52896 } 52897 const useQueryClient = ({ 52898 context 52899 } = {}) => { 52900 const queryClient2 = reactExports.useContext(getQueryClientContext(context, reactExports.useContext(QueryClientSharingContext))); 52901 if (!queryClient2) { 52902 throw new Error("No QueryClient set, use QueryClientProvider to set one"); 52903 } 52904 return queryClient2; 52905 }; 52906 const QueryClientProvider = ({ 52907 client: client2, 52908 children, 52909 context, 52910 contextSharing = false 52911 }) => { 52912 reactExports.useEffect(() => { 52913 client2.mount(); 52914 return () => { 52915 client2.unmount(); 52916 }; 52917 }, [client2]); 52918 const Context = getQueryClientContext(context, contextSharing); 52919 return /* @__PURE__ */ reactExports.createElement(QueryClientSharingContext.Provider, { 52920 value: !context && contextSharing 52921 }, /* @__PURE__ */ reactExports.createElement(Context.Provider, { 52922 value: client2 52923 }, children)); 52924 }; 52925 const IsRestoringContext = /* @__PURE__ */ reactExports.createContext(false); 52926 const useIsRestoring = () => reactExports.useContext(IsRestoringContext); 52927 IsRestoringContext.Provider; 52928 function createValue() { 52929 let isReset = false; 52930 return { 52931 clearReset: () => { 52932 isReset = false; 52933 }, 52934 reset: () => { 52935 isReset = true; 52936 }, 52937 isReset: () => { 52938 return isReset; 52939 } 52940 }; 52941 } 52942 const QueryErrorResetBoundaryContext = /* @__PURE__ */ reactExports.createContext(createValue()); 52943 const useQueryErrorResetBoundary = () => reactExports.useContext(QueryErrorResetBoundaryContext); 52944 function shouldThrowError(_useErrorBoundary, params) { 52945 if (typeof _useErrorBoundary === "function") { 52946 return _useErrorBoundary(...params); 52947 } 52948 return !!_useErrorBoundary; 52949 } 52950 const ensurePreventErrorBoundaryRetry = (options2, errorResetBoundary) => { 52951 if (options2.suspense || options2.useErrorBoundary) { 52952 if (!errorResetBoundary.isReset()) { 52953 options2.retryOnMount = false; 52954 } 52955 } 52956 }; 52957 const useClearResetErrorBoundary = (errorResetBoundary) => { 52958 reactExports.useEffect(() => { 52959 errorResetBoundary.clearReset(); 52960 }, [errorResetBoundary]); 52961 }; 52962 const getHasError = ({ 52963 result, 52964 errorResetBoundary, 52965 useErrorBoundary, 52966 query 52967 }) => { 52968 return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(useErrorBoundary, [result.error, query]); 52969 }; 52970 const ensureStaleTime = (defaultedOptions) => { 52971 if (defaultedOptions.suspense) { 52972 if (typeof defaultedOptions.staleTime !== "number") { 52973 defaultedOptions.staleTime = 1e3; 52974 } 52975 } 52976 }; 52977 const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; 52978 const shouldSuspend = (defaultedOptions, result, isRestoring) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && willFetch(result, isRestoring); 52979 const fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).then(({ 52980 data 52981 }) => { 52982 defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data); 52983 defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null); 52984 }).catch((error) => { 52985 errorResetBoundary.clearReset(); 52986 defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error); 52987 defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(void 0, error); 52988 }); 52989 function useBaseQuery(options2, Observer) { 52990 const queryClient2 = useQueryClient({ 52991 context: options2.context 52992 }); 52993 const isRestoring = useIsRestoring(); 52994 const errorResetBoundary = useQueryErrorResetBoundary(); 52995 const defaultedOptions = queryClient2.defaultQueryOptions(options2); 52996 defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 52997 if (defaultedOptions.onError) { 52998 defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError); 52999 } 53000 if (defaultedOptions.onSuccess) { 53001 defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess); 53002 } 53003 if (defaultedOptions.onSettled) { 53004 defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled); 53005 } 53006 ensureStaleTime(defaultedOptions); 53007 ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); 53008 useClearResetErrorBoundary(errorResetBoundary); 53009 const [observer] = reactExports.useState(() => new Observer(queryClient2, defaultedOptions)); 53010 const result = observer.getOptimisticResult(defaultedOptions); 53011 useSyncExternalStore(reactExports.useCallback((onStoreChange) => { 53012 const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange)); 53013 observer.updateResult(); 53014 return unsubscribe; 53015 }, [observer, isRestoring]), () => observer.getCurrentResult(), () => observer.getCurrentResult()); 53016 reactExports.useEffect(() => { 53017 observer.setOptions(defaultedOptions, { 53018 listeners: false 53019 }); 53020 }, [defaultedOptions, observer]); 53021 if (shouldSuspend(defaultedOptions, result, isRestoring)) { 53022 throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 53023 } 53024 if (getHasError({ 53025 result, 53026 errorResetBoundary, 53027 useErrorBoundary: defaultedOptions.useErrorBoundary, 53028 query: observer.getCurrentQuery() 53029 })) { 53030 throw result.error; 53031 } 53032 return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 53033 } 53034 function useQuery(arg1, arg2, arg3) { 53035 const parsedOptions = parseQueryArgs(arg1, arg2, arg3); 53036 return useBaseQuery(parsedOptions, QueryObserver); 53037 } 53038 function useIsMutating(arg1, arg2, arg3) { 53039 const [filters, options2 = {}] = parseMutationFilterArgs(arg1, arg2, arg3); 53040 const queryClient2 = useQueryClient({ 53041 context: options2.context 53042 }); 53043 const mutationCache = queryClient2.getMutationCache(); 53044 return useSyncExternalStore(reactExports.useCallback((onStoreChange) => mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)), [mutationCache]), () => queryClient2.isMutating(filters), () => queryClient2.isMutating(filters)); 53045 } 53046 function useMutation(arg1, arg2, arg3) { 53047 const options2 = parseMutationArgs(arg1, arg2); 53048 const queryClient2 = useQueryClient({ 53049 context: options2.context 53050 }); 53051 const [observer] = reactExports.useState(() => new MutationObserver$1(queryClient2, options2)); 53052 reactExports.useEffect(() => { 53053 observer.setOptions(options2); 53054 }, [observer, options2]); 53055 const result = useSyncExternalStore(reactExports.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult()); 53056 const mutate = reactExports.useCallback((variables, mutateOptions) => { 53057 observer.mutate(variables, mutateOptions).catch(noop); 53058 }, [observer]); 53059 if (result.error && shouldThrowError(observer.options.useErrorBoundary, [result.error])) { 53060 throw result.error; 53061 } 53062 return __spreadProps(__spreadValues({}, result), { 53063 mutate, 53064 mutateAsync: result.mutate 53065 }); 53066 } 53067 function noop() { 53068 } 53069 function baseSlice(array2, start, end) { 53070 var index2 = -1, length2 = array2.length; 53071 if (start < 0) { 53072 start = -start > length2 ? 0 : length2 + start; 53073 } 53074 end = end > length2 ? length2 : end; 53075 if (end < 0) { 53076 end += length2; 53077 } 53078 length2 = start > end ? 0 : end - start >>> 0; 53079 start >>>= 0; 53080 var result = Array(length2); 53081 while (++index2 < length2) { 53082 result[index2] = array2[index2 + start]; 53083 } 53084 return result; 53085 } 53086 function castSlice(array2, start, end) { 53087 var length2 = array2.length; 53088 end = end === void 0 ? length2 : end; 53089 return !start && end >= length2 ? array2 : baseSlice(array2, start, end); 53090 } 53091 var rsAstralRange$2 = "\\ud800-\\udfff", rsComboMarksRange$3 = "\\u0300-\\u036f", reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f", rsComboSymbol
53091sRange$3 = "\\u20d0-\\u20ff", rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3, rsVarRange$2 = "\\ufe0e\\ufe0f"; 53092 var rsZWJ$2 = "\\u200d"; 53093 var reHasUnicode = RegExp("[" + rsZWJ$2 + rsAstralRange$2 + rsComboRange$3 + rsVarRange$2 + "]"); 53094 function hasUnicode(string2) { 53095 return reHasUnicode.test(string2); 53096 } 53097 function asciiToArray(string2) { 53098 return string2.split(""); 53099 } 53100 var rsAstralRange$1 = "\\ud800-\\udfff", rsComboMarksRange$2 = "\\u0300-\\u036f", reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$2 = "\\u20d0-\\u20ff", rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2, rsVarRange$1 = "\\ufe0e\\ufe0f"; 53101 var rsAstral = "[" + rsAstralRange$1 + "]", rsCombo$2 = "[" + rsComboRange$2 + "]", rsFitz$1 = "\\ud83c[\\udffb-\\udfff]", rsModifier$1 = "(?:" + rsCombo$2 + "|" + rsFitz$1 + ")", rsNonAstral$1 = "[^" + rsAstralRange$1 + "]", rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ$1 = "\\u200d"; 53102 var reOptMod$1 = rsModifier$1 + "?", rsOptVar$1 = "[" + rsVarRange$1 + "]?", rsOptJoin$1 = "(?:" + rsZWJ$1 + "(?:" + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsOptVar$1 + reOptMod$1 + ")*", rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1, rsSymbol = "(?:" + [rsNonAstral$1 + rsCombo$2 + "?", rsCombo$2, rsRegional$1, rsSurrPair$1, rsAstral].join("|") + ")"; 53103 var reUnicode = RegExp(rsFitz$1 + "(?=" + rsFitz$1 + ")|" + rsSymbol + rsSeq$1, "g"); 53104 function unicodeToArray(string2) { 53105 return string2.match(reUnicode) || []; 53106 } 53107 function stringToArray(string2) { 53108 return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2); 53109 } 53110 function createCaseFirst(methodName) { 53111 return function(string2) { 53112 string2 = toString$1(string2); 53113 var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0; 53114 var chr = strSymbols ? strSymbols[0] : string2.charAt(0); 53115 var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1); 53116 return chr[methodName]() + trailing; 53117 }; 53118 } 53119 var upperFirst = createCaseFirst("toUpperCase"); 53120 var l = (e2, t2) => (t2 == null ? void 0 : t2.length) ? t2.reduceRight((n2, r2) => r2(n2), e2) : e2; 53121 var $$3 = (e2, t2) => { 53122 let _a = t2, { middlewares: n2 } = _a, r2 = __objRest(_a, ["middlewares"]), u2 = l(e2, n2), a2 = (s2) => { 53123 let o2 = [...r2.queryKey, s2]; 53124 return __spreadProps(__spreadValues({}, r2), { queryKey: o2, queryFn: () => __async(null, null, function* () { 53125 let { data: i2 } = yield u2(...s2 || []); 53126 return i2; 53127 }) }); 53128 }, m2 = (s2, o2) => { 53129 let y2 = useQueryClient(), { queryKey: i2, queryFn: f2 } = a2(s2), d2 = i2[0], g2 = __spreadProps(__spreadValues(__spreadValues({}, r2), o2), { queryKey: i2 }), h2 = useQuery(__spreadValues({ queryFn: f2 }, g2)), c2 = () => __async(null, null, function* () { 53130 yield y2.invalidateQueries({ queryKey: i2 }); 53131 }), p2 = (x2) => { 53132 y2.setQueryData(i2, x2); 53133 }; 53134 return { [`${d2}Query`]: h2, [`${d2}QueryKey`]: i2, [`set${upperFirst(d2)}Data`]: p2, [`invalidate${upperFirst(d2)}Query`]: c2 }; 53135 }; 53136 return m2.getQueryOptions = a2, m2; 53137 }, U$2 = (e2, t2) => { 53138 let _a = t2, { middlewares: n2 } = _a, r2 = __objRest(_a, ["middlewares"]), u2 = l(e2, n2); 53139 return (a2) => { 53140 let m2 = (f2) => __async(null, null, function* () { 53141 let { data: d2 } = yield u2(...f2); 53142 return d2; 53143 }), s2 = __spreadValues(__spreadValues({}, r2), a2), o2 = s2.mutationKey[0], y2 = s2.mutationKey, i2 = useMutation(__spreadValues({ mutationFn: m2 }, s2)); 53144 return { [`${o2}Mutation`]: i2, [`${o2}MutationKey`]: y2 }; 53145 }; 53146 }; 53147 var R$2 = (e2) => e2 instanceof Error && e2.name === "ReauthCancelledError", M$3 = (e2, t2) => { 53148 var _a, _b; 53149 return axios.isAxiosError(t2) && (((_a = t2.response) == null ? void 0 : _a.status) === 403 || ((_b = t2.response) == null ? void 0 : _b.status) === 404) || R$2(t2) ? false : e2 < 2; 53150 }, w$3 = (e2) => { 53151 var _a, _b, _c, _d, _e2, _f; 53152 let t2 = "Something went wrong."; 53153 return axios.isAxiosError(e2) && ((_a = e2.response) == null ? void 0 : _a.data.title) ? t2 = (_b = e2.response) == null ? void 0 : _b.data.title : axios.isAxiosError(e2) && ((_c = e2.response) == null ? void 0 : _c.data.body) ? t2 = v$2((_d = e2.response) == null ? void 0 : _d.data.body) : axios.isAxiosError(e2) && ((_e2 = e2.response) == null ? void 0 : _e2.data.message) ? t2 = (_f = e2.response) == null ? void 0 : _f.data.message : e2 instanceof Error && e2.message && (t2 = e2.message), t2; 53154 }, D$3 = (e2) => (t2) => { 53155 e2(w$3(t2)); 53156 }, K$2 = (e2) => (t2, n2) => { 53157 var _a, _b; 53158 if (!("onError" in n2.options)) { 53159 if (axios.isAxiosError(t2) && (((_a = t2.response) == null ? void 0 : _a.status) === 401 || ((_b = t2.response) == null ? void 0 : _b.status) === 403)) { 53160 console.error(t2); 53161 return; 53162 } 53163 return D$3(e2)(t2); 53164 } 53165 }, v$2 = (e2) => { 53166 let t2 = /* @__PURE__ */ new Set(), n2 = (r2) => { 53167 Object.keys(r2).forEach((u2) => { 53168 let a2 = r2[u2]; 53169 Array.isArray(a2) ? t2.add(`${u2}: ${a2.join(",")}`) : a2 !== null && typeof a2 == "object" ? n2(a2) : t2.add(`${u2}: ${String(a2)}`); 53170 }); 53171 }; 53172 return n2(e2), Array.from(t2).join(` 53173`); 53174 }; 53175 var A$2 = ({ notify: e2 }) => new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: M$3 }, mutations: { onError: D$3(e2) } }, queryCache: new QueryCache({ onError: K$2(e2) }) }); 53176 class CXContactApiClientModel extends ApiBase { 53177 constructor() { 53178 super(...arguments); 53179 __publicField(this, "getOrderData", (payload) => { 53180 return this.post("/cx-contact/order-data", payload); 53181 }); 53182 __publicField(this, "getShopContext", () => { 53183 return this.get("/cx-contact/shop-context"); 53184 }); 53185 __publicField(this, "getTopicTree", (params) => { 53186 return this.get("/cx-contact/topics/tree", params); 53187 }); 53188 __publicField(this, "createReport", (payload) => { 53189 return this.post("/cx-contact/reports", payload); 53190 }); 53191 __publicField(this, "uploadAttachment", (file) => __async(this, null, function* () { 53192 const fileType = file.type || "application/octet-stream"; 53193 const response = yield this.post(`/cx-contact/attachments/upload`, { 53194 fileName: encodeURI(file.name), 53195 contentType: fileType, 53196 size: file.size 53197 }); 53198 const { uploadUrl } = response.data; 53199 yield axios.put(uploadUrl, file, { 53200 headers: { 53201 "Content-Disposition": `attachment; filename="${encodeURI(file.name)}"`, 53202 "Content-Type": fileType, 53203 "x-goog-content-length-range": `0,${file.size}` 53204 } 53205 }); 53206 return response; 53207 })); 53208 } 53209 } 53210 const CXContactApiClient = new CXContactApiClientModel("/api"); 53211 const useGetOrderDataMutation = U$2(CXContactApiClient.getOrderData, { 53212 mutationKey: ["getOrderData"] 53213 }); 53214 const formatVariant = (variant) => __spreadProps(__spreadValues({}, variant), { 53215 name: fe$2(variant.name), 53216 description: variant.description ? fe$2(variant.description) : void 0 53217 }); 53218 const getIndividualGiftCardVariants = (giftCardVariants) => giftCardVariants.flatMap( 53219 (variant) => Array.from({ length: variant.quantity }, (_2, index2) => __spreadProps(__spreadValues({}, formatVariant(variant)), { 53220 quantity: 1, 53221 id: index2 > 0 ? `${variant.id}_${index2}` : variant.id, 53222 giftCardIds: variant.giftCardIds[index2] ? [variant.giftCardIds[index2]] : variant.giftCardIds 53223 })) 53224 ); 53225 const formatOrderData = (orderData) => __spreadProps(__spreadValues({}, orderData), { 53226 commonOrder: orderData.commonOrder ? __spreadProps(__spreadValues({}, orderData.commonOrder), {
53227 shipments: orderData.commonOrder.shipments.map((shipment) => __spreadProps(__spreadValues({}, shipment), { 53228 variants: shipment.variants.map(formatVariant) 53229 })), 53230 digitalVariants: orderData.commonOrder.digitalVariants.map(formatVariant), 53231 giftCardVariants: getIndividualGiftCardVariants(orderData.commonOrder.giftCardVariants) 53232 }) : void 0 53233 }); 53234 const sanitizeEmail = (email) => { 53235 return email.trim(); 53236 }; 53237 const sanitizeFriendlyId = (friendlyId) => { 53238 const trimmedFriendlyId = friendlyId.trim(); 53239 return trimmedFriendlyId.startsWith("#") ? trimmedFriendlyId.slice(1) : trimmedFriendlyId; 53240 }; 53241 const OrderDataContext = reactExports.createContext({ 53242 orderData: void 0, 53243 isLoading: false, 53244 selectedVariants: [], 53245 selectedVariantIds: [], 53246 selectedVariantsData: [], 53247 fetchOrderData: () => __async(null, null, function* () { 53248 }), 53249 handleVariantSelectionChange: () => { 53250 } 53251 }); 53252 const OrderDataProvider = ({ children }) => { 53253 const { getOrderDataMutation } = useGetOrderDataMutation({ 53254 onError: void 0 53255 }); 53256 const [orderData, setOrderData] = reactExports.useState(); 53257 const [selectedVariants, setSelectedVariants] = reactExports.useState([]); 53258 const fetchOrderData = reactExports.useCallback( 53259 (_0) => __async(null, [_0], function* ({ email, friendlyId }) { 53260 const data = yield getOrderDataMutation.mutateAsync([ 53261 { supporterEmail: sanitizeEmail(email), friendlyId: sanitizeFriendlyId(friendlyId) } 53262 ]); 53263 setOrderData(formatOrderData(data)); 53264 }), 53265 [getOrderDataMutation] 53266 ); 53267 reactExports.useEffect(() => { 53268 var _a, _b; 53269 if (!(orderData == null ? void 0 : orderData.commonOrder)) return; 53270 const shipmentVariants = orderData.commonOrder.shipments.flatMap( 53271 (shipment) => shipment.variants.map((variant) => ({ shipmentId: shipment.id, variantId: variant.id })) 53272 ); 53273 const digitalVariants = ((_a = orderData.commonOrder.digitalVariants) != null ? _a : []).map((variant) => ({ 53274 shipmentId: "digital_items", 53275 variantId: variant.id 53276 })); 53277 const giftCardVariants = ((_b = orderData.commonOrder.giftCardVariants) != null ? _b : []).map((variant) => ({ 53278 shipmentId: "gift_cards", 53279 variantId: variant.id 53280 })); 53281 const allVariants2 = [...shipmentVariants, ...digitalVariants, ...giftCardVariants]; 53282 if (allVariants2.length === 1) { 53283 setSelectedVariants(allVariants2); 53284 } 53285 }, [orderData]); 53286 const handleVariantSelectionChange = reactExports.useCallback( 53287 (shipmentId, variantId, isSelected) => { 53288 setSelectedVariants((prev2) => { 53289 if (isSelected) { 53290 return [...prev2, { shipmentId, variantId }]; 53291 } 53292 return prev2.filter((item) => item.shipmentId !== shipmentId || item.variantId !== variantId); 53293 }); 53294 }, 53295 [] 53296 ); 53297 const allVariants = reactExports.useMemo( 53298 () => { 53299 var _a, _b, _c; 53300 return [ 53301 ...((_a = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a.shipments.flatMap((shipment) =>
53301 shipment.variants)) || [], 53302 ...((_b = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _b.digitalVariants) || [], 53303 ...((_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.giftCardVariants) || [] 53304 ]; 53305 }, 53306 [orderData] 53307 ); 53308 const selectedVariantIds = reactExports.useMemo( 53309 () => [...new Set(selectedVariants.map(({ variantId }) => variantId))], 53310 [selectedVariants] 53311 ); 53312 const selectedVariantsData = reactExports.useMemo( 53313 () => selectedVariantIds.map((variantId) => allVariants == null ? void 0 : allVariants.find((variant) => variant.id === variantId)).filter((variant) => variant !== void 0), 53314 [selectedVariantIds, allVariants] 53315 ); 53316 const value = reactExports.useMemo( 53317 () => ({ 53318 orderData, 53319 isLoading: getOrderDataMutation.isLoading || !orderData, 53320 selectedVariants, 53321 selectedVariantIds, 53322 selectedVariantsData, 53323 fetchOrderData, 53324 handleVariantSelectionChange 53325 }), 53326 [ 53327 orderData, 53328 getOrderDataMutation.isLoading, 53329 selectedVariants, 53330 selectedVariantIds, 53331 selectedVariantsData, 53332 fetchOrderData, 53333 handleVariantSelectionChange 53334 ] 53335 ); 53336 return /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDataContext.Provider, { value, children }); 53337 }; 53338 const useOrderData = () => { 53339 return reactExports.useContext(OrderDataContext); 53340 }; 53341 const useScreenTracking = ({ shopId }) => { 53342 const { trackEvent, screenId } = useAnalytics(); 53343 const { isAuthorized } = useOrderAuth(); 53344 const { orderData } = useOrderData(); 53345 const trackedScreenIdRef = reactExports.useRef(null); 53346 reactExports.useEffect(() => { 53347 if (!shopId) return; 53348 if (isAuthorized && !orderData) return; 53349 if (!screenId) return; 53350 if (trackedScreenIdRef.current === screenId) return; 53351 trackedScreenIdRef.current = screenId; 53352 trackEvent("cf_screen_viewed", { 53353 screen_id: screenId, 53354 shop_id: shopId, 53355 order_id: orderData == null ? void 0 : orderData.id 53356 }); 53357 }, [screenId, shopId, isAuthorized, orderData, trackEvent]); 53358 }; 53359 const useShopContextQuery = $$3(CXContactApiClient.getShopContext, { 53360 queryKey: ["shopContext"], 53361 select: (data) => __spreadProps(__spreadValues({}, data), { 53362 shopName: fe$2(data.shopName) 53363 }) 53364 }); 53365 const Contact = () => { 53366 var _a, _b, _c, _d, _e2, _f, _g, _h; 53367 const { pathname } = useLocation(); 53368 const { shopContextQuery } = useShopContextQuery(); 53369 useScreenTracking({ shopId: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId }); 53370 const shopName = ((_b = shopContextQuery.data) == null ? void 0 : _b.shopName) || ""; 53371 if (shopContextQuery.isInitialLoading) { 53372 return /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderSuspenseFallback, {}); 53373 } 53374 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53375 /* @__PURE__ */ jsxRuntimeExports.jsx( 53376 ContactHead, 53377 { 53378 shopName, 53379 contactEmail: (_c = shopContextQuery.data) == null ? void 0 : _c.contactEmail, 53380 logoUrl: (_d = shopContextQuery.data) == null ? void 0 : _d.logoUrl, 53381 externalStoreUrl: (_e2 = shopContextQuery.data) == null ? void 0 : _e2.externalStoreUrl 53382 } 53383 ), 53384 /* @__PURE__ */ jsxRuntimeExports.jsx(E$1, { shopId: (_f = shopContextQuery.data) == null ? void 0 : _f.shopId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AutoFocusableContainer, { id: pathname, children: /* @__PURE__ */ jsxRuntimeExports.jsx( 53385 Layout, 53386 { 53387 logoName: shopName, 53388 logoUrl: (_g = shopContextQuery.data) == null ? void 0 : _g.logoUrl, 53389 externalStoreUrl: (_h = shopContextQuery.data) == null ? void 0 : _h.externalStoreUrl, 53390 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}) 53391 } 53392 ) }) }) 53393 ] }); 53394 }; 53395 const Logout = () => { 53396 const { logout } = useOrderAuth(); 53397 const navigate = useNavigate(); 53398 reactExports.useEffect(() => { 53399 logout(); 53400 navigate(routes.contact.self, { replace: true }); 53401 }, [logout, navigate]); 53402 return null; 53403 }; 53404 /*! 53405 * paypal-js v9.7.0 (2026-04-27T17:34:27.064Z) 53406 * Copyright 2020-present, PayPal, Inc. All rights reserved. 53407 * 53408 * Licensed under the Apache License, Version 2.0 (the "License"); 53409 * you may not use this file except in compliance with the License. 53410 * You may obtain a copy of the License at 53411 * 53412 * http://www.apache.org/licenses/LICENSE-2.0 53413 * 53414 * Unless required by applicable law or agreed to in writing, software 53415 * distributed under the License is distributed on an "AS IS" BASIS, 53416 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53417 * See the License for the specific language governing permissions and 53418 * limitations under the License. 53419 */ 53420 typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { 53421 var e2 = new Error(message); 53422 return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; 53423 }; 53424 var Am = ["US", "GB", "CA", "AU", "DE"]; 53425 function Rr$1(a2, e2) { 53426 for (var r2 = -1, t2 = e2.length, n2 = a2.length; ++r2 < t2; ) a2[n2 + r2] = e2[r2]; 53427 return a2; 53428 } 53429 var na$1 = Rr$1; 53430 var Dr$1 = typeof global == "object" && global && global.Object === Object && global, oa = Dr$1; 53431 var Hr$2 = typeof self == "object" && self && self.Object === Object && self, Ur$1 = oa || Hr$2 || Function("return this")(), f$1 = Ur$1; 53432 var jr$1 = f$1.Symbol, v$1 = jr$1; 53433 var Oa = Object.prototype, zr$1 = Oa.hasOwnProperty, Vr$2 = Oa.toString, X = v$1 ? v$1.toStringTag : void 0; 53434 function Wr$1(a2) { 53435 var e2 = zr$1.call(a2, X), r2 = a2[X]; 53436 try { 53437 a2[X] = void 0; 53438 var t2 = true; 53439 } catch (e3) { 53440 } 53441 var n2 = Vr$2.call(a2); 53442 return t2 && (e2 ? a2[X] = r2 : delete a2[X]), n2; 53443 } 53444 var Ia = Wr$1; 53445 var Yr$1 = Object.prototype, Jr$1 = Yr$1.toString; 53446 function qr$1(a2) { 53447 return Jr$1.call(a2); 53448 } 53449 var Ba = qr$1; 53450 var Zr$1 = "[object Null]", Qr$1 = "[object Undefined]", La = v$1 ? v$1.toStringTag : void 0; 53451 function $r$1(a2) { 53452 return a2 == null ? a2 === void 0 ? Qr$1 : Zr$1 : La && La in Object(a2) ? Ia(a2) : Ba(a2); 53453 } 53454 var A$1 = $r$1; 53455 function Xr$1(a2) { 53456 return a2 != null && typeof a2 == "object"; 53457 } 53458 var M$2 = Xr$1; 53459 var at = "[object Arguments]"; 53460 function et(a2) { 53461 return M$2(a2) && A$1(a2) == at; 53462 } 53463 var Sa = et; 53464 var Ka = Object.prototype, rt = Ka.hasOwnProperty, tt = Ka.propertyIsEnumerable, it = Sa(/* @__PURE__ */ (function() { 53465 return arguments; 53466 })()) ? Sa : function(a2) { 53467 return M$2(a2) && rt.call(a2, "callee") && !tt.call(a2, "callee"); 53468 }, R$1 = it; 53469 var nt = Array.isArray, u$1 = nt; 53470 var Ra = v$1 ? v$1.isConcatSpreadable : void 0; 53471 function ot(a2) { 53472 return u$1(a2) || R$1(a2) || !!(Ra && a2 && a2[Ra]); 53473 } 53474 var Da = ot; 53475 function Ha(a2, e2, r2, t2, n2) { 53476 var i2 = -1, o2 = a2.length; 53477 for (r2 || (r2 = Da), n2 || (n2 = []); ++i2 < o2; ) { 53478 var m2 = a2[i2]; 53479 e2 > 0 && r2(m2) ? e2 > 1 ? Ha(m2, e2 - 1, r2, t2, n2) : na$1(n2, m2) : t2 || (n2[n2.length] = m2); 53480 } 53481 return n2; 53482 } 53483 var Ua = Ha; 53484 function mt$1(a2, e2) { 53485 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length, n2 = Array(t2); ++r2 < t2; ) n2[r2] = e2(a2[r2], r2, a2); 53486 return n2; 53487 } 53488 var D$2 = mt$1; 53489 var lt$1 = "[object Symbol]"; 53490 function st(a2) { 53491 return typeof a2 == "symbol" || M$2(a2) && A$1(a2) == lt$1; 53492 } 53493 var y$1 = st; 53494 var bt$1 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, ut = /^\w*$/; 53495 function pt$1(a2, e2) { 53496 if (u$1(a2)) return false;
53497 var r2 = typeof a2; 53498 return r2 == "number" || r2 == "symbol" || r2 == "boolean" || a2 == null || y$1(a2) ? true : ut.test(a2) || !bt$1.test(a2) || e2 != null && a2 in Object(e2); 53499 } 53500 var H$1 = pt$1; 53501 function ft$1(a2) { 53502 var e2 = typeof a2; 53503 return a2 != null && (e2 == "object" || e2 == "function"); 53504 } 53505 var N$1 = ft$1; 53506 var Tt$1 = "[object AsyncFunction]", vt = "[object Function]", ct = "[object GeneratorFunction]", dt$1 = "[object Proxy]"; 53507 function ht$2(a2) { 53508 if (!N$1(a2)) return false; 53509 var e2 = A$1(a2); 53510 return e2 == vt || e2 == ct || e2 == Tt$1 || e2 == dt$1; 53511 } 53512 var ma = ht$2; 53513 var gt$1 = f$1["__core-js_shared__"], la$1 = gt$1; 53514 var ja = (function() { 53515 var a2 = /[^.]+$/.exec(la$1 && la$1.keys && la$1.keys.IE_PROTO || ""); 53516 return a2 ? "Symbol(src)_1." + a2 : ""; 53517 })(); 53518 function At$1(a2) { 53519 return !!ja && ja in a2; 53520 } 53521 var za = At$1; 53522 var Mt$1 = Function.prototype, St$1 = Mt$1.toString; 53523 function yt$1(a2) { 53524 if (a2 != null) { 53525 try { 53526 return St$1.call(a2); 53527 } catch (e2) { 53528 } 53529 try { 53530 return a2 + ""; 53531 } catch (e2) { 53532 } 53533 } 53534 return ""; 53535 } 53536 var C$2 = yt$1; 53537 var Ct$1 = /[\\^$.*+?()[\]{}|]/g, wt$1 = /^\[object .+?Constructor\]$/, Et$1 = Function.prototype, Nt$1 = Object.prototype, Gt$1 = Et$1.toString, Pt$1 = Nt$1.hasOwnProperty, xt$1 = RegExp("^" + Gt$1.call(Pt$1).replace(Ct$1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); 53538 function kt$1(a2) { 53539 if (!N$1(a2) || za(a2)) return false; 53540 var e2 = ma(a2) ? xt$1 : wt$1; 53541 return e2.test(C$2(a2)); 53542 }
vendor: 8,032 bytes, lines 53543-53804
53543 var Va = kt$1; 53544 function Ft$1(a2, e2) { 53545 return a2 == null ? void 0 : a2[e2]; 53546 } 53547 var Wa = Ft$1; 53548 function _t$1(a2, e2) { 53549 var r2 = Wa(a2, e2); 53550 return Va(r2) ? r2 : void 0; 53551 } 53552 var c = _t$1; 53553 var Ot$1 = c(Object, "create"), w$2 = Ot$1; 53554 function It$1() { 53555 this.__data__ = w$2 ? w$2(null) : {}, this.size = 0; 53556 } 53557 var Ya = It$1; 53558 function Bt$1(a2) { 53559 var e2 = this.has(a2) && delete this.__data__[a2]; 53560 return this.size -= e2 ? 1 : 0, e2; 53561 } 53562 var Ja = Bt$1; 53563 var Lt$1 = "__lodash_hash_undefined__", Kt$1 = Object.prototype, Rt$1 = Kt$1.hasOwnProperty; 53564 function Dt$1(a2) { 53565 var e2 = this.__data__; 53566 if (w$2) { 53567 var r2 = e2[a2]; 53568 return r2 === Lt$1 ? void 0 : r2; 53569 } 53570 return Rt$1.call(e2, a2) ? e2[a2] : void 0; 53571 } 53572 var qa = Dt$1; 53573 var Ht$1 = Object.prototype, Ut$1 = Ht$1.hasOwnProperty; 53574 function jt$2(a2) { 53575 var e2 = this.__data__; 53576 return w$2 ? e2[a2] !== void 0 : Ut$1.call(e2, a2); 53577 } 53578 var Za = jt$2; 53579 var zt$1 = "__lodash_hash_undefined__"; 53580 function Vt$1(a2, e2) { 53581 var r2 = this.__data__; 53582 return this.size += this.has(a2) ? 0 : 1, r2[a2] = w$2 && e2 === void 0 ? zt$1 : e2, this; 53583 } 53584 var Qa = Vt$1; 53585 function U$1(a2) { 53586 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53587 for (this.clear(); ++e2 < r2; ) { 53588 var t2 = a2[e2]; 53589 this.set(t2[0], t2[1]); 53590 } 53591 } 53592 U$1.prototype.clear = Ya; 53593 U$1.prototype.delete = Ja; 53594 U$1.prototype.get = qa; 53595 U$1.prototype.has = Za; 53596 U$1.prototype.set = Qa; 53597 var ya = U$1; 53598 function Wt$2() { 53599 this.__data__ = [], this.size = 0; 53600 } 53601 var $a = Wt$2; 53602 function Yt$2(a2, e2) { 53603 return a2 === e2 || a2 !== a2 && e2 !== e2; 53604 } 53605 var j$1 = Yt$2; 53606 function Jt$1(a2, e2) { 53607 for (var r2 = a2.length; r2--; ) if (j$1(a2[r2][0], e2)) return r2; 53608 return -1; 53609 } 53610 var G$1 = Jt$1; 53611 var qt$1 = Array.prototype, Zt$1 = qt$1.splice; 53612 function Qt$2(a2) { 53613 var e2 = this.__data__, r2 = G$1(e2, a2); 53614 if (r2 < 0) return false; 53615 var t2 = e2.length - 1; 53616 return r2 == t2 ? e2.pop() : Zt$1.call(e2, r2, 1), --this.size, true; 53617 } 53618 var Xa = Qt$2; 53619 function $t$1(a2) { 53620 var e2 = this.__data__, r2 = G$1(e2, a2); 53621 return r2 < 0 ? void 0 : e2[r2][1]; 53622 } 53623 var ae = $t$1; 53624 function Xt$1(a2) { 53625 return G$1(this.__data__, a2) > -1; 53626 } 53627 var ee = Xt$1; 53628 function ai$1(a2, e2) { 53629 var r2 = this.__data__, t2 = G$1(r2, a2); 53630 return t2 < 0 ? (++this.size, r2.push([a2, e2])) : r2[t2][1] = e2, this; 53631 } 53632 var re = ai$1; 53633 function z$1(a2) { 53634 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53635 for (this.clear(); ++e2 < r2; ) { 53636 var t2 = a2[e2]; 53637 this.set(t2[0], t2[1]); 53638 } 53639 } 53640 z$1.prototype.clear = $a; 53641 z$1.prototype.delete = Xa; 53642 z$1.prototype.get = ae; 53643 z$1.prototype.has = ee; 53644 z$1.prototype.set = re; 53645 var P$1 = z$1; 53646 var ei$1 = c(f$1, "Map"), x$1 = ei$1; 53647 function ri$1() { 53648 this.size = 0, this.__data__ = { hash: new ya(), map: new (x$1 || P$1)(), string: new ya() }; 53649 } 53650 var te = ri$1; 53651 function ti$1(a2) { 53652 var e2 = typeof a2; 53653 return e2 == "string" || e2 == "number" || e2 == "symbol" || e2 == "boolean" ? a2 !== "__proto__" : a2 === null; 53654 } 53655 var ie = ti$1; 53656 function ii$1(a2, e2) { 53657 var r2 = a2.__data__; 53658 return ie(e2) ? r2[typeof e2 == "string" ? "string" : "hash"] : r2.map; 53659 } 53660 var k$2 = ii$1; 53661 function ni$1(a2) { 53662 var e2 = k$2(this, a2).delete(a2); 53663 return this.size -= e2 ? 1 : 0, e2; 53664 } 53665 var ne = ni$1; 53666 function oi$1(a2) { 53667 return k$2(this, a2).get(a2); 53668 } 53669 var oe = oi$1; 53670 function mi$1(a2) { 53671 return k$2(this, a2).has(a2); 53672 } 53673 var me$1 = mi$1; 53674 function li$1(a2, e2) { 53675 var r2 = k$2(this, a2), t2 = r2.size; 53676 return r2.set(a2, e2), this.size += r2.size == t2 ? 0 : 1, this; 53677 } 53678 var le = li$1; 53679 function V$1(a2) { 53680 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53681 for (this.clear(); ++e2 < r2; ) { 53682 var t2 = a2[e2]; 53683 this.set(t2[0], t2[1]); 53684 } 53685 } 53686 V$1.prototype.clear = te; 53687 V$1.prototype.delete = ne; 53688 V$1.prototype.get = oe; 53689 V$1.prototype.has = me$1; 53690 V$1.prototype.set = le; 53691 var L$2 = V$1; 53692 var si = "Expected a function"; 53693 function Ca(a2, e2) { 53694 if (typeof a2 != "function" || e2 != null && typeof e2 != "function") throw new TypeError(si); 53695 var r2 = function() { 53696 var t2 = arguments, n2 = e2 ? e2.apply(this, t2) : t2[0], i2 = r2.cache; 53697 if (i2.has(n2)) return i2.get(n2); 53698 var o2 = a2.apply(this, t2); 53699 return r2.cache = i2.set(n2, o2) || i2, o2; 53700 }; 53701 return r2.cache = new (Ca.Cache || L$2)(), r2; 53702 } 53703 Ca.Cache = L$2; 53704 var se = Ca; 53705 var bi = 500; 53706 function ui$1(a2) { 53707 var e2 = se(a2, function(t2) { 53708 return r2.size === bi && r2.clear(), t2; 53709 }), r2 = e2.cache; 53710 return e2; 53711 } 53712 var be$1 = ui$1; 53713 var pi$1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, fi = /\\(\\)?/g, Ti = be$1(function(a2) { 53714 var e2 = []; 53715 return a2.charCodeAt(0) === 46 && e2.push(""), a2.replace(pi$1, function(r2, t2, n2, i2) { 53716 e2.push(n2 ? i2.replace(fi, "$1") : t2 || r2); 53717 }), e2; 53718 }), ue = Ti; 53719 var pe$1 = v$1 ? v$1.prototype : void 0, fe$1 = pe$1 ? pe$1.toString : void 0; 53720 function Te$1(a2) { 53721 if (typeof a2 == "string") return a2; 53722 if (u$1(a2)) return D$2(a2, Te$1) + ""; 53723 if (y$1(a2)) return fe$1 ? fe$1.call(a2) : ""; 53724 var e2 = a2 + ""; 53725 return e2 == "0" && 1 / a2 == -Infinity ? "-0" : e2; 53726 } 53727 var ve$1 = Te$1; 53728 function ci$1(a2) { 53729 return a2 == null ? "" : ve$1(a2); 53730 } 53731 var ce = ci$1; 53732 function di(a2, e2) { 53733 return u$1(a2) ? a2 : H$1(a2, e2) ? [a2] : ue(ce(a2)); 53734 } 53735 var sa = di; 53736 function gi(a2) { 53737 if (typeof a2 == "string" || y$1(a2)) return a2; 53738 var e2 = a2 + ""; 53739 return e2 == "0" && 1 / a2 == -Infinity ? "-0" : e2; 53740 } 53741 var F$1 = gi; 53742 function Ai(a2, e2) { 53743 e2 = sa(e2, a2); 53744 for (var r2 = 0, t2 = e2.length; a2 != null && r2 < t2; ) a2 = a2[F$1(e2[r2++])]; 53745 return r2 && r2 == t2 ? a2 : void 0; 53746 } 53747 var W = Ai; 53748 function Mi() { 53749 this.__data__ = new P$1(), this.size = 0; 53750 } 53751 var de$1 = Mi; 53752 function Si(a2) { 53753 var e2 = this.__data__, r2 = e2.delete(a2); 53754 return this.size = e2.size, r2; 53755 } 53756 var he$1 = Si; 53757 function yi$1(a2) { 53758 return this.__data__.get(a2); 53759 } 53760 var ge$1 = yi$1; 53761 function Ci(a2) { 53762 return this.__data__.has(a2); 53763 } 53764 var Ae$1 = Ci; 53765 var wi = 200; 53766 function Ei(a2, e2) { 53767 var r2 = this.__data__; 53768 if (r2 instanceof P$1) { 53769 var t2 = r2.__data__; 53770 if (!x$1 || t2.length < wi - 1) return t2.push([a2, e2]), this.size = ++r2.size, this; 53771 r2 = this.__data__ = new L$2(t2); 53772 } 53773 return r2.set(a2, e2), this.size = r2.size, this; 53774 } 53775 var Me$1 = Ei; 53776 function Y$1(a2) { 53777 var e2 = this.__data__ = new P$1(a2); 53778 this.size = e2.size; 53779 } 53780 Y$1.prototype.clear = de$1; 53781 Y$1.prototype.delete = he$1; 53782 Y$1.prototype.get = ge$1; 53783 Y$1.prototype.has = Ae$1; 53784 Y$1.prototype.set = Me$1; 53785 var J$1 = Y$1; 53786 var Ni = "__lodash_hash_undefined__"; 53787 function Gi(a2) { 53788 return this.__data__.set(a2, Ni), this; 53789 } 53790 var Se$1 = Gi; 53791 function Pi(a2) { 53792 return this.__data__.has(a2); 53793 } 53794 var ye$1 = Pi; 53795 function ba(a2) { 53796 var e2 = -1, r2 = a2 == null ? 0 : a2.length; 53797 for (this.__data__ = new L$2(); ++e2 < r2; ) this.add(a2[e2]); 53798 } 53799 ba.prototype.add = ba.prototype.push = Se$1; 53800 ba.prototype.has = ye$1; 53801 var Ce$1 = ba; 53802 function xi(a2, e2) { 53803 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length; ++r2 < t2; ) if (e2(a2[r2], r2, a2)) return true; 53804 return false;
53805 } 53806 var we$1 = xi; 53807 function ki(a2, e2) { 53808 return a2.has(e2); 53809 } 53810 var Ee$1 = ki; 53811 var Fi = 1, _i$1 = 2; 53812 function Oi(a2, e2, r2, t2, n2, i2) { 53813 var o2 = r2 & Fi, m2 = a2.length, s2 = e2.length; 53814 if (m2 != s2 && !(o2 && s2 > m2)) return false; 53815 var l2 = i2.get(a2), d2 = i2.get(e2); 53816 if (l2 && d2) return l2 == e2 && d2 == a2; 53817 var T2 = -1, p2 = true, S2 = r2 & _i$1 ? new Ce$1() : void 0; 53818 for (i2.set(a2, e2), i2.set(e2, a2); ++T2 < m2; ) { 53819 var h2 = a2[T2], g2 = e2[T2]; 53820 if (t2) var E2 = o2 ? t2(g2, h2, T2, e2, a2, i2) : t2(h2, g2, T2, a2, e2, i2); 53821 if (E2 !== void 0) { 53822 if (E2) continue; 53823 p2 = false; 53824 break; 53825 } 53826 if (S2) { 53827 if (!we$1(e2, function(I2, B2) { 53828 if (!Ee$1(S2, B2) && (h2 === I2 || n2(h2, I2, r2, t2, i2))) return S2.push(B2); 53829 })) { 53830 p2 = false; 53831 break; 53832 } 53833 } else if (!(h2 === g2 || n2(h2, g2, r2, t2, i2))) { 53834 p2 = false; 53835 break; 53836 } 53837 } 53838 return i2.delete(a2), i2.delete(e2), p2; 53839 } 53840 var ua = Oi; 53841 var Ii = f$1.Uint8Array, wa = Ii; 53842 function Bi(a2) { 53843 var e2 = -1, r2 = Array(a2.size); 53844 return a2.forEach(function(t2, n2) { 53845 r2[++e2] = [n2, t2]; 53846 }), r2; 53847 } 53848 var Ne$1 = Bi; 53849 function Li(a2) { 53850 var e2 = -1, r2 = Array(a2.size); 53851 return a2.forEach(function(t2) { 53852 r2[++e2] = t2; 53853 }), r2; 53854 } 53855 var Ge$1 = Li; 53856 var Ki = 1, Ri = 2, Di = "[object Boolean]", Hi = "[object Date]", Ui = "[object Error]", ji = "[object Map]", zi = "[object Number]",
53856Vi = "[object RegExp]", Wi = "[object Set]", Yi = "[object String]", Ji = "[object Symbol]", qi$1 = "[object ArrayBuffer]", Zi = "[object DataView]", Pe$1 = v$1 ? v$1.prototype : void 0, Ea = Pe$1 ? Pe$1.valueOf : void 0; 53857 function Qi(a2, e2, r2, t2, n2, i2, o2) { 53858 switch (r2) { 53859 case Zi: 53860 if (a2.byteLength != e2.byteLength || a2.byteOffset != e2.byteOffset) return false; 53861 a2 = a2.buffer, e2 = e2.buffer; 53862 case qi$1: 53863 return !(a2.byteLength != e2.byteLength || !i2(new wa(a2), new wa(e2))); 53864 case Di: 53865 case Hi: 53866 case zi: 53867 return j$1(+a2, +e2); 53868 case Ui: 53869 return a2.name == e2.name && a2.message == e2.message; 53870 case Vi: 53871 case Yi: 53872 return a2 == e2 + ""; 53873 case ji: 53874 var m2 = Ne$1; 53875 case Wi: 53876 var s2 = t2 & Ki; 53877 if (m2 || (m2 = Ge$1), a2.size != e2.size && !s2) return false; 53878 var l2 = o2.get(a2); 53879 if (l2) return l2 == e2; 53880 t2 |= Ri, o2.set(a2, e2); 53881 var d2 = ua(m2(a2), m2(e2), t2, n2, i2, o2); 53882 return o2.delete(a2), d2; 53883 case Ji: 53884 if (Ea) return Ea.call(a2) == Ea.call(e2); 53885 } 53886 return false; 53887 } 53888 var xe$1 = Qi; 53889 function $i$1(a2, e2, r2) { 53890 var t2 = e2(a2); 53891 return u$1(a2) ? t2 : na$1(t2, r2(a2)); 53892 } 53893 var ke$1 = $i$1; 53894 function Xi$1(a2, e2) { 53895 for (var r2 = -1, t2 = a2 == null ? 0 : a2.length, n2 = 0, i2 = []; ++r2 < t2; ) { 53896 var o2 = a2[r2]; 53897 e2(o2, r2, a2) && (i2[n2++] = o2); 53898 } 53899 return i2; 53900 } 53901 var Fe$2 = Xi$1; 53902 function an() { 53903 return []; 53904 } 53905 var _e$1 = an; 53906 var en = Object.prototype, rn = en.propertyIsEnumerable, Oe$1 = Object.getOwnPropertySymbols, tn = Oe$1 ? function(a2) { 53907 return a2 == null ? [] : (a2 = Object(a2), Fe$2(Oe$1(a2), function(e2) { 53908 return rn.call(a2, e2); 53909 })); 53910 } : _e$1, Ie$1 = tn; 53911 function nn(a2, e2) { 53912 for (var r2 = -1, t2 = Array(a2); ++r2 < a2; ) t2[r2] = e2(r2); 53913 return t2; 53914 } 53915 var Be$1 = nn; 53916 function on() { 53917 return false; 53918 } 53919 var Le$1 = on; 53920 var De$1 = typeof exports == "object" && exports && !exports.nodeType && exports, Ke$1 = De$1 && typeof module == "object" && module && !module.nodeType && module, mn = Ke$1 && Ke$1.exports === De$1, Re$1 = mn ? f$1.Buffer : void 0, ln$1 = Re$1 ? Re$1.isBuffer : void 0, sn$1 = ln$1 || Le$1, aa$1 = sn$1; 53921 var bn = 9007199254740991, un$1 = /^(?:0|[1-9]\d*)$/; 53922 function pn$1(a2, e2) { 53923 var r2 = typeof a2; 53924 return e2 = e2 != null ? e2 : bn, !!e2 && (r2 == "number" || r2 != "symbol" && un$1.test(a2)) && a2 > -1 && a2 % 1 == 0 && a2 < e2; 53925 } 53926 var q$1 = pn$1; 53927 var fn = 9007199254740991; 53928 function Tn(a2) { 53929 return typeof a2 == "number" && a2 > -1 && a2 % 1 == 0 && a2 <= fn; 53930 } 53931 var Z$1 = Tn; 53932 var vn$1 = "[object Arguments]", cn$1 = "[object Array]", dn$1 = "[object Boolean]", hn = "[object Date]", gn = "[object Error]", An = "[object Function]", Mn = "[object Map]", Sn$1 = "[object Number]", yn = "[object Object]", Cn = "[object RegExp]", wn = "[object Set]", En = "[object String]", Nn$1 = "[object WeakMap]", Gn = "[object ArrayBuffer]", Pn = "[object DataView]", xn = "[object Float32Array]", kn = "[object Float64Array]", Fn = "[object Int8Array]", _n = "[object Int16Array]", On = "[object Int32Array]", In = "[object Uint8Array]", Bn = "[object Uint8ClampedArray]", Ln = "[object Uint16Array]", Kn = "[object Uint32Array]", b = {}; 53933 b[xn] = b[kn] = b[Fn] = b[_n] = b[On] = b[In] = b[Bn] = b[Ln] = b[Kn] = true; 53934 b[vn$1] = b[cn$1] = b[Gn] = b[dn$1] = b[Pn] = b[hn] = b[gn] = b[An] = b[Mn] = b[Sn$1] = b[yn] = b[Cn] = b[wn] = b[En] = b[Nn$1] = false; 53935 function Rn(a2) { 53936 return M$2(a2) && Z$1(a2.length) && !!b[A$1(a2)]; 53937 } 53938 var He$1 = Rn; 53939 function Dn(a2) { 53940 return function(e2) { 53941 return a2(e2); 53942 }; 53943 } 53944 var pa = Dn; 53945 var Ue$1 = typeof exports == "object" && exports && !exports.nodeType && exports, ea$1 = Ue$1 && typeof module == "object" && module && !module.nodeType && module, Hn
53945= ea$1 && ea$1.exports === Ue$1, Na = Hn && oa.process, Un = (function() { 53946 try { 53947 var a2 = ea$1 && ea$1.require && ea$1.require("util").types; 53948 return a2 || Na && Na.binding && Na.binding("util"); 53949 } catch (e2) { 53950 } 53951 })(), Ga = Un; 53952 var je$1 = Ga && Ga.isTypedArray, jn = je$1 ? pa(je$1) : He$1, fa = jn; 53953 var zn = Object.prototype, Vn = zn.hasOwnProperty; 53954 function Wn(a2, e2) { 53955 var r2 = u$1(a2), t2 = !r2 && R$1(a2), n2 = !r2 && !t2 && aa$1(a2), i2 = !r2 && !t2 && !n2 && fa(a2), o2 = r2 || t2 || n2 || i2, m2 = o2 ? Be$1(a2.length, String) : [], s2 = m2.length; 53956 for (var l2 in a2) (e2 || Vn.call(a2, l2)) && !(o2 && (l2 == "length" || n2 && (l2 == "offset" || l2 == "parent") || i2 && (l2 == "buffer" || l2 == "byteLength" || l2 == "byteOffset") || q$1(l2, s2))) && m2.push(l2); 53957 return m2; 53958 } 53959 var ze$1 = Wn; 53960 var Yn = Object.prototype; 53961 function Jn(a2) { 53962 var e2 = a2 && a2.constructor, r2 = typeof e2 == "function" && e2.prototype || Yn; 53963 return a2 === r2; 53964 } 53965 var Ve$1 = Jn; 53966 function qn(a2, e2) { 53967 return function(r2) { 53968 return a2(e2(r2)); 53969 }; 53970 } 53971 var We$1 = qn; 53972 var Zn = We$1(Object.keys, Object), Ye$1 = Zn; 53973 var Qn = Object.prototype, $n = Qn.hasOwnProperty; 53974 function Xn(a2) { 53975 if (!Ve$1(a2)) return Ye$1(a2); 53976 var e2 = []; 53977 for (var r2 in Object(a2)) $n.call(a2, r2) && r2 != "constructor" && e2.push(r2); 53978 return e2; 53979 } 53980 var Je$1 = Xn; 53981 function ao(a2) { 53982 return a2 != null && Z$1(a2.length) && !ma(a2); 53983 } 53984 var _$1 = ao; 53985 function eo(a2) { 53986 return _$1(a2) ? ze$1(a2) : Je$1(a2); 53987 } 53988 var Q$1 = eo; 53989 function ro(a2) { 53990 return ke$1(a2, Q$1, Ie$1); 53991 } 53992 var Pa = ro; 53993 var to = 1, io = Object.prototype, no = io.hasOwnProperty; 53994 function oo(a2, e2, r2, t2, n2, i2) { 53995 var o2 = r2 & to, m2 = Pa(a2), s2 = m2.length, l2 = Pa(e2), d2 = l2.length; 53996 if (s2 != d2 && !o2) return false; 53997 for (var T2 = s2; T2--; ) { 53998 var p2 = m2[T2]; 53999 if (!(o2 ? p2 in e2 : no.call(e2, p2))) return false; 54000 } 54001 var S2 = i2.get(a2), h2 = i2.get(e2); 54002 if (S2 && h2) return S2 == e2 && h2 == a2; 54003 var g2 = true; 54004 i2.set(a2, e2), i2.set(e2, a2); 54005 for (var E2 = o2; ++T2 < s2; ) { 54006 p2 = m2[T2]; 54007 var I2 = a2[p2], B2 = e2[p2]; 54008 if (t2) var _a = o2 ? t2(B2, I2, p2, e2, a2, i2) : t2(I2, B2, p2, a2, e2, i2); 54009 if (!(_a === void 0 ? I2 === B2 || n2(I2, B2, r2, t2, i2) : _a)) { 54010 g2 = false; 54011 break; 54012 } 54013 E2 || (E2 = p2 == "constructor"); 54014 } 54015 if (g2 && !E2) { 54016 var ta = a2.constructor, ia = e2.constructor; 54017 ta != ia && "constructor" in a2 && "constructor" in e2 && !(typeof ta == "function" && ta instanceof ta && typeof ia == "function" && ia instanceof ia) && (g2 = false); 54018 } 54019 return i2.delete(a2), i2.delete(e2), g2; 54020 } 54021 var qe$1 = oo; 54022 var mo = c(f$1, "DataView"), Ta = mo; 54023 var lo = c(f$1, "Promise"), va = lo; 54024 var so = c(f$1, "Set"), ca = so; 54025 var bo = c(f$1, "WeakMap"), da = bo; 54026 var Ze$1 = "[object Map]", uo = "[object Object]", Qe = "[object Promise]", $e$1 = "[object Set]", Xe$1 = "[object WeakMap]", ar$1 = "[object DataView]", po = C$2(Ta), fo = C$2(x$1), To = C$2(va), vo = C$2(ca), co = C$2(da), K$1 = A$1; 54027 (Ta && K$1(new Ta(new ArrayBuffer(1))) != ar$1 || x$1 && K$1(new x$1()) != Ze$1 || va && K$1(va.resolve()) != Qe || ca && K$1(new ca()) != $e$1 || da && K$1(new da()) != Xe$1) && (K$1 = function(a2) { 54028 var e2 = A$1(a2), r2 = e2 == uo ? a2.constructor : void 0, t2 = r2 ? C$2(r2) : ""; 54029 if (t2) switch (t2) { 54030 case po: 54031 return ar$1; 54032 case fo: 54033 return Ze$1; 54034 case To: 54035 return Qe; 54036 case vo: 54037 return $e$1; 54038 case co: 54039 return Xe$1; 54040 } 54041 return e2; 54042 }); 54043 var xa = K$1; 54044 var ho = 1, er$1 = "[object Arguments]", rr$1 = "[object Array]", ha = "[object Object]", go = Object.prototype, tr$1 = go.hasOwnProperty; 54045 function Ao(a2, e2, r2, t2, n2, i2) { 54046 var o2 = u$1(a2), m2 = u$1(e2), s2 = o2 ? rr$1 : xa(a2), l2 = m2 ? rr$1 : xa(e2); 54047 s2 = s2 == er$1 ? ha : s2, l2 = l2 == er$1 ? ha : l2; 54048 var d2 = s2 == ha, T2 = l2 == ha, p2 = s2 == l2; 54049 if (p2 && aa$1(a2)) { 54050 if (!aa$1(e2)) return false;
54051 o2 = true, d2 = false; 54052 } 54053 if (p2 && !d2) return i2 || (i2 = new J$1()), o2 || fa(a2) ? ua(a2, e2, r2, t2, n2, i2) : xe$1(a2, e2, s2, r2, t2, n2, i2); 54054 if (!(r2 & ho)) { 54055 var S2 = d2 && tr$1.call(a2, "__wrapped__"), h2 = T2 && tr$1.call(e2, "__wrapped__"); 54056 if (S2 || h2) { 54057 var g2 = S2 ? a2.value() : a2, E2 = h2 ? e2.value() : e2; 54058 return i2 || (i2 = new J$1()), n2(g2, E2, r2, t2, i2); 54059 } 54060 } 54061 return p2 ? (i2 || (i2 = new J$1()), qe$1(a2, e2, r2, t2, n2, i2)) : false; 54062 } 54063 var ir$1 = Ao; 54064 function nr$1(a2, e2, r2, t2, n2) { 54065 return a2 === e2 ? true : a2 == null || e2 == null || !M$2(a2) && !M$2(e2) ? a2 !== a2 && e2 !== e2 : ir$1(a2, e2, r2, t2, nr$1, n2); 54066 } 54067 var ga = nr$1; 54068 var Mo = 1, So = 2; 54069 function yo(a2, e2, r2, t2) { 54070 var n2 = r2.length, i2 = n2, o2 = !t2; 54071 if (a2 == null) return !i2; 54072 for (a2 = Object(a2); n2--; ) { 54073 var m2 = r2[n2]; 54074 if (o2 && m2[2] ? m2[1] !== a2[m2[0]] : !(m2[0] in a2)) return false; 54075 } 54076 for (; ++n2 < i2; ) { 54077 m2 = r2[n2]; 54078 var s2 = m2[0], l2 = a2[s2], d2 = m2[1]; 54079 if (o2 && m2[2]) { 54080 if (l2 === void 0 && !(s2 in a2)) return false; 54081 } else { 54082 var T2 = new J$1(); 54083 if (t2) var p2 = t2(l2, d2, s2, a2, e2, T2); 54084 if (!(p2 === void 0 ? ga(d2, l2, Mo | So, t2, T2) : p2)) return false; 54085 } 54086 } 54087 return true; 54088 } 54089 var or$1 = yo; 54090 function Co(a2) { 54091 return a2 === a2 && !N$1(a2); 54092 } 54093 var Aa = Co; 54094 function wo(a2) { 54095 for (var e2 = Q$1(a2), r2 = e2.length; r2--; ) { 54096 var t2 = e2[r2], n2 = a2[t2]; 54097 e2[r2] = [t2, n2, Aa(n2)]; 54098 } 54099 return e2; 54100 } 54101 var mr$1 = wo; 54102 function Eo(a2, e2) { 54103 return function(r2) { 54104 return r2 == null ? false : r2[a2] === e2 && (e2 !== void 0 || a2 in Object(r2)); 54105 }; 54106 } 54107 var Ma = Eo; 54108 function No(a2) { 54109 var e2 = mr$1(a2); 54110 return e2.length == 1 && e2[0][2] ? Ma(e2[0][0], e2[0][1]) : function(r2) { 54111 return r2 === a2 || or$1(r2, a2, e2); 54112 }; 54113 } 54114 var lr$1 = No; 54115 function Go(a2, e2, r2) { 54116 var t2 = a2 == null ? void 0 : W(a2, e2); 54117 return t2 === void 0 ? r2 : t2; 54118 } 54119 var sr$1 = Go; 54120 function Po(a2, e2) { 54121 return a2 != null && e2 in Object(a2); 54122 } 54123 var br$1 = Po; 54124 function xo(a2, e2, r2) { 54125 e2 = sa(e2, a2); 54126 for (var t2 = -1, n2 = e2.length, i2 = false; ++t2 < n2; ) { 54127 var o2 = F$1(e2[t2]); 54128 if (!(i2 = a2 != null && r2(a2, o2))) break; 54129 a2 = a2[o2]; 54130 } 54131 return i2 || ++t2 != n2 ? i2 : (n2 = a2 == null ? 0 : a2.length, !!n2 && Z$1(n2) && q$1(o2, n2) && (u$1(a2) || R$1(a2))); 54132 } 54133 var ur$1 = xo; 54134 function ko(a2, e2) { 54135 return a2 != null && ur$1(a2, e2, br$1); 54136 } 54137 var pr$2 = ko; 54138 var Fo = 1, _o = 2; 54139 function Oo(a2, e2) { 54140 return H$1(a2) && Aa(e2) ? Ma(F$1(a2), e2) : function(r2) { 54141 var t2 = sr$1(r2, a2); 54142 return t2 === void 0 && t2 === e2 ? pr$2(r2, a2) : ga(e2, t2, Fo | _o); 54143 }; 54144 } 54145 var fr$1 = Oo; 54146 function Io(a2) { 54147 return a2; 54148 } 54149 var O$1 = Io; 54150 function Bo(a2) { 54151 return function(e2) { 54152 return e2 == null ? void 0 : e2[a2]; 54153 }; 54154 } 54155 var Tr$1 = Bo; 54156 function Lo(a2) { 54157 return function(e2) { 54158 return W(e2, a2); 54159 }; 54160 } 54161 var vr$1 = Lo; 54162 function Ko(a2) { 54163 return H$1(a2) ? Tr$1(F$1(a2)) : vr$1(a2); 54164 } 54165 var cr$1 = Ko; 54166 function Ro(a2) { 54167 return typeof a2 == "function" ? a2 : a2 == null ? O$1 : typeof a2 == "object" ? u$1(a2) ? fr$1(a2[0], a2[1]) : lr$1(a2) : cr$1(a2); 54168 } 54169 var dr$1 = Ro; 54170 function Do(a2) { 54171 return function(e2, r2, t2) { 54172 for (var n2 = -1, i2 = Object(e2), o2 = t2(e2), m2 = o2.length; m2--; ) { 54173 var s2 = o2[a2 ? m2 : ++n2]; 54174 if (r2(i2[s2], s2, i2) === false) break; 54175 } 54176 return e2; 54177 }; 54178 } 54179 var hr$1 = Do; 54180 var Ho = hr$1(), gr$1 = Ho; 54181 function Uo(a2, e2) { 54182 return a2 && gr$1(a2, e2, Q$1); 54183 } 54184 var Ar$1 = Uo; 54185 function jo(a2, e2) { 54186 return function(r2, t2) { 54187 if (r2 == null) return r2; 54188 if (!_$1(r2)) return a2(r2, t2); 54189 for (var n2 = r2.length, i2 = e2 ? n2 : -1, o2 = Object(r2); (e2 ? i2-- : ++i2 < n2) && t2(o2[i2], i2, o2) !== false; ) ; 54190 return r2; 54191 }; 54192 } 54193 var Mr$1 = jo; 54194 var zo = Mr$1(Ar$1), Sr$1 = zo; 54195 function Vo(a2, e2) { 54196 var r2 = -1, t2 = _$1(a2) ? Array(a2.length) : []; 54197 return Sr$1(a2, function(n2, i2, o2) { 54198 t2[++r2] = e2(n2, i2, o2); 54199 }), t2; 54200 } 54201 var yr$1 = Vo; 54202 function Wo(a2, e2) { 54203 var r2 = a2.length; 54204 for (a2.sort(e2); r2--; ) a2[r2] = a2[r2].value; 54205 return a2; 54206 } 54207 var Cr$1 = Wo; 54208 function Yo(a2, e2) { 54209 if (a2 !== e2) { 54210 var r2 = a2 !== void 0, t2 = a2 === null, n2 = a2 === a2, i2 =
54210y$1(a2), o2 = e2 !== void 0, m2 = e2 === null, s2 = e2 === e2, l2 = y$1(e2); 54211 if (!m2 && !l2 && !i2 && a2 > e2 || i2 && o2 && s2 && !m2 && !l2 || t2 && o2 && s2 || !r2 && s2 || !n2) return 1; 54212 if (!t2 && !i2 && !l2 && a2 < e2 || l2 && r2 && n2 && !t2 && !i2 || m2 && r2 && n2 || !o2 && n2 || !s2) return -1; 54213 } 54214 return 0; 54215 } 54216 var wr$1 = Yo; 54217 function Jo(a2, e2, r2) { 54218 for (var t2 = -1, n2 = a2.criteria, i2 = e2.criteria, o2 = n2.length, m2 = r2.length; ++t2 < o2; ) { 54219 var s2 = wr$1(n2[t2], i2[t2]); 54220 if (s2) { 54221 if (t2 >= m2) return s2; 54222 var l2 = r2[t2]; 54223 return s2 * (l2 == "desc" ? -1 : 1); 54224 } 54225 } 54226 return a2.index - e2.index; 54227 } 54228 var Er$1 = Jo; 54229 function qo(a2, e2, r2) { 54230 e2.length ? e2 = D$2(e2, function(i2) { 54231 return u$1(i2) ? function(o2) { 54232 return W(o2, i2.length === 1 ? i2[0] : i2); 54233 } : i2; 54234 }) : e2 = [O$1]; 54235 var t2 = -1; 54236 e2 = D$2(e2, pa(dr$1)); 54237 var n2 = yr$1(a2, function(i2, o2, m2) { 54238 var s2 = D$2(e2, function(l2) { 54239 return l2(i2); 54240 }); 54241 return { criteria: s2, index: ++t2, value: i2 }; 54242 }); 54243 return Cr$1(n2, function(i2, o2) { 54244 return Er$1(i2, o2, r2); 54245 }); 54246 } 54247 var Nr$1 = qo; 54248 function Zo(a2, e2, r2) { 54249 switch (r2.length) { 54250 case 0: 54251 return a2.call(e2); 54252 case 1: 54253 return a2.call(e2, r2[0]); 54254 case 2: 54255 return a2.call(e2, r2[0], r2[1]); 54256 case 3: 54257 return a2.call(e2, r2[0], r2[1], r2[2]); 54258 } 54259 return a2.apply(e2, r2); 54260 } 54261 var Gr$2 = Zo; 54262 var Pr$1 = Math.max; 54263 function Qo(a2, e2, r2) { 54264 return e2 = Pr$1(e2 === void 0 ? a2.length - 1 : e2, 0), function() { 54265 for (var t2 = arguments, n2 = -1, i2 = Pr$1(t2.length - e2, 0), o2 = Array(i2); ++n2 < i2; ) o2[n2] = t2[e2 + n2]; 54266 n2 = -1; 54267 for (var m2 = Array(e2 + 1); ++n2 < e2; ) m2[n2] = t2[n2]; 54268 return m2[e2] = r2(o2), Gr$2(a2, this, m2); 54269 }; 54270 } 54271 var xr$1 = Qo; 54272 function $o(a2) { 54273 return function() { 54274 return a2; 54275 }; 54276 } 54277 var kr$1 = $o; 54278 var Xo = (function() { 54279 try { 54280 var a2 = c(Object, "defineProperty"); 54281 return a2({}, "", {}), a2; 54282 } catch (e2) { 54283 } 54284 })(), ka = Xo; 54285 var am = ka ? function(a2, e2) { 54286 return ka(a2, "toString", { configurable: true, enumerable: false, value: kr$1(e2), writable: true }); 54287 } : O$1, Fr$1 = am; 54288 var em = 800, rm = 16, tm = Date.now; 54289 function im(a2) { 54290 var e2 = 0, r2 = 0; 54291 return function() { 54292 var t2 = tm(), n2 = rm - (t2 - r2); 54293 if (r2 = t2, n2 > 0) { 54294 if (++e2 >= em) return arguments[0]; 54295 } else e2 = 0; 54296 return a2.apply(void 0, arguments); 54297 }; 54298 } 54299 var _r$1 = im; 54300 var nm = _r$1(Fr$1), Or$1 = nm; 54301 function om(a2, e2) { 54302 return Or$1(xr$1(a2, e2, O$1), a2 + ""); 54303 } 54304 var Ir$1 = om; 54305 function mm(a2, e2, r2) { 54306 if (!N$1(r2)) return false; 54307 var t2 = typeof e2; 54308 return (t2 == "number" ? _$1(r2) && q$1(e2, r2.length) : t2 == "string" && e2 in r2) ? j$1(r2[e2], a2) : false; 54309 } 54310 var Fa = mm; 54311 var lm = Ir$1(function(a2, e2) { 54312 if (a2 == null) return []; 54313 var r2 = e2.length; 54314 return r2 > 1 && Fa(a2, e2[0], e2[1]) ? e2 = [] : r2 > 2 && Fa(e2[0], e2[1], e2[2]) && (e2 = [e2[0]]), Nr$1(a2, Ua(e2, 1), []); 54315 }), $$2 = lm; 54316 var sm = [{ name: "Alabama", abbreviation: "AL" }, { name: "Alaska", abbreviation: "AK" }, { name: "American Samoa", abbreviation: "AS" }, { name: "Arizona", abbreviation: "AZ" }, { name: "Arkansas", abbreviation: "AR" }, { name: "California", abbreviation: "CA" }, { name: "Colorado", abbreviation: "CO" }, { name: "Connecticut", abbreviation: "CT" }, { name: "Delaware", abbreviation: "DE" }, { name: "District of Columbia", abbreviation: "DC" }, { name: "Florida", abbreviation: "FL" }, { name: "Georgia", abbreviation: "GA" }, { name: "Guam", abbreviation: "GU" }, { name: "Hawaii", abbreviation: "HI" }, { name: "Idaho", abbreviation: "ID" }, { name: "Illinois", abbreviation: "IL" }, { name: "Indiana", abbreviation: "IN" }, { name: "Iowa", abbreviation: "IA" }, { name: "Kansas", abbreviation: "KS" }, { name: "Kentucky", abbreviation: "KY" }, { name: "Louisiana", abbreviation: "LA" }, { name: "Maine", abbreviation: "ME" }, { name: "Maryland", abbreviation: "MD" }, { name: "Massachusetts", abbreviation: "MA" }, { name: "Michigan", abbreviation: "MI" }, { name: "Minnesota", abbreviation: "MN" }, { name: "Mississippi", abbreviation: "MS" }, { name: "Missouri", abbreviation: "MO" }, { name: "Montana", abbreviation: "MT" }, { name: "Nebraska", abbreviation: "NE" }, { name: "Nevada", abbreviation: "NV" }, { name: "New Hampshire", abbreviation: "NH" }, { name: "New Jersey", abbreviation: "NJ" }, { name: "New Mexico", abbreviation: "NM" }, { name: "New York", abbreviation: "NY" }, { name: "North Carolina", abbreviation: "NC" }, { name: "North Dakota", abbreviation: "ND" }, { name: "Northern Mariana Islands", abbreviation: "MP" }, { name: "Ohio", abbreviation: "OH" }, { name: "Oklahoma", abbreviation: "OK" }, { name: "Oregon", abbreviation: "OR" }, { name: "Pennsylvania", abbreviation: "PA" }, { name: "Puerto Rico", abbreviation: "PR" }, { name: "Rhode Island", abbreviation: "RI" }, { name: "South Carolina", abbreviation: "SC" }, { name: "South Dakota", abbreviation: "SD" }, { name: "Tennessee", abbreviation: "TN" }, { name: "Texas", abbreviation: "TX" }, { name: "Utah", abbreviation: "UT" }, { name: "Vermont", abbreviation: "VT" }, { name: "Virgin Islands", abbreviation: "VI" }, { name: "Virginia", abbreviation: "VA" }, { name: "Washington", abbreviation: "WA" }, { name: "West Virginia", abbreviation: "WV" }, { name: "Wisconsin", abbreviation: "WI" }, { name: "Wyoming", abbreviation: "WY" }], bm = [{ name: "Armed Forces America", abbreviation: "AA" }, { name: "Armed Forces Europe", abbreviation: "AE" }, { name: "Armed Forces Pacific", abbreviation: "AP" }], um = [{ name: "Alberta", abbreviation: "AB" }, { name: "British Columbia", abbreviation: "BC" }, { name: "Manitoba", abbreviation: "MB" }, { name: "New Brunswick", abbreviation: "NB" }, { name: "Newfoundland and Labrador", abbreviation: "NL" }, { name: "Northwest Territories", abbreviation: "NT" }, { name: "Nova Scotia", abbreviation: "NS" }, { name: "Nunavut", abbreviation: "NU" }, { name: "Ontario", abbreviation: "ON" }, { name: "Prince Edward Island", abbreviation: "PE" }, { name: "Quebec", abbreviation: "QC" }, { name: "Saskatchewan", abbreviation: "SK" }, { name: "Yukon", abbreviation: "YT" }], pm = [{ name: "Hokkaido", abbreviation: "Hokkaido" }, { name: "Aomori", abbreviation: "Aomori" }, { name: "Iwate", abbreviation: "Iwate" }, { name: "Miyagi", abbreviation: "Miyagi" }, { name: "Akita", abbreviation: "Akita" }, { name: "Yamagata", abbreviation: "Yamagata" }, { name: "Fukushima", abbreviation: "Fukushima" }, { name: "Ibaraki", abbreviation: "Ibaraki" }, { name: "Tochigi", abbreviation: "Tochigi" }, { name: "Gunma", abbreviation: "Gunma" }, { name: "Saitama", abbreviation: "Saitama" }, { name: "Chiba", abbreviation: "Chiba" }, { name: "Tokyo", abbreviation: "Tokyo" }, { name: "Kanagawa", abbreviation: "Kanagawa" }, { name: "Niigata", abbreviation: "Niigata" }, { name: "Toyama", abbreviation: "Toyama" }, { name: "Ishikawa", abbreviation: "Ishikawa" }, { name: "Fukui", abbreviation: "Fukui" }, { name: "Yamanashi", abbreviation: "Yamanashi" }, { name: "Nagano", abbreviation: "Nagano" }, { name: "Gifu", abbreviation: "Gifu" }, { name: "Shizuoka", abbreviation: "Shizuoka" }, { name: "Aichi", abbreviation: "Aichi" }, { name: "Mie", abbreviation: "Mie" }, { name: "Shiga", abbreviation: "Shiga" }, { name: "Kyoto", abbreviation: "Kyoto" }, { name: "Osaka", abbreviation: "Osaka" }, { name: "Hyogo", abbreviation: "Hyogo" }, { name: "Nara", abbreviation: "Nara" }, { name: "Wakayama", abbreviation: "Wakayama" }, { name: "Tottori", abbreviation: "Tottori" }, { name: "Shimane", abbreviation: "Shimane" }, { name: "Okayama", abbreviation: "Okayama" }, { name: "Hiroshima", abbreviation: "Hiroshima" }, { name: "Yamaguchi", abbreviation: "Yamaguchi" }
54316, { name: "Tokushima", abbreviation: "Tokushima" }, { name: "Kagawa", abbreviation: "Kagawa" }, { name: "Ehime", abbreviation: "Ehime" }, { name: "Kochi", abbreviation: "Kochi" }, { name: "Fukuoka", abbreviation: "Fukuoka" }, { name: "Saga", abbreviation: "Saga" }, { name: "Nagasaki", abbreviation: "Nagasaki" }, { name: "Kumamoto", abbreviation: "Kumamoto" }, { name: "Oita", abbreviation: "Oita" }, { name: "Miyazaki", abbreviation: "Miyazaki" }, { name: "Kagoshima", abbreviation: "Kagoshima" }, { name: "Okinawa", abbreviation: "Okinawa" }], fm = [{ name: "Australian Capital Territory", abbreviation: "ACT" }, { name: "New South Wales", abbreviation: "NSW" }, { name: "Northern Territory", abbreviation: "NT" }, { name: "Queensland", abbreviation: "QLD" }, { name: "South Australia", abbreviation: "SA" }, { name: "Tasmania", abbreviation: "TAS" }, { name: "Victoria", abbreviation: "VIC" }, { name: "Western Australia", abbreviation: "WA" }], Tm = [{ name: "Acre", abbreviation: "AC" }, { name: "Alagoas", abbreviation: "AL" }, { name: "Amazonas", abbreviation: "AM" }, { name: "Amapá", abbreviation: "AP" }, { name: "Bahia", abbreviation: "BA" }, { name: "Ceará", abbreviation: "CE" }, { name: "Distrito Federal", abbreviation: "DF" }, { name: "EspÃrito Santo", abbreviation: "ES" }, { name: "Goiás", abbreviation: "GO" }, { name: "Maranhão", abbreviation: "MA" }, { name: "Minas Gerais", abbreviation: "MG" }, { name: "Mato Grosso do Sul", abbreviation: "MS" }, { name: "Mato Grosso", abbreviation: "MT" }, { name: "Pará", abbreviation: "PA" }, { name: "ParaÃba", abbreviation: "PB" }, { name: "Pernambuco", abbreviation: "PE" }, { name: "PiauÃ", abbreviation: "PI" }, { name: "Paraná", abbreviation: "PR" }, { name: "Rio de Janeiro", abbreviation: "RJ" }, { name: "Rio Grande do Norte", abbreviation: "RN" }, { name: "Rondônia", abbreviation: "RO" }, { name: "Roraima", abbreviation: "RR" }, { name: "Rio Grande do Sul", abbreviation: "RS" }, { name: "Santa Catarina", abbreviation: "SC" }, { name: "Sergipe", abbreviation: "SE" }, { name: "São Paulo", abbreviation: "SP" }, { name: "Tocantins", abbreviation: "TO" }], ra = ({ name: a2, abbreviation: e2 }) => ({ label: a2, value: e2 }); 54317 ({ US: $$2([...sm, ...bm].map(ra), ["label"]), CA: $$2(um.map(ra), ["label"]), JP: $$2(pm.map(ra), ["label"]), AU: $$2(fm.map(ra), ["label"]), BR: $$2(Tm.map(ra), ["label"]) }); 54318 var timezone$1 = { exports: {} }; 54319 var timezone = timezone$1.exports; 54320 var hasRequiredTimezone; 54321 function requireTimezone() { 54322 if (hasRequiredTimezone) return timezone$1.exports; 54323 hasRequiredTimezone = 1; 54324 (function(module2, exports$1) { 54325 !(function(t2, e2) { 54326 module2.exports = e2(); 54327 })(timezone, (function() { 54328 var t2 = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e2 = {}; 54329 return function(n2, i2, o2) { 54330 var r2, a2 = function(t3, n3, i3) { 54331 void 0 === i3 && (i3 = {}); 54332 var o3 = new Date(t3), r3 = (function(t4, n4) { 54333 void 0 === n4 && (n4 = {}); 54334 var i4 = n4.timeZoneName || "short", o4 = t4 + "|" + i4, r4 = e2[o4]; 54335 return r4 || (r4 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t4, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i4 }), e2[o4] = r4), r4; 54336 })(n3, i3); 54337 return r3.formatToParts(o3); 54338 }, u2 = function(e3, n3) { 54339 for (var i3 = a2(e3, n3), r3 = [], u3 = 0; u3 < i3.length; u3 += 1) { 54340 var f3 = i3[u3], s3 = f3.type, m2 = f3.value, c2 = t2[s3]; 54341 c2 >= 0 && (r3[c2] = parseInt(m2, 10)); 54342 } 54343 var d2 = r3[3], l2 = 24 === d2 ? 0 : d2, h2 = r3[0] + "-" + r3[1] + "-" + r3[2] + " " + l2 + ":" + r3[4] + ":" + r3[5] + ":000", v2 = +e3; 54344 return (o2.utc(h2).valueOf() - (v2 -= v2 % 1e3)) / 6e4; 54345 }, f2 = i2.prototype; 54346 f2.tz = function(t3, e3) { 54347 void 0 === t3 && (t3 = r2); 54348 var n3, i3 = this.utcOffset(), a3 = this.toDate(), u3 = a3.toLocaleStr
54348ing("en-US", { timeZone: t3 }), f3 = Math.round((a3 - new Date(u3)) / 1e3 / 60), s3 = 15 * -Math.round(a3.getTimezoneOffset() / 15) - f3; 54349 if (!Number(s3)) n3 = this.utcOffset(0, e3); 54350 else if (n3 = o2(u3, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s3, true), e3) { 54351 var m2 = n3.utcOffset(); 54352 n3 = n3.add(i3 - m2, "minute"); 54353 } 54354 return n3.$x.$timezone = t3, n3; 54355 }, f2.offsetName = function(t3) { 54356 var e3 = this.$x.$timezone || o2.tz.guess(), n3 = a2(this.valueOf(), e3, { timeZoneName: t3 }).find((function(t4) { 54357 return "timezonename" === t4.type.toLowerCase(); 54358 })); 54359 return n3 && n3.value; 54360 }; 54361 var s2 = f2.startOf; 54362 f2.startOf = function(t3, e3) { 54363 if (!this.$x || !this.$x.$timezone) return s2.call(this, t3, e3); 54364 var n3 = o2(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L }); 54365 return s2.call(n3, t3, e3).tz(this.$x.$timezone, true); 54366 }, o2.tz = function(t3, e3, n3) { 54367 var i3 = n3 && e3, a3 = n3 || e3 || r2, f3 = u2(+o2(), a3); 54368 if ("string" != typeof t3) return o2(t3).tz(a3); 54369 var s3 = (function(t4, e4, n4) { 54370 var i4 = t4 - 60 * e4 * 1e3, o3 = u2(i4, n4); 54371 if (e4 === o3) return [i4, e4]; 54372 var r3 = u2(i4 -= 60 * (o3 - e4) * 1e3, n4); 54373 return o3 === r3 ? [i4, o3] : [t4 - 60 * Math.min(o3, r3) * 1e3, Math.max(o3, r3)]; 54374 })(o2.utc(t3, i3).valueOf(), f3, a3), m2 = s3[0], c2 = s3[1], d2 = o2(m2).utcOffset(c2); 54375 return d2.$x.$timezone = a3, d2; 54376 }, o2.tz.guess = function() { 54377 return Intl.DateTimeFormat().resolvedOptions().timeZone; 54378 }, o2.tz.setDefault = function(t3) { 54379 r2 = t3; 54380 }; 54381 }; 54382 })); 54383 })(timezone$1); 54384 return timezone$1.exports; 54385 } 54386 var timezoneExports = requireTimezone(); 54387 const yi = /* @__PURE__ */ getDefaultExportFromCjs(timezoneExports); 54388 var utc$1 = { exports: {} }; 54389 var utc = utc$1.exports; 54390 var hasRequiredUtc; 54391 function requireUtc() { 54392 if (hasRequiredUtc) return utc$1.exports; 54393 hasRequiredUtc = 1; 54394 (function(module2, exports$1) { 54395 !(function(t2, i2) { 54396 module2.exports = i2(); 54397 })(utc, (function() { 54398 var t2 = "minute", i2 = /[+-]\d\d(?::?\d\d)?/g, e2 = /([+-]|\d\d)/g; 54399 return function(s2, f2, n2) { 54400 var u2 = f2.prototype; 54401 n2.utc = function(t3) { 54402 var i3 = { date: t3, utc: true, args: arguments }; 54403 return new f2(i3); 54404 }, u2.utc = function(i3) { 54405 var e3 = n2(this.toDate(), { locale: this.$L, utc: true }); 54406 return i3 ? e3.add(this.utcOffset(), t2) : e3; 54407 }, u2.local = function() { 54408 return n2(this.toDate(), { locale: this.$L, utc: false }); 54409 }; 54410 var r2 = u2.parse; 54411 u2.parse = function(t3) { 54412 t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r2.call(this, t3); 54413 }; 54414 var o2 = u2.init; 54415 u2.init = function() { 54416 if (this.$u) { 54417 var t3 = this.$d; 54418 this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds(); 54419 } else o2.call(this); 54420 }; 54421 var a2 = u2.utcOffset; 54422 u2.utcOffset = function(s3, f3) { 54423 var n3 = this.$utils().u; 54424 if (n3(s3)) return this.$u ? 0 : n3(this.$offset) ? a2.call(this) : this.$offset; 54425 if ("string" == typeof s3 && (s3 = (function(t3) { 54426 void 0 === t3 && (t3 = ""); 54427 var s4 = t3.match(i2); 54428 if (!s4) return null; 54429 var f4 = ("" + s4[0]).match(e2) || ["-", 0, 0], n4 = f4[0], u4 = 60 * +f4[1] + +f4[2]; 54430 return 0 === u4 ? 0 : "+" === n4 ? u4 : -u4; 54431 })(s3), null === s3)) return this; 54432 var u3 = Math.abs(s3) <= 16 ? 60 * s3 : s3; 54433 if (0 === u3) return this.utc(f3); 54434 var r3 = this.clone(); 54435 if (f3) return r3.$offset = u3, r3.$u = false, r3; 54436 var o3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset(); 54437 return (r3 = this.local().add(u3 + o3, t2)).$offset = u3, r3.$x.$localOffset = o3, r3; 54438 }; 54439 var h2 = u2.format; 54440 u2.format = function(t3) { 54441 var i3 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : ""); 54442 return h2.call(this, i3); 54443 }, u2.valueOf = function() { 54444 var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset()); 54445 return this.$d.valueOf() - 6e4 * t3; 54446 }, u2.isUTC = function() { 54447 return !!this.$u; 54448 }, u2.toISOString = function() { 54449 return this.toDate().toISOString(); 54450 }, u2.toString = function() { 54451 return this.toDate().toUTCString(); 54452 }; 54453 var l2 = u2.toDate; 54454 u2.toDate = function(t3) { 54455 return "s" === t3 && this.$offset ? n2(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l2.call(this); 54456 }; 54457 var c2 = u2.diff; 54458 u2.diff = function(t3, i3, e3) { 54459 if (t3 && this.$u === t3.$u) return c2.call(this, t3, i3, e3); 54460 var s3 = this.local(), f3 = n2(t3).local(); 54461 return c2.call(s3, f3, i3, e3); 54462 }; 54463 }; 54464 })); 54465 })(utc$1); 54466 return utc$1.exports; 54467 } 54468 var utcExports = requireUtc(); 54469 const $i = /* @__PURE__ */ getDefaultExportFromCjs(utcExports); 54470 var advancedFormat$1 = { exports: {} }; 54471 var advancedFormat = advancedFormat$1.exports; 54472 var hasRequiredAdvancedFormat; 54473 function requireAdvancedFormat() { 54474 if (hasRequiredAdvancedFormat) return advancedFormat$1.exports; 54475 hasRequiredAdvancedFormat = 1; 54476 (function(module2, exports$1) { 54477 !(function(e2, t2) { 54478 module2.exports = t2(); 54479 })(advancedFormat, (function() { 54480 return function(e2, t2) { 54481 var r2 = t2.prototype, n2 = r2.format; 54482 r2.format = function(e3) { 54483 var t3 = this, r3 = this.$locale(); 54484 if (!this.isValid()) return n2.bind(this)(e3); 54485 var s2 = this.$utils(), a2 = (e3 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e4) { 54486 switch (e4) { 54487 case "Q": 54488 return Math.ceil((t3.$M + 1) / 3); 54489 case "Do": 54490 return r3.ordinal(t3.$D); 54491 case "gggg": 54492 return t3.weekYear(); 54493 case "GGGG": 54494 return t3.isoWeekYear(); 54495 case "wo": 54496 return r3.ordinal(t3.week(), "W"); 54497 case "w": 54498 case "ww": 54499 return s2.s(t3.week(), "w" === e4 ? 1 : 2, "0"); 54500 case "W": 54501 case "WW":
54502 return s2.s(t3.isoWeek(), "W" === e4 ? 1 : 2, "0"); 54503 case "k": 54504 case "kk": 54505 return s2.s(String(0 === t3.$H ? 24 : t3.$H), "k" === e4 ? 1 : 2, "0"); 54506 case "X": 54507 return Math.floor(t3.$d.getTime() / 1e3); 54508 case "x": 54509 return t3.$d.getTime(); 54510 case "z": 54511 return "[" + t3.offsetName() + "]"; 54512 case "zzz": 54513 return "[" + t3.offsetName("long") + "]"; 54514 default: 54515 return e4; 54516 } 54517 })); 54518 return n2.bind(this)(a2); 54519 }; 54520 }; 54521 })); 54522 })(advancedFormat$1); 54523 return advancedFormat$1.exports; 54524 } 54525 var advancedFormatExports = requireAdvancedFormat(); 54526 const Xi = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports); 54527 var weekOfYear$1 = { exports: {} }; 54528 var weekOfYear = weekOfYear$1.exports; 54529 var hasRequiredWeekOfYear; 54530 function requireWeekOfYear() { 54531 if (hasRequiredWeekOfYear) return weekOfYear$1.exports; 54532 hasRequiredWeekOfYear = 1; 54533 (function(module2, exports$1) { 54534 !(function(e2, t2) { 54535 module2.exports = t2(); 54536 })(weekOfYear, (function() { 54537 var e2 = "week", t2 = "year"; 54538 return function(i2, n2, r2) { 54539 var f2 = n2.prototype; 54540 f2.week = function(i3) { 54541 if (void 0 === i3 && (i3 = null), null !== i3) return this.add(7 * (i3 - this.week()), "day"); 54542 var n3 = this.$locale().yearStart || 1; 54543 if (11 === this.month() && this.date() > 25) { 54544 var f3 = r2(this).startOf(t2).add(1, t2).date(n3), s2 = r2(this).endOf(e2); 54545 if (f3.isBefore(s2)) return 1; 54546 } 54547 var a2 = r2(this).startOf(t2).date(n3).startOf(e2).subtract(1, "millisecond"), o2 = this.diff(a2, e2, true); 54548 return o2 < 0 ? r2(this).startOf("week").week() : Math.ceil(o2); 54549 }, f2.weeks = function(e3) { 54550 return void 0 === e3 && (e3 = null), this.week(e3); 54551 }; 54552 }; 54553 })); 54554 })(weekOfYear$1); 54555 return weekOfYear$1.exports; 54556 } 54557 var weekOfYearExports = requireWeekOfYear(); 54558 const _i = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports); 54559 var e = { heading2xl: lt$2` 54560 font-family: var(--font-family-heading); 54561 font-size: var(--font-size-800); 54562 font-weight: var(--font-weight-440); 54563 line-height: var(--font-line-height-700); 54564 letter-spacing: var(--font-letter-spacing-densest); 54565 `, headingXl: lt$2` 54566 font-family: var(--font-family-heading); 54567 font-size: var(--font-size-700); 54568 font-weight: var(--font-weight-460); 54569 line-height: var(--font-line-height-600); 54570 letter-spacing: var(--font-letter-spacing-denser); 54571 `, headingLg: lt$2` 54572 font-family: var(--font-family-heading); 54573 font-size: var(--font-size-600); 54574 font-weight: var(--font-weight-480); 54575 line-height: var(--font-line-height-500); 54576 letter-spacing: var(--font-letter-spacing-dense); 54577 `, headingMd: lt$2` 54578 font-family: var(--font-family-heading); 54579 font-size: var(--font-size-500); 54580 font-weight: var(--font-weight-480); 54581 line-height: var(--font-line-height-400); 54582 letter-spacing: var(--font-letter-spacing-dense); 54583 `, headingSm: lt$2` 54584 font-family: var(--font-family-heading); 54585 font-size: var(--font-size-400); 54586 font-weight: var(--font-weight-500); 54587 line-height: var(--font-line-height-300); 54588 letter-spacing: var(--font-letter-spacing-dense); 54589 `, headingXs: lt$2` 54590 font-family: var(--font-family-heading); 54591 font-size: var(--font-size-300); 54592 font-weight: var(--font-weight-500); 54593 line-height: var(--font-line-height-200); 54594 letter-spacing: var(--font-letter-spacing-normal); 54595 `, bodyMdRegular: lt$2` 54596 font-family: var(--font-family-body); 54597 font-size: var(--font-size-400); 54598 font-weight: var(--font-weight-400); 54599 line-height: var(--font-line-height-400); 54600 letter-spacing: var(--font-letter-spacing-normal); 54601 `, bodyMdMedium: lt$2` 54602 font-family: var(--font-family-body); 54603 font-size: var(--font-size-400); 54604 font-weight: var(--font-weight-500); 54605 line-height: var(--font-line-height-400); 54606 letter-spacing: var(--font-letter-spacing-normal); 54607 `, bodyMdSemibold: lt$2` 54608 font-family: var(--font-family-body); 54609 font-size: var(--font-size-400); 54610 font-weight: var(--font-weight-600); 54611 line-height: var(--font-line-height-400); 54612 letter-spacing: var(--font-letter-spacing-normal); 54613 `, bodySmRegular: lt$2` 54614 font-family: var(--font-family-body); 54615 font-size: var(--font-size-300); 54616 font-weight: var(--font-weight-400); 54617 line-height: var(--font-line-height-300); 54618 letter-spacing: var(--font-letter-spacing-loose); 54619 `, bodySmMedium: lt$2` 54620 font-family: var(--font-family-body); 54621 font-size: var(--font-size-300); 54622 font-weight: var(--font-weight-500); 54623 line-height: var(--font-line-height-300); 54624 letter-spacing: var(--font-letter-spacing-loose); 54625 `, bodySmSemibold: lt$2` 54626 font-family: var(--font-family-body); 54627 font-size: var(--font-size-300); 54628 font-weight: var(--font-weight-600); 54629 line-height: var(--font-line-height-300); 54630 letter-spacing: var(--font-letter-spacing-loose); 54631 `, bodyXsRegular: lt$2` 54632 font-family: var(--font-family-body); 54633 font-size: var(--font-size-200); 54634 font-weight: var(--font-weight-400); 54635 line-height: var(--font-line-height-200); 54636 letter-spacing: var(--font-letter-spacing-looser); 54637 `, bodyXsMedium: lt$2` 54638 font-family: var(--font-family-body); 54639 font-size: var(--font-size-200); 54640 font-weight: var(--font-weight-500); 54641 line-height: var(--font-line-height-200); 54642 letter-spacing: var(--font-letter-spacing-looser); 54643 `, bodyXsSemibold: lt$2` 54644 font-family: var(--font-family-body); 54645 font-size: var(--font-size-200); 54646 font-weight: var(--font-weight-600); 54647 line-height: var(--font-line-height-200); 54648 letter-spacing: var(--font-letter-spacing-looser); 54649 `, body2xsRegular: lt$2` 54650 font-family: var(--font-family-body); 54651 font-size: var(--font-size-100); 54652 font-weight: var(--font-weight-400); 54653 line-height: var(--font-line-height-100); 54654 letter-spacing: var(--font-letter-spacing-loosest); 54655 `, body2xsMedium: lt$2` 54656 font-family: var(--font-family-body); 54657 font-size: var(--font-size-100); 54658 font-weight: var(--font-weight-500); 54659 line-height: var(--font-line-height-100); 54660 letter-spacing: var(--font-letter-spacing-loosest); 54661 `, body2xsSemibold: lt$2` 54662 font-family: var(--font-family-body); 54663 font-size: var(--font-size-100); 54664 font-weight: var(--font-weight-600); 54665 line-height: var(--font-line-height-100); 54666 letter-spacing: var(--font-letter-spacing-loosest); 54667 `, monoMdRegular: lt$2` 54668 font-family: var(--font-family-mono); 54669 font-size: var(--font-size-400); 54670 font-weight: var(--font-weight-400); 54671 line-height: var(--font-line-height-400); 54672 letter-spacing: var(--font-letter-spacing-densest); 54673 `, monoMdMedium: lt$2` 54674 font-family: var(--font-family-mono); 54675 font-size: var(--font-size-400); 54676 font-weight: var(--font-weight-500); 54677 line-height: var(--font-line-height-400); 54678 letter-spacing: var(--font-letter-spacing-densest); 54679 `, monoMdSemibold: lt$2` 54680 font-family: var(--font-family-mono); 54681 font-size: var(--font-size-400); 54682 font-weight: var(--font-weight-600); 54683 line-height: var(--font-line-height-400); 54684 letter-spacing: var(--font-letter-spacing-densest); 54685 `, monoSmRegular: lt$2` 54686 font-family: var(--font-family-mono); 54687 font-size: var(--font-size-300); 54688 font-weight: var(--font-weight-400); 54689 line-height: var(--font-line-height-300); 54690 letter-spacing: var(--font-letter-spacing-denser); 54691 `, monoSmMedium: lt$2` 54692 font-family: var(--font-family-mono); 54693 font-size: var(--font-size-300); 54694 font-weight: var(--font-weight-500); 54695 line-height: var(--font-line-height-300); 54696 letter-spacing: var(--font-letter-spacing-denser); 54697 `, monoSmSemibold: lt$2` 54698 font-family: var(--font-family-mono); 54699 font-size: var(--font-size-300); 54700 font-weight: var(--font-weight-600); 54701 line-height: var(--font-line-height-300); 54702 letter-spacing: var(--font-letter-spacing-denser); 54703 `, monoXsRegular: lt$2` 54704 font-family: var(--font-family-mono); 54705 font-size: var(--font-size-200); 54706 font-weight: var(--font-weight-400); 54707 line-height: var(--font-line-height-200); 54708 letter-spacing: var(--font-letter-spacing-dense); 54709 `, monoXsMedium: lt$2` 54710 font-family: var(--font-family-mono); 54711 font-size: var(--font-size-200); 54712 font-weight: var(--font-weight-500); 54713 line-height: var(--font-line-height-200); 54714 letter-spacing: var(--font-letter-spacing-dense); 54715 `, monoXsSemibold: lt$2` 54716 font-family: var(--font-family-mono); 54717 font-size: var(--font-size-200); 54718 font-weight: var(--font-weight-600); 54719 line-height: var(--font-line-height-200); 54720 letter-spacing: var(--font-letter-spacing-dense); 54721 `, mono2xsRegular: lt$2` 54722 font-family: var(--font-family-mono); 54723 font-size: var(--font-size-100); 54724 font-weight: var(--font-weight-400); 54725 line-height: var(--font-line-height-100); 54726 letter-spacing: var(--font-letter-spacing-normal); 54727 `, mono2xsMedium: lt$2` 54728 font-family: var(--font-family-mono); 54729 font-size: var(--font-size-100); 54730 font-weight: var(--font-weight-500); 54731 line-height: var(--font-line-height-100); 54732 letter-spacing: var(--font-letter-spacing-normal); 54733 `, mono2xsSemibold: lt$2` 54734 font-family: var(--font-family-mono); 54735 font-size: var(--font-size-100); 54736 font-weight: var(--font-weight-600); 54737 line-height: var(--font-line-height-100); 54738 letter-spacing: var(--font-letter-spacing-normal); 54739 ` }; 54740 var Y = { AD: { name: "Andorra", native: "Andorra", phone: [376], continent: "EU", capital: "Andorra la Vella", currency: ["EUR"], languages: ["ca"] }, AE: { name: "United Arab Emirates", native: "دÙÙØ© Ø§ÙØ¥Ù ارات Ø§ÙØ¹Ø±Ø¨ÙØ© اÙÙ ØªØØ¯Ø©", phone: [971], continent: "AS", capital: "Abu Dhabi", currency: ["AED"], languages: ["ar"] }, AF: { name: "Afghanistan", native: "Ø§ÙØºØ§ÙستاÙ", phone: [93], c
54740ontinent: "AS", capital: "Kabul", currency: ["AFN"], languages: ["ps", "uz", "tk"] }, AG: { name: "Antigua and Barbuda", native: "Antigua and Barbuda", phone: [1268], continent: "NA", capital: "Saint John's", currency: ["XCD"], languages: ["en"] }, AI: { name: "Anguilla", native: "Anguilla", phone: [1264], continent: "NA", capital: "The Valley", currency: ["XCD"], languages: ["en"] }, AL: { name: "Albania", native: "Shqipëria", phone: [355], continent: "EU", capital: "Tirana", currency: ["ALL"], languages: ["sq"] }, AM: { name: "Armenia", native: "ÕÕ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶", phone: [374], continent: "AS", capital: "Yerevan", currency: ["AMD"], languages: ["hy", "ru"] }, AO: { name: "Angola", native: "Angola", phone: [244], continent: "AF", capital: "Luanda", currency: ["AOA"], languages: ["pt"] }, AQ: { name: "Antarctica", native: "Antarctica", phone: [672], continent: "AN", capital: "", currency: [], languages: [] }, AR: { name: "Argentina", native: "Argentina", phone: [54], continent: "SA", capital: "Buenos Aires", currency: ["ARS"], languages: ["es", "gn"] }, AS: { name: "American Samoa", native: "American Samoa", phone: [1684], continent: "OC", capital: "Pago Pago", currency: ["USD"], languages: ["en", "sm"] }, AT: { name: "Austria", native: "Ãsterreich", phone: [43], continent: "EU", capital: "Vienna", currency: ["EUR"], languages: ["de"] }, AU: { name: "Australia", native: "Australia", phone: [61], continent: "OC", capital: "Canberra", currency: ["AUD"], languages: ["en"] }, AW: { name: "Aruba", native: "Aruba", phone: [297], continent: "NA", capital: "Oranjestad", currency: ["AWG"], languages: ["nl", "pa"] }, AX: { name: "Aland", native: "Ã
land", phone: [358], continent: "EU", capital: "Mariehamn", currency: ["EUR"], languages: ["sv"], partOf: "FI" }, AZ: { name: "Azerbaijan", native: "AzÉrbaycan", phone: [994], continent: "AS", continents: ["AS", "EU"], capital: "Baku", currency: ["AZN"], languages: ["az"] }, BA: { name: "Bosnia and Herzegovina", native: "Bosna i Hercegovina", phone: [387], continent: "EU", capital: "Sarajevo", currency: ["BAM"], languages: ["bs", "hr", "sr"] }, BB: { name: "Barbados", native: "Barbados", phone: [1246], continent: "NA", capital: "Bridgetown", currency: ["BBD"], languages: ["en"] }, BD: { name: "Bangladesh", native: "Bangladesh", phone: [880], continent: "AS", capital: "Dhaka", currency: ["BDT"], languages: ["bn"] }, BE: { name: "Belgium", native: "België", phone: [32], continent: "EU", capital: "Brussels", currency: ["EUR"], languages: ["nl", "fr", "de"] }, BF: { name: "Burkina Faso", native: "Burkina Faso", phone: [226], continent: "AF", capital: "Ouagadougou", currency: ["XOF"], languages: ["fr", "ff"] }, BG: { name: "Bulgaria", native: "ÐÑлгаÑиÑ", phone: [359], continent: "EU", capital: "Sofia", currency: ["BGN"], languages: ["bg"] }, BH: { name: "Bahrain", native: "âØ§ÙØ¨ØØ±ÙÙ", phone: [973], continent: "AS", capital: "Manama", currency: ["BHD"], languages: ["ar"] }, BI: { name: "Burundi", native: "Burundi", phone: [257], continent: "AF", capital: "Bujumbura", currency: ["BIF"], languages: ["fr", "rn"] }, BJ: { name: "Benin", native: "Bénin", phone: [229], continent: "AF", capital: "Porto-Novo", currency: ["XOF"], languages: ["fr"] }, BL: { name: "Saint Barthelemy", native: "Saint-Barthélemy", phone: [590], continent: "NA", capital: "Gustavia", currency: ["EUR"], languages: ["fr"] }, BM: { name: "Bermuda", native: "Bermuda", phone: [1441], continent: "NA", capital: "Hamilton", currency: ["BMD"], languages: ["en"] }, BN: { name: "Brunei", native: "Negara Brunei Darussalam", phone: [673], continent: "AS", capital: "Bandar Seri Begawan", currency: ["BND"], languages: ["ms"] }, BO: { name: "Bolivia", native: "Bolivia", phone: [591], continent: "SA", capital: "Sucre", currency: ["BOB", "BOV"], languages: ["es", "ay", "qu"] }, BQ: { name: "Bonaire", native: "Bonaire", phone: [5997], continent: "NA", capital: "Kralendijk", currency: ["USD"], languages: ["nl"] }, BR: { name: "Brazil", native: "Brasil", phone: [55], continent: "SA", capital: "BrasÃlia", currency: ["BRL"], languages: ["pt"] }, BS: { name: "Bahamas", native: "Bahamas", phone: [1242], continent: "NA", capital: "Nassau",
54740currency: ["BSD"], languages: ["en"] }, BT: { name: "Bhutan", native: "ʼbrug-yul", phone: [975], continent: "AS", capital: "Thimphu", currency: ["BTN", "INR"], languages: ["dz"] }, BV: { name: "Bouvet Island", native: "Bouvetøya", phone: [47], continent: "AN", capital: "", currency: ["NOK"], languages: ["no", "nb", "nn"] }, BW: { name: "Botswana", native: "Botswana", phone: [267], continent: "AF", capital: "Gaborone", currency: ["BWP"], languages: ["en", "tn"] }, BY: { name: "Belarus", native: "ÐелаÑÑÌÑÑ", phone: [375], continent: "EU", capital: "Minsk", currency: ["BYN"], languages: ["be", "ru"] }, BZ: { name: "Belize", native: "Belize", phone: [501], continent: "NA", capital: "Belmopan", currency: ["BZD"], languages: ["en", "es"] }, CA: { name: "Canada", native: "Canada", phone: [1], continent: "NA", capital: "Ottawa", currency: ["CAD"], languages: ["en", "fr"] }, CC: { name: "Cocos (Keeling) Islands", native: "Cocos (Keeling) Islands", phone: [61], continent: "AS", capital: "West Island", currency: ["AUD"], languages: ["en"] }, CD: { name: "Democratic Republic of the Congo", native: "République démocratique du Congo", phone: [243], continent: "AF", capital: "Kinshasa", currency: ["CDF"], languages: ["fr", "ln", "kg", "sw", "lu"] }, CF: { name: "Central African Republic", native: "Ködörösêse tî Bêafrîka", phone: [236], continent: "AF", capital: "Bangui", currency: ["XAF"], languages: ["fr", "sg"] }, CG: { name: "Republic of the Congo", native: "République du Congo", phone: [242], continent: "AF", capital: "Brazzaville", currency: ["XAF"], languages: ["fr", "ln"] }, CH: { name: "Switzerland", native: "Schweiz", phone: [41], continent: "EU", capital: "Bern", currency: ["CHE", "CHF", "CHW"], languages: ["de", "fr", "it"] }, CI: { name: "Ivory Coast", native: "Côte d'Ivoire", phone: [225], continent: "AF", capital: "Yamoussoukro", currency: ["XOF"], languages: ["fr"] }, CK: { name: "Cook Islands", native: "Cook Islands", phone: [682], continent: "OC", capital: "Avarua", currency: ["NZD"], languages: ["en"] }, CL: { name: "Chile", native: "Chile", phone: [56], continent: "SA", capital: "Santiago", currency: ["CLF", "CLP"], languages: ["es"] }, CM: { name: "Cameroon", native: "Cameroon", phone: [237], continent: "AF", capital: "Yaoundé", currency: ["XAF"], languages: ["en", "fr"] }, CN: { name: "China", native: "ä¸å½", phone: [86], continent: "AS", capital: "Beijing", currency: ["CNY"], languages: ["zh"] }, CO: { name: "Colombia", native: "Colombia", phone: [57], continent: "SA", capital: "Bogotá", currency: ["COP"], languages: ["es"] }, CR: { name: "Costa Rica", native: "Costa Rica", phone: [506], continent: "NA", capital: "San José", currency: ["CRC"], languages: ["es"] }, CU: { name: "Cuba", native: "Cuba", phone: [53], continent: "NA", capital: "Havana", currency: ["CUC", "CUP"], languages: ["es"] }, CV: { name: "Cape Verde", native: "Cabo Verde", phone: [238], continent: "AF", capital: "Praia", currency: ["CVE"], languages: ["pt"] }, CW: { name: "Curacao", native: "Curaçao", phone: [5999], continent: "NA", capital: "Willemstad", currency: ["ANG"], languages: ["nl", "pa", "en"] }, CX: { name: "Christmas Island", native: "Christmas Island", phone: [61], continent: "AS", capital: "Flying Fish Cove", currency: ["AUD"], languages: ["en"] }, CY: { name: "Cyprus", native: "ÎÏÏÏοÏ", phone: [357], continent: "EU", capital: "Nicosia", currency: ["EUR"], languages: ["el", "tr", "hy"] }, CZ: { name: "Czech Republic", native: "Äeská republika", phone: [420], continent: "EU", capital: "Prague", currency: ["CZK"], languages: ["cs"] }, DE: { name: "Germany", native: "Deutschland", phone: [49], continent: "EU", capital: "Berlin", currency: ["EUR"], languages: ["de"] }, DJ: { name: "Djibouti", native: "Djibouti", phone: [253], continent: "AF", capital: "Djibouti", currency: ["DJF"], languages: ["fr", "ar"] }, DK: { name: "Denmark", native: "Danmark", phone: [45], continent: "EU", continents: ["EU", "NA"], capital: "Copenhagen", currency: ["DKK"], languages: ["da"] }, DM: { name: "Dominica", native: "Dominica", phone: [1767], continent: "NA", capital: "Roseau", currency: ["XCD"], languages: ["en"] }, DO: { name: "Dominican Republic", native: "República Dominicana", phone: [1809, 1829, 1849], c
54740ontinent: "NA", capital: "Santo Domingo", currency: ["DOP"], languages: ["es"] }, DZ: { name: "Algeria", native: "Ø§ÙØ¬Ø²Ø§Ø¦Ø±", phone: [213], continent: "AF", capital: "Algiers", currency: ["DZD"], languages: ["ar"] }, EC: { name: "Ecuador", native: "Ecuador", phone: [593], continent: "SA", capital: "Quito", currency: ["USD"], languages: ["es"] }, EE: { name: "Estonia", native: "Eesti", phone: [372], continent: "EU", capital: "Tallinn", currency: ["EUR"], languages: ["et"] }, EG: { name: "Egypt", native: "Ù
صرâ", phone: [20], continent: "AF", continents: ["AF", "AS"], capital: "Cairo", currency: ["EGP"], languages: ["ar"] }, EH: { name: "Western Sahara", native: "Ø§ÙØµØØ±Ø§Ø¡ Ø§ÙØºØ±Ø¨ÙØ©", phone: [212], continent: "AF", capital: "El Aaiún", currency: ["MAD", "DZD", "MRU"], languages: ["es"] }, ER: { name: "Eritrea", native: "á¤ááµá«", phone: [291], continent: "AF", capital: "Asmara", currency: ["ERN"], languages: ["ti", "ar", "en"] }, ES: { name: "Spain", native: "España", phone: [34], continent: "EU", capital: "Madrid", currency: ["EUR"], languages: ["es", "eu", "ca", "gl", "oc"] }, ET: { name: "Ethiopia", native: "á¢áµá®áµá«", phone: [251], continent: "AF", capital: "Addis Ababa", currency: ["ETB"], languages: ["am"] }, FI: { name: "Finland", native: "Suomi", phone: [358], continent: "EU", capital: "Helsinki", currency: ["EUR"], languages: ["fi", "sv"] }, FJ: { name: "Fiji", native: "Fiji", phone: [679], continent: "OC", capital: "Suva", currency: ["FJD"], languages: ["en", "fj", "hi", "ur"] }, FK: { name: "Falkland Islands", native: "Falkland Islands", phone: [500], continent: "SA", capital: "Stanley", currency: ["FKP"], languages: ["en"] }, FM: { name: "Micronesia", native: "Micronesia", phone: [691], continent: "OC", capital: "Palikir", currency: ["USD"], languages: ["en"] }, FO: { name: "Faroe Islands", native: "Føroyar", phone: [298], continent: "EU", capital: "Tórshavn", currency: ["DKK"], languages: ["fo"] }, FR: { name: "France", native: "France", phone: [33], continent: "EU", capital: "Paris", currency: ["EUR"], languages: ["fr"] }, GA: { name: "Gabon", native: "Gabon", phone: [241], continent: "AF", capital: "Libreville", currency: ["XAF"], languages: ["fr"] }, GB: { name: "United Kingdom", native: "United Kingdom", phone: [44], continent: "EU", capital: "London", currency: ["GBP"], languages: ["en"] }, GD: { name: "Grenada", native: "Grenada", phone: [1473], continent: "NA", capital: "St. George's", currency: ["XCD"], languages: ["en"] }, GE: { name: "Georgia", native: "á¡áá¥áá ááááá", phone: [995], continent: "AS", continents: ["AS", "EU"], capital: "Tbilisi", currency: ["GEL"], languages: ["ka"] }, GF: { name: "French Guiana", native: "Guyane française", phone: [594], continent: "SA", capital: "Cayenne", currency: ["EUR"], languages: ["fr"] }, GG: { name: "Guernsey", native: "Guernsey", phone: [44], continent: "EU", capital: "St. Peter Port", currency: ["GBP"], languages: ["en", "fr"] }, GH: { name: "Ghana", native: "Ghana", phone: [233], continent: "AF", capital: "Accra", currency: ["GHS"], languages: ["en"] }, GI: { name: "Gibraltar", native: "Gibraltar", phone: [350], continent: "EU", capital: "Gibraltar", currency: ["GIP"], languages: ["en"] }, GL: { name: "Greenland", native: "Kalaallit Nunaat", phone: [299], continent: "NA", capital: "Nuuk", currency: ["DKK"], languages: ["kl"] }, GM: { name: "Gambia", native: "Gambia", phone: [220], continent: "AF", capital: "Banjul", currency: ["GMD"], languages: ["en"] }, GN: { name: "Guinea", native: "Guinée", phone: [224], continent: "AF", capital: "Conakry", currency: ["GNF"], languages: ["fr", "ff"] }, GP: { name: "Guadeloupe", native: "Guadeloupe", phone: [590], continent: "NA", capital: "Basse-Terre", currency: ["EUR"], languages: ["fr"] }, GQ: { name: "Equatorial Guinea", native: "Guinea Ecuatorial", phone: [240], continent: "AF", capital: "Malabo", currency: ["XAF"], languages: ["es", "fr"] }, GR: { name: "Greece", native: "Îλλάδα", phone: [30], continent: "EU", capital: "Athens", currency: ["EUR"], languages: ["el"] }, GS: { name: "South Georgia and the South Sandwich Islands", native: "South Georgia", phone: [500], continent: "AN", capital: "King Edward Point", currency: ["GBP"], languages: ["en"] }, GT: { name: "Guatemala", native: "Guatemala", phone: [502], continent: "NA", capital: "Guatemala City", currency: ["GTQ"], languages: ["es"] }, GU: { name: "Guam", native: "Guam", phone: [1671], continent: "OC", capital: "HagÃ¥tña", currency: ["USD"], languages: ["en", "ch", "es"] }, GW: { name: "Guinea-Bissau", native: "Guiné-Bissau", phone: [245], continent: "AF", capital: "Bissau", currency: ["XOF"], languages: ["pt"] }, GY: { name: "Guyana", native: "Guyana", phone: [592], continent: "SA", capital: "Georgetown", currency: ["GYD"], languages: ["en"] }, HK: { name: "Hong Kong", native: "馿¸¯", phone: [852], continent: "AS", capital: "City of Victoria", currency: ["HKD"], languages: ["zh", "en"] }, HM: { name: "Heard Island and McDonald Islands", native: "Heard Island and McDonald Islands", phone: [61], continent: "AN", capital: "", currency: ["AUD"], languages: ["en"] }, HN: { name: "Honduras", native: "Honduras", phone: [504], continent: "NA", capital: "Tegucigalpa", currency: ["HNL"], languages: ["es"] }, HR: { name: "Croatia", native: "Hrvatska", phone: [385], continent: "EU", capital: "Zagreb", currency: ["EUR"], languages: ["hr"] }, HT: { name: "Haiti", native: "Haïti", phone: [509], continent: "NA", capital: "Port-au-Prince", currency: ["HTG", "USD"], languages: ["fr", "ht"] }, HU: { name: "Hungary", native: "Magyarország", phone: [36], continent: "EU", capital: "Budapest", currency: ["HUF"], languages: ["hu"] }, ID: { name: "Indonesia", native: "Indonesia", phone: [62], continent: "AS", capital: "Jakarta", currency: ["IDR"], languages: ["id"] }, IE: { name: "Ireland", native: "Ãire", phone: [353], continent: "EU", capital: "Dublin", currency: ["EUR"], languages: ["ga", "en"] }, IL: { name: "Israel", native: "×ִשְ×רָ×Öµ×", phone: [972], continent: "AS", capital: "Jerusalem", currency: ["ILS"], languages: ["he", "ar"] }, IM: { name: "Isle of Man", native: "Isle of Man", phone: [44], continent: "EU", capital: "Douglas", currency: ["GBP"], languages: ["en", "gv"] }, IN: { name: "India", native: "à¤à¤¾à¤°à¤¤", phone: [91], continent: "AS", capital: "New Delhi", currency: ["INR"], languages: ["hi", "en"] }, IO: { name: "British Indian Ocean Territory", native: "British Indian Ocean Territory", phone: [246], continent: "AS", capital: "Diego Garcia", currency: ["USD"], languages: ["en"] }, IQ: { name: "Iraq", native: "Ø§ÙØ¹Ø±Ø§Ù", phone: [964], continent: "AS", capital: "Baghdad", currency: ["IQD"], languages: ["ar", "ku"] }, IR: { name: "Iran", native: "Ø§ÛØ±Ø§Ù", phone: [98], continent: "AS", capital: "Tehran", currency: ["IRR"], languages: ["fa"] }, IS: { name: "Iceland", native: "Ãsland", phone: [354], continent: "EU", capital: "Reykjavik", currency: ["ISK"], languages: ["is"] }, IT: { name: "Italy", native: "Italia", phone: [39], continent: "EU", capital: "Rome", currency: ["EUR"], languages: ["it"] }, JE: { name: "Jersey", native: "Jersey", phone: [44], continent: "EU", capital: "Saint Helier", currency: ["GBP"], languages: ["en", "fr"] }, JM: { name: "Jamaica", native: "Jamaica", phone: [1876], continent: "NA", capital: "Kingston", currency: ["JMD"], languages: ["en"] }, JO: { name: "Jordan", native: "Ø§ÙØ£Ø±Ø¯Ù", phone: [962], continent: "AS", capital: "Amman", currency: ["JOD"], languages: ["ar"] }, JP: { name: "Japan", native: "æ¥æ¬", phone: [81], continent: "AS", capital: "Tokyo", currency: ["JPY"], languages: ["ja"] }, KE: { name: "Kenya", native: "Kenya", phone: [254], continent: "AF", capital: "Nairobi", currency: ["KES"], languages: ["en", "sw"] }, KG: { name: "Kyrgyzstan", native: "ÐÑÑгÑзÑÑан", phone: [99
547406], continent: "AS", capital: "Bishkek", currency: ["KGS"], languages: ["ky", "ru"] }, KH: { name: "Cambodia", native: "KâmpÅchéa", phone: [855], continent: "AS", capital: "Phnom Penh", currency: ["KHR"], languages: ["km"] }, KI: { name: "Kiribati", native: "Kiribati", phone: [686], continent: "OC", capital: "South Tarawa", currency: ["AUD"], languages: ["en"] }, KM: { name: "Comoros", native: "Komori", phone: [269], continent: "AF", capital: "Moroni", currency: ["KMF"], languages: ["ar", "fr"] }, KN: { name: "Saint Kitts and Nevis", native: "Saint Kitts and Nevis", phone: [1869], continent: "NA", capital: "Basseterre", currency: ["XCD"], languages: ["en"] }, KP: { name: "North Korea", native: "ë¶í", phone: [850], continent: "AS", capital: "Pyongyang", currency: ["KPW"], languages: ["ko"] }, KR: { name: "South Korea", native: "ëí민êµ", phone: [82], continent: "AS", capital: "Seoul", currency: ["KRW"], languages: ["ko"] }, KW: { name: "Kuwait", native: "اÙÙÙÙØª", phone: [965], continent: "AS", capital: "Kuwait City", currency: ["KWD"], languages: ["ar"] }, KY: { name: "Cayman Islands", native: "Cayman Islands", phone: [1345], continent: "NA", capital: "George Town", currency: ["KYD"], languages: ["en"] }, KZ: { name: "Kazakhstan", native: "ÒазаÒÑÑан", phone: [7], continent: "AS", continents: ["AS", "EU"], capital: "Astana", currency: ["KZT"], languages: ["kk", "ru"] }, LA: { name: "Laos", native: "ສàºàºàº¥àº²àº§", phone: [856], continent: "AS", capital: "Vientiane", currency: ["LAK"], languages: ["lo"] }, LB: { name: "Lebanon", native: "ÙØ¨ÙاÙ", phone: [961], continent: "AS", capital: "Beirut", currency: ["LBP"], languages: ["ar", "fr"] }, LC: { name: "Saint Lucia", native: "Saint Lucia", phone: [1758], continent: "NA", capital: "Castries", currency: ["XCD"], languages: ["en"] }, LI: { name: "Liechtenstein", native: "Liechtenstein", phone: [423], continent: "EU", capital: "Vaduz", currency: ["CHF"], languages: ["de"] }, LK: { name: "Sri Lanka", native: "ÅrÄ« laá¹kÄva", phone: [94], continent: "AS", capital: "Colombo", currency: ["LKR"], languages: ["si", "ta"] }, LR: { name: "Liberia", native: "Liberia", phone: [231], continent: "AF", capital: "Monrovia", currency: ["LRD"], languages: ["en"] }, LS: { name: "Lesotho", native: "Lesotho", phone: [266], continent: "AF", capital: "Maseru", currency: ["LSL", "ZAR"], languages: ["en", "st"] }, LT: { name: "Lithuania", native: "Lietuva", phone: [370], continent: "EU", capital: "Vilnius", currency: ["EUR"], languages: ["lt"] }, LU: { name: "Luxembourg", native: "Luxembourg", phone: [352], continent: "EU", capital: "Luxembourg", currency: ["EUR"], languages: ["fr", "de", "lb"] }, LV: { name: "Latvia", native: "Latvija", phone: [371], continent: "EU", capital: "Riga", currency: ["EUR"], languages: ["lv"] }, LY: { name: "Libya", native: "âÙÙØ¨Ùا", phone: [218], continent: "AF", capital: "Tripoli", currency: ["LYD"], languages: ["ar"] }, MA: { name: "Morocco", native: "اÙÙ
غرب", phone: [212], continent: "AF", capital: "Rabat", currency: ["MAD"], languages: ["ar"] }, MC: { name: "Monaco", native: "Monaco", phone: [377], continent: "EU", capital: "Monaco", currency: ["EUR"], languages: ["fr"] }, MD: { name: "Moldova", native: "Moldova", phone: [373], continent: "EU", capital: "ChiÈinÄu", currency: ["MDL"], languages: ["ro"] }, ME: { name: "Montenegro", native: "ЦÑна ÐоÑа", phone: [382], continent: "EU", capital: "Podgorica", currency: ["EUR"], languages: ["sr", "bs", "sq", "hr"] }, MF: { name: "Saint Martin", native: "Saint-Martin", phone: [590], continent: "NA", capital: "Marigot", currency: ["EUR"], languages: ["en", "fr", "nl"] }, MG: { name: "Madagascar", native: "Madagasikara", phone: [261], continent: "AF", capital: "Antananarivo", currency: ["MGA"], languages: ["fr", "mg"] }, MH: { name: "Marshall Islands", native: "M̧ajeļ", phone: [692], continent: "OC", capital: "Majuro", currency: ["USD"], languages: ["en", "mh"] }, MK: { name: "North Macedonia", native: "СевеÑна ÐакедониÑа", phone: [389], continent: "EU", capital: "Skopje", currency: ["MKD"], languages: ["mk"] }, ML: { name: "Mali", native: "Mali", phone: [223], continent: "AF", capital: "Bamako", currency: ["XOF"], languages: ["fr"] }, MM: { name: "Myanmar (Burma)", native: "áá¼ááºáá¬", phone: [95], continent: "AS", capital: "Naypyidaw", currency: ["MMK"], languages: ["my"] }, MN: { name: "Mongolia", native: "Ðонгол ÑлÑ", phone: [976], continent: "AS", capital: "Ulan Bator", currency: ["MNT"], languages: ["mn"] }, MO: { name: "Macao", native: "æ¾³é", phone: [853], continent: "AS", capital: "", currency: ["MOP"], languages: ["zh", "pt"] }, MP: { name: "Northern Mariana Islands", native: "Northern Mariana Islands", phone: [1670], continent: "OC", capital: "Saipan", currency: ["USD"], languages: ["en", "ch"] }
54740, MQ: { name: "Martinique", native: "Martinique", phone: [596], continent: "NA", capital: "Fort-de-France", currency: ["EUR"], languages: ["fr"] }, MR: { name: "Mauritania", native: "Ù
ÙØ±ÙتاÙÙØ§", phone: [222], continent: "AF", capital: "Nouakchott", currency: ["MRU"], languages: ["ar"] }, MS: { name: "Montserrat", native: "Montserrat", phone: [1664], continent: "NA", capital: "Plymouth", currency: ["XCD"], languages: ["en"] }, MT: { name: "Malta", native: "Malta", phone: [356], continent: "EU", capital: "Valletta", currency: ["EUR"], languages: ["mt", "en"] }, MU: { name: "Mauritius", native: "Maurice", phone: [230], continent: "AF", capital: "Port Louis", currency: ["MUR"], languages: ["en"] }, MV: { name: "Maldives", native: "Maldives", phone: [960], continent: "AS", capital: "Malé", currency: ["MVR"], languages: ["dv"] }, MW: { name: "Malawi", native: "Malawi", phone: [265], continent: "AF", capital: "Lilongwe", currency: ["MWK"], languages: ["en", "ny"] }, MX: { name: "Mexico", native: "México", phone: [52], continent: "NA", capital: "Mexico City", currency: ["MXN"], languages: ["es"] }, MY: { name: "Malaysia", native: "Malaysia", phone: [60], continent: "AS", capital: "Kuala Lumpur", currency: ["MYR"], languages: ["ms"] }, MZ: { name: "Mozambique", native: "Moçambique", phone: [258], continent: "AF", capital: "Maputo", currency: ["MZN"], languages: ["pt"] }, NA: { name: "Namibia", native: "Namibia", phone: [264], continent: "AF", capital: "Windhoek", currency: ["NAD", "ZAR"], languages: ["en", "af"] }, NC: { name: "New Caledonia", native: "Nouvelle-Calédonie", phone: [687], continent: "OC", capital: "Nouméa", currency: ["XPF"], languages: ["fr"] }, NE: { name: "Niger", native: "Niger", phone: [227], continent: "AF", capital: "Niamey", currency: ["XOF"], languages: ["fr"] }, NF: { name: "Norfolk Island", native: "Norfolk Island", phone: [672], continent: "OC", capital: "Kingston", currency: ["AUD"], languages: ["en"] }, NG: { name: "Nigeria", native: "Nigeria", phone: [234], continent: "AF", capital: "Abuja", currency: ["NGN"], languages: ["en"] }, NI: { name: "Nicaragua", native: "Nicaragua", phone: [505], continent: "NA", capital: "Managua", currency: ["NIO"], languages: ["es"] }, NL: { name: "Netherlands", native: "Nederland", phone: [31], continent: "EU", capital: "Amsterdam", currency: ["EUR"], languages: ["nl"] }, NO: { name: "Norway", native: "Norge", phone: [47], continent: "EU", capital: "Oslo", currency: ["NOK"], languages: ["no", "nb", "nn"] }, NP: { name: "Nepal", native: "नà¥à¤ªà¤¾à¤²", phone: [977], continent: "AS", capital: "Kathmandu", currency: ["NPR"], languages: ["ne"] }, NR: { name: "Nauru", native: "Nauru", phone: [674], continent: "OC", capital: "Yaren", currency: ["AUD"], languages: ["en", "na"] }, NU: { name: "Niue", native: "NiuÄ", phone: [683], continent: "OC", capital: "Alofi", currency: ["NZD"], languages: ["en"] }, NZ: { name: "New Zealand", native: "New Zealand", phone: [64], continent: "OC", capital: "Wellington", currency: ["NZD"], languages: ["en", "mi"] }, OM: { name: "Oman", native: "عÙ
اÙ", phone: [968], continent: "AS", capital: "Muscat", currency: ["OMR"], languages: ["ar"] }, PA: { name: "Panama", native: "Panamá", phone: [507], continent: "NA", capital: "Panama City", currency: ["PAB", "USD"], languages: ["es"] }, PE: { name: "Peru", native: "Perú", phone: [51], continent: "SA", capital: "Lima", currency: ["PEN"], languages: ["es"] }, PF: { name: "French Polynesia", native: "Polynésie française", phone: [689], continent: "OC", capital: "PapeetÄ", currency: ["XPF"], languages: ["fr"] }, PG: { name: "Papua New Guinea", native: "Papua Niugini", phone: [675], continent: "OC", capital: "Port Moresby", currency: ["PGK"], languages: ["en"] }, PH: { name: "Philippines", native: "Pilipinas", phone: [63], continent: "AS", capital: "Manila", currency: ["PHP"], languages: ["en"] }, PK: { name: "Pakistan", native: "Pakistan", phone: [92], continent: "AS", capital: "Islamabad", currency: ["PKR"], languages: ["en", "ur"] }, PL: { name: "Poland", native: "Polska", phone: [48], continent: "EU", capital: "Warsaw", currency: ["PLN"], languages: ["pl"] }, PM: { name: "Saint Pierre and Miquelon", native: "Saint-Pierre-et-Miquelon", phone: [508], continent: "NA", capital: "Saint-Pierre", currency: ["EUR"], languages: ["fr"] }, PN: { name: "Pitcairn Islands", native: "Pitcairn Islands", phone: [64], continent: "OC", capital: "Adamstown", currency: ["NZD"], languages: ["en"] }, PR: { name: "Puerto Rico", native: "Puerto Rico", phone: [1787, 1939], continent: "NA", capital: "San Juan", currency: ["USD"], languages: ["es", "en"] }, PS: { name: "Palestine", native: "ÙÙØ³Ø·ÙÙ", phone: [970], continent: "AS", capital: "Ramallah", currency: ["ILS"], languages: ["ar"] }, PT: { name: "Portugal", native: "Portugal", phone: [351], continent: "EU", capital: "Lisbon", currency: ["EUR"], languages: ["pt"] }, PW: { name: "Palau", native: "Palau", phone: [680], continent: "OC", capital: "Ngerulmud", currency: ["USD"], languages: ["en"] }, PY: { name: "Paraguay", native: "Paraguay", phone: [595], continent: "SA", capital: "Asunción", currency: ["PYG"], languages: ["es", "gn"] }, QA: { name: "Qatar", native: "ÙØ·Ø±", phone: [974], continent: "AS", capital: "Doha", currency: ["QAR"], languages: ["ar"] }, RE: { name: "Reunion", native: "La Réunion", phone: [262], continent: "AF", capital: "Saint-Denis", currency: ["EUR"], languages: ["fr"] }, RO: { name: "Romania", native: "România", phone: [40], continent: "EU", capital: "Bucharest", currency: ["RON"], languages: ["ro"] }, RS: { name: "Serbia", native: "СÑбиÑа", phone: [381], continent: "EU", capital: "Belgrade", currency: ["RSD"], languages: ["sr"] }, RU: { name: "Russia", native: "РоÑÑиÑ", phone: [7], continent: "AS", continents: ["AS", "EU"], capital: "Moscow", currency: ["RUB"], languages: ["ru"] }, RW: { name: "Rwanda", native: "Rwanda", phone: [250], continent: "AF", capital: "Kigali", currency: ["RWF"], languages: ["rw", "en", "fr"] }, SA: { name: "Saudi Arabia", native: "Ø§ÙØ¹Ø±Ø¨ÙØ© Ø§ÙØ³Ø¹ÙØ¯ÙØ©", phone: [966], continent: "AS", capital: "Riyadh", currency: ["SAR"], languages: ["ar"] }, SB: { name: "Solomon Islands", native: "Solomon Islands", phone: [677], continent: "OC", capital: "Honiara", currency: ["SBD"], languages: ["en"] }, SC: { name: "Seychelles", native: "Seychelles", phone: [248], continent: "AF", capital: "Victoria", currency: ["SCR"], languages: ["fr", "en"] }, SD: { name: "Sudan", native: "Ø§ÙØ³ÙداÙ", phone: [249], continent: "AF", capital: "Khartoum", currency: ["SDG"], languages: ["ar", "en"] }
54740, SE: { name: "Sweden", native: "Sverige", phone: [46], continent: "EU", capital: "Stockholm", currency: ["SEK"], languages: ["sv"] }, SG: { name: "Singapore", native: "Singapore", phone: [65], continent: "AS", capital: "Singapore", currency: ["SGD"], languages: ["en", "ms", "ta", "zh"] }, SH: { name: "Saint Helena", native: "Saint Helena", phone: [290], continent: "AF", capital: "Jamestown", currency: ["SHP"], languages: ["en"] }, SI: { name: "Slovenia", native: "Slovenija", phone: [386], continent: "EU", capital: "Ljubljana", currency: ["EUR"], languages: ["sl"] }, SJ: { name: "Svalbard and Jan Mayen", native: "Svalbard og Jan Mayen", phone: [4779], continent: "EU", capital: "Longyearbyen", currency: ["NOK"], languages: ["no"] }, SK: { name: "Slovakia", native: "Slovensko", phone: [421], continent: "EU", capital: "Bratislava", currency: ["EUR"], languages: ["sk"] }, SL: { name: "Sierra Leone", native: "Sierra Leone", phone: [232], continent: "AF", capital: "Freetown", currency: ["SLL"], languages: ["en"] }, SM: { name: "San Marino", native: "San Marino", phone: [378], continent: "EU", capital: "City of San Marino", currency: ["EUR"], languages: ["it"] }, SN: { name: "Senegal", native: "Sénégal", phone: [221], continent: "AF", capital: "Dakar", currency: ["XOF"], languages: ["fr"] }, SO: { name: "Somalia", native: "Soomaaliya", phone: [252], continent: "AF", capital: "Mogadishu", currency: ["SOS"], languages: ["so", "ar"] }, SR: { name: "Suriname", native: "Suriname", phone: [597], continent: "SA", capital: "Paramaribo", currency: ["SRD"], languages: ["nl"] }, SS: { name: "South Sudan", native: "South Sudan", phone: [211], continent: "AF", capital: "Juba", currency: ["SSP"], languages: ["en"] }, ST: { name: "Sao Tome and Principe", native: "São Tomé e PrÃncipe", phone: [239], continent: "AF", capital: "São Tomé", currency: ["STN"], languages: ["pt"] }, SV: { name: "El Salvador", native: "El Salvador", phone: [503], continent: "NA", capital: "San Salvador", currency: ["SVC", "USD"], languages: ["es"] }, SX: { name: "Sint Maarten", native: "Sint Maarten", phone: [1721], continent: "NA", capital: "Philipsburg", currency: ["ANG"], languages: ["nl", "en"] }, SY: { name: "Syria", native: "Ø³ÙØ±Ùا", phone: [963], continent: "AS", capital: "Damascus", currency: ["SYP"], languages: ["ar"] }, SZ: { name: "Eswatini", native: "Eswatini", phone: [268], continent: "AF", capital: "Lobamba", currency: ["SZL"], languages: ["en", "ss"] }, TC: { name: "Turks and Caicos Islands", native: "Turks and Caicos Islands", phone: [1649], continent: "NA", capital: "Cockburn Town", currency: ["USD"], languages: ["en"] }, TD: { name: "Chad", native: "Tchad", phone: [235], continent: "AF", capital: "N'Djamena", currency: ["XAF"], languages: ["fr", "ar"] }, TF: { name: "French Southern Territories", native: "Territoire des Terres australes et antarctiques fr", phone: [262], continent: "AN", capital: "Port-aux-Français", currency: ["EUR"], languages: ["fr"] }, TG: { name: "Togo", native: "Togo", phone: [228], continent: "AF", capital: "Lomé", currency: ["XOF"], languages: ["fr"] }, TH: { name: "Thailand", native: "à¸à¸£à¸°à¹à¸à¸¨à¹à¸à¸¢", phone: [66], continent: "AS", capital: "Bangkok", currency: ["THB"], languages: ["th"] }, TJ: { name: "Tajikistan", native: "ТоҷикиÑÑон", phone: [992], continent: "AS", capital: "Dushanbe", currency: ["TJS"], languages: ["tg", "ru"] }, TK: { name: "Tokelau", native: "Tokelau", phone: [690], continent: "OC", capital: "Fakaofo", currency: ["NZD"], languages: ["en"] }, TL: { name: "East Timor", native: "Timor-Leste", phone: [670], continent: "OC", capital: "Dili", currency: ["USD"], languages: ["pt"] }, TM: { name: "Turkmenistan", native: "Türkmenistan", phone: [993], continent: "AS", capital: "Ashgabat", currency: ["TMT"], languages: ["tk", "ru"] }, TN: { name: "Tunisia", native: "تÙÙØ³", phone: [216], continent: "AF", capital: "Tunis", currency: ["TND"], languages: ["ar"] }, TO: { name: "Tonga", native: "Tonga", phone: [676], continent: "OC", capital: "Nuku'alofa", currency: ["TOP"], languages: ["en", "to"] }, TR: { name: "Turkey", native: "Türkiye", phone: [90], continent: "AS", continents: ["AS", "EU"], capital: "Ankara", currency: ["TRY"], languages: ["tr"] }, TT: { name: "Trinidad and Tobago", native: "Trinidad and Tobago", phone: [1868], continent: "NA", capital: "Port of Spain", currency: ["TTD"], languages: ["en"] }, TV: { name: "Tuvalu", native: "Tuvalu", phone: [688], continent: "OC", capital: "Funafuti", currency: ["AUD"], languages: ["en"] }, TW: { name: "Taiwan", native: "èºç£", phone: [886], continent: "AS", capital: "Taipei", currency: ["TWD"], languages: ["zh"] }, TZ: { name: "Tanzania", native: "Tanzania", phone: [255], continent: "AF", capital: "Dodoma", currency: ["TZS"], languages: ["sw", "en"] }, UA: { name: "Ukraine", native: "УкÑаÑна", phone: [380], continent: "EU", capital: "Kyiv", currency: ["UAH"], languages: ["uk"] }, UG: { name: "Uganda", native: "Uganda", phone: [256], continent: "AF", capital: "K
54740ampala", currency: ["UGX"], languages: ["en", "sw"] }, UM: { name: "U.S. Minor Outlying Islands", native: "United States Minor Outlying Islands", phone: [1], continent: "OC", capital: "", currency: ["USD"], languages: ["en"] }, US: { name: "United States", native: "United States", phone: [1], continent: "NA", capital: "Washington D.C.", currency: ["USD", "USN", "USS"], languages: ["en"] }, UY: { name: "Uruguay", native: "Uruguay", phone: [598], continent: "SA", capital: "Montevideo", currency: ["UYI", "UYU"], languages: ["es"] }, UZ: { name: "Uzbekistan", native: "O'zbekiston", phone: [998], continent: "AS", capital: "Tashkent", currency: ["UZS"], languages: ["uz", "ru"] }, VA: { name: "Vatican City", native: "Vaticano", phone: [379], continent: "EU", capital: "Vatican City", currency: ["EUR"], languages: ["it", "la"] }, VC: { name: "Saint Vincent and the Grenadines", native: "Saint Vincent and the Grenadines", phone: [1784], continent: "NA", capital: "Kingstown", currency: ["XCD"], languages: ["en"] }, VE: { name: "Venezuela", native: "Venezuela", phone: [58], continent: "SA", capital: "Caracas", currency: ["VES"], languages: ["es"] }, VG: { name: "British Virgin Islands", native: "British Virgin Islands", phone: [1284], continent: "NA", capital: "Road Town", currency: ["USD"], languages: ["en"] }, VI: { name: "U.S. Virgin Islands", native: "United States Virgin Islands", phone: [1340], continent: "NA", capital: "Charlotte Amalie", currency: ["USD"], languages: ["en"] }, VN: { name: "Vietnam", native: "Viá»t Nam", phone: [84], continent: "AS", capital: "Hanoi", currency: ["VND"], languages: ["vi"] }, VU: { name: "Vanuatu", native: "Vanuatu", phone: [678], continent: "OC", capital: "Port Vila", currency: ["VUV"], languages: ["bi", "en", "fr"] }, WF: { name: "Wallis and Futuna", native: "Wallis et Futuna", phone: [681], continent: "OC", capital: "Mata-Utu", currency: ["XPF"], languages: ["fr"] }, WS: { name: "Samoa", native: "Samoa", phone: [685], continent: "OC", capital: "Apia", currency: ["WST"], languages: ["sm", "en"] }, XK: { name: "Kosovo", native: "Republika e Kosovës", phone: [377, 381, 383, 386], continent: "EU", capital: "Pristina", currency: ["EUR"], languages: ["sq", "sr"], userAssigned: true }, YE: { name: "Yemen", native: "اÙÙÙÙ ÙÙ", phone: [967], continent: "AS", capital: "Sana'a", currency: ["YER"], languages: ["ar"] }, YT: { name: "Mayotte", native: "Mayotte", phone: [262], continent: "AF", capital: "Mamoudzou", currency: ["EUR"], languages: ["fr"] }, ZA: { name: "South Africa", native: "South Africa", phone: [27], continent: "AF", capital: "Pretoria", currency: ["ZAR"], languages: ["af", "en", "nr", "st", "ss", "tn", "ts", "ve", "xh", "zu"] }, ZM: { name: "Zambia", native: "Zambia", phone: [260], continent: "AF", capital: "Lusaka", currency: ["ZMW"], languages: ["en"] }, ZW: { name: "Zimbabwe", native: "Zimbabwe", phone: [263], continent: "AF", capital: "Harare", currency: ["USD", "ZAR", "BWP", "GBP", "AUD", "CNY", "INR", "JPY"], languages: ["en", "sn", "nd"] } }; 54741 var lt = { AD: "AND", AE: "ARE", AF: "AFG", AG: "ATG", AI: "AIA", AL: "ALB", AM: "ARM", AO: "AGO", AQ: "ATA", AR: "ARG", AS: "ASM", AT: "AUT", AU: "AUS", AW: "ABW", AX: "ALA", AZ: "AZE", BA: "BIH", BB: "BRB", BD: "BGD", BE: "BEL", BF: "BFA", BG: "BGR", BH: "BHR", BI: "BDI", BJ: "BEN", BL: "BLM", BM: "BMU", BN: "BRN", BO: "BOL", BQ: "BES", BR: "BRA", BS: "BHS", BT: "BTN", BV: "BVT", BW: "BWA", BY: "BLR", BZ: "BLZ", CA: "CAN", CC: "CCK", CD: "COD", CF: "CAF", CG: "COG", CH: "CHE", CI: "CIV", CK: "COK", CL: "CHL", CM: "CMR", CN: "CHN", CO: "COL", CR: "CRI", CU: "CUB", CV: "CPV", CW: "CUW", CX: "CXR", CY: "CYP", CZ: "CZE", DE: "DEU", DJ: "DJI", DK: "DNK", DM: "DMA", DO: "DOM", DZ: "DZA", EC: "ECU", EE: "EST", EG: "EGY", EH: "ESH", ER: "ERI", ES: "ESP", ET: "ETH", FI: "FIN", FJ: "FJI", FK: "FLK", FM: "FSM", FO: "FRO", FR: "FRA", GA: "GAB", GB: "GBR", GD: "GRD", GE: "GEO", GF: "GUF", GG: "GGY", GH: "GHA", GI: "GIB", GL: "GRL", GM: "GMB", GN: "GIN", GP: "GLP", GQ: "GNQ", GR: "GRC", GS: "SGS", GT: "GTM", GU: "GUM", GW: "GNB", GY: "GUY", HK: "HKG", HM: "HMD", HN: "HND", HR: "HRV", HT: "HTI", HU: "HUN", ID: "IDN", IE: "IRL", IL: "ISR", IM: "IMN", IN: "IND", IO: "IOT", IQ: "IRQ", IR: "IRN", IS: "ISL", IT: "ITA", JE: "JEY", JM: "JAM", JO: "JOR", JP: "JPN", KE: "KEN", KG: "KGZ", KH: "KHM", KI: "KIR", KM: "COM", KN: "KNA", KP: "PRK", KR: "KOR", KW: "KWT", KY: "CYM", KZ: "KAZ", LA: "LAO", LB: "LBN", LC: "LCA", LI: "LIE", LK: "LKA", LR: "LBR", LS: "LSO", LT: "LTU", LU: "LUX", LV: "LVA", LY: "LBY", MA: "MAR", MC: "MCO", MD: "MDA", ME: "MNE", MF: "MAF", MG: "MDG", MH: "MHL", MK: "MKD", ML: "MLI", MM: "MMR", MN: "MNG", MO: "MAC", MP: "MNP", MQ: "MTQ", MR: "MRT", MS: "MSR", MT
54741: "MLT", MU: "MUS", MV: "MDV", MW: "MWI", MX: "MEX", MY: "MYS", MZ: "MOZ", NA: "NAM", NC: "NCL", NE: "NER", NF: "NFK", NG: "NGA", NI: "NIC", NL: "NLD", NO: "NOR", NP: "NPL", NR: "NRU", NU: "NIU", NZ: "NZL", OM: "OMN", PA: "PAN", PE: "PER", PF: "PYF", PG: "PNG", PH: "PHL", PK: "PAK", PL: "POL", PM: "SPM", PN: "PCN", PR: "PRI", PS: "PSE", PT: "PRT", PW: "PLW", PY: "PRY", QA: "QAT", RE: "REU", RO: "ROU", RS: "SRB", RU: "RUS", RW: "RWA", SA: "SAU", SB: "SLB", SC: "SYC", SD: "SDN", SE: "SWE", SG: "SGP", SH: "SHN", SI: "SVN", SJ: "SJM", SK: "SVK", SL: "SLE", SM: "SMR", SN: "SEN", SO: "SOM", SR: "SUR", SS: "SSD", ST: "STP", SV: "SLV", SX: "SXM", SY: "SYR", SZ: "SWZ", TC: "TCA", TD: "TCD", TF: "ATF", TG: "TGO", TH: "THA", TJ: "TJK", TK: "TKL", TL: "TLS", TM: "TKM", TN: "TUN", TO: "TON", TR: "TUR", TT: "TTO", TV: "TUV", TW: "TWN", TZ: "TZA", UA: "UKR", UG: "UGA", UM: "UMI", US: "USA", UY: "URY", UZ: "UZB", VA: "VAT", VC: "VCT", VE: "VEN", VG: "VGB", VI: "VIR", VN: "VNM", VU: "VUT", WF: "WLF", WS: "WSM", XK: "XKX", YE: "YEM", YT: "MYT", ZA: "ZAF", ZM: "ZMB", ZW: "ZWE" }, pt = (n2) => __spreadProps(__spreadValues({}, Y[n2]), { iso2: n2, iso3: lt[n2] }), mt = () => Object.keys(Y).map((n2) => pt(n2)); 54742 mt(); 54743 function dt(n2, e2) { 54744 for (var a2 = -1, t2 = n2 == null ? 0 : n2.length; ++a2 < t2 && e2(n2[a2], a2, n2) !== false; ) ; 54745 return n2; 54746 } 54747 var pe = dt; 54748 function ht$1(n2, e2, a2) { 54749 e2 == "__proto__" && ka ? ka(n2, e2, { configurable: true, enumerable: true, value: a2, writable: true }) : n2[e2] = a2; 54750 } 54751 var un = ht$1; 54752 var yt = Object.prototype, At = yt.hasOwnProperty; 54753 function St(n2, e2, a2) { 54754 var t2 = n2[e2]; 54755 (!(At.call(n2, e2) && j$1(t2, a2)) || a2 === void 0 && !(e2 in n2)) && un(n2, e2, a2); 54756 } 54757 var L$1 = St; 54758 function Ct(n2, e2, a2, t2) { 54759 var r2 = !a2; 54760 a2 || (a2 = {}); 54761 for (var u2 = -1, o2 = e2.length; ++u2 < o2; ) { 54762 var i2 = e2[u2], c2 = t2 ? t2(a2[i2], n2[i2], i2, a2, n2) : void 0; 54763 c2 === void 0 && (c2 = n2[i2]), r2 ? un(a2, i2, c2) : L$1(a2, i2, c2); 54764 } 54765 return a2; 54766 } 54767 var D$1 = Ct; 54768 function Et(n2, e2) { 54769 return n2 && D$1(e2, Q$1(e2), n2); 54770 } 54771 var me = Et; 54772 function bt(n2) { 54773 var e2 = []; 54774 if (n2 != null) for (var a2 in Object(n2)) e2.push(a2); 54775 return e2; 54776 } 54777 var ge = bt; 54778 var Dt = Object.prototype, Mt = Dt.hasOwnProperty; 54779 function Bt(n2) { 54780 if (!N$1(n2)) return ge(n2); 54781 var e2 = Ve$1(n2), a2 = []; 54782 for (var t2 in n2) t2 == "constructor" && (e2 || !Mt.call(n2, t2)) || a2.push(t2); 54783 return a2; 54784 } 54785 var fe = Bt; 54786 function Tt(n2) { 54787 return _$1(n2) ? ze$1(n2, true) : fe(n2); 54788 } 54789 var w$1 = Tt; 54790 function xt(n2, e2) { 54791 return n2 && D$1(e2, w$1(e2), n2); 54792 } 54793 var ve = xt; 54794 var Ae = typeof exports == "object" && exports && !exports.nodeType && exports, de = Ae && typeof module == "object" && module && !module.nodeType && module, Pt = de && de.exports === Ae, he = Pt ? f$1.Buffer : void 0, ye = he ? he.allocUnsafe : void 0; 54795 function Ft(n2, e2) { 54796 if (e2) return n2.slice(); 54797 var a2 = n2.length, t2 = ye ? ye(a2) : new n2.constructor(a2); 54798 return n2.copy(t2), t2; 54799 } 54800 var Se = Ft; 54801 function Nt(n2, e2) { 54802 var a2 = -1, t2 = n2.length; 54803 for (e2 || (e2 = Array(t2)); ++a2 < t2; ) e2[a2] = n2[a2]; 54804 return e2; 54805 } 54806 var Ce = Nt; 54807 function It(n2, e2) { 54808 return D$1(n2, Ie$1(n2), e2); 54809 } 54810 var Ee = It; 54811 var Ut = We$1(Object.getPrototypeOf, Object), K = Ut; 54812 var Ot = Object.getOwnPropertySymbols, Rt = Ot ? function(n2) { 54813 for (var e2 = []; n2; ) na$1(e2, Ie$1(n2)), n2 = K(n2); 54814 return e2; 54815 } : _e$1, cn = Rt; 54816 function Gt(n2, e2) { 54817 return D$1(n2, cn(n2), e2); 54818 } 54819 var be = Gt; 54820 function Lt(n2) { 54821 return ke$1(n2, w$1, cn); 54822 } 54823 var sn = Lt; 54824 var wt = Object.prototype, Kt = wt.hasOwnProperty; 54825 function kt(n2) { 54826 var e2 = n2.length, a2 = new n2.constructor(e2); 54827 return e2 && typeof n2[0] == "string" && Kt.call(n2, "index") && (a2.index = n2.index, a2.input = n2.input), a2; 54828 } 54829 var De = kt; 54830 function Ht(n2) { 54831 var e2 = new n2.constructor(n2.byteLength); 54832 return new wa(e2).set(new wa(n2)), e2; 54833 } 54834 var k$1 = Ht; 54835 function Vt(n2, e2) {
54836 var a2 = e2 ? k$1(n2.buffer) : n2.buffer; 54837 return new n2.constructor(a2, n2.byteOffset, n2.byteLength); 54838 } 54839 var Me = Vt; 54840 var jt$1 = /\w*$/; 54841 function zt(n2) { 54842 var e2 = new n2.constructor(n2.source, jt$1.exec(n2)); 54843 return e2.lastIndex = n2.lastIndex, e2; 54844 } 54845 var Be = zt; 54846 var Te = v$1 ? v$1.prototype : void 0, xe = Te ? Te.valueOf : void 0; 54847 function Zt(n2) { 54848 return xe ? Object(xe.call(n2)) : {}; 54849 } 54850 var Pe = Zt; 54851 function Yt$1(n2, e2) { 54852 var a2 = e2 ? k$1(n2.buffer) : n2.buffer; 54853 return new n2.constructor(a2, n2.byteOffset, n2.length); 54854 } 54855 var Fe$1 = Yt$1; 54856 var Wt$1 = "[object Boolean]", Jt = "[object Date]", Xt = "[object Map]", $t = "[object Number]", _t = "[object RegExp]", qt = "[object Set]", Qt$1 = "[object String]", nr = "[object Symbol]", er = "[object ArrayBuffer]", ar = "[object DataView]", tr = "[object Float32Array]", rr = "[object Float64Array]", ir = "[object Int8Array]", or = "[object Int16Array]", ur = "[object Int32Array]", cr = "[object Uint8Array]", sr = "[object Uint8ClampedArray]", lr = "[object Uint16Array]", pr$1 = "[object Uint32Array]"; 54857 function mr(n2, e2, a2) { 54858 var t2 = n2.constructor; 54859 switch (e2) { 54860 case er: 54861 return k$1(n2); 54862 case Wt$1: 54863 case Jt: 54864 return new t2(+n2); 54865 case ar: 54866 return Me(n2, a2); 54867 case tr: 54868 case rr: 54869 case ir: 54870 case or: 54871 case ur: 54872 case cr: 54873 case sr: 54874 case lr: 54875 case pr$1: 54876 return Fe$1(n2, a2); 54877 case Xt: 54878 return new t2(); 54879 case $t: 54880 case Qt$1: 54881 return new t2(n2); 54882 case _t: 54883 return Be(n2); 54884 case qt: 54885 return new t2(); 54886 case nr: 54887 return Pe(n2); 54888 } 54889 } 54890 var Ne = mr; 54891 var Ie = Object.create, gr = /* @__PURE__ */ (function() { 54892 function n2() { 54893 } 54894 return function(e2) { 54895 if (!N$1(e2)) return {}; 54896 if (Ie) return Ie(e2); 54897 n2.prototype = e2; 54898 var a2 = new n2(); 54899 return n2.prototype = void 0, a2; 54900 }; 54901 })(), Ue = gr; 54902 function fr(n2) { 54903 return typeof n2.constructor == "function" && !Ve$1(n2) ? Ue(K(n2)) : {}; 54904 } 54905 var Oe = fr; 54906 var vr = "[object Map]"; 54907 function dr(n2) { 54908 return M$2(n2) && xa(n2) == vr; 54909 } 54910 var Re = dr; 54911 var Ge = Ga && Ga.isMap, hr = Ge ? pa(Ge) : Re, Le = hr; 54912 var yr = "[object Set]"; 54913 function Ar(n2) { 54914 return M$2(n2) && xa(n2) == yr; 54915 } 54916 var we = Ar; 54917 var Ke = Ga && Ga.isSet, Sr = Ke ? pa(Ke) : we, ke = Sr; 54918 var Cr = 1, Er = 2, br = 4, He = "[object Arguments]", Dr = "[object Array]", Mr = "[object Boolean]", Br = "[object Date]", Tr = "[object Error]", Ve = "[object Function]", xr = "[object GeneratorFunction]", Pr = "[object Map]", Fr = "[object Number]", je = "[object Object]", Nr = "[object RegExp]", Ir = "[object Set]", Ur = "[object String]", Or = "[object Symbol]", Rr = "[object WeakMap]", Gr$1 = "[object ArrayBuffer]", Lr = "[object DataView]", wr = "[object Float32Array]", Kr = "[object Float64Array]", kr = "[object Int8Array]", Hr$1 = "[object Int16Array]", Vr$1 = "[object Int32Array]", jr = "[object Uint8Array]", zr = "[object Uint8ClampedArray]", Zr = "[object Uint16Array]", Yr = "[object Uint32Array]", s$2 = {}; 54919 s$2[He] = s$2[Dr] = s$2[Gr$1] = s$2[Lr] = s$2[Mr] = s$2[Br] = s$2[wr] = s$2[Kr] = s$2[kr] = s$2[Hr$1] = s$2[Vr$1] = s$2[Pr] = s$2[Fr] = s$2[je] = s$2[Nr] = s$2[Ir] = s$2[Ur] = s$2[Or] = s$2[jr] = s$2[zr] = s$2[Zr] = s$2[Yr] = true; 54920 s$2[Tr] = s$2[Ve] = s$2[Rr] = false; 54921 function ln(n2, e2, a2, t2, r2, u2) { 54922 var o2, i2 = e2 & Cr, c2 = e2 & Er, p2 = e2 & br; 54923 if (a2 && (o2 = r2 ? a2(n2, t2, r2, u2) : a2(n2)), o2 !== void 0) return o2; 54924 if (!N$1(n2)) return n2; 54925 var g2 = u$1(n2); 54926 if (g2) { 54927 if (o2 = De(n2), !i2) return Ce(n2, o2); 54928 } else { 54929 var S2 = xa(n2), C2 = S2 == Ve || S2 == xr; 54930 if (aa$1(n2)) return Se(n2, i2); 54931 if (S2 == je || S2 == He || C2 && !r2) { 54932 if (o2 = c2 || C2 ? {} : Oe(n2), !i2) return c2 ? be(n2, ve(o2, n2)) : Ee(n2, me(o2, n2)); 54933 } else { 54934 if (!s$2[S2]) return r2 ? n2 : {}; 54935 o2 = Ne(n2, S2, i2); 54936 } 54937 } 54938 u2 || (u2 = new J$1()); 54939 var T2 = u2.get(n2); 54940 if (T2) return T2; 54941 u2.set(n2, o2), ke(n2) ? n2.forEach(function(v2) { 54942 o2.add(ln(v2, e2, a2, v2, n2, u2)); 54943 }) : Le(n2) && n2.forEach(function(v2, E2) { 54944 o2.set(E2, ln(v2, e2, a2, E2, n2, u2)); 54945 }); 54946 var d2 = p2 ? c2 ? sn : Pa : c2 ? w$1 : Q$1, y2 = g2 ? void 0 : d2(n2); 54947 return pe(y2 || n2, function(v2, E2) { 54948 y2 && (E2 = v2, v2 = n2[E2]), L$1(o2, E2, ln(v2, e2, a2, E2, n2, u2)); 54949 }), o2; 54950 } 54951 var ze = ln; 54952 function Wr(n2) { 54953 var e2 = n2 == null ? 0 : n2.length; 54954 return e2 ? n2[e2 - 1] : void 0; 54955 } 54956 var Ze = Wr; 54957 function Jr(n2, e2, a2) { 54958 var t2 = -1, r2 = n2.length; 54959 e2 < 0 && (e2 = -e2 > r2 ? 0 : r2 + e2), a2 = a2 > r2 ? r2 : a2, a2 < 0 && (a2 += r2), r2 = e2 > a2 ? 0 : a2 - e2 >>> 0, e2 >>>= 0; 54960 for (var u2 = Array(r2); ++t2 < r2; ) u2[t2] = n2[t2 + e2]; 54961 return u2; 54962 } 54963 var Ye = Jr; 54964 function Xr(n2, e2) { 54965 return e2.length < 2 ? n2 : W(n2, Ye(e2, 0, -1)); 54966 } 54967 var We = Xr; 54968 function $r(n2, e2) { 54969 return e2 = sa(e2, n2), n2 = We(n2, e2), n2 == null || delete n2[F$1(Ze(e2))]; 54970 } 54971 var Je = $r; 54972 var _r = "[object Object]", qr = Function.prototype, Qr = Object.prototype, Xe = qr.toString, ni = Qr.hasOwnProperty, ei = Xe.call(Object); 54973 function ai(n2) { 54974 if (!M$2(n2) || A$1(n2) != _r) return false;
54975 var e2 = K(n2); 54976 if (e2 === null) return true; 54977 var a2 = ni.call(e2, "constructor") && e2.constructor; 54978 return typeof a2 == "function" && a2 instanceof a2 && Xe.call(a2) == ei; 54979 } 54980 var $e = ai; 54981 function ti(n2) { 54982 return $e(n2) ? void 0 : n2; 54983 } 54984 var _e = ti; 54985 function ri(n2) { 54986 var e2 = n2 == null ? 0 : n2.length; 54987 return e2 ? Ua(n2, 1) : []; 54988 } 54989 var qe = ri; 54990 function ii(n2) { 54991 return Or$1(xr$1(n2, void 0, qe), n2 + ""); 54992 } 54993 var pn = ii; 54994 var oi = 1, ui = 2, ci = 4; 54995 pn(function(n2, e2) { 54996 var a2 = {}; 54997 if (n2 == null) return a2; 54998 var t2 = false; 54999 e2 = D$2(e2, function(u2) { 55000 return u2 = sa(u2, n2), t2 || (t2 = u2.length > 1), u2; 55001 }), D$1(n2, sn(n2), a2), t2 && (a2 = ze(a2, oi | ui | ci, _e)); 55002 for (var r2 = e2.length; r2--; ) Je(a2, e2[r2]); 55003 return a2; 55004 }); 55005 function li(n2, e2, a2, t2) { 55006 if (!N$1(n2)) return n2; 55007 e2 = sa(e2, n2); 55008 for (var r2 = -1, u2 = e2.length, o2 = u2 - 1, i2 = n2; i2 != null && ++r2 < u2; ) { 55009 var c2 = F$1(e2[r2]), p2 = a2; 55010 if (c2 === "__proto__" || c2 === "constructor" || c2 === "prototype") return n2; 55011 if (r2 != o2) { 55012 var g2 = i2[c2]; 55013 p2 = t2 ? t2(g2, c2, i2) : void 0, p2 === void 0 && (p2 = N$1(g2) ? g2 : q$1(e2[r2 + 1]) ? [] : {}); 55014 } 55015 L$1(i2, c2, p2), i2 = i2[c2]; 55016 } 55017 return n2; 55018 } 55019 var na = li; 55020 function pi(n2, e2, a2) { 55021 for (var t2 = -1, r2 = e2.length, u2 = {}; ++t2 < r2; ) { 55022 var o2 = e2[t2], i2 = W(n2, o2); 55023 a2(i2, o2) && na(u2, sa(o2, n2), i2); 55024 } 55025 return u2; 55026 } 55027 var ea = pi; 55028 function mi(n2, e2) { 55029 return ea(n2, e2, function(a2, t2) { 55030 return pr$2(n2, t2); 55031 }); 55032 } 55033 var aa = mi; 55034 pn(function(n2, e2) { 55035 return n2 == null ? {} : aa(n2, e2); 55036 }); 55037 Un$1.extend($i); 55038 Un$1.extend(yi); 55039 var la = (n2) => typeof n2 == "string" || n2 instanceof Date ? Un$1(n2) : n2; 55040 reactExports.createContext(void 0); 55041 dt$2.div` 55042 position: relative; 55043`; 55044 dt$2.div` 55045 position: absolute; 55046 top: calc(100% + 8px); 55047 z-index: 1; 55048 55049 width: 100%; 55050`; 55051 dt$2.span` 55052 max-width: 70%; 55053 55054 overflow: hidden; 55055 text-overflow: ellipsis; 55056 white-space: nowrap; 55057`; 55058 dt$2.span` 55059 margin-left: 8px; 55060 55061 white-space: nowrap; 55062 text-overflow: ellipsis; 55063 font-size: 14px; 55064 color: var(--text-secondary); 55065 overflow: hidden; 55066`; 55067 dt$2.div` 55068 display: flex; 55069 align-items: center; 55070`; 55071 dt$2.div` 55072 aspect-ratio: 20/14; 55073 width: ${({ $size: n2 }) => n2}px; 55074 max-height: fit-content; 55075 background-color: var(--bg-quaternary); 55076 display: flex; 55077 align-items: center; 55078 justify-content: center; 55079 color: var(--text-primary-invert); 55080 font-size: calc(${({ $size: n2 }) => n2}px / 2); 55081 font-weight: var(--font-weight-600); 55082`; 55083 dt$2.div` 55084 margin-left: var(--space-300); 55085 55086 font-size: var(--font-size-400); 55087 line-height: 150%; 55088`; 55089 dt$2.span` 55090 font-size: ${({ $size: n2 }) => n2}px; 55091 /* NOTE: This font is provided by "country-flag-emoji-polyfill" package when unicode emoji flags are not supported */ 55092 font-family: 'Twemoji Country Flags', 'Helvetica', 'Comic Sans', serif; 55093`; 55094 Un$1.extend(_i); 55095 Un$1.extend(Xi); 55096 Un$1.extend($i); 55097 var qi = ({ date: n2, format: e2 = "DD MMM YYYY", utc: a2 = false }) => { 55098 let t2 = la(n2); 55099 return t2.isValid() ? (a2 && (t2 = t2.utc()), jsxRuntimeExports.jsx("time", { dateTime: t2.toISOString(), children: t2.format(e2) })) : null; 55100 }; 55101 dt$2.span` 55102 font-size: 0.75em; 55103 color: var(--text-secondary); 55104`; 55105 dt$2.span` 55106 ${({ $value: n2 }) => n2 > 0 && lt$2` 55107 color: var(--text-success); 55108 `} 55109 55110 ${({ $value: n2 }) => n2 < 0 && lt$2` 55111 color: var(--text-critical); 55112 `} 55113`; 55114 dt$2.span` 55115 ${({ $value: n2 }) => n2 < 0 && lt$2` 55116 color: var(--text-critical); 55117 `} 55118`; 55119 var dn = 41; 55120 dt$2.div` 55121 cursor: pointer; 55122 position: relative; 55123`; 55124 dt$2(Input$2)` 55125 pointer-events: ${({ $isSearching: n2 }) => n2 ? "auto" : "none"}; 55126 padding-left: ${dn}px; 55127 padding-right: ${dn}px; 55128`; 55129 dt$2.div` 55130 height: 50vh; 55131 overflow-y: auto; 55132 55133 -ms-overflow-style: none; 55134 scrollbar-width: none; 55135 55136 &::-webkit-scrollbar {
55137 display: none; 55138 } 55139 55140 ${mediaQueries.tablet} { 55141 height: auto; 55142 max-height: 300px; 55143 } 55144`; 55145 dt$2.div` 55146 display: flex; 55147 align-items: center; 55148 justify-content: center; 55149 padding: var(--space-600); 55150 color: var(--text-secondary); 55151`; 55152 dt$2.span` 55153 display: flex; 55154 align-items: center; 55155 gap: var(--space-300); 55156`; 55157 dt$2.div` 55158 &:not(:first-child) { 55159 border-top: 1px solid var(--bg-tertiary); 55160 } 55161`; 55162 dt$2.div` 55163 ${e.body2xsMedium}; 55164 padding: var(--space-300) var(--space-400); 55165 color: var(--text-secondary); 55166 text-transform: uppercase; 55167`; 55168 dt$2(Root$2)` 55169 padding: 0 var(--space-300) var(--space-300); 55170 border-bottom: 1px solid var(--bg-tertiary); 55171 55172 ${mediaQueries.tablet} { 55173 display: none; 55174 } 55175`; 55176 dt$2(Box$1)` 55177 cursor: text; 55178 position: relative; 55179`; 55180 dt$2(Input$2)` 55181 padding-left: ${dn}px; 55182 padding-right: ${dn}px; 55183`; 55184 new Set(Am); 55185 /*! Bundled license information: 55186 55187 countries-list/mjs/index.js: 55188 (*! countries-list v3.1.1 by Annexare | MIT *) 55189 */ 55190 /*! ***************************************************************************** 55191 Copyright (c) Microsoft Corporation. 55192 55193 Permission to use, copy, modify, and/or distribute this software for any 55194 purpose with or without fee is hereby granted. 55195 55196 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 55197 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 55198 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 55199 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 55200 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 55201 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 55202 PERFORMANCE OF THIS SOFTWARE. 55203 ***************************************************************************** */ 55204 var s$1 = function() { 55205 return s$1 = Object.assign || function(e3) { 55206 for (var t2, r2 = 1, o2 = arguments.length; r2 < o2; r2++) for (var n2 in t2 = arguments[r2]) Object.prototype.hasOwnProperty.call(t2, n2) && (e3[n2] = t2[n2]); 55207 return e3; 55208 }, s$1.apply(this, arguments); 55209 }; 55210 var f, p = function(e3) { 55211 var t2; 55212 e3 ? (function(e4) { 55213 if (e4) for (; e4.lastChild; ) e4.lastChild.remove(); 55214 })("string" == typeof e3 ? document.getElementById(e3) : e3) : (t2 = document.querySelector(".grecaptcha-badge")) && t2.parentNode && document.body.removeChild(t2.parentNode); 55215 }, d = function(e3, t2) { 55216 p(t2), window.___grecaptcha_cfg = void 0; 55217 var r2 = document.querySelector("#" + e3); 55218 r2 && r2.remove(), (function() { 55219 var e4 = document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]'); 55220 e4 && e4.remove(); 55221 })(); 55222 }, y = function(e3) { 55223 var t2 = e3.render, r2 = e3.onLoadCallbackName, o2 = e3.language, n2 = e3.onLoad, a2 = e3.useRecaptchaNet, c2 = e3.useEnterprise, i2 = e3.scriptProps, s2 = void 0 === i2 ? {} : i2, u2 = s2.nonce, l2 = void 0 === u2 ? "" : u2, f2 = s2.defer, p2 = void 0 !== f2 && f2, d2 = s2.async, y2 = void 0 !== d2 && d2, m2 = s2.id, v2 = void 0 === m2 ? "" : m2, b2 = s2.appendTo, h2 = v2 || "google-recaptcha-v3"; 55224 if ((function(e4) { 55225 return !!document.querySelector("#" + e4); 55226 })(h2)) n2(); 55227 else { 55228 var g2 = (function(e4) { 55229 return "https://www." + (e4.useRecaptchaNet ? "recaptcha.net" : "google.com") + "/recaptcha/" + (e4.useEnterprise ? "enterprise.js" : "api.js"); 55230 })({ useEnterprise: c2, useRecaptchaNet: a2 }), S2 = document.createElement("script"); 55231 S2.id = h2, S2.src = g2 + "?render=" + t2 + ("explicit" === t2 ? "&onload=" + r2 : "") + (o2 ? "&hl=" + o2 : ""), l2 && (S2.nonce = l2), S2.defer = !!p2, S2.async = !!y2, S2.onload = n2, ("body" === b2 ? document.body : document.getElementsByTagName("head")[0]).appendChild(S2); 55232 } 55233 }, m = function(e3) { 55234 console.warn(e3); 55235 }; 55236 !(function(e3) { 55237 e3.SCRIPT_NOT_AVAILABLE = "Recaptcha script is not available"; 55238 })(f || (f = {})); 55239 var v = reactExports.createContext({ executeRecaptcha: function() { 55240 throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called
55240inside component wrapped by GoogleRecaptchaProvider"); 55241 } }); 55242 v.Consumer; 55243 function h(t2) { 55244 var i2 = t2.reCaptchaKey, u2 = t2.useEnterprise, l2 = void 0 !== u2 && u2, p2 = t2.useRecaptchaNet, b2 = void 0 !== p2 && p2, h2 = t2.scriptProps, g2 = t2.language, S2 = t2.container, w2 = t2.children, $2 = reactExports.useState(null), C2 = $2[0], P2 = $2[1], x2 = reactExports.useRef(i2), E2 = JSON.stringify(h2), R2 = JSON.stringify(null == S2 ? void 0 : S2.parameters); 55245 reactExports.useEffect((function() { 55246 if (i2) { 55247 var e3 = (null == h2 ? void 0 : h2.id) || "google-recaptcha-v3", t3 = (null == h2 ? void 0 : h2.onLoadCallbackName) || "onRecaptchaLoadCallback"; 55248 window[t3] = function() { 55249 var e4 = l2 ? window.grecaptcha.enterprise : window.grecaptcha, t4 = s$1({ badge: "inline", size: "invisible", sitekey: i2 }, (null == S2 ? void 0 : S2.parameters) || {}); 55250 x2.current = e4.render(null == S2 ? void 0 : S2.element, t4); 55251 }; 55252 return y({ render: (null == S2 ? void 0 : S2.element) ? "explicit" : i2, onLoadCallbackName: t3, useEnterprise: l2, useRecaptchaNet: b2, scriptProps: h2, language: g2, onLoad: function() { 55253 if (window && window.grecaptcha) { 55254 var e4 = l2 ? window.grecaptcha.enterprise : window.grecaptcha; 55255 e4.ready((function() { 55256 P2(e4); 55257 })); 55258 } else m("<GoogleRecaptchaProvider /> " + f.SCRIPT_NOT_AVAILABLE); 55259 } }), function() { 55260 d(e3, null == S2 ? void 0 : S2.element); 55261 }; 55262 } 55263 m("<GoogleReCaptchaProvider /> recaptcha key not provided"); 55264 }), [l2, b2, E2, R2, g2, i2, null == S2 ? void 0 : S2.element]); 55265 var M2 = reactExports.useCallback((function(e3) { 55266 if (!C2 || !C2.execute) throw new Error("<GoogleReCaptchaProvider /> Google Recaptcha has not been loaded"); 55267 return C2.execute(x2.current, { action: e3 }); 55268 }), [C2, x2]), N2 = reactExports.useMemo((function() { 55269 return { executeRecaptcha: C2 ? M2 : void 0, container: null == S2 ? void 0 : S2.element }; 55270 }), [M2, C2, null == S2 ? void 0 : S2.element]); 55271 return e$3.createElement(v.Provider, { value: N2 }, w2); 55272 } 55273 var g = function() { 55274 return reactExports.useContext(v); 55275 }; 55276 function w(e3, t2) { 55277 return e3(t2 = { exports: {} }, t2.exports), t2.exports; 55278 /** @license React v16.13.1 55279 * react-is.production.min.js 55280 * 55281 * Copyright (c) Facebook, Inc. and its affiliates. 55282 * 55283 * This source code is licensed under the MIT license found in the 55284 * LICENSE file in the root directory of this source tree. 55285 */ 55286 } 55287 var $$1 = "function" == typeof Symbol && Symbol.for, C$1 = $$1 ? Symbol.for("react.element") : 60103, P = $$1 ? Symbol.for("react.portal") : 60106, x = $$1 ? Symbol.for("react.fragment") : 60107, E = $$1 ? Symbol.for("react.strict_mode") : 60108, R = $$1 ? Symbol.for("react.profiler") : 60114, M$1 = $$1 ? Symbol.for("react.provider") : 60109, N = $$1 ? Symbol.for("react.context") : 60110, O = $$1 ? Symbol.for("react.async_mode") : 60111, _ = $$1 ? Symbol.for("react.concurrent_mode") : 60111, T = $$1 ? Symbol.for("react.forward_ref") : 60112, j = $$1 ? Symbol.for("react.suspense")
vendor: 1,122 bytes, lines 55287-55320
55287: 60113, L = $$1 ? Symbol.for("react.suspense_list") : 60120, k = $$1 ? Symbol.for("react.memo") : 60115, F = $$1 ? Symbol.for("react.lazy") : 60116, A = $$1 ? Symbol.for("react.block") : 60121, V = $$1 ? Symbol.for("react.fundamental") : 60117, z = $$1 ? Symbol.for("react.responder") : 60118, G = $$1 ? Symbol.for("react.scope") : 60119; 55288 function I(e3) { 55289 if ("object" == typeof e3 && null !== e3) { 55290 var t2 = e3.$$typeof; 55291 switch (t2) { 55292 case C$1: 55293 switch (e3 = e3.type) { 55294 case O: 55295 case _: 55296 case x: 55297 case R: 55298 case E: 55299 case j: 55300 return e3; 55301 default: 55302 switch (e3 = e3 && e3.$$typeof) { 55303 case N: 55304 case T: 55305 case F: 55306 case k: 55307 case M$1: 55308 return e3; 55309 default: 55310 return t2; 55311 } 55312 } 55313 case P: 55314 return t2; 55315 } 55316 } 55317 } 55318 function D(e3) { 55319 return I(e3) === _; 55320 }
55321 var q = { AsyncMode: O, ConcurrentMode: _, ContextConsumer: N, ContextProvider: M$1, Element: C$1, ForwardRef: T, Fragment: x, Lazy: F, Memo: k, Portal: P, Profiler: R, StrictMode: E, Suspense: j, isAsyncMode: function(e3) { 55322 return D(e3) || I(e3) === O; 55323 }, isConcurrentMode: D, isContextConsumer: function(e3) { 55324 return I(e3) === N; 55325 }, isContextProvider: function(e3) { 55326 return I(e3) === M$1; 55327 }, isElement: function(e3) { 55328 return "object" == typeof e3 && null !== e3 && e3.$$typeof === C$1; 55329 }, isForwardRef: function(e3) { 55330 return I(e3) === T; 55331 }, isFragment: function(e3) { 55332 return I(e3) === x; 55333 }, isLazy: function(e3) { 55334 return I(e3) === F; 55335 }, isMemo: function(e3) { 55336 return I(e3) === k; 55337 }, isPortal: function(e3) { 55338 return I(e3) === P; 55339 }, isProfiler: function(e3) { 55340 return I(e3) === R; 55341 }, isStrictMode: function(e3) { 55342 return I(e3) === E; 55343 }, isSuspense: function(e3) { 55344 return I(e3) === j; 55345 }, isValidElementType: function(e3) { 55346 return "string" == typeof e3 || "function" == typeof e3 || e3 === x || e3 === _ || e3 === R || e3 === E || e3 === j || e3 === L || "object" == typeof e3 && null !== e3 && (e3.$$typeof === F || e3.$$typeof === k || e3.$$typeof === M$1 || e3.$$typeof === N || e3.$$typeof === T || e3.$$typeof === V || e3.$$typeof === z || e3.$$typeof === G || e3.$$typeof === A); 55347 }, typeOf: I }, B = w((function(e3, t2) { 55348 })), J = (B.AsyncMode, B.ConcurrentMode, B.ContextConsumer, B.ContextProvider, B.Element, B.ForwardRef, B.Fragment, B.Lazy, B.Memo, B.Portal, B.Profiler, B.StrictMode, B.Suspense, B.isAsyncMode, B.isConcurrentMode, B.isContextConsumer, B.isContextProvider, B.isElement, B.isForwardRef, B.isFragment, B.isLazy, B.isMemo, B.isPortal, B.isProfiler, B.isStrictMode, B.isSuspense, B.isValidElementType, B.typeOf, w((function(e3) { 55349 e3.exports = q; 55350 }))), H = { $$typeof: true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }, Q = {}; 55351 Q[J.ForwardRef] = { $$typeof: true, render: true, defaultProps: true, displayName: true, propTypes: true }, Q[J.Memo] = H; 55352 var Z = "stripe-element"; 55353 reactExports.createContext(void 0); 55354 var vn = 200, Sn = mt$2` 55355 0%, 100% { background-color: var(--bg-secondary); } 55356 50% { background-color: var(--bg-tertiary); } 55357`, C = dt$2.div` 55358 background: var(--bg-secondary); 55359 border-radius: var(--panel-radius-normal); 55360 height: ${({ $height: e2 }) => e2 != null ? e2 : 56}px; 55361 animation: ${Sn} 1.5s ease-in-out infinite; 55362 will-change: background-color; 55363`, U = dt$2.div` 55364 display: grid; 55365 gap: 12px; 55366 ${({ $columns: e2 }) => e2 && `grid-template-columns: ${e2};`} 55367`, M = dt$2.div` 55368 display: grid; 55369 align-items: start; 55370 55371 > * { 55372 grid-area: 1 / 1; 55373 } 55374`, $ = dt$2.div` 55375 // PayPal's Smart Button iframe promotes itself to its own paint layer, so 55376 // relying on source-order stacking lets it bleed through. Match the same 55377 // ceiling the PayPal disable overlay uses (PAYPAL_Z_INDEX + 1). 55378 position: relative; 55379 z-index: ${vn + 1}; 55380 max-height: ${({ $isReady: e2 }) => e2 ? 0 : 600}px; 55381 overflow: hidden; 55382 opacity: ${({ $isReady: e2 }) => e2 ? 0 : 1}; 55383 pointer-events: ${({ $isReady: e2 }) => e2 ? "none" : "auto"}; 55384 transition: 55385 opacity 0.2s ease, 55386 max-height 0s linear 0.2s; 55387`; 55388 dt$2.div` 55389 position: relative; 55390 top: 2px; 55391 55392 line-height: var(--font-line-height-400); 55393 text-align: center; 55394 font-weight: var(--font-weight-600); 55395`; 55396 dt$2.label` 55397 display: block; 55398 padding: var(--space-100); 55399 55400 ${mediaQueries.tablet} { 55401 padding: var(--space-150); 55402 } 55403`; 55404 dt$2.input` 55405 clip: rect(1px, 1px, 1px, 1px); 55406 55407 position: absolute; 55408`; 55409 dt$2.div` 55410 position: relative; 55411 display: flex; 55412 align-items: center; 55413 justify-content: center; 55414 55415 height: 48px; 55416 padding: 0 var(--space-200); 55417 55418 color: var(--text-primary); 55419 background: var(--bg-secondary); 55420 border-radius: var(--input-radius-normal); 55421 cursor: pointer; 55422 55423 input:hover + & { 55424 background: var(--bg-secondary-hover); 55425 } 55426 55427 input:focus-visible + & { 55428 background: var(--bg-secondary-hover); 55429 } 55430 55431 input:checked + & { 55432 background: var(--bg-secondary-hover); 55433 border: 2px solid var(--text-primary); 55434 } 55435 55436 ${mediaQueries.tablet} { 55437 padding: 0 var(--space-400); 55438 } 55439`; 55440 dt$2.div` 55441 display: flex; 55442 flex-direction: column; 55443 55444 ${mediaQueries.tablet} { 55445 flex-direction: row; 55446 } 55447`; 55448 dt$2.div` 55449 width: calc(100% / 2); 55450 55451 ${mediaQueries.tablet} { 55452 width: auto; 55453 flex: 1; 55454 } 55455`; 55456 dt$2.div` 55457 padding: 0; 55458 margin-top: var(--space-400); 55459 55460 ${mediaQueries.tablet} { 55461 padding: var(--space-200); 55462 margin-top: 0; 55463 } 55464`; 55465 dt$2.div` 55466 display: flex; 55467 flex-direction: row; 55468 justify-content: flex-start; 55469 flex: 1; 55470 flex-wrap: wrap; 55471 55472 margin: var(--space-n100); 55473 55474 ${mediaQueries.tablet} { 55475 margin: var(--space-n150); 55476 } 55477`; 55478 var Nn = 200; 55479 dt$2.div` 55480 position: relative; 55481 55482 ${({ $visible: e2 }) => e2 && lt$2` 55483 width: 100%; 55484 `} 55485 55486 paypal-button { 55487 --paypal-button-border-radius: var(--button-radius-normal); 55488 55489 display: block; 55490 width: 100%; 55491 max-width: none; 55492 height: 54px; 55493 margin: var(--space-50) 0; 55494 vertical-align: top; 55495 } 55496 55497 paypal-button[hidden] { 55498 display: none; 55499 } 55500`; 55501 dt$2.div` 55502 position: absolute; 55503 z-index: ${Nn + 1}; 55504 width: 100%; 55505 height: 100%; 55506 background-color: var(--bg-primary); 55507 opacity: 0.8;
55508 cursor: not-allowed; 55509 display: flex; 55510 justify-content: center; 55511 align-items: center; 55512`; 55513 var ft = () => jsxRuntimeExports.jsxs(U, { children: [jsxRuntimeExports.jsx(C, { $height: 200 }), jsxRuntimeExports.jsx(C, {}), jsxRuntimeExports.jsx(C, {})] }); 55514 var gt = dt$2.div` 55515 margin-bottom: var(--space-100); 55516`, ht = dt$2.div` 55517 width: 100%; 55518`; 55519 reactExports.forwardRef(({ isLoading: e2 }, t2) => jsxRuntimeExports.jsxs(M, { children: [jsxRuntimeExports.jsx(gt, { children: jsxRuntimeExports.jsx(ht, { id: Z, ref: t2, "data-testid": "StripePaymentElement.StripeContainer" }) }), jsxRuntimeExports.jsx($, { $isReady: !e2, children: jsxRuntimeExports.jsx(ft, {}) })] })); 55520 dt$2.div` 55521 position: relative; 55522 flex: 1; 55523 display: flex; 55524 flex-direction: column; 55525 margin-top: var(--space-1100); 55526 justify-content: flex-end; 55527`; 55528 var pr = 48; 55529 dt$2.div` 55530 position: relative; 55531 flex: 2; 55532 display: flex; 55533 flex-direction: column; 55534 55535 padding: ${32 + pr}px 0 16px; 55536 margin: 0 16px; 55537 55538 ${mediaQueries.tablet} { 55539 padding: var(--space-800) 0; 55540 margin: 0 var(--space-400); 55541 } 55542 55543 ${mediaQueries.laptopS} { 55544 max-width: 600px; 55545 margin: 0 var(--space-800) 0 var(--space-400); 55546 } 55547 55548 ${mediaQueries.laptop} { 55549 margin: 0 var(--space-1400) 0 var(--space-400); 55550 } 55551`; 55552 dt$2.div` 55553 display: flex; 55554 flex-direction: column-reverse; 55555 margin-top: var(--space-800); 55556 55557 ${mediaQueries.tablet} { 55558 flex-direction: column; 55559 } 55560`; 55561 dt$2.div` 55562 display: flex; 55563 flex-direction: column-reverse; 55564 width: 100%; 55565 55566 ${mediaQueries.tablet} { 55567 flex-direction: row; 55568 align-items: center; 55569 justify-content: space-between; 55570 } 55571`; 55572 dt$2.div` 55573 display: flex; 55574 justify-content: center; 55575 flex-shrink: 0; 55576 margin-right: var(--space-400); 55577`; 55578 dt$2.div` 55579 margin-bottom: var(--space-400); 55580 55581 ${mediaQueries.tablet} { 55582 margin-bottom: 0; 55583 margin-left: auto; 55584 min-width: 230px; 55585 } 55586`; 55587 dt$2.div` 55588 margin-bottom: var(--space-400); 55589 font-size: var(--font-size-200); 55590 text-align: center; 55591 color: var(--text-secondary); 55592 55593 ${mediaQueries.tablet} { 55594 margin-top: var(--space-400); 55595 margin-bottom: 0; 55596 text-align: right; 55597 } 55598`; 55599 dt$2.header` 55600 overflow: hidden; 55601`; 55602 dt$2.div` 55603 display: flex; 55604 justify-content: center; 55605 align-items: flex-start; 55606 margin-bottom: var(--space-800); 55607 55608 ${mediaQueries.tablet} { 55609 margin-bottom: var(--space-1000); 55610 } 55611`; 55612 dt$2.h1` 55613 display: inline-flex; 55614 align-items: center; 55615 color: var(--text-primary); 55616`; 55617 dt$2.div` 55618 position: fixed; 55619 display: flex; 55620 flex-direction: column; 55621 align-items: center; 55622 justify-content: flex-start; 55623 top: 0; 55624 left: 0; 55625 z-index: 2; 55626 55627 width: 100%; 55628 55629 background-color: var(--bg-secondary); 55630 font-size: var(--font-size-300); 55631 color: var(--text-primary); 55632 55633 ${({ $isOpen: e2 }) => e2 && lt$2` 55634 height: 100vh; 55635 55636 overflow-y: auto; 55637 -webkit-overflow-scrolling: touch; 55638 `}; 55639`; 55640 dt$2.div` 55641 display: flex; 55642 align-items: center; 55643 justify-content: space-between; 55644 cursor: pointer; 55645 padding: var(--space-300) var(--space-600); 55646 55647 width: 100%; 55648`; 55649 dt$2.div` 55650 margin-right: var(--space-200); 55651`; 55652 dt$2.div` 55653 flex: 1; 55654 display: flex; 55655 align-items: center; 55656 55657 font-size: var(--font-size-300); 55658 line-height: var(--font-line-height-400); 55659`; 55660 dt$2.div` 55661 margin-left: var(--space-250); 55662`; 55663 dt$2.div` 55664 padding: var(--space-800) 0 var(--space-200); 55665 width: 100%; 55666`; 55667 dt$2.div` 55668 display: none; 55669 55670 ${mediaQueries.tablet} { 55671 position: relative; 55672 display: block; 55673 55674 width: 100%; 55675 } 55676 55677 ${mediaQueries.laptopS} { 55678 margin-right: var(--space-400); 55679 max-width: 400px; 55680 min-width: 400px; 55681 flex: 1; 55682 } 55683`; 55684 dt$2.div` 55685 margin-left: auto; 55686 margin-right: auto; 55687 min-height: 100vh; 55688 55689 ${mediaQueries.laptopS} { 55690 display: flex; 55691 justify-content: center; 55692 55693 max-width: 1180px; 55694 } 55695`; 55696 var Wt = { development: "6Ldg--IqAAAAAEDTR39qTXmZ96hKrap-MwPiO-_h", staging: "6Ldg--IqAAAAAEDTR39qTXmZ96hKrap-MwPiO-_h", production: "6LcUIoYlAAAAALE9OrjdIcUfeYTpTq5RlXh5HuZt" }[getCurrentEnvironment()], Fe = "recaptcha-container", Yt = "x-recaptcha-token"; 55697 var jt = dt$2.div` 55698 display: none; 55699`; 55700 var Qt = reactExports.createContext({ executeRecaptcha: () => Promise.resolve(""), addRecaptchaRequestInterceptor: () => Promise.resolve(false), removeRecaptchaRequestInterceptor: () => Promise.resolve(false) }), Vr = ({ children: e2 }) => { 55701 let t2 = g(), r2 = reactExports.useRef(), n2 = !isNil(r2.current), a2 = (p2) => (y2) => __async(null, null, function* () { 55702 if (t2.executeRecaptcha && y2.headers) try { 55703 let u2 = yield t2.executeRecaptcha(p2); 55704 y2.headers[Yt] = u2; 55705 } catch (e3) { 55706 return y2; 55707 } 55708 return y2; 55709 }), o2 = (p2, y2) => __async(null, null, function* () { 55710 return n2 ? false : (r2.current = p2.addRequestInterceptor(a2(y2)), true); 55711 }), d2 = (p2) => __async(null, null, function* () { 55712 return n2 ? (p2.removeRequestInterceptor(r2.current), r2.current = null, true) : false;
vendor: 45,385 bytes, lines 55713-56967
55713 }), l2 = reactExports.useMemo(() => __spreadProps(__spreadValues({}, t2), { addRecaptchaRequestInterceptor: o2, removeRecaptchaRequestInterceptor: d2 }), [t2]); 55714 return jsxRuntimeExports.jsx(Qt.Provider, { value: l2, children: e2 }); 55715 }, Hr = ({ children: e2 }) => jsxRuntimeExports.jsxs(h, { reCaptchaKey: Wt, useEnterprise: true, scriptProps: { defer: true }, container: { element: Fe, parameters: {} }, children: [jsxRuntimeExports.jsx(jt, { id: Fe }), jsxRuntimeExports.jsx(Vr, { children: e2 })] }), Gr = () => reactExports.useContext(Qt); 55716 reactExports.createContext(void 0); 55717 var map; 55718 try { 55719 map = Map; 55720 } catch (_2) { 55721 } 55722 var set; 55723 try { 55724 set = Set; 55725 } catch (_2) { 55726 } 55727 function baseClone(src, circulars, clones) { 55728 if (!src || typeof src !== "object" || typeof src === "function") { 55729 return src; 55730 } 55731 if (src.nodeType && "cloneNode" in src) { 55732 return src.cloneNode(true); 55733 } 55734 if (src instanceof Date) { 55735 return new Date(src.getTime()); 55736 } 55737 if (src instanceof RegExp) { 55738 return new RegExp(src); 55739 } 55740 if (Array.isArray(src)) { 55741 return src.map(clone); 55742 } 55743 if (map && src instanceof map) { 55744 return new Map(Array.from(src.entries())); 55745 } 55746 if (set && src instanceof set) { 55747 return new Set(Array.from(src.values())); 55748 } 55749 if (src instanceof Object) { 55750 circulars.push(src); 55751 var obj = Object.create(src); 55752 clones.push(obj); 55753 for (var key in src) { 55754 var idx = circulars.findIndex(function(i2) { 55755 return i2 === src[key]; 55756 }); 55757 obj[key] = idx > -1 ? clones[idx] : baseClone(src[key], circulars, clones); 55758 } 55759 return obj; 55760 } 55761 return src; 55762 } 55763 function clone(src) { 55764 return baseClone(src, [], []); 55765 } 55766 const toString = Object.prototype.toString; 55767 const errorToString = Error.prototype.toString; 55768 const regExpToString = RegExp.prototype.toString; 55769 const symbolToString = typeof Symbol !== "undefined" ? Symbol.prototype.toString : () => ""; 55770 const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/; 55771 function printNumber(val) { 55772 if (val != +val) return "NaN"; 55773 const isNegativeZero = val === 0 && 1 / val < 0; 55774 return isNegativeZero ? "-0" : "" + val; 55775 } 55776 function printSimpleValue(val, quoteStrings = false) { 55777 if (val == null || val === true || val === false) return "" + val; 55778 const typeOf = typeof val; 55779 if (typeOf === "number") return printNumber(val); 55780 if (typeOf === "string") return quoteStrings ? `"${val}"` : val; 55781 if (typeOf === "function") return "[Function " + (val.name || "anonymous") + "]"; 55782 if (typeOf === "symbol") return symbolToString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)"); 55783 const tag = toString.call(val).slice(8, -1); 55784 if (tag === "Date") return isNaN(val.getTime()) ? "" + val : val.toISOString(val); 55785 if (tag === "Error" || val instanceof Error) return "[" + errorToString.call(val) + "]"; 55786 if (tag === "RegExp") return regExpToString.call(val); 55787 return null; 55788 } 55789 function printValue(value, quoteStrings) { 55790 let result = printSimpleValue(value, quoteStrings); 55791 if (result !== null) return result; 55792 return JSON.stringify(value, function(key, value2) { 55793 let result2 = printSimpleValue(this[key], quoteStrings); 55794 if (result2 !== null) return result2; 55795 return value2; 55796 }, 2); 55797 } 55798 let mixed = { 55799 default: "${path} is invalid", 55800 required: "${path} is a required field", 55801 oneOf: "${path} must be one of the following values: ${values}", 55802 notOneOf: "${path} must not be one of the following values: ${values}", 55803 notType: ({ 55804 path, 55805 type, 55806 value, 55807 originalValue 55808 }) => { 55809 let isCast = originalValue != null && originalValue !== value; 55810 let msg = `${path} must be a \`${type}\` type, but the final value was: \`${printValue(value, true)}\`` + (isCast ? ` (cast from the value \`${printValue(originalValue, true)}\`).` : "."); 55811 if (value === null) { 55812 msg += ` 55813 If "null" is intended as an empty value be sure to mark the schema as \`.nullable()\``; 55814 } 55815 return msg; 55816 }, 55817 defined: "${path} must be defined" 55818 }; 55819 let string = { 55820 length: "${path} must be exactly ${length} characters", 55821 min: "${path} must be at least ${min} characters", 55822 max: "${path} must be at most ${max} characters", 55823 matches: '${path} must match the following: "${regex}"', 55824 email: "${path} must be a valid email", 55825 url: "${path} must be a valid URL", 55826 uuid: "${path} must be a valid UUID", 55827 trim: "${path} must be a trimmed string", 55828 lowercase: "${path} must be a lowercase string", 55829 uppercase: "${path} must be a upper case string" 55830 }; 55831 let number = { 55832 min: "${path} must be greater than or equal to ${min}", 55833 max: "${path} must be less than or equal to ${max}", 55834 lessThan: "${path} must be less than ${less}", 55835 moreThan: "${path} must be greater than ${more}", 55836 positive: "${path} must be a positive number", 55837 negative: "${path} must be a negative number", 55838 integer: "${path} must be an integer" 55839 }; 55840 let date = { 55841 min: "${path} field must be later than ${min}", 55842 max: "${path} field must be at earlier than ${max}" 55843 }; 55844 let boolean = { 55845 isValue: "${path} field must be ${value}" 55846 }; 55847 let object = { 55848 noUnknown: "${path} field has unspecified keys: ${unknown}" 55849 }; 55850 let array = { 55851 min: "${path} field must have at least ${min} items", 55852 max: "${path} field must have less than or equal to ${max} items", 55853 length: "${path} must have ${length} items" 55854 }; 55855 const locale = Object.assign(/* @__PURE__ */ Object.create(null), { 55856 mixed, 55857 string, 55858 number, 55859 date, 55860 object, 55861 array, 55862 boolean 55863 }); 55864 var objectProto = Object.prototype; 55865 var hasOwnProperty = objectProto.hasOwnProperty; 55866 function baseHas(object2, key) { 55867 return object2 != null && hasOwnProperty.call(object2, key); 55868 } 55869 function has(object2, path) { 55870 return object2 != null && hasPath(object2, path, baseHas); 55871 } 55872 const isSchema = (obj) => obj && obj.__isYupSchema__; 55873 class Condition { 55874 constructor(refs, options2) { 55875 this.fn = void 0; 55876 this.refs = refs; 55877 this.refs = refs; 55878 if (typeof options2 === "function") { 55879 this.fn = options2; 55880 return; 55881 } 55882 if (!has(options2, "is")) throw new TypeError("`is:` is required for `when()` conditions"); 55883 if (!options2.then && !options2.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions"); 55884 let { 55885 is, 55886 then, 55887 otherwise 55888 } = options2; 55889 let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is); 55890 this.fn = function(...args) { 55891 let options3 = args.pop(); 55892 let schema = args.pop(); 55893 let branch = check(...args) ? then : otherwise; 55894 if (!branch) return void 0; 55895 if (typeof branch === "function") return branch(schema); 55896 return schema.concat(branch.resolve(options3)); 55897 }; 55898 } 55899 resolve(base, options2) { 55900 let values = this.refs.map((ref) => ref.getValue(options2 == null ? void 0 : options2.value, options2 == null ? void 0 : options2.parent, options2 == null ? void 0 : options2.context)); 55901 let schema = this.fn.apply(base, values.concat(base, options2)); 55902 if (schema === void 0 || schema === base) return base; 55903 if (!isSchema(schema)) throw new TypeError("conditions must return a schema object"); 55904 return schema.resolve(options2); 55905 } 55906 } 55907 function toArray(value) { 55908 return value == null ? [] : [].concat(value); 55909 } 55910 function _extends$4() { 55911 _extends$4 = Object.assign || function(target) { 55912 for (var i2 = 1; i2 < arguments.length; i2++) { 55913 var source = arguments[i2]; 55914 for (var key in source) { 55915 if (Object.prototype.hasOwnProperty.call(source, key)) { 55916 target[key] = source[key]; 55917 } 55918 } 55919 } 55920 return target; 55921 }; 55922 return _extends$4.apply(this, arguments); 55923 } 55924 let strReg = /\$\{\s*(\w+)\s*\}/g; 55925 class ValidationError extends Error { 55926 static formatError(message, params) { 55927 const path = params.label || params.path || "this"; 55928 if (path !== params.path) params = _extends$4({}, params, { 55929 path 55930 }); 55931 if (typeof message === "string") return message.replace(strReg, (_2, key) => printValue(params[key])); 55932 if (typeof message === "function") return message(params); 55933 return message; 55934 } 55935 static isError(err) { 55936 return err && err.name === "ValidationError"; 55937 } 55938 constructor(errorOrErrors, value, field, type) { 55939 super(); 55940 this.value = void 0; 55941 this.path = void 0; 55942 this.type = void 0; 55943 this.errors = void 0; 55944 this.params = void 0; 55945 this.inner = void 0; 55946 this.name = "ValidationError"; 55947 this.value = value; 55948 this.path = field; 55949 this.type = type; 55950 this.errors = []; 55951 this.inner = []; 55952 toArray(errorOrErrors).forEach((err) => { 55953 if (ValidationError.isError(err)) { 55954 this.errors.push(...err.errors); 55955 this.inner = this.inner.concat(err.inner.length ? err.inner : err); 55956 } else { 55957 this.errors.push(err); 55958 } 55959 }); 55960 this.message = this.errors.length > 1 ? `${this.errors.length} errors occurred` : this.errors[0]; 55961 if (Error.captureStackTrace) Error.captureStackTrace(this, ValidationError); 55962 } 55963 } 55964 const once = (cb) => { 55965 let fired = false; 55966 return (...args) => { 55967 if (fired) return; 55968 fired = true; 55969 cb(...args); 55970 }; 55971 }; 55972 function runTests(options2, cb) { 55973 let { 55974 endEarly, 55975 tests, 55976 args, 55977 value, 55978 errors, 55979 sort, 55980 path 55981 } = options2; 55982 let callback = once(cb); 55983 let count2 = tests.length; 55984 const nestedErrors = []; 55985 errors = errors ? errors : []; 55986 if (!count2) return errors.length ? callback(new ValidationError(errors, value, path)) : callback(null, value); 55987 for (let i2 = 0; i2 < tests.length; i2++) { 55988 const test2 = tests[i2]; 55989 test2(args, function finishTestRun(err) { 55990 if (err) { 55991 if (!ValidationError.isError(err)) { 55992 return callback(err, value); 55993 } 55994 if (endEarly) { 55995 err.value = value; 55996 return callback(err, value); 55997 } 55998 nestedErrors.push(err); 55999 } 56000 if (--count2 <= 0) { 56001 if (nestedErrors.length) { 56002 if (sort) nestedErrors.sort(sort); 56003 if (errors.length) nestedErrors.push(...errors); 56004 errors = nestedErrors; 56005 } 56006 if (errors.length) { 56007 callback(new ValidationError(errors, value, path), value); 56008 return; 56009 } 56010 callback(null, value); 56011 } 56012 }); 56013 } 56014 } 56015 var propertyExpr; 56016 var hasRequiredPropertyExpr; 56017 function requirePropertyExpr() { 56018 if (hasRequiredPropertyExpr) return propertyExpr; 56019 hasRequiredPropertyExpr = 1; 56020 function Cache(maxSize) { 56021 this._maxSize = maxSize; 56022 this.clear(); 56023 } 56024 Cache.prototype.clear = function() { 56025 this._size = 0; 56026 this._values = /* @__PURE__ */ Object.create(null); 56027 }; 56028 Cache.prototype.get = function(key) { 56029 return this._values[key]; 56030 }; 56031 Cache.prototype.set = function(key, value) { 56032 this._size >= this._maxSize && this.clear(); 56033 if (!(key in this._values)) this._size++; 56034 return this._values[key] = value; 56035 }; 56036 var SPLIT_REGEX = /[^.^\]^[]+|(?=\[\]|\.\.)/g, DIGIT_REGEX = /^\d+$/, LEAD_DIGIT_REGEX = /^\d/, SPEC_CHAR_REGEX = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, CLEAN_QUOTES_REGEX = /^\s*(['"]?)(.*?)(\1)\s*$/, MAX_CACHE_SIZE = 512; 56037 var pathCache = new Cache(MAX_CACHE_SIZE), setCache = new Cache(MAX_CACHE_SIZE), getCache = new Cache(MAX_CACHE_SIZE); 56038 propertyExpr = { 56039 Cache, 56040 split, 56041 normalizePath, 56042 setter: function(path) { 56043 var parts = normalizePath(path); 56044 return setCache.get(path) || setCache.set(path, function setter(obj, value) { 56045 var index2 = 0; 56046 var len = parts.length; 56047 var data = obj; 56048 while (index2 < len - 1) { 56049 var part = parts[index2]; 56050 if (part === "__proto__" || part === "constructor" || part === "prototype") { 56051 return obj; 56052 } 56053 data = data[parts[index2++]]; 56054 } 56055 data[parts[index2]] = value; 56056 }); 56057 }, 56058 getter: function(path, safe) { 56059 var parts = normalizePath(path); 56060 return getCache.get(path) || getCache.set(path, function getter(data) { 56061 var index2 = 0, len = parts.length; 56062 while (index2 < len) { 56063 if (data != null || !safe) data = data[parts[index2++]]; 56064 else return; 56065 } 56066 return data; 56067 }); 56068 }, 56069 join: function(segments) { 56070 return segments.reduce(function(path, part) { 56071 return path + (isQuoted(part) || DIGIT_REGEX.test(part) ? "[" + part + "]" : (path ? "." : "") + part); 56072 }, ""); 56073 }, 56074 forEach: function(path, cb, thisArg) { 56075 forEach2(Array.isArray(path) ? path : split(path), cb, thisArg); 56076 } 56077 }; 56078 function normalizePath(path) { 56079 return pathCache.get(path) || pathCache.set( 56080 path, 56081 split(path).map(function(part) { 56082 return part.replace(CLEAN_QUOTES_REGEX, "$2"); 56083 }) 56084 ); 56085 } 56086 function split(path) { 56087 return path.match(SPLIT_REGEX) || [""]; 56088 } 56089 function forEach2(parts, iter, thisArg) { 56090 var len = parts.length, part, idx, isArray2, isBracket; 56091 for (idx = 0; idx < len; idx++) { 56092 part = parts[idx]; 56093 if (part) { 56094 if (shouldBeQuoted(part)) { 56095 part = '"' + part + '"'; 56096 } 56097 isBracket = isQuoted(part); 56098 isArray2 = !isBracket && /^\d+$/.test(part); 56099 iter.call(thisArg, part, isBracket, isArray2, idx, parts); 56100 } 56101 } 56102 } 56103 function isQuoted(str) { 56104 return typeof str === "string" && str && ["'", '"'].indexOf(str.charAt(0)) !== -1; 56105 } 56106 function hasLeadingNumber(part) { 56107 return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX); 56108 } 56109 function hasSpecialChars(part) { 56110 return SPEC_CHAR_REGEX.test(part); 56111 } 56112 function shouldBeQuoted(part) { 56113 return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part)); 56114 } 56115 return propertyExpr; 56116 } 56117 var propertyExprExports = requirePropertyExpr(); 56118 const prefixes = { 56119 context: "$", 56120 value: "." 56121 }; 56122 function create$8(key, options2) { 56123 return new Reference(key, options2); 56124 } 56125 class Reference { 56126 constructor(key, options2 = {}) { 56127 this.key = void 0; 56128 this.isContext = void 0; 56129 this.isValue = void 0; 56130 this.isSibling = void 0; 56131 this.path = void 0; 56132 this.getter = void 0; 56133 this.map = void 0; 56134 if (typeof key !== "string") throw new TypeError("ref must be a string, got: " + key); 56135 this.key = key.trim(); 56136 if (key === "") throw new TypeError("ref must be a non-empty string"); 56137 this.isContext = this.key[0] === prefixes.context; 56138 this.isValue = this.key[0] === prefixes.value; 56139 this.isSibling = !this.isContext && !this.isValue; 56140 let prefix2 = this.isContext ? prefixes.context : this.isValue ? prefixes.value : ""; 56141 this.path = this.key.slice(prefix2.length); 56142 this.getter = this.path && propertyExprExports.getter(this.path, true); 56143 this.map = options2.map; 56144 } 56145 getValue(value, parent, context) { 56146 let result = this.isContext ? context : this.isValue ? value : parent; 56147 if (this.getter) result = this.getter(result || {}); 56148 if (this.map) result = this.map(result); 56149 return result; 56150 } 56151 /** 56152 * 56153 * @param {*} value 56154 * @param {Object} options 56155 * @param {Object=} options.context 56156 * @param {Object=} options.parent 56157 */ 56158 cast(value, options2) { 56159 return this.getValue(value, options2 == null ? void 0 : options2.parent, options2 == null ? void 0 : options2.context); 56160 } 56161 resolve() { 56162 return this; 56163 } 56164 describe() { 56165 return { 56166 type: "ref", 56167 key: this.key 56168 }; 56169 } 56170 toString() { 56171 return `Ref(${this.key})`; 56172 } 56173 static isRef(value) { 56174 return value && value.__isYupRef; 56175 } 56176 } 56177 Reference.prototype.__isYupRef = true; 56178 function _extends$3() { 56179 _extends$3 = Object.assign || function(target) { 56180 for (var i2 = 1; i2 < arguments.length; i2++) { 56181 var source = arguments[i2]; 56182 for (var key in source) { 56183 if (Object.prototype.hasOwnProperty.call(source, key)) { 56184 target[key] = source[key]; 56185 } 56186 } 56187 } 56188 return target; 56189 }; 56190 return _extends$3.apply(this, arguments); 56191 } 56192 function _objectWithoutPropertiesLoose(source, excluded) { 56193 if (source == null) return {}; 56194 var target = {}; 56195 var sourceKeys = Object.keys(source); 56196 var key, i2; 56197 for (i2 = 0; i2 < sourceKeys.length; i2++) { 56198 key = sourceKeys[i2]; 56199 if (excluded.indexOf(key) >= 0) continue; 56200 target[key] = source[key]; 56201 } 56202 return target; 56203 } 56204 function createValidation(config) { 56205 function validate(_ref2, cb) { 56206 let { 56207 value, 56208 path = "", 56209 label, 56210 options: options2, 56211 originalValue, 56212 sync 56213 } = _ref2, rest = _objectWithoutPropertiesLoose(_ref2, ["value", "path", "label", "options", "originalValue", "sync"]); 56214 const { 56215 name, 56216 test: test2, 56217 params, 56218 message 56219 } = config; 56220 let { 56221 parent, 56222 context 56223 } = options2; 56224 function resolve(item) { 56225 return Reference.isRef(item) ? item.getValue(value, parent, context) : item; 56226 } 56227 function createError(overrides = {}) { 56228 const nextParams = mapValues(_extends$3({ 56229 value, 56230 originalValue, 56231 label, 56232 path: overrides.path || path 56233 }, params, overrides.params), resolve); 56234 const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name); 56235 error.params = nextParams; 56236 return error; 56237 } 56238 let ctx = _extends$3({ 56239 path, 56240 parent, 56241 type: name, 56242 createError, 56243 resolve, 56244 options: options2, 56245 originalValue 56246 }, rest); 56247 if (!sync) { 56248 try { 56249 Promise.resolve(test2.call(ctx, value, ctx)).then((validOrError) => { 56250 if (ValidationError.isError(validOrError)) cb(validOrError); 56251 else if (!validOrError) cb(createError()); 56252 else cb(null, validOrError); 56253 }).catch(cb); 56254 } catch (err) { 56255 cb(err); 56256 } 56257 return; 56258 } 56259 let result; 56260 try { 56261 var _ref22; 56262 result = test2.call(ctx, value, ctx); 56263 if (typeof ((_ref22 = result) == null ? void 0 : _ref22.then) === "function") { 56264 throw new Error(`Validation test of type: "${ctx.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`); 56265 } 56266 } catch (err) { 56267 cb(err); 56268 return; 56269 } 56270 if (ValidationError.isError(result)) cb(result); 56271 else if (!result) cb(createError()); 56272 else cb(null, result); 56273 } 56274 validate.OPTIONS = config; 56275 return validate; 56276 } 56277 let trim = (part) => part.substr(0, part.length - 1).substr(1); 56278 function getIn(schema, path, value, context = value) { 56279 let parent, lastPart, lastPartDebug; 56280 if (!path) return { 56281 parent, 56282 parentPath: path, 56283 schema 56284 }; 56285 propertyExprExports.forEach(path, (_part, isBracket, isArray2) => { 56286 let part = isBracket ? trim(_part) : _part; 56287 schema = schema.resolve({ 56288 context, 56289 parent, 56290 value 56291 }); 56292 if (schema.innerType) { 56293 let idx = isArray2 ? parseInt(part, 10) : 0; 56294 if (value && idx >= value.length) { 56295 throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `); 56296 } 56297 parent = value; 56298 value = value && value[idx]; 56299 schema = schema.innerType; 56300 } 56301 if (!isArray2) { 56302 if (!schema.fields || !schema.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema._type}")`); 56303 parent = value; 56304 value = value && value[part]; 56305 schema = schema.fields[part]; 56306 } 56307 lastPart = part; 56308 lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part; 56309 }); 56310 return { 56311 schema, 56312 parent, 56313 parentPath: lastPart 56314 }; 56315 } 56316 const reach = (obj, path, value, context) => getIn(obj, path, value, context).schema; 56317 class ReferenceSet { 56318 constructor() { 56319 this.list = void 0; 56320 this.refs = void 0; 56321 this.list = /* @__PURE__ */ new Set(); 56322 this.refs = /* @__PURE__ */ new Map(); 56323 } 56324 get size() { 56325 return this.list.size + this.refs.size; 56326 } 56327 describe() { 56328 const description = []; 56329 for (const item of this.list) description.push(item); 56330 for (const [, ref] of this.refs) description.push(ref.describe()); 56331 return description; 56332 } 56333 toArray() { 56334 return Array.from(this.list).concat(Array.from(this.refs.values())); 56335 } 56336 resolveAll(resolve) { 56337 return this.toArray().reduce((acc, e2) => acc.concat(Reference.isRef(e2) ? resolve(e2) : e2), []); 56338 } 56339 add(value) { 56340 Reference.isRef(value) ? this.refs.set(value.key, value) : this.list.add(value); 56341 } 56342 delete(value) { 56343 Reference.isRef(value) ? this.refs.delete(value.key) : this.list.delete(value); 56344 } 56345 clone() { 56346 const next2 = new ReferenceSet(); 56347 next2.list = new Set(this.list); 56348 next2.refs = new Map(this.refs); 56349 return next2; 56350 } 56351 merge(newItems, removeItems) { 56352 const next2 = this.clone(); 56353 newItems.list.forEach((value) => next2.add(value)); 56354 newItems.refs.forEach((value) => next2.add(value)); 56355 removeItems.list.forEach((value) => next2.delete(value)); 56356 removeItems.refs.forEach((value) => next2.delete(value)); 56357 return next2; 56358 } 56359 } 56360 function _extends$2() { 56361 _extends$2 = Object.assign || function(target) { 56362 for (var i2 = 1; i2 < arguments.length; i2++) { 56363 var source = arguments[i2]; 56364 for (var key in source) { 56365 if (Object.prototype.hasOwnProperty.call(source, key)) { 56366 target[key] = source[key]; 56367 } 56368 } 56369 } 56370 return target; 56371 }; 56372 return _extends$2.apply(this, arguments); 56373 } 56374 class BaseSchema { 56375 constructor(options2) { 56376 this.deps = []; 56377 this.tests = void 0; 56378 this.transforms = void 0; 56379 this.conditions = []; 56380 this._mutate = void 0; 56381 this._typeError = void 0; 56382 this._whitelist = new ReferenceSet(); 56383 this._blacklist = new ReferenceSet(); 56384 this.exclusiveTests = /* @__PURE__ */ Object.create(null); 56385 this.spec = void 0; 56386 this.tests = []; 56387 this.transforms = []; 56388 this.withMutation(() => { 56389 this.typeError(mixed.notType); 56390 }); 56391 this.type = (options2 == null ? void 0 : options2.type) || "mixed"; 56392 this.spec = _extends$2({ 56393 strip: false, 56394 strict: false, 56395 abortEarly: true, 56396 recursive: true, 56397 nullable: false, 56398 presence: "optional" 56399 }, options2 == null ? void 0 : options2.spec); 56400 } 56401 // TODO: remove 56402 get _type() { 56403 return this.type; 56404 } 56405 _typeCheck(_value) { 56406 return true; 56407 } 56408 clone(spec) { 56409 if (this._mutate) { 56410 if (spec) Object.assign(this.spec, spec); 56411 return this; 56412 } 56413 const next2 = Object.create(Object.getPrototypeOf(this)); 56414 next2.type = this.type; 56415 next2._typeError = this._typeError; 56416 next2._whitelistError = this._whitelistError; 56417 next2._blacklistError = this._blacklistError; 56418 next2._whitelist = this._whitelist.clone(); 56419 next2._blacklist = this._blacklist.clone(); 56420 next2.exclusiveTests = _extends$2({}, this.exclusiveTests); 56421 next2.deps = [...this.deps]; 56422 next2.conditions = [...this.conditions]; 56423 next2.tests = [...this.tests]; 56424 next2.transforms = [...this.transforms]; 56425 next2.spec = clone(_extends$2({}, this.spec, spec)); 56426 return next2; 56427 } 56428 label(label) { 56429 let next2 = this.clone(); 56430 next2.spec.label = label; 56431 return next2; 56432 } 56433 meta(...args) { 56434 if (args.length === 0) return this.spec.meta; 56435 let next2 = this.clone(); 56436 next2.spec.meta = Object.assign(next2.spec.meta || {}, args[0]); 56437 return next2; 56438 } 56439 // withContext<TContext extends AnyObject>(): BaseSchema< 56440 // TCast, 56441 // TContext, 56442 // TOutput 56443 // > { 56444 // return this as any; 56445 // } 56446 withMutation(fn2) { 56447 let before = this._mutate; 56448 this._mutate = true; 56449 let result = fn2(this); 56450 this._mutate = before; 56451 return result; 56452 } 56453 concat(schema) { 56454 if (!schema || schema === this) return this; 56455 if (schema.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema.type}`); 56456 let base = this; 56457 let combined = schema.clone(); 56458 const mergedSpec = _extends$2({}, base.spec, combined.spec); 56459 combined.spec = mergedSpec; 56460 combined._typeError || (combined._typeError = base._typeError); 56461 combined._whitelistError || (combined._whitelistError = base._whitelistError); 56462 combined._blacklistError || (combined._blacklistError = base._blacklistError); 56463 combined._whitelist = base._whitelist.merge(schema._whitelist, schema._blacklist); 56464 combined._blacklist = base._blacklist.merge(schema._blacklist, schema._whitelist); 56465 combined.tests = base.tests; 56466 combined.exclusiveTests = base.exclusiveTests; 56467 combined.withMutation((next2) => { 56468 schema.tests.forEach((fn2) => { 56469 next2.test(fn2.OPTIONS); 56470 }); 56471 }); 56472 combined.transforms = [...base.transforms, ...combined.transforms]; 56473 return combined; 56474 } 56475 isType(v2) { 56476 if (this.spec.nullable && v2 === null) return true; 56477 return this._typeCheck(v2); 56478 } 56479 resolve(options2) { 56480 let schema = this; 56481 if (schema.conditions.length) { 56482 let conditions = schema.conditions; 56483 schema = schema.clone(); 56484 schema.conditions = []; 56485 schema = conditions.reduce((schema2, condition) => condition.resolve(schema2, options2), schema); 56486 schema = schema.resolve(options2); 56487 } 56488 return schema; 56489 } 56490 /** 56491 * 56492 * @param {*} value 56493 * @param {Object} options 56494 * @param {*=} options.parent 56495 * @param {*=} options.context 56496 */ 56497 cast(value, options2 = {}) { 56498 let resolvedSchema = this.resolve(_extends$2({ 56499 value 56500 }, options2)); 56501 let result = resolvedSchema._cast(value, options2); 56502 if (value !== void 0 && options2.assert !== false && resolvedSchema.isType(result) !== true) { 56503 let formattedValue = printValue(value); 56504 let formattedResult = printValue(result); 56505 throw new TypeError(`The value of ${options2.path || "field"} could not be cast to a value that satisfies the schema type: "${resolvedSchema._type}". 56506 56507attempted value: ${formattedValue} 56508` + (formattedResult !== formattedValue ? `result of cast: ${formattedResult}` : "")); 56509 } 56510 return result; 56511 } 56512 _cast(rawValue, _options) { 56513 let value = rawValue === void 0 ? rawValue : this.transforms.reduce((value2, fn2) => fn2.call(this, value2, rawValue, this), rawValue); 56514 if (value === void 0) { 56515 value = this.getDefault(); 56516 } 56517 return value; 56518 } 56519 _validate(_value, options2 = {}, cb) { 56520 let { 56521 sync, 56522 path, 56523 from: from2 = [], 56524 originalValue = _value, 56525 strict: strict2 = this.spec.strict, 56526 abortEarly = this.spec.abortEarly 56527 } = options2; 56528 let value = _value; 56529 if (!strict2) { 56530 value = this._cast(value, _extends$2({ 56531 assert: false 56532 }, options2)); 56533 } 56534 let args = { 56535 value, 56536 path, 56537 options: options2, 56538 originalValue, 56539 schema: this, 56540 label: this.spec.label, 56541 sync, 56542 from: from2 56543 }; 56544 let initialTests = []; 56545 if (this._typeError) initialTests.push(this._typeError); 56546 let finalTests = []; 56547 if (this._whitelistError) finalTests.push(this._whitelistError); 56548 if (this._blacklistError) finalTests.push(this._blacklistError); 56549 runTests({ 56550 args, 56551 value, 56552 path, 56553 tests: initialTests, 56554 endEarly: abortEarly 56555 }, (err) => { 56556 if (err) return void cb(err, value); 56557 runTests({ 56558 tests: this.tests.concat(finalTests), 56559 args, 56560 path, 56561 sync, 56562 value, 56563 endEarly: abortEarly 56564 }, cb); 56565 }); 56566 } 56567 validate(value, options2, maybeCb) { 56568 let schema = this.resolve(_extends$2({}, options2, { 56569 value 56570 })); 56571 return typeof maybeCb === "function" ? schema._validate(value, options2, maybeCb) : new Promise((resolve, reject) => schema._validate(value, options2, (err, value2) => { 56572 if (err) reject(err); 56573 else resolve(value2); 56574 })); 56575 } 56576 validateSync(value, options2) { 56577 let schema = this.resolve(_extends$2({}, options2, { 56578 value 56579 })); 56580 let result; 56581 schema._validate(value, _extends$2({}, options2, { 56582 sync: true 56583 }), (err, value2) => { 56584 if (err) throw err; 56585 result = value2; 56586 }); 56587 return result; 56588 } 56589 isValid(value, options2) { 56590 return this.validate(value, options2).then(() => true, (err) => { 56591 if (ValidationError.isError(err)) return false; 56592 throw err; 56593 }); 56594 } 56595 isValidSync(value, options2) { 56596 try { 56597 this.validateSync(value, options2); 56598 return true; 56599 } catch (err) { 56600 if (ValidationError.isError(err)) return false; 56601 throw err; 56602 } 56603 } 56604 _getDefault() { 56605 let defaultValue = this.spec.default; 56606 if (defaultValue == null) { 56607 return defaultValue; 56608 } 56609 return typeof defaultValue === "function" ? defaultValue.call(this) : clone(defaultValue); 56610 } 56611 getDefault(options2) { 56612 let schema = this.resolve(options2 || {}); 56613 return schema._getDefault(); 56614 } 56615 default(def) { 56616 if (arguments.length === 0) { 56617 return this._getDefault(); 56618 } 56619 let next2 = this.clone({ 56620 default: def 56621 }); 56622 return next2; 56623 } 56624 strict(isStrict = true) { 56625 let next2 = this.clone(); 56626 next2.spec.strict = isStrict; 56627 return next2; 56628 } 56629 _isPresent(value) { 56630 return value != null; 56631 } 56632 defined(message = mixed.defined) { 56633 return this.test({ 56634 message, 56635 name: "defined", 56636 exclusive: true, 56637 test(value) { 56638 return value !== void 0; 56639 } 56640 }); 56641 } 56642 required(message = mixed.required) { 56643 return this.clone({ 56644 presence: "required" 56645 }).withMutation((s2) => s2.test({ 56646 message, 56647 name: "required", 56648 exclusive: true, 56649 test(value) { 56650 return this.schema._isPresent(value); 56651 } 56652 })); 56653 } 56654 notRequired() { 56655 let next2 = this.clone({ 56656 presence: "optional" 56657 }); 56658 next2.tests = next2.tests.filter((test2) => test2.OPTIONS.name !== "required"); 56659 return next2; 56660 } 56661 nullable(isNullable = true) { 56662 let next2 = this.clone({ 56663 nullable: isNullable !== false 56664 }); 56665 return next2; 56666 } 56667 transform(fn2) { 56668 let next2 = this.clone(); 56669 next2.transforms.push(fn2); 56670 return next2; 56671 } 56672 /** 56673 * Adds a test function to the schema's queue of tests. 56674 * tests can be exclusive or non-exclusive. 56675 * 56676 * - exclusive tests, will replace any existing tests of the same name. 56677 * - non-exclusive: can be stacked 56678 * 56679 * If a non-exclusive test is added to a schema with an exclusive test of the same name 56680 * the exclusive test is removed and further tests of the same name will be stacked. 56681 * 56682 * If an exclusive test is added to a schema with non-exclusive tests of the same name 56683 * the previous tests are removed and further tests of the same name will replace each other. 56684 */ 56685 test(...args) { 56686 let opts; 56687 if (args.length === 1) { 56688 if (typeof args[0] === "function") { 56689 opts = { 56690 test: args[0] 56691 }; 56692 } else { 56693 opts = args[0]; 56694 } 56695 } else if (args.length === 2) { 56696 opts = { 56697 name: args[0], 56698 test: args[1] 56699 }; 56700 } else { 56701 opts = { 56702 name: args[0], 56703 message: args[1], 56704 test: args[2] 56705 }; 56706 } 56707 if (opts.message === void 0) opts.message = mixed.default; 56708 if (typeof opts.test !== "function") throw new TypeError("`test` is a required parameters"); 56709 let next2 = this.clone(); 56710 let validate = createValidation(opts); 56711 let isExclusive = opts.exclusive || opts.name && next2.exclusiveTests[opts.name] === true; 56712 if (opts.exclusive) { 56713 if (!opts.name) throw new TypeError("Exclusive tests must provide a unique `name` identifying the test"); 56714 } 56715 if (opts.name) next2.exclusiveTests[opts.name] = !!opts.exclusive; 56716 next2.tests = next2.tests.filter((fn2) => { 56717 if (fn2.OPTIONS.name === opts.name) { 56718 if (isExclusive) return false; 56719 if (fn2.OPTIONS.test === validate.OPTIONS.test) return false; 56720 } 56721 return true; 56722 }); 56723 next2.tests.push(validate); 56724 return next2; 56725 } 56726 when(keys2, options2) { 56727 if (!Array.isArray(keys2) && typeof keys2 !== "string") { 56728 options2 = keys2; 56729 keys2 = "."; 56730 } 56731 let next2 = this.clone(); 56732 let deps = toArray(keys2).map((key) => new Reference(key)); 56733 deps.forEach((dep) => { 56734 if (dep.isSibling) next2.deps.push(dep.key); 56735 }); 56736 next2.conditions.push(new Condition(deps, options2)); 56737 return next2; 56738 } 56739 typeError(message) { 56740 let next2 = this.clone(); 56741 next2._typeError = createValidation({ 56742 message, 56743 name: "typeError", 56744 test(value) { 56745 if (value !== void 0 && !this.schema.isType(value)) return this.createError({ 56746 params: { 56747 type: this.schema._type 56748 } 56749 }); 56750 return true; 56751 } 56752 }); 56753 return next2; 56754 } 56755 oneOf(enums, message = mixed.oneOf) { 56756 let next2 = this.clone(); 56757 enums.forEach((val) => { 56758 next2._whitelist.add(val); 56759 next2._blacklist.delete(val); 56760 }); 56761 next2._whitelistError = createValidation({ 56762 message, 56763 name: "oneOf", 56764 test(value) { 56765 if (value === void 0) return true; 56766 let valids = this.schema._whitelist; 56767 let resolved = valids.resolveAll(this.resolve); 56768 return resolved.includes(value) ? true : this.createError({ 56769 params: { 56770 values: valids.toArray().join(", "), 56771 resolved 56772 } 56773 }); 56774 } 56775 }); 56776 return next2; 56777 } 56778 notOneOf(enums, message = mixed.notOneOf) { 56779 let next2 = this.clone(); 56780 enums.forEach((val) => { 56781 next2._blacklist.add(val); 56782 next2._whitelist.delete(val); 56783 }); 56784 next2._blacklistError = createValidation({ 56785 message, 56786 name: "notOneOf", 56787 test(value) { 56788 let invalids = this.schema._blacklist; 56789 let resolved = invalids.resolveAll(this.resolve); 56790 if (resolved.includes(value)) return this.createError({ 56791 params: { 56792 values: invalids.toArray().join(", "), 56793 resolved 56794 } 56795 }); 56796 return true; 56797 } 56798 }); 56799 return next2; 56800 } 56801 strip(strip = true) { 56802 let next2 = this.clone(); 56803 next2.spec.strip = strip; 56804 return next2; 56805 } 56806 describe() { 56807 const next2 = this.clone(); 56808 const { 56809 label, 56810 meta 56811 } = next2.spec; 56812 const description = { 56813 meta, 56814 label, 56815 type: next2.type, 56816 oneOf: next2._whitelist.describe(), 56817 notOneOf: next2._blacklist.describe(), 56818 tests: next2.tests.map((fn2) => ({ 56819 name: fn2.OPTIONS.name, 56820 params: fn2.OPTIONS.params 56821 })).filter((n2, idx, list) => list.findIndex((c2) => c2.name === n2.name) === idx) 56822 }; 56823 return description; 56824 } 56825 } 56826 BaseSchema.prototype.__isYupSchema__ = true; 56827 for (const method of ["validate", "validateSync"]) BaseSchema.prototype[`${method}At`] = function(path, value, options2 = {}) { 56828 const { 56829 parent, 56830 parentPath, 56831 schema 56832 } = getIn(this, path, value, options2.context); 56833 return schema[method](parent && parent[parentPath], _extends$2({}, options2, { 56834 parent, 56835 path 56836 })); 56837 }; 56838 for (const alias of ["equals", "is"]) BaseSchema.prototype[alias] = BaseSchema.prototype.oneOf; 56839 for (const alias of ["not", "nope"]) BaseSchema.prototype[alias] = BaseSchema.prototype.notOneOf; 56840 BaseSchema.prototype.optional = BaseSchema.prototype.notRequired; 56841 const Mixed = BaseSchema; 56842 function create$7() { 56843 return new Mixed(); 56844 } 56845 create$7.prototype = Mixed.prototype; 56846 const isAbsent = (value) => value == null; 56847 function create$6() { 56848 return new BooleanSchema(); 56849 } 56850 class BooleanSchema extends BaseSchema { 56851 constructor() { 56852 super({ 56853 type: "boolean" 56854 }); 56855 this.withMutation(() => { 56856 this.transform(function(value) { 56857 if (!this.isType(value)) { 56858 if (/^(true|1)$/i.test(String(value))) return true; 56859 if (/^(false|0)$/i.test(String(value))) return false; 56860 } 56861 return value; 56862 }); 56863 }); 56864 } 56865 _typeCheck(v2) { 56866 if (v2 instanceof Boolean) v2 = v2.valueOf(); 56867 return typeof v2 === "boolean"; 56868 } 56869 isTrue(message = boolean.isValue) { 56870 return this.test({ 56871 message, 56872 name: "is-value", 56873 exclusive: true, 56874 params: { 56875 value: "true" 56876 }, 56877 test(value) { 56878 return isAbsent(value) || value === true; 56879 } 56880 }); 56881 } 56882 isFalse(message = boolean.isValue) { 56883 return this.test({ 56884 message, 56885 name: "is-value", 56886 exclusive: true, 56887 params: { 56888 value: "false" 56889 }, 56890 test(value) { 56891 return isAbsent(value) || value === false; 56892 } 56893 }); 56894 } 56895 } 56896 create$6.prototype = BooleanSchema.prototype; 56897 let rEmail = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; 56898 let rUrl = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i; 56899 let rUUID = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; 56900 let isTrimmed = (value) => isAbsent(value) || value === value.trim(); 56901 let objStringTag = {}.toString(); 56902 function create$5() { 56903 return new StringSchema(); 56904 } 56905 class StringSchema extends BaseSchema { 56906 constructor() { 56907 super({ 56908 type: "string" 56909 }); 56910 this.withMutation(() => { 56911 this.transform(function(value) { 56912 if (this.isType(value)) return value; 56913 if (Array.isArray(value)) return value; 56914 const strValue = value != null && value.toString ? value.toString() : value; 56915 if (strValue === objStringTag) return value; 56916 return strValue; 56917 }); 56918 }); 56919 } 56920 _typeCheck(value) { 56921 if (value instanceof String) value = value.valueOf(); 56922 return typeof value === "string"; 56923 } 56924 _isPresent(value) { 56925 return super._isPresent(value) && !!value.length; 56926 } 56927 length(length2, message = string.length) { 56928 return this.test({ 56929 message, 56930 name: "length", 56931 exclusive: true, 56932 params: { 56933 length: length2 56934 }, 56935 test(value) { 56936 return isAbsent(value) || value.length === this.resolve(length2); 56937 } 56938 }); 56939 } 56940 min(min2, message = string.min) { 56941 return this.test({ 56942 message, 56943 name: "min", 56944 exclusive: true, 56945 params: { 56946 min: min2 56947 }, 56948 test(value) { 56949 return isAbsent(value) || value.length >= this.resolve(min2); 56950 } 56951 }); 56952 } 56953 max(max2, message = string.max) { 56954 return this.test({ 56955 name: "max", 56956 exclusive: true, 56957 message, 56958 params: { 56959 max: max2 56960 }, 56961 test(value) { 56962 return isAbsent(value) || value.length <= this.resolve(max2); 56963 } 56964 }); 56965 } 56966 matches(regex, options2) { 56967 let excludeEmptyString = false;
56968 let message; 56969 let name; 56970 if (options2) { 56971 if (typeof options2 === "object") { 56972 ({ 56973 excludeEmptyString = false, 56974 message, 56975 name 56976 } = options2); 56977 } else { 56978 message = options2; 56979 } 56980 } 56981 return this.test({ 56982 name: name || "matches", 56983 message: message || string.matches, 56984 params: { 56985 regex 56986 }, 56987 test: (value) => isAbsent(value) || value === "" && excludeEmptyString || value.search(regex) !== -1 56988 }); 56989 } 56990 email(message = string.email) { 56991 return this.matches(rEmail, { 56992 name: "email", 56993 message, 56994 excludeEmptyString: true 56995 }); 56996 } 56997 url(message = string.url) { 56998 return this.matches(rUrl, { 56999 name: "url", 57000 message, 57001 excludeEmptyString: true 57002 }); 57003 } 57004 uuid(message = string.uuid) { 57005 return this.matches(rUUID, { 57006 name: "uuid", 57007 message, 57008 excludeEmptyString: false 57009 }); 57010 } 57011 //-- transforms -- 57012 ensure() { 57013 return this.default("").transform((val) => val === null ? "" : val); 57014 } 57015 trim(message = string.trim) { 57016 return this.transform((val) => val != null ? val.trim() : val).test({ 57017 message, 57018 name: "trim", 57019 test: isTrimmed 57020 }); 57021 } 57022 lowercase(message = string.lowercase) { 57023 return this.transform((value) => !isAbsent(value) ? value.toLowerCase() : value).test({ 57024 message, 57025 name: "string_case", 57026 exclusive: true, 57027 test: (value) => isAbsent(value) || value === value.toLowerCase() 57028 }); 57029 } 57030 uppercase(message = string.uppercase) { 57031 return this.transform((value) => !isAbsent(value) ? value.toUpperCase() : value).test({ 57032 message, 57033 name: "string_case", 57034 exclusive: true, 57035 test: (value) => isAbsent(value) || value === value.toUpperCase() 57036 }); 57037 } 57038 } 57039 create$5.prototype = StringSchema.prototype; 57040 let isNaN$1 = (value) => value != +value; 57041 function create$4() { 57042 return new NumberSchema(); 57043 } 57044 class NumberSchema extends BaseSchema { 57045 constructor() { 57046 super({ 57047 type: "number" 57048 }); 57049 this.withMutation(() => { 57050 this.transform(function(value) { 57051 let parsed = value; 57052 if (typeof parsed === "string") { 57053 parsed = parsed.replace(/\s/g, ""); 57054 if (parsed === "") return NaN; 57055 parsed = +parsed; 57056 } 57057 if (this.isType(parsed)) return parsed; 57058 return parseFloat(parsed); 57059 }); 57060 }); 57061 } 57062 _typeCheck(value) { 57063 if (value instanceof Number) value = value.valueOf(); 57064 return typeof value === "number" && !isNaN$1(value); 57065 } 57066 min(min2, message = number.min) { 57067 return this.test({ 57068 message, 57069 name: "min", 57070 exclusive: true, 57071 params: { 57072 min: min2 57073 }, 57074 test(value) { 57075 return isAbsent(value) || value >= this.resolve(min2); 57076 } 57077 }); 57078 } 57079 max(max2, message = number.max) { 57080 return this.test({ 57081 message, 57082 name: "max", 57083 exclusive: true, 57084 params: { 57085 max: max2 57086 }, 57087 test(value) { 57088 return isAbsent(value) || value <= this.resolve(max2); 57089 } 57090 }); 57091 } 57092 lessThan(less, message = number.lessThan) { 57093 return this.test({ 57094 message, 57095 name: "max", 57096 exclusive: true, 57097 params: { 57098 less 57099 }, 57100 test(value) { 57101 return isAbsent(value) || value < this.resolve(less); 57102 } 57103 }); 57104 } 57105 moreThan(more, message = number.moreThan) { 57106 return this.test({ 57107 message, 57108 name: "min", 57109 exclusive: true, 57110 params: { 57111 more 57112 }, 57113 test(value) { 57114 return isAbsent(value) || value > this.resolve(more); 57115 } 57116 }); 57117 } 57118 positive(msg = number.positive) { 57119 return this.moreThan(0, msg); 57120 } 57121 negative(msg = number.negative) { 57122 return this.lessThan(0, msg); 57123 } 57124 integer(message = number.integer) { 57125 return this.test({ 57126 name: "integer", 57127 message, 57128 test: (val) => isAbsent(val) || Number.isInteger(val) 57129 }); 57130 } 57131 truncate() { 57132 return this.transform((value) => !isAbsent(value) ? value | 0 : value); 57133 }
vendor: 7,033 bytes, lines 57134-57421
57134 round(method) { 57135 var _method; 57136 let avail = ["ceil", "floor", "round", "trunc"]; 57137 method = ((_method = method) == null ? void 0 : _method.toLowerCase()) || "round"; 57138 if (method === "trunc") return this.truncate(); 57139 if (avail.indexOf(method.toLowerCase()) === -1) throw new TypeError("Only valid options for round() are: " + avail.join(", ")); 57140 return this.transform((value) => !isAbsent(value) ? Math[method](value) : value); 57141 } 57142 } 57143 create$4.prototype = NumberSchema.prototype; 57144 var isoReg = /^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/; 57145 function parseIsoDate(date2) { 57146 var numericKeys = [1, 4, 5, 6, 7, 10, 11], minutesOffset = 0, timestamp, struct; 57147 if (struct = isoReg.exec(date2)) { 57148 for (var i2 = 0, k2; k2 = numericKeys[i2]; ++i2) struct[k2] = +struct[k2] || 0; 57149 struct[2] = (+struct[2] || 1) - 1; 57150 struct[3] = +struct[3] || 1; 57151 struct[7] = struct[7] ? String(struct[7]).substr(0, 3) : 0; 57152 if ((struct[8] === void 0 || struct[8] === "") && (struct[9] === void 0 || struct[9] === "")) timestamp = +new Date(struct[1], struct[2], struct[3], struct[4], struct[5], struct[6], struct[7]); 57153 else { 57154 if (struct[8] !== "Z" && struct[9] !== void 0) { 57155 minutesOffset = struct[10] * 60 + struct[11]; 57156 if (struct[9] === "+") minutesOffset = 0 - minutesOffset; 57157 } 57158 timestamp = Date.UTC(struct[1], struct[2], struct[3], struct[4], struct[5] + minutesOffset, struct[6], struct[7]); 57159 } 57160 } else timestamp = Date.parse ? Date.parse(date2) : NaN; 57161 return timestamp; 57162 } 57163 let invalidDate = /* @__PURE__ */ new Date(""); 57164 let isDate = (obj) => Object.prototype.toString.call(obj) === "[object Date]"; 57165 function create$3() { 57166 return new DateSchema(); 57167 } 57168 class DateSchema extends BaseSchema { 57169 constructor() { 57170 super({ 57171 type: "date" 57172 }); 57173 this.withMutation(() => { 57174 this.transform(function(value) { 57175 if (this.isType(value)) return value; 57176 value = parseIsoDate(value); 57177 return !isNaN(value) ? new Date(value) : invalidDate; 57178 }); 57179 }); 57180 } 57181 _typeCheck(v2) { 57182 return isDate(v2) && !isNaN(v2.getTime()); 57183 } 57184 prepareParam(ref, name) { 57185 let param; 57186 if (!Reference.isRef(ref)) { 57187 let cast = this.cast(ref); 57188 if (!this._typeCheck(cast)) throw new TypeError(`\`${name}\` must be a Date or a value that can be \`cast()\` to a Date`); 57189 param = cast; 57190 } else { 57191 param = ref; 57192 } 57193 return param; 57194 } 57195 min(min2, message = date.min) { 57196 let limit = this.prepareParam(min2, "min"); 57197 return this.test({ 57198 message, 57199 name: "min", 57200 exclusive: true, 57201 params: { 57202 min: min2 57203 }, 57204 test(value) { 57205 return isAbsent(value) || value >= this.resolve(limit); 57206 } 57207 }); 57208 } 57209 max(max2, message = date.max) { 57210 let limit = this.prepareParam(max2, "max"); 57211 return this.test({ 57212 message, 57213 name: "max", 57214 exclusive: true, 57215 params: { 57216 max: max2 57217 }, 57218 test(value) { 57219 return isAbsent(value) || value <= this.resolve(limit); 57220 } 57221 }); 57222 } 57223 } 57224 DateSchema.INVALID_DATE = invalidDate; 57225 create$3.prototype = DateSchema.prototype; 57226 create$3.INVALID_DATE = invalidDate; 57227 var deburredLetters = { 57228 // Latin-1 Supplement block. 57229 "Ã": "A", 57230 "Ã": "A", 57231 "Ã": "A", 57232 "Ã": "A", 57233 "Ã": "A", 57234 "à ": "A", 57235 "à ": "a", 57236 "á": "a", 57237 "â": "a", 57238 "ã": "a", 57239 "ä": "a", 57240 "Ã¥": "a", 57241 "Ã": "C", 57242 "ç": "c", 57243 "Ã": "D", 57244 "ð": "d", 57245 "Ã": "E", 57246 "Ã": "E", 57247 "Ã": "E", 57248 "Ã": "E", 57249 "è": "e", 57250 "é": "e", 57251 "ê": "e", 57252 "ë": "e", 57253 "Ã": "I", 57254 "Ã": "I", 57255 "Ã": "I", 57256 "Ã": "I", 57257 "ì": "i", 57258 "Ã": "i", 57259 "î": "i", 57260 "ï": "i", 57261 "Ã": "N", 57262 "ñ": "n", 57263 "Ã": "O", 57264 "Ã": "O", 57265 "Ã": "O", 57266 "Ã": "O", 57267 "Ã": "O", 57268 "Ã": "O", 57269 "ò": "o", 57270 "ó": "o", 57271 "ô": "o", 57272 "õ": "o", 57273 "ö": "o", 57274 "ø": "o", 57275 "Ã": "U", 57276 "Ã": "U", 57277 "Ã": "U", 57278 "Ã": "U", 57279 "ù": "u", 57280 "ú": "u", 57281 "û": "u", 57282 "ü": "u", 57283 "Ã": "Y", 57284 "ý": "y", 57285 "ÿ": "y", 57286 "Ã": "Ae", 57287 "æ": "ae", 57288 "Ã": "Th", 57289 "þ": "th", 57290 "Ã": "ss", 57291 // Latin Extended-A block. 57292 "Ä": "A", 57293 "Ä": "A", 57294 "Ä": "A", 57295 "Ä": "a", 57296 "Ä": "a", 57297 "Ä ": "a", 57298 "Ä": "C", 57299 "Ä": "C", 57300 "Ä": "C", 57301 "Ä": "C", 57302 "Ä": "c", 57303 "Ä": "c", 57304 "Ä": "c", 57305 "Ä": "c", 57306 "Ä": "D", 57307 "Ä": "D", 57308 "Ä": "d", 57309 "Ä": "d", 57310 "Ä": "E", 57311 "Ä": "E", 57312 "Ä": "E", 57313 "Ä": "E", 57314 "Ä": "E", 57315 "Ä": "e", 57316 "Ä": "e", 57317 "Ä": "e", 57318 "Ä": "e", 57319 "Ä": "e", 57320 "Ä": "G", 57321 "Ä": "G", 57322 "Ä ": "G", 57323 "Ä¢": "G", 57324 "Ä": "g", 57325 "Ä": "g", 57326 "Ä¡": "g", 57327 "Ä£": "g", 57328 "Ĥ": "H", 57329 "Ħ": "H", 57330 "Ä¥": "h", 57331 "ħ": "h", 57332 "Ĩ": "I", 57333 "Ī": "I", 57334 "Ĭ": "I", 57335 "Ä®": "I", 57336 "İ": "I", 57337 "Ä©": "i", 57338 "Ä«": "i", 57339 "Ä": "i", 57340 "į": "i", 57341 "ı": "i", 57342 "Ä´": "J", 57343 "ĵ": "j", 57344 "Ķ": "K", 57345 "Ä·": "k", 57346 "ĸ": "k", 57347 "Ĺ": "L", 57348 "Ä»": "L", 57349 "Ľ": "L", 57350 "Ä¿": "L", 57351 "Å": "L", 57352 "ĺ": "l", 57353 "ļ": "l", 57354 "ľ": "l", 57355 "Å": "l", 57356 "Å": "l", 57357 "Å": "N", 57358 "Å ": "N", 57359 "Å": "N", 57360 "Å": "N", 57361 "Å": "n", 57362 "Å": "n", 57363 "Å": "n", 57364 "Å": "n", 57365 "Å": "O", 57366 "Å": "O", 57367 "Å": "O", 57368 "Å": "o", 57369 "Å": "o", 57370 "Å": "o", 57371 "Å": "R", 57372 "Å": "R", 57373 "Å": "R", 57374 "Å": "r", 57375 "Å": "r", 57376 "Å": "r", 57377 "Å": "S", 57378 "Å": "S", 57379 "Å": "S", 57380 "Å ": "S", 57381 "Å": "s", 57382 "Å": "s", 57383 "Å": "s", 57384 "Å¡": "s", 57385 "Å¢": "T", 57386 "Ť": "T", 57387 "Ŧ": "T", 57388 "Å£": "t", 57389 "Å¥": "t", 57390 "ŧ": "t", 57391 "Ũ": "U", 57392 "Ū": "U", 57393 "Ŭ": "U", 57394 "Å®": "U", 57395 "Ű": "U", 57396 "Ų": "U", 57397 "Å©": "u", 57398 "Å«": "u", 57399 "Å": "u", 57400 "ů": "u", 57401 "ű": "u", 57402 "ų": "u", 57403 "Å´": "W", 57404 "ŵ": "w", 57405 "Ŷ": "Y", 57406 "Å·": "y", 57407 "Ÿ": "Y", 57408 "Ź": "Z", 57409 "Å»": "Z", 57410 "Ž": "Z", 57411 "ź": "z", 57412 "ż": "z", 57413 "ž": "z", 57414 "IJ": "IJ", 57415 "ij": "ij", 57416 "Å": "Oe", 57417 "Å": "oe", 57418 "Å": "'n", 57419 "Å¿": "s" 57420 }; 57421 var deburrLetter = basePropertyOf(deburredLetters);
vendor: 4,247 bytes, lines 57422-57474
57422 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 57423 var rsComboMarksRange$1 = "\\u0300-\\u036f", reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f", rsComboSymbolsRange$1 = "\\u20d0-\\u20ff", rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; 57424 var rsCombo$1 = "[" + rsComboRange$1 + "]"; 57425 var reComboMark = RegExp(rsCombo$1, "g"); 57426 function deburr(string2) { 57427 string2 = toString$1(string2); 57428 return string2 && string2.replace(reLatin, deburrLetter).replace(reComboMark, ""); 57429 } 57430 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 57431 function asciiWords(string2) { 57432 return string2.match(reAsciiWord) || []; 57433 } 57434 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 57435 function hasUnicodeWord(string2) { 57436 return reHasUnicodeWord.test(string2); 57437 } 57438 var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 57439 var rsApos$1 = "['â]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; 57440 var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos$1 + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos$1 + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; 57441 var reUnicodeWord = RegExp([ 57442 rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", 57443 rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", 57444 rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, 57445 rsUpper + "+" + rsOptContrUpper, 57446 rsOrdUpper, 57447 rsOrdLower, 57448 rsDigits, 57449 rsEmoji 57450 ].join("|"), "g"); 57451 function unicodeWords(string2) { 57452 return string2.match(reUnicodeWord) || []; 57453 } 57454 function words(string2, pattern, guard) { 57455 string2 = toString$1(string2); 57456 pattern = pattern; 57457 if (pattern === void 0) { 57458 return hasUnicodeWord(string2) ? unicodeWords(string2) : asciiWords(string2); 57459 } 57460 return string2.match(pattern) || []; 57461 } 57462 var rsApos = "['â]"; 57463 var reApos = RegExp(rsApos, "g"); 57464 function createCompounder(callback) { 57465 return function(string2) { 57466 return arrayReduce(words(deburr(string2).replace(reApos, "")), callback, ""); 57467 }; 57468 } 57469 var snakeCase = createCompounder(function(result, word, index2) { 57470 return result + (index2 ? "_" : "") + word.toLowerCase(); 57471 }); 57472 function capitalize(string2) { 57473 return upperFirst(toString$1(string2).toLowerCase()); 57474 }
vendor: 15,871 bytes, lines 57475-57925
57475 var camelCase = createCompounder(function(result, word, index2) { 57476 word = word.toLowerCase(); 57477 return result + (index2 ? capitalize(word) : word); 57478 }); 57479 function mapKeys(object2, iteratee) { 57480 var result = {}; 57481 iteratee = baseIteratee(iteratee); 57482 baseForOwn(object2, function(value, key, object3) { 57483 baseAssignValue(result, iteratee(value, key, object3), value); 57484 }); 57485 return result; 57486 } 57487 var toposort$1 = { exports: {} }; 57488 var hasRequiredToposort; 57489 function requireToposort() { 57490 if (hasRequiredToposort) return toposort$1.exports; 57491 hasRequiredToposort = 1; 57492 toposort$1.exports = function(edges) { 57493 return toposort2(uniqueNodes(edges), edges); 57494 }; 57495 toposort$1.exports.array = toposort2; 57496 function toposort2(nodes, edges) { 57497 var cursor = nodes.length, sorted = new Array(cursor), visited = {}, i2 = cursor, outgoingEdges = makeOutgoingEdges(edges), nodesHash = makeNodesHash(nodes); 57498 edges.forEach(function(edge) { 57499 if (!nodesHash.has(edge[0]) || !nodesHash.has(edge[1])) { 57500 throw new Error("Unknown node. There is an unknown node in the supplied edges."); 57501 } 57502 }); 57503 while (i2--) { 57504 if (!visited[i2]) visit2(nodes[i2], i2, /* @__PURE__ */ new Set()); 57505 } 57506 return sorted; 57507 function visit2(node2, i3, predecessors) { 57508 if (predecessors.has(node2)) { 57509 var nodeRep; 57510 try { 57511 nodeRep = ", node was:" + JSON.stringify(node2); 57512 } catch (e2) { 57513 nodeRep = ""; 57514 } 57515 throw new Error("Cyclic dependency" + nodeRep); 57516 } 57517 if (!nodesHash.has(node2)) { 57518 throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(node2)); 57519 } 57520 if (visited[i3]) return; 57521 visited[i3] = true; 57522 var outgoing = outgoingEdges.get(node2) || /* @__PURE__ */ new Set(); 57523 outgoing = Array.from(outgoing); 57524 if (i3 = outgoing.length) { 57525 predecessors.add(node2); 57526 do { 57527 var child = outgoing[--i3]; 57528 visit2(child, nodesHash.get(child), predecessors); 57529 } while (i3); 57530 predecessors.delete(node2); 57531 } 57532 sorted[--cursor] = node2; 57533 } 57534 } 57535 function uniqueNodes(arr) { 57536 var res = /* @__PURE__ */ new Set(); 57537 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57538 var edge = arr[i2]; 57539 res.add(edge[0]); 57540 res.add(edge[1]); 57541 } 57542 return Array.from(res); 57543 } 57544 function makeOutgoingEdges(arr) { 57545 var edges = /* @__PURE__ */ new Map(); 57546 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57547 var edge = arr[i2]; 57548 if (!edges.has(edge[0])) edges.set(edge[0], /* @__PURE__ */ new Set()); 57549 if (!edges.has(edge[1])) edges.set(edge[1], /* @__PURE__ */ new Set()); 57550 edges.get(edge[0]).add(edge[1]); 57551 } 57552 return edges; 57553 } 57554 function makeNodesHash(arr) { 57555 var res = /* @__PURE__ */ new Map(); 57556 for (var i2 = 0, len = arr.length; i2 < len; i2++) { 57557 res.set(arr[i2], i2); 57558 } 57559 return res; 57560 } 57561 return toposort$1.exports; 57562 } 57563 var toposortExports = requireToposort(); 57564 const toposort = /* @__PURE__ */ getDefaultExportFromCjs(toposortExports); 57565 function sortFields(fields, excludedEdges = []) { 57566 let edges = []; 57567 let nodes = /* @__PURE__ */ new Set(); 57568 let excludes = new Set(excludedEdges.map(([a2, b2]) => `${a2}-${b2}`)); 57569 function addNode(depPath, key) { 57570 let node2 = propertyExprExports.split(depPath)[0]; 57571 nodes.add(node2); 57572 if (!excludes.has(`${key}-${node2}`)) edges.push([key, node2]); 57573 } 57574 for (const key in fields) if (has(fields, key)) { 57575 let value = fields[key]; 57576 nodes.add(key); 57577 if (Reference.isRef(value) && value.isSibling) addNode(value.path, key); 57578 else if (isSchema(value) && "deps" in value) value.deps.forEach((path) => addNode(path, key)); 57579 } 57580 return toposort.array(Array.from(nodes), edges).reverse(); 57581 } 57582 function findIndex(arr, err) { 57583 let idx = Infinity; 57584 arr.some((key, ii2) => { 57585 var _err$path; 57586 if (((_err$path = err.path) == null ? void 0 : _err$path.indexOf(key)) !== -1) { 57587 idx = ii2; 57588 return true; 57589 } 57590 }); 57591 return idx; 57592 } 57593 function sortByKeyOrder(keys2) { 57594 return (a2, b2) => { 57595 return findIndex(keys2, a2) - findIndex(keys2, b2); 57596 }; 57597 } 57598 function _extends$1() { 57599 _extends$1 = Object.assign || function(target) { 57600 for (var i2 = 1; i2 < arguments.length; i2++) { 57601 var source = arguments[i2]; 57602 for (var key in source) { 57603 if (Object.prototype.hasOwnProperty.call(source, key)) { 57604 target[key] = source[key]; 57605 } 57606 } 57607 } 57608 return target; 57609 }; 57610 return _extends$1.apply(this, arguments); 57611 } 57612 let isObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]"; 57613 function unknown(ctx, value) { 57614 let known = Object.keys(ctx.fields); 57615 return Object.keys(value).filter((key) => known.indexOf(key) === -1); 57616 } 57617 const defaultSort = sortByKeyOrder([]); 57618 class ObjectSchema extends BaseSchema { 57619 constructor(spec) { 57620 super({ 57621 type: "object" 57622 }); 57623 this.fields = /* @__PURE__ */ Object.create(null); 57624 this._sortErrors = defaultSort; 57625 this._nodes = []; 57626 this._excludedEdges = []; 57627 this.withMutation(() => { 57628 this.transform(function coerce(value) { 57629 if (typeof value === "string") { 57630 try { 57631 value = JSON.parse(value); 57632 } catch (err) { 57633 value = null; 57634 } 57635 } 57636 if (this.isType(value)) return value; 57637 return null; 57638 }); 57639 if (spec) { 57640 this.shape(spec); 57641 } 57642 }); 57643 } 57644 _typeCheck(value) { 57645 return isObject(value) || typeof value === "function"; 57646 } 57647 _cast(_value, options2 = {}) { 57648 var _options$stripUnknown; 57649 let value = super._cast(_value, options2); 57650 if (value === void 0) return this.getDefault(); 57651 if (!this._typeCheck(value)) return value; 57652 let fields = this.fields; 57653 let strip = (_options$stripUnknown = options2.stripUnknown) != null ? _options$stripUnknown : this.spec.noUnknown; 57654 let props = this._nodes.concat(Object.keys(value).filter((v2) => this._nodes.indexOf(v2) === -1)); 57655 let intermediateValue = {}; 57656 let innerOptions = _extends$1({}, options2, { 57657 parent: intermediateValue, 57658 __validating: options2.__validating || false 57659 }); 57660 let isChanged = false; 57661 for (const prop of props) { 57662 let field = fields[prop]; 57663 let exists = has(value, prop); 57664 if (field) { 57665 let fieldValue; 57666 let inputValue = value[prop]; 57667 innerOptions.path = (options2.path ? `${options2.path}.` : "") + prop; 57668 field = field.resolve({ 57669 value: inputValue, 57670 context: options2.context, 57671 parent: intermediateValue 57672 }); 57673 let fieldSpec = "spec" in field ? field.spec : void 0; 57674 let strict2 = fieldSpec == null ? void 0 : fieldSpec.strict; 57675 if (fieldSpec == null ? void 0 : fieldSpec.strip) { 57676 isChanged = isChanged || prop in value; 57677 continue; 57678 } 57679 fieldValue = !options2.__validating || !strict2 ? ( 57680 // TODO: use _cast, this is double resolving 57681 field.cast(value[prop], innerOptions) 57682 ) : value[prop]; 57683 if (fieldValue !== void 0) { 57684 intermediateValue[prop] = fieldValue; 57685 } 57686 } else if (exists && !strip) { 57687 intermediateValue[prop] = value[prop]; 57688 } 57689 if (intermediateValue[prop] !== value[prop]) { 57690 isChanged = true; 57691 } 57692 } 57693 return isChanged ? intermediateValue : value; 57694 } 57695 _validate(_value, opts = {}, callback) { 57696 let errors = []; 57697 let { 57698 sync, 57699 from: from2 = [], 57700 originalValue = _value, 57701 abortEarly = this.spec.abortEarly, 57702 recursive = this.spec.recursive 57703 } = opts; 57704 from2 = [{ 57705 schema: this, 57706 value: originalValue 57707 }, ...from2]; 57708 opts.__validating = true; 57709 opts.originalValue = originalValue; 57710 opts.from = from2; 57711 super._validate(_value, opts, (err, value) => { 57712 if (err) { 57713 if (!ValidationError.isError(err) || abortEarly) { 57714 return void callback(err, value); 57715 } 57716 errors.push(err); 57717 } 57718 if (!recursive || !isObject(value)) { 57719 callback(errors[0] || null, value); 57720 return; 57721 } 57722 originalValue = originalValue || value; 57723 let tests = this._nodes.map((key) => (_2, cb) => { 57724 let path = key.indexOf(".") === -1 ? (opts.path ? `${opts.path}.` : "") + key : `${opts.path || ""}["${key}"]`; 57725 let field = this.fields[key]; 57726 if (field && "validate" in field) { 57727 field.validate(value[key], _extends$1({}, opts, { 57728 // @ts-ignore 57729 path, 57730 from: from2, 57731 // inner fields are always strict: 57732 // 1. this isn't strict so the casting will also have cast inner values 57733 // 2. this is strict in which case the nested values weren't cast either 57734 strict: true, 57735 parent: value, 57736 originalValue: originalValue[key] 57737 }), cb); 57738 return; 57739 } 57740 cb(null); 57741 }); 57742 runTests({ 57743 tests, 57744 value, 57745 errors, 57746 endEarly: abortEarly, 57747 sort: this._sortErrors, 57748 path: opts.path 57749 }, callback); 57750 }); 57751 } 57752 clone(spec) { 57753 const next2 = super.clone(spec); 57754 next2.fields = _extends$1({}, this.fields); 57755 next2._nodes = this._nodes; 57756 next2._excludedEdges = this._excludedEdges; 57757 next2._sortErrors = this._sortErrors; 57758 return next2; 57759 } 57760 concat(schema) { 57761 let next2 = super.concat(schema); 57762 let nextFields = next2.fields; 57763 for (let [field, schemaOrRef] of Object.entries(this.fields)) { 57764 const target = nextFields[field]; 57765 if (target === void 0) { 57766 nextFields[field] = schemaOrRef; 57767 } else if (target instanceof BaseSchema && schemaOrRef instanceof BaseSchema) { 57768 nextFields[field] = schemaOrRef.concat(target); 57769 } 57770 } 57771 return next2.withMutation(() => next2.shape(nextFields, this._excludedEdges)); 57772 } 57773 getDefaultFromShape() { 57774 let dft = {}; 57775 this._nodes.forEach((key) => { 57776 const field = this.fields[key]; 57777 dft[key] = "default" in field ? field.getDefault() : void 0; 57778 }); 57779 return dft; 57780 } 57781 _getDefault() { 57782 if ("default" in this.spec) { 57783 return super._getDefault(); 57784 } 57785 if (!this._nodes.length) { 57786 return void 0; 57787 } 57788 return this.getDefaultFromShape(); 57789 } 57790 shape(additions, excludes = []) { 57791 let next2 = this.clone(); 57792 let fields = Object.assign(next2.fields, additions); 57793 next2.fields = fields; 57794 next2._sortErrors = sortByKeyOrder(Object.keys(fields)); 57795 if (excludes.length) { 57796 if (!Array.isArray(excludes[0])) excludes = [excludes]; 57797 next2._excludedEdges = [...next2._excludedEdges, ...excludes]; 57798 } 57799 next2._nodes = sortFields(fields, next2._excludedEdges); 57800 return next2; 57801 } 57802 pick(keys2) { 57803 const picked = {}; 57804 for (const key of keys2) { 57805 if (this.fields[key]) picked[key] = this.fields[key]; 57806 } 57807 return this.clone().withMutation((next2) => { 57808 next2.fields = {}; 57809 return next2.shape(picked); 57810 }); 57811 } 57812 omit(keys2) { 57813 const next2 = this.clone(); 57814 const fields = next2.fields; 57815 next2.fields = {}; 57816 for (const key of keys2) { 57817 delete fields[key]; 57818 } 57819 return next2.withMutation(() => next2.shape(fields)); 57820 } 57821 from(from2, to2, alias) { 57822 let fromGetter = propertyExprExports.getter(from2, true); 57823 return this.transform((obj) => { 57824 if (obj == null) return obj; 57825 let newObj = obj; 57826 if (has(obj, from2)) { 57827 newObj = _extends$1({}, obj); 57828 if (!alias) delete newObj[from2]; 57829 newObj[to2] = fromGetter(obj); 57830 } 57831 return newObj; 57832 }); 57833 } 57834 noUnknown(noAllow = true, message = object.noUnknown) { 57835 if (typeof noAllow === "string") { 57836 message = noAllow; 57837 noAllow = true; 57838 } 57839 let next2 = this.test({ 57840 name: "noUnknown", 57841 exclusive: true, 57842 message, 57843 test(value) { 57844 if (value == null) return true; 57845 const unknownKeys = unknown(this.schema, value); 57846 return !noAllow || unknownKeys.length === 0 || this.createError({ 57847 params: { 57848 unknown: unknownKeys.join(", ") 57849 } 57850 }); 57851 } 57852 }); 57853 next2.spec.noUnknown = noAllow; 57854 return next2; 57855 } 57856 unknown(allow = true, message = object.noUnknown) { 57857 return this.noUnknown(!allow, message); 57858 } 57859 transformKeys(fn2) { 57860 return this.transform((obj) => obj && mapKeys(obj, (_2, key) => fn2(key))); 57861 } 57862 camelCase() { 57863 return this.transformKeys(camelCase); 57864 } 57865 snakeCase() { 57866 return this.transformKeys(snakeCase); 57867 } 57868 constantCase() { 57869 return this.transformKeys((key) => snakeCase(key).toUpperCase()); 57870 } 57871 describe() { 57872 let base = super.describe(); 57873 base.fields = mapValues(this.fields, (value) => value.describe()); 57874 return base; 57875 } 57876 } 57877 function create$2(spec) { 57878 return new ObjectSchema(spec); 57879 } 57880 create$2.prototype = ObjectSchema.prototype; 57881 function _extends() { 57882 _extends = Object.assign || function(target) { 57883 for (var i2 = 1; i2 < arguments.length; i2++) { 57884 var source = arguments[i2]; 57885 for (var key in source) { 57886 if (Object.prototype.hasOwnProperty.call(source, key)) { 57887 target[key] = source[key]; 57888 } 57889 } 57890 } 57891 return target; 57892 }; 57893 return _extends.apply(this, arguments); 57894 } 57895 function create$1(type) { 57896 return new ArraySchema(type); 57897 } 57898 class ArraySchema extends BaseSchema { 57899 constructor(type) { 57900 super({ 57901 type: "array" 57902 }); 57903 this.innerType = void 0; 57904 this.innerType = type; 57905 this.withMutation(() => { 57906 this.transform(function(values) { 57907 if (typeof values === "string") try { 57908 values = JSON.parse(values); 57909 } catch (err) { 57910 values = null; 57911 } 57912 return this.isType(values) ? values : null; 57913 }); 57914 }); 57915 } 57916 _typeCheck(v2) { 57917 return Array.isArray(v2); 57918 } 57919 get _subType() { 57920 return this.innerType; 57921 } 57922 _cast(_value, _opts) { 57923 const value = super._cast(_value, _opts); 57924 if (!this._typeCheck(value) || !this.innerType) return value; 57925 let isChanged = false;
57926 const castArray = value.map((v2, idx) => { 57927 const castElement = this.innerType.cast(v2, _extends({}, _opts, { 57928 path: `${_opts.path || ""}[${idx}]` 57929 })); 57930 if (castElement !== v2) { 57931 isChanged = true; 57932 } 57933 return castElement; 57934 }); 57935 return isChanged ? castArray : value; 57936 } 57937 _validate(_value, options2 = {}, callback) { 57938 var _options$abortEarly, _options$recursive; 57939 let errors = []; 57940 options2.sync; 57941 let path = options2.path; 57942 let innerType = this.innerType; 57943 let endEarly = (_options$abortEarly = options2.abortEarly) != null ? _options$abortEarly : this.spec.abortEarly; 57944 let recursive = (_options$recursive = options2.recursive) != null ? _options$recursive : this.spec.recursive; 57945 let originalValue = options2.originalValue != null ? options2.originalValue : _value; 57946 super._validate(_value, options2, (err, value) => { 57947 if (err) { 57948 if (!ValidationError.isError(err) || endEarly) { 57949 return void callback(err, value); 57950 } 57951 errors.push(err); 57952 } 57953 if (!recursive || !innerType || !this._typeCheck(value)) { 57954 callback(errors[0] || null, value); 57955 return; 57956 } 57957 originalValue = originalValue || value; 57958 let tests = new Array(value.length); 57959 for (let idx = 0; idx < value.length; idx++) { 57960 let item = value[idx]; 57961 let path2 = `${options2.path || ""}[${idx}]`; 57962 let innerOptions = _extends({}, options2, { 57963 path: path2, 57964 strict: true, 57965 parent: value, 57966 index: idx, 57967 originalValue: originalValue[idx] 57968 }); 57969 tests[idx] = (_2, cb) => innerType.validate(item, innerOptions, cb); 57970 } 57971 runTests({ 57972 path, 57973 value, 57974 errors, 57975 endEarly, 57976 tests 57977 }, callback); 57978 }); 57979 } 57980 clone(spec) { 57981 const next2 = super.clone(spec); 57982 next2.innerType = this.innerType; 57983 return next2; 57984 } 57985 concat(schema) { 57986 let next2 = super.concat(schema); 57987 next2.innerType = this.innerType; 57988 if (schema.innerType) next2.innerType = next2.innerType ? ( 57989 // @ts-expect-error Lazy doesn't have concat() 57990 next2.innerType.concat(schema.innerType) 57991 ) : schema.innerType; 57992 return next2; 57993 } 57994 of(schema) { 57995 let next2 = this.clone(); 57996 if (!isSchema(schema)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema)); 57997 next2.innerType = schema; 57998 return next2; 57999 } 58000 length(length2, message = array.length) { 58001 return this.test({ 58002 message, 58003 name: "length", 58004 exclusive: true, 58005 params: { 58006 length: length2 58007 }, 58008 test(value) { 58009 return isAbsent(value) || value.length === this.resolve(length2); 58010 } 58011 }); 58012 } 58013 min(min2, message) { 58014 message = message || array.min; 58015 return this.test({ 58016 message, 58017 name: "min", 58018 exclusive: true, 58019 params: { 58020 min: min2 58021 }, 58022 // FIXME(ts): Array<typeof T> 58023 test(value) { 58024 return isAbsent(value) || value.length >= this.resolve(min2); 58025 } 58026 }); 58027 } 58028 max(max2, message) { 58029 message = message || array.max; 58030 return this.test({ 58031 message, 58032 name: "max", 58033 exclusive: true, 58034 params: { 58035 max: max2 58036 }, 58037 test(value) { 58038 return isAbsent(value) || value.length <= this.resolve(max2); 58039 } 58040 }); 58041 } 58042 ensure() { 58043 return this.default(() => []).transform((val, original) => { 58044 if (this._typeCheck(val)) return val; 58045 return original == null ? [] : [].concat(original); 58046 }); 58047 } 58048 compact(rejector) {
58049 let reject = !rejector ? (v2) => !!v2 : (v2, i2, a2) => !rejector(v2, i2, a2); 58050 return this.transform((values) => values != null ? values.filter(reject) : values); 58051 } 58052 describe() { 58053 let base = super.describe(); 58054 if (this.innerType) base.innerType = this.innerType.describe(); 58055 return base; 58056 } 58057 nullable(isNullable = true) { 58058 return super.nullable(isNullable); 58059 } 58060 defined() { 58061 return super.defined(); 58062 } 58063 required(msg) { 58064 return super.required(msg); 58065 } 58066 } 58067 create$1.prototype = ArraySchema.prototype; 58068 function create(builder) { 58069 return new Lazy(builder); 58070 } 58071 class Lazy { 58072 constructor(builder) { 58073 this.type = "lazy"; 58074 this.__isYupSchema__ = true; 58075 this.__inputType = void 0; 58076 this.__outputType = void 0; 58077 this._resolve = (value, options2 = {}) => { 58078 let schema = this.builder(value, options2); 58079 if (!isSchema(schema)) throw new TypeError("lazy() functions must return a valid schema"); 58080 return schema.resolve(options2); 58081 }; 58082 this.builder = builder; 58083 } 58084 resolve(options2) { 58085 return this._resolve(options2.value, options2); 58086 } 58087 cast(value, options2) { 58088 return this._resolve(value, options2).cast(value, options2); 58089 } 58090 validate(value, options2, maybeCb) { 58091 return this._resolve(value, options2).validate(value, options2, maybeCb); 58092 } 58093 validateSync(value, options2) { 58094 return this._resolve(value, options2).validateSync(value, options2); 58095 } 58096 validateAt(path, value, options2) { 58097 return this._resolve(value, options2).validateAt(path, value, options2); 58098 } 58099 validateSyncAt(path, value, options2) { 58100 return this._resolve(value, options2).validateSyncAt(path, value, options2); 58101 } 58102 describe() { 58103 return null; 58104 } 58105 isValid(value, options2) { 58106 return this._resolve(value, options2).isValid(value, options2); 58107 } 58108 isValidSync(value, options2) { 58109 return this._resolve(value, options2).isValidSync(value, options2); 58110 } 58111 } 58112 function setLocale(custom) { 58113 Object.keys(custom).forEach((type) => { 58114 Object.keys(custom[type]).forEach((method) => { 58115 locale[type][method] = custom[type][method]; 58116 }); 58117 }); 58118 } 58119 function addMethod(schemaType, name, fn2) { 58120 if (!schemaType || !isSchema(schemaType.prototype)) throw new TypeError("You must provide a yup schema constructor function"); 58121 if (typeof name !== "string") throw new TypeError("A Method name must be provided"); 58122 if (typeof fn2 !== "function") throw new TypeError("Method function must be provided"); 58123 schemaType.prototype[name] = fn2; 58124 } 58125 const t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 58126 __proto__: null, 58127 ArraySchema, 58128 BaseSchema, 58129 BooleanSchema, 58130 DateSchema, 58131 MixedSchema: Mixed, 58132 NumberSchema, 58133 ObjectSchema, 58134 StringSchema, 58135 ValidationError, 58136 addMethod, 58137 array: create$1, 58138 bool: create$6, 58139 boolean: create$6, 58140 date: create$3, 58141 isSchema, 58142 lazy: create, 58143 mixed: create$7, 58144 number: create$4, 58145 object: create$2, 58146 reach, 58147 ref: create$8, 58148 setLocale, 58149 string: create$5 58150 }, Symbol.toStringTag, { value: "Module" })); 58151 setLocale({ mixed: { required: "This field is required." }, string: { email: "Email must be valid.", min: "Must have more than ${min} characters.", max: "Must have less than ${max} characters." }, number: { positive: "Must be greater than 0.", min: "Must not be lower than ${min}.", max: "Must not be higher than ${max}.", integer: "Must be an integer." } }); 58152 addMethod(create$5, "fullName", function(i2) { 58153 return this.test("fullName", i2, function(n2) { 58154 return !n2 || n2.trim().includes(" ") || this.createError({ path: this.path, message: i2 }); 58155 }); 58156 }); 58157 addMethod(create$5, "latin", function(i2) { 58158 return this.test("latin", i2, function(n2) { 58159 return !n2 || m$3(n2) || this.createError({ path: this.path, message: i2 }); 58160 }); 58161 }); 58162 addMethod(create$5, "notEmail", function(i2) { 58163 return this.test("notEmail", i2, function(n2) { 58164 return !create$5().email().isValidSync(n2) || this.createError({ path: this.path, message: i2 }); 58165 }); 58166 }); 58167 addMethod(create$5, "notPOBox", function(i2) { 58168 return this.test("notPOBox", i2, function(n2) { 58169 return !n2 || !d$3(n2) || this.createError({ path: this.path, message: i2 }); 58170 }); 58171 }); 58172 addMethod(create$5, "noHTML", function(i2 = "Must not include HTML tags.") { 58173 return this.test("noHTML", i2, function(n2) { 58174 return !n2 || !V$2(n2) || this.createError({ path: this.path, message: i2 }); 58175 }); 58176 }); 58177 var u = t; 58178 const useFormValidation = ({ topics }) => { 58179 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58180 const validationSchema = reactExports.useMemo( 58181 () => u.object().shape({ 58182 email: u.string().required(t2("email_required_error")).email(t2("email_invalid_error")), 58183 fullName: u.string().required(t2("full_name_required_error")), 58184 topic: u.string().required(t2("topic_required_error")), 58185 subTopic: u.string().test( 58186 "isRequired", 58187 t2("sub_topic_required_error"), 58188 (value, { parent, options: options2 }) => { 58189 var _a, _b; 58190 const selectedTopicId = parent.topic; 58191 const selectedTopic = ((_a = options2.context) == null ? void 0 : _a.topics).find( 58192 ({ root: root2 }) => root2.id === selectedTopicId 58193 ); 58194 if (((_b = selectedTopic == null ? void 0 : selectedTopic.children) == null ? void 0 : _b.length) && !value) { 58195 return false;
58196 } 58197 return true; 58198 } 58199 ), 58200 message: u.string().required(t2("message_required_error")).min(15, ({ min: min2 }) => t2("message_min_length_error", { count: min2 })) 58201 }), 58202 [t2] 58203 ); 58204 const validate = (values) => { 58205 try { 58206 validateYupSchema(values, validationSchema, true, { 58207 topics 58208 }); 58209 } catch (err) { 58210 return yupToFormErrors(err); 58211 } 58212 return {}; 58213 }; 58214 return { 58215 validate 58216 }; 58217 }; 58218 const TranslatableForm = ({ children }) => { 58219 const { i18n } = useTranslation(); 58220 const { errors, touched, setFieldTouched } = y$4(); 58221 reactExports.useEffect(() => { 58222 const handleLanguageChanged = () => { 58223 Object.keys(errors).forEach((fieldName) => { 58224 if (Object.keys(touched).includes(fieldName)) { 58225 setFieldTouched(fieldName); 58226 } 58227 }); 58228 }; 58229 i18n.on("languageChanged", handleLanguageChanged); 58230 return () => { 58231 i18n.off("languageChanged", handleLanguageChanged); 58232 }; 58233 }, [errors, touched, setFieldTouched, i18n]); 58234 return /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { children }); 58235 }; 58236 const Container$7 = dt$2.div` 58237 padding: var(--space-300); 58238 border-radius: var(--panel-radius-normal); 58239 background: var(--bg-secondary); 58240 font-size: var(--font-size-300); 58241 line-height: var(--font-line-height-300); 58242`; 58243 const Title$1 = dt$2.div` 58244 color: var(--text-primary); 58245 font-weight: var(--font-weight-500); 58246 margin-bottom: var(--space-150); 58247`; 58248 const Text = dt$2.div` 58249 color: var(--text-secondary); 58250 58251 a { 58252 text-decoration: underline; 58253 58254 &:hover { 58255 color: var(--text-primary); 58256 } 58257 } 58258 58259 b, 58260 strong { 58261 font-weight: var(--font-weight-500); 58262 } 58263 58264 i { 58265 font-style: italic; 58266 } 58267 58268 ul, 58269 ol { 58270 margin: var(--space-150) 0; 58271 margin-left: var(--space-200); 58272 padding-left: var(--space-300); 58273 } 58274 58275 ul { 58276 list-style-type: disc; 58277 } 58278 58279 ol { 58280 list-style-type: decimal; 58281 } 58282 58283 li { 58284 margin-bottom: var(--space-100); 58285 58286 &:last-child { 58287 margin-bottom: 0; 58288 } 58289 } 58290`; 58291 const TopicAdditionalInfo = ({ title, children }) => { 58292 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$7, { children: [ 58293 title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$1, { children: title }), 58294 children && /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { dangerouslySetInnerHTML: { __html: children } }) 58295 ] }); 58296 }; 58297 const getTopicById = (topics, id2) => { 58298 const topic = topics.find((topic2) => topic2.root.id === id2); 58299 if (topic) return topic.root; 58300 return topics.flatMap((topic2) => topic2.children).find((child) => child.id === id2); 58301 }; 58302 const getTopicOptions = (topics, parentId) => { 58303 var _a; 58304 const topicData = parentId === void 0 ? topics.map((topic) => topic.root) : (_a = topics.find((topic) => topic.root.id === parentId)) == null ? void 0 : _a.children; 58305 return (topicData == null ? void 0 : topicData.map((topic) => ({ label: topic.value, value: topic.id }))) || []; 58306 }; 58307 const List = dt$2.ul` 58308 display: flex; 58309 flex-direction: column; 58310 gap: var(--space-200); 58311 margin: 0; 58312 padding: 0; 58313 list-style: none; 58314`; 58315 const Item = dt$2.li` 58316 display: flex; 58317 align-items: center; 58318 gap: var(--space-200); 58319`; 58320 const Name$2 = dt$2.span` 58321 font-size: var(--font-size-400); 58322 line-height: var(--font-line-height-400); 58323 letter-spacing: var(--font-letter-spacing-normal); 58324`; 58325 const LoaderContainer = dt$2.div` 58326 display: flex; 58327 align-items: center; 58328 justify-content: center; 58329 width: 12px; 58330 height: 12px; 58331`; 58332 const FileListItem = ({ name, status, onRemove }) => { 58333 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm.attachments" }); 58334 const isLoading = status === "LOADING"; 58335 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Item, { children: [
58336 isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "small" }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: onRemove, "aria-label": t2("remove_file_label"), children: /* @__PURE__ */ jsxRuntimeExports.jsx($4, { height: 12 }) }), 58337 /* @__PURE__ */ jsxRuntimeExports.jsx(Name$2, { children: name }) 58338 ] }); 58339 }; 58340 const FileList = ({ children }) => { 58341 return /* @__PURE__ */ jsxRuntimeExports.jsx(List, { children }); 58342 }; 58343 FileList.Item = FileListItem; 58344 const useUploadAttachmentMutation = U$2(CXContactApiClient.uploadAttachment, { 58345 mutationKey: ["uploadAttachment"] 58346 }); 58347 const useAttachmentFiles = () => { 58348 const [files, setFiles] = reactExports.useState([]); 58349 const { uploadAttachmentMutation } = useUploadAttachmentMutation(); 58350 const { addRecaptchaRequestInterceptor, removeRecaptchaRequestInterceptor } = Gr(); 58351 const updateFile = (file) => { 58352 setFiles((prev2) => prev2.map((oldFile) => oldFile.id === file.id ? file : oldFile)); 58353 }; 58354 const removeFile = (id2) => { 58355 setFiles((prev2) => prev2.filter((file) => file.id !== id2)); 58356 }; 58357 const uploadFiles = (acceptedFiles) => __async(null, null, function* () { 58358 const newFiles = acceptedFiles.map((file) => ({ 58359 id: crypto.randomUUID(), 58360 name: file.name, 58361 status: "LOADING" 58362 })); 58363 setFiles((prev2) => [...prev2, ...newFiles]); 58364 yield addRecaptchaRequestInterceptor(CXContactApiClient, "attachment_upload"); 58365 yield Promise.all( 58366 acceptedFiles.map((file, index2) => __async(null, null, function* () { 58367 try { 58368 const data = yield uploadAttachmentMutation.mutateAsync([file]); 58369 updateFile(__spreadProps(__spreadValues({}, newFiles[index2]), { status: "SUCCESS", url: data.fileUrl })); 58370 } catch (e2) { 58371 removeFile(newFiles[index2].id); 58372 } 58373 })) 58374 ); 58375 yield removeRecaptchaRequestInterceptor(CXContactApiClient); 58376 }); 58377 return { 58378 files, 58379 uploadFiles, 58380 removeFile 58381 }; 58382 }; 58383 const Container$6 = dt$2.div` 58384 display: flex; 58385 flex-direction: column; 58386 gap: var(--space-200); 58387 margin-top: var(--space-400); 58388`; 58389 const Attachments = ({ onChange }) => { 58390 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm.attachments" }); 58391 const { files, uploadFiles, removeFile } = useAttachmentFiles(); 58392 const { open, getInputProps } = useDropzone({ 58393 onDropAccepted: uploadFiles, 58394 maxSize: 10 * 1024 * 1024, 58395 // 10MB 58396 accept: { 58397 // Images 58398 "image/jpeg": [], 58399 "image/png": [], 58400 "image/gif": [], 58401 "image/webp": [], 58402 // Documents 58403 "application/pdf": [], 58404 "application/msword": [], 58405 "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [], 58406 "text/plain": [], 58407 // CSV/Excel 58408 "text/csv": [], 58409 "application/vnd.ms-excel": [], 58410 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [] 58411 } 58412 }); 58413 reactExports.useEffect(() => { 58414 const fileUrls = files.filter((file) => file.status === "SUCCESS" && file.url).map((file) => file.url); 58415 onChange == null ? void 0 : onChange(fileUrls); 58416 }, [files]); 58417 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$6, { children: [
58418 /* @__PURE__ */ jsxRuntimeExports.jsx("input", __spreadValues({}, getInputProps())), 58419 /* @__PURE__ */ jsxRuntimeExports.jsx( 58420 ButtonClean, 58421 { 58422 appearance: "inherit", 58423 withUnderline: false, 58424 icon: ps, 58425 label: t2("add_button_label"), 58426 onClick: open 58427 } 58428 ), 58429 /* @__PURE__ */ jsxRuntimeExports.jsx(FileList, { children: files.map((file) => /* @__PURE__ */ jsxRuntimeExports.jsx( 58430 FileList.Item, 58431 { 58432 name: file.name, 58433 status: file.status, 58434 onRemove: () => removeFile(file.id) 58435 }, 58436 file.id 58437 )) }) 58438 ] }); 58439 }; 58440 const useIsUploadingAttachment = () => { 58441 const isUploading = useIsMutating({ mutationKey: ["uploadAttachment"] }) > 0; 58442 return { isUploading }; 58443 }; 58444 const useReportFormTracking = ({ 58445 currentTopicId, 58446 firstAnswer 58447 }) => { 58448 const { trackEvent, screenId } = useAnalytics(); 58449 const { shopContextQuery } = useShopContextQuery(); 58450 const { orderData } = useOrderData(); 58451 reactExports.useEffect(() => { 58452 var _a; 58453 if (!currentTopicId) return; 58454 trackEvent("cf_topic_selected", { 58455 topic_id: currentTopicId, 58456 screen_id: screenId, 58457 shop_id: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId, 58458 order_id: orderData == null ? void 0 : orderData.id 58459 }); 58460 }, [currentTopicId]); 58461 reactExports.useEffect(() => { 58462 var _a; 58463 if (!firstAnswer) return; 58464 trackEvent("cf_first_answer_displayed", { 58465 topic_id: currentTopicId, 58466 screen_id: screenId, 58467 shop_id: (_a = shopContextQuery.data) == null ? void 0 : _a.shopId, 58468 order_id: orderData == null ? void 0 : orderData.id 58469 }); 58470 }, [firstAnswer]); 58471 }; 58472 const ReportFormContent = ({ topics, showEmailField }) => { 58473 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58474 const { values, isSubmitting, setFieldValue } = y$4(); 58475 const { isUploading: isUploadingAttachment } = useIsUploadingAttachment(); 58476 const currentTopicId = values.subTopic || values.topic; 58477 const selectedTopic = getTopicById(topics, currentTopicId); 58478 useReportFormTracking({ currentTopicId, firstAnswer: selectedTopic == null ? void 0 : selectedTopic.firstAnswer }); 58479 const topicOptions = getTopicOptions(topics); 58480 const subTopicOptions = getTopicOptions(topics, values.topic); 58481 const renderSubTopic = () => { 58482 if (!subTopicOptions.length) return null; 58483 return /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58484 Field, 58485 { 58486 component: Select, 58487 name: "subTopic", 58488 label: t2("sub_topic_label"), 58489 options: subTopicOptions 58490 } 58491 ) }) }); 58492 }; 58493 const renderSelectedTopicAdditionalInfo = () => { 58494 if (!(selectedTopic == null ? void 0 : selectedTopic.firstAnswer)) { 58495 return null; 58496 } 58497 return /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TopicAdditionalInfo, { title: selectedTopic.firstAnswer.headerPlainString, children: selectedTopic.firstAnswer.bodyHtml }) }) }); 58498 }; 58499 return /* @__PURE__ */ jsxRuntimeExports.jsx(TranslatableForm, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset, { children: [
58500 showEmailField && /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "email", label: t2("email_label") }) }) }), 58501 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "fullName", label: t2("full_name_label") }) }) }), 58502 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58503 Field, 58504 { 58505 component: Select, 58506 name: "topic", 58507 label: t2("topic_label"), 58508 options: topicOptions, 58509 onChange: () => setFieldValue("subTopic", "") 58510 } 58511 ) }) }), 58512 renderSubTopic(), 58513 renderSelectedTopicAdditionalInfo(),
58514 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58515 Field, 58516 { 58517 component: Textarea, 58518 rows: 5, 58519 name: "message", 58520 label: t2("message_label"), 58521 placeholder: t2("message_label") 58522 } 58523 ) }) }), 58524 /* @__PURE__ */ jsxRuntimeExports.jsx(Attachments, { onChange: (fileUrls) => setFieldValue("attachments", fileUrls) }), 58525 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 58526 Button$1, 58527 { 58528 label: t2("submit_label"), 58529 loading: isSubmitting, 58530 disabled: isUploadingAttachment, 58531 type: "submit", 58532 appearance: "primary", 58533 fullWidth: true 58534 } 58535 ) }) }) 58536 ] }) }); 58537 }; 58538 const useCreateReportMutation = U$2(CXContactApiClient.createReport, { 58539 mutationKey: ["createReport"] 58540 }); 58541 const useTopicTreeQuery = $$3(CXContactApiClient.getTopicTree, { 58542 queryKey: ["topicTree"] 58543 }); 58544 const isVisibleByAllowedValues = (allowedValues, selectedValues) => { 58545 if (allowedValues === void 0 || allowedValues === null) { 58546 return true; 58547 } 58548 if (allowedValues.length === 0) { 58549 return false; 58550 } 58551 return selectedValues.some((value) => allowedValues.includes(value)); 58552 }; 58553 const isTopicVisible = (topic, context) => { 58554 const passesFulfillmentFilter = isVisibleByAllowedValues( 58555 topic.allowedFulfillmentServices, 58556 context.selectedFulfillmentServices 58557 ); 58558 const passesShopFeaturesFilter = isVisibleByAllowedValues( 58559 topic.allowedShopFeatures, 58560 context.enabledShopFeatures 58561 ); 58562 return passesFulfillmentFilter && passesShopFeaturesFilter; 58563 }; 58564 const filterTopics = (topics, context) => { 58565 return topics.filter((topic) => isTopicVisible(topic, context)).map((topic) => __spreadProps(__spreadValues({}, topic), { 58566 children: topic.children.filter((child) => isTopicVisible(child, context)) 58567 })); 58568 }; 58569 var s = "core_dashboard_visited"; 58570 /*! js-cookie v3.0.5 | MIT */ 58571 function assign(target) { 58572 for (var i2 = 1; i2 < arguments.length; i2++) { 58573 var source = arguments[i2]; 58574 for (var key in source) { 58575 target[key] = source[key]; 58576 } 58577 } 58578 return target; 58579 } 58580 var defaultConverter = { 58581 read: function(value) { 58582 if (value[0] === '"') { 58583 value = value.slice(1, -1); 58584 } 58585 return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); 58586 }, 58587 write: function(value) { 58588 return encodeURIComponent(value).replace( 58589 /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, 58590 decodeURIComponent 58591 ); 58592 } 58593 }; 58594 function init(converter, defaultAttributes) { 58595 function set2(name, value, attributes) { 58596 if (typeof document === "undefined") { 58597 return; 58598 } 58599 attributes = assign({}, defaultAttributes, attributes); 58600 if (typeof attributes.expires === "number") { 58601 attributes.expires = new Date(Date.now() + attributes.expires * 864e5); 58602 } 58603 if (attributes.expires) { 58604 attributes.expires = attributes.expires.toUTCString(); 58605 } 58606 name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); 58607 var stringifiedAttributes = ""; 58608 for (var attributeName in attributes) { 58609 if (!attributes[attributeName]) { 58610 continue; 58611 } 58612 stringifiedAttributes += "; " + attributeName; 58613 if (attributes[attributeName] === true) { 58614 continue; 58615 } 58616 stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; 58617 } 58618 return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes; 58619 } 58620 function get2(name) { 58621 if (typeof document === "undefined" || arguments.length && !name) { 58622 return; 58623 } 58624 var cookies2 = document.cookie ? document.cookie.split("; ") : []; 58625 var jar = {}; 58626 for (var i2 = 0;
58626 i2 < cookies2.length; i2++) { 58627 var parts = cookies2[i2].split("="); 58628 var value = parts.slice(1).join("="); 58629 try { 58630 var found = decodeURIComponent(parts[0]); 58631 jar[found] = converter.read(value, found); 58632 if (name === found) { 58633 break; 58634 } 58635 } catch (e2) { 58636 } 58637 } 58638 return name ? jar[name] : jar; 58639 } 58640 return Object.create( 58641 { 58642 set: set2, 58643 get: get2, 58644 remove: function(name, attributes) { 58645 set2( 58646 name, 58647 "", 58648 assign({}, attributes, { 58649 expires: -1 58650 }) 58651 ); 58652 }, 58653 withAttributes: function(attributes) { 58654 return init(this.converter, assign({}, this.attributes, attributes)); 58655 }, 58656 withConverter: function(converter2) { 58657 return init(assign({}, this.converter, converter2), this.attributes); 58658 } 58659 }, 58660 { 58661 attributes: { value: Object.freeze(defaultAttributes) }, 58662 converter: { value: Object.freeze(converter) } 58663 } 58664 ); 58665 } 58666 init(defaultConverter, { path: "/" }); 58667 reactExports.createContext(void 0); 58668 const getIsCreator = () => { 58669 return document.cookie.split("; ").some((cookie) => cookie.startsWith(`${s}=`)); 58670 }; 58671 const getTopicByFriendlyId = (topics, friendlyId) => { 58672 const topic = topics.find((topic2) => topic2.root.friendlyId === friendlyId); 58673 if (topic) return topic.root; 58674 return topics.flatMap((topic2) => topic2.children).find((child) => child.friendlyId === friendlyId); 58675 }; 58676 const ReportForm = ({ topicPath, showEmailField = true }) => { 58677 var _a, _b, _c; 58678 const { orderData, selectedVariantIds, selectedVariantsData } = useOrderData(); 58679 const location = useLocation(); 58680 const isOrderPlaced = location.pathname.includes(routes.contact.orderPlaced.self); 58681 const orderId = isOrderPlaced ? orderData == null ? void 0 : orderData.id : void 0; 58682 const { t: t2 } = useTranslation("modules", { keyPrefix: "reportForm" }); 58683 const { isAuthorized, email, friendlyId, logout } = useOrderAuth(); 58684 const navigate = useNavigate(); 58685 const [searchParams] = useSearchParams(); 58686 const { shopContextQuery } = useShopContextQuery(); 58687 const orderParams = isAuthorized && orderId && friendlyId && email ? { orderId, orderFriendlyId: friendlyId, supporterEmail: email } : {}; 58688 const { topicTreeQuery } = useTopicTreeQuery([ 58689 __spreadValues({ 58690 path: topicPath, 58691 isCreator: getIsCreator() 58692 }, orderParams) 58693 ]); 58694 const { createReportMutation } = useCreateReportMutation({ 58695 // NOTE: remove default error handling, because we handle it in the formik level 58696 onError: void 0 58697 }); 58698 const { addRecaptchaRequestInterceptor, removeRecaptchaRequestInterceptor } = Gr(); 58699 const contactEmail = (_a = shopContextQuery.data) == null ? void 0 : _a.contactEmail; 58700 const topics = reactExports.useMemo(() => { 58701 var _a2, _b2; 58702 return (_b2 = (_a2 = topicTreeQuery.data) == null ? void 0 : _a2.topics) != null ? _b2 : []; 58703 }, [topicTreeQuery.data]); 58704 const selectedFulfillmentServices = reactExports.useMemo( 58705 () => [ 58706 ...new Set( 58707 selectedVariantsData.map((variant) => variant.fulfillmentService).filter((service) => service !== void 0) 58708 ) 58709 ], 58710 [selectedVariantsData] 58711 ); 58712 const enabledShopFeatures = reactExports.useMemo( 58713 () => { 58714 var _a2, _b2; 58715 return (_b2 = (_a2 = shopContextQuery.data) == null ? void 0 : _a2.enabledFeatures) != null ? _b2 : []; 58716 }, 58717 [(_b = shopContextQuery.data) == null ? void 0 : _b.enabledFeatures] 58718 ); 58719 const filteredTopics = reactExports.useMemo( 58720 () => filterTopics(topics, { selectedFulfillmentServices, enabledShopFeatures }), 58721 [topics, selectedFulfillmentServices, enabledShopFeatures] 58722 ); 58723 const { validate } = useFormValidation({ topics: filteredTopics }); 58724 const topicFriendlyIdParam = searchParams.get("topicId"); 58725 const initialTopicFromUrl = reactExports.useMemo(() => { 58726 if (!topicFriendlyIdParam) return void 0;
58727 return getTopicByFriendlyId(filteredTopics, topicFriendlyIdParam); 58728 }, [filteredTopics, topicFriendlyIdParam]); 58729 const initialTopicId = reactExports.useMemo(() => { 58730 if (!initialTopicFromUrl) return ""; 58731 if (!initialTopicFromUrl.parentId) return initialTopicFromUrl.id; 58732 return initialTopicFromUrl.parentId; 58733 }, [initialTopicFromUrl]); 58734 const initialSubTopicId = reactExports.useMemo(() => { 58735 if (!initialTopicFromUrl) return ""; 58736 if (!initialTopicFromUrl.parentId) return ""; 58737 return initialTopicFromUrl.friendlyId; 58738 }, [initialTopicFromUrl]); 58739 const initialValues = reactExports.useMemo( 58740 () => { 58741 var _a2; 58742 return { 58743 email: email != null ? email : "", 58744 fullName: ((_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.shippingFullName) || "", 58745 topic: initialTopicId, 58746 subTopic: initialSubTopicId, 58747 message: "", 58748 attachments: [] 58749 }; 58750 }, 58751 [email, (_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.shippingFullName, initialTopicId, initialSubTopicId] 58752 ); 58753 const handleSubmit = (values) => __async(null, null, function* () { 58754 yield addRecaptchaRequestInterceptor(CXContactApiClient, "report_add"); 58755 try { 58756 yield createReportMutation.mutateAsync([ 58757 { 58758 orderId, 58759 topicId: values.subTopic || values.topic, 58760 isCreator: getIsCreator(), 58761 offerVariantIds: selectedVariantIds, 58762 supporterEmail: values.email, 58763 supporterFullName: values.fullName, 58764 message: values.message, 58765 attachmentUrls: values.attachments 58766 } 58767 ]); 58768 logout(); 58769 navigate(routes.contact.success); 58770 } catch (e2) { 58771 notify( 58772 contactEmail ? /* @__PURE__ */ jsxRuntimeExports.jsx( 58773 Trans, 58774 { 58775 t: t2, 58776 i18nKey: "submit_error", 58777 components: { 58778 emailLink: /* @__PURE__ */ jsxRuntimeExports.jsx( 58779 ButtonClean, 58780 { 58781 appearance: "inherit", 58782 label: contactEmail, 58783 href: `mailto:${contactEmail}` 58784 } 58785 ) 58786 } 58787 } 58788 ) : t2("submit_error_no_email"), 58789 { type: "error" } 58790 ); 58791 } finally { 58792 yield removeRecaptchaRequestInterceptor(CXContactApiClient); 58793 } 58794 }); 58795 if (topicTreeQuery.isInitialLoading) { 58796 return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Loader, {}); 58797 } 58798 return /* @__PURE__ */ jsxRuntimeExports.jsx(Formik, { initialValues, validate, onSubmit: handleSubmit, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ReportFormContent, { topics: filteredTopics, showEmailField }) }); 58799 }; 58800 const Container$5 = dt$2.div` 58801 display: flex; 58802 gap: var(--space-200); 58803`; 58804 const ItemContainer$1 = dt$2.div` 58805 display: flex; 58806 align-items: center; 58807 gap: var(--space-200); 58808 background: var(--bg-secondary); 58809 border-radius: var(--panel-radius-normal); 58810 padding: var(--space-100) var(--space-200) var(--space-100) var(--space-100); 58811`; 58812 const ImageContainer$1 = dt$2.div` 58813 flex-shrink: 0; 58814 height: 40px; 58815 aspect-ratio: 3/4; 58816 background-color: var(--bg-secondary); 58817`; 58818 const Image$1 = dt$2.img` 58819 width: 100%; 58820 height: auto; 58821 object-fit: contain; 58822 border-radius: var(--image-radius-normal); 58823`; 58824 const ImagePlaceholder$1 = dt$2.div` 58825 width: 100%; 58826 height: 100%; 58827 display: flex; 58828 align-items: center; 58829 justify-content: center; 58830 border-radius: var(--image-radius-normal); 58831 color: var(--pale, var(--icon-secondary)); 58832`; 58833 const Name$1 = dt$2.span` 58834 color: var(--text-primary); 58835 font-size: var(--font-size-300); 58836 line-height: var(--font-line-height-300); 58837 letter-spacing: var(--font-letter-spacing-loose); 58838`; 58839 const ProductsThumbnailsItem = ({ imageUrl, name }) => { 58840 const renderPhoto = () => { 58841 if (!imageUrl) { 58842 return /* @__PURE__ */ jsxRuntimeExports.jsx(ImagePlaceholder$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(D9, { height: 20 }) }); 58843 } 58844 return /* @__PURE__ */ jsxRuntimeExports.jsx(Image$1, { src: imageUrl, alt: name }); 58845 }; 58846 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ItemContainer$1, { children: [
58847 /* @__PURE__ */ jsxRuntimeExports.jsx(ImageContainer$1, { children: renderPhoto() }), 58848 /* @__PURE__ */ jsxRuntimeExports.jsx(Name$1, { children: name }) 58849 ] }); 58850 }; 58851 const ProductsThumbnails = ({ children }) => { 58852 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$5, { children }); 58853 }; 58854 ProductsThumbnails.Item = ProductsThumbnailsItem; 58855 const OrderDetails = () => { 58856 const { selectedVariants, selectedVariantsData } = useOrderData(); 58857 const navigate = useNavigate(); 58858 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderDetails" }); 58859 reactExports.useEffect(() => { 58860 if (!selectedVariants.length) { 58861 navigate(routes.contact.orderPlaced.self); 58862 } 58863 }, [selectedVariants, navigate]); 58864 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 58865 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: routes.contact.orderPlaced.variants, children: t2("title") }), 58866 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsThumbnails, { children: selectedVariantsData.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 58867 ProductsThumbnails.Item, 58868 { 58869 imageUrl: variant.imageUrl, 58870 name: variant == null ? void 0 : variant.name 58871 }, 58872 variant.id 58873 )) }),
58874 /* @__PURE__ */ jsxRuntimeExports.jsx(ReportForm, { topicPath: "ORDER_ITEMS", showEmailField: false }) 58875 ] }); 58876 }; 58877 const Container$4 = dt$2(Link)` 58878 flex: 1; 58879 58880 border: 1px solid var(--input-border, var(--border-secondary)); 58881 border-radius: var(--button-radius-normal); 58882 padding: var(--space-400); 58883 color: var(--text-secondary); 58884 font-size: var(--font-size-400); 58885 line-height: var(--font-line-height-400); 58886 letter-spacing: var(--font-letter-spacing-normal, 0); 58887 text-align: center; 58888 58889 &:hover { 58890 color: var(--text-primary); 58891 border-color: var(--text-primary); 58892 } 58893 58894 ${({ $active }) => $active && lt$2` 58895 cursor: default; 58896 color: var(--text-primary); 58897 border-color: var(--text-primary); 58898 font-weight: var(--font-weight-600); 58899 box-shadow: inset 0 0 0 1px var(--text-primary); 58900 `} 58901`; 58902 const TabButton = ({ active = false, to: to2, children }) => { 58903 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$4, { $active: active, to: to2, children }); 58904 }; 58905 const Paragraph = dt$2.p` 58906 line-height: var(--font-line-height-400); 58907 letter-spacing: var(--font-letter-spacing-normal); 58908 margin: 0; 58909 58910 & + & { 58911 margin-top: var(--space-200); 58912 } 58913`; 58914 const OrderNumberSuggestionModal = () => { 58915 const { close } = useModalContext(); 58916 const navigate = useNavigate(); 58917 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderLogin" }); 58918 const handleSupportClick = () => { 58919 navigate(`${routes.contact.somethingElse}?topicId=ORDER_CONFIRMATION_ISSUE`); 58920 close(); 58921 }; 58922 return /* @__PURE__ */ jsxRuntimeExports.jsxs( 58923 ModalBox, 58924 { 58925 title: t2("order_number_suggestion_modal_title"), 58926 onClose: close, 58927 fullWidth: true, 58928 buttonsDirection: "column", 58929 buttons: [
58930 /* @__PURE__ */ jsxRuntimeExports.jsx( 58931 Button$1, 58932 { 58933 label: t2("order_number_suggestion_modal_support_button"), 58934 appearance: "semi-transparent", 58935 fullWidth: true, 58936 onClick: handleSupportClick 58937 }, 58938 "support" 58939 ), 58940 /* @__PURE__ */ jsxRuntimeExports.jsx( 58941 Button$1, 58942 { 58943 label: t2("order_number_suggestion_modal_close_button"), 58944 appearance: "primary", 58945 fullWidth: true, 58946 onClick: close 58947 }, 58948 "close" 58949 ) 58950 ], 58951 children: [ 58952 /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, { t: t2, i18nKey: "order_number_suggestion_modal_paragraph_1" }) }), 58953 /* @__PURE__ */ jsxRuntimeExports.jsx(Paragraph, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trans, { t: t2, i18nKey: "order_number_suggestion_modal_paragraph_2" }) }) 58954 ] 58955 } 58956 ); 58957 }; 58958 const Instructions = dt$2.div` 58959 color: var(--text-primary); 58960 line-height: var(--font-line-height-400); 58961 letter-spacing: var(--font-letter-spacing-normal); 58962 58963 margin-bottom: var(--space-400); 58964`; 58965 const OrderLogin = () => { 58966 const { email, friendlyId, login } = useOrderAuth(); 58967 const { fetchOrderData } = useOrderData(); 58968 const navigate = useNavigate(); 58969 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderLogin" }); 58970 const { open } = useModalContext(); 58971 const initialValues = reactExports.useMemo( 58972 () => ({ email: email != null ? email : "", friendlyId: friendlyId != null ? friendlyId : "" }), 58973 [email, friendlyId] 58974 ); 58975 const validationSchema = reactExports.useMemo( 58976 () => u.object().shape({ 58977 friendlyId: u.string().trim().required(t2("friendly_id_required_error")).matches(/^#?[A-Za-z0-9]{8}$/, t2("friendly_id_invalid_error")), 58978 email: u.string().trim().required(t2("email_required_error")).email(t2("email_invalid_error")) 58979 }), 58980 [t2] 58981 ); 58982 const handleSubmit = (values) => __async(null, null, function* () { 58983 try { 58984 yield fetchOrderData(values); 58985 login({ 58986 email: values.email, 58987 friendlyId: values.friendlyId 58988 }); 58989 navigate(routes.contact.orderPlaced.variants); 58990 } catch (e2) { 58991 notify(t2("invalid_order_error"), { type: "error" }); 58992 } 58993 }); 58994 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
58995 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { children: t2("title") }), 58996 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 58997 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.self, active: true, children: t2("primary_tab_button_label") }), 58998 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.somethingElse, children: t2("secondary_tab_button_label") }) 58999 ] }), 59000 /* @__PURE__ */ jsxRuntimeExports.jsx( 59001 Formik, 59002 { 59003 initialValues, 59004 validationSchema, 59005 onSubmit: handleSubmit, 59006 children: ({ isSubmitting }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(TranslatableForm, { children: [ 59007 /* @__PURE__ */ jsxRuntimeExports.jsx(Instructions, { children: t2("instructions") }), 59008 /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset, { children: [ 59009 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Fieldset.Item, { children: [
59010 /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "friendlyId", label: t2("friendly_id_label") }), 59011 /* @__PURE__ */ jsxRuntimeExports.jsx(Suggestion, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 59012 ButtonClean, 59013 { 59014 label: t2("friendly_id_suggestion"), 59015 onClick: () => open(OrderNumberSuggestionModal) 59016 } 59017 ) }) 59018 ] }) }), 59019 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { component: Input$1, name: "email", label: t2("email_label") }) }) }), 59020 /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Row, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fieldset.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( 59021 Button$1, 59022 { 59023 label: t2("submit_label"), 59024 loading: isSubmitting, 59025 type: "submit", 59026 appearance: "primary", 59027 fullWidth: true 59028 } 59029 ) }) }) 59030 ] }) 59031 ] }) 59032 } 59033 ) 59034 ] }); 59035 }; 59036 const OrderPlaced = () => { 59037 const { isAuthorized, email, friendlyId, logout } = useOrderAuth(); 59038 const { fetchOrderData, orderData } = useOrderData(); 59039 const navigate = useNavigate(); 59040 const location = useLocation(); 59041 const getInitialUrl = () => { 59042 if (!isAuthorized) { 59043 return routes.contact.orderPlaced.self; 59044 } 59045 return routes.contact.orderPlaced.variants; 59046 }; 59047 const initializeOrderData = (email2, friendlyId2) => __async(null, null, function* () { 59048 try { 59049 yield fetchOrderData({ email: email2, friendlyId: friendlyId2 }); 59050 } catch (e2) { 59051 logout(); 59052 navigate(routes.contact.orderPlaced.self); 59053 } 59054 }); 59055 reactExports.useEffect(() => { 59056 if (isAuthorized && email && friendlyId && !orderData) { 59057 initializeOrderData(email, friendlyId); 59058 } 59059 }, [isAuthorized, email, friendlyId, orderData]); 59060 reactExports.useEffect(() => { 59061 const initialUrl = getInitialUrl(); 59062 if (location.pathname !== initialUrl) { 59063 navigate(initialUrl); 59064 } 59065 }, []); 59066 return /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}); 59067 }; 59068 const Container$3 = dt$2.div` 59069 display: flex; 59070 flex-direction: column; 59071 gap: var(--space-300); 59072`; 59073 const ItemContainer = dt$2.div` 59074 display: flex; 59075 align-items: center; 59076 gap: var(--space-400); 59077 border: 1px solid var(--input-border, var(--border-secondary)); 59078 border-radius: var(--panel-radius-normal); 59079 padding: var(--space-200) var(--space-400); 59080 cursor: pointer; 59081 59082 &:hover { 59083 border-color: var(--text-primary); 59084 } 59085`; 59086 const ImageContainer = dt$2.div` 59087 flex-shrink: 0; 59088 height: 80px; 59089 aspect-ratio: 3/4; 59090 background-color: var(--bg-secondary); 59091`; 59092 const CheckboxWrapper = dt$2.div``; 59093 const Image = dt$2.img` 59094 width: 100%; 59095 height: auto; 59096 object-fit: contain; 59097 border-radius: var(--image-radius-normal); 59098`; 59099 const ImagePlaceholder = dt$2.div` 59100 width: 100%; 59101 height: 100%; 59102 display: flex; 59103 align-items: center; 59104 justify-content: center; 59105 border-radius: var(--image-radius-normal); 59106 color: var(--pale, var(--border-primary)); 59107`; 59108 const Content = dt$2.div` 59109 display: flex; 59110 flex-direction: column; 59111 min-width: 0; 59112`; 59113 const Name = dt$2.span` 59114 font-size: var(--font-size-400); 59115 line-height: var(--font-line-height-400, 24px); 59116 letter-spacing: var(--font-letter-spacing-normal); 59117`; 59118 const Description$1 = dt$2.span` 59119 font-size: var(--font-size-200); 59120 line-height: var(--font-line-height-200); 59121 color: var(--text-secondary); 59122`; 59123 const DownloadLinks = dt$2.div` 59124 display: flex; 59125 flex-wrap: wrap; 59126 margin-top: var(--space-100); 59127`; 59128 const DownloadButton = dt$2.button` 59129 display: flex; 59130 align-items: center; 59131 gap: var(--space-200); 59132 font-size: var(--font-size-200); 59133 line-height: var(--font-line-height-200); 59134 color: var(--text-secondary); 59135 cursor: pointer; 59136 59137 margin-right: var(--space-400); 59138 59139 &:last-child { 59140 margin-right: 0; 59141 } 59142 59143 &:hover { 59144 color: var(--text-primary); 59145 text-decoration: underline; 59146 } 59147`; 59148 const ActionLink = dt$2.a` 59149 display: flex; 59150 align-items: center; 59151 gap: var(--space-200); 59152 margin-top: var(--space-200); 59153 font-size: var(--font-size-200); 59154 line-height: var(--font-line-height-200); 59155 color: var(--text-secondary); 59156 cursor: pointer; 59157 59158 &:hover { 59159 color: var(--text-primary); 59160 text-decoration: underline; 59161 } 59162`; 59163 const BannerWrapper = dt$2.div` 59164 margin: var(--space-200) 0; 59165`; 59166 const ProductsListItem = ({ 59167 imageUrl, 59168 name, 59169 description, 59170 digitalItems, 59171 actionLink, 59172 isSelected, 59173 onSelectionChange, 59174 onFileDownload 59175 }) => { 59176 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59177 const renderPhoto = (imageUrl2) => { 59178 if (!imageUrl2) { 59179 return /* @__PURE__ */ jsxRuntimeExports.jsx(ImagePlaceholder, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(D9, { height: 32 }) }); 59180 } 59181 return /* @__PURE__ */ jsxRuntimeExports.jsx(Image, { src: imageUrl2 }); 59182 }; 59183 const renderDigitalItems = () => { 59184 if (!(digitalItems == null ? void 0 : digitalItems.length)) return null; 59185 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59186 /* @__PURE__ */ jsxRuntimeExports.jsx(BannerWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Banner, { appearance: "inherit", size: "small", children: t2("digital_refund_banner") }) }), 59187 /* @__PURE__ */ jsxRuntimeExports.jsx(DownloadLinks, { children: digitalItems.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs( 59188 DownloadButton, 59189 { 59190 type: "button", 59191 disabled: item.isLoading, 59192 onClick: (e2) => { 59193 e2.stopPropagation(); 59194 onFileDownload == null ? void 0 : onFileDownload(item.uri); 59195 }, 59196 children: [ 59197 item.isLoading ? /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, { size: "small" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Me$3, { height: 12 }), 59198 item.name 59199 ] 59200 }, 59201 item.uri 59202 )) }) 59203 ] }); 59204 }; 59205 return /* @__PURE__ */ jsxRuntimeExports.jsxs(ItemContainer, { onClick: onSelectionChange, children: [
59206 /* @__PURE__ */ jsxRuntimeExports.jsx( 59207 CheckboxWrapper, 59208 { 59209 onClick: (e2) => { 59210 e2.stopPropagation(); 59211 }, 59212 children: /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, { value: isSelected, onValueChange: onSelectionChange }) 59213 } 59214 ), 59215 /* @__PURE__ */ jsxRuntimeExports.jsx(ImageContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AspectBox, { ratio: "3:4", children: renderPhoto(imageUrl) }) }), 59216 /* @__PURE__ */ jsxRuntimeExports.jsxs(Content, { children: [ 59217 /* @__PURE__ */ jsxRuntimeExports.jsx(Name, { children: name }), 59218 renderDigitalItems(), 59219 description && /* @__PURE__ */ jsxRuntimeExports.jsx(Description$1, { children: description }), 59220 actionLink && /* @__PURE__ */ jsxRuntimeExports.jsx( 59221 ActionLink, 59222 { 59223 href: actionLink.href, 59224 target: "_blank", 59225 rel: "noreferrer", 59226 onClick: (e2) => e2.stopPropagation(), 59227 children: actionLink.label 59228 } 59229 ) 59230 ] }) 59231 ] }); 59232 }; 59233 const ProductsList = ({ children }) => { 59234 return /* @__PURE__ */ jsxRuntimeExports.jsx(Container$3, { children }); 59235 }; 59236 ProductsList.Item = ProductsListItem; 59237 const Container$2 = dt$2.div` 59238 display: inline-flex; 59239 gap: var(--space-150); 59240`; 59241 const ShipmentCarrier = ({ carrier, trackingUrl }) => { 59242 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.shipmentCarrier" }); 59243 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$2, { children: [ 59244 t2("shipped_via", { carrier }), 59245 " ", 59246 trackingUrl && /* @__PURE__ */ jsxRuntimeExports.jsx( 59247 ButtonClean, 59248 { 59249 href: trackingUrl, 59250 target: "_blank", 59251 label: t2("track_shipment"), 59252 appearance: "inherit" 59253 } 59254 ) 59255 ] }); 59256 }; 59257 const Container$1 = dt$2.div` 59258 display: flex; 59259 flex-direction: column; 59260 gap: var(--space-150); 59261 margin-bottom: var(--space-300); 59262`; 59263 const Subheader = dt$2.div` 59264 color: var(--text-secondary); 59265 59266 font-size: var(--font-size-200); 59267 line-height: var(--font-line-height-200); 59268 letter-spacing: var(--font-letter-spacing-looser); 59269`; 59270 const Title = dt$2.h3` 59271 color: var(--text-primary); 59272 59273 font-family: var(--font-family-heading); 59274 font-size: var(--font-size-400); 59275 font-weight: var(--font-weight-500); 59276 line-height: var(--font-line-height-300); 59277 letter-spacing: var(--font-letter-spacing-dense); 59278 59279 ${mediaQueries.laptop} { 59280 font-size: var(--font-size-500); 59281 font-weight: var(--font-weight-480); 59282 line-height: var(--font-line-height-400); 59283 } 59284`; 59285 const Subtitle = dt$2.div` 59286 color: var(--text-secondary); 59287 59288 font-size: var(--font-size-300); 59289 line-height: var(--font-line-height-300); 59290 letter-spacing: var(--font-letter-spacing-looser); 59291`; 59292 const ShipmentHeader = ({ title, subheader, subtitle }) => { 59293 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container$1, { children: [ 59294 subheader && /* @__PURE__ */ jsxRuntimeExports.jsx(Subheader, { children: subheader }),
59295 /* @__PURE__ */ jsxRuntimeExports.jsx(Title, { children: title }), 59296 subtitle && /* @__PURE__ */ jsxRuntimeExports.jsx(Subtitle, { children: subtitle }) 59297 ] }); 59298 }; 59299 const DATE_FORMAT = "MMM D, YYYY"; 59300 const hasDateRange = (status) => { 59301 return "dateFrom" in status && "dateTo" in status; 59302 }; 59303 const hasSingleDate = (status) => { 59304 return "date" in status; 59305 }; 59306 const ShipmentTitle = ({ status }) => { 59307 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.shipmentTitle" }); 59308 const renderDeliveryDate = () => { 59309 if (hasDateRange(status)) { 59310 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59311 /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.dateFrom, format: DATE_FORMAT }), 59312 " -", 59313 " ", 59314 /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.dateTo, format: DATE_FORMAT }) 59315 ] }); 59316 } 59317 if (hasSingleDate(status)) { 59318 return /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: status.date, format: DATE_FORMAT }); 59319 } 59320 return null; 59321 }; 59322 switch (status.type) { 59323 case "DeliveredAt": 59324 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59325 t2("status_delivered_on"), 59326 renderDeliveryDate() 59327 ] }); 59328 case "DeliveryEstimationDateRange": 59329 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59330 t2("status_estimated_delivery"), 59331 renderDeliveryDate() 59332 ] }); 59333 case "ShippedOn": 59334 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59335 t2("status_shipped_on"), 59336 renderDeliveryDate() 59337 ] }); 59338 case "ArrivesOn": 59339 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59340 t2("status_arrives_on"), 59341 renderDeliveryDate() 59342 ] }); 59343 case "ArrivesBetween": 59344 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59345 t2("status_arrives"), 59346 renderDeliveryDate() 59347 ] }); 59348 case "Unknown": 59349 default: 59350 return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t2("status_order_placed") }); 59351 } 59352 }; 59353 const getProgressPercentage = (doneItemsCount, itemsCount) => { 59354 const MIN_PERCENTAGE = 12; 59355 if (itemsCount === 0) { 59356 return MIN_PERCENTAGE; 59357 } 59358 if (itemsCount === 1) { 59359 return Math.max(doneItemsCount * 100, MIN_PERCENTAGE); 59360 } 59361 return Math.max((doneItemsCount - 1) / (itemsCount - 1) * 100, MIN_PERCENTAGE); 59362 }; 59363 const mapTimelineEventToProgressItem = (event) => { 59364 return { 59365 done: !!event.occurredAt, 59366 type: event.type, 59367 date: event.occurredAt 59368 }; 59369 }; 59370 const Container = dt$2.div` 59371 margin: var(--space-400) 0; 59372`; 59373 const ProgressContainer = dt$2.div` 59374 margin-bottom: var(--space-150); 59375`; 59376 const Progress = dt$2.div` 59377 height: 6px; 59378 background: color-mix(in srgb, var(--bg-brand) 20%, transparent); 59379 border-radius: var(--panel-radius-normal); 59380 overflow: hidden; 59381`; 59382 const ProgressBar = dt$2.div` 59383 height: 100%; 59384 width: ${({ $width }) => $width}; 59385 background: var(--bg-brand); 59386 border-radius: var(--panel-radius-normal); 59387`; 59388 const Events = dt$2.ul` 59389 display: flex; 59390`; 59391 const Event$1 = dt$2.li` 59392 flex: 1; 59393 59394 font-size: var(--font-size-200); 59395 line-height: var(--font-line-height-200); 59396 letter-spacing: var(--font-letter-spacing-looser); 59397 color: var(--text-secondary); 59398 text-align: center; 59399 59400 &:first-child { 59401 text-align: left; 59402 } 59403 59404 &:last-child { 59405 text-align: right; 59406 } 59407 59408 ${({ $active }) => $active && lt$2` 59409 font-weight: var(--font-weight-600); 59410 color: var(--text-primary); 59411 `} 59412`; 59413 const TimelineEvents = ({ timeline }) => { 59414 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants.components.timelineEvents" }); 59415 const getEventName = (type) => { 59416 return t2(type.toLowerCase(), { defaultValue: type }); 59417 }; 59418 const progressItems = timeline.map(mapTimelineEventToProgressItem); 59419 const doneItems = progressItems.filter(({ done }) => done); 59420 const percentage = getProgressPercentage(doneItems.length, progressItems.length); 59421 const renderProgressItem = (progressItem, index2) => { 59422 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Event$1, { $active: progressItem.done, children: [
59423 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: getEventName(progressItem.type) }), 59424 progressItem.date && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(qi, { date: progressItem.date, format: "MMM D" }) }) 59425 ] }, `${progressItem.type}-${index2}`); 59426 }; 59427 if (progressItems.length === 0) { 59428 return null; 59429 } 59430 return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { children: [ 59431 /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Progress, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressBar, { $width: `${percentage}%` }) }) }), 59432 /* @__PURE__ */ jsxRuntimeExports.jsx(Events, { children: progressItems.map(renderProgressItem) }) 59433 ] }); 59434 }; 59435 class DownloadsApiClientModel extends ApiBase { 59436 constructor() { 59437 super(...arguments); 59438 __publicField(this, "getOrderFile", (orderId, file) => { 59439 return this.get(`/media/downloads/order/${orderId}`, { file }); 59440 }); 59441 } 59442 } 59443 const DownloadsApiClient = new DownloadsApiClientModel(getBaseApiUrl()); 59444 const useOrderFileMutation = U$2(DownloadsApiClient.getOrderFile, { 59445 mutationKey: ["getOrderFile"] 59446 }); 59447 const useFileDownload = (orderId) => { 59448 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59449 const { getOrderFileMutation } = useOrderFileMutation(); 59450 const [loadingFiles, setLoadingFiles] = reactExports.useState([]); 59451 const removeLoadingFile = (file) => { 59452 setLoadingFiles((prev2) => prev2.filter((f2) => f2 !== file)); 59453 }; 59454 const downloadFile = (file) => { 59455 setLoadingFiles((prev2) => [...prev2, file]); 59456 getOrderFileMutation.mutate([orderId, file], { 59457 onSuccess: (data) => { 59458 window.location.href = data.url; 59459 removeLoadingFile(file); 59460 }, 59461 onError: (error) => { 59462 var _a, _b; 59463 removeLoadingFile(file); 59464 if (isAxiosError(error) && ((_a = error.response) == null ? void 0 : _a.data.code) === "DOWNLOAD_LIMIT_EXCEEDED_ERROR") { 59465 notify(t2("download_limit_exceeded_error"), { toastId: file, type: "error" }); 59466 return; 59467 } 59468 if (isAxiosError(error) && ((_b = error.response) == null ? void 0 : _b.data.code) === "DOWNLOAD_EXPIRED_ERROR") { 59469 notify(t2("download_expired_error"), { toastId: file, type: "error" }); 59470 return; 59471 } 59472 notify(t2("download_pending_info"), { toastId: file, type: "info" }); 59473 } 59474 }); 59475 }; 59476 return { downloadFile, loadingFiles }; 59477 }; 59478 const OrderVariants = () => { 59479 var _a; 59480 const { orderData, isLoading, selectedVariants, handleVariantSelectionChange } = useOrderData(); 59481 const { t: t2 } = useTranslation("modules", { keyPrefix: "orderVariants" }); 59482 const navigate = useNavigate(); 59483 const { downloadFile, loadingFiles } = useFileDownload((_a = orderData == null ? void 0 : orderData.id) != null ? _a : ""); 59484 const isVariantSelected = (shipmentId, variantId) => { 59485 return selectedVariants.some( 59486 (item) => item.shipmentId === shipmentId && item.variantId === variantId 59487 ); 59488 }; 59489 const getDigitalItemsWithLoadingState = (digitalItems) => { 59490 return digitalItems == null ? void 0 : digitalItems.map((item) => __spreadProps(__spreadValues({}, item), { 59491 isLoading: loadingFiles.includes(item.uri) 59492 })); 59493 }; 59494 const getSubmitLabel = () => { 59495 if (!selectedVariants.length) { 59496 return t2("submit_label_empty"); 59497 } 59498 return t2("submit_label"); 59499 }; 59500 const renderShipments = () => { 59501 var _a2, _b; 59502 const shipments = (_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.shipments) != null ? _b : []; 59503 const hasMultipleShipments = shipments.length > 1; 59504 return shipments.map((shipment, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59505 /* @__PURE__ */ jsxRuntimeExports.jsx( 59506 ShipmentHeader, 59507 { 59508 title: /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentTitle, { status: shipment.status }), 59509 subheader: hasMultipleShipments ? t2("shipment_subheader", { current: index2 + 1, total: shipments.length }) : void 0, 59510 subtitle: shipment.carrier ? /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentCarrier, { carrier: shipment.carrier, trackingUrl: shipment.trackingUrl }) : void 0 59511 } 59512 ), 59513 /* @__PURE__ */ jsxRuntimeExports.jsx(TimelineEvents, { timeline: shipment.timeline }), 59514 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: shipment.variants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59515 ProductsList.Item, 59516 { 59517 imageUrl: variant.imageUrl, 59518 name: variant.name, 59519 description: variant.description, 59520 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59521 isSelected: isVariantSelected(shipment.id, variant.id), 59522 onSelectionChange: () => handleVariantSelectionChange( 59523 shipment.id, 59524 variant.id, 59525 !isVariantSelected(shipment.id, variant.id) 59526 ), 59527 onFileDownload: downloadFile 59528 }, 59529 variant.id 59530 )) }) 59531 ] }, shipment.id)); 59532 }; 59533 const renderDigitalItems = () => { 59534 var _a2, _b, _c; 59535 const shipmentId = "digital_items"; 59536 if (!((_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.digitalVariants) == null ? void 0 : _b.length)) return null; 59537 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59538 /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentHeader, { title: t2("digital_shipment_title") }), 59539 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: (_c = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _c.digitalVariants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59540 ProductsList.Item, 59541 { 59542 imageUrl: variant.imageUrl, 59543 name: variant.name, 59544 description: variant.description, 59545 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59546 isSelected: isVariantSelected(shipmentId, variant.id), 59547 onSelectionChange: () => handleVariantSelectionChange( 59548 shipmentId, 59549 variant.id, 59550 !isVariantSelected(shipmentId, variant.id) 59551 ), 59552 onFileDownload: downloadFile 59553 }, 59554 variant.id 59555 )) }) 59556 ] }); 59557 }; 59558 const renderGiftCards = () => { 59559 var _a2, _b; 59560 const shipmentId = "gift_cards"; 59561 const individualGiftCards = (_b = (_a2 = orderData == null ? void 0 : orderData.commonOrder) == null ? void 0 : _a2.giftCardVariants) != null ? _b : []; 59562 if (!individualGiftCards.length) return null; 59563 return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
59564 /* @__PURE__ */ jsxRuntimeExports.jsx(ShipmentHeader, { title: t2("gift_cards_shipment_title") }), 59565 /* @__PURE__ */ jsxRuntimeExports.jsx(ProductsList, { children: individualGiftCards.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx( 59566 ProductsList.Item, 59567 { 59568 imageUrl: variant.imageUrl, 59569 name: variant.name, 59570 description: variant.description, 59571 digitalItems: getDigitalItemsWithLoadingState(variant.digitalItems), 59572 actionLink: variant.giftCardIds[0] ? { href: `/gift_cards/${variant.giftCardIds[0]}`, label: t2("view_gift_card") } : void 0, 59573 isSelected: isVariantSelected(shipmentId, variant.id), 59574 onSelectionChange: () => handleVariantSelectionChange( 59575 shipmentId, 59576 variant.id, 59577 !isVariantSelected(shipmentId, variant.id) 59578 ), 59579 onFileDownload: downloadFile 59580 }, 59581 variant.id 59582 )) }) 59583 ] }); 59584 }; 59585 const renderData = () => { 59586 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ 59587 renderShipments(), 59588 renderDigitalItems(), 59589 renderGiftCards() 59590 ] }); 59591 }; 59592 const renderLoader = () => { 59593 return /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Loader, {}); 59594 }; 59595 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59596 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: routes.contact.orderPlaced.self, children: t2("title") }), 59597 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 59598 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.self, active: true, children: t2("primary_tab_button_label") }), 59599 /* @__PURE__ */ jsxRuntimeExports.jsx(TabButton, { to: routes.contact.orderPlaced.somethingElse, children: t2("secondary_tab_button_label") }) 59600 ] }), 59601 isLoading ? renderLoader() : renderData(), 59602 /* @__PURE__ */ jsxRuntimeExports.jsx( 59603 Button$1, 59604 { 59605 label: getSubmitLabel(), 59606 disabled: isLoading || selectedVariants.length === 0, 59607 type: "button", 59608 appearance: "primary", 59609 fullWidth: true, 59610 onClick: () => navigate(routes.contact.orderPlaced.details) 59611 } 59612 ) 59613 ] }); 59614 }; 59615 const SomethingElse = () => { 59616 const { t: t2 } = useTranslation("modules", { keyPrefix: "somethingElse" }); 59617 const location = useLocation(); 59618 const isOrderPlaced = location.pathname.includes(routes.contact.orderPlaced.self); 59619 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59620 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { backLocation: isOrderPlaced ? routes.contact.orderPlaced.self : void 0, children: isOrderPlaced ? t2("order_placed_title") : t2("title") }), 59621 /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout.Tabs, { children: [ 59622 /* @__PURE__ */ jsxRuntimeExports.jsx( 59623 TabButton, 59624 { 59625 to: isOrderPlaced ? routes.contact.orderPlaced.variants : routes.contact.orderPlaced.self, 59626 children: isOrderPlaced ? t2("order_placed_primary_tab_button_label") : t2("primary_tab_button_label") 59627 } 59628 ), 59629 /* @__PURE__ */ jsxRuntimeExports.jsx( 59630 TabButton, 59631 { 59632 to: isOrderPlaced ? routes.contact.orderPlaced.somethingElse : routes.contact.somethingElse, 59633 active: true, 59634 children: t2("secondary_tab_button_label") 59635 } 59636 ) 59637 ] }), 59638 /* @__PURE__ */ jsxRuntimeExports.jsx(ReportForm, { topicPath: isOrderPlaced ? "ORDER_OTHER" : "OTHER" }) 59639 ] }); 59640 }; 59641 const Header = dt$2.div` 59642 display: flex; 59643 flex-direction: column; 59644 gap: var(--space-300); 59645`; 59646 const Description = dt$2.p` 59647 font-size: var(--font-size-400); 59648 line-height: var(--font-line-height-400); 59649 letter-spacing: var(--font-letter-spacing-normal); 59650`; 59651 const Success = () => { 59652 var _a; 59653 const { t: t2 } = useTranslation("modules", { keyPrefix: "success" }); 59654 const { shopContextQuery } = useShopContextQuery(); 59655 return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59656 /* @__PURE__ */ jsxRuntimeExports.jsxs(Header, { children: [ 59657 /* @__PURE__ */ jsxRuntimeExports.jsx(Layout.Title, { children: t2("title") }), 59658 /* @__PURE__ */ jsxRuntimeExports.jsx(Description, { children: t2("subtitle") }) 59659 ] }), 59660 /* @__PURE__ */ jsxRuntimeExports.jsx( 59661 Button$1, 59662 { 59663 label: t2("back_label"), 59664 href: ((_a = shopContextQuery.data) == null ? void 0 : _a.externalStoreUrl) || "/", 59665 appearance: "primary" 59666 } 59667 ) 59668 ] }); 59669 }; 59670 const queryClient = A$2({ 59671 notify: (message) => notify(message, { type: "error" }) 59672 }); 59673 const Root = () => /* @__PURE__ */ jsxRuntimeExports.jsx(MediaQueryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastsProvider, { position: "top", autoClose: 1e4, children: /* @__PURE__ */ jsxRuntimeExports.jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Hr, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BrowserRouter, { future: { v7_startTransition: true, v7_relativeSplatPath: true }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnalyticsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderAuthProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDataProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Q$3, { userAgent: window.navigator.userAgent, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderSuspenseFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Routes, { children: [
59674 /* @__PURE__ */ jsxRuntimeExports.jsxs(Route, { path: routes.contact.self, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Contact, {}), children: [ 59675 /* @__PURE__ */ jsxRuntimeExports.jsx( 59676 Route, 59677 { 59678 index: true, 59679 element: /* @__PURE__ */ jsxRuntimeExports.jsx(Navigate, { to: routes.contact.orderPlaced.self }) 59680 } 59681 ), 59682 /* @__PURE__ */ jsxRuntimeExports.jsxs(Route, { path: routes.contact.orderPlaced.self, element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderPlaced, {}), children: [ 59683 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { index: true, element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderLogin, {}) }), 59684 /* @__PURE__ */ jsxRuntimeExports.jsx( 59685 Route, 59686 { 59687 path: routes.contact.orderPlaced.variants, 59688 element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderVariants, {}) 59689 } 59690 ), 59691 /* @__PURE__ */ jsxRuntimeExports.jsx( 59692 Route, 59693 { 59694 path: routes.contact.orderPlaced.details, 59695 element: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderDetails, {}) 59696 } 59697 ),
59698 /* @__PURE__ */ jsxRuntimeExports.jsx( 59699 Route, 59700 { 59701 path: routes.contact.orderPlaced.somethingElse, 59702 element: /* @__PURE__ */ jsxRuntimeExports.jsx(SomethingElse, {}) 59703 } 59704 ) 59705 ] }), 59706 /* @__PURE__ */ jsxRuntimeExports.jsx( 59707 Route, 59708 { 59709 path: routes.contact.somethingElse, 59710 element: /* @__PURE__ */ jsxRuntimeExports.jsx(SomethingElse, {}) 59711 } 59712 ), 59713 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: routes.contact.success, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Success, {}) }), 59714 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: routes.contact.logout, element: /* @__PURE__ */ jsxRuntimeExports.jsx(Logout, {}) }) 59715 ] }), 59716 /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: "*", element: /* @__PURE__ */ jsxRuntimeExports.jsx(NotFoundErrorPage, {}) }) 59717 ] }) }) }) }) }) }) }) }) }) }) }) }); 59718 b$4({ 59719 appName: "contact", 59720 options: { 59721 tracesSampleRate: 0.1, 59722 integrations: [ 59723 reactRouterV6BrowserTracingIntegration({ 59724 useEffect: reactExports.useEffect, 59725 createRoutesFromChildren, 59726 matchRoutes, 59727 useLocation, 59728 useNavigationType 59729 }) 59730 ] 59731 } 59732 }); 59733 if (getCurrentEnvironment() !== "development") { 59734 const interceptor = errorLoggerInterceptor(s$5); 59735 OrderStatusClient.addErrorResponseInterceptor(interceptor); 59736 } 59737 const root = clientExports.createRoot(document.getElementById("root")); 59738 root.render(/* @__PURE__ */ jsxRuntimeExports.jsx(Root, {})); 59739 } 59740}); 59741export default require_index_001();
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.