diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json index f0127c92..4bac03e0 100644 --- a/.obsidian/plugins/cron/data.json +++ b/.obsidian/plugins/cron/data.json @@ -19,7 +19,7 @@ "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": { "locked": false, "lockedDeviceName": "iPhone", - "lastRun": "2024-09-11T07:35:52+02:00" + "lastRun": "2024-10-04T08:32:12+02:00" } } } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-activity-history/data.json b/.obsidian/plugins/obsidian-activity-history/data.json index 803e467c..4b995ccb 100644 --- a/.obsidian/plugins/obsidian-activity-history/data.json +++ b/.obsidian/plugins/obsidian-activity-history/data.json @@ -12,8 +12,8 @@ "checkpointList": [ { "path": "/", - "date": "2024-09-11", - "size": 9778271 + "date": "2024-10-04", + "size": 10256004 } ], "activityHistory": [ @@ -3914,7 +3914,99 @@ }, { "date": "2024-09-11", - "value": 1442 + "value": 1677 + }, + { + "date": "2024-09-12", + "value": 18659 + }, + { + "date": "2024-09-13", + "value": 2032 + }, + { + "date": "2024-09-14", + "value": 3633 + }, + { + "date": "2024-09-15", + "value": 153467 + }, + { + "date": "2024-09-16", + "value": 1560 + }, + { + "date": "2024-09-17", + "value": 1990 + }, + { + "date": "2024-09-18", + "value": 4037 + }, + { + "date": "2024-09-19", + "value": 1532 + }, + { + "date": "2024-09-20", + "value": 21773 + }, + { + "date": "2024-09-21", + "value": 27019 + }, + { + "date": "2024-09-22", + "value": 3214 + }, + { + "date": "2024-09-23", + "value": 1571 + }, + { + "date": "2024-09-24", + "value": 61712 + }, + { + "date": "2024-09-25", + "value": 18867 + }, + { + "date": "2024-09-26", + "value": 2101 + }, + { + "date": "2024-09-27", + "value": 2663 + }, + { + "date": "2024-09-28", + "value": 1439 + }, + { + "date": "2024-09-29", + "value": 3916 + }, + { + "date": "2024-09-30", + "value": 165958 + }, + { + "date": "2024-10-01", + "value": 2645 + }, + { + "date": "2024-10-02", + "value": 28080 + }, + { + "date": "2024-10-03", + "value": 1775 + }, + { + "date": "2024-10-04", + "value": 5145 } ] } diff --git a/.obsidian/plugins/obsidian-advanced-uri/main.js b/.obsidian/plugins/obsidian-advanced-uri/main.js index 0ec3df3b..0b486176 100644 --- a/.obsidian/plugins/obsidian-advanced-uri/main.js +++ b/.obsidian/plugins/obsidian-advanced-uri/main.js @@ -3,5114 +3,26 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source visit the plugins github repository (https://github.com/Vinzent03/obsidian-advanced-uri) */ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/feather-icons/dist/feather.js -var require_feather = __commonJS({ - "node_modules/feather-icons/dist/feather.js"(exports, module2) { - (function webpackUniversalModuleDefinition(root, factory) { - if (typeof exports === "object" && typeof module2 === "object") - module2.exports = factory(); - else if (typeof define === "function" && define.amd) - define([], factory); - else if (typeof exports === "object") - exports["feather"] = factory(); - else - root["feather"] = factory(); - })(typeof self !== "undefined" ? self : exports, function() { - return ( - /******/ - function(modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if (installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module3 = installedModules[moduleId] = { - /******/ - i: moduleId, - /******/ - l: false, - /******/ - exports: {} - /******/ - }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); - module3.l = true; - return module3.exports; - } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.d = function(exports2, name, getter) { - if (!__webpack_require__.o(exports2, name)) { - Object.defineProperty(exports2, name, { - /******/ - configurable: false, - /******/ - enumerable: true, - /******/ - get: getter - /******/ - }); - } - }; - __webpack_require__.r = function(exports2) { - Object.defineProperty(exports2, "__esModule", { value: true }); - }; - __webpack_require__.n = function(module3) { - var getter = module3 && module3.__esModule ? ( - /******/ - function getDefault() { - return module3["default"]; - } - ) : ( - /******/ - function getModuleExports() { - return module3; - } - ); - __webpack_require__.d(getter, "a", getter); - return getter; - }; - __webpack_require__.o = function(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - }; - __webpack_require__.p = ""; - return __webpack_require__(__webpack_require__.s = 0); - }({ - /***/ - "./dist/icons.json": ( - /*!*************************!*\ - !*** ./dist/icons.json ***! - \*************************/ - /*! exports provided: activity, airplay, alert-circle, alert-octagon, alert-triangle, align-center, align-justify, align-left, align-right, anchor, aperture, archive, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, award, bar-chart-2, bar-chart, battery-charging, battery, bell-off, bell, bluetooth, bold, book-open, book, bookmark, box, briefcase, calendar, camera-off, camera, cast, check-circle, check-square, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, chrome, circle, clipboard, clock, cloud-drizzle, cloud-lightning, cloud-off, cloud-rain, cloud-snow, cloud, code, codepen, codesandbox, coffee, columns, command, compass, copy, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, cpu, credit-card, crop, crosshair, database, delete, disc, divide-circle, divide-square, divide, dollar-sign, download-cloud, download, dribbble, droplet, edit-2, edit-3, edit, external-link, eye-off, eye, facebook, fast-forward, feather, figma, file-minus, file-plus, file-text, file, film, filter, flag, folder-minus, folder-plus, folder, framer, frown, gift, git-branch, git-commit, git-merge, git-pull-request, github, gitlab, globe, grid, hard-drive, hash, headphones, heart, help-circle, hexagon, home, image, inbox, info, instagram, italic, key, layers, layout, life-buoy, link-2, link, linkedin, list, loader, lock, log-in, log-out, mail, map-pin, map, maximize-2, maximize, meh, menu, message-circle, message-square, mic-off, mic, minimize-2, minimize, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, mouse-pointer, move, music, navigation-2, navigation, octagon, package, paperclip, pause-circle, pause, pen-tool, percent, phone-call, phone-forwarded, phone-incoming, phone-missed, phone-off, phone-outgoing, phone, pie-chart, play-circle, play, plus-circle, plus-square, plus, pocket, power, printer, radio, refresh-ccw, refresh-cw, repeat, rewind, rotate-ccw, rotate-cw, rss, save, scissors, search, send, server, settings, share-2, share, shield-off, shield, shopping-bag, shopping-cart, shuffle, sidebar, skip-back, skip-forward, slack, slash, sliders, smartphone, smile, speaker, square, star, stop-circle, sun, sunrise, sunset, table, tablet, tag, target, terminal, thermometer, thumbs-down, thumbs-up, toggle-left, toggle-right, tool, trash-2, trash, trello, trending-down, trending-up, triangle, truck, tv, twitch, twitter, type, umbrella, underline, unlock, upload-cloud, upload, user-check, user-minus, user-plus, user-x, user, users, video-off, video, voicemail, volume-1, volume-2, volume-x, volume, watch, wifi-off, wifi, wind, x-circle, x-octagon, x-square, x, youtube, zap-off, zap, zoom-in, zoom-out, default */ - /***/ - function(module3) { - module3.exports = { "activity": '', "airplay": '', "alert-circle": '', "alert-octagon": '', "alert-triangle": '', "align-center": '', "align-justify": '', "align-left": '', "align-right": '', "anchor": '', "aperture": '', "archive": '', "arrow-down-circle": '', "arrow-down-left": '', "arrow-down-right": '', "arrow-down": '', "arrow-left-circle": '', "arrow-left": '', "arrow-right-circle": '', "arrow-right": '', "arrow-up-circle": '', "arrow-up-left": '', "arrow-up-right": '', "arrow-up": '', "at-sign": '', "award": '', "bar-chart-2": '', "bar-chart": '', "battery-charging": '', "battery": '', "bell-off": '', "bell": '', "bluetooth": '', "bold": '', "book-open": '', "book": '', "bookmark": '', "box": '', "briefcase": '', "calendar": '', "camera-off": '', "camera": '', "cast": '', "check-circle": '', "check-square": '', "check": '', "chevron-down": '', "chevron-left": '', "chevron-right": '', "chevron-up": '', "chevrons-down": '', "chevrons-left": '', "chevrons-right": '', "chevrons-up": '', "chrome": '', "circle": '', "clipboard": '', "clock": '', "cloud-drizzle": '', "cloud-lightning": '', "cloud-off": '', "cloud-rain": '', "cloud-snow": '', "cloud": '', "code": '', "codepen": '', "codesandbox": '', "coffee": '', "columns": '', "command": '', "compass": '', "copy": '', "corner-down-left": '', "corner-down-right": '', "corner-left-down": '', "corner-left-up": '', "corner-right-down": '', "corner-right-up": '', "corner-up-left": '', "corner-up-right": '', "cpu": '', "credit-card": '', "crop": '', "crosshair": '', "database": '', "delete": '', "disc": '', "divide-circle": '', "divide-square": '', "divide": '', "dollar-sign": '', "download-cloud": '', "download": '', "dribbble": '', "droplet": '', "edit-2": '', "edit-3": '', "edit": '', "external-link": '', "eye-off": '', "eye": '', "facebook": '', "fast-forward": '', "feather": '', "figma": '', "file-minus": '', "file-plus": '', "file-text": '', "file": '', "film": '', "filter": '', "flag": '', "folder-minus": '', "folder-plus": '', "folder": '', "framer": '', "frown": '', "gift": '', "git-branch": '', "git-commit": '', "git-merge": '', "git-pull-request": '', "github": '', "gitlab": '', "globe": '', "grid": '', "hard-drive": '', "hash": '', "headphones": '', "heart": '', "help-circle": '', "hexagon": '', "home": '', "image": '', "inbox": '', "info": '', "instagram": '', "italic": '', "key": '', "layers": '', "layout": '', "life-buoy": '', "link-2": '', "link": '', "linkedin": '', "list": '', "loader": '', "lock": '', "log-in": '', "log-out": '', "mail": '', "map-pin": '', "map": '', "maximize-2": '', "maximize": '', "meh": '', "menu": '', "message-circle": '', "message-square": '', "mic-off": '', "mic": '', "minimize-2": '', "minimize": '', "minus-circle": '', "minus-square": '', "minus": '', "monitor": '', "moon": '', "more-horizontal": '', "more-vertical": '', "mouse-pointer": '', "move": '', "music": '', "navigation-2": '', "navigation": '', "octagon": '', "package": '', "paperclip": '', "pause-circle": '', "pause": '', "pen-tool": '', "percent": '', "phone-call": '', "phone-forwarded": '', "phone-incoming": '', "phone-missed": '', "phone-off": '', "phone-outgoing": '', "phone": '', "pie-chart": '', "play-circle": '', "play": '', "plus-circle": '', "plus-square": '', "plus": '', "pocket": '', "power": '', "printer": '', "radio": '', "refresh-ccw": '', "refresh-cw": '', "repeat": '', "rewind": '', "rotate-ccw": '', "rotate-cw": '', "rss": '', "save": '', "scissors": '', "search": '', "send": '', "server": '', "settings": '', "share-2": '', "share": '', "shield-off": '', "shield": '', "shopping-bag": '', "shopping-cart": '', "shuffle": '', "sidebar": '', "skip-back": '', "skip-forward": '', "slack": '', "slash": '', "sliders": '', "smartphone": '', "smile": '', "speaker": '', "square": '', "star": '', "stop-circle": '', "sun": '', "sunrise": '', "sunset": '', "table": '', "tablet": '', "tag": '', "target": '', "terminal": '', "thermometer": '', "thumbs-down": '', "thumbs-up": '', "toggle-left": '', "toggle-right": '', "tool": '', "trash-2": '', "trash": '', "trello": '', "trending-down": '', "trending-up": '', "triangle": '', "truck": '', "tv": '', "twitch": '', "twitter": '', "type": '', "umbrella": '', "underline": '', "unlock": '', "upload-cloud": '', "upload": '', "user-check": '', "user-minus": '', "user-plus": '', "user-x": '', "user": '', "users": '', "video-off": '', "video": '', "voicemail": '', "volume-1": '', "volume-2": '', "volume-x": '', "volume": '', "watch": '', "wifi-off": '', "wifi": '', "wind": '', "x-circle": '', "x-octagon": '', "x-square": '', "x": '', "youtube": '', "zap-off": '', "zap": '', "zoom-in": '', "zoom-out": '' }; - } - ), - /***/ - "./node_modules/classnames/dedupe.js": ( - /*!*******************************************!*\ - !*** ./node_modules/classnames/dedupe.js ***! - \*******************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - (function() { - "use strict"; - var classNames = function() { - function StorageObject() { - } - StorageObject.prototype = /* @__PURE__ */ Object.create(null); - function _parseArray(resultSet, array) { - var length = array.length; - for (var i = 0; i < length; ++i) { - _parse(resultSet, array[i]); - } - } - var hasOwn = {}.hasOwnProperty; - function _parseNumber(resultSet, num) { - resultSet[num] = true; - } - function _parseObject(resultSet, object) { - for (var k in object) { - if (hasOwn.call(object, k)) { - resultSet[k] = !!object[k]; - } - } - } - var SPACE = /\s+/; - function _parseString(resultSet, str) { - var array = str.split(SPACE); - var length = array.length; - for (var i = 0; i < length; ++i) { - resultSet[array[i]] = true; - } - } - function _parse(resultSet, arg) { - if (!arg) - return; - var argType = typeof arg; - if (argType === "string") { - _parseString(resultSet, arg); - } else if (Array.isArray(arg)) { - _parseArray(resultSet, arg); - } else if (argType === "object") { - _parseObject(resultSet, arg); - } else if (argType === "number") { - _parseNumber(resultSet, arg); - } - } - function _classNames() { - var len = arguments.length; - var args = Array(len); - for (var i = 0; i < len; i++) { - args[i] = arguments[i]; - } - var classSet = new StorageObject(); - _parseArray(classSet, args); - var list = []; - for (var k in classSet) { - if (classSet[k]) { - list.push(k); - } - } - return list.join(" "); - } - return _classNames; - }(); - if (typeof module3 !== "undefined" && module3.exports) { - module3.exports = classNames; - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { - return classNames; - }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - } - })(); - } - ), - /***/ - "./node_modules/core-js/es/array/from.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/es/array/from.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - __webpack_require__( - /*! ../../modules/es.string.iterator */ - "./node_modules/core-js/modules/es.string.iterator.js" - ); - __webpack_require__( - /*! ../../modules/es.array.from */ - "./node_modules/core-js/modules/es.array.from.js" - ); - var path = __webpack_require__( - /*! ../../internals/path */ - "./node_modules/core-js/internals/path.js" - ); - module3.exports = path.Array.from; - } - ), - /***/ - "./node_modules/core-js/internals/a-function.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/a-function.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = function(it) { - if (typeof it != "function") { - throw TypeError(String(it) + " is not a function"); - } - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/an-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/an-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - module3.exports = function(it) { - if (!isObject(it)) { - throw TypeError(String(it) + " is not an object"); - } - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/array-from.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/array-from.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var bind = __webpack_require__( - /*! ../internals/bind-context */ - "./node_modules/core-js/internals/bind-context.js" - ); - var toObject = __webpack_require__( - /*! ../internals/to-object */ - "./node_modules/core-js/internals/to-object.js" - ); - var callWithSafeIterationClosing = __webpack_require__( - /*! ../internals/call-with-safe-iteration-closing */ - "./node_modules/core-js/internals/call-with-safe-iteration-closing.js" - ); - var isArrayIteratorMethod = __webpack_require__( - /*! ../internals/is-array-iterator-method */ - "./node_modules/core-js/internals/is-array-iterator-method.js" - ); - var toLength = __webpack_require__( - /*! ../internals/to-length */ - "./node_modules/core-js/internals/to-length.js" - ); - var createProperty = __webpack_require__( - /*! ../internals/create-property */ - "./node_modules/core-js/internals/create-property.js" - ); - var getIteratorMethod = __webpack_require__( - /*! ../internals/get-iterator-method */ - "./node_modules/core-js/internals/get-iterator-method.js" - ); - module3.exports = function from(arrayLike) { - var O = toObject(arrayLike); - var C = typeof this == "function" ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : void 0; - var mapping = mapfn !== void 0; - var index = 0; - var iteratorMethod = getIteratorMethod(O); - var length, result, step, iterator; - if (mapping) - mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0, 2); - if (iteratorMethod != void 0 && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - result = new C(); - for (; !(step = iterator.next()).done; index++) { - createProperty( - result, - index, - mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value - ); - } - } else { - length = toLength(O.length); - result = new C(length); - for (; length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/array-includes.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/array-includes.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var toLength = __webpack_require__( - /*! ../internals/to-length */ - "./node_modules/core-js/internals/to-length.js" - ); - var toAbsoluteIndex = __webpack_require__( - /*! ../internals/to-absolute-index */ - "./node_modules/core-js/internals/to-absolute-index.js" - ); - module3.exports = function(IS_INCLUDES) { - return function($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - if (IS_INCLUDES && el != el) - while (length > index) { - value = O[index++]; - if (value != value) - return true; - } - else - for (; length > index; index++) - if (IS_INCLUDES || index in O) { - if (O[index] === el) - return IS_INCLUDES || index || 0; - } - return !IS_INCLUDES && -1; - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/bind-context.js": ( - /*!********************************************************!*\ - !*** ./node_modules/core-js/internals/bind-context.js ***! - \********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var aFunction = __webpack_require__( - /*! ../internals/a-function */ - "./node_modules/core-js/internals/a-function.js" - ); - module3.exports = function(fn, that, length) { - aFunction(fn); - if (that === void 0) - return fn; - switch (length) { - case 0: - return function() { - return fn.call(that); - }; - case 1: - return function(a) { - return fn.call(that, a); - }; - case 2: - return function(a, b) { - return fn.call(that, a, b); - }; - case 3: - return function(a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function() { - return fn.apply(that, arguments); - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/call-with-safe-iteration-closing.js": ( - /*!****************************************************************************!*\ - !*** ./node_modules/core-js/internals/call-with-safe-iteration-closing.js ***! - \****************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - module3.exports = function(iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); - } catch (error) { - var returnMethod = iterator["return"]; - if (returnMethod !== void 0) - anObject(returnMethod.call(iterator)); - throw error; - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/check-correctness-of-iteration.js": ( - /*!**************************************************************************!*\ - !*** ./node_modules/core-js/internals/check-correctness-of-iteration.js ***! - \**************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var SAFE_CLOSING = false; - try { - var called = 0; - var iteratorWithReturn = { - next: function() { - return { done: !!called++ }; - }, - "return": function() { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function() { - return this; - }; - Array.from(iteratorWithReturn, function() { - throw 2; - }); - } catch (error) { - } - module3.exports = function(exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) - return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function() { - return { - next: function() { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { - } - return ITERATION_SUPPORT; - }; - } - ), - /***/ - "./node_modules/core-js/internals/classof-raw.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/classof-raw.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - var toString = {}.toString; - module3.exports = function(it) { - return toString.call(it).slice(8, -1); - }; - } - ), - /***/ - "./node_modules/core-js/internals/classof.js": ( - /*!***************************************************!*\ - !*** ./node_modules/core-js/internals/classof.js ***! - \***************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var classofRaw = __webpack_require__( - /*! ../internals/classof-raw */ - "./node_modules/core-js/internals/classof-raw.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var CORRECT_ARGUMENTS = classofRaw(function() { - return arguments; - }()) == "Arguments"; - var tryGet = function(it, key) { - try { - return it[key]; - } catch (error) { - } - }; - module3.exports = function(it) { - var O, tag, result; - return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/copy-constructor-properties.js": ( - /*!***********************************************************************!*\ - !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***! - \***********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var ownKeys = __webpack_require__( - /*! ../internals/own-keys */ - "./node_modules/core-js/internals/own-keys.js" - ); - var getOwnPropertyDescriptorModule = __webpack_require__( - /*! ../internals/object-get-own-property-descriptor */ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - module3.exports = function(target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (!has(target, key)) - defineProperty(target, key, getOwnPropertyDescriptor(source, key)); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/correct-prototype-getter.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/correct-prototype-getter.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !fails(function() { - function F() { - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - } - ), - /***/ - "./node_modules/core-js/internals/create-iterator-constructor.js": ( - /*!***********************************************************************!*\ - !*** ./node_modules/core-js/internals/create-iterator-constructor.js ***! - \***********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var IteratorPrototype = __webpack_require__( - /*! ../internals/iterators-core */ - "./node_modules/core-js/internals/iterators-core.js" - ).IteratorPrototype; - var create = __webpack_require__( - /*! ../internals/object-create */ - "./node_modules/core-js/internals/object-create.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - var setToStringTag = __webpack_require__( - /*! ../internals/set-to-string-tag */ - "./node_modules/core-js/internals/set-to-string-tag.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var returnThis = function() { - return this; - }; - module3.exports = function(IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + " Iterator"; - IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - } - ), - /***/ - "./node_modules/core-js/internals/create-property-descriptor.js": ( - /*!**********************************************************************!*\ - !*** ./node_modules/core-js/internals/create-property-descriptor.js ***! - \**********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = function(bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/create-property.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/create-property.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - module3.exports = function(object, key, value) { - var propertyKey = toPrimitive(key); - if (propertyKey in object) - definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else - object[propertyKey] = value; - }; - } - ), - /***/ - "./node_modules/core-js/internals/define-iterator.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/define-iterator.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var $ = __webpack_require__( - /*! ../internals/export */ - "./node_modules/core-js/internals/export.js" - ); - var createIteratorConstructor = __webpack_require__( - /*! ../internals/create-iterator-constructor */ - "./node_modules/core-js/internals/create-iterator-constructor.js" - ); - var getPrototypeOf = __webpack_require__( - /*! ../internals/object-get-prototype-of */ - "./node_modules/core-js/internals/object-get-prototype-of.js" - ); - var setPrototypeOf = __webpack_require__( - /*! ../internals/object-set-prototype-of */ - "./node_modules/core-js/internals/object-set-prototype-of.js" - ); - var setToStringTag = __webpack_require__( - /*! ../internals/set-to-string-tag */ - "./node_modules/core-js/internals/set-to-string-tag.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var redefine = __webpack_require__( - /*! ../internals/redefine */ - "./node_modules/core-js/internals/redefine.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var IteratorsCore = __webpack_require__( - /*! ../internals/iterators-core */ - "./node_modules/core-js/internals/iterators-core.js" - ); - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol("iterator"); - var KEYS = "keys"; - var VALUES = "values"; - var ENTRIES = "entries"; - var returnThis = function() { - return this; - }; - module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function(KIND) { - if (KIND === DEFAULT && defaultIterator) - return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) - return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function() { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + " Iterator"; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (typeof CurrentIteratorPrototype[ITERATOR] != "function") { - hide(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) - Iterators[TO_STRING_TAG] = returnThis; - } - } - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return nativeIterator.call(this); - }; - } - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - hide(IterablePrototype, ITERATOR, defaultIterator); - } - Iterators[NAME] = defaultIterator; - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) - for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } - else - $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } - return methods; - }; - } - ), - /***/ - "./node_modules/core-js/internals/descriptors.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/descriptors.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !fails(function() { - return Object.defineProperty({}, "a", { get: function() { - return 7; - } }).a != 7; - }); - } - ), - /***/ - "./node_modules/core-js/internals/document-create-element.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/document-create-element.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var isObject = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var document2 = global.document; - var exist = isObject(document2) && isObject(document2.createElement); - module3.exports = function(it) { - return exist ? document2.createElement(it) : {}; - }; - } - ), - /***/ - "./node_modules/core-js/internals/enum-bug-keys.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/enum-bug-keys.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf" - ]; - } - ), - /***/ - "./node_modules/core-js/internals/export.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/export.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var getOwnPropertyDescriptor = __webpack_require__( - /*! ../internals/object-get-own-property-descriptor */ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js" - ).f; - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var redefine = __webpack_require__( - /*! ../internals/redefine */ - "./node_modules/core-js/internals/redefine.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var copyConstructorProperties = __webpack_require__( - /*! ../internals/copy-constructor-properties */ - "./node_modules/core-js/internals/copy-constructor-properties.js" - ); - var isForced = __webpack_require__( - /*! ../internals/is-forced */ - "./node_modules/core-js/internals/is-forced.js" - ); - module3.exports = function(options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global; - } else if (STATIC) { - target = global[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global[TARGET] || {}).prototype; - } - if (target) - for (key in source) { - sourceProperty = source[key]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key); - targetProperty = descriptor && descriptor.value; - } else - targetProperty = target[key]; - FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced); - if (!FORCED && targetProperty !== void 0) { - if (typeof sourceProperty === typeof targetProperty) - continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - if (options.sham || targetProperty && targetProperty.sham) { - hide(sourceProperty, "sham", true); - } - redefine(target, key, sourceProperty, options); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/fails.js": ( - /*!*************************************************!*\ - !*** ./node_modules/core-js/internals/fails.js ***! - \*************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = function(exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/function-to-string.js": ( - /*!**************************************************************!*\ - !*** ./node_modules/core-js/internals/function-to-string.js ***! - \**************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - module3.exports = shared("native-function-to-string", Function.toString); - } - ), - /***/ - "./node_modules/core-js/internals/get-iterator-method.js": ( - /*!***************************************************************!*\ - !*** ./node_modules/core-js/internals/get-iterator-method.js ***! - \***************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var classof = __webpack_require__( - /*! ../internals/classof */ - "./node_modules/core-js/internals/classof.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - module3.exports = function(it) { - if (it != void 0) - return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; - }; - } - ), - /***/ - "./node_modules/core-js/internals/global.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/global.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - (function(global) { - var O = "object"; - var check = function(it) { - return it && it.Math == Math && it; - }; - module3.exports = // eslint-disable-next-line no-undef - check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global == O && global) || // eslint-disable-next-line no-new-func - Function("return this")(); - }).call(this, __webpack_require__( - /*! ./../../webpack/buildin/global.js */ - "./node_modules/webpack/buildin/global.js" - )); - } - ), - /***/ - "./node_modules/core-js/internals/has.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/internals/has.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - var hasOwnProperty = {}.hasOwnProperty; - module3.exports = function(it, key) { - return hasOwnProperty.call(it, key); - }; - } - ), - /***/ - "./node_modules/core-js/internals/hidden-keys.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/hidden-keys.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = {}; - } - ), - /***/ - "./node_modules/core-js/internals/hide.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/hide.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - module3.exports = DESCRIPTORS ? function(object, key, value) { - return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); - } : function(object, key, value) { - object[key] = value; - return object; - }; - } - ), - /***/ - "./node_modules/core-js/internals/html.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/html.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var document2 = global.document; - module3.exports = document2 && document2.documentElement; - } - ), - /***/ - "./node_modules/core-js/internals/ie8-dom-define.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/ie8-dom-define.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var createElement = __webpack_require__( - /*! ../internals/document-create-element */ - "./node_modules/core-js/internals/document-create-element.js" - ); - module3.exports = !DESCRIPTORS && !fails(function() { - return Object.defineProperty(createElement("div"), "a", { - get: function() { - return 7; - } - }).a != 7; - }); - } - ), - /***/ - "./node_modules/core-js/internals/indexed-object.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/indexed-object.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var classof = __webpack_require__( - /*! ../internals/classof-raw */ - "./node_modules/core-js/internals/classof-raw.js" - ); - var split = "".split; - module3.exports = fails(function() { - return !Object("z").propertyIsEnumerable(0); - }) ? function(it) { - return classof(it) == "String" ? split.call(it, "") : Object(it); - } : Object; - } - ), - /***/ - "./node_modules/core-js/internals/internal-state.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/internal-state.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var NATIVE_WEAK_MAP = __webpack_require__( - /*! ../internals/native-weak-map */ - "./node_modules/core-js/internals/native-weak-map.js" - ); - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var isObject = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var objectHas = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var WeakMap = global.WeakMap; - var set, get, has; - var enforce = function(it) { - return has(it) ? get(it) : set(it, {}); - }; - var getterFor = function(TYPE) { - return function(it) { - var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { - throw TypeError("Incompatible receiver, " + TYPE + " required"); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP) { - var store = new WeakMap(); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function(it, metadata) { - wmset.call(store, it, metadata); - return metadata; - }; - get = function(it) { - return wmget.call(store, it) || {}; - }; - has = function(it) { - return wmhas.call(store, it); - }; - } else { - var STATE = sharedKey("state"); - hiddenKeys[STATE] = true; - set = function(it, metadata) { - hide(it, STATE, metadata); - return metadata; - }; - get = function(it) { - return objectHas(it, STATE) ? it[STATE] : {}; - }; - has = function(it) { - return objectHas(it, STATE); - }; - } - module3.exports = { - set, - get, - has, - enforce, - getterFor - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-array-iterator-method.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/is-array-iterator-method.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var ArrayPrototype = Array.prototype; - module3.exports = function(it) { - return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-forced.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/is-forced.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var replacement = /#|\.prototype\./; - var isForced = function(feature, detection) { - var value = data[normalize(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection; - }; - var normalize = isForced.normalize = function(string) { - return String(string).replace(replacement, ".").toLowerCase(); - }; - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = "N"; - var POLYFILL = isForced.POLYFILL = "P"; - module3.exports = isForced; - } - ), - /***/ - "./node_modules/core-js/internals/is-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/is-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = function(it) { - return typeof it === "object" ? it !== null : typeof it === "function"; - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-pure.js": ( - /*!***************************************************!*\ - !*** ./node_modules/core-js/internals/is-pure.js ***! - \***************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = false; - } - ), - /***/ - "./node_modules/core-js/internals/iterators-core.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/iterators-core.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var getPrototypeOf = __webpack_require__( - /*! ../internals/object-get-prototype-of */ - "./node_modules/core-js/internals/object-get-prototype-of.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var BUGGY_SAFARI_ITERATORS = false; - var returnThis = function() { - return this; - }; - var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; - if ([].keys) { - arrayIterator = [].keys(); - if (!("next" in arrayIterator)) - BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) - IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - if (IteratorPrototype == void 0) - IteratorPrototype = {}; - if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) - hide(IteratorPrototype, ITERATOR, returnThis); - module3.exports = { - IteratorPrototype, - BUGGY_SAFARI_ITERATORS - }; - } - ), - /***/ - "./node_modules/core-js/internals/iterators.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/iterators.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = {}; - } - ), - /***/ - "./node_modules/core-js/internals/native-symbol.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/native-symbol.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !!Object.getOwnPropertySymbols && !fails(function() { - return !String(Symbol()); - }); - } - ), - /***/ - "./node_modules/core-js/internals/native-weak-map.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/native-weak-map.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var nativeFunctionToString = __webpack_require__( - /*! ../internals/function-to-string */ - "./node_modules/core-js/internals/function-to-string.js" - ); - var WeakMap = global.WeakMap; - module3.exports = typeof WeakMap === "function" && /native code/.test(nativeFunctionToString.call(WeakMap)); - } - ), - /***/ - "./node_modules/core-js/internals/object-create.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/object-create.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var defineProperties = __webpack_require__( - /*! ../internals/object-define-properties */ - "./node_modules/core-js/internals/object-define-properties.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var html = __webpack_require__( - /*! ../internals/html */ - "./node_modules/core-js/internals/html.js" - ); - var documentCreateElement = __webpack_require__( - /*! ../internals/document-create-element */ - "./node_modules/core-js/internals/document-create-element.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var IE_PROTO = sharedKey("IE_PROTO"); - var PROTOTYPE = "prototype"; - var Empty = function() { - }; - var createDict = function() { - var iframe = documentCreateElement("iframe"); - var length = enumBugKeys.length; - var lt = "<"; - var script = "script"; - var gt = ">"; - var js = "java" + script + ":"; - var iframeDocument; - iframe.style.display = "none"; - html.appendChild(iframe); - iframe.src = String(js); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + script + gt + "document.F=Object" + lt + "/" + script + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (length--) - delete createDict[PROTOTYPE][enumBugKeys[length]]; - return createDict(); - }; - module3.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - result[IE_PROTO] = O; - } else - result = createDict(); - return Properties === void 0 ? result : defineProperties(result, Properties); - }; - hiddenKeys[IE_PROTO] = true; - } - ), - /***/ - "./node_modules/core-js/internals/object-define-properties.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/object-define-properties.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var objectKeys = __webpack_require__( - /*! ../internals/object-keys */ - "./node_modules/core-js/internals/object-keys.js" - ); - module3.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var i = 0; - var key; - while (length > i) - definePropertyModule.f(O, key = keys[i++], Properties[key]); - return O; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-define-property.js": ( - /*!******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-define-property.js ***! - \******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var IE8_DOM_DEFINE = __webpack_require__( - /*! ../internals/ie8-dom-define */ - "./node_modules/core-js/internals/ie8-dom-define.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var nativeDefineProperty = Object.defineProperty; - exports2.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) - try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { - } - if ("get" in Attributes || "set" in Attributes) - throw TypeError("Accessors not supported"); - if ("value" in Attributes) - O[P] = Attributes.value; - return O; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js": ( - /*!******************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***! - \******************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var propertyIsEnumerableModule = __webpack_require__( - /*! ../internals/object-property-is-enumerable */ - "./node_modules/core-js/internals/object-property-is-enumerable.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var IE8_DOM_DEFINE = __webpack_require__( - /*! ../internals/ie8-dom-define */ - "./node_modules/core-js/internals/ie8-dom-define.js" - ); - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - exports2.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) - try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { - } - if (has(O, P)) - return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-names.js": ( - /*!*************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***! - \*************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var internalObjectKeys = __webpack_require__( - /*! ../internals/object-keys-internal */ - "./node_modules/core-js/internals/object-keys-internal.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - var hiddenKeys = enumBugKeys.concat("length", "prototype"); - exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-symbols.js": ( - /*!***************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***! - \***************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - exports2.f = Object.getOwnPropertySymbols; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-prototype-of.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-prototype-of.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var toObject = __webpack_require__( - /*! ../internals/to-object */ - "./node_modules/core-js/internals/to-object.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var CORRECT_PROTOTYPE_GETTER = __webpack_require__( - /*! ../internals/correct-prototype-getter */ - "./node_modules/core-js/internals/correct-prototype-getter.js" - ); - var IE_PROTO = sharedKey("IE_PROTO"); - var ObjectPrototype = Object.prototype; - module3.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function(O) { - O = toObject(O); - if (has(O, IE_PROTO)) - return O[IE_PROTO]; - if (typeof O.constructor == "function" && O instanceof O.constructor) { - return O.constructor.prototype; - } - return O instanceof Object ? ObjectPrototype : null; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-keys-internal.js": ( - /*!****************************************************************!*\ - !*** ./node_modules/core-js/internals/object-keys-internal.js ***! - \****************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var arrayIncludes = __webpack_require__( - /*! ../internals/array-includes */ - "./node_modules/core-js/internals/array-includes.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var arrayIndexOf = arrayIncludes(false); - module3.exports = function(object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - for (key in O) - !has(hiddenKeys, key) && has(O, key) && result.push(key); - while (names.length > i) - if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-keys.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/object-keys.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var internalObjectKeys = __webpack_require__( - /*! ../internals/object-keys-internal */ - "./node_modules/core-js/internals/object-keys-internal.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - module3.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-property-is-enumerable.js": ( - /*!*************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***! - \*************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var nativePropertyIsEnumerable = {}.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); - exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } : nativePropertyIsEnumerable; - } - ), - /***/ - "./node_modules/core-js/internals/object-set-prototype-of.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var validateSetPrototypeOfArguments = __webpack_require__( - /*! ../internals/validate-set-prototype-of-arguments */ - "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js" - ); - module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() { - var correctSetter = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set; - setter.call(test, []); - correctSetter = test instanceof Array; - } catch (error) { - } - return function setPrototypeOf(O, proto) { - validateSetPrototypeOfArguments(O, proto); - if (correctSetter) - setter.call(O, proto); - else - O.__proto__ = proto; - return O; - }; - }() : void 0); - } - ), - /***/ - "./node_modules/core-js/internals/own-keys.js": ( - /*!****************************************************!*\ - !*** ./node_modules/core-js/internals/own-keys.js ***! - \****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var getOwnPropertyNamesModule = __webpack_require__( - /*! ../internals/object-get-own-property-names */ - "./node_modules/core-js/internals/object-get-own-property-names.js" - ); - var getOwnPropertySymbolsModule = __webpack_require__( - /*! ../internals/object-get-own-property-symbols */ - "./node_modules/core-js/internals/object-get-own-property-symbols.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var Reflect2 = global.Reflect; - module3.exports = Reflect2 && Reflect2.ownKeys || function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - } - ), - /***/ - "./node_modules/core-js/internals/path.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/path.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - module3.exports = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - } - ), - /***/ - "./node_modules/core-js/internals/redefine.js": ( - /*!****************************************************!*\ - !*** ./node_modules/core-js/internals/redefine.js ***! - \****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var nativeFunctionToString = __webpack_require__( - /*! ../internals/function-to-string */ - "./node_modules/core-js/internals/function-to-string.js" - ); - var InternalStateModule = __webpack_require__( - /*! ../internals/internal-state */ - "./node_modules/core-js/internals/internal-state.js" - ); - var getInternalState = InternalStateModule.get; - var enforceInternalState = InternalStateModule.enforce; - var TEMPLATE = String(nativeFunctionToString).split("toString"); - shared("inspectSource", function(it) { - return nativeFunctionToString.call(it); - }); - (module3.exports = function(O, key, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == "function") { - if (typeof key == "string" && !has(value, "name")) - hide(value, "name", key); - enforceInternalState(value).source = TEMPLATE.join(typeof key == "string" ? key : ""); - } - if (O === global) { - if (simple) - O[key] = value; - else - setGlobal(key, value); - return; - } else if (!unsafe) { - delete O[key]; - } else if (!noTargetGet && O[key]) { - simple = true; - } - if (simple) - O[key] = value; - else - hide(O, key, value); - })(Function.prototype, "toString", function toString() { - return typeof this == "function" && getInternalState(this).source || nativeFunctionToString.call(this); - }); - } - ), - /***/ - "./node_modules/core-js/internals/require-object-coercible.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/require-object-coercible.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - module3.exports = function(it) { - if (it == void 0) - throw TypeError("Can't call method on " + it); - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/set-global.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/set-global.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - module3.exports = function(key, value) { - try { - hide(global, key, value); - } catch (error) { - global[key] = value; - } - return value; - }; - } - ), - /***/ - "./node_modules/core-js/internals/set-to-string-tag.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/set-to-string-tag.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var defineProperty = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ).f; - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - module3.exports = function(it, TAG, STATIC) { - if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/shared-key.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/shared-key.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var uid = __webpack_require__( - /*! ../internals/uid */ - "./node_modules/core-js/internals/uid.js" - ); - var keys = shared("keys"); - module3.exports = function(key) { - return keys[key] || (keys[key] = uid(key)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/shared.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/shared.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var SHARED = "__core-js_shared__"; - var store = global[SHARED] || setGlobal(SHARED, {}); - (module3.exports = function(key, value) { - return store[key] || (store[key] = value !== void 0 ? value : {}); - })("versions", []).push({ - version: "3.1.3", - mode: IS_PURE ? "pure" : "global", - copyright: "\xA9 2019 Denis Pushkarev (zloirock.ru)" - }); - } - ), - /***/ - "./node_modules/core-js/internals/string-at.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/string-at.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(that, pos, CONVERT_TO_STRING) { - var S = String(requireObjectCoercible(that)); - var position = toInteger(pos); - var size = S.length; - var first, second; - if (position < 0 || position >= size) - return CONVERT_TO_STRING ? "" : void 0; - first = S.charCodeAt(position); - return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536; - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-absolute-index.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/to-absolute-index.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var max = Math.max; - var min = Math.min; - module3.exports = function(index, length) { - var integer = toInteger(index); - return integer < 0 ? max(integer + length, 0) : min(integer, length); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-indexed-object.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/to-indexed-object.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var IndexedObject = __webpack_require__( - /*! ../internals/indexed-object */ - "./node_modules/core-js/internals/indexed-object.js" - ); - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(it) { - return IndexedObject(requireObjectCoercible(it)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-integer.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/to-integer.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - var ceil = Math.ceil; - var floor = Math.floor; - module3.exports = function(argument) { - return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-length.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/to-length.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var min = Math.min; - module3.exports = function(argument) { - return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0; - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/to-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(argument) { - return Object(requireObjectCoercible(argument)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-primitive.js": ( - /*!********************************************************!*\ - !*** ./node_modules/core-js/internals/to-primitive.js ***! - \********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - module3.exports = function(it, S) { - if (!isObject(it)) - return it; - var fn, val; - if (S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) - return val; - if (typeof (fn = it.valueOf) == "function" && !isObject(val = fn.call(it))) - return val; - if (!S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it))) - return val; - throw TypeError("Can't convert object to primitive value"); - }; - } - ), - /***/ - "./node_modules/core-js/internals/uid.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/internals/uid.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - var id = 0; - var postfix = Math.random(); - module3.exports = function(key) { - return "Symbol(".concat(key === void 0 ? "" : key, ")_", (++id + postfix).toString(36)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js": ( - /*!*******************************************************************************!*\ - !*** ./node_modules/core-js/internals/validate-set-prototype-of-arguments.js ***! - \*******************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var isObject = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - module3.exports = function(O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) { - throw TypeError("Can't set " + String(proto) + " as a prototype"); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/well-known-symbol.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/well-known-symbol.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var global = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var uid = __webpack_require__( - /*! ../internals/uid */ - "./node_modules/core-js/internals/uid.js" - ); - var NATIVE_SYMBOL = __webpack_require__( - /*! ../internals/native-symbol */ - "./node_modules/core-js/internals/native-symbol.js" - ); - var Symbol2 = global.Symbol; - var store = shared("wks"); - module3.exports = function(name) { - return store[name] || (store[name] = NATIVE_SYMBOL && Symbol2[name] || (NATIVE_SYMBOL ? Symbol2 : uid)("Symbol." + name)); - }; - } - ), - /***/ - "./node_modules/core-js/modules/es.array.from.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es.array.from.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - var $ = __webpack_require__( - /*! ../internals/export */ - "./node_modules/core-js/internals/export.js" - ); - var from = __webpack_require__( - /*! ../internals/array-from */ - "./node_modules/core-js/internals/array-from.js" - ); - var checkCorrectnessOfIteration = __webpack_require__( - /*! ../internals/check-correctness-of-iteration */ - "./node_modules/core-js/internals/check-correctness-of-iteration.js" - ); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { - Array.from(iterable); - }); - $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { - from - }); - } - ), - /***/ - "./node_modules/core-js/modules/es.string.iterator.js": ( - /*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es.string.iterator.js ***! - \************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var codePointAt = __webpack_require__( - /*! ../internals/string-at */ - "./node_modules/core-js/internals/string-at.js" - ); - var InternalStateModule = __webpack_require__( - /*! ../internals/internal-state */ - "./node_modules/core-js/internals/internal-state.js" - ); - var defineIterator = __webpack_require__( - /*! ../internals/define-iterator */ - "./node_modules/core-js/internals/define-iterator.js" - ); - var STRING_ITERATOR = "String Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - defineIterator(String, "String", function(iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0 - }); - }, function next() { - var state = getInternalState(this); - var string = state.string; - var index = state.index; - var point; - if (index >= string.length) - return { value: void 0, done: true }; - point = codePointAt(string, index, true); - state.index += point.length; - return { value: point, done: false }; - }); - } - ), - /***/ - "./node_modules/webpack/buildin/global.js": ( - /*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ - /*! no static exports found */ - /***/ - function(module3, exports2) { - var g; - g = function() { - return this; - }(); - try { - g = g || Function("return this")() || (1, eval)("this"); - } catch (e) { - if (typeof window === "object") - g = window; - } - module3.exports = g; - } - ), - /***/ - "./src/default-attrs.json": ( - /*!********************************!*\ - !*** ./src/default-attrs.json ***! - \********************************/ - /*! exports provided: xmlns, width, height, viewBox, fill, stroke, stroke-width, stroke-linecap, stroke-linejoin, default */ - /***/ - function(module3) { - module3.exports = { "xmlns": "http://www.w3.org/2000/svg", "width": 24, "height": 24, "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" }; - } - ), - /***/ - "./src/icon.js": ( - /*!*********************!*\ - !*** ./src/icon.js ***! - \*********************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - var _createClass = function() { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - var _dedupe = __webpack_require__( - /*! classnames/dedupe */ - "./node_modules/classnames/dedupe.js" - ); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _defaultAttrs = __webpack_require__( - /*! ./default-attrs.json */ - "./src/default-attrs.json" - ); - var _defaultAttrs2 = _interopRequireDefault(_defaultAttrs); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var Icon = function() { - function Icon2(name, contents) { - var tags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; - _classCallCheck(this, Icon2); - this.name = name; - this.contents = contents; - this.tags = tags; - this.attrs = _extends({}, _defaultAttrs2.default, { class: "feather feather-" + name }); - } - _createClass(Icon2, [{ - key: "toSvg", - value: function toSvg() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var combinedAttrs = _extends({}, this.attrs, attrs, { class: (0, _dedupe2.default)(this.attrs.class, attrs.class) }); - return "" + this.contents + ""; - } - /** - * Return string representation of an `Icon`. - * - * Added for backward compatibility. If old code expects `feather.icons.` - * to be a string, `toString()` will get implicitly called. - * - * @returns {string} - */ - }, { - key: "toString", - value: function toString() { - return this.contents; - } - }]); - return Icon2; - }(); - function attrsToString(attrs) { - return Object.keys(attrs).map(function(key) { - return key + '="' + attrs[key] + '"'; - }).join(" "); - } - exports2.default = Icon; - } - ), - /***/ - "./src/icons.js": ( - /*!**********************!*\ - !*** ./src/icons.js ***! - \**********************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _icon = __webpack_require__( - /*! ./icon */ - "./src/icon.js" - ); - var _icon2 = _interopRequireDefault(_icon); - var _icons = __webpack_require__( - /*! ../dist/icons.json */ - "./dist/icons.json" - ); - var _icons2 = _interopRequireDefault(_icons); - var _tags = __webpack_require__( - /*! ./tags.json */ - "./src/tags.json" - ); - var _tags2 = _interopRequireDefault(_tags); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - exports2.default = Object.keys(_icons2.default).map(function(key) { - return new _icon2.default(key, _icons2.default[key], _tags2.default[key]); - }).reduce(function(object, icon) { - object[icon.name] = icon; - return object; - }, {}); - } - ), - /***/ - "./src/index.js": ( - /*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - var _toSvg = __webpack_require__( - /*! ./to-svg */ - "./src/to-svg.js" - ); - var _toSvg2 = _interopRequireDefault(_toSvg); - var _replace = __webpack_require__( - /*! ./replace */ - "./src/replace.js" - ); - var _replace2 = _interopRequireDefault(_replace); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - module3.exports = { icons: _icons2.default, toSvg: _toSvg2.default, replace: _replace2.default }; - } - ), - /***/ - "./src/replace.js": ( - /*!************************!*\ - !*** ./src/replace.js ***! - \************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; - }; - var _dedupe = __webpack_require__( - /*! classnames/dedupe */ - "./node_modules/classnames/dedupe.js" - ); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function replace() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (typeof document === "undefined") { - throw new Error("`feather.replace()` only works in a browser environment."); - } - var elementsToReplace = document.querySelectorAll("[data-feather]"); - Array.from(elementsToReplace).forEach(function(element) { - return replaceElement(element, attrs); - }); - } - function replaceElement(element) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var elementAttrs = getAttrs(element); - var name = elementAttrs["data-feather"]; - delete elementAttrs["data-feather"]; - var svgString = _icons2.default[name].toSvg(_extends({}, attrs, elementAttrs, { class: (0, _dedupe2.default)(attrs.class, elementAttrs.class) })); - var svgDocument = new DOMParser().parseFromString(svgString, "image/svg+xml"); - var svgElement = svgDocument.querySelector("svg"); - element.parentNode.replaceChild(svgElement, element); - } - function getAttrs(element) { - return Array.from(element.attributes).reduce(function(attrs, attr) { - attrs[attr.name] = attr.value; - return attrs; - }, {}); - } - exports2.default = replace; - } - ), - /***/ - "./src/tags.json": ( - /*!***********************!*\ - !*** ./src/tags.json ***! - \***********************/ - /*! exports provided: activity, airplay, alert-circle, alert-octagon, alert-triangle, align-center, align-justify, align-left, align-right, anchor, archive, at-sign, award, aperture, bar-chart, bar-chart-2, battery, battery-charging, bell, bell-off, bluetooth, book-open, book, bookmark, box, briefcase, calendar, camera, cast, chevron-down, chevron-up, circle, clipboard, clock, cloud-drizzle, cloud-lightning, cloud-rain, cloud-snow, cloud, codepen, codesandbox, code, coffee, columns, command, compass, copy, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, cpu, credit-card, crop, crosshair, database, delete, disc, dollar-sign, droplet, edit, edit-2, edit-3, eye, eye-off, external-link, facebook, fast-forward, figma, file-minus, file-plus, file-text, film, filter, flag, folder-minus, folder-plus, folder, framer, frown, gift, git-branch, git-commit, git-merge, git-pull-request, github, gitlab, globe, hard-drive, hash, headphones, heart, help-circle, hexagon, home, image, inbox, instagram, key, layers, layout, life-buoy, link, link-2, linkedin, list, lock, log-in, log-out, mail, map-pin, map, maximize, maximize-2, meh, menu, message-circle, message-square, mic-off, mic, minimize, minimize-2, minus, monitor, moon, more-horizontal, more-vertical, mouse-pointer, move, music, navigation, navigation-2, octagon, package, paperclip, pause, pause-circle, pen-tool, percent, phone-call, phone-forwarded, phone-incoming, phone-missed, phone-off, phone-outgoing, phone, play, pie-chart, play-circle, plus, plus-circle, plus-square, pocket, power, printer, radio, refresh-cw, refresh-ccw, repeat, rewind, rotate-ccw, rotate-cw, rss, save, scissors, search, send, settings, share-2, shield, shield-off, shopping-bag, shopping-cart, shuffle, skip-back, skip-forward, slack, slash, sliders, smartphone, smile, speaker, star, stop-circle, sun, sunrise, sunset, tablet, tag, target, terminal, thermometer, thumbs-down, thumbs-up, toggle-left, toggle-right, tool, trash, trash-2, triangle, truck, tv, twitch, twitter, type, umbrella, unlock, user-check, user-minus, user-plus, user-x, user, users, video-off, video, voicemail, volume, volume-1, volume-2, volume-x, watch, wifi-off, wifi, wind, x-circle, x-octagon, x-square, x, youtube, zap-off, zap, zoom-in, zoom-out, default */ - /***/ - function(module3) { - module3.exports = { "activity": ["pulse", "health", "action", "motion"], "airplay": ["stream", "cast", "mirroring"], "alert-circle": ["warning", "alert", "danger"], "alert-octagon": ["warning", "alert", "danger"], "alert-triangle": ["warning", "alert", "danger"], "align-center": ["text alignment", "center"], "align-justify": ["text alignment", "justified"], "align-left": ["text alignment", "left"], "align-right": ["text alignment", "right"], "anchor": [], "archive": ["index", "box"], "at-sign": ["mention", "at", "email", "message"], "award": ["achievement", "badge"], "aperture": ["camera", "photo"], "bar-chart": ["statistics", "diagram", "graph"], "bar-chart-2": ["statistics", "diagram", "graph"], "battery": ["power", "electricity"], "battery-charging": ["power", "electricity"], "bell": ["alarm", "notification", "sound"], "bell-off": ["alarm", "notification", "silent"], "bluetooth": ["wireless"], "book-open": ["read", "library"], "book": ["read", "dictionary", "booklet", "magazine", "library"], "bookmark": ["read", "clip", "marker", "tag"], "box": ["cube"], "briefcase": ["work", "bag", "baggage", "folder"], "calendar": ["date"], "camera": ["photo"], "cast": ["chromecast", "airplay"], "chevron-down": ["expand"], "chevron-up": ["collapse"], "circle": ["off", "zero", "record"], "clipboard": ["copy"], "clock": ["time", "watch", "alarm"], "cloud-drizzle": ["weather", "shower"], "cloud-lightning": ["weather", "bolt"], "cloud-rain": ["weather"], "cloud-snow": ["weather", "blizzard"], "cloud": ["weather"], "codepen": ["logo"], "codesandbox": ["logo"], "code": ["source", "programming"], "coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"], "columns": ["layout"], "command": ["keyboard", "cmd", "terminal", "prompt"], "compass": ["navigation", "safari", "travel", "direction"], "copy": ["clone", "duplicate"], "corner-down-left": ["arrow", "return"], "corner-down-right": ["arrow"], "corner-left-down": ["arrow"], "corner-left-up": ["arrow"], "corner-right-down": ["arrow"], "corner-right-up": ["arrow"], "corner-up-left": ["arrow"], "corner-up-right": ["arrow"], "cpu": ["processor", "technology"], "credit-card": ["purchase", "payment", "cc"], "crop": ["photo", "image"], "crosshair": ["aim", "target"], "database": ["storage", "memory"], "delete": ["remove"], "disc": ["album", "cd", "dvd", "music"], "dollar-sign": ["currency", "money", "payment"], "droplet": ["water"], "edit": ["pencil", "change"], "edit-2": ["pencil", "change"], "edit-3": ["pencil", "change"], "eye": ["view", "watch"], "eye-off": ["view", "watch", "hide", "hidden"], "external-link": ["outbound"], "facebook": ["logo", "social"], "fast-forward": ["music"], "figma": ["logo", "design", "tool"], "file-minus": ["delete", "remove", "erase"], "file-plus": ["add", "create", "new"], "file-text": ["data", "txt", "pdf"], "film": ["movie", "video"], "filter": ["funnel", "hopper"], "flag": ["report"], "folder-minus": ["directory"], "folder-plus": ["directory"], "folder": ["directory"], "framer": ["logo", "design", "tool"], "frown": ["emoji", "face", "bad", "sad", "emotion"], "gift": ["present", "box", "birthday", "party"], "git-branch": ["code", "version control"], "git-commit": ["code", "version control"], "git-merge": ["code", "version control"], "git-pull-request": ["code", "version control"], "github": ["logo", "version control"], "gitlab": ["logo", "version control"], "globe": ["world", "browser", "language", "translate"], "hard-drive": ["computer", "server", "memory", "data"], "hash": ["hashtag", "number", "pound"], "headphones": ["music", "audio", "sound"], "heart": ["like", "love", "emotion"], "help-circle": ["question mark"], "hexagon": ["shape", "node.js", "logo"], "home": ["house", "living"], "image": ["picture"], "inbox": ["email"], "instagram": ["logo", "camera"], "key": ["password", "login", "authentication", "secure"], "layers": ["stack"], "layout": ["window", "webpage"], "life-buoy": ["help", "life ring", "support"], "link": ["chain", "url"], "link-2": ["chain", "url"], "linkedin": ["logo", "social media"], "list": ["options"], "lock": ["security", "password", "secure"], "log-in": ["sign in", "arrow", "enter"], "log-out": ["sign out", "arrow", "exit"], "mail": ["email", "message"], "map-pin": ["location", "navigation", "travel", "marker"], "map": ["location", "navigation", "travel"], "maximize": ["fullscreen"], "maximize-2": ["fullscreen", "arrows", "expand"], "meh": ["emoji", "face", "neutral", "emotion"], "menu": ["bars", "navigation", "hamburger"], "message-circle": ["comment", "chat"], "message-square": ["comment", "chat"], "mic-off": ["record", "sound", "mute"], "mic": ["record", "sound", "listen"], "minimize": ["exit fullscreen", "close"], "minimize-2": ["exit fullscreen", "arrows", "close"], "minus": ["subtract"], "monitor": ["tv", "screen", "display"], "moon": ["dark", "night"], "more-horizontal": ["ellipsis"], "more-vertical": ["ellipsis"], "mouse-pointer": ["arrow", "cursor"], "move": ["arrows"], "music": ["note"], "navigation": ["location", "travel"], "navigation-2": ["location", "travel"], "octagon": ["stop"], "package": ["box", "container"], "paperclip": ["attachment"], "pause": ["music", "stop"], "pause-circle": ["music", "audio", "stop"], "pen-tool": ["vector", "drawing"], "percent": ["discount"], "phone-call": ["ring"], "phone-forwarded": ["call"], "phone-incoming": ["call"], "phone-missed": ["call"], "phone-off": ["call", "mute"], "phone-outgoing": ["call"], "phone": ["call"], "play": ["music", "start"], "pie-chart": ["statistics", "diagram"], "play-circle": ["music", "start"], "plus": ["add", "new"], "plus-circle": ["add", "new"], "plus-square": ["add", "new"], "pocket": ["logo", "save"], "power": ["on", "off"], "printer": ["fax", "office", "device"], "radio": ["signal"], "refresh-cw": ["synchronise", "arrows"], "refresh-ccw": ["arrows"], "repeat": ["loop", "arrows"], "rewind": ["music"], "rotate-ccw": ["arrow"], "rotate-cw": ["arrow"], "rss": ["feed", "subscribe"], "save": ["floppy disk"], "scissors": ["cut"], "search": ["find", "magnifier", "magnifying glass"], "send": ["message", "mail", "email", "paper airplane", "paper aeroplane"], "settings": ["cog", "edit", "gear", "preferences"], "share-2": ["network", "connections"], "shield": ["security", "secure"], "shield-off": ["security", "insecure"], "shopping-bag": ["ecommerce", "cart", "purchase", "store"], "shopping-cart": ["ecommerce", "cart", "purchase", "store"], "shuffle": ["music"], "skip-back": ["music"], "skip-forward": ["music"], "slack": ["logo"], "slash": ["ban", "no"], "sliders": ["settings", "controls"], "smartphone": ["cellphone", "device"], "smile": ["emoji", "face", "happy", "good", "emotion"], "speaker": ["audio", "music"], "star": ["bookmark", "favorite", "like"], "stop-circle": ["media", "music"], "sun": ["brightness", "weather", "light"], "sunrise": ["weather", "time", "morning", "day"], "sunset": ["weather", "time", "evening", "night"], "tablet": ["device"], "tag": ["label"], "target": ["logo", "bullseye"], "terminal": ["code", "command line", "prompt"], "thermometer": ["temperature", "celsius", "fahrenheit", "weather"], "thumbs-down": ["dislike", "bad", "emotion"], "thumbs-up": ["like", "good", "emotion"], "toggle-left": ["on", "off", "switch"], "toggle-right": ["on", "off", "switch"], "tool": ["settings", "spanner"], "trash": ["garbage", "delete", "remove", "bin"], "trash-2": ["garbage", "delete", "remove", "bin"], "triangle": ["delta"], "truck": ["delivery", "van", "shipping", "transport", "lorry"], "tv": ["television", "stream"], "twitch": ["logo"], "twitter": ["logo", "social"], "type": ["text"], "umbrella": ["rain", "weather"], "unlock": ["security"], "user-check": ["followed", "subscribed"], "user-minus": ["delete", "remove", "unfollow", "unsubscribe"], "user-plus": ["new", "add", "create", "follow", "subscribe"], "user-x": ["delete", "remove", "unfollow", "unsubscribe", "unavailable"], "user": ["person", "account"], "users": ["group"], "video-off": ["camera", "movie", "film"], "video": ["camera", "movie", "film"], "voicemail": ["phone"], "volume": ["music", "sound", "mute"], "volume-1": ["music", "sound"], "volume-2": ["music", "sound"], "volume-x": ["music", "sound", "mute"], "watch": ["clock", "time"], "wifi-off": ["disabled"], "wifi": ["connection", "signal", "wireless"], "wind": ["weather", "air"], "x-circle": ["cancel", "close", "delete", "remove", "times", "clear"], "x-octagon": ["delete", "stop", "alert", "warning", "times", "clear"], "x-square": ["cancel", "close", "delete", "remove", "times", "clear"], "x": ["cancel", "close", "delete", "remove", "times", "clear"], "youtube": ["logo", "video", "play"], "zap-off": ["flash", "camera", "lightning"], "zap": ["flash", "camera", "lightning"], "zoom-in": ["magnifying glass"], "zoom-out": ["magnifying glass"] }; - } - ), - /***/ - "./src/to-svg.js": ( - /*!***********************!*\ - !*** ./src/to-svg.js ***! - \***********************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { - value: true - }); - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toSvg(name) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."); - if (!name) { - throw new Error("The required `key` (icon name) parameter is missing."); - } - if (!_icons2.default[name]) { - throw new Error("No icon matching '" + name + "'. See the complete list of icons at https://feathericons.com"); - } - return _icons2.default[name].toSvg(attrs); - } - exports2.default = toSvg; - } - ), - /***/ - 0: ( - /*!**************************************************!*\ - !*** multi core-js/es/array/from ./src/index.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports2, __webpack_require__) { - __webpack_require__( - /*! core-js/es/array/from */ - "./node_modules/core-js/es/array/from.js" - ); - module3.exports = __webpack_require__( - /*! /home/runner/work/feather/feather/src/index.js */ - "./src/index.js" - ); - } - ) - /******/ - }) - ); - }); - } -}); - -// node_modules/obsidian-daily-notes-interface/dist/main.js -var require_main = __commonJS({ - "node_modules/obsidian-daily-notes-interface/dist/main.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var obsidian = require("obsidian"); - var DEFAULT_DAILY_NOTE_FORMAT = "YYYY-MM-DD"; - var DEFAULT_WEEKLY_NOTE_FORMAT = "gggg-[W]ww"; - var DEFAULT_MONTHLY_NOTE_FORMAT = "YYYY-MM"; - var DEFAULT_QUARTERLY_NOTE_FORMAT = "YYYY-[Q]Q"; - var DEFAULT_YEARLY_NOTE_FORMAT = "YYYY"; - function shouldUsePeriodicNotesSettings(periodicity) { - var _a, _b; - const periodicNotes = window.app.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a[periodicity]) == null ? void 0 : _b.enabled); - } - function getDailyNoteSettings2() { - var _a, _b, _c, _d; - try { - const { internalPlugins, plugins } = window.app; - if (shouldUsePeriodicNotesSettings("daily")) { - const { format: format2, folder: folder2, template: template2 } = ((_b = (_a = plugins.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.daily) || {}; - return { - format: format2 || DEFAULT_DAILY_NOTE_FORMAT, - folder: (folder2 == null ? void 0 : folder2.trim()) || "", - template: (template2 == null ? void 0 : template2.trim()) || "" - }; - } - const { folder, format, template } = ((_d = (_c = internalPlugins.getPluginById("daily-notes")) == null ? void 0 : _c.instance) == null ? void 0 : _d.options) || {}; - return { - format: format || DEFAULT_DAILY_NOTE_FORMAT, - folder: (folder == null ? void 0 : folder.trim()) || "", - template: (template == null ? void 0 : template.trim()) || "" - }; - } catch (err) { - console.info("No custom daily note settings found!", err); - } - } - function getWeeklyNoteSettings() { - var _a, _b, _c, _d, _e, _f, _g; - try { - const pluginManager = window.app.plugins; - const calendarSettings = (_a = pluginManager.getPlugin("calendar")) == null ? void 0 : _a.options; - const periodicNotesSettings = (_c = (_b = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _b.settings) == null ? void 0 : _c.weekly; - if (shouldUsePeriodicNotesSettings("weekly")) { - return { - format: periodicNotesSettings.format || DEFAULT_WEEKLY_NOTE_FORMAT, - folder: ((_d = periodicNotesSettings.folder) == null ? void 0 : _d.trim()) || "", - template: ((_e = periodicNotesSettings.template) == null ? void 0 : _e.trim()) || "" - }; - } - const settings = calendarSettings || {}; - return { - format: settings.weeklyNoteFormat || DEFAULT_WEEKLY_NOTE_FORMAT, - folder: ((_f = settings.weeklyNoteFolder) == null ? void 0 : _f.trim()) || "", - template: ((_g = settings.weeklyNoteTemplate) == null ? void 0 : _g.trim()) || "" - }; - } catch (err) { - console.info("No custom weekly note settings found!", err); - } - } - function getMonthlyNoteSettings() { - var _a, _b, _c, _d; - const pluginManager = window.app.plugins; - try { - const settings = shouldUsePeriodicNotesSettings("monthly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.monthly) || {}; - return { - format: settings.format || DEFAULT_MONTHLY_NOTE_FORMAT, - folder: ((_c = settings.folder) == null ? void 0 : _c.trim()) || "", - template: ((_d = settings.template) == null ? void 0 : _d.trim()) || "" - }; - } catch (err) { - console.info("No custom monthly note settings found!", err); - } - } - function getQuarterlyNoteSettings() { - var _a, _b, _c, _d; - const pluginManager = window.app.plugins; - try { - const settings = shouldUsePeriodicNotesSettings("quarterly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.quarterly) || {}; - return { - format: settings.format || DEFAULT_QUARTERLY_NOTE_FORMAT, - folder: ((_c = settings.folder) == null ? void 0 : _c.trim()) || "", - template: ((_d = settings.template) == null ? void 0 : _d.trim()) || "" - }; - } catch (err) { - console.info("No custom quarterly note settings found!", err); - } - } - function getYearlyNoteSettings() { - var _a, _b, _c, _d; - const pluginManager = window.app.plugins; - try { - const settings = shouldUsePeriodicNotesSettings("yearly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.yearly) || {}; - return { - format: settings.format || DEFAULT_YEARLY_NOTE_FORMAT, - folder: ((_c = settings.folder) == null ? void 0 : _c.trim()) || "", - template: ((_d = settings.template) == null ? void 0 : _d.trim()) || "" - }; - } catch (err) { - console.info("No custom yearly note settings found!", err); - } - } - function join2(...partSegments) { - let parts = []; - for (let i = 0, l = partSegments.length; i < l; i++) { - parts = parts.concat(partSegments[i].split("/")); - } - const newParts = []; - for (let i = 0, l = parts.length; i < l; i++) { - const part = parts[i]; - if (!part || part === ".") - continue; - else - newParts.push(part); - } - if (parts[0] === "") - newParts.unshift(""); - return newParts.join("/"); - } - function basename(fullPath) { - let base = fullPath.substring(fullPath.lastIndexOf("/") + 1); - if (base.lastIndexOf(".") != -1) - base = base.substring(0, base.lastIndexOf(".")); - return base; - } - async function ensureFolderExists2(path) { - const dirs = path.replace(/\\/g, "/").split("/"); - dirs.pop(); - if (dirs.length) { - const dir = join2(...dirs); - if (!window.app.vault.getAbstractFileByPath(dir)) { - await window.app.vault.createFolder(dir); - } - } - } - async function getNotePath2(directory, filename) { - if (!filename.endsWith(".md")) { - filename += ".md"; - } - const path = obsidian.normalizePath(join2(directory, filename)); - await ensureFolderExists2(path); - return path; - } - async function getTemplateInfo(template) { - const { metadataCache, vault } = window.app; - const templatePath = obsidian.normalizePath(template); - if (templatePath === "/") { - return Promise.resolve(["", null]); - } - try { - const templateFile = metadataCache.getFirstLinkpathDest(templatePath, ""); - const contents = await vault.cachedRead(templateFile); - const IFoldInfo = window.app.foldManager.load(templateFile); - return [contents, IFoldInfo]; - } catch (err) { - console.error(`Failed to read the daily note template '${templatePath}'`, err); - new obsidian.Notice("Failed to read the daily note template"); - return ["", null]; - } - } - function getDateUID(date, granularity = "day") { - const ts = date.clone().startOf(granularity).format(); - return `${granularity}-${ts}`; - } - function removeEscapedCharacters(format) { - return format.replace(/\[[^\]]*\]/g, ""); - } - function isFormatAmbiguous(format, granularity) { - if (granularity === "week") { - const cleanFormat = removeEscapedCharacters(format); - return /w{1,2}/i.test(cleanFormat) && (/M{1,4}/.test(cleanFormat) || /D{1,4}/.test(cleanFormat)); - } - return false; - } - function getDateFromFile(file, granularity) { - return getDateFromFilename(file.basename, granularity); - } - function getDateFromPath(path, granularity) { - return getDateFromFilename(basename(path), granularity); - } - function getDateFromFilename(filename, granularity) { - const getSettings = { - day: getDailyNoteSettings2, - week: getWeeklyNoteSettings, - month: getMonthlyNoteSettings, - quarter: getQuarterlyNoteSettings, - year: getYearlyNoteSettings - }; - const format = getSettings[granularity]().format.split("/").pop(); - const noteDate = window.moment(filename, format, true); - if (!noteDate.isValid()) { - return null; - } - if (isFormatAmbiguous(format, granularity)) { - if (granularity === "week") { - const cleanFormat = removeEscapedCharacters(format); - if (/w{1,2}/i.test(cleanFormat)) { - return window.moment( - filename, - // If format contains week, remove day & month formatting - format.replace(/M{1,4}/g, "").replace(/D{1,4}/g, ""), - false - ); - } - } - } - return noteDate; - } - var DailyNotesFolderMissingError = class extends Error { - }; - async function createDailyNote2(date) { - const app2 = window.app; - const { vault } = app2; - const moment = window.moment; - const { template, format, folder } = getDailyNoteSettings2(); - const [templateContents, IFoldInfo] = await getTemplateInfo(template); - const filename = date.format(format); - const normalizedPath = await getNotePath2(folder, filename); - try { - const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { - const now = moment(); - const currentDate = date.clone().set({ - hour: now.get("hour"), - minute: now.get("minute"), - second: now.get("second") - }); - if (calc) { - currentDate.add(parseInt(timeDelta, 10), unit); - } - if (momentFormat) { - return currentDate.format(momentFormat.substring(1).trim()); - } - return currentDate.format(format); - }).replace(/{{\s*yesterday\s*}}/gi, date.clone().subtract(1, "day").format(format)).replace(/{{\s*tomorrow\s*}}/gi, date.clone().add(1, "d").format(format))); - app2.foldManager.save(createdFile, IFoldInfo); - return createdFile; - } catch (err) { - console.error(`Failed to create file: '${normalizedPath}'`, err); - new obsidian.Notice("Unable to create new file."); - } - } - function getDailyNote2(date, dailyNotes) { - var _a; - return (_a = dailyNotes[getDateUID(date, "day")]) != null ? _a : null; - } - function getAllDailyNotes2() { - const { vault } = window.app; - const { folder } = getDailyNoteSettings2(); - const dailyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder)); - if (!dailyNotesFolder) { - throw new DailyNotesFolderMissingError("Failed to find daily notes folder"); - } - const dailyNotes = {}; - obsidian.Vault.recurseChildren(dailyNotesFolder, (note) => { - if (note instanceof obsidian.TFile) { - const date = getDateFromFile(note, "day"); - if (date) { - const dateString = getDateUID(date, "day"); - dailyNotes[dateString] = note; - } - } - }); - return dailyNotes; - } - var WeeklyNotesFolderMissingError = class extends Error { - }; - function getDaysOfWeek() { - const { moment } = window; - let weekStart = moment.localeData()._week.dow; - const daysOfWeek = [ - "sunday", - "monday", - "tuesday", - "wednesday", - "thursday", - "friday", - "saturday" - ]; - while (weekStart) { - daysOfWeek.push(daysOfWeek.shift()); - weekStart--; - } - return daysOfWeek; - } - function getDayOfWeekNumericalValue(dayOfWeekName) { - return getDaysOfWeek().indexOf(dayOfWeekName.toLowerCase()); - } - async function createWeeklyNote(date) { - const { vault } = window.app; - const { template, format, folder } = getWeeklyNoteSettings(); - const [templateContents, IFoldInfo] = await getTemplateInfo(template); - const filename = date.format(format); - const normalizedPath = await getNotePath2(folder, filename); - try { - const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { - const now = window.moment(); - const currentDate = date.clone().set({ - hour: now.get("hour"), - minute: now.get("minute"), - second: now.get("second") - }); - if (calc) { - currentDate.add(parseInt(timeDelta, 10), unit); - } - if (momentFormat) { - return currentDate.format(momentFormat.substring(1).trim()); - } - return currentDate.format(format); - }).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi, (_, dayOfWeek, momentFormat) => { - const day = getDayOfWeekNumericalValue(dayOfWeek); - return date.weekday(day).format(momentFormat.trim()); - })); - window.app.foldManager.save(createdFile, IFoldInfo); - return createdFile; - } catch (err) { - console.error(`Failed to create file: '${normalizedPath}'`, err); - new obsidian.Notice("Unable to create new file."); - } - } - function getWeeklyNote(date, weeklyNotes) { - var _a; - return (_a = weeklyNotes[getDateUID(date, "week")]) != null ? _a : null; - } - function getAllWeeklyNotes() { - const weeklyNotes = {}; - if (!appHasWeeklyNotesPluginLoaded()) { - return weeklyNotes; - } - const { vault } = window.app; - const { folder } = getWeeklyNoteSettings(); - const weeklyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder)); - if (!weeklyNotesFolder) { - throw new WeeklyNotesFolderMissingError("Failed to find weekly notes folder"); - } - obsidian.Vault.recurseChildren(weeklyNotesFolder, (note) => { - if (note instanceof obsidian.TFile) { - const date = getDateFromFile(note, "week"); - if (date) { - const dateString = getDateUID(date, "week"); - weeklyNotes[dateString] = note; - } - } - }); - return weeklyNotes; - } - var MonthlyNotesFolderMissingError = class extends Error { - }; - async function createMonthlyNote(date) { - const { vault } = window.app; - const { template, format, folder } = getMonthlyNoteSettings(); - const [templateContents, IFoldInfo] = await getTemplateInfo(template); - const filename = date.format(format); - const normalizedPath = await getNotePath2(folder, filename); - try { - const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { - const now = window.moment(); - const currentDate = date.clone().set({ - hour: now.get("hour"), - minute: now.get("minute"), - second: now.get("second") - }); - if (calc) { - currentDate.add(parseInt(timeDelta, 10), unit); - } - if (momentFormat) { - return currentDate.format(momentFormat.substring(1).trim()); - } - return currentDate.format(format); - }).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename)); - window.app.foldManager.save(createdFile, IFoldInfo); - return createdFile; - } catch (err) { - console.error(`Failed to create file: '${normalizedPath}'`, err); - new obsidian.Notice("Unable to create new file."); - } - } - function getMonthlyNote(date, monthlyNotes) { - var _a; - return (_a = monthlyNotes[getDateUID(date, "month")]) != null ? _a : null; - } - function getAllMonthlyNotes() { - const monthlyNotes = {}; - if (!appHasMonthlyNotesPluginLoaded()) { - return monthlyNotes; - } - const { vault } = window.app; - const { folder } = getMonthlyNoteSettings(); - const monthlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder)); - if (!monthlyNotesFolder) { - throw new MonthlyNotesFolderMissingError("Failed to find monthly notes folder"); - } - obsidian.Vault.recurseChildren(monthlyNotesFolder, (note) => { - if (note instanceof obsidian.TFile) { - const date = getDateFromFile(note, "month"); - if (date) { - const dateString = getDateUID(date, "month"); - monthlyNotes[dateString] = note; - } - } - }); - return monthlyNotes; - } - var QuarterlyNotesFolderMissingError = class extends Error { - }; - async function createQuarterlyNote(date) { - const { vault } = window.app; - const { template, format, folder } = getQuarterlyNoteSettings(); - const [templateContents, IFoldInfo] = await getTemplateInfo(template); - const filename = date.format(format); - const normalizedPath = await getNotePath2(folder, filename); - try { - const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { - const now = window.moment(); - const currentDate = date.clone().set({ - hour: now.get("hour"), - minute: now.get("minute"), - second: now.get("second") - }); - if (calc) { - currentDate.add(parseInt(timeDelta, 10), unit); - } - if (momentFormat) { - return currentDate.format(momentFormat.substring(1).trim()); - } - return currentDate.format(format); - }).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename)); - window.app.foldManager.save(createdFile, IFoldInfo); - return createdFile; - } catch (err) { - console.error(`Failed to create file: '${normalizedPath}'`, err); - new obsidian.Notice("Unable to create new file."); - } - } - function getQuarterlyNote(date, quarterly) { - var _a; - return (_a = quarterly[getDateUID(date, "quarter")]) != null ? _a : null; - } - function getAllQuarterlyNotes() { - const quarterly = {}; - if (!appHasQuarterlyNotesPluginLoaded()) { - return quarterly; - } - const { vault } = window.app; - const { folder } = getQuarterlyNoteSettings(); - const quarterlyFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder)); - if (!quarterlyFolder) { - throw new QuarterlyNotesFolderMissingError("Failed to find quarterly notes folder"); - } - obsidian.Vault.recurseChildren(quarterlyFolder, (note) => { - if (note instanceof obsidian.TFile) { - const date = getDateFromFile(note, "quarter"); - if (date) { - const dateString = getDateUID(date, "quarter"); - quarterly[dateString] = note; - } - } - }); - return quarterly; - } - var YearlyNotesFolderMissingError = class extends Error { - }; - async function createYearlyNote(date) { - const { vault } = window.app; - const { template, format, folder } = getYearlyNoteSettings(); - const [templateContents, IFoldInfo] = await getTemplateInfo(template); - const filename = date.format(format); - const normalizedPath = await getNotePath2(folder, filename); - try { - const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => { - const now = window.moment(); - const currentDate = date.clone().set({ - hour: now.get("hour"), - minute: now.get("minute"), - second: now.get("second") - }); - if (calc) { - currentDate.add(parseInt(timeDelta, 10), unit); - } - if (momentFormat) { - return currentDate.format(momentFormat.substring(1).trim()); - } - return currentDate.format(format); - }).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename)); - window.app.foldManager.save(createdFile, IFoldInfo); - return createdFile; - } catch (err) { - console.error(`Failed to create file: '${normalizedPath}'`, err); - new obsidian.Notice("Unable to create new file."); - } - } - function getYearlyNote(date, yearlyNotes) { - var _a; - return (_a = yearlyNotes[getDateUID(date, "year")]) != null ? _a : null; - } - function getAllYearlyNotes() { - const yearlyNotes = {}; - if (!appHasYearlyNotesPluginLoaded()) { - return yearlyNotes; - } - const { vault } = window.app; - const { folder } = getYearlyNoteSettings(); - const yearlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder)); - if (!yearlyNotesFolder) { - throw new YearlyNotesFolderMissingError("Failed to find yearly notes folder"); - } - obsidian.Vault.recurseChildren(yearlyNotesFolder, (note) => { - if (note instanceof obsidian.TFile) { - const date = getDateFromFile(note, "year"); - if (date) { - const dateString = getDateUID(date, "year"); - yearlyNotes[dateString] = note; - } - } - }); - return yearlyNotes; - } - function appHasDailyNotesPluginLoaded2() { - var _a, _b; - const { app: app2 } = window; - const dailyNotesPlugin = app2.internalPlugins.plugins["daily-notes"]; - if (dailyNotesPlugin && dailyNotesPlugin.enabled) { - return true; - } - const periodicNotes = app2.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.daily) == null ? void 0 : _b.enabled); - } - function appHasWeeklyNotesPluginLoaded() { - var _a, _b; - const { app: app2 } = window; - if (app2.plugins.getPlugin("calendar")) { - return true; - } - const periodicNotes = app2.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.weekly) == null ? void 0 : _b.enabled); - } - function appHasMonthlyNotesPluginLoaded() { - var _a, _b; - const { app: app2 } = window; - const periodicNotes = app2.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.monthly) == null ? void 0 : _b.enabled); - } - function appHasQuarterlyNotesPluginLoaded() { - var _a, _b; - const { app: app2 } = window; - const periodicNotes = app2.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.quarterly) == null ? void 0 : _b.enabled); - } - function appHasYearlyNotesPluginLoaded() { - var _a, _b; - const { app: app2 } = window; - const periodicNotes = app2.plugins.getPlugin("periodic-notes"); - return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.yearly) == null ? void 0 : _b.enabled); - } - function getPeriodicNoteSettings(granularity) { - const getSettings = { - day: getDailyNoteSettings2, - week: getWeeklyNoteSettings, - month: getMonthlyNoteSettings, - quarter: getQuarterlyNoteSettings, - year: getYearlyNoteSettings - }[granularity]; - return getSettings(); - } - function createPeriodicNote(granularity, date) { - const createFn = { - day: createDailyNote2, - month: createMonthlyNote, - week: createWeeklyNote - }; - return createFn[granularity](date); - } - exports.DEFAULT_DAILY_NOTE_FORMAT = DEFAULT_DAILY_NOTE_FORMAT; - exports.DEFAULT_MONTHLY_NOTE_FORMAT = DEFAULT_MONTHLY_NOTE_FORMAT; - exports.DEFAULT_QUARTERLY_NOTE_FORMAT = DEFAULT_QUARTERLY_NOTE_FORMAT; - exports.DEFAULT_WEEKLY_NOTE_FORMAT = DEFAULT_WEEKLY_NOTE_FORMAT; - exports.DEFAULT_YEARLY_NOTE_FORMAT = DEFAULT_YEARLY_NOTE_FORMAT; - exports.appHasDailyNotesPluginLoaded = appHasDailyNotesPluginLoaded2; - exports.appHasMonthlyNotesPluginLoaded = appHasMonthlyNotesPluginLoaded; - exports.appHasQuarterlyNotesPluginLoaded = appHasQuarterlyNotesPluginLoaded; - exports.appHasWeeklyNotesPluginLoaded = appHasWeeklyNotesPluginLoaded; - exports.appHasYearlyNotesPluginLoaded = appHasYearlyNotesPluginLoaded; - exports.createDailyNote = createDailyNote2; - exports.createMonthlyNote = createMonthlyNote; - exports.createPeriodicNote = createPeriodicNote; - exports.createQuarterlyNote = createQuarterlyNote; - exports.createWeeklyNote = createWeeklyNote; - exports.createYearlyNote = createYearlyNote; - exports.getAllDailyNotes = getAllDailyNotes2; - exports.getAllMonthlyNotes = getAllMonthlyNotes; - exports.getAllQuarterlyNotes = getAllQuarterlyNotes; - exports.getAllWeeklyNotes = getAllWeeklyNotes; - exports.getAllYearlyNotes = getAllYearlyNotes; - exports.getDailyNote = getDailyNote2; - exports.getDailyNoteSettings = getDailyNoteSettings2; - exports.getDateFromFile = getDateFromFile; - exports.getDateFromPath = getDateFromPath; - exports.getDateUID = getDateUID; - exports.getMonthlyNote = getMonthlyNote; - exports.getMonthlyNoteSettings = getMonthlyNoteSettings; - exports.getPeriodicNoteSettings = getPeriodicNoteSettings; - exports.getQuarterlyNote = getQuarterlyNote; - exports.getQuarterlyNoteSettings = getQuarterlyNoteSettings; - exports.getTemplateInfo = getTemplateInfo; - exports.getWeeklyNote = getWeeklyNote; - exports.getWeeklyNoteSettings = getWeeklyNoteSettings; - exports.getYearlyNote = getYearlyNote; - exports.getYearlyNoteSettings = getYearlyNoteSettings; - } -}); - -// src/main.ts -var main_exports = {}; -__export(main_exports, { - default: () => AdvancedURI -}); -module.exports = __toCommonJS(main_exports); -var import_obsidian14 = require("obsidian"); - -// node_modules/obsidian-community-lib/dist/utils.js -var feather = __toESM(require_feather()); -var import_obsidian = require("obsidian"); -var stripMD = (noteName) => { - if (noteName.match(/\.MD$|\.md$/m)) { - return noteName.split(/\.MD$|\.md$/m).slice(0, -1).join(".md"); - } else - return noteName; -}; - -// src/main.ts -var import_obsidian_daily_notes_interface2 = __toESM(require_main()); - -// src/block_utils.ts -var import_obsidian2 = require("obsidian"); -var BlockUtils = class _BlockUtils { - static getBlock(app2, editor, file) { - var _a, _b; - const cursor = editor.getCursor("to"); - const fileCache = app2.metadataCache.getFileCache(file); - const sections = fileCache == null ? void 0 : fileCache.sections; - if (!sections || sections.length === 0) { - console.log("error reading FileCache (empty file?)"); - return; - } - const foundSectionIndex = sections.findIndex((section) => section.position.start.line > cursor.line); - let currentBlock = foundSectionIndex > 0 ? sections[foundSectionIndex - 1] : sections[sections.length - 1]; - if ((currentBlock == null ? void 0 : currentBlock.type) == "list") { - currentBlock = (_b = (_a = fileCache.listItems) == null ? void 0 : _a.find( - (section) => section.position.start.line <= cursor.line && section.position.end.line >= cursor.line - )) != null ? _b : currentBlock; - } - return currentBlock; - } - static getIdOfBlock(editor, block) { - const blockId = block.id; - if (blockId) { - return blockId; - } - const sectionEnd = block.position.end; - const pos = { - ch: sectionEnd.col, - line: sectionEnd.line - }; - const newId = Math.random().toString(36).substring(2, 8); - const spacer = _BlockUtils.shouldInsertAfter(block) ? "\n\n" : " "; - editor.replaceRange(`${spacer}^${newId}`, pos); - return newId; - } - static shouldInsertAfter(block) { - if (block.type) { - return [ - "blockquote", - "code", - "table", - "heading", - "comment", - "footnoteDefinition" - ].includes(block.type); - } - } - static getBlockId(app2) { - const view = app2.workspace.getActiveViewOfType(import_obsidian2.MarkdownView); - if (view) { - const editor = view.editor; - const file = view.file; - const block = this.getBlock(app2, editor, file); - if (block) - return this.getIdOfBlock(editor, block); - } - } -}; - -// src/constants.ts -var DEFAULT_SETTINGS = { - openFileOnWrite: true, - openDailyInNewPane: false, - openFileOnWriteInNewPane: false, - openFileWithoutWriteInNewPane: false, - idField: "id", - useUID: false, - addFilepathWhenUsingUID: false, - allowEval: false, - includeVaultName: true, - vaultParam: "name" -}; - -// src/daily_note_utils.ts -var import_obsidian3 = require("obsidian"); -var import_obsidian_daily_notes_interface = __toESM(require_main()); -function join(...partSegments) { - let parts = []; - for (let i = 0, l = partSegments.length; i < l; i++) { - parts = parts.concat(partSegments[i].split("/")); - } - const newParts = []; - for (let i = 0, l = parts.length; i < l; i++) { - const part = parts[i]; - if (!part || part === ".") - continue; - else - newParts.push(part); - } - if (parts[0] === "") - newParts.unshift(""); - return newParts.join("/"); -} -async function getNotePath(directory, filename) { - if (!filename.endsWith(".md")) { - filename += ".md"; - } - const path = (0, import_obsidian3.normalizePath)(join(directory, filename)); - await ensureFolderExists(path); - return path; -} -async function ensureFolderExists(path) { - const dirs = path.replace(/\\/g, "/").split("/"); - dirs.pop(); - if (dirs.length) { - const dir = join(...dirs); - if (!window.app.vault.getAbstractFileByPath(dir)) { - await window.app.vault.createFolder(dir); - } - } -} -async function getDailyNotePath(date) { - const { format, folder } = (0, import_obsidian_daily_notes_interface.getDailyNoteSettings)(); - const filename = date.format(format); - const normalizedPath = await getNotePath(folder, filename); - return normalizedPath; -} - -// src/handlers.ts -var import_obsidian7 = require("obsidian"); - -// src/modals/enter_data_modal.ts -var import_obsidian4 = require("obsidian"); -var EnterDataModal = class extends import_obsidian4.SuggestModal { - constructor(plugin, file) { - super(plugin.app); - this.file = file; - //null if for normal write mode, its not associated with a special mode like "append" or "prepend" - this.modes = [null, "overwrite", "append", "prepend"]; - this.plugin = plugin; - this.setPlaceholder( - "Type your data to be written to the file or leave it empty to just open it" - ); - } - getSuggestions(query) { - if (query == "") - query = null; - let suggestions = []; - for (const mode of this.modes) { - if (!(mode === "overwrite" && !query)) { - let display; - if (query) { - if (mode) { - display = `Write "${query}" in ${mode} mode`; - } else { - display = `Write "${query}"`; - } - } else { - if (mode) { - display = `Open in ${mode} mode`; - } else { - display = `Open`; - } - } - suggestions.push({ - data: query, - display, - mode, - func: () => { - if (this.file) { - this.plugin.tools.copyURI({ - filepath: this.file, - data: query, - mode - }); - } else { - this.plugin.tools.copyURI({ - daily: "true", - data: query, - mode - }); - } - } - }); - } - } - return suggestions; - } - renderSuggestion(value, el) { - el.innerText = value.display; - } - onChooseSuggestion(item, _) { - item.func(); - } -}; - -// src/modals/file_modal.ts -var import_obsidian5 = require("obsidian"); -var FileModal = class extends import_obsidian5.FuzzySuggestModal { - constructor(plugin, placeHolder, allowNoFile = true) { - super(plugin.app); - this.placeHolder = placeHolder; - this.allowNoFile = allowNoFile; - this.plugin = plugin; - this.setPlaceholder(this.placeHolder); - } - getItems() { - let specialItems = []; - if (this.allowNoFile) { - specialItems.push({ - display: "", - source: void 0 - }); - } - const file = this.app.workspace.getActiveFile(); - if (file) { - specialItems.push({ display: "", source: file.path }); - } - return [ - ...specialItems, - ...this.app.vault.getFiles().map((e) => { - return { display: e.path, source: e.path }; - }) - ]; - } - getItemText(item) { - return item.display; - } - onChooseItem(item, evt) { - } -}; - -// src/utils.ts -var import_obsidian6 = require("obsidian"); -function getViewStateFromMode(parameters) { - return parameters.viewmode ? { - state: { - mode: parameters.viewmode, - source: parameters.viewmode == "source" - } - } : void 0; -} -function copyText(text) { - return navigator.clipboard.writeText(text); -} -function getAlternativeFilePath(app2, file) { - var _a; - const dir = (_a = file.parent) == null ? void 0 : _a.path; - const formattedDir = dir === "/" ? "" : dir; - const name = file.name; - for (let index = 1; index < 100; index++) { - const base = stripMD(name); - const alternative = formattedDir + (formattedDir == "" ? "" : "/") + base + ` ${index}.md`; - const exists = app2.vault.getAbstractFileByPath(alternative) !== null; - if (!exists) { - return alternative; - } - } -} -function getFileUri(app2, file) { - const url = new URL(app2.vault.getResourcePath(file)); - url.host = "localhosthostlocal"; - url.protocol = "file"; - url.search = ""; - url.pathname = decodeURIComponent(url.pathname); - const res = url.toString().replace("/localhosthostlocal/", "/"); - return res; -} -function getEndAndBeginningOfHeading(app2, file, heading) { - var _a, _b; - const cache = app2.metadataCache.getFileCache(file); - const sections = cache.sections; - const foundHeading = (_a = cache.headings) == null ? void 0 : _a.find((e) => e.heading === heading); - if (foundHeading) { - const foundSectionIndex = sections.findIndex( - (section) => section.type === "heading" && section.position.start.line === foundHeading.position.start.line - ); - const restSections = sections.slice(foundSectionIndex + 1); - const nextHeadingIndex = restSections == null ? void 0 : restSections.findIndex( - (e) => e.type === "heading" - ); - const lastSection = (_b = restSections[(nextHeadingIndex !== -1 ? nextHeadingIndex : restSections.length) - 1]) != null ? _b : sections[foundSectionIndex]; - const lastLine = lastSection.position.end.line + 1; - return { - lastLine, - firstLine: sections[foundSectionIndex].position.end.line + 1 - }; - } else { - new import_obsidian6.Notice("Can't find heading"); - } -} - -// src/handlers.ts -var Handlers = class { - constructor(plugin) { - this.plugin = plugin; - this.app = this.plugin.app; - } - get tools() { - return this.plugin.tools; - } - handlePluginManagement(parameters) { - if (parameters["enable-plugin"]) { - const pluginId = parameters["enable-plugin"]; - if (this.app.plugins.getPlugin(pluginId)) { - this.app.plugins.enablePluginAndSave(pluginId); - new import_obsidian7.Notice(`Enabled ${pluginId}`); - } else if (this.app.internalPlugins.plugins[pluginId]) { - this.app.internalPlugins.plugins[pluginId].enable(true); - new import_obsidian7.Notice(`Enabled ${pluginId}`); - } - } else if (parameters["disable-plugin"]) { - const pluginId = parameters["disable-plugin"]; - if (this.app.plugins.getPlugin(pluginId)) { - this.app.plugins.disablePluginAndSave(pluginId); - new import_obsidian7.Notice(`Disabled ${pluginId}`); - } else if (this.app.internalPlugins.plugins[pluginId]) { - this.app.internalPlugins.plugins[pluginId].disable(true); - new import_obsidian7.Notice(`Disabled ${pluginId}`); - } - } - } - handleFrontmatterKey(parameters) { - var _a; - const key = parameters.frontmatterkey; - const file = this.app.vault.getAbstractFileByPath( - (_a = parameters.filepath) != null ? _a : this.app.workspace.getActiveFile().path - ); - if (!(file instanceof import_obsidian7.TFile)) { - return; - } - const frontmatter = this.app.metadataCache.getFileCache(file).frontmatter; - if (parameters.data) { - let data = parameters.data; - try { - data = JSON.parse(data); - } catch (e) { - data = `"${data}"`; - data = JSON.parse(data); - } - this.app.fileManager.processFrontMatter(file, (frontmatter2) => { - if (key.startsWith("[") && key.endsWith("]")) { - const list = key.substring(1, key.length - 1).split(","); - let cache = frontmatter2; - for (let i = 0; i < list.length; i++) { - const item = list[i]; - if (cache instanceof Array) { - const index = parseInt(item); - if (Number.isNaN(index)) { - cache = cache.find((e) => e == item); - } - if (i == list.length - 1) { - cache[parseInt(item)] = data; - } else { - cache = cache[parseInt(item)]; - } - } else { - if (i == list.length - 1) { - cache[item] = data; - } else { - cache = cache[item]; - } - } - } - } else { - frontmatter2[key] = data; - } - }); - } else { - let res; - if (key.startsWith("[") && key.endsWith("]")) { - const list = key.substring(1, key.length - 1).split(","); - let cache = frontmatter; - for (const item of list) { - if (cache instanceof Array) { - const index = parseInt(item); - if (Number.isNaN(index)) { - cache = cache.find((e) => e == item); - } - cache = cache[parseInt(item)]; - } else { - cache = cache[item]; - } - } - res = cache; - } else { - res = frontmatter[key]; - } - copyText(res); - } - } - handleWorkspace(parameters) { - const workspaces = this.app.internalPlugins.getEnabledPluginById("workspaces"); - if (!workspaces) { - new import_obsidian7.Notice("Workspaces plugin is not enabled"); - this.plugin.failure(parameters); - } else { - if (parameters.saveworkspace == "true") { - const active = workspaces.activeWorkspace; - workspaces.saveWorkspace(active); - new import_obsidian7.Notice(`Saved current workspace to ${active}`); - } - if (parameters.workspace != void 0) { - workspaces.loadWorkspace(parameters.workspace); - } - this.plugin.success(parameters); - } - } - async handleCommand(parameters) { - if (parameters.filepath) { - if (parameters.mode) { - if (parameters.mode == "new") { - const file = this.app.metadataCache.getFirstLinkpathDest( - parameters.filepath, - "/" - ); - if (file instanceof import_obsidian7.TFile) { - parameters.filepath = getAlternativeFilePath( - this.app, - file - ); - } - } - await this.plugin.open({ - file: parameters.filepath, - mode: "source", - parameters - }); - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView); - if (view) { - const editor = view.editor; - const data = editor.getValue(); - if (parameters.mode === "append") { - editor.setValue(data + "\n"); - const lines = editor.lineCount(); - editor.setCursor({ ch: 0, line: lines }); - } else if (parameters.mode === "prepend") { - editor.setValue("\n" + data); - editor.setCursor({ ch: 0, line: 0 }); - } else if (parameters.mode === "overwrite") { - editor.setValue(""); - } - } - } else if (parameters.line != void 0 || parameters.column != void 0) { - await this.plugin.open({ - file: parameters.filepath, - mode: "source", - parameters - }); - await this.plugin.setCursorInLine(parameters); - } else { - await this.plugin.open({ - file: parameters.filepath, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - } - } - if (parameters.commandid) { - this.app.commands.executeCommandById(parameters.commandid); - } else if (parameters.commandname) { - const rawCommands = this.app.commands.commands; - for (const command in rawCommands) { - if (rawCommands[command].name === parameters.commandname) { - if (rawCommands[command].callback) { - rawCommands[command].callback(); - } else { - rawCommands[command].checkCallback(false); - } - break; - } - } - } - this.plugin.success(parameters); - } - async handleEval(parameters) { - if (parameters.filepath) { - if (parameters.mode) { - if (parameters.mode == "new") { - const file = this.app.metadataCache.getFirstLinkpathDest( - parameters.filepath, - "/" - ); - if (file instanceof import_obsidian7.TFile) { - parameters.filepath = getAlternativeFilePath( - this.app, - file - ); - } - } - await this.plugin.open({ - file: parameters.filepath, - mode: "source", - parameters - }); - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView); - if (view) { - const editor = view.editor; - const data = editor.getValue(); - if (parameters.mode === "append") { - editor.setValue(data + "\n"); - const lines = editor.lineCount(); - editor.setCursor({ ch: 0, line: lines }); - } else if (parameters.mode === "prepend") { - editor.setValue("\n" + data); - editor.setCursor({ ch: 0, line: 0 }); - } else if (parameters.mode === "overwrite") { - editor.setValue(""); - } - } - } else if (parameters.line != void 0 || parameters.column != void 0) { - await this.plugin.open({ - file: parameters.filepath, - mode: "source", - parameters - }); - await this.plugin.setCursorInLine(parameters); - } else { - await this.plugin.open({ - file: parameters.filepath, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - } - } - if (this.plugin.settings.allowEval) { - const eval2 = eval; - eval2(parameters.eval); - this.plugin.success(parameters); - } else { - new import_obsidian7.Notice( - "Eval is not allowed. Please enable it in the settings." - ); - this.plugin.failure(parameters); - } - } - async handleDoesFileExist(parameters) { - const exists = await this.app.vault.adapter.exists(parameters.filepath); - copyText((exists ? 1 : 0).toString()); - this.plugin.success(parameters); - } - async handleSearchAndReplace(parameters) { - let file; - if (parameters.filepath) { - const abstractFile = this.app.vault.getAbstractFileByPath( - parameters.filepath - ); - if (abstractFile instanceof import_obsidian7.TFile) { - file = abstractFile; - } - } else { - file = this.app.workspace.getActiveFile(); - } - if (file) { - let data = await this.app.vault.read(file); - if (parameters.searchregex) { - try { - const [, , pattern, flags] = parameters.searchregex.match(/(\/?)(.+)\1([a-z]*)/i); - const regex = new RegExp(pattern, flags); - data = data.replace(regex, parameters.replace); - this.plugin.success(parameters); - } catch (error) { - new import_obsidian7.Notice( - `Can't parse ${parameters.searchregex} as RegEx` - ); - this.plugin.failure(parameters); - } - } else { - data = data.replaceAll(parameters.search, parameters.replace); - this.plugin.success(parameters); - } - await this.plugin.writeAndOpenFile(file.path, data, parameters); - } else { - new import_obsidian7.Notice("Cannot find file"); - this.plugin.failure(parameters); - } - } - async handleSearch(parameters) { - if (parameters.filepath) { - await this.plugin.open({ - file: parameters.filepath, - parameters - }); - } - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.FileView); - view.currentMode.showSearch(); - const search = view.currentMode.search; - search.searchInputEl.value = parameters.search; - search.searchInputEl.dispatchEvent(new Event("input")); - } - async handleWrite(parameters, createdDailyNote = false) { - var _a; - let file; - if (parameters.filepath) { - file = this.app.vault.getAbstractFileByPath(parameters.filepath); - } else { - file = this.app.workspace.getActiveFile(); - } - if (parameters.filepath || file) { - let outFile; - let path = (_a = parameters.filepath) != null ? _a : file.path; - if (parameters.mode === "overwrite") { - outFile = await this.plugin.writeAndOpenFile( - path, - parameters.data, - parameters - ); - this.plugin.success(parameters); - } else if (parameters.mode === "prepend") { - if (file instanceof import_obsidian7.TFile) { - outFile = await this.plugin.prepend(file, parameters); - } else { - outFile = await this.plugin.prepend(path, parameters); - } - this.plugin.success(parameters); - } else if (parameters.mode === "append") { - if (file instanceof import_obsidian7.TFile) { - outFile = await this.plugin.append(file, parameters); - } else { - outFile = await this.plugin.append(path, parameters); - } - this.plugin.success(parameters); - } else if (parameters.mode === "new") { - if (file instanceof import_obsidian7.TFile) { - outFile = await this.plugin.writeAndOpenFile( - getAlternativeFilePath(this.app, file), - parameters.data, - parameters - ); - this.plugin.hookSuccess(parameters, outFile); - } else { - outFile = await this.plugin.writeAndOpenFile( - path, - parameters.data, - parameters - ); - this.plugin.hookSuccess(parameters, outFile); - } - } else if (!createdDailyNote && file instanceof import_obsidian7.TFile) { - new import_obsidian7.Notice("File already exists"); - this.plugin.openExistingFileAndSetCursor(file.path, parameters); - this.plugin.failure(parameters); - } else { - outFile = await this.plugin.writeAndOpenFile( - path, - parameters.data, - parameters - ); - this.plugin.success(parameters); - } - if (parameters.uid) { - this.tools.writeUIDToFile(outFile, parameters.uid); - } - } else { - new import_obsidian7.Notice("Cannot find file"); - this.plugin.failure(parameters); - } - } - async handleOpen(parameters) { - if (parameters.heading != void 0) { - await this.plugin.open({ - file: parameters.filepath + "#" + parameters.heading, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView); - if (!view) - return; - const cache = this.app.metadataCache.getFileCache(view.file); - const heading = cache.headings.find( - (e) => e.heading === parameters.heading - ); - view.editor.focus(); - view.editor.setCursor({ - line: heading.position.start.line + 1, - ch: 0 - }); - } else if (parameters.block != void 0) { - await this.plugin.open({ - file: parameters.filepath + "#^" + parameters.block, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView); - if (!view) - return; - const cache = this.app.metadataCache.getFileCache(view.file); - const block = cache.blocks[parameters.block]; - view.editor.focus(); - view.editor.setCursor({ line: block.position.start.line, ch: 0 }); - } else { - await this.plugin.open({ - file: parameters.filepath, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - if (parameters.line != void 0 || parameters.column != void 0) { - await this.plugin.setCursorInLine(parameters); - } - } - if (parameters.mode != void 0) { - await this.plugin.setCursor(parameters); - } - if (parameters.uid) { - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView); - this.tools.writeUIDToFile(view.file, parameters.uid); - } - this.plugin.success(parameters); - } - async handleOpenBlock(parameters) { - const file = this.tools.getFileFromBlockID(parameters.block); - if (file) { - await this.plugin.chooseHandler( - { - ...parameters, - filepath: file.path - }, - false - ); - } - } - handleCopyFileURI(withoutData, file) { - const view = this.app.workspace.getActiveViewOfType(import_obsidian7.FileView); - if (!view && !file) - return; - if (view instanceof import_obsidian7.MarkdownView) { - const pos = view.editor.getCursor(); - const cache = this.app.metadataCache.getFileCache(view.file); - if (cache.headings) { - for (const heading of cache.headings) { - if (heading.position.start.line <= pos.line && heading.position.end.line >= pos.line) { - this.tools.copyURI({ - filepath: view.file.path, - heading: heading.heading - }); - return; - } - } - } - if (cache.blocks) { - for (const blockID of Object.keys(cache.blocks)) { - const block = cache.blocks[blockID]; - if (block.position.start.line <= pos.line && block.position.end.line >= pos.line) { - this.tools.copyURI({ - filepath: view.file.path, - block: blockID - }); - return; - } - } - } - } - if (withoutData) { - const file2 = file != null ? file : this.app.workspace.getActiveFile(); - if (!file2) { - new import_obsidian7.Notice("No file opened"); - return; - } - this.tools.copyURI({ - filepath: file2.path - }); - } else { - const fileModal = new FileModal( - this.plugin, - "Choose a file", - false - ); - fileModal.open(); - fileModal.onChooseItem = (item, _) => { - new EnterDataModal(this.plugin, item.source).open(); - }; - } - } - handleOpenSettings(parameters) { - if (this.app.setting.containerEl.parentElement === null) { - this.app.setting.open(); - } - if (parameters.settingid == "plugin-browser") { - this.app.setting.openTabById("community-plugins"); - this.app.setting.activeTab.containerEl.find(".mod-cta").click(); - } else if (parameters.settingid == "theme-browser") { - this.app.setting.openTabById("appearance"); - this.app.setting.activeTab.containerEl.find(".mod-cta").click(); - } else { - this.app.setting.openTabById(parameters.settingid); - } - if (parameters.settingsection) { - const elements = this.app.setting.tabContentContainer.querySelectorAll("*"); - const heading = Array.prototype.find.call( - elements, - (e) => e.textContent == parameters.settingsection - ); - if (heading) { - heading.scrollIntoView(); - } - } - this.plugin.success(parameters); - } - async handleUpdatePlugins(parameters) { - new import_obsidian7.Notice("Checking for updates\u2026"); - await this.app.plugins.checkForUpdates(); - const updateCount = Object.keys(this.app.plugins.updates).length; - if (updateCount > 0) { - parameters.settingid = "community-plugins"; - this.handleOpenSettings(parameters); - this.app.setting.activeTab.containerEl.findAll(".mod-cta").last().click(); - } - this.plugin.success(parameters); - } - async handleBookmarks(parameters) { - const bookmarksPlugin = this.app.internalPlugins.getEnabledPluginById("bookmarks"); - const bookmarks = bookmarksPlugin.getBookmarks(); - const bookmark = bookmarks.find((b) => b.title == parameters.bookmark); - let openMode; - if (parameters.openmode == "true" || parameters.openmode == "false") { - openMode = parameters.openmode == "true"; - } else { - openMode = parameters.openmode; - } - bookmarksPlugin.openBookmark(bookmark, openMode); - } - async handleCanvas(parameters) { - if (parameters.filepath) { - await this.plugin.open({ - file: parameters.filepath, - setting: this.plugin.settings.openFileWithoutWriteInNewPane, - parameters - }); - } - const activeView = this.app.workspace.activeLeaf.view; - if (activeView.getViewType() != "canvas") { - new import_obsidian7.Notice("Active view is not a canvas"); - return; - } - const canvasView = activeView; - if (parameters.canvasnodes) { - const ids = parameters.canvasnodes.split(","); - const nodes = canvasView.canvas.nodes; - const selectedNodes = ids.map((id) => nodes.get(id)); - const selection = canvasView.canvas.selection; - canvasView.canvas.updateSelection(() => { - for (const node of selectedNodes) { - selection.add(node); - } - }); - canvasView.canvas.zoomToSelection(); - } - if (parameters.canvasviewport) { - const [x, y, zoom] = parameters.canvasviewport.split(","); - if (x != "-") { - if (x.startsWith("--") || x.startsWith("++")) { - const tx = canvasView.canvas.tx + Number(x.substring(1)); - canvasView.canvas.tx = tx; - } else { - canvasView.canvas.tx = Number(x); - } - } - if (y != "-") { - if (y.startsWith("--") || y.startsWith("++")) { - const ty = canvasView.canvas.ty + Number(y.substring(1)); - canvasView.canvas.ty = ty; - } else { - canvasView.canvas.ty = Number(y); - } - } - if (zoom != "-") { - if (zoom.startsWith("--") || zoom.startsWith("++")) { - const tZoom = canvasView.canvas.tZoom + Number(zoom.substring(1)); - canvasView.canvas.tZoom = tZoom; - } else { - canvasView.canvas.tZoom = Number(zoom); - } - } - canvasView.canvas.markViewportChanged(); - } - } -}; - -// src/modals/command_modal.ts -var import_obsidian8 = require("obsidian"); -var CommandModal = class extends import_obsidian8.FuzzySuggestModal { - constructor(plugin, file) { - super(plugin.app); - this.plugin = plugin; - this.file = file; - } - getItems() { - const rawCommands = this.app.commands.commands; - const commands = Object.keys(rawCommands).map((e) => { - return { id: rawCommands[e].id, name: rawCommands[e].name }; - }); - return commands; - } - getItemText(item) { - return item.name; - } - onChooseItem(item, _) { - this.plugin.tools.copyURI({ - filepath: this.file, - commandid: item.id - }); - } -}; - -// src/modals/replace_modal.ts -var import_obsidian9 = require("obsidian"); -var ReplaceModal = class extends import_obsidian9.SuggestModal { - constructor(plugin, search, filepath) { - super(plugin.app); - this.search = search; - this.filepath = filepath; - this.emptyText = "Empty text (replace with nothing)"; - this.plugin = plugin; - this.setPlaceholder("Replacement text"); - } - getSuggestions(query) { - if (query === "") { - query = this.emptyText; - } - return [query]; - } - renderSuggestion(value, el) { - el.innerText = value; - } - onChooseSuggestion(item, _) { - if (this.search.isRegEx) { - this.plugin.tools.copyURI({ - filepath: this.filepath, - searchregex: this.search.source, - replace: item == this.emptyText ? "" : item - }); - } else { - this.plugin.tools.copyURI({ - filepath: this.filepath, - search: this.search.source, - replace: item == this.emptyText ? "" : item - }); - } - } -}; - -// src/modals/search_modal.ts -var import_obsidian10 = require("obsidian"); -var SearchModal = class extends import_obsidian10.SuggestModal { - constructor(plugin) { - super(plugin.app); - this.plugin = plugin; - this.setPlaceholder("Searched text. RegEx is supported"); - } - getSuggestions(query) { - if (query === "") { - query = "..."; - } - let regex; - try { - regex = new RegExp(query); - } catch (error) { - } - return [ - { - source: query, - isRegEx: false, - display: query - }, - { - source: query, - display: regex ? `As RegEx: ${query}` : `Can't parse RegEx`, - isRegEx: true - } - ]; - } - renderSuggestion(value, el) { - el.innerText = value.display; - } - onChooseSuggestion(item, _) { - } -}; - -// src/settings.ts -var import_obsidian11 = require("obsidian"); -var SettingsTab = class extends import_obsidian11.PluginSettingTab { - constructor(app2, plugin) { - super(app2, plugin); - this.plugin = plugin; - } - display() { - let { containerEl } = this; - containerEl.empty(); - containerEl.createEl("h2", { text: this.plugin.manifest.name }); - new import_obsidian11.Setting(containerEl).setName("Open file on write").addToggle( - (cb) => cb.setValue(this.plugin.settings.openFileOnWrite).onChange((value) => { - this.plugin.settings.openFileOnWrite = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Open file on write in a new pane").setDisabled(this.plugin.settings.openFileOnWrite).addToggle( - (cb) => cb.setValue(this.plugin.settings.openFileOnWriteInNewPane).onChange((value) => { - this.plugin.settings.openFileOnWriteInNewPane = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Open daily note in a new pane").addToggle( - (cb) => cb.setValue(this.plugin.settings.openDailyInNewPane).onChange((value) => { - this.plugin.settings.openDailyInNewPane = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Open file without write in new pane").addToggle( - (cb) => cb.setValue( - this.plugin.settings.openFileWithoutWriteInNewPane - ).onChange((value) => { - this.plugin.settings.openFileWithoutWriteInNewPane = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Use UID instead of file paths").addToggle( - (cb) => cb.setValue(this.plugin.settings.useUID).onChange((value) => { - this.plugin.settings.useUID = value; - this.plugin.saveSettings(); - this.display(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Include vault name/ID parameter").addToggle( - (cb) => cb.setValue(this.plugin.settings.includeVaultName).onChange((value) => { - this.plugin.settings.includeVaultName = value; - this.plugin.saveSettings(); - this.display(); - }) - ); - if (this.plugin.settings.includeVaultName) { - new import_obsidian11.Setting(containerEl).setName("Vault identifying parameter").setDesc( - "Choose whether to use the vault Name or its internal ID as the identifying parameter." - ).addDropdown( - (cb) => cb.addOption("name", "Name").addOption("id", "ID").setValue(this.plugin.settings.vaultParam).onChange((value) => { - this.plugin.settings.vaultParam = value; - this.plugin.saveSettings(); - }) - ); - } - if (this.plugin.settings.useUID) { - new import_obsidian11.Setting(containerEl).setName("Add filepath parameter").setDesc( - "When using UID instead of file paths, you can still add the filepath parameter to know what this URI is about. It's NOT actually used." - ).addToggle( - (cb) => cb.setValue(this.plugin.settings.addFilepathWhenUsingUID).onChange((value) => { - this.plugin.settings.addFilepathWhenUsingUID = value; - this.plugin.saveSettings(); - }) - ); - } - new import_obsidian11.Setting(containerEl).setName("UID field in frontmatter").addText( - (cb) => cb.setValue(this.plugin.settings.idField).onChange((value) => { - this.plugin.settings.idField = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Allow executing arbitrary code via eval").setDesc( - "\u26A0\uFE0F This can be dangerous as it allows executing arbitrary code. Only enable this if you trust the source of the URIs you are using and know what you are doing. \u26A0\uFE0F" - ).addToggle( - (cb) => cb.setValue(this.plugin.settings.allowEval).onChange((value) => { - this.plugin.settings.allowEval = value; - this.plugin.saveSettings(); - }) - ); - new import_obsidian11.Setting(containerEl).setName("Donate").setDesc( - "If you like this Plugin, consider donating to support continued development." - ).addButton((bt) => { - bt.buttonEl.outerHTML = "Buy Me a Coffee at ko-fi.com"; - }); - } -}; - -// src/tools.ts -var import_obsidian12 = require("obsidian"); - -// node_modules/uuid/dist/esm-browser/rng.js -var getRandomValues; -var rnds8 = new Uint8Array(16); -function rng() { - if (!getRandomValues) { - getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto); - if (!getRandomValues) { - throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); - } - } - return getRandomValues(rnds8); -} - -// node_modules/uuid/dist/esm-browser/regex.js -var regex_default = /^(?:[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; - -// node_modules/uuid/dist/esm-browser/validate.js -function validate(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default = validate; - -// node_modules/uuid/dist/esm-browser/stringify.js -var byteToHex = []; -for (i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).substr(1)); -} -var i; -function stringify(arr) { - var offset = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; - var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); - if (!validate_default(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var stringify_default = stringify; - -// node_modules/uuid/dist/esm-browser/v4.js -function v4(options, buf, offset) { - options = options || {}; - var rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return stringify_default(rnds); -} -var v4_default = v4; - -// src/tools.ts -var Tools = class { - constructor(plugin) { - this.plugin = plugin; - this.app = this.plugin.app; - } - get settings() { - return this.plugin.settings; - } - async writeUIDToFile(file, uid) { - var _a; - const frontmatter = (_a = this.app.metadataCache.getFileCache(file)) == null ? void 0 : _a.frontmatter; - const fileContent = await this.app.vault.read(file); - const isYamlEmpty = (!frontmatter || frontmatter.length === 0) && !fileContent.match(/^-{3}\s*\n*\r*-{3}/); - let splitContent = fileContent.split("\n"); - const key = `${this.plugin.settings.idField}:`; - if (isYamlEmpty) { - splitContent.unshift("---"); - splitContent.unshift(`${key} ${uid}`); - splitContent.unshift("---"); - } else { - const lineIndexOfKey = splitContent.findIndex( - (line) => line.startsWith(key) - ); - if (lineIndexOfKey != -1) { - splitContent[lineIndexOfKey] = `${key} ${uid}`; - } else { - splitContent.splice(1, 0, `${key} ${uid}`); - } - } - const newFileContent = splitContent.join("\n"); - await this.app.vault.modify(file, newFileContent); - return uid; - } - async getUIDFromFile(file) { - var _a; - const cache = (_a = this.app.metadataCache.getFileCache(file)) != null ? _a : await new Promise((resolve) => { - const ref = this.app.metadataCache.on("changed", (metaFile) => { - if (metaFile.path == file.path) { - const cache2 = this.app.metadataCache.getFileCache(file); - this.app.metadataCache.offref(ref); - resolve(cache2); - } - }); - }); - const uid = (0, import_obsidian12.parseFrontMatterEntry)( - cache.frontmatter, - this.plugin.settings.idField - ); - if (uid != void 0) { - if (uid instanceof Array) { - return uid[0]; - } else { - return uid; - } - } - return await this.writeUIDToFile(file, v4_default()); - } - async generateURI(parameters, doubleEncode) { - const prefix = "obsidian://advanced-uri"; - let suffix = ""; - const file = this.app.vault.getAbstractFileByPath(parameters.filepath); - if (this.settings.includeVaultName) { - suffix += "?vault="; - if (this.settings.vaultParam == "id" && this.app.appId) { - suffix += this.app.appId; - } else { - suffix += this.app.vault.getName(); - } - } - if (this.settings.useUID && file instanceof import_obsidian12.TFile && file.extension == "md") { - if (!this.settings.addFilepathWhenUsingUID) - parameters.filepath = void 0; - parameters.uid = await this.getUIDFromFile(file); - } - const sortedParameterKeys = Object.keys(parameters).filter((key) => parameters[key]).sort((a, b) => { - const first = ["filepath", "filename", "uid", "daily"]; - const last = ["data", "eval"]; - if (first.includes(a)) - return -1; - if (first.includes(b)) - return 1; - if (last.includes(a)) - return 1; - if (last.includes(b)) - return -1; - return 0; - }); - for (const parameter of sortedParameterKeys) { - if (parameters[parameter] != void 0) { - suffix += suffix ? "&" : "?"; - suffix += `${parameter}=${encodeURIComponent( - parameters[parameter] - )}`; - } - } - if (doubleEncode) { - return prefix + encodeURI(suffix); - } else { - return prefix + suffix; - } - } - async copyURI(parameters) { - const uri = await this.generateURI(parameters, true); - await copyText(uri); - new import_obsidian12.Notice("Advanced URI copied to your clipboard"); - } - getFileFromUID(uid) { - var _a; - const files = this.app.vault.getMarkdownFiles(); - const idKey = this.settings.idField; - for (const file of files) { - const fieldValue = (0, import_obsidian12.parseFrontMatterEntry)( - (_a = this.app.metadataCache.getFileCache(file)) == null ? void 0 : _a.frontmatter, - idKey - ); - if (fieldValue instanceof Array) { - if (fieldValue.contains(uid)) - return file; - } else { - if (fieldValue == uid) - return file; - } - } - } - getFileFromBlockID(blockId) { - var _a, _b; - const files = this.app.vault.getMarkdownFiles(); - for (const file of files) { - const blockExists = ((_b = (_a = this.app.metadataCache.getFileCache(file)) == null ? void 0 : _a.blocks) == null ? void 0 : _b[blockId]) != void 0; - if (blockExists) - return file; - } - } -}; - -// src/modals/workspace_modal.ts -var import_obsidian13 = require("obsidian"); -var WorkspaceModal = class extends import_obsidian13.FuzzySuggestModal { - constructor(plugin) { - super(plugin.app); - this.plugin = plugin; - this.setPlaceholder("Choose a workspace"); - } - getItems() { - const workspacesPlugin = this.app.internalPlugins.getEnabledPluginById("workspaces"); - if (!workspacesPlugin) { - new import_obsidian13.Notice("Workspaces plugin is not enabled"); - } else { - return Object.keys(workspacesPlugin.workspaces); - } - } - getItemText(item) { - return item; - } - onChooseItem(item, _) { - this.plugin.tools.copyURI({ workspace: item }); - } -}; - -// src/main.ts -var AdvancedURI = class extends import_obsidian14.Plugin { - constructor() { - super(...arguments); - this.handlers = new Handlers(this); - this.tools = new Tools(this); - } - async onload() { - await this.loadSettings(); - this.addSettingTab(new SettingsTab(this.app, this)); - this.addCommand({ - id: "copy-uri-current-file", - name: "Copy URI for file with options", - callback: () => this.handlers.handleCopyFileURI(false) - }); - this.addCommand({ - id: "copy-uri-current-file-simple", - name: "Copy URI for current file", - callback: () => this.handlers.handleCopyFileURI(true) - }); - this.addCommand({ - id: "copy-uri-daily", - name: "Copy URI for daily note", - callback: () => new EnterDataModal(this).open() - }); - this.addCommand({ - id: "copy-uri-search-and-replace", - name: "Copy URI for search and replace", - callback: () => { - const fileModal = new FileModal( - this, - "Used file for search and replace" - ); - fileModal.open(); - fileModal.onChooseItem = (filePath) => { - const searchModal = new SearchModal(this); - searchModal.open(); - searchModal.onChooseSuggestion = (item) => { - new ReplaceModal(this, item, filePath == null ? void 0 : filePath.source).open(); - }; - }; - } - }); - this.addCommand({ - id: "copy-uri-command", - name: "Copy URI for command", - callback: () => { - const fileModal = new FileModal( - this, - "Select a file to be opened before executing the command" - ); - fileModal.open(); - fileModal.onChooseItem = (item) => { - new CommandModal(this, item == null ? void 0 : item.source).open(); - }; - } - }); - this.addCommand({ - id: "copy-uri-block", - name: "Copy URI for current block", - checkCallback: (checking) => { - const view = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView); - if (checking) - return view != void 0; - const id = BlockUtils.getBlockId(this.app); - if (id) { - this.tools.copyURI({ - filepath: view.file.path, - block: id - }); - } - } - }); - this.addCommand({ - id: "copy-uri-workspace", - name: "Copy URI for workspace", - callback: () => { - const modal = new WorkspaceModal(this); - modal.open(); - } - }); - this.addCommand({ - id: "copy-uri-canvas-node", - name: "Copy URI for selected canvas nodes", - checkCallback: (checking) => { - const activeView = this.app.workspace.activeLeaf.view; - if (checking) { - return activeView.getViewType() === "canvas" && activeView.canvas.selection.size > 0; - } - if (activeView.getViewType() !== "canvas") - return false; - const canvasView = activeView; - let ids = []; - canvasView.canvas.selection.forEach((node) => { - ids.push(node.id); - }); - this.tools.copyURI({ - canvasnodes: ids.join(","), - filepath: activeView.file.path - }); - } - }); - this.addCommand({ - id: "copy-uri-canvas-viewport", - name: "Copy URI for current canvas viewport", - checkCallback: (checking) => { - const activeView = this.app.workspace.activeLeaf.view; - if (checking) { - return activeView.getViewType() === "canvas"; - } - if (activeView.getViewType() !== "canvas") - return false; - const canvasView = activeView; - const canvas = canvasView.canvas; - const tx = canvas.tx.toFixed(0), ty = canvas.ty.toFixed(0), tZoom = canvas.tZoom.toFixed(3); - this.tools.copyURI({ - filepath: activeView.file.path, - canvasviewport: `${tx},${ty},${tZoom}` - }); - } - }); - this.registerObsidianProtocolHandler("advanced-uri", async (e) => { - var _a, _b, _c; - const parameters = e; - let createdDailyNote = false; - for (const parameter in parameters) { - parameters[parameter] = decodeURIComponent( - parameters[parameter] - ); - } - this.lastParameters = { ...parameters }; - if (parameters.uid) { - const res = (_a = this.tools.getFileFromUID(parameters.uid)) == null ? void 0 : _a.path; - if (res != void 0) { - parameters.filepath = res; - parameters.uid = void 0; - } - } else if (parameters.filename) { - let file = this.app.metadataCache.getFirstLinkpathDest( - parameters.filename, - "" - ); - if (!file) { - file = this.app.vault.getMarkdownFiles().find( - (file2) => { - var _a2; - return (_a2 = (0, import_obsidian14.parseFrontMatterAliases)( - this.app.metadataCache.getFileCache(file2).frontmatter - )) == null ? void 0 : _a2.includes(parameters.filename); - } - ); - } - const parentFolder = this.app.fileManager.getNewFileParent( - (_b = this.app.workspace.getActiveFile()) == null ? void 0 : _b.path - ); - const parentFolderPath = parentFolder.isRoot() ? "" : parentFolder.path + "/"; - parameters.filepath = (_c = file == null ? void 0 : file.path) != null ? _c : parentFolderPath + (0, import_obsidian14.normalizePath)(parameters.filename); - } - if (parameters.filepath) { - parameters.filepath = (0, import_obsidian14.normalizePath)(parameters.filepath); - const index = parameters.filepath.lastIndexOf("."); - const extension = parameters.filepath.substring( - index < 0 ? parameters.filepath.length : index - ); - if (extension === "") { - parameters.filepath = parameters.filepath + ".md"; - } - } else if (parameters.daily === "true") { - if (!(0, import_obsidian_daily_notes_interface2.appHasDailyNotesPluginLoaded)()) { - new import_obsidian14.Notice("Daily notes plugin is not loaded"); - return; - } - const moment = window.moment(Date.now()); - const allDailyNotes = (0, import_obsidian_daily_notes_interface2.getAllDailyNotes)(); - let dailyNote = (0, import_obsidian_daily_notes_interface2.getDailyNote)(moment, allDailyNotes); - if (!dailyNote) { - if (parameters.exists === "true") { - parameters.filepath = await getDailyNotePath(moment); - } else { - dailyNote = await (0, import_obsidian_daily_notes_interface2.createDailyNote)(moment); - await new Promise((r) => setTimeout(r, 500)); - createdDailyNote = true; - } - } - if (dailyNote !== void 0) { - parameters.filepath = dailyNote.path; - } - } - if (parameters.clipboard === "true") { - parameters.data = await navigator.clipboard.readText(); - } - this.chooseHandler(parameters, createdDailyNote); - }); - this.registerObsidianProtocolHandler( - "hook-get-advanced-uri", - async (e) => { - const parameters = e; - for (const parameter in parameters) { - parameters[parameter] = decodeURIComponent( - parameters[parameter] - ); - } - const file = this.app.workspace.getActiveFile(); - if (file) { - this.hookSuccess(parameters, file); - } else { - this.failure(parameters, { - errorMessage: "No file opened" - }); - } - } - ); - this.registerEvent( - this.app.workspace.on("file-menu", (menu, file, source) => { - if (!(source === "more-options" || source === "tab-header" || source == "file-explorer-context-menu")) { - return; - } - if (!(file instanceof import_obsidian14.TFile)) { - return; - } - menu.addItem((item) => { - item.setTitle(`Copy Advanced URI`).setIcon("link").setSection("info").onClick( - (_) => this.handlers.handleCopyFileURI(true, file) - ); - }); - }) - ); - } - async chooseHandler(parameters, createdDailyNote) { - if (parameters["enable-plugin"] || parameters["disable-plugin"]) { - this.handlers.handlePluginManagement(parameters); - } else if (parameters.frontmatterkey) { - this.handlers.handleFrontmatterKey(parameters); - } else if (parameters.workspace || parameters.saveworkspace == "true") { - this.handlers.handleWorkspace(parameters); - } else if (parameters.commandname || parameters.commandid) { - this.handlers.handleCommand(parameters); - } else if (parameters.bookmark) { - this.handlers.handleBookmarks(parameters); - } else if (parameters.eval) { - this.handlers.handleEval(parameters); - } else if (parameters.filepath && parameters.exists === "true") { - this.handlers.handleDoesFileExist(parameters); - } else if (parameters.canvasnodes || parameters.canvasviewport) { - this.handlers.handleCanvas(parameters); - } else if (parameters.data) { - this.handlers.handleWrite(parameters, createdDailyNote); - } else if (parameters.filepath && parameters.heading) { - await this.handlers.handleOpen(parameters); - parameters.filepath = void 0; - parameters.heading = void 0; - this.chooseHandler(parameters, createdDailyNote); - } else if (parameters.filepath && parameters.block) { - await this.handlers.handleOpen(parameters); - parameters.filepath = void 0; - parameters.block = void 0; - this.chooseHandler(parameters, createdDailyNote); - } else if ((parameters.search || parameters.searchregex) && parameters.replace != void 0) { - this.handlers.handleSearchAndReplace(parameters); - } else if (parameters.search) { - this.handlers.handleSearch(parameters); - } else if (parameters.filepath) { - this.handlers.handleOpen(parameters); - } else if (parameters.block) { - this.handlers.handleOpenBlock(parameters); - } else if (parameters.settingid) { - this.handlers.handleOpenSettings(parameters); - } else if (parameters.updateplugins) { - this.handlers.handleUpdatePlugins(parameters); - } - } - async hookSuccess(parameters, file) { - if (!parameters["x-success"]) - return; - const options = { - title: stripMD(file.name), - advanceduri: await this.tools.generateURI( - { filepath: file.path }, - false - ), - urlkey: "advanceduri", - fileuri: getFileUri(this.app, file) - }; - this.success(parameters, options); - } - success(parameters, options) { - if (parameters["x-success"]) { - const url = new URL(parameters["x-success"]); - for (const param in options) { - url.searchParams.set(param, options[param]); - } - window.open(url.toString()); - } - } - failure(parameters, options) { - if (parameters["x-error"]) { - const url = new URL(parameters["x-error"]); - for (const param in options) { - url.searchParams.set(param, options[param]); - } - window.open(url.toString()); - } - } - async append(file, parameters) { - var _a; - let path; - let dataToWrite; - if (parameters.heading) { - if (file instanceof import_obsidian14.TFile) { - path = file.path; - const line = (_a = getEndAndBeginningOfHeading( - this.app, - file, - parameters.heading - )) == null ? void 0 : _a.lastLine; - if (line === void 0) - return; - const data = await this.app.vault.read(file); - const lines = data.split("\n"); - lines.splice(line, 0, ...parameters.data.split("\n")); - dataToWrite = lines.join("\n"); - } - } else { - if (file instanceof import_obsidian14.TFile) { - path = file.path; - const fileData = await this.app.vault.read(file); - if (parameters.line) { - let line = Math.max(Number(parameters.line), 0); - const lines = fileData.split("\n"); - lines.splice(line, 0, parameters.data); - dataToWrite = lines.join("\n"); - } else { - dataToWrite = fileData + "\n" + parameters.data; - } - } else { - path = file; - dataToWrite = parameters.data; - } - } - return this.writeAndOpenFile(path, dataToWrite, parameters); - } - async prepend(file, parameters) { - var _a; - let path; - let dataToWrite; - if (parameters.heading) { - if (file instanceof import_obsidian14.TFile) { - path = file.path; - const line = (_a = getEndAndBeginningOfHeading( - this.app, - file, - parameters.heading - )) == null ? void 0 : _a.firstLine; - if (line === void 0) - return; - const data = await this.app.vault.read(file); - const lines = data.split("\n"); - lines.splice(line, 0, ...parameters.data.split("\n")); - dataToWrite = lines.join("\n"); - } - } else { - if (file instanceof import_obsidian14.TFile) { - path = file.path; - const fileData = await this.app.vault.read(file); - const cache = this.app.metadataCache.getFileCache(file); - let line = 0; - if (parameters.line) { - line += Math.max(Number(parameters.line) - 1, 0); - } else if (cache.frontmatterPosition) { - line += cache.frontmatterPosition.end.line + 1; - } - const lines = fileData.split("\n"); - lines.splice(line, 0, parameters.data); - dataToWrite = lines.join("\n"); - } else { - path = file; - dataToWrite = parameters.data; - } - } - return this.writeAndOpenFile(path, dataToWrite, parameters); - } - async writeAndOpenFile(outputFileName, text, parameters) { - const file = this.app.vault.getAbstractFileByPath(outputFileName); - if (file instanceof import_obsidian14.TFile) { - await this.app.vault.modify(file, text); - } else { - const parts = outputFileName.split("/"); - const dir = parts.slice(0, parts.length - 1).join("/"); - if (parts.length > 1 && !(this.app.vault.getAbstractFileByPath(dir) instanceof import_obsidian14.TFolder)) { - await this.app.vault.createFolder(dir); - } - const base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; - if (base64regex.test(text)) { - await this.app.vault.createBinary( - outputFileName, - (0, import_obsidian14.base64ToArrayBuffer)(text) - ); - } else { - await this.app.vault.create(outputFileName, text); - } - } - this.openExistingFileAndSetCursor(outputFileName, parameters); - return this.app.vault.getAbstractFileByPath(outputFileName); - } - async openExistingFileAndSetCursor(file, parameters) { - if (parameters.openmode == "silent") - return; - if (this.settings.openFileOnWrite) { - await this.open({ - file, - setting: this.settings.openFileOnWriteInNewPane, - parameters - }); - if (parameters.line != void 0 || parameters.column != void 0) { - await this.setCursorInLine(parameters); - } - } - } - async open({ - file, - setting, - parameters, - supportPopover, - mode - }) { - if (parameters.openmode == "popover" && (supportPopover != null ? supportPopover : true)) { - const hoverEditor = this.app.plugins.plugins["obsidian-hover-editor"]; - if (!hoverEditor) { - new import_obsidian14.Notice( - "Cannot find Hover Editor plugin. Please file an issue." - ); - this.failure(parameters); - } - const leaf = hoverEditor.spawnPopover(void 0, () => { - this.app.workspace.setActiveLeaf(leaf, { focus: true }); - }); - let tFile; - if (file instanceof import_obsidian14.TFile) { - tFile = file; - } else { - tFile = this.app.vault.getAbstractFileByPath( - (0, import_obsidian14.getLinkpath)(file) - ); - } - await leaf.openFile(tFile); - } else { - let openMode = setting; - if (parameters.newpane !== void 0) { - openMode = parameters.newpane == "true"; - } - if (parameters.openmode !== void 0) { - if (parameters.openmode == "true" || parameters.openmode == "false") { - openMode = parameters.openmode == "true"; - } else if (parameters.openmode == "popover") { - openMode = false; - } else if (import_obsidian14.Platform.isMobile && parameters.openmode == "window") { - } else { - openMode = parameters.openmode; - } - } - if (openMode == "silent") { - return; - } - if (import_obsidian14.Platform.isMobileApp && openMode == "window") { - openMode = true; - } - let fileIsAlreadyOpened = false; - if (isBoolean(openMode)) { - this.app.workspace.iterateAllLeaves((leaf) => { - var _a; - if (((_a = leaf.view.file) == null ? void 0 : _a.path) === parameters.filepath) { - if (fileIsAlreadyOpened && leaf.width == 0) - return; - fileIsAlreadyOpened = true; - this.app.workspace.setActiveLeaf(leaf, { focus: true }); - } - }); - } - return this.app.workspace.openLinkText( - file instanceof import_obsidian14.TFile ? file.path : file, - "/", - fileIsAlreadyOpened ? false : openMode, - mode != void 0 ? { state: { mode } } : getViewStateFromMode(parameters) - ); - } - } - async setCursor(parameters) { - const view = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView); - if (!view) - return; - const mode = parameters.mode; - const editor = view.editor; - let viewState = view.leaf.getViewState(); - viewState.state.mode = "source"; - if (mode === "append") { - const lastLine = editor.lastLine(); - const lastLineLength = editor.getLine(lastLine).length; - await view.leaf.setViewState(viewState, { focus: true }); - editor.setCursor({ ch: lastLineLength, line: lastLine }); - } else if (mode === "prepend") { - await view.leaf.setViewState(viewState, { focus: true }); - editor.setCursor({ ch: 0, line: 0 }); - } - await new Promise((resolve) => setTimeout(resolve, 10)); - if (parameters.viewmode == "preview") { - viewState.state.mode = "preview"; - await view.leaf.setViewState(viewState); - } - } - async setCursorInLine(parameters) { - const view = this.app.workspace.getActiveViewOfType(import_obsidian14.MarkdownView); - if (!view) - return; - const viewState = view.leaf.getViewState(); - const rawLine = parameters.line != void 0 ? Number(parameters.line) : void 0; - const rawColumn = parameters.column ? Number(parameters.column) : void 0; - viewState.state.mode = "source"; - await view.leaf.setViewState(viewState); - const line = rawLine != void 0 ? Math.min(rawLine - 1, view.editor.lineCount() - 1) : view.editor.getCursor().line; - const maxColumn = view.editor.getLine(line).length - 1; - const column = Math.min(rawColumn - 1, maxColumn); - view.editor.focus(); - view.editor.setCursor({ - line, - ch: column != null ? column : maxColumn - }); - await new Promise((resolve) => setTimeout(resolve, 10)); - if (parameters.viewmode == "preview") { - viewState.state.mode = "preview"; - await view.leaf.setViewState(viewState); - } - } - async loadSettings() { - this.settings = Object.assign(DEFAULT_SETTINGS, await this.loadData()); - } - async saveSettings() { - await this.saveData(this.settings); - } -}; +var gt=Object.create;var ae=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var De=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports),jt=(o,n)=>{for(var e in n)ae(o,e,{get:n[e],enumerable:!0})},Ve=(o,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of xt(n))!wt.call(o,i)&&i!==e&&ae(o,i,{get:()=>n[i],enumerable:!(t=mt(n,i))||t.enumerable});return o};var xe=(o,n,e)=>(e=o!=null?gt(vt(o)):{},Ve(n||!o||!o.__esModule?ae(e,"default",{value:o,enumerable:!0}):e,o)),bt=o=>Ve(ae({},"__esModule",{value:!0}),o);var Le=De((Y,ve)=>{(function(n,e){typeof Y=="object"&&typeof ve=="object"?ve.exports=e():typeof define=="function"&&define.amd?define([],e):typeof Y=="object"?Y.feather=e():n.feather=e()})(typeof self!="undefined"?self:Y,function(){return function(o){var n={};function e(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return o[t].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=o,e.c=n,e.d=function(t,i,a){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:a})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=0)}({"./dist/icons.json":function(o){o.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(o,n,e){var t,i;(function(){"use strict";var a=function(){function l(){}l.prototype=Object.create(null);function r(f,y){for(var g=y.length,x=0;x1?arguments[1]:void 0,y=f!==void 0,g=0,x=s(h),b,M,A,P;if(y&&(f=t(f,m>2?arguments[2]:void 0,2)),x!=null&&!(u==Array&&l(x)))for(P=x.call(h),M=new u;!(A=P.next()).done;g++)c(M,g,y?a(P,f,[A.value,g],!0):A.value);else for(b=r(h.length),M=new u(b);b>g;g++)c(M,g,y?f(h[g],g):h[g]);return M.length=g,M}},"./node_modules/core-js/internals/array-includes.js":function(o,n,e){var t=e("./node_modules/core-js/internals/to-indexed-object.js"),i=e("./node_modules/core-js/internals/to-length.js"),a=e("./node_modules/core-js/internals/to-absolute-index.js");o.exports=function(l){return function(r,c,s){var d=t(r),p=i(d.length),h=a(s,p),u;if(l&&c!=c){for(;p>h;)if(u=d[h++],u!=u)return!0}else for(;p>h;h++)if((l||h in d)&&d[h]===c)return l||h||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(o,n,e){var t=e("./node_modules/core-js/internals/a-function.js");o.exports=function(i,a,l){if(t(i),a===void 0)return i;switch(l){case 0:return function(){return i.call(a)};case 1:return function(r){return i.call(a,r)};case 2:return function(r,c){return i.call(a,r,c)};case 3:return function(r,c,s){return i.call(a,r,c,s)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(o,n,e){var t=e("./node_modules/core-js/internals/an-object.js");o.exports=function(i,a,l,r){try{return r?a(t(l)[0],l[1]):a(l)}catch(s){var c=i.return;throw c!==void 0&&t(c.call(i)),s}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(o,n,e){var t=e("./node_modules/core-js/internals/well-known-symbol.js"),i=t("iterator"),a=!1;try{var l=0,r={next:function(){return{done:!!l++}},return:function(){a=!0}};r[i]=function(){return this},Array.from(r,function(){throw 2})}catch(c){}o.exports=function(c,s){if(!s&&!a)return!1;var d=!1;try{var p={};p[i]=function(){return{next:function(){return{done:d=!0}}}},c(p)}catch(h){}return d}},"./node_modules/core-js/internals/classof-raw.js":function(o,n){var e={}.toString;o.exports=function(t){return e.call(t).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(o,n,e){var t=e("./node_modules/core-js/internals/classof-raw.js"),i=e("./node_modules/core-js/internals/well-known-symbol.js"),a=i("toStringTag"),l=t(function(){return arguments}())=="Arguments",r=function(c,s){try{return c[s]}catch(d){}};o.exports=function(c){var s,d,p;return c===void 0?"Undefined":c===null?"Null":typeof(d=r(s=Object(c),a))=="string"?d:l?t(s):(p=t(s))=="Object"&&typeof s.callee=="function"?"Arguments":p}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(o,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/own-keys.js"),a=e("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),l=e("./node_modules/core-js/internals/object-define-property.js");o.exports=function(r,c){for(var s=i(c),d=l.f,p=a.f,h=0;h",b="java"+g+":",M;for(m.style.display="none",r.appendChild(m),m.src=String(b),M=m.contentWindow.document,M.open(),M.write(y+g+x+"document.F=Object"+y+"/"+g+x),M.close(),u=M.F;f--;)delete u[p][a[f]];return u()};o.exports=Object.create||function(f,y){var g;return f!==null?(h[p]=t(f),g=new h,h[p]=null,g[d]=f):g=u(),y===void 0?g:i(g,y)},l[d]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(o,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/object-define-property.js"),a=e("./node_modules/core-js/internals/an-object.js"),l=e("./node_modules/core-js/internals/object-keys.js");o.exports=t?Object.defineProperties:function(c,s){a(c);for(var d=l(s),p=d.length,h=0,u;p>h;)i.f(c,u=d[h++],s[u]);return c}},"./node_modules/core-js/internals/object-define-property.js":function(o,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/ie8-dom-define.js"),a=e("./node_modules/core-js/internals/an-object.js"),l=e("./node_modules/core-js/internals/to-primitive.js"),r=Object.defineProperty;n.f=t?r:function(s,d,p){if(a(s),d=l(d,!0),a(p),i)try{return r(s,d,p)}catch(h){}if("get"in p||"set"in p)throw TypeError("Accessors not supported");return"value"in p&&(s[d]=p.value),s}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(o,n,e){var t=e("./node_modules/core-js/internals/descriptors.js"),i=e("./node_modules/core-js/internals/object-property-is-enumerable.js"),a=e("./node_modules/core-js/internals/create-property-descriptor.js"),l=e("./node_modules/core-js/internals/to-indexed-object.js"),r=e("./node_modules/core-js/internals/to-primitive.js"),c=e("./node_modules/core-js/internals/has.js"),s=e("./node_modules/core-js/internals/ie8-dom-define.js"),d=Object.getOwnPropertyDescriptor;n.f=t?d:function(h,u){if(h=l(h),u=r(u,!0),s)try{return d(h,u)}catch(m){}if(c(h,u))return a(!i.f.call(h,u),h[u])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(o,n,e){var t=e("./node_modules/core-js/internals/object-keys-internal.js"),i=e("./node_modules/core-js/internals/enum-bug-keys.js"),a=i.concat("length","prototype");n.f=Object.getOwnPropertyNames||function(r){return t(r,a)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(o,n){n.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(o,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/to-object.js"),a=e("./node_modules/core-js/internals/shared-key.js"),l=e("./node_modules/core-js/internals/correct-prototype-getter.js"),r=a("IE_PROTO"),c=Object.prototype;o.exports=l?Object.getPrototypeOf:function(s){return s=i(s),t(s,r)?s[r]:typeof s.constructor=="function"&&s instanceof s.constructor?s.constructor.prototype:s instanceof Object?c:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(o,n,e){var t=e("./node_modules/core-js/internals/has.js"),i=e("./node_modules/core-js/internals/to-indexed-object.js"),a=e("./node_modules/core-js/internals/array-includes.js"),l=e("./node_modules/core-js/internals/hidden-keys.js"),r=a(!1);o.exports=function(c,s){var d=i(c),p=0,h=[],u;for(u in d)!t(l,u)&&t(d,u)&&h.push(u);for(;s.length>p;)t(d,u=s[p++])&&(~r(h,u)||h.push(u));return h}},"./node_modules/core-js/internals/object-keys.js":function(o,n,e){var t=e("./node_modules/core-js/internals/object-keys-internal.js"),i=e("./node_modules/core-js/internals/enum-bug-keys.js");o.exports=Object.keys||function(l){return t(l,i)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(o,n,e){"use strict";var t={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!t.call({1:2},1);n.f=a?function(r){var c=i(this,r);return!!c&&c.enumerable}:t},"./node_modules/core-js/internals/object-set-prototype-of.js":function(o,n,e){var t=e("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");o.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,a={},l;try{l=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,l.call(a,[]),i=a instanceof Array}catch(r){}return function(c,s){return t(c,s),i?l.call(c,s):c.__proto__=s,c}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(o,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/object-get-own-property-names.js"),a=e("./node_modules/core-js/internals/object-get-own-property-symbols.js"),l=e("./node_modules/core-js/internals/an-object.js"),r=t.Reflect;o.exports=r&&r.ownKeys||function(s){var d=i.f(l(s)),p=a.f;return p?d.concat(p(s)):d}},"./node_modules/core-js/internals/path.js":function(o,n,e){o.exports=e("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(o,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/shared.js"),a=e("./node_modules/core-js/internals/hide.js"),l=e("./node_modules/core-js/internals/has.js"),r=e("./node_modules/core-js/internals/set-global.js"),c=e("./node_modules/core-js/internals/function-to-string.js"),s=e("./node_modules/core-js/internals/internal-state.js"),d=s.get,p=s.enforce,h=String(c).split("toString");i("inspectSource",function(u){return c.call(u)}),(o.exports=function(u,m,f,y){var g=y?!!y.unsafe:!1,x=y?!!y.enumerable:!1,b=y?!!y.noTargetGet:!1;if(typeof f=="function"&&(typeof m=="string"&&!l(f,"name")&&a(f,"name",m),p(f).source=h.join(typeof m=="string"?m:"")),u===t){x?u[m]=f:r(m,f);return}else g?!b&&u[m]&&(x=!0):delete u[m];x?u[m]=f:a(u,m,f)})(Function.prototype,"toString",function(){return typeof this=="function"&&d(this).source||c.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(o,n){o.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},"./node_modules/core-js/internals/set-global.js":function(o,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/hide.js");o.exports=function(a,l){try{i(t,a,l)}catch(r){t[a]=l}return l}},"./node_modules/core-js/internals/set-to-string-tag.js":function(o,n,e){var t=e("./node_modules/core-js/internals/object-define-property.js").f,i=e("./node_modules/core-js/internals/has.js"),a=e("./node_modules/core-js/internals/well-known-symbol.js"),l=a("toStringTag");o.exports=function(r,c,s){r&&!i(r=s?r:r.prototype,l)&&t(r,l,{configurable:!0,value:c})}},"./node_modules/core-js/internals/shared-key.js":function(o,n,e){var t=e("./node_modules/core-js/internals/shared.js"),i=e("./node_modules/core-js/internals/uid.js"),a=t("keys");o.exports=function(l){return a[l]||(a[l]=i(l))}},"./node_modules/core-js/internals/shared.js":function(o,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/set-global.js"),a=e("./node_modules/core-js/internals/is-pure.js"),l="__core-js_shared__",r=t[l]||i(l,{});(o.exports=function(c,s){return r[c]||(r[c]=s!==void 0?s:{})})("versions",[]).push({version:"3.1.3",mode:a?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(o,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=e("./node_modules/core-js/internals/require-object-coercible.js");o.exports=function(a,l,r){var c=String(i(a)),s=t(l),d=c.length,p,h;return s<0||s>=d?r?"":void 0:(p=c.charCodeAt(s),p<55296||p>56319||s+1===d||(h=c.charCodeAt(s+1))<56320||h>57343?r?c.charAt(s):p:r?c.slice(s,s+2):(p-55296<<10)+(h-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(o,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=Math.max,a=Math.min;o.exports=function(l,r){var c=t(l);return c<0?i(c+r,0):a(c,r)}},"./node_modules/core-js/internals/to-indexed-object.js":function(o,n,e){var t=e("./node_modules/core-js/internals/indexed-object.js"),i=e("./node_modules/core-js/internals/require-object-coercible.js");o.exports=function(a){return t(i(a))}},"./node_modules/core-js/internals/to-integer.js":function(o,n){var e=Math.ceil,t=Math.floor;o.exports=function(i){return isNaN(i=+i)?0:(i>0?t:e)(i)}},"./node_modules/core-js/internals/to-length.js":function(o,n,e){var t=e("./node_modules/core-js/internals/to-integer.js"),i=Math.min;o.exports=function(a){return a>0?i(t(a),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(o,n,e){var t=e("./node_modules/core-js/internals/require-object-coercible.js");o.exports=function(i){return Object(t(i))}},"./node_modules/core-js/internals/to-primitive.js":function(o,n,e){var t=e("./node_modules/core-js/internals/is-object.js");o.exports=function(i,a){if(!t(i))return i;var l,r;if(a&&typeof(l=i.toString)=="function"&&!t(r=l.call(i))||typeof(l=i.valueOf)=="function"&&!t(r=l.call(i))||!a&&typeof(l=i.toString)=="function"&&!t(r=l.call(i)))return r;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(o,n){var e=0,t=Math.random();o.exports=function(i){return"Symbol(".concat(i===void 0?"":i,")_",(++e+t).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(o,n,e){var t=e("./node_modules/core-js/internals/is-object.js"),i=e("./node_modules/core-js/internals/an-object.js");o.exports=function(a,l){if(i(a),!t(l)&&l!==null)throw TypeError("Can't set "+String(l)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(o,n,e){var t=e("./node_modules/core-js/internals/global.js"),i=e("./node_modules/core-js/internals/shared.js"),a=e("./node_modules/core-js/internals/uid.js"),l=e("./node_modules/core-js/internals/native-symbol.js"),r=t.Symbol,c=i("wks");o.exports=function(s){return c[s]||(c[s]=l&&r[s]||(l?r:a)("Symbol."+s))}},"./node_modules/core-js/modules/es.array.from.js":function(o,n,e){var t=e("./node_modules/core-js/internals/export.js"),i=e("./node_modules/core-js/internals/array-from.js"),a=e("./node_modules/core-js/internals/check-correctness-of-iteration.js"),l=!a(function(r){Array.from(r)});t({target:"Array",stat:!0,forced:l},{from:i})},"./node_modules/core-js/modules/es.string.iterator.js":function(o,n,e){"use strict";var t=e("./node_modules/core-js/internals/string-at.js"),i=e("./node_modules/core-js/internals/internal-state.js"),a=e("./node_modules/core-js/internals/define-iterator.js"),l="String Iterator",r=i.set,c=i.getterFor(l);a(String,"String",function(s){r(this,{type:l,string:String(s),index:0})},function(){var d=c(this),p=d.string,h=d.index,u;return h>=p.length?{value:void 0,done:!0}:(u=t(p,h,!0),d.index+=u.length,{value:u,done:!1})})},"./node_modules/webpack/buildin/global.js":function(o,n){var e;e=function(){return this}();try{e=e||Function("return this")()||(0,eval)("this")}catch(t){typeof window=="object"&&(e=window)}o.exports=e},"./src/default-attrs.json":function(o){o.exports={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}},"./src/icon.js":function(o,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(u){for(var m=1;m2&&arguments[2]!==void 0?arguments[2]:[];d(this,u),this.name=m,this.contents=f,this.tags=y,this.attrs=t({},c.default,{class:"feather feather-"+m})}return i(u,[{key:"toSvg",value:function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=t({},this.attrs,f,{class:(0,l.default)(this.attrs.class,f.class)});return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),u}();function h(u){return Object.keys(u).map(function(m){return m+'="'+u[m]+'"'}).join(" ")}n.default=p},"./src/icons.js":function(o,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("./src/icon.js"),i=s(t),a=e("./dist/icons.json"),l=s(a),r=e("./src/tags.json"),c=s(r);function s(d){return d&&d.__esModule?d:{default:d}}n.default=Object.keys(l.default).map(function(d){return new i.default(d,l.default[d],c.default[d])}).reduce(function(d,p){return d[p.name]=p,d},{})},"./src/index.js":function(o,n,e){"use strict";var t=e("./src/icons.js"),i=s(t),a=e("./src/to-svg.js"),l=s(a),r=e("./src/replace.js"),c=s(r);function s(d){return d&&d.__esModule?d:{default:d}}o.exports={icons:i.default,toSvg:l.default,replace:c.default}},"./src/replace.js":function(o,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(h){for(var u=1;u0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document=="undefined")throw new Error("`feather.replace()` only works in a browser environment.");var u=document.querySelectorAll("[data-feather]");Array.from(u).forEach(function(m){return d(m,h)})}function d(h){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=p(h),f=m["data-feather"];delete m["data-feather"];var y=r.default[f].toSvg(t({},u,m,{class:(0,a.default)(u.class,m.class)})),g=new DOMParser().parseFromString(y,"image/svg+xml"),x=g.querySelector("svg");h.parentNode.replaceChild(x,h)}function p(h){return Array.from(h.attributes).reduce(function(u,m){return u[m.name]=m.value,u},{})}n.default=s},"./src/tags.json":function(o){o.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-buoy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(o,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("./src/icons.js"),i=a(t);function a(r){return r&&r.__esModule?r:{default:r}}function l(r){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!r)throw new Error("The required `key` (icon name) parameter is missing.");if(!i.default[r])throw new Error("No icon matching '"+r+"'. See the complete list of icons at https://feathericons.com");return i.default[r].toSvg(c)}n.default=l},0:function(o,n,e){e("./node_modules/core-js/es/array/from.js"),o.exports=e("./src/index.js")}})})});var Ie=De(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});var F=require("obsidian"),we="YYYY-MM-DD",je="gggg-[W]ww",ze="YYYY-MM",Ue="YYYY-[Q]Q",He="YYYY";function G(o){var e,t;let n=window.app.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e[o])==null?void 0:t.enabled)}function Q(){var o,n,e,t;try{let{internalPlugins:i,plugins:a}=window.app;if(G("daily")){let{format:s,folder:d,template:p}=((n=(o=a.getPlugin("periodic-notes"))==null?void 0:o.settings)==null?void 0:n.daily)||{};return{format:s||we,folder:(d==null?void 0:d.trim())||"",template:(p==null?void 0:p.trim())||""}}let{folder:l,format:r,template:c}=((t=(e=i.getPluginById("daily-notes"))==null?void 0:e.instance)==null?void 0:t.options)||{};return{format:r||we,folder:(l==null?void 0:l.trim())||"",template:(c==null?void 0:c.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function Z(){var o,n,e,t,i,a,l;try{let r=window.app.plugins,c=(o=r.getPlugin("calendar"))==null?void 0:o.options,s=(e=(n=r.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.weekly;if(G("weekly"))return{format:s.format||je,folder:((t=s.folder)==null?void 0:t.trim())||"",template:((i=s.template)==null?void 0:i.trim())||""};let d=c||{};return{format:d.weeklyNoteFormat||je,folder:((a=d.weeklyNoteFolder)==null?void 0:a.trim())||"",template:((l=d.weeklyNoteTemplate)==null?void 0:l.trim())||""}}catch(r){console.info("No custom weekly note settings found!",r)}}function J(){var n,e,t,i;let o=window.app.plugins;try{let a=G("monthly")&&((e=(n=o.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.monthly)||{};return{format:a.format||ze,folder:((t=a.folder)==null?void 0:t.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom monthly note settings found!",a)}}function X(){var n,e,t,i;let o=window.app.plugins;try{let a=G("quarterly")&&((e=(n=o.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.quarterly)||{};return{format:a.format||Ue,folder:((t=a.folder)==null?void 0:t.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom quarterly note settings found!",a)}}function q(){var n,e,t,i;let o=window.app.plugins;try{let a=G("yearly")&&((e=(n=o.getPlugin("periodic-notes"))==null?void 0:n.settings)==null?void 0:e.yearly)||{};return{format:a.format||He,folder:((t=a.folder)==null?void 0:t.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom yearly note settings found!",a)}}function We(...o){let n=[];for(let t=0,i=o.length;t{let x=t(),b=o.clone().set({hour:x.get("hour"),minute:x.get("minute"),second:x.get("second")});return m&&b.add(parseInt(f,10),y),g?b.format(g.substring(1).trim()):b.format(a)}).replace(/{{\s*yesterday\s*}}/gi,o.clone().subtract(1,"day").format(a)).replace(/{{\s*tomorrow\s*}}/gi,o.clone().add(1,"d").format(a)));return n.foldManager.save(p,c),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new F.Notice("Unable to create new file.")}}function St(o,n){var e;return(e=n[O(o,"day")])!=null?e:null}function Ot(){let{vault:o}=window.app,{folder:n}=Q(),e=o.getAbstractFileByPath(F.normalizePath(n));if(!e)throw new be("Failed to find daily notes folder");let t={};return F.Vault.recurseChildren(e,i=>{if(i instanceof F.TFile){let a=W(i,"day");if(a){let l=O(a,"day");t[l]=i}}}),t}var Me=class extends Error{};function Ct(){let{moment:o}=window,n=o.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;n;)e.push(e.shift()),n--;return e}function kt(o){return Ct().indexOf(o.toLowerCase())}async function Ke(o){let{vault:n}=window.app,{template:e,format:t,folder:i}=Z(),[a,l]=await H(e),r=o.format(t),c=await _(i,r);try{let s=await n.create(c,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,h,u,m,f)=>{let y=window.moment(),g=o.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return h&&g.add(parseInt(u,10),m),f?g.format(f.substring(1).trim()):g.format(t)}).replace(/{{\s*title\s*}}/gi,r).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,p,h)=>{let u=kt(p);return o.weekday(u).format(h.trim())}));return window.app.foldManager.save(s,l),s}catch(s){console.error(`Failed to create file: '${c}'`,s),new F.Notice("Unable to create new file.")}}function Tt(o,n){var e;return(e=n[O(o,"week")])!=null?e:null}function Et(){let o={};if(!Qe())return o;let{vault:n}=window.app,{folder:e}=Z(),t=n.getAbstractFileByPath(F.normalizePath(e));if(!t)throw new Me("Failed to find weekly notes folder");return F.Vault.recurseChildren(t,i=>{if(i instanceof F.TFile){let a=W(i,"week");if(a){let l=O(a,"week");o[l]=i}}}),o}var Ae=class extends Error{};async function Ge(o){let{vault:n}=window.app,{template:e,format:t,folder:i}=J(),[a,l]=await H(e),r=o.format(t),c=await _(i,r);try{let s=await n.create(c,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,h,u,m,f)=>{let y=window.moment(),g=o.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return h&&g.add(parseInt(u,10),m),f?g.format(f.substring(1).trim()):g.format(t)}).replace(/{{\s*date\s*}}/gi,r).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,r));return window.app.foldManager.save(s,l),s}catch(s){console.error(`Failed to create file: '${c}'`,s),new F.Notice("Unable to create new file.")}}function Rt(o,n){var e;return(e=n[O(o,"month")])!=null?e:null}function Nt(){let o={};if(!Ze())return o;let{vault:n}=window.app,{folder:e}=J(),t=n.getAbstractFileByPath(F.normalizePath(e));if(!t)throw new Ae("Failed to find monthly notes folder");return F.Vault.recurseChildren(t,i=>{if(i instanceof F.TFile){let a=W(i,"month");if(a){let l=O(a,"month");o[l]=i}}}),o}var Fe=class extends Error{};async function Dt(o){let{vault:n}=window.app,{template:e,format:t,folder:i}=X(),[a,l]=await H(e),r=o.format(t),c=await _(i,r);try{let s=await n.create(c,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,h,u,m,f)=>{let y=window.moment(),g=o.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return h&&g.add(parseInt(u,10),m),f?g.format(f.substring(1).trim()):g.format(t)}).replace(/{{\s*date\s*}}/gi,r).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,r));return window.app.foldManager.save(s,l),s}catch(s){console.error(`Failed to create file: '${c}'`,s),new F.Notice("Unable to create new file.")}}function Vt(o,n){var e;return(e=n[O(o,"quarter")])!=null?e:null}function Lt(){let o={};if(!Je())return o;let{vault:n}=window.app,{folder:e}=X(),t=n.getAbstractFileByPath(F.normalizePath(e));if(!t)throw new Fe("Failed to find quarterly notes folder");return F.Vault.recurseChildren(t,i=>{if(i instanceof F.TFile){let a=W(i,"quarter");if(a){let l=O(a,"quarter");o[l]=i}}}),o}var Pe=class extends Error{};async function zt(o){let{vault:n}=window.app,{template:e,format:t,folder:i}=q(),[a,l]=await H(e),r=o.format(t),c=await _(i,r);try{let s=await n.create(c,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,h,u,m,f)=>{let y=window.moment(),g=o.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return h&&g.add(parseInt(u,10),m),f?g.format(f.substring(1).trim()):g.format(t)}).replace(/{{\s*date\s*}}/gi,r).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,r));return window.app.foldManager.save(s,l),s}catch(s){console.error(`Failed to create file: '${c}'`,s),new F.Notice("Unable to create new file.")}}function Ut(o,n){var e;return(e=n[O(o,"year")])!=null?e:null}function Ht(){let o={};if(!Xe())return o;let{vault:n}=window.app,{folder:e}=q(),t=n.getAbstractFileByPath(F.normalizePath(e));if(!t)throw new Pe("Failed to find yearly notes folder");return F.Vault.recurseChildren(t,i=>{if(i instanceof F.TFile){let a=W(i,"year");if(a){let l=O(a,"year");o[l]=i}}}),o}function Wt(){var t,i;let{app:o}=window,n=o.internalPlugins.plugins["daily-notes"];if(n&&n.enabled)return!0;let e=o.plugins.getPlugin("periodic-notes");return e&&((i=(t=e.settings)==null?void 0:t.daily)==null?void 0:i.enabled)}function Qe(){var e,t;let{app:o}=window;if(o.plugins.getPlugin("calendar"))return!0;let n=o.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.weekly)==null?void 0:t.enabled)}function Ze(){var e,t;let{app:o}=window,n=o.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.monthly)==null?void 0:t.enabled)}function Je(){var e,t;let{app:o}=window,n=o.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.quarterly)==null?void 0:t.enabled)}function Xe(){var e,t;let{app:o}=window,n=o.plugins.getPlugin("periodic-notes");return n&&((t=(e=n.settings)==null?void 0:e.yearly)==null?void 0:t.enabled)}function Bt(o){let n={day:Q,week:Z,month:J,quarter:X,year:q}[o];return n()}function $t(o,n){return{day:Ye,month:Ge,week:Ke}[o](n)}v.DEFAULT_DAILY_NOTE_FORMAT=we;v.DEFAULT_MONTHLY_NOTE_FORMAT=ze;v.DEFAULT_QUARTERLY_NOTE_FORMAT=Ue;v.DEFAULT_WEEKLY_NOTE_FORMAT=je;v.DEFAULT_YEARLY_NOTE_FORMAT=He;v.appHasDailyNotesPluginLoaded=Wt;v.appHasMonthlyNotesPluginLoaded=Ze;v.appHasQuarterlyNotesPluginLoaded=Je;v.appHasWeeklyNotesPluginLoaded=Qe;v.appHasYearlyNotesPluginLoaded=Xe;v.createDailyNote=Ye;v.createMonthlyNote=Ge;v.createPeriodicNote=$t;v.createQuarterlyNote=Dt;v.createWeeklyNote=Ke;v.createYearlyNote=zt;v.getAllDailyNotes=Ot;v.getAllMonthlyNotes=Nt;v.getAllQuarterlyNotes=Lt;v.getAllWeeklyNotes=Et;v.getAllYearlyNotes=Ht;v.getDailyNote=St;v.getDailyNoteSettings=Q;v.getDateFromFile=W;v.getDateFromPath=It;v.getDateUID=O;v.getMonthlyNote=Rt;v.getMonthlyNoteSettings=J;v.getPeriodicNoteSettings=Bt;v.getQuarterlyNote=Vt;v.getQuarterlyNoteSettings=X;v.getTemplateInfo=H;v.getWeeklyNote=Tt;v.getWeeklyNoteSettings=Z;v.getYearlyNote=Ut;v.getYearlyNoteSettings=q});var Xt={};jt(Xt,{default:()=>ge});module.exports=bt(Xt);var j=require("obsidian");var Mt=xe(Le()),E=require("obsidian");var K=o=>o.match(/\.MD$|\.md$/m)?o.split(/\.MD$|\.md$/m).slice(0,-1).join(".md"):o;var R=xe(Ie());var qe=require("obsidian"),le=class o{static getBlock(n,e,t){var s,d;let i=e.getCursor("to"),a=n.metadataCache.getFileCache(t),l=a==null?void 0:a.sections;if(!l||l.length===0){console.log("error reading FileCache (empty file?)");return}let r=l.findIndex(p=>p.position.start.line>i.line),c=r>0?l[r-1]:l[l.length-1];return(c==null?void 0:c.type)=="list"&&(c=(d=(s=a.listItems)==null?void 0:s.find(p=>p.position.start.line<=i.line&&p.position.end.line>=i.line))!=null?d:c),c}static getIdOfBlock(n,e){let t=e.id;if(t)return t;let i=e.position.end,a={ch:i.col,line:i.line},l=Math.random().toString(36).substring(2,8),r=o.shouldInsertAfter(e)?` + +`:" ";return n.replaceRange(`${r}^${l}`,a),l}static shouldInsertAfter(n){if(n.type)return["blockquote","code","table","heading","comment","footnoteDefinition"].includes(n.type)}static getBlockId(n){let e=n.workspace.getActiveViewOfType(qe.MarkdownView);if(e){let t=e.editor,i=e.file,a=this.getBlock(n,t,i);if(a)return this.getIdOfBlock(t,a)}}};var _e={openFileOnWrite:!0,openDailyInNewPane:!1,openFileOnWriteInNewPane:!1,openFileWithoutWriteInNewPane:!1,idField:"id",useUID:!1,addFilepathWhenUsingUID:!1,allowEval:!1,includeVaultName:!0,vaultParam:"name"};var et=require("obsidian"),tt=xe(Ie());function nt(...o){let n=[];for(let t=0,i=o.length;t{this.file?this.plugin.tools.copyURI({filepath:this.file,data:e,mode:i}):this.plugin.tools.copyURI({daily:"true",data:e,mode:i})}})}return t}renderSuggestion(e,t){t.innerText=e.display}onChooseSuggestion(e,t){e.func()}};var at=require("obsidian"),V=class extends at.FuzzySuggestModal{constructor(e,t,i=!0){super(e.app);this.placeHolder=t;this.allowNoFile=i;this.plugin=e,this.setPlaceholder(this.placeHolder)}getItems(){let e=[];this.allowNoFile&&e.push({display:"",source:void 0});let t=this.app.workspace.getActiveFile();return t&&e.push({display:"",source:t.path}),[...e,...this.app.vault.getFiles().map(i=>({display:i.path,source:i.path}))]}getItemText(e){return e.display}onChooseItem(e,t){}};var lt=require("obsidian");function Se(o){return o.viewmode?{state:{mode:o.viewmode,source:o.viewmode=="source"}}:void 0}function ee(o){return navigator.clipboard.writeText(o)}function re(o,n){var a;let e=(a=n.parent)==null?void 0:a.path,t=e==="/"?"":e,i=n.name;for(let l=1;l<100;l++){let r=K(i),c=t+(t==""?"":"/")+r+` ${l}.md`;if(!(o.vault.getAbstractFileByPath(c)!==null))return c}}function rt(o,n){let e=new URL(o.vault.getResourcePath(n));return e.host="localhosthostlocal",e.protocol="file",e.search="",e.pathname=decodeURIComponent(e.pathname),e.toString().replace("/localhosthostlocal/","/")}function Oe(o,n,e){var l,r;let t=o.metadataCache.getFileCache(n),i=t.sections,a=(l=t.headings)==null?void 0:l.find(c=>c.heading===e);if(a){let c=i.findIndex(u=>u.type==="heading"&&u.position.start.line===a.position.start.line),s=i.slice(c+1),d=s==null?void 0:s.findIndex(u=>u.type==="heading");return{lastLine:((r=s[(d!==-1?d:s.length)-1])!=null?r:i[c]).position.end.line+1,firstLine:i[c].position.end.line+1}}else new lt.Notice("Can't find heading")}var te=class{constructor(n){this.plugin=n;this.app=this.plugin.app}get tools(){return this.plugin.tools}handlePluginManagement(n){if(n["enable-plugin"]){let e=n["enable-plugin"];this.app.plugins.getPlugin(e)?(this.app.plugins.enablePluginAndSave(e),new w.Notice(`Enabled ${e}`)):this.app.internalPlugins.plugins[e]&&(this.app.internalPlugins.plugins[e].enable(!0),new w.Notice(`Enabled ${e}`))}else if(n["disable-plugin"]){let e=n["disable-plugin"];this.app.plugins.getPlugin(e)?(this.app.plugins.disablePluginAndSave(e),new w.Notice(`Disabled ${e}`)):this.app.internalPlugins.plugins[e]&&(this.app.internalPlugins.plugins[e].disable(!0),new w.Notice(`Disabled ${e}`))}}handleFrontmatterKey(n){var a;let e=n.frontmatterkey,t=this.app.vault.getAbstractFileByPath((a=n.filepath)!=null?a:this.app.workspace.getActiveFile().path);if(!(t instanceof w.TFile))return;let i=this.app.metadataCache.getFileCache(t).frontmatter;if(n.data){let l=n.data;try{l=JSON.parse(l)}catch(r){l=`"${l}"`,l=JSON.parse(l)}this.app.fileManager.processFrontMatter(t,r=>{if(e.startsWith("[")&&e.endsWith("]")){let c=e.substring(1,e.length-1).split(","),s=r;for(let d=0;du==p)),d==c.length-1?s[parseInt(p)]=l:s=s[parseInt(p)]}else d==c.length-1?s[p]=l:s=s[p]}}else r[e]=l})}else{let l;if(e.startsWith("[")&&e.endsWith("]")){let r=e.substring(1,e.length-1).split(","),c=i;for(let s of r)if(c instanceof Array){let d=parseInt(s);Number.isNaN(d)&&(c=c.find(p=>p==s)),c=c[parseInt(s)]}else c=c[s];l=c}else l=i[e];ee(l)}}handleWorkspace(n){let e=this.app.internalPlugins.getEnabledPluginById("workspaces");if(!e)new w.Notice("Workspaces plugin is not enabled"),this.plugin.failure(n);else{if(n.saveworkspace=="true"){let t=e.activeWorkspace;e.saveWorkspace(t),new w.Notice(`Saved current workspace to ${t}`)}n.clipboard&&n.clipboard!="false"?this.tools.copyURI({workspace:e.activeWorkspace}):n.workspace!=null&&e.loadWorkspace(n.workspace),this.plugin.success(n)}}async handleCommand(n){if(n.filepath)if(n.mode){if(n.mode=="new"){let t=this.app.metadataCache.getFirstLinkpathDest(n.filepath,"/");t instanceof w.TFile&&(n.filepath=re(this.app,t))}await this.plugin.open({file:n.filepath,mode:"source",parameters:n});let e=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(e){let t=e.editor,i=t.getValue();if(n.mode==="append"){t.setValue(i+` +`);let a=t.lineCount();t.setCursor({ch:0,line:a})}else n.mode==="prepend"?(t.setValue(` +`+i),t.setCursor({ch:0,line:0})):n.mode==="overwrite"&&t.setValue("")}}else n.line!=null||n.column!=null||n.offset!=null?(await this.plugin.open({file:n.filepath,mode:"source",parameters:n}),await this.plugin.setCursorInLine(n)):await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});else(n.openmode||n.viewmode)&&await this.plugin.open({parameters:n});if(n.commandid)this.app.commands.executeCommandById(n.commandid);else if(n.commandname){let e=this.app.commands.commands;for(let t in e)if(e[t].name===n.commandname){e[t].callback?await e[t].callback():e[t].checkCallback(!1);break}}if(n.confirm&&n.confirm!="false"){await new Promise(t=>setTimeout(t,750));let e=document.querySelector(".mod-cta:not([style*='display: none'])");e.click instanceof Function&&e.click()}this.plugin.success(n)}async handleEval(n){if(n.filepath)if(n.mode){if(n.mode=="new"){let t=this.app.metadataCache.getFirstLinkpathDest(n.filepath,"/");t instanceof w.TFile&&(n.filepath=re(this.app,t))}await this.plugin.open({file:n.filepath,mode:"source",parameters:n});let e=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(e){let t=e.editor,i=t.getValue();if(n.mode==="append"){t.setValue(i+` +`);let a=t.lineCount();t.setCursor({ch:0,line:a})}else n.mode==="prepend"?(t.setValue(` +`+i),t.setCursor({ch:0,line:0})):n.mode==="overwrite"&&t.setValue("")}}else n.line!=null||n.column!=null||n.offset!=null?(await this.plugin.open({file:n.filepath,mode:"source",parameters:n}),await this.plugin.setCursorInLine(n)):await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});this.plugin.settings.allowEval?((0,eval)(n.eval),this.plugin.success(n)):(new w.Notice("Eval is not allowed. Please enable it in the settings."),this.plugin.failure(n))}async handleDoesFileExist(n){let e=await this.app.vault.adapter.exists(n.filepath);ee((e?1:0).toString()),this.plugin.success(n)}async handleSearchAndReplace(n){let e;if(n.filepath){let t=this.app.vault.getAbstractFileByPath(n.filepath);t instanceof w.TFile&&(e=t)}else e=this.app.workspace.getActiveFile();if(e){let t=await this.app.vault.read(e);if(n.searchregex)try{let[,,i,a]=n.searchregex.match(/(\/?)(.+)\1([a-z]*)/i),l=new RegExp(i,a);t=t.replace(l,n.replace),this.plugin.success(n)}catch(i){new w.Notice(`Can't parse ${n.searchregex} as RegEx`),this.plugin.failure(n)}else t=t.replaceAll(n.search,n.replace),this.plugin.success(n);await this.plugin.writeAndOpenFile(e.path,t,n)}else new w.Notice("Cannot find file"),this.plugin.failure(n)}async handleSearch(n){n.filepath&&await this.plugin.open({file:n.filepath,parameters:n});let e=this.app.workspace.getActiveViewOfType(w.FileView);e.currentMode.showSearch();let t=e.currentMode.search;t.searchInputEl.value=n.search,t.searchInputEl.dispatchEvent(new Event("input"))}async handleWrite(n,e=!1){var i;let t;if(n.filepath?t=this.app.vault.getAbstractFileByPath(n.filepath):t=this.app.workspace.getActiveFile(),n.filepath||t){let a,l=(i=n.filepath)!=null?i:t.path;n.mode==="overwrite"?(a=await this.plugin.writeAndOpenFile(l,n.data,n),this.plugin.success(n)):n.mode==="prepend"?(t instanceof w.TFile?a=await this.plugin.prepend(t,n):a=await this.plugin.prepend(l,n),this.plugin.success(n)):n.mode==="append"?(t instanceof w.TFile?a=await this.plugin.append(t,n):a=await this.plugin.append(l,n),this.plugin.success(n)):n.mode==="new"?t instanceof w.TFile?(a=await this.plugin.writeAndOpenFile(re(this.app,t),n.data,n),this.plugin.hookSuccess(n,a)):(a=await this.plugin.writeAndOpenFile(l,n.data,n),this.plugin.hookSuccess(n,a)):!e&&t instanceof w.TFile?(new w.Notice("File already exists"),this.plugin.openExistingFileAndSetCursor(t.path,n),this.plugin.failure(n)):(a=await this.plugin.writeAndOpenFile(l,n.data,n),this.plugin.success(n)),n.uid&&this.tools.writeUIDToFile(a,n.uid)}else new w.Notice("Cannot find file"),this.plugin.failure(n)}async handleOpen(n){if(n.heading!=null){await this.plugin.open({file:n.filepath+"#"+n.heading,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(!e)return;let i=this.app.metadataCache.getFileCache(e.file).headings.find(a=>a.heading===n.heading);e.editor.focus(),e.editor.setCursor({line:i.position.start.line+1,ch:0})}else if(n.block!=null){await this.plugin.open({file:n.filepath+"#^"+n.block,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.getActiveViewOfType(w.MarkdownView);if(!e)return;let i=this.app.metadataCache.getFileCache(e.file).blocks[n.block];e.editor.focus(),e.editor.setCursor({line:i.position.start.line,ch:0})}else await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n}),(n.line!=null||n.column!=null||n.offset!=null)&&await this.plugin.setCursorInLine(n);if(n.mode!=null&&await this.plugin.setCursor(n),n.uid){let e=this.app.workspace.getActiveViewOfType(w.MarkdownView);this.tools.writeUIDToFile(e.file,n.uid)}this.plugin.success(n)}async handleOpenBlock(n){let e=this.tools.getFileFromBlockID(n.block);e&&await this.plugin.chooseHandler({...n,filepath:e.path},!1)}handleCopyFileURI(n,e){let t=this.app.workspace.getActiveViewOfType(w.FileView);if(!(!t&&!e)){if(t instanceof w.MarkdownView){let i=t.editor.getCursor(),a=this.app.metadataCache.getFileCache(t.file);if(a.headings){for(let l of a.headings)if(l.position.start.line<=i.line&&l.position.end.line>=i.line){this.tools.copyURI({filepath:t.file.path,heading:l.heading});return}}if(a.blocks)for(let l of Object.keys(a.blocks)){let r=a.blocks[l];if(r.position.start.line<=i.line&&r.position.end.line>=i.line){this.tools.copyURI({filepath:t.file.path,block:l});return}}}if(n){let i=e!=null?e:this.app.workspace.getActiveFile();if(!i){new w.Notice("No file opened");return}this.tools.copyURI({filepath:i.path})}else{let i=new V(this.plugin,"Choose a file",!1);i.open(),i.onChooseItem=(a,l)=>{new B(this.plugin,a.source).open()}}}}handleOpenSettings(n){if(this.app.setting.containerEl.parentElement===null&&this.app.setting.open(),n.settingid=="plugin-browser"?(this.app.setting.openTabById("community-plugins"),this.app.setting.activeTab.containerEl.find(".mod-cta").click()):n.settingid=="theme-browser"?(this.app.setting.openTabById("appearance"),this.app.setting.activeTab.containerEl.find(".mod-cta").click()):this.app.setting.openTabById(n.settingid),n.settingsection){let e=this.app.setting.tabContentContainer.querySelectorAll("*"),t=Array.prototype.find.call(e,i=>i.textContent==n.settingsection);t&&t.scrollIntoView()}this.plugin.success(n)}async handleUpdatePlugins(n){new w.Notice("Checking for updates\u2026"),await this.app.plugins.checkForUpdates(),Object.keys(this.app.plugins.updates).length>0&&(n.settingid="community-plugins",this.handleOpenSettings(n),this.app.setting.activeTab.containerEl.findAll(".mod-cta").last().click()),this.plugin.success(n)}async handleBookmarks(n){let e=this.app.internalPlugins.getEnabledPluginById("bookmarks"),i=e.getBookmarks().find(l=>l.title==n.bookmark),a;n.openmode=="true"||n.openmode=="false"?a=n.openmode=="true":a=n.openmode,e.openBookmark(i,a)}async handleCanvas(n){n.filepath&&await this.plugin.open({file:n.filepath,setting:this.plugin.settings.openFileWithoutWriteInNewPane,parameters:n});let e=this.app.workspace.activeLeaf.view;if(e.getViewType()!="canvas"){new w.Notice("Active view is not a canvas");return}let t=e;if(n.canvasnodes){let i=n.canvasnodes.split(","),a=t.canvas.nodes,l=i.map(c=>a.get(c)),r=t.canvas.selection;t.canvas.updateSelection(()=>{for(let c of l)r.add(c)}),t.canvas.zoomToSelection()}if(n.canvasviewport){let[i,a,l]=n.canvasviewport.split(",");if(i!="-")if(i.startsWith("--")||i.startsWith("++")){let r=t.canvas.tx+Number(i.substring(1));t.canvas.tx=r}else t.canvas.tx=Number(i);if(a!="-")if(a.startsWith("--")||a.startsWith("++")){let r=t.canvas.ty+Number(a.substring(1));t.canvas.ty=r}else t.canvas.ty=Number(a);if(l!="-")if(l.startsWith("--")||l.startsWith("++")){let r=t.canvas.tZoom+Number(l.substring(1));t.canvas.tZoom=r}else t.canvas.tZoom=Number(l);t.canvas.markViewportChanged()}}};var st=require("obsidian"),se=class extends st.FuzzySuggestModal{constructor(e,t){super(e.app);this.plugin=e,this.file=t}getItems(){let e=this.app.commands.commands;return Object.keys(e).map(i=>({id:e[i].id,name:e[i].name}))}getItemText(e){return e.name}onChooseItem(e,t){this.plugin.tools.copyURI({filepath:this.file,commandid:e.id})}};var ct=require("obsidian"),ce=class extends ct.SuggestModal{constructor(e,t,i){super(e.app);this.search=t;this.filepath=i;this.emptyText="Empty text (replace with nothing)";this.plugin=e,this.setPlaceholder("Replacement text")}getSuggestions(e){return e===""&&(e=this.emptyText),[e]}renderSuggestion(e,t){t.innerText=e}onChooseSuggestion(e,t){this.search.isRegEx?this.plugin.tools.copyURI({filepath:this.filepath,searchregex:this.search.source,replace:e==this.emptyText?"":e}):this.plugin.tools.copyURI({filepath:this.filepath,search:this.search.source,replace:e==this.emptyText?"":e})}};var dt=require("obsidian"),de=class extends dt.SuggestModal{constructor(e){super(e.app);this.plugin=e,this.setPlaceholder("Searched text. RegEx is supported")}getSuggestions(e){e===""&&(e="...");let t;try{t=new RegExp(e)}catch(i){}return[{source:e,isRegEx:!1,display:e},{source:e,display:t?`As RegEx: ${e}`:"Can't parse RegEx",isRegEx:!0}]}renderSuggestion(e,t){t.innerText=e.display}onChooseSuggestion(e,t){}};var S=require("obsidian"),pe=class extends S.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e}=this;e.empty(),e.createEl("h2",{text:this.plugin.manifest.name}),new S.Setting(e).setName("Open file on write").addToggle(t=>t.setValue(this.plugin.settings.openFileOnWrite).onChange(i=>{this.plugin.settings.openFileOnWrite=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Open file on write in a new pane").setDisabled(this.plugin.settings.openFileOnWrite).addToggle(t=>t.setValue(this.plugin.settings.openFileOnWriteInNewPane).onChange(i=>{this.plugin.settings.openFileOnWriteInNewPane=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Open daily note in a new pane").addToggle(t=>t.setValue(this.plugin.settings.openDailyInNewPane).onChange(i=>{this.plugin.settings.openDailyInNewPane=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Open file without write in new pane").addToggle(t=>t.setValue(this.plugin.settings.openFileWithoutWriteInNewPane).onChange(i=>{this.plugin.settings.openFileWithoutWriteInNewPane=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Use UID instead of file paths").addToggle(t=>t.setValue(this.plugin.settings.useUID).onChange(i=>{this.plugin.settings.useUID=i,this.plugin.saveSettings(),this.display()})),new S.Setting(e).setName("Include vault name/ID parameter").addToggle(t=>t.setValue(this.plugin.settings.includeVaultName).onChange(i=>{this.plugin.settings.includeVaultName=i,this.plugin.saveSettings(),this.display()})),this.plugin.settings.includeVaultName&&new S.Setting(e).setName("Vault identifying parameter").setDesc("Choose whether to use the vault Name or its internal ID as the identifying parameter.").addDropdown(t=>t.addOption("name","Name").addOption("id","ID").setValue(this.plugin.settings.vaultParam).onChange(i=>{this.plugin.settings.vaultParam=i,this.plugin.saveSettings()})),this.plugin.settings.useUID&&new S.Setting(e).setName("Add filepath parameter").setDesc("When using UID instead of file paths, you can still add the filepath parameter to know what this URI is about. It's NOT actually used.").addToggle(t=>t.setValue(this.plugin.settings.addFilepathWhenUsingUID).onChange(i=>{this.plugin.settings.addFilepathWhenUsingUID=i,this.plugin.saveSettings()})),new S.Setting(e).setName("UID field in frontmatter").addText(t=>t.setValue(this.plugin.settings.idField).onChange(i=>{this.plugin.settings.idField=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Allow executing arbitrary code via eval").setDesc("\u26A0\uFE0F This can be dangerous as it allows executing arbitrary code. Only enable this if you trust the source of the URIs you are using and know what you are doing. \u26A0\uFE0F").addToggle(t=>t.setValue(this.plugin.settings.allowEval).onChange(i=>{this.plugin.settings.allowEval=i,this.plugin.saveSettings()})),new S.Setting(e).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(t=>{t.buttonEl.outerHTML="Buy Me a Coffee at ko-fi.com"})}};var L=require("obsidian");var ue,Gt=new Uint8Array(16);function Ce(){if(!ue&&(ue=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ue))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(Gt)}var pt=/^(?:[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;function Qt(o){return typeof o=="string"&&pt.test(o)}var ut=Qt;var I=[];for(he=0;he<256;++he)I.push((he+256).toString(16).substr(1));var he;function Zt(o){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=(I[o[n+0]]+I[o[n+1]]+I[o[n+2]]+I[o[n+3]]+"-"+I[o[n+4]]+I[o[n+5]]+"-"+I[o[n+6]]+I[o[n+7]]+"-"+I[o[n+8]]+I[o[n+9]]+"-"+I[o[n+10]]+I[o[n+11]]+I[o[n+12]]+I[o[n+13]]+I[o[n+14]]+I[o[n+15]]).toLowerCase();if(!ut(e))throw TypeError("Stringified UUID is invalid");return e}var ht=Zt;function Jt(o,n,e){o=o||{};var t=o.random||(o.rng||Ce)();if(t[6]=t[6]&15|64,t[8]=t[8]&63|128,n){e=e||0;for(var i=0;i<16;++i)n[e+i]=t[i];return n}return ht(t)}var ke=Jt;var ne=class{constructor(n){this.plugin=n;this.app=this.plugin.app}get settings(){return this.plugin.settings}async writeUIDToFile(n,e){var s;let t=(s=this.app.metadataCache.getFileCache(n))==null?void 0:s.frontmatter,i=await this.app.vault.read(n),a=(!t||t.length===0)&&!i.match(/^-{3}\s*\n*\r*-{3}/),l=i.split(` +`),r=`${this.plugin.settings.idField}:`;if(a)l.unshift("---"),l.unshift(`${r} ${e}`),l.unshift("---");else{let d=l.findIndex(p=>p.startsWith(r));d!=-1?l[d]=`${r} ${e}`:l.splice(1,0,`${r} ${e}`)}let c=l.join(` +`);return await this.app.vault.modify(n,c),e}async getUIDFromFile(n){var i;let e=(i=this.app.metadataCache.getFileCache(n))!=null?i:await new Promise(a=>{let l=this.app.metadataCache.on("changed",r=>{if(r.path==n.path){let c=this.app.metadataCache.getFileCache(n);this.app.metadataCache.offref(l),a(c)}})}),t=(0,L.parseFrontMatterEntry)(e.frontmatter,this.plugin.settings.idField);return t!=null?t instanceof Array?t[0]:t:await this.writeUIDToFile(n,ke())}async generateURI(n){let e="obsidian://adv-uri",t="",i=this.app.vault.getAbstractFileByPath(n.filepath);this.settings.includeVaultName&&(t+="?vault=",this.settings.vaultParam=="id"&&this.app.appId?t+=encodeURIComponent(this.app.appId):t+=encodeURIComponent(this.app.vault.getName())),this.settings.useUID&&i instanceof L.TFile&&i.extension=="md"&&(this.settings.addFilepathWhenUsingUID||(n.filepath=void 0),n.uid=await this.getUIDFromFile(i));let a=Object.keys(n).filter(l=>n[l]).sort((l,r)=>{let c=["filepath","filename","uid","daily"],s=["data","eval"];return c.includes(l)?-1:c.includes(r)||s.includes(l)?1:s.includes(r)?-1:0});for(let l of a)n[l]!=null&&(t+=t?"&":"?",t+=`${l}=${encodeURIComponent(n[l])}`);return t.endsWith("%20")&&(t+="&"),e+t}async copyURI(n){let e=await this.generateURI(n);await ee(e),new L.Notice("Advanced URI copied to your clipboard")}getFileFromUID(n){var i;let e=this.app.vault.getMarkdownFiles(),t=this.settings.idField;for(let a of e){let l=(0,L.parseFrontMatterEntry)((i=this.app.metadataCache.getFileCache(a))==null?void 0:i.frontmatter,t);if(l instanceof Array){if(l.contains(n))return a}else if(l==n)return a}}getFileFromBlockID(n){var t,i;let e=this.app.vault.getMarkdownFiles();for(let a of e)if(((i=(t=this.app.metadataCache.getFileCache(a))==null?void 0:t.blocks)==null?void 0:i[n])!=null)return a}};var fe=require("obsidian"),ye=class extends fe.FuzzySuggestModal{constructor(e){super(e.app);this.plugin=e,this.setPlaceholder("Choose a workspace")}getItems(){let e=this.app.internalPlugins.getEnabledPluginById("workspaces");if(!e)new fe.Notice("Workspaces plugin is not enabled");else return Object.keys(e.workspaces)}getItemText(e){return e}onChooseItem(e,t){this.plugin.tools.copyURI({workspace:e})}};var ge=class extends j.Plugin{constructor(){super(...arguments);this.handlers=new te(this);this.tools=new ne(this)}async onload(){await this.loadSettings(),this.addSettingTab(new pe(this.app,this)),this.addCommand({id:"copy-uri-current-file",name:"Copy URI for file with options",callback:()=>this.handlers.handleCopyFileURI(!1)}),this.addCommand({id:"copy-uri-current-file-simple",name:"Copy URI for current file",callback:()=>this.handlers.handleCopyFileURI(!0)}),this.addCommand({id:"copy-uri-daily",name:"Copy URI for daily note",callback:()=>new B(this).open()}),this.addCommand({id:"copy-uri-search-and-replace",name:"Copy URI for search and replace",callback:()=>{let e=new V(this,"Used file for search and replace");e.open(),e.onChooseItem=t=>{let i=new de(this);i.open(),i.onChooseSuggestion=a=>{new ce(this,a,t==null?void 0:t.source).open()}}}}),this.addCommand({id:"copy-uri-command",name:"Copy URI for command",callback:()=>{let e=new V(this,"Select a file to be opened before executing the command");e.open(),e.onChooseItem=t=>{new se(this,t==null?void 0:t.source).open()}}}),this.addCommand({id:"copy-uri-block",name:"Copy URI for current block",checkCallback:e=>{let t=this.app.workspace.getActiveViewOfType(j.MarkdownView);if(e)return t!=null;let i=le.getBlockId(this.app);i&&this.tools.copyURI({filepath:t.file.path,block:i})}}),this.addCommand({id:"copy-uri-workspace",name:"Copy URI for workspace",callback:()=>{new ye(this).open()}}),this.addCommand({id:"copy-uri-canvas-node",name:"Copy URI for selected canvas nodes",checkCallback:e=>{let t=this.app.workspace.activeLeaf.view;if(e)return t.getViewType()==="canvas"&&t.canvas.selection.size>0;if(t.getViewType()!=="canvas")return!1;let i=t,a=[];i.canvas.selection.forEach(l=>{a.push(l.id)}),this.tools.copyURI({canvasnodes:a.join(","),filepath:t.file.path})}}),this.addCommand({id:"copy-uri-canvas-viewport",name:"Copy URI for current canvas viewport",checkCallback:e=>{let t=this.app.workspace.activeLeaf.view;if(e)return t.getViewType()==="canvas";if(t.getViewType()!=="canvas")return!1;let a=t.canvas,l=a.tx.toFixed(0),r=a.ty.toFixed(0),c=a.tZoom.toFixed(3);this.tools.copyURI({filepath:t.file.path,canvasviewport:`${l},${r},${c}`})}}),this.registerObsidianProtocolHandler("advanced-uri",async e=>{let t=e;for(let i in t)t[i]=decodeURIComponent(t[i]);this.onUriCall(t)}),this.registerObsidianProtocolHandler("adv-uri",async e=>{let t=e;this.onUriCall(t)}),this.registerObsidianProtocolHandler("hook-get-advanced-uri",async e=>{let t=e;for(let a in t)t[a]=decodeURIComponent(t[a]);let i=this.app.workspace.getActiveFile();i?this.hookSuccess(t,i):this.failure(t,{errorMessage:"No file opened"})}),this.registerEvent(this.app.workspace.on("file-menu",(e,t,i)=>{(i==="more-options"||i==="tab-header"||i=="file-explorer-context-menu")&&t instanceof j.TFile&&e.addItem(a=>{a.setTitle("Copy Advanced URI").setIcon("link").setSection("info").onClick(l=>this.handlers.handleCopyFileURI(!0,t))})}))}async onUriCall(e){var i,a,l;let t=!1;if(this.lastParameters={...e},e.uid){let r=(i=this.tools.getFileFromUID(e.uid))==null?void 0:i.path;r!=null&&(e.filepath=r,e.uid=void 0)}else if(e.filename){let r=this.app.metadataCache.getFirstLinkpathDest(e.filename,"");r||(r=this.app.vault.getMarkdownFiles().find(d=>{var p;return(p=(0,j.parseFrontMatterAliases)(this.app.metadataCache.getFileCache(d).frontmatter))==null?void 0:p.includes(e.filename)}));let c=this.app.fileManager.getNewFileParent((a=this.app.workspace.getActiveFile())==null?void 0:a.path),s=c.isRoot()?"":c.path+"/";e.filepath=(l=r==null?void 0:r.path)!=null?l:s+(0,j.normalizePath)(e.filename)}if(e.filepath){e.filepath=(0,j.normalizePath)(e.filepath);let r=e.filepath.lastIndexOf(".");e.filepath.substring(r<0?e.filepath.length:r)===""&&(e.filepath=e.filepath+".md")}else if(e.daily==="true"){if(!(0,R.appHasDailyNotesPluginLoaded)()){new j.Notice("Daily notes plugin is not loaded");return}let r=window.moment(Date.now()),c=(0,R.getAllDailyNotes)(),s=(0,R.getDailyNote)(r,c);s||(e.exists==="true"?e.filepath=await it(r):(s=await(0,R.createDailyNote)(r),await new Promise(d=>setTimeout(d,500)),t=!0)),s!==void 0&&(e.filepath=s.path)}e.clipboard==="true"&&(e.data=await navigator.clipboard.readText()),this.chooseHandler(e,t)}async chooseHandler(e,t){e["enable-plugin"]||e["disable-plugin"]?this.handlers.handlePluginManagement(e):e.frontmatterkey?this.handlers.handleFrontmatterKey(e):e.workspace||e.saveworkspace=="true"?this.handlers.handleWorkspace(e):e.commandname||e.commandid?this.handlers.handleCommand(e):e.bookmark?this.handlers.handleBookmarks(e):e.eval?this.handlers.handleEval(e):e.filepath&&e.exists==="true"?this.handlers.handleDoesFileExist(e):e.canvasnodes||e.canvasviewport?this.handlers.handleCanvas(e):e.data?this.handlers.handleWrite(e,t):e.filepath&&e.heading?(await this.handlers.handleOpen(e),e.filepath=void 0,e.heading=void 0,this.chooseHandler(e,t)):e.filepath&&e.block?(await this.handlers.handleOpen(e),e.filepath=void 0,e.block=void 0,this.chooseHandler(e,t)):(e.search||e.searchregex)&&e.replace!=null?this.handlers.handleSearchAndReplace(e):e.search?this.handlers.handleSearch(e):e.filepath?this.handlers.handleOpen(e):e.block?this.handlers.handleOpenBlock(e):e.settingid?this.handlers.handleOpenSettings(e):e.updateplugins&&this.handlers.handleUpdatePlugins(e)}async hookSuccess(e,t){if(!e["x-success"])return;let i={title:K(t.name),advanceduri:await this.tools.generateURI({filepath:t.path}),urlkey:"advanceduri",fileuri:rt(this.app,t)};this.success(e,i)}success(e,t){if(e["x-success"]){let i=new URL(e["x-success"]);for(let a in t)i.searchParams.set(a,t[a]);window.open(i.toString())}}failure(e,t){if(e["x-error"]){let i=new URL(e["x-error"]);for(let a in t)i.searchParams.set(a,t[a]);window.open(i.toString())}}async append(e,t){var l;let i,a;if(t.heading){if(e instanceof j.TFile){i=e.path;let r=(l=Oe(this.app,e,t.heading))==null?void 0:l.lastLine;if(r===void 0)return;let s=(await this.app.vault.read(e)).split(` +`);s.splice(r,0,...t.data.split(` +`)),a=s.join(` +`)}}else if(e instanceof j.TFile){i=e.path;let r=await this.app.vault.read(e);if(t.line){let c=Math.max(Number(t.line),0),s=r.split(` +`);s.splice(c,0,t.data),a=s.join(` +`)}else a=r+` +`+t.data}else i=e,a=t.data;return this.writeAndOpenFile(i,a,t)}async prepend(e,t){var l;let i,a;if(t.heading){if(e instanceof j.TFile){i=e.path;let r=(l=Oe(this.app,e,t.heading))==null?void 0:l.firstLine;if(r===void 0)return;let s=(await this.app.vault.read(e)).split(` +`);s.splice(r,0,...t.data.split(` +`)),a=s.join(` +`)}}else if(e instanceof j.TFile){i=e.path;let r=await this.app.vault.read(e),c=this.app.metadataCache.getFileCache(e),s=0;t.line?s+=Math.max(Number(t.line)-1,0):c.frontmatterPosition&&(s+=c.frontmatterPosition.end.line+1);let d=r.split(` +`);d.splice(s,0,t.data),a=d.join(` +`)}else i=e,a=t.data;return this.writeAndOpenFile(i,a,t)}async writeAndOpenFile(e,t,i){let a=this.app.vault.getAbstractFileByPath(e);if(a instanceof j.TFile)await this.app.vault.modify(a,t);else{let l=e.split("/"),r=l.slice(0,l.length-1).join("/");l.length>1&&!(this.app.vault.getAbstractFileByPath(r)instanceof j.TFolder)&&await this.app.vault.createFolder(r),/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(t)?await this.app.vault.createBinary(e,(0,j.base64ToArrayBuffer)(t)):await this.app.vault.create(e,t)}return this.openExistingFileAndSetCursor(e,i),this.app.vault.getAbstractFileByPath(e)}async openExistingFileAndSetCursor(e,t){t.openmode!="silent"&&this.settings.openFileOnWrite&&(await this.open({file:e,setting:this.settings.openFileOnWriteInNewPane,parameters:t}),(t.line!=null||t.column!=null||t.offset!=null)&&await this.setCursorInLine(t))}async open({file:e,setting:t,parameters:i,supportPopover:a,mode:l}){var c;let r;if(i.openmode=="popover"&&(a==null||a)){let s=this.app.plugins.plugins["obsidian-hover-editor"];s||(new j.Notice("Cannot find Hover Editor plugin. Please file an issue."),this.failure(i)),await new Promise(d=>{r=s.spawnPopover(void 0,()=>{this.app.workspace.setActiveLeaf(r,{focus:!0}),d()})})}else{let s=t;if(i.newpane!==void 0&&(s=i.newpane=="true"),i.openmode!==void 0&&(i.openmode=="true"||i.openmode=="false"?s=i.openmode=="true":i.openmode=="popover"?s=!1:j.Platform.isMobile&&i.openmode=="window"||(s=i.openmode)),s=="silent")return;if(j.Platform.isMobileApp&&s=="window"&&(s=!0),e!=null){let d=!1;isBoolean(s)&&this.app.workspace.iterateAllLeaves(p=>{var h;if(((h=p.view.file)==null?void 0:h.path)===i.filepath){if(d&&p.width==0)return;d=!0,this.app.workspace.setActiveLeaf(p,{focus:!0}),r=p}})}r||(r=this.app.workspace.getLeaf(s),this.app.workspace.setActiveLeaf(r,{focus:!0}))}if(e instanceof j.TFile?await r.openFile(e):e!=null&&await this.app.workspace.openLinkText(e,"/",!1,l!=null?{state:{mode:l}}:Se(i)),r.view instanceof j.MarkdownView){let s=r.getViewState();l!=null?s.state.mode=l:s.state={...s.state,...(c=Se(i))==null?void 0:c.state},await r.setViewState(s)}return r}async setCursor(e){let t=this.app.workspace.getActiveViewOfType(j.MarkdownView);if(!t)return;let i=e.mode,a=t.editor,l=t.leaf.getViewState();if(l.state.mode="source",i==="append"){let r=a.lastLine(),c=a.getLine(r).length;await t.leaf.setViewState(l,{focus:!0}),a.setCursor({ch:c,line:r})}else i==="prepend"&&(await t.leaf.setViewState(l,{focus:!0}),a.setCursor({ch:0,line:0}));await new Promise(r=>setTimeout(r,10)),e.viewmode=="preview"&&(l.state.mode="preview",await t.leaf.setViewState(l))}async setCursorInLine(e){let t=this.app.workspace.getActiveViewOfType(j.MarkdownView);if(!t)return;let i=t.leaf.getViewState(),a=e.line!=null?Number(e.line):void 0,l=e.column?Number(e.column):void 0;i.state.mode="source",await t.leaf.setViewState(i);let r,c;if(e.offset!=null){let s=t.editor.offsetToPos(Number(e.offset));r=s.line,c=s.ch}else{r=a!=null?Math.min(a-1,t.editor.lineCount()-1):t.editor.getCursor().line;let s=t.editor.getLine(r).length-1;c=Math.min(l-1,s)}t.editor.focus(),t.editor.setCursor({line:r,ch:c}),t.editor.scrollIntoView({from:{line:r,ch:c},to:{line:r,ch:c}},!0),await new Promise(s=>setTimeout(s,10)),e.viewmode=="preview"&&(i.state.mode="preview",await t.leaf.setViewState(i))}async loadSettings(){this.settings=Object.assign(_e,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}}; //! All of these methods are taken from https://www.npmjs.com/package/obsidian-daily-notes-interface. /*! Bundled license information: diff --git a/.obsidian/plugins/obsidian-advanced-uri/manifest.json b/.obsidian/plugins/obsidian-advanced-uri/manifest.json index 927aaddc..c92d8e2f 100644 --- a/.obsidian/plugins/obsidian-advanced-uri/manifest.json +++ b/.obsidian/plugins/obsidian-advanced-uri/manifest.json @@ -5,7 +5,7 @@ "isDesktopOnly": false, "js": "main.js", "fundingUrl": "https://ko-fi.com/vinzent", - "version": "1.42.0", + "version": "1.44.1", "author": "Vinzent", "authorUrl": "https://github.com/Vinzent03" } diff --git a/.obsidian/plugins/obsidian-commits/data.json b/.obsidian/plugins/obsidian-commits/data.json index f1cf11e9..25e6dc75 100644 --- a/.obsidian/plugins/obsidian-commits/data.json +++ b/.obsidian/plugins/obsidian-commits/data.json @@ -490,7 +490,7 @@ "links": 4 }, "05.01 Computer setup/Storage and Syncing.md": { - "size": 4848, + "size": 5358, "tags": 4, "links": 13 }, @@ -1345,7 +1345,7 @@ "links": 6 }, "01.03 Family/Timothée Bédier.md": { - "size": 1847, + "size": 2073, "tags": 3, "links": 4 }, @@ -1360,7 +1360,7 @@ "links": 6 }, "01.03 Family/Auguste Bédier.md": { - "size": 1920, + "size": 2151, "tags": 3, "links": 6 }, @@ -1520,7 +1520,7 @@ "links": 19 }, "05.02 Networks/Configuring UFW.md": { - "size": 4862, + "size": 5834, "tags": 2, "links": 7 }, @@ -1570,7 +1570,7 @@ "links": 1 }, "01.02 Home/Household.md": { - "size": 3785, + "size": 4178, "tags": 2, "links": 4 }, @@ -1650,7 +1650,7 @@ "links": 1 }, "01.02 Home/@Shopping list.md": { - "size": 5750, + "size": 6352, "tags": 1, "links": 1 }, @@ -2935,7 +2935,7 @@ "links": 3 }, "03.02 Travels/@Italy.md": { - "size": 1942, + "size": 2170, "tags": 2, "links": 2 }, @@ -10525,9 +10525,9 @@ "links": 4 }, "01.03 Family/Dorothée Moulin.md": { - "size": 1579, + "size": 1742, "tags": 3, - "links": 3 + "links": 4 }, "00.01 Admin/Calendars/2024-04-21.md": { "size": 1556, @@ -11285,7 +11285,7 @@ "links": 3 }, "01.06 Health/2024-06-29 Fungal treatment.md": { - "size": 12568, + "size": 2857, "tags": 2, "links": 3 }, @@ -12117,25 +12117,15 @@ "00.03 News/How to Make Millions as a Professional Whistleblower.md": { "size": 28672, "tags": 3, - "links": 1 - }, - "00.02 Inbox/Diplomacy.md": { - "size": 883, - "tags": 2, - "links": 1 + "links": 2 }, "00.01 Admin/Calendars/Events/2024-09-01 ⚽️ LOSC - PSG (1-3).md": { "size": 438, "tags": 0, "links": 2 }, - "00.01 Admin/Calendars/Events/2024-09-18 ⚽️ PSG - FC Girona.md": { - "size": 192, - "tags": 0, - "links": 2 - }, "00.01 Admin/Calendars/Events/2024-10-01 ⚽️ Arsenal - PSG.md": { - "size": 187, + "size": 370, "tags": 0, "links": 2 }, @@ -12209,15 +12199,10 @@ "tags": 0, "links": 8 }, - "00.03 News/These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly.md": { - "size": 73931, - "tags": 4, - "links": 1 - }, "00.03 News/Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons.md": { "size": 36531, "tags": 4, - "links": 1 + "links": 2 }, "00.03 News/Anatomy of a Murder.md": { "size": 59865, @@ -12227,7 +12212,7 @@ "00.03 News/Why I changed my mind about volunteering.md": { "size": 28254, "tags": 3, - "links": 1 + "links": 2 }, "00.01 Admin/Calendars/2024-09-09.md": { "size": 1255, @@ -12240,17 +12225,257 @@ "links": 6 }, "00.01 Admin/Calendars/2024-09-11.md": { + "size": 1566, + "tags": 0, + "links": 9 + }, + "00.01 Admin/Calendars/2024-09-12.md": { + "size": 1255, + "tags": 0, + "links": 6 + }, + "00.03 News/At Least Two Saudi Officials May Have Deliberately Assisted 911 Hijackers, New Evidence Suggests.md": { + "size": 17017, + "tags": 5, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-13.md": { + "size": 1412, + "tags": 0, + "links": 8 + }, + "00.01 Admin/Calendars/2024-09-14.md": { + "size": 1412, + "tags": 0, + "links": 7 + }, + "02.03 Zürich/Garde Manger.md": { + "size": 1458, + "tags": 3, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-15.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.03 News/Inside the Dangerous, Secretive World of Extreme Fishing.md": { + "size": 29196, + "tags": 3, + "links": 2 + }, + "00.03 News/I Examined Donald Trump’s Ear — and His Soul — at Mar-a-Lago.md": { + "size": 43643, + "tags": 3, + "links": 2 + }, + "00.03 News/Russia’s Espionage War in the Arctic.md": { + "size": 80044, + "tags": 4, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-16.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2024-09-17.md": { + "size": 1598, + "tags": 0, + "links": 9 + }, + "00.01 Admin/Calendars/2024-09-18.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "02.02 Paris/Erso.md": { + "size": 1602, + "tags": 2, + "links": 2 + }, + "00.01 Admin/Calendars/Events/2024-09-14 ⚽️ PSG - Brest 29 (3-1).md": { + "size": 444, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/Events/2024-09-18 ⚽️ PSG - FC Girona (1-0).md": { + "size": 409, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-19.md": { + "size": 1412, + "tags": 0, + "links": 7 + }, + "00.01 Admin/Calendars/2024-09-20.md": { + "size": 1255, + "tags": 0, + "links": 5 + }, + "00.03 News/Emails Reveal How Walz Struggled to Deal With Unrest, Reach Consensus With Critics After Police Killings.md": { + "size": 19161, + "tags": 3, + "links": 1 + }, + "00.01 Admin/Calendars/2024-09-21.md": { + "size": 1412, + "tags": 0, + "links": 8 + }, + "00.03 News/SpaceX’s ascent in Texas was fueled by accommodating local politicians.md": { + "size": 24083, + "tags": 4, + "links": 1 + }, + "01.07 Animals/2024-09-21 Patron's Cup.md": { + "size": 857, + "tags": 3, + "links": 4 + }, + "00.01 Admin/Calendars/Events/2024-09-21 ⚽️ Reims - PSG (1-1).md": { + "size": 416, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-22.md": { + "size": 1255, + "tags": 0, + "links": 5 + }, + "02.03 Zürich/Antiquario da Marco.md": { + "size": 1575, + "tags": 2, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-23.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "00.01 Admin/Calendars/2024-09-24.md": { + "size": 1627, + "tags": 0, + "links": 8 + }, + "00.03 News/How Anthony Flores and Anna Moore Scammed Dr. Mark Sawusch.md": { + "size": 35895, + "tags": 4, + "links": 1 + }, + "00.03 News/For Laura Loomer, a Trump comeback is everything.md": { + "size": 22492, + "tags": 3, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-25.md": { + "size": 1274, + "tags": 0, + "links": 5 + }, + "03.03 Food & Wine/Green Lentil Daal.md": { + "size": 3581, + "tags": 3, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-26.md": { + "size": 1412, + "tags": 0, + "links": 4 + }, + "01.07 Animals/2024-09-25 Vet Clearance.md": { + "size": 659, + "tags": 3, + "links": 1 + }, + "00.01 Admin/Calendars/2024-09-27.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "00.01 Admin/Calendars/Events/2024-09-27 ⚽️ PSG - Rennes (3-1).md": { + "size": 441, + "tags": 0, + "links": 2 + }, + "00.01 Admin/Calendars/2024-09-28.md": { "size": 1412, "tags": 0, "links": 5 + }, + "00.01 Admin/Calendars/2024-09-29.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "03.04 Cinematheque/Independence Day (1996).md": { + "size": 2264, + "tags": 1, + "links": 1 + }, + "00.01 Admin/Calendars/2024-09-30.md": { + "size": 1259, + "tags": 0, + "links": 5 + }, + "00.03 News/To Understand Mississippi, I Went to Spain.md": { + "size": 13605, + "tags": 3, + "links": 1 + }, + "00.03 News/How Sparing the Parkland Shooter's Life Changed Florida's Death Penalty.md": { + "size": 101409, + "tags": 4, + "links": 1 + }, + "00.03 News/Opinion The Number.md": { + "size": 49708, + "tags": 3, + "links": 1 + }, + "00.01 Admin/Calendars/2024-10-01.md": { + "size": 1412, + "tags": 0, + "links": 7 + }, + "03.02 Travels/These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly.md": { + "size": 73931, + "tags": 4, + "links": 3 + }, + "00.01 Admin/Calendars/2024-10-02.md": { + "size": 1255, + "tags": 0, + "links": 6 + }, + "03.03 Food & Wine/Turkish Eggs.md": { + "size": 4824, + "tags": 2, + "links": 2 + }, + "00.01 Admin/Calendars/2024-10-03.md": { + "size": 1412, + "tags": 0, + "links": 5 + }, + "00.01 Admin/Calendars/2024-10-04.md": { + "size": 1282, + "tags": 0, + "links": 5 + }, + "03.01 Reading list/Diplomacy.md": { + "size": 883, + "tags": 2, + "links": 2 } }, "commitTypes": { "/": { - "Refactor": 11826, - "Create": 2938, - "Link": 14386, - "Expand": 2367 + "Refactor": 11864, + "Create": 2984, + "Link": 14500, + "Expand": 2407 } }, "dailyCommits": { @@ -12258,43 +12483,83 @@ "0": 190, "1": 46, "2": 33, - "3": 12, + "3": 13, "4": 46, - "5": 17, + "5": 18, "6": 77, - "7": 1165, - "8": 3381, - "9": 1244, - "10": 845, - "11": 631, - "12": 6827, - "13": 805, - "14": 689, - "15": 1020, + "7": 1207, + "8": 3420, + "9": 1264, + "10": 856, + "11": 641, + "12": 6854, + "13": 806, + "14": 715, + "15": 1025, "16": 781, - "17": 946, - "18": 7471, - "19": 1084, - "20": 971, - "21": 935, - "22": 831, - "23": 1470 + "17": 949, + "18": 7480, + "19": 1088, + "20": 989, + "21": 944, + "22": 840, + "23": 1473 } }, "weeklyCommits": { "/": { - "Mon": 3473, - "Tue": 2002, - "Wed": 8122, - "Thu": 1572, - "Fri": 1652, + "Mon": 3497, + "Tue": 2038, + "Wed": 8168, + "Thu": 1599, + "Fri": 1688, "Sat": 0, - "Sun": 14696 + "Sun": 14765 } }, "recentCommits": { "/": { "Expanded": [ + " 2024-06-29 Fungal treatment ", + " Storage and Syncing ", + " 2024-06-29 Fungal treatment ", + " Dorothée Moulin ", + " 2024-10-01 ⚽️ Arsenal - PSG ", + " 2024-10-01 ⚽️ Arsenal - PSG ", + " 2024-06-29 Fungal treatment ", + " 2024-06-29 Fungal treatment ", + " Auguste Bédier ", + " 2024-06-29 Fungal treatment ", + " 2024-09-27 ⚽️ PSG - Rennes (3-1) ", + " 2024-09-27 ⚽️ PSG - Rennes ", + " 2024-09-27 ⚽️ PSG - Rennes ", + " 2024-06-29 Fungal treatment ", + " 2024-06-29 Fungal treatment ", + " 2024-09-25 Vet Clearance ", + " 2024-06-29 Fungal treatment ", + " 2024-09-11 ", + " 2024-09-24 ", + " Household ", + " Timothée Bédier ", + " Antiquario da Marco ", + " 2024-09-21 ⚽️ Reims - PSG ", + " 2024-09-21 ⚽️ Reims - PSG ", + " 2024-09-21 Patron's Cup ", + " 2024-09-21 Patron's Cup ", + " @Shopping list ", + " Configuring UFW ", + " 2024-09-18 ⚽️ PSG - FC Girona (1-0) ", + " 2024-09-18 ⚽️ PSG - FC Girona ", + " 2024-09-18 ⚽️ PSG - FC Girona ", + " Erso ", + " @Italy ", + " 2024-06-29 Fungal treatment ", + " 2024-09-17 ", + " 2024-09-17 ", + " 2024-09-14 ⚽️ PSG - Brest 29 ", + " 2024-09-14 ⚽️ PSG - Brest 29 ", + " 2024-09-14 ⚽️ PSG - Brest 29 ", + " Garde Manger ", " 2024-06-29 Fungal treatment ", " @Sally ", " Household ", @@ -12305,102 +12570,88 @@ " 2024-06-29 Fungal treatment ", " Ophélie Bédier ", " 2024-09-04 ", - " 2024-11-06 ⚽️ PSG - Atletico Madrid ", - " 2024-12-10 ⚽️ RB Salzburg - PSG ", - " 2025-01-22 ⚽️ PSG - Man City ", - " 2025-01-29 ⚽️ Stuttgart - PSG ", - " 2024-11-26 ⚽️ Bayern - PSG ", - " 2024-09-18 ⚽️ PSG - FC Girona ", - " 2024-10-01 ⚽️ Arsenal - PSG ", - " 2024-10-22 ⚽️ PSG - PSV Eindhoven ", - " 2024-09-01 ⚽️ LOSC - PSG ", - " 2024-09-01 ⚽️ LOSC - PSG ", - " 2024-09-01 ⚽️ LOSC - PSG ", - " Configuring UFW ", - " Gaslight ", - " 2024-06-29 Fungal treatment ", - " Qu'est-ce Qui Nous Tente ", - " Silence of Friends ", - " Couronnement de l'Art ", - " Génie & Folie ", - " If ", - " The Times They are a-changing ", - " Nightwood ", - " New Year well Wishes ", - " New Year well Wishes ", - " New Year well Wishes ", - " Household ", - " Hilaire Bédier ", - " @Lifestyle ", - " 2024-06-29 Fungal treatment ", - " Wien ", - " Wien ", - " Wien ", - " Wien ", - " Wien ", - " Wien ", - " @Lifestyle ", - " @Lifestyle ", - " Configuring UFW ", - " 2024-08-23 ⚽️ PSG - Montpellier ", - " 2024-08-23 ⚽️ PSG - Montpellier ", - " 2024-08-23 ⚽️ PSG - Montpellier ", - " @Reading master " + " 2024-11-06 ⚽️ PSG - Atletico Madrid " ], "Created": [ - " 2024-09-11 ", - " 2024-09-10 ", - " 2024-09-09 ", - " Why I changed my mind about volunteering ", - " Anatomy of a Murder ", - " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ", - " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ", - " 2024-09-08 ", - " 2024-09-07 ", - " 2024-09-06 ", - " 2024-09-05 ", - " 2024-09-04 ", - " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ", - " 2024-09-03 ", - " 2024-09-02 ", - " 2025-01-29 ⚽️ Stuttgart - PSG ", - " 2025-01-22 ⚽️ PSG - Man City ", - " 2024-12-10 ⚽️ RB Salzburg - PSG ", - " 2024-11-26 Bayern - PSG ", - " 2024-11-06 ⚽️ PSG - Atletico Madrid ", - " 2024-10-22 ⚽️ PSG - PSV Eindhoven ", - " 2024-10-01 ⚽️ Arsenal - PSG ", - " 2024-09-18 ⚽️ PSG - FC Girona ", - " 2024-09-01 ⚽️ LOSC - PSG ", - " Diplomacy ", - " Diplomacy ", - " How to Make Millions as a Professional Whistleblower ", - " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ", - " Fear and Joy in Chicago Fintan O’Toole ", - " 2024-09-01 ", - " 2024-08-31 ", - " 2024-08-30 ", - " 2024-08-29 ", - " Untitled ", + " 2024-10-04 ", + " 2024-10-03 ", + " Turkish Eggs ", + " 2024-10-02 ", + " 2024-10-01 ", + " How Sparing the Parkland Shooter's Life Changed Florida's Death Penalty ", + " Opinion The Number ", + " To Understand Mississippi, I Went to Spain ", + " 2024-09-30 ", + " Independence Day (1996) ", + " 2024-09-29 ", + " 2024-09-28 ", + " 2024-09-27 ⚽️ PSG - Rennes ", + " 2024-09-27 ", " Untitled ", + " 2024-09-26 ", + " Green Lentil Daal - An Easy Weeknight Meal ", + " 2024-09-25 ", + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", + " For Laura Loomer, a Trump comeback is everything ", + " How Anthony Flores and Anna Moore Scammed Dr. Mark Sawusch ", + " 2024-09-24 ", + " 2024-09-23 ", " Untitled ", + " 2024-09-22 ", + " 2024-09-21 ⚽️ Reims - PSG ", " Untitled ", + " SpaceX’s ascent in Texas was fueled by accommodating local politicians ", + " 2024-09-21 ", + " Emails Reveal How Walz Struggled to Deal With Unrest, Reach Consensus With Critics After Police Killings ", + " 2024-09-20 ", + " 2024-09-19 ", " Untitled ", + " 2024-09-18 ", + " 2024-09-17 ", + " 2024-09-16 ", + " Russia’s Espionage War in the Arctic ", + " I Examined Donald Trump’s Ear — and His Soul — at Mar-a-Lago ", + " Inside the Dangerous, Secretive World of Extreme Fishing ", + " 2024-09-15 ", + " 2024-09-14 ⚽️ PSG - Brest 29 ", " Untitled ", - " Seehaus ", - " 2024-08-28 ", - " Untitled ", - " 2024-08-27 ", - " 2024-08-26 ", - " ‘The Blind Side’ Made Him Famous. But He Has a Different Story to Tell. ", - " From Fiery Revolutionary to Sunshine State Retiree The THC-Fueled Twilight of the Last of the Chicago 7 ", - " 2024-08-25 ", - " Untitled ", - " 2024-08-24 ", - " Arizona Dream (1993) ", - " 2024-08-23 ⚽️ PSG - Montpellier " + " 2024-09-14 ", + " 2024-09-13 ", + " At Least Two Saudi Officials May Have Deliberately Assisted 911 Hijackers, New Evidence Suggests ", + " 2024-09-12 ", + " 2024-09-11 ", + " 2024-09-10 ", + " 2024-09-09 ", + " Why I changed my mind about volunteering ", + " Anatomy of a Murder " ], "Renamed": [ + " Diplomacy ", + " Turkish Eggs ", + " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ", + " Opinion The Number ", + " How Sparing the Parkland Shooter's Life Changed Florida's Death Penalty ", + " To Understand Mississippi, I Went to Spain ", + " 2024-09-27 ⚽️ PSG - Rennes (3-1) ", + " 2024-09-25 Vet Clearance ", + " Green Lentil Daal ", + " Green Lentil Daal ", + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", + " For Laura Loomer, a Trump comeback is everything ", + " How Anthony Flores and Anna Moore Scammed Dr. Mark Sawusch ", + " Antiquario da Marco ", + " 2024-09-21 ⚽️ Reims - PSG (1-1) ", + " 2024-09-21 Patron's Cup ", + " SpaceX’s ascent in Texas was fueled by accommodating local politicians ", + " Emails Reveal How Walz Struggled to Deal With Unrest, Reach Consensus With Critics After Police Killings ", + " 2024-09-18 ⚽️ PSG - FC Girona (1-0) ", + " 2024-09-14 ⚽️ PSG - Brest 29 (3-1) ", + " Erso ", + " Russia’s Espionage War in the Arctic ", + " I Examined Donald Trump’s Ear — and His Soul — at Mar-a-Lago ", + " Inside the Dangerous, Secretive World of Extreme Fishing ", + " Garde Manger ", + " At Least Two Saudi Officials May Have Deliberately Assisted 911 Hijackers, New Evidence Suggests ", " Why I changed my mind about volunteering ", " Anatomy of a Murder ", " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ", @@ -12425,35 +12676,32 @@ " Wien ", " 2024-08-23 ⚽️ PSG - Montpellier (6-0) ", " Trump Assassination Attempt Laid Bare Long-standing Vulnerabilities in the Secret Service ", - " The Vigil Keepers of January 6th ", - " How McDonald’s Found Out Its Wildly Popular Monopoly Game Was a Fraud ", - " The California Beach Town Awash in Poop ", - " After Nike Leaders Promised Climate Action, Their Corporate Jets Kept Flying — and Polluting ", - " Armed and Underground Inside the Turbulent, Secret World of an American Militia ", - " Escaping Oklahoma A Worker’s Story From Inside an Illegal Marijuana Operation ", - " What I Saw in the Darién Gap ", - " The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ", - " Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ", - " Ozempic Boom Inside USA’s Weight-Loss Drug Capital ", - " I Can’t Overstate How Bananas This Arizona Primary Is. The QAnon Shaman Isn’t Even the Weirdest Part. ", - " The movement desperately trying to get people to have more babies ", - " The movement desperately trying to get people to have more babies ", - " Why CVS and Target Locking Up Products Is Backfiring ", - " The skydiver who survived a 14,000-foot fall - ESPN ", - " Marjorie Taylor Greene’s and Brad Raffensperger’s Voter Registrations Targeted in Georgia’s New Online Portal ", - " Why We Investigated Matthew Trewhella, the Far-Right Wisconsin Pastor Influencing Republican Politics ", - " 2024-08-01 Tonsilitis ", - " 2024-08-01 Tonsilitis ", - " How four U.S. presidents unleashed economic warfare across the globe ", - " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb ", - " 📋 @Task Master ", - " 🗒️ @Master Note ", - " 📃 Template Scene ", - " 🧭 layout$address ", - " 🍷 Template Wine ", - " 📔 Template Wiki " + " The Vigil Keepers of January 6th " ], "Tagged": [ + " Inside the Dangerous, Secretive World of Extreme Fishing ", + " Turkish Eggs ", + " Russia’s Espionage War in the Arctic ", + " How Sparing the Parkland Shooter's Life Changed Florida's Death Penalty ", + " Opinion The Number ", + " To Understand Mississippi, I Went to Spain ", + " Independence Day (1996) ", + " 2024-09-25 Vet Clearance ", + " Green Lentil Daal ", + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", + " How Anthony Flores and Anna Moore Scammed Dr. Mark Sawusch ", + " For Laura Loomer, a Trump comeback is everything ", + " Antiquario da Marco ", + " 2024-09-21 Patron's Cup ", + " SpaceX’s ascent in Texas was fueled by accommodating local politicians ", + " Emails Reveal How Walz Struggled to Deal With Unrest, Reach Consensus With Critics After Police Killings ", + " Erso ", + " I Examined Donald Trump’s Ear — and His Soul — at Mar-a-Lago ", + " Russia’s Espionage War in the Arctic ", + " Inside the Dangerous, Secretive World of Extreme Fishing ", + " Garde Manger ", + " At Least Two Saudi Officials May Have Deliberately Assisted 911 Hijackers, New Evidence Suggests ", " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ", " Anatomy of a Murder ", " Why I changed my mind about volunteering ", @@ -12481,32 +12729,19 @@ " Escaping Oklahoma A Worker’s Story From Inside an Illegal Marijuana Operation ", " Armed and Underground Inside the Turbulent, Secret World of an American Militia ", " Sleepy Hollow (1999) ", - " The Social Dilemma (2020) ", - " The Pink Panther (1963) ", - " What I Saw in the Darién Gap ", - " Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ", - " The Chipotle Bowl Thrower Who Was Forced to Work Fast Food ", - " Moscow’s Spies Were Stealing US Tech — Until the FBI Started a Sabotage Campaign ", - " Ozempic Boom Inside USA’s Weight-Loss Drug Capital ", - " Interstellar (2014) ", - " Dallas Buyers Club (2013) ", - " The movement desperately trying to get people to have more babies ", - " I Can’t Overstate How Bananas This Arizona Primary Is. The QAnon Shaman Isn’t Even the Weirdest Part. ", - " Why CVS and Target Locking Up Products Is Backfiring ", - " The skydiver who survived a 14,000-foot fall - ESPN ", - " Why We Investigated Matthew Trewhella, the Far-Right Wisconsin Pastor Influencing Republican Politics ", - " Marjorie Taylor Greene’s and Brad Raffensperger’s Voter Registrations Targeted in Georgia’s New Online Portal ", - " 2024-08-01 Tonsilitis ", - " 2024-08-01 Tonsilitis ", - " Magic Mike (2012) ", - " Killer Joe (2011) ", - " The People vs Larry Flynt (1996) ", - " Amistad (1997) ", - " Braveheart (1995) ", - " How four U.S. presidents unleashed economic warfare across the globe ", - " I Accidentally Uncovered a Nationwide Scam Run by Fake Hosts on Airbnb " + " The Social Dilemma (2020) " ], "Refactored": [ + " Turkish Eggs ", + " 2024-10-02 ", + " 2024-09-30 ", + " Green Lentil Daal ", + " Green Lentil Daal ", + " 2024-06-29 Fungal treatment ", + " 2024-09-22 ", + " 2024-09-20 ", + " 2024-09-17 ", + " 2024-09-12 ", " 2023-07-13 Health check ", " 2024-09-09 ", " 2024-09-06 ", @@ -12547,19 +12782,10 @@ " Juan Bautista Bossio ", " 2024-06-17 ", " 2024-06-13 ", - " Life - Practical infos ", - " When Father was Away on Business (1985) ", - " 2024-05-22 ", - " The elections next door Mexico’s cartels pick candidates, kill rivals ", - " Server Tools ", - " How climate change is turning camels into the new cows ", - " Breakfast Stromboli ", - " Lemon Zucchini Muffins ", - " Lemon Zucchini Muffins ", - " 2024-05-09 ", - " 2024-05-08 " + " Life - Practical infos " ], "Deleted": [ + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", " Diplomacy ", " 2021-12-04 MRCK - lil dialogue ", " ‘The Blind Side’ Made Him Famous. But He Has a Different Story to Tell. ", @@ -12609,63 +12835,63 @@ " What Happened in Vegas David Hill ", " Why Bill Watterson Vanished - The American Conservative ", " What Really Happened to JFK ", - " Why Does Crypto Matter Matt Levine on BTC, ETH, Blockchain ", - " The Tunnels of Gaza " + " Why Does Crypto Matter Matt Levine on BTC, ETH, Blockchain " ], "Linked": [ - " 2024-09-11 ", - " 2024-09-11 ", - " 2024-09-10 ", - " 2024-09-10 ", - " 2024-09-09 ", - " Anatomy of a Murder ", + " Diplomacy ", + " For Laura Loomer, a Trump comeback is everything ", + " Inside the Dangerous, Secretive World of Extreme Fishing ", + " 2024-10-04 ", + " 2024-10-03 ", + " 2024-10-03 ", + " Dorothée Moulin ", + " 2024-10-02 ", + " Turkish Eggs ", + " 2024-10-02 ", + " 2024-10-02 ", + " 2024-10-01 ", + " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ", + " 2024-10-01 ", + " 2024-10-01 ", + " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ", + " 2024-10-01 ", + " Russia’s Espionage War in the Arctic ", + " 2024-09-30 ", + " How Sparing the Parkland Shooter's Life Changed Florida's Death Penalty ", + " Opinion The Number ", + " To Understand Mississippi, I Went to Spain ", + " 2024-09-30 ", + " 2024-09-29 ", + " Independence Day (1996) ", + " 2024-09-28 ", + " 2024-09-29 ", + " 2024-09-28 ", + " 2024-09-27 ⚽️ PSG - Rennes ", + " 2024-09-27 ", + " How to Make Millions as a Professional Whistleblower ", + " 2024-09-27 ", + " 2024-09-25 Vet Clearance ", + " 2024-09-26 ", + " 2024-09-25 ", + " I Examined Donald Trump’s Ear — and His Soul — at Mar-a-Lago ", + " Green Lentil Daal ", + " At Least Two Saudi Officials May Have Deliberately Assisted 911 Hijackers, New Evidence Suggests ", " Why I changed my mind about volunteering ", - " Where MAGA Granddads and Resistance Moms Go to Learn America’s Most Painful History Lessons ", - " These Are the Best Texas-Style Barbecue Joints in America – Texas Monthly ", - " 2024-09-08 ", - " 2024-09-08 ", - " Fear and Joy in Chicago Fintan O’Toole ", - " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ", - " 2024-09-07 ", - " 2024-09-06 ", - " 2024-09-05 ", - " 2024-09-04 ", - " 2024-09-04 ", - " The Accelerationists’ App How Telegram Became the “Center of Gravity” for a New Breed of Domestic Terrorists ", - " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ", - " 2024-09-03 ", - " 2024-09-02 ", - " 2024-09-03 ", - " 2024-09-02 ", - " 2024-11-06 ⚽️ PSG - Atletico Madrid ", - " 2024-12-10 ⚽️ RB Salzburg - PSG ", - " 2025-01-22 ⚽️ PSG - Man City ", - " 2025-01-29 ⚽️ Stuttgart - PSG ", - " 2024-11-26 ⚽️ Bayern - PSG ", - " 2024-09-18 ⚽️ PSG - FC Girona ", - " 2024-10-01 ⚽️ Arsenal - PSG ", - " 2024-10-22 ⚽️ PSG - PSV Eindhoven ", - " 2024-09-01 ⚽️ LOSC - PSG ", - " 2024-09-01 ", - " Diplomacy ", - " How to Make Millions as a Professional Whistleblower ", - " Fear and Joy in Chicago Fintan O’Toole ", - " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ", - " Gaslight ", - " Ozempic Boom Inside USA’s Weight-Loss Drug Capital ", - " 2024-09-01 ", - " 2024-08-31 ", - " 2024-08-31 ", - " What I Saw in the Darién Gap ", - " 2024-08-30 ", - " 2024-08-30 ", - " The Vigil Keepers of January 6th ", - " Underworld ", - " 2024-08-29 ", - " Exclusive Life Aboard a Nuclear Submarine as the US Responds to Threats Around the Globe ", - " 2024-08-29 " + " 2024-09-25 ", + " 2024-09-24 ", + " The Ballad of Byron York Meet Conservative Media’s Saddest Stenographer ", + " How Anthony Flores and Anna Moore Scammed Dr. Mark Sawusch ", + " For Laura Loomer, a Trump comeback is everything ", + " 2024-09-24 ", + " 2024-09-24 ", + " 2024-09-23 ", + " 2024-09-22 ", + " 2024-09-22 ", + " Antiquario da Marco ", + " 2024-09-21 ⚽️ Reims - PSG " ], "Removed Tags from": [ + " For Laura Loomer, a Trump comeback is everything ", " How Nayib Bukele's 'Iron Fist' Has Transformed El Salvador ", " The soft life why millennials are quitting the rat race ", " The Insulin Empire Edward Ongweso Jr. & Athena Sofides ", @@ -12715,8 +12941,7 @@ " A Family’s Disappearance Rocked New Zealand. What Came After Has Stunned Everyone. ", " Multiple Trump Witnesses Have Received Significant Financial Benefits From His Businesses, Campaign ", " Jerry West, as a player and exec, sustained excellence during a lifetime of emotional struggle ", - " The Local Girls Who Inspired the Hollywood Classic “Mean Girls” ", - " How Two Single Moms Escaped an Alleged Sex-Trafficking Ring and Ultimately Saved Each Other " + " The Local Girls Who Inspired the Hollywood Classic “Mean Girls” " ], "Removed Links from": [ " How a Con Man Ended Up in Solitary in Colorado Supermax Federal Prison ", diff --git a/.obsidian/plugins/obsidian-dice-roller/data.json b/.obsidian/plugins/obsidian-dice-roller/data.json index 8b5ff957..ba6bad28 100644 --- a/.obsidian/plugins/obsidian-dice-roller/data.json +++ b/.obsidian/plugins/obsidian-dice-roller/data.json @@ -1,4 +1,5 @@ { + "position": "RIGHT", "showFudgeIcon": false, "rollLinksForTags": false, "copyContentButton": true, @@ -22,7 +23,6 @@ "textColor": "#ffffff", "textFont": "Arial", "showLeafOnStartup": true, - "showDice": true, "displayAsEmbed": true, "round": "None", "initialDisplay": "Roll", @@ -73,6 +73,7 @@ "showRenderNotice": true, "diceModTemplateFolders": {}, "replaceDiceModInLivePreview": true, - "version": "11.0.4", - "viewResults": [] + "version": "11.3.1", + "viewResults": [], + "showDice": true } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-dice-roller/main.js b/.obsidian/plugins/obsidian-dice-roller/main.js index da630eed..f1b63fe3 100644 --- a/.obsidian/plugins/obsidian-dice-roller/main.js +++ b/.obsidian/plugins/obsidian-dice-roller/main.js @@ -3,22 +3,19 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ -var Dg=Object.create;var Co=Object.defineProperty;var Tg=Object.getOwnPropertyDescriptor;var Cg=Object.getOwnPropertyNames;var Rg=Object.getPrototypeOf,Fg=Object.prototype.hasOwnProperty;var Kn=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Lg=(r,e)=>{for(var t in e)Co(r,t,{get:e[t],enumerable:!0})},sd=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cg(e))!Fg.call(r,n)&&n!==t&&Co(r,n,{get:()=>e[n],enumerable:!(i=Tg(e,n))||i.enumerable});return r};var Qn=(r,e,t)=>(t=r!=null?Dg(Rg(r)):{},sd(e||!r||!r.__esModule?Co(t,"default",{value:r,enumerable:!0}):t,r)),Bg=r=>sd(Co({},"__esModule",{value:!0}),r);var hm=Kn((Ml,po)=>{(function(r){var e=typeof Ml=="object"&&Ml,t=typeof po=="object"&&po&&po.exports==e&&po,i=typeof global=="object"&&global;(i.global===i||i.window===i)&&(r=i);var n=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,o=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,a=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,l={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},c=/["&'<>`]/g,u={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,d=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,m={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` -`,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},y={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},x={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},g=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],f=String.fromCharCode,E={},w=E.hasOwnProperty,_=function(N,k){return w.call(N,k)},D=function(N,k){for(var V=-1,U=N.length;++V=55296&&N<=57343||N>1114111?(k&&v("character reference outside the permissible Unicode range"),"\uFFFD"):_(x,N)?(k&&v("disallowed character reference"),x[N]):(k&&D(g,N)&&v("disallowed character reference"),N>65535&&(N-=65536,V+=f(N>>>10&1023|55296),N=56320|N&1023),V+=f(N),V)},W=function(N){return"&#x"+N.toString(16).toUpperCase()+";"},A=function(N){return"&#"+N+";"},v=function(N){throw Error("Parse error: "+N)},R=function(N,k){k=T(k,R.options);var V=k.strict;V&&d.test(N)&&v("forbidden code point");var U=k.encodeEverything,q=k.useNamedReferences,j=k.allowUnsafeSymbols,ne=k.decimal?A:W,ae=function(H){return ne(H.charCodeAt(0))};return U?(N=N.replace(s,function(H){return q&&_(l,H)?"&"+l[H]+";":ae(H)}),q&&(N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),q&&(N=N.replace(a,function(H){return"&"+l[H]+";"}))):q?(j||(N=N.replace(c,function(H){return"&"+l[H]+";"})),N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),N=N.replace(a,function(H){return"&"+l[H]+";"})):j||(N=N.replace(c,ae)),N.replace(n,function(H){var Te=H.charCodeAt(0),ue=H.charCodeAt(1),we=(Te-55296)*1024+ue-56320+65536;return ne(we)}).replace(o,ae)};R.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var S=function(N,k){k=T(k,S.options);var V=k.strict;return V&&h.test(N)&&v("malformed character reference"),N.replace(p,function(U,q,j,ne,ae,H,Te,ue,we){var oe,Ce,Ae,Z,ie,te;return q?(ie=q,m[ie]):j?(ie=j,te=ne,te&&k.isAttributeValue?(V&&te=="="&&v("`&` did not start a character reference"),U):(V&&v("named character reference was not terminated by a semicolon"),y[ie]+(te||""))):ae?(Ae=ae,Ce=H,V&&!Ce&&v("character reference was not terminated by a semicolon"),oe=parseInt(Ae,10),O(oe,V)):Te?(Z=Te,Ce=ue,V&&!Ce&&v("character reference was not terminated by a semicolon"),oe=parseInt(Z,16),O(oe,V)):(V&&v("named character reference was not terminated by a semicolon"),U)})};S.options={isAttributeValue:!1,strict:!1};var B=function(N){return N.replace(c,function(k){return u[k]})},L={version:"1.2.0",encode:R,decode:S,escape:B,unescape:S};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return L});else if(e&&!e.nodeType)if(t)t.exports=L;else for(var C in L)_(L,C)&&(e[C]=L[C]);else r.he=L})(Ml)});var pm=Kn((dm,Dl)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof Dl=="object"&&Dl.exports?Dl.exports=e():r.moo=e()})(dm,function(){"use strict";var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function i(A){return A&&e.call(A)==="[object RegExp]"}function n(A){return A&&typeof A=="object"&&!i(A)&&!Array.isArray(A)}function s(A){return A.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function o(A){var v=new RegExp("|"+A);return v.exec("").length-1}function a(A){return"("+A+")"}function l(A){if(!A.length)return"(?!)";var v=A.map(function(R){return"(?:"+R+")"}).join("|");return"(?:"+v+")"}function c(A){if(typeof A=="string")return"(?:"+s(A)+")";if(i(A)){if(A.ignoreCase)throw new Error("RegExp /i flag not allowed");if(A.global)throw new Error("RegExp /g flag is implied");if(A.sticky)throw new Error("RegExp /y flag is implied");if(A.multiline)throw new Error("RegExp /m flag is implied");return A.source}else throw new Error("Not a pattern: "+A)}function u(A,v){return A.length>v?A:Array(v-A.length+1).join(" ")+A}function h(A,v){for(var R=A.length,S=0;;){var B=A.lastIndexOf(` +var e0=Object.create;var Bo=Object.defineProperty;var t0=Object.getOwnPropertyDescriptor;var i0=Object.getOwnPropertyNames;var n0=Object.getPrototypeOf,s0=Object.prototype.hasOwnProperty;var _i=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),r0=(r,e)=>{for(var t in e)Bo(r,t,{get:e[t],enumerable:!0})},Td=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of i0(e))!s0.call(r,n)&&n!==t&&Bo(r,n,{get:()=>e[n],enumerable:!(i=t0(e,n))||i.enumerable});return r};var nn=(r,e,t)=>(t=r!=null?e0(n0(r)):{},Td(e||!r||!r.__esModule?Bo(t,"default",{value:r,enumerable:!0}):t,r)),o0=r=>Td(Bo({},"__esModule",{value:!0}),r);var Hm=_i(Ji=>{"use strict";var _E=Ji&&Ji.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.getWordsByCategory=Ji.wordList=void 0;Ji.wordList={noun:[{word:"accountant",categories:["profession"]},{word:"ability",categories:["thing"]},{word:"accident",categories:["thing"]},{word:"account",categories:["thing"]},{word:"action",categories:["thing"]},{word:"activity",categories:["thing"]},{word:"actor",categories:["profession"]},{word:"ad",categories:["media"]},{word:"addition",categories:["thing"]},{word:"address",categories:["thing"]},{word:"adult",categories:["people"]},{word:"advantage",categories:["thing"]},{word:"advertisement",categories:["media"]},{word:"afternoon",categories:["time"]},{word:"agency",categories:["thing"]},{word:"agent",categories:["people"]},{word:"air",categories:["thing"]},{word:"airline",categories:["transportation"]},{word:"airplane",categories:["transportation"]},{word:"airport",categories:["transportation","place"]},{word:"alarm",categories:["thing"]},{word:"alligator",categories:["animals"]},{word:"ambulance",categories:["health"]},{word:"analyst",categories:["profession"]},{word:"angle",categories:["thing"]},{word:"animal",categories:["animals"]},{word:"answer",categories:["thing"]},{word:"apartment",categories:["place"]},{word:"apple",categories:["food"]},{word:"application",categories:["thing"]},{word:"appointment",categories:["thing"]},{word:"architect",categories:["profession"]},{word:"argument",categories:["thing"]},{word:"area",categories:["thing"]},{word:"arm",categories:["thing"]},{word:"army",categories:["thing"]},{word:"art",categories:["thing"]},{word:"article",categories:["thing"]},{word:"artist",categories:["profession"]},{word:"australia",categories:["place"]},{word:"author",categories:["profession"]},{word:"autumn",categories:["time"]},{word:"baby",categories:["people","family"]},{word:"baker",categories:["profession"]},{word:"balloon",categories:["thing"]},{word:"banana",categories:["food"]},{word:"barista",categories:["profession"]},{word:"battery",categories:["thing"]},{word:"beach",categories:["place"]},{word:"bear",categories:["animals"]},{word:"beard",categories:["thing"]},{word:"bed",categories:["thing"]},{word:"belgium",categories:["place"]},{word:"bird",categories:["animals"]},{word:"bit",categories:["thing","technology"]},{word:"book",categories:["thing","education"]},{word:"boots",categories:["thing"]},{word:"boy",categories:["people"]},{word:"branch",categories:["thing"]},{word:"breakfast",categories:["thing"]},{word:"brother",categories:["family"]},{word:"businessperson",categories:["people","business"]},{word:"butcher",categories:["profession"]},{word:"byte",categories:["thing","technology"]},{word:"camera",categories:["thing"]},{word:"candle",categories:["thing"]},{word:"car",categories:["transportation"]},{word:"caravan",categories:["transportation"]},{word:"carpenter",categories:["profession"]},{word:"carpet",categories:["thing"]},{word:"cartoon",categories:["media"]},{word:"cat",categories:["animals"]},{word:"chef",categories:["profession"]},{word:"child",categories:["people","family"]},{word:"china",categories:["place"]},{word:"church",categories:["religion"]},{word:"city",categories:["place"]},{word:"coat",categories:["thing"]},{word:"coffeeshop",categories:["place"]},{word:"computer",categories:["thing","technology"]},{word:"continent",categories:["place"]},{word:"controller",categories:["thing","technology"]},{word:"country",categories:["place"]},{word:"cpu",categories:["thing","technology"]},{word:"crayon",categories:["thing"]},{word:"cricket",categories:["animals"]},{word:"crowd",categories:["people"]},{word:"daughter",categories:["family"]},{word:"dawn",categories:["time"]},{word:"daybreak",categories:["time"]},{word:"death",categories:["thing"]},{word:"denmark",categories:["place"]},{word:"dentist",categories:["profession"]},{word:"diamond",categories:["thing"]},{word:"dinner",categories:["food"]},{word:"disease",categories:["thing"]},{word:"doctor",categories:["profession"]},{word:"dog",categories:["animals"]},{word:"dream",categories:["thing"]},{word:"dress",categories:["thing"]},{word:"dusk",categories:["time"]},{word:"easter",categories:["religion"]},{word:"egg",categories:["food"]},{word:"eggplant",categories:["food"]},{word:"egypt",categories:["place"]},{word:"electrician",categories:["profession"]},{word:"elephant",categories:["animals"]},{word:"energy",categories:["thing"]},{word:"engine",categories:["transportation"]},{word:"engineer",categories:["profession"]},{word:"england",categories:["place"]},{word:"eve",categories:["time"]},{word:"evening",categories:["time"]},{word:"eventide",categories:["time"]},{word:"exabyte",categories:["thing","technology"]},{word:"eye",categories:["thing"]},{word:"fall",categories:["time"]},{word:"family",categories:["family"]},{word:"farmer",categories:["profession"]},{word:"father",categories:["people","family"]},{word:"finland",categories:["place"]},{word:"fireman",categories:["profession"]},{word:"fish",categories:["animals"]},{word:"flag",categories:["thing"]},{word:"florist",categories:["profession"]},{word:"flower",categories:["thing"]},{word:"football",categories:["sports"]},{word:"forest",categories:["place"]},{word:"fountain",categories:["thing"]},{word:"france",categories:["place"]},{word:"furniture",categories:["thing"]},{word:"garage",categories:["place"]},{word:"garden",categories:["food"]},{word:"gas",categories:["transportation"]},{word:"ghost",categories:["thing"]},{word:"gigabyte",categories:["thing","technology"]},{word:"girl",categories:["people"]},{word:"glass",categories:["thing"]},{word:"gold",categories:["thing"]},{word:"gpu",categories:["thing","technology"]},{word:"grandmother",categories:["people","family"]},{word:"grass",categories:["thing"]},{word:"greece",categories:["place"]},{word:"guitar",categories:["thing"]},{word:"hair",categories:["thing"]},{word:"hairdresser",categories:["profession"]},{word:"hamburger",categories:["food"]},{word:"helicopter",categories:["transportation"]},{word:"helmet",categories:["thing"]},{word:"holiday",categories:["thing"]},{word:"honey",categories:["food"]},{word:"horse",categories:["animals"]},{word:"hospital",categories:["place"]},{word:"house",categories:["place"]},{word:"hydrogen",categories:["science"]},{word:"ice",categories:["science"]},{word:"insect",categories:["animals"]},{word:"insurance",categories:["thing"]},{word:"intern",categories:["profession"]},{word:"iron",categories:["science"]},{word:"island",categories:["place"]},{word:"jackal",categories:["animals"]},{word:"jelly",categories:["food"]},{word:"jewellery",categories:["thing"]},{word:"jordan",categories:["place"]},{word:"journalist",categories:["profession"]},{word:"joystick",categories:["thing","technology"]},{word:"judge",categories:["profession"]},{word:"juice",categories:["food"]},{word:"kangaroo",categories:["animals"]},{word:"keyboard",categories:["thing","technology"]},{word:"kilobyte",categories:["thing","technology"]},{word:"king",categories:["people"]},{word:"kitchen",categories:["place"]},{word:"kite",categories:["thing"]},{word:"knife",categories:["thing"]},{word:"lamp",categories:["thing"]},{word:"laptop",categories:["thing","technology"]},{word:"lawyer",categories:["profession"]},{word:"leather",categories:["thing"]},{word:"librarian",categories:["profession"]},{word:"library",categories:["place"]},{word:"lifeguard",categories:["profession"]},{word:"lighter",categories:["thing"]},{word:"lion",categories:["animals"]},{word:"lizard",categories:["animals"]},{word:"lock",categories:["thing"]},{word:"london",categories:["place"]},{word:"lunch",categories:["food"]},{word:"machine",categories:["science"]},{word:"magazine",categories:["media"]},{word:"magician",categories:["people"]},{word:"man",categories:["people"]},{word:"manchester",categories:["place"]},{word:"market",categories:["place"]},{word:"match",categories:["thing"]},{word:"mechanic",categories:["profession"]},{word:"megabyte",categories:["thing","technology"]},{word:"memory",categories:["thing","technology"]},{word:"microphone",categories:["thing"]},{word:"midnight",categories:["time"]},{word:"minister",categories:["people","religion"]},{word:"monitor",categories:["thing","technology"]},{word:"monkey",categories:["animals"]},{word:"morn",categories:["time"]},{word:"morning",categories:["time"]},{word:"mother",categories:["people","family"]},{word:"motherboard",categories:["thing","technology"]},{word:"motorcycle",categories:["transportation"]},{word:"mouse",categories:["thing","technology","animals"]},{word:"musician",categories:["profession"]},{word:"nail",categories:["thing"]},{word:"napkin",categories:["thing"]},{word:"needle",categories:["thing"]},{word:"nest",categories:["thing"]},{word:"nigeria",categories:["place"]},{word:"night",categories:["time"]},{word:"nightfall",categories:["time"]},{word:"noon",categories:["time"]},{word:"notebook",categories:["thing"]},{word:"nurse",categories:["profession"]},{word:"ocean",categories:["place"]},{word:"oil",categories:["thing"]},{word:"optician",categories:["profession"]},{word:"orange",categories:["food"]},{word:"oxygen",categories:["science"]},{word:"oyster",categories:["animals"]},{word:"pager",categories:["thing","technology"]},{word:"painter",categories:["profession"]},{word:"painting",categories:["media"]},{word:"park",categories:["place"]},{word:"parrot",categories:["animals"]},{word:"pencil",categories:["thing","education"]},{word:"petabyte",categories:["thing","technology"]},{word:"pharmacist",categories:["profession"]},{word:"photographer",categories:["profession"]},{word:"piano",categories:["thing"]},{word:"pillow",categories:["thing"]},{word:"pilot",categories:["profession"]},{word:"pizza",categories:["food"]},{word:"planet",categories:["science"]},{word:"plastic",categories:["thing"]},{word:"plumber",categories:["profession"]},{word:"policeman",categories:["profession"]},{word:"portugal",categories:["place"]},{word:"postman",categories:["profession"]},{word:"potato",categories:["food"]},{word:"printer",categories:["thing","technology"]},{word:"processor",categories:["thing","technology"]},{word:"psychiatrist",categories:["profession"]},{word:"queen",categories:["people"]},{word:"quill",categories:["thing"]},{word:"rain",categories:["thing"]},{word:"rainbow",categories:["science"]},{word:"raincoat",categories:["thing"]},{word:"ram",categories:["thing","technology"]},{word:"receptionist",categories:["profession"]},{word:"refrigerator",categories:["food"]},{word:"restaurant",categories:["place"]},{word:"river",categories:["thing"]},{word:"rocket",categories:["science"]},{word:"room",categories:["place"]},{word:"rose",categories:["thing"]},{word:"russia",categories:["place"]},{word:"salesclerk",categories:["people","business"]},{word:"salesmen",categories:["profession"]},{word:"sandwich",categories:["food"]},{word:"school",categories:["education"]},{word:"scientist",categories:["profession"]},{word:"scooter",categories:["transportation"]},{word:"secretary",categories:["profession"]},{word:"shampoo",categories:["thing"]},{word:"shoe",categories:["thing"]},{word:"smartphone",categories:["thing","technology"]},{word:"soccer",categories:["sports"]},{word:"solstice",categories:["time"]},{word:"spoon",categories:["thing"]},{word:"spring",categories:["time"]},{word:"state",categories:["place"]},{word:"stone",categories:["thing"]},{word:"student",categories:["people","education"]},{word:"sugar",categories:["food"]},{word:"summer",categories:["time"]},{word:"sundown",categories:["time"]},{word:"sunset",categories:["time"]},{word:"sweden",categories:["place"]},{word:"table",categories:["thing"]},{word:"tailor",categories:["profession"]},{word:"teacher",categories:["people","education","profession"]},{word:"teenager",categories:["people","family"]},{word:"telephone",categories:["thing"]},{word:"television",categories:["media"]},{word:"tent",categories:["thing"]},{word:"terabyte",categories:["thing","technology"]},{word:"thailand",categories:["place"]},{word:"tiger",categories:["animals"]},{word:"toddler",categories:["people","family"]},{word:"tomato",categories:["food"]},{word:"toothbrush",categories:["thing"]},{word:"traffic",categories:["thing"]},{word:"train",categories:["transportation"]},{word:"translator",categories:["profession"]},{word:"truck",categories:["thing","transportation"]},{word:"twilight",categories:["time"]},{word:"uganda",categories:["place"]},{word:"umbrella",categories:["thing"]},{word:"van",categories:["transportation"]},{word:"vase",categories:["thing"]},{word:"vegetable",categories:["food"]},{word:"vr",categories:["thing","technology"]},{word:"vulture",categories:["animals"]},{word:"waiter",categories:["profession"]},{word:"waitress",categories:["profession"]},{word:"wall",categories:["thing"]},{word:"whale",categories:["animals"]},{word:"window",categories:["thing"]},{word:"winter",categories:["time"]},{word:"wire",categories:["thing"]},{word:"wolf",categories:["animals"]},{word:"woman",categories:["people"]},{word:"xylophone",categories:["thing"]},{word:"yacht",categories:["transportation"]},{word:"yak",categories:["animals"]},{word:"yottabyte",categories:["thing","technology"]},{word:"zebra",categories:["animals"]},{word:"zettabyte",categories:["thing","technology"]},{word:"zoo",categories:["animals"]}],adjective:[{word:"abandoned",categories:["condition"]},{word:"abiding",categories:["personality"]},{word:"able",categories:["condition"]},{word:"abrasive",categories:["condition","personality"]},{word:"abnormal",categories:["condition"]},{word:"absurd",categories:["condition"]},{word:"abundant",categories:["quantity"]},{word:"acceptable",categories:["condition"]},{word:"acidic",categories:["taste"]},{word:"acoustic",categories:["sounds"]},{word:"acrid",categories:["condition"]},{word:"adamant",categories:["personality"]},{word:"adorable",categories:["personality"]},{word:"adventurous",categories:["personality"]},{word:"aggressive",categories:["personality"]},{word:"agitated",categories:["personality"]},{word:"agreeable",categories:["personality"]},{word:"alert",categories:["condition"]},{word:"alive",categories:["condition"]},{word:"aloof",categories:["personality"]},{word:"ambitious",categories:["personality"]},{word:"ancient",categories:["time"]},{word:"angry",categories:["personality"]},{word:"annoyed",categories:["personality"]},{word:"antsy",categories:["personality"]},{word:"anxious",categories:["personality"]},{word:"appalling",categories:["personality"]},{word:"appetizing",categories:["taste"]},{word:"apprehensive",categories:["personality"]},{word:"arrogant",categories:["personality"]},{word:"ashamed",categories:["personality"]},{word:"astonishing",categories:["personality"]},{word:"attractive",categories:["appearance"]},{word:"average",categories:["appearance"]},{word:"bad",categories:["condition"]},{word:"bald",categories:["appearance"]},{word:"bashful",categories:["personality"]},{word:"beautiful",categories:["appearance"]},{word:"beefy",categories:["appearance"]},{word:"belligerent",categories:["personality"]},{word:"bent",categories:["condition"]},{word:"best",categories:["condition"]},{word:"better",categories:["condition"]},{word:"bewildered",categories:["personality"]},{word:"big",categories:["size"]},{word:"billions",categories:["quantity"]},{word:"billowy",categories:["appearance"]},{word:"bitter",categories:["taste"]},{word:"black",categories:["color"]},{word:"bland",categories:["taste"]},{word:"blue",categories:["color"]},{word:"blushing",categories:["appearance"]},{word:"bored",categories:["personality"]},{word:"boring",categories:["personality"]},{word:"boundless",categories:["personality"]},{word:"brainy",categories:["personality"]},{word:"brash",categories:["personality"]},{word:"brave",categories:["personality"]},{word:"breezy",categories:["touch"]},{word:"brief",categories:["time"]},{word:"bright",categories:["appearance"]},{word:"broad",categories:["shapes"]},{word:"broken",categories:["condition"]},{word:"brown",categories:["color"]},{word:"bulky",categories:["appearance"]},{word:"bumpy",categories:["touch"]},{word:"burly",categories:["appearance"]},{word:"busy",categories:["personality"]},{word:"cagey",categories:["personality"]},{word:"calm",categories:["personality"]},{word:"callous",categories:["personality"]},{word:"careful",categories:["condition"]},{word:"chilly",categories:["touch"]},{word:"chubby",categories:["appearance"]},{word:"clean",categories:["appearance"]},{word:"clever",categories:["condition"]},{word:"clumsy",categories:["personality"]},{word:"cold",categories:["touch"]},{word:"colossal",categories:["size"]},{word:"cool",categories:["touch"]},{word:"crashing",categories:["sounds"]},{word:"creamy",categories:["taste"]},{word:"crooked",categories:["shapes"]},{word:"cuddly",categories:["touch"]},{word:"curved",categories:["shapes"]},{word:"damaged",categories:["touch"]},{word:"damp",categories:["touch"]},{word:"dazzling",categories:["appearance"]},{word:"dead",categories:["condition"]},{word:"deafening",categories:["sounds"]},{word:"deep",categories:["shapes"]},{word:"defeated",categories:["personality"]},{word:"delicious",categories:["taste"]},{word:"delightful",categories:["personality"]},{word:"dirty",categories:["touch"]},{word:"disgusting",categories:["taste"]},{word:"drab",categories:["appearance"]},{word:"dry",categories:["touch"]},{word:"eager",categories:["personality"]},{word:"early",categories:["time"]},{word:"easy",categories:["condition"]},{word:"echoing",categories:["sounds"]},{word:"elegant",categories:["appearance"]},{word:"embarrassed",categories:["personality"]},{word:"enough",categories:["quantity"]},{word:"faint",categories:["sounds"]},{word:"faithful",categories:["personality"]},{word:"famous",categories:["condition"]},{word:"fancy",categories:["appearance"]},{word:"fast",categories:["time"]},{word:"fat",categories:["size"]},{word:"few",categories:["quantity"]},{word:"fierce",categories:["personality"]},{word:"fit",categories:["appearance"]},{word:"flabby",categories:["appearance"]},{word:"flaky",categories:["touch"]},{word:"flat",categories:["shapes"]},{word:"fluffy",categories:["touch"]},{word:"freezing",categories:["touch"]},{word:"fresh",categories:["taste"]},{word:"full",categories:["quantity"]},{word:"future",categories:["time"]},{word:"gentle",categories:["personality"]},{word:"gifted",categories:["condition"]},{word:"gigantic",categories:["size"]},{word:"glamorous",categories:["appearance"]},{word:"gorgeous",categories:["appearance"]},{word:"gray",categories:["color"]},{word:"greasy",categories:["touch","taste"]},{word:"great",categories:["size"]},{word:"green",categories:["color"]},{word:"grumpy",categories:["personality"]},{word:"hallowed",categories:["condition"]},{word:"handsome",categories:["appearance"]},{word:"happy",categories:["personality"]},{word:"harsh",categories:["sounds"]},{word:"helpful",categories:["condition"]},{word:"helpless",categories:["personality"]},{word:"high",categories:["shapes"]},{word:"hissing",categories:["sounds"]},{word:"hollow",categories:["shapes"]},{word:"hot",categories:["touch","taste"]},{word:"howling",categories:["sounds"]},{word:"huge",categories:["size"]},{word:"hundreds",categories:["quantity"]},{word:"icy",categories:["touch"]},{word:"immense",categories:["size"]},{word:"important",categories:["condition"]},{word:"incalculable",categories:["quantity"]},{word:"inexpensive",categories:["condition"]},{word:"itchy",categories:["personality"]},{word:"jealous",categories:["personality"]},{word:"jolly",categories:["personality"]},{word:"juicy",categories:["taste"]},{word:"kind",categories:["personality"]},{word:"large",categories:["size"]},{word:"late",categories:["time"]},{word:"lazy",categories:["personality"]},{word:"lemon",categories:["color"]},{word:"limited",categories:["quantity"]},{word:"little",categories:["size","quantity"]},{word:"lively",categories:["personality"]},{word:"long",categories:["time","appearance"]},{word:"loose",categories:["touch"]},{word:"loud",categories:["sounds"]},{word:"low",categories:["shapes"]},{word:"magnificent",categories:["appearance"]},{word:"mammoth",categories:["size"]},{word:"mango",categories:["color"]},{word:"many",categories:["quantity"]},{word:"massive",categories:["size"]},{word:"mealy",categories:["condition"]},{word:"melodic",categories:["sounds"]},{word:"melted",categories:["touch"]},{word:"microscopic",categories:["size"]},{word:"millions",categories:["quantity"]},{word:"miniature",categories:["size"]},{word:"modern",categories:["time"]},{word:"moldy",categories:["taste"]},{word:"most",categories:["quantity"]},{word:"muscular",categories:["appearance"]},{word:"mushy",categories:["condition"]},{word:"mysterious",categories:["personality"]},{word:"narrow",categories:["shapes"]},{word:"nervous",categories:["personality"]},{word:"nice",categories:["personality"]},{word:"noisy",categories:["sounds"]},{word:"numerous",categories:["quantity"]},{word:"nutritious",categories:["taste"]},{word:"nutty",categories:["taste"]},{word:"obedient",categories:["personality"]},{word:"obnoxious",categories:["personality"]},{word:"odd",categories:["condition"]},{word:"old",categories:["time"]},{word:"orange",categories:["color"]},{word:"panicky",categories:["personality"]},{word:"petite",categories:["size"]},{word:"pitiful",categories:["personality"]},{word:"plain",categories:["appearance"]},{word:"plump",categories:["appearance"]},{word:"polite",categories:["personality"]},{word:"poor",categories:["condition"]},{word:"powerful",categories:["condition"]},{word:"prehistoric",categories:["time"]},{word:"prickly",categories:["touch"]},{word:"proud",categories:["personality"]},{word:"puny",categories:["size"]},{word:"purple",categories:["color"]},{word:"purring",categories:["sounds"]},{word:"putrid",categories:["taste"]},{word:"quaint",categories:["appearance"]},{word:"quick",categories:["time"]},{word:"quiet",categories:["sounds"]},{word:"rancid",categories:["taste"]},{word:"rapid",categories:["time"]},{word:"rapping",categories:["sounds"]},{word:"raspy",categories:["sounds"]},{word:"red",categories:["color"]},{word:"refined",categories:["shapes"]},{word:"repulsive",categories:["personality"]},{word:"rhythmic",categories:["sounds"]},{word:"rich",categories:["condition"]},{word:"ripe",categories:["taste"]},{word:"rotten",categories:["taste"]},{word:"rough",categories:["touch"]},{word:"round",categories:["shapes"]},{word:"salmon",categories:["color"]},{word:"salty",categories:["taste"]},{word:"savory",categories:["taste"]},{word:"scarce",categories:["quantity"]},{word:"scary",categories:["personality"]},{word:"scrawny",categories:["size"]},{word:"screeching",categories:["sounds"]},{word:"scruffy",categories:["appearance"]},{word:"shaggy",categories:["touch"]},{word:"shallow",categories:["shapes"]},{word:"shapely",categories:["appearance"]},{word:"sharp",categories:["touch"]},{word:"short",categories:["size","appearance","time"]},{word:"shrilling",categories:["sounds"]},{word:"shy",categories:["condition"]},{word:"silly",categories:["personality"]},{word:"skinny",categories:["appearance","shapes"]},{word:"slimy",categories:["touch"]},{word:"slow",categories:["time"]},{word:"small",categories:["size"]},{word:"some",categories:["quantity"]},{word:"sour",categories:["taste"]},{word:"sparse",categories:["quantity"]},{word:"spicy",categories:["taste"]},{word:"spoiled",categories:["taste"]},{word:"square",categories:["shapes"]},{word:"squeaking",categories:["sounds"]},{word:"stale",categories:["taste"]},{word:"steep",categories:["shapes"]},{word:"sticky",categories:["touch"]},{word:"stocky",categories:["appearance"]},{word:"straight",categories:["shapes"]},{word:"strong",categories:["touch"]},{word:"substantial",categories:["quantity"]},{word:"sweet",categories:["taste"]},{word:"swift",categories:["time"]},{word:"tall",categories:["size"]},{word:"tangy",categories:["taste"]},{word:"tart",categories:["taste"]},{word:"tasteless",categories:["taste"]},{word:"tasty",categories:["taste"]},{word:"teeny",categories:["size"]},{word:"tender",categories:["condition"]},{word:"thankful",categories:["personality"]},{word:"thoughtless",categories:["personality"]},{word:"thousands",categories:["quantity"]},{word:"thundering",categories:["sounds"]},{word:"tight",categories:["touch"]},{word:"tinkling",categories:["sounds"]},{word:"tiny",categories:["size"]},{word:"ugly",categories:["appearance"]},{word:"uneven",categories:["touch"]},{word:"unimportant",categories:["condition"]},{word:"uninterested",categories:["condition"]},{word:"unkempt",categories:["appearance"]},{word:"unsightly",categories:["appearance"]},{word:"uptight",categories:["personality"]},{word:"vast",categories:["condition"]},{word:"victorious",categories:["personality"]},{word:"wailing",categories:["sounds"]},{word:"warm",categories:["touch"]},{word:"weak",categories:["touch"]},{word:"wet",categories:["touch"]},{word:"whining",categories:["sounds"]},{word:"whispering",categories:["sounds"]},{word:"white",categories:["color"]},{word:"wide",categories:["shapes"]},{word:"witty",categories:["personality"]},{word:"wonderful",categories:["personality"]},{word:"wooden",categories:["touch"]},{word:"worried",categories:["personality"]},{word:"wrong",categories:["condition"]},{word:"yellow",categories:["color"]},{word:"young",categories:["time"]},{word:"yummy",categories:["taste"]},{word:"zealous",categories:["personality"]}]};function EE(r,e){var t,i;e===void 0&&(e=[]);var n=new Set(e),s=[];try{for(var o=_E(Ji.wordList[r]),a=o.next();!a.done;a=o.next()){var l=a.value;(e.length===0||l.categories.some(function(c){return n.has(c)}))&&s.push(l.word)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return s}Ji.getWordsByCategory=EE});var Wm=_i(Tn=>{"use strict";var Vl=Tn&&Tn.__assign||function(){return Vl=Object.assign||function(r){for(var e,t=1,i=arguments.length;t{"use strict";var Kh=Object.defineProperty,DE=Object.getOwnPropertyDescriptor,TE=Object.getOwnPropertyNames,CE=Object.prototype.hasOwnProperty,RE=(r,e)=>{for(var t in e)Kh(r,t,{get:e[t],enumerable:!0})},FE=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of TE(e))!CE.call(r,n)&&n!==t&&Kh(r,n,{get:()=>e[n],enumerable:!(i=DE(e,n))||i.enumerable});return r},LE=r=>FE(Kh({},"__esModule",{value:!0}),r),Xm={};RE(Xm,{FileInputSuggest:()=>PE,FolderInputSuggest:()=>BE,FuzzyInputSuggest:()=>Qh,setNodeIcon:()=>kE});Ym.exports=LE(Xm);var Jh=require("obsidian"),Qh=class extends Jh.AbstractInputSuggest{constructor(r,e,t){super(r,e.inputEl),this.items=t}getSuggestions(r){let e=(0,Jh.prepareSimpleSearch)(r),t=[];for(let i of this.items){let n=e(this.getItemText(i));n&&t.push({item:i,match:n})}return t}renderSuggestion(r,e){e.addClass("mod-complex");let t=e.createDiv({cls:"suggestion-content"});if(!r?.item){t.setText("No match found"),t.parentElement?.addClass("is-selected");return}let i=t.createDiv("suggestion-title");this.renderTitle(i,r);let n=t.createDiv("suggestion-note");this.renderNote(n,r)}renderMatches(r,e,t,i){(0,Jh.renderMatches)(r,e,t,i)}},$m=require("obsidian"),BE=class extends Qh{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:i}=e;(0,$m.renderMatches)(r,t.path,i.matches)}renderTitle(r,e){let{item:t,match:i}=e;(0,$m.renderMatches)(r,t.name,i.matches,t.path.length-t.name.length)}},jm=require("obsidian"),PE=class extends Qh{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:i}=e;(0,jm.renderMatches)(r,t.path,i.matches)}renderTitle(r,e){let{item:t,match:i}=e;(0,jm.renderMatches)(r,t.name,i.matches,t.path.length-t.name.length)}},IE=require("obsidian"),NE={"has-node-icon":"helpers_has-node-icon","x-small":"helpers_x-small",small:"helpers_small",medium:"helpers_medium",large:"helpers_large","x-large":"helpers_x-large"};function kE(r,e){r.addClass(NE["has-node-icon"]),(0,IE.setIcon)(r,e)}});var Qm=_i((Km,Hl)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof Hl=="object"&&Hl.exports?Hl.exports=e():r.moo=e()})(Km,function(){"use strict";var r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function i(A){return A&&e.call(A)==="[object RegExp]"}function n(A){return A&&typeof A=="object"&&!i(A)&&!Array.isArray(A)}function s(A){return A.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function o(A){var v=new RegExp("|"+A);return v.exec("").length-1}function a(A){return"("+A+")"}function l(A){if(!A.length)return"(?!)";var v=A.map(function(R){return"(?:"+R+")"}).join("|");return"(?:"+v+")"}function c(A){if(typeof A=="string")return"(?:"+s(A)+")";if(i(A)){if(A.ignoreCase)throw new Error("RegExp /i flag not allowed");if(A.global)throw new Error("RegExp /g flag is implied");if(A.sticky)throw new Error("RegExp /y flag is implied");if(A.multiline)throw new Error("RegExp /m flag is implied");return A.source}else throw new Error("Not a pattern: "+A)}function u(A,v){return A.length>v?A:Array(v-A.length+1).join(" ")+A}function h(A,v){for(var R=A.length,S=0;;){var B=A.lastIndexOf(` `,R-1);if(B===-1||(S++,R=B,S===v)||R===0)break}var L=S0)throw new Error("RegExp has capture groups: "+H+` Use (?: \u2026 ) instead`);if(!V.lineBreaks&&H.test(` -`))throw new Error("Rule should declare lineBreaks: "+H);N.push(a(ae))}}var ue=R&&R.fallback,we=t&&!ue?"ym":"gm",oe=t||ue?"":"|";L===!0&&(we+="u");var Ce=new RegExp(l(N)+oe,we);return{regexp:Ce,groups:C,fast:S,error:R||x}}function f(A){var v=g(y(A));return new D({start:v},"start")}function E(A,v,R){var S=A&&(A.push||A.next);if(S&&!R[S])throw new Error("Missing state '"+S+"' (in token '"+A.defaultType+"' of state '"+v+"')");if(A&&A.pop&&+A.pop!=1)throw new Error("pop must be 1 (in token '"+A.defaultType+"' of state '"+v+"')")}function w(A,v){var R=A.$all?y(A.$all):[];delete A.$all;var S=Object.getOwnPropertyNames(A);v||(v=S[0]);for(var B=Object.create(null),L=0;L{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});require("obsidian");var g_=r=>{var e;return r?(e=r.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},y_=r=>r.plugins.enabledPlugins.has("dataview");Tl.getAPI=g_;Tl.isPluginEnabled=y_});var Rm=Kn(Wi=>{"use strict";var cE=Wi&&Wi.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.getWordsByCategory=Wi.wordList=void 0;Wi.wordList={noun:[{word:"accountant",categories:["profession"]},{word:"ability",categories:["thing"]},{word:"accident",categories:["thing"]},{word:"account",categories:["thing"]},{word:"action",categories:["thing"]},{word:"activity",categories:["thing"]},{word:"actor",categories:["profession"]},{word:"ad",categories:["media"]},{word:"addition",categories:["thing"]},{word:"address",categories:["thing"]},{word:"adult",categories:["people"]},{word:"advantage",categories:["thing"]},{word:"advertisement",categories:["media"]},{word:"afternoon",categories:["time"]},{word:"agency",categories:["thing"]},{word:"agent",categories:["people"]},{word:"air",categories:["thing"]},{word:"airline",categories:["transportation"]},{word:"airplane",categories:["transportation"]},{word:"airport",categories:["transportation","place"]},{word:"alarm",categories:["thing"]},{word:"alligator",categories:["animals"]},{word:"ambulance",categories:["health"]},{word:"analyst",categories:["profession"]},{word:"angle",categories:["thing"]},{word:"animal",categories:["animals"]},{word:"answer",categories:["thing"]},{word:"apartment",categories:["place"]},{word:"apple",categories:["food"]},{word:"application",categories:["thing"]},{word:"appointment",categories:["thing"]},{word:"architect",categories:["profession"]},{word:"argument",categories:["thing"]},{word:"area",categories:["thing"]},{word:"arm",categories:["thing"]},{word:"army",categories:["thing"]},{word:"art",categories:["thing"]},{word:"article",categories:["thing"]},{word:"artist",categories:["profession"]},{word:"australia",categories:["place"]},{word:"author",categories:["profession"]},{word:"autumn",categories:["time"]},{word:"baby",categories:["people","family"]},{word:"baker",categories:["profession"]},{word:"balloon",categories:["thing"]},{word:"banana",categories:["food"]},{word:"barista",categories:["profession"]},{word:"battery",categories:["thing"]},{word:"beach",categories:["place"]},{word:"bear",categories:["animals"]},{word:"beard",categories:["thing"]},{word:"bed",categories:["thing"]},{word:"belgium",categories:["place"]},{word:"bird",categories:["animals"]},{word:"bit",categories:["thing","technology"]},{word:"book",categories:["thing","education"]},{word:"boots",categories:["thing"]},{word:"boy",categories:["people"]},{word:"branch",categories:["thing"]},{word:"breakfast",categories:["thing"]},{word:"brother",categories:["family"]},{word:"businessperson",categories:["people","business"]},{word:"butcher",categories:["profession"]},{word:"byte",categories:["thing","technology"]},{word:"camera",categories:["thing"]},{word:"candle",categories:["thing"]},{word:"car",categories:["transportation"]},{word:"caravan",categories:["transportation"]},{word:"carpenter",categories:["profession"]},{word:"carpet",categories:["thing"]},{word:"cartoon",categories:["media"]},{word:"cat",categories:["animals"]},{word:"chef",categories:["profession"]},{word:"child",categories:["people","family"]},{word:"china",categories:["place"]},{word:"church",categories:["religion"]},{word:"city",categories:["place"]},{word:"coat",categories:["thing"]},{word:"coffeeshop",categories:["place"]},{word:"computer",categories:["thing","technology"]},{word:"continent",categories:["place"]},{word:"controller",categories:["thing","technology"]},{word:"country",categories:["place"]},{word:"cpu",categories:["thing","technology"]},{word:"crayon",categories:["thing"]},{word:"cricket",categories:["animals"]},{word:"crowd",categories:["people"]},{word:"daughter",categories:["family"]},{word:"dawn",categories:["time"]},{word:"daybreak",categories:["time"]},{word:"death",categories:["thing"]},{word:"denmark",categories:["place"]},{word:"dentist",categories:["profession"]},{word:"diamond",categories:["thing"]},{word:"dinner",categories:["food"]},{word:"disease",categories:["thing"]},{word:"doctor",categories:["profession"]},{word:"dog",categories:["animals"]},{word:"dream",categories:["thing"]},{word:"dress",categories:["thing"]},{word:"dusk",categories:["time"]},{word:"easter",categories:["religion"]},{word:"egg",categories:["food"]},{word:"eggplant",categories:["food"]},{word:"egypt",categories:["place"]},{word:"electrician",categories:["profession"]},{word:"elephant",categories:["animals"]},{word:"energy",categories:["thing"]},{word:"engine",categories:["transportation"]},{word:"engineer",categories:["profession"]},{word:"england",categories:["place"]},{word:"eve",categories:["time"]},{word:"evening",categories:["time"]},{word:"eventide",categories:["time"]},{word:"exabyte",categories:["thing","technology"]},{word:"eye",categories:["thing"]},{word:"fall",categories:["time"]},{word:"family",categories:["family"]},{word:"farmer",categories:["profession"]},{word:"father",categories:["people","family"]},{word:"finland",categories:["place"]},{word:"fireman",categories:["profession"]},{word:"fish",categories:["animals"]},{word:"flag",categories:["thing"]},{word:"florist",categories:["profession"]},{word:"flower",categories:["thing"]},{word:"football",categories:["sports"]},{word:"forest",categories:["place"]},{word:"fountain",categories:["thing"]},{word:"france",categories:["place"]},{word:"furniture",categories:["thing"]},{word:"garage",categories:["place"]},{word:"garden",categories:["food"]},{word:"gas",categories:["transportation"]},{word:"ghost",categories:["thing"]},{word:"gigabyte",categories:["thing","technology"]},{word:"girl",categories:["people"]},{word:"glass",categories:["thing"]},{word:"gold",categories:["thing"]},{word:"gpu",categories:["thing","technology"]},{word:"grandmother",categories:["people","family"]},{word:"grass",categories:["thing"]},{word:"greece",categories:["place"]},{word:"guitar",categories:["thing"]},{word:"hair",categories:["thing"]},{word:"hairdresser",categories:["profession"]},{word:"hamburger",categories:["food"]},{word:"helicopter",categories:["transportation"]},{word:"helmet",categories:["thing"]},{word:"holiday",categories:["thing"]},{word:"honey",categories:["food"]},{word:"horse",categories:["animals"]},{word:"hospital",categories:["place"]},{word:"house",categories:["place"]},{word:"hydrogen",categories:["science"]},{word:"ice",categories:["science"]},{word:"insect",categories:["animals"]},{word:"insurance",categories:["thing"]},{word:"intern",categories:["profession"]},{word:"iron",categories:["science"]},{word:"island",categories:["place"]},{word:"jackal",categories:["animals"]},{word:"jelly",categories:["food"]},{word:"jewellery",categories:["thing"]},{word:"jordan",categories:["place"]},{word:"journalist",categories:["profession"]},{word:"joystick",categories:["thing","technology"]},{word:"judge",categories:["profession"]},{word:"juice",categories:["food"]},{word:"kangaroo",categories:["animals"]},{word:"keyboard",categories:["thing","technology"]},{word:"kilobyte",categories:["thing","technology"]},{word:"king",categories:["people"]},{word:"kitchen",categories:["place"]},{word:"kite",categories:["thing"]},{word:"knife",categories:["thing"]},{word:"lamp",categories:["thing"]},{word:"laptop",categories:["thing","technology"]},{word:"lawyer",categories:["profession"]},{word:"leather",categories:["thing"]},{word:"librarian",categories:["profession"]},{word:"library",categories:["place"]},{word:"lifeguard",categories:["profession"]},{word:"lighter",categories:["thing"]},{word:"lion",categories:["animals"]},{word:"lizard",categories:["animals"]},{word:"lock",categories:["thing"]},{word:"london",categories:["place"]},{word:"lunch",categories:["food"]},{word:"machine",categories:["science"]},{word:"magazine",categories:["media"]},{word:"magician",categories:["people"]},{word:"man",categories:["people"]},{word:"manchester",categories:["place"]},{word:"market",categories:["place"]},{word:"match",categories:["thing"]},{word:"mechanic",categories:["profession"]},{word:"megabyte",categories:["thing","technology"]},{word:"memory",categories:["thing","technology"]},{word:"microphone",categories:["thing"]},{word:"midnight",categories:["time"]},{word:"minister",categories:["people","religion"]},{word:"monitor",categories:["thing","technology"]},{word:"monkey",categories:["animals"]},{word:"morn",categories:["time"]},{word:"morning",categories:["time"]},{word:"mother",categories:["people","family"]},{word:"motherboard",categories:["thing","technology"]},{word:"motorcycle",categories:["transportation"]},{word:"mouse",categories:["thing","technology","animals"]},{word:"musician",categories:["profession"]},{word:"nail",categories:["thing"]},{word:"napkin",categories:["thing"]},{word:"needle",categories:["thing"]},{word:"nest",categories:["thing"]},{word:"nigeria",categories:["place"]},{word:"night",categories:["time"]},{word:"nightfall",categories:["time"]},{word:"noon",categories:["time"]},{word:"notebook",categories:["thing"]},{word:"nurse",categories:["profession"]},{word:"ocean",categories:["place"]},{word:"oil",categories:["thing"]},{word:"optician",categories:["profession"]},{word:"orange",categories:["food"]},{word:"oxygen",categories:["science"]},{word:"oyster",categories:["animals"]},{word:"pager",categories:["thing","technology"]},{word:"painter",categories:["profession"]},{word:"painting",categories:["media"]},{word:"park",categories:["place"]},{word:"parrot",categories:["animals"]},{word:"pencil",categories:["thing","education"]},{word:"petabyte",categories:["thing","technology"]},{word:"pharmacist",categories:["profession"]},{word:"photographer",categories:["profession"]},{word:"piano",categories:["thing"]},{word:"pillow",categories:["thing"]},{word:"pilot",categories:["profession"]},{word:"pizza",categories:["food"]},{word:"planet",categories:["science"]},{word:"plastic",categories:["thing"]},{word:"plumber",categories:["profession"]},{word:"policeman",categories:["profession"]},{word:"portugal",categories:["place"]},{word:"postman",categories:["profession"]},{word:"potato",categories:["food"]},{word:"printer",categories:["thing","technology"]},{word:"processor",categories:["thing","technology"]},{word:"psychiatrist",categories:["profession"]},{word:"queen",categories:["people"]},{word:"quill",categories:["thing"]},{word:"rain",categories:["thing"]},{word:"rainbow",categories:["science"]},{word:"raincoat",categories:["thing"]},{word:"ram",categories:["thing","technology"]},{word:"receptionist",categories:["profession"]},{word:"refrigerator",categories:["food"]},{word:"restaurant",categories:["place"]},{word:"river",categories:["thing"]},{word:"rocket",categories:["science"]},{word:"room",categories:["place"]},{word:"rose",categories:["thing"]},{word:"russia",categories:["place"]},{word:"salesclerk",categories:["people","business"]},{word:"salesmen",categories:["profession"]},{word:"sandwich",categories:["food"]},{word:"school",categories:["education"]},{word:"scientist",categories:["profession"]},{word:"scooter",categories:["transportation"]},{word:"secretary",categories:["profession"]},{word:"shampoo",categories:["thing"]},{word:"shoe",categories:["thing"]},{word:"smartphone",categories:["thing","technology"]},{word:"soccer",categories:["sports"]},{word:"solstice",categories:["time"]},{word:"spoon",categories:["thing"]},{word:"spring",categories:["time"]},{word:"state",categories:["place"]},{word:"stone",categories:["thing"]},{word:"student",categories:["people","education"]},{word:"sugar",categories:["food"]},{word:"summer",categories:["time"]},{word:"sundown",categories:["time"]},{word:"sunset",categories:["time"]},{word:"sweden",categories:["place"]},{word:"table",categories:["thing"]},{word:"tailor",categories:["profession"]},{word:"teacher",categories:["people","education","profession"]},{word:"teenager",categories:["people","family"]},{word:"telephone",categories:["thing"]},{word:"television",categories:["media"]},{word:"tent",categories:["thing"]},{word:"terabyte",categories:["thing","technology"]},{word:"thailand",categories:["place"]},{word:"tiger",categories:["animals"]},{word:"toddler",categories:["people","family"]},{word:"tomato",categories:["food"]},{word:"toothbrush",categories:["thing"]},{word:"traffic",categories:["thing"]},{word:"train",categories:["transportation"]},{word:"translator",categories:["profession"]},{word:"truck",categories:["thing","transportation"]},{word:"twilight",categories:["time"]},{word:"uganda",categories:["place"]},{word:"umbrella",categories:["thing"]},{word:"van",categories:["transportation"]},{word:"vase",categories:["thing"]},{word:"vegetable",categories:["food"]},{word:"vr",categories:["thing","technology"]},{word:"vulture",categories:["animals"]},{word:"waiter",categories:["profession"]},{word:"waitress",categories:["profession"]},{word:"wall",categories:["thing"]},{word:"whale",categories:["animals"]},{word:"window",categories:["thing"]},{word:"winter",categories:["time"]},{word:"wire",categories:["thing"]},{word:"wolf",categories:["animals"]},{word:"woman",categories:["people"]},{word:"xylophone",categories:["thing"]},{word:"yacht",categories:["transportation"]},{word:"yak",categories:["animals"]},{word:"yottabyte",categories:["thing","technology"]},{word:"zebra",categories:["animals"]},{word:"zettabyte",categories:["thing","technology"]},{word:"zoo",categories:["animals"]}],adjective:[{word:"abandoned",categories:["condition"]},{word:"abiding",categories:["personality"]},{word:"able",categories:["condition"]},{word:"abrasive",categories:["condition","personality"]},{word:"abnormal",categories:["condition"]},{word:"absurd",categories:["condition"]},{word:"abundant",categories:["quantity"]},{word:"acceptable",categories:["condition"]},{word:"acidic",categories:["taste"]},{word:"acoustic",categories:["sounds"]},{word:"acrid",categories:["condition"]},{word:"adamant",categories:["personality"]},{word:"adorable",categories:["personality"]},{word:"adventurous",categories:["personality"]},{word:"aggressive",categories:["personality"]},{word:"agitated",categories:["personality"]},{word:"agreeable",categories:["personality"]},{word:"alert",categories:["condition"]},{word:"alive",categories:["condition"]},{word:"aloof",categories:["personality"]},{word:"ambitious",categories:["personality"]},{word:"ancient",categories:["time"]},{word:"angry",categories:["personality"]},{word:"annoyed",categories:["personality"]},{word:"antsy",categories:["personality"]},{word:"anxious",categories:["personality"]},{word:"appalling",categories:["personality"]},{word:"appetizing",categories:["taste"]},{word:"apprehensive",categories:["personality"]},{word:"arrogant",categories:["personality"]},{word:"ashamed",categories:["personality"]},{word:"astonishing",categories:["personality"]},{word:"attractive",categories:["appearance"]},{word:"average",categories:["appearance"]},{word:"bad",categories:["condition"]},{word:"bald",categories:["appearance"]},{word:"bashful",categories:["personality"]},{word:"beautiful",categories:["appearance"]},{word:"beefy",categories:["appearance"]},{word:"belligerent",categories:["personality"]},{word:"bent",categories:["condition"]},{word:"best",categories:["condition"]},{word:"better",categories:["condition"]},{word:"bewildered",categories:["personality"]},{word:"big",categories:["size"]},{word:"billions",categories:["quantity"]},{word:"billowy",categories:["appearance"]},{word:"bitter",categories:["taste"]},{word:"black",categories:["color"]},{word:"bland",categories:["taste"]},{word:"blue",categories:["color"]},{word:"blushing",categories:["appearance"]},{word:"bored",categories:["personality"]},{word:"boring",categories:["personality"]},{word:"boundless",categories:["personality"]},{word:"brainy",categories:["personality"]},{word:"brash",categories:["personality"]},{word:"brave",categories:["personality"]},{word:"breezy",categories:["touch"]},{word:"brief",categories:["time"]},{word:"bright",categories:["appearance"]},{word:"broad",categories:["shapes"]},{word:"broken",categories:["condition"]},{word:"brown",categories:["color"]},{word:"bulky",categories:["appearance"]},{word:"bumpy",categories:["touch"]},{word:"burly",categories:["appearance"]},{word:"busy",categories:["personality"]},{word:"cagey",categories:["personality"]},{word:"calm",categories:["personality"]},{word:"callous",categories:["personality"]},{word:"careful",categories:["condition"]},{word:"chilly",categories:["touch"]},{word:"chubby",categories:["appearance"]},{word:"clean",categories:["appearance"]},{word:"clever",categories:["condition"]},{word:"clumsy",categories:["personality"]},{word:"cold",categories:["touch"]},{word:"colossal",categories:["size"]},{word:"cool",categories:["touch"]},{word:"crashing",categories:["sounds"]},{word:"creamy",categories:["taste"]},{word:"crooked",categories:["shapes"]},{word:"cuddly",categories:["touch"]},{word:"curved",categories:["shapes"]},{word:"damaged",categories:["touch"]},{word:"damp",categories:["touch"]},{word:"dazzling",categories:["appearance"]},{word:"dead",categories:["condition"]},{word:"deafening",categories:["sounds"]},{word:"deep",categories:["shapes"]},{word:"defeated",categories:["personality"]},{word:"delicious",categories:["taste"]},{word:"delightful",categories:["personality"]},{word:"dirty",categories:["touch"]},{word:"disgusting",categories:["taste"]},{word:"drab",categories:["appearance"]},{word:"dry",categories:["touch"]},{word:"eager",categories:["personality"]},{word:"early",categories:["time"]},{word:"easy",categories:["condition"]},{word:"echoing",categories:["sounds"]},{word:"elegant",categories:["appearance"]},{word:"embarrassed",categories:["personality"]},{word:"enough",categories:["quantity"]},{word:"faint",categories:["sounds"]},{word:"faithful",categories:["personality"]},{word:"famous",categories:["condition"]},{word:"fancy",categories:["appearance"]},{word:"fast",categories:["time"]},{word:"fat",categories:["size"]},{word:"few",categories:["quantity"]},{word:"fierce",categories:["personality"]},{word:"fit",categories:["appearance"]},{word:"flabby",categories:["appearance"]},{word:"flaky",categories:["touch"]},{word:"flat",categories:["shapes"]},{word:"fluffy",categories:["touch"]},{word:"freezing",categories:["touch"]},{word:"fresh",categories:["taste"]},{word:"full",categories:["quantity"]},{word:"future",categories:["time"]},{word:"gentle",categories:["personality"]},{word:"gifted",categories:["condition"]},{word:"gigantic",categories:["size"]},{word:"glamorous",categories:["appearance"]},{word:"gorgeous",categories:["appearance"]},{word:"gray",categories:["color"]},{word:"greasy",categories:["touch","taste"]},{word:"great",categories:["size"]},{word:"green",categories:["color"]},{word:"grumpy",categories:["personality"]},{word:"hallowed",categories:["condition"]},{word:"handsome",categories:["appearance"]},{word:"happy",categories:["personality"]},{word:"harsh",categories:["sounds"]},{word:"helpful",categories:["condition"]},{word:"helpless",categories:["personality"]},{word:"high",categories:["shapes"]},{word:"hissing",categories:["sounds"]},{word:"hollow",categories:["shapes"]},{word:"hot",categories:["touch","taste"]},{word:"howling",categories:["sounds"]},{word:"huge",categories:["size"]},{word:"hundreds",categories:["quantity"]},{word:"icy",categories:["touch"]},{word:"immense",categories:["size"]},{word:"important",categories:["condition"]},{word:"incalculable",categories:["quantity"]},{word:"inexpensive",categories:["condition"]},{word:"itchy",categories:["personality"]},{word:"jealous",categories:["personality"]},{word:"jolly",categories:["personality"]},{word:"juicy",categories:["taste"]},{word:"kind",categories:["personality"]},{word:"large",categories:["size"]},{word:"late",categories:["time"]},{word:"lazy",categories:["personality"]},{word:"lemon",categories:["color"]},{word:"limited",categories:["quantity"]},{word:"little",categories:["size","quantity"]},{word:"lively",categories:["personality"]},{word:"long",categories:["time","appearance"]},{word:"loose",categories:["touch"]},{word:"loud",categories:["sounds"]},{word:"low",categories:["shapes"]},{word:"magnificent",categories:["appearance"]},{word:"mammoth",categories:["size"]},{word:"mango",categories:["color"]},{word:"many",categories:["quantity"]},{word:"massive",categories:["size"]},{word:"mealy",categories:["condition"]},{word:"melodic",categories:["sounds"]},{word:"melted",categories:["touch"]},{word:"microscopic",categories:["size"]},{word:"millions",categories:["quantity"]},{word:"miniature",categories:["size"]},{word:"modern",categories:["time"]},{word:"moldy",categories:["taste"]},{word:"most",categories:["quantity"]},{word:"muscular",categories:["appearance"]},{word:"mushy",categories:["condition"]},{word:"mysterious",categories:["personality"]},{word:"narrow",categories:["shapes"]},{word:"nervous",categories:["personality"]},{word:"nice",categories:["personality"]},{word:"noisy",categories:["sounds"]},{word:"numerous",categories:["quantity"]},{word:"nutritious",categories:["taste"]},{word:"nutty",categories:["taste"]},{word:"obedient",categories:["personality"]},{word:"obnoxious",categories:["personality"]},{word:"odd",categories:["condition"]},{word:"old",categories:["time"]},{word:"orange",categories:["color"]},{word:"panicky",categories:["personality"]},{word:"petite",categories:["size"]},{word:"pitiful",categories:["personality"]},{word:"plain",categories:["appearance"]},{word:"plump",categories:["appearance"]},{word:"polite",categories:["personality"]},{word:"poor",categories:["condition"]},{word:"powerful",categories:["condition"]},{word:"prehistoric",categories:["time"]},{word:"prickly",categories:["touch"]},{word:"proud",categories:["personality"]},{word:"puny",categories:["size"]},{word:"purple",categories:["color"]},{word:"purring",categories:["sounds"]},{word:"putrid",categories:["taste"]},{word:"quaint",categories:["appearance"]},{word:"quick",categories:["time"]},{word:"quiet",categories:["sounds"]},{word:"rancid",categories:["taste"]},{word:"rapid",categories:["time"]},{word:"rapping",categories:["sounds"]},{word:"raspy",categories:["sounds"]},{word:"red",categories:["color"]},{word:"refined",categories:["shapes"]},{word:"repulsive",categories:["personality"]},{word:"rhythmic",categories:["sounds"]},{word:"rich",categories:["condition"]},{word:"ripe",categories:["taste"]},{word:"rotten",categories:["taste"]},{word:"rough",categories:["touch"]},{word:"round",categories:["shapes"]},{word:"salmon",categories:["color"]},{word:"salty",categories:["taste"]},{word:"savory",categories:["taste"]},{word:"scarce",categories:["quantity"]},{word:"scary",categories:["personality"]},{word:"scrawny",categories:["size"]},{word:"screeching",categories:["sounds"]},{word:"scruffy",categories:["appearance"]},{word:"shaggy",categories:["touch"]},{word:"shallow",categories:["shapes"]},{word:"shapely",categories:["appearance"]},{word:"sharp",categories:["touch"]},{word:"short",categories:["size","appearance","time"]},{word:"shrilling",categories:["sounds"]},{word:"shy",categories:["condition"]},{word:"silly",categories:["personality"]},{word:"skinny",categories:["appearance","shapes"]},{word:"slimy",categories:["touch"]},{word:"slow",categories:["time"]},{word:"small",categories:["size"]},{word:"some",categories:["quantity"]},{word:"sour",categories:["taste"]},{word:"sparse",categories:["quantity"]},{word:"spicy",categories:["taste"]},{word:"spoiled",categories:["taste"]},{word:"square",categories:["shapes"]},{word:"squeaking",categories:["sounds"]},{word:"stale",categories:["taste"]},{word:"steep",categories:["shapes"]},{word:"sticky",categories:["touch"]},{word:"stocky",categories:["appearance"]},{word:"straight",categories:["shapes"]},{word:"strong",categories:["touch"]},{word:"substantial",categories:["quantity"]},{word:"sweet",categories:["taste"]},{word:"swift",categories:["time"]},{word:"tall",categories:["size"]},{word:"tangy",categories:["taste"]},{word:"tart",categories:["taste"]},{word:"tasteless",categories:["taste"]},{word:"tasty",categories:["taste"]},{word:"teeny",categories:["size"]},{word:"tender",categories:["condition"]},{word:"thankful",categories:["personality"]},{word:"thoughtless",categories:["personality"]},{word:"thousands",categories:["quantity"]},{word:"thundering",categories:["sounds"]},{word:"tight",categories:["touch"]},{word:"tinkling",categories:["sounds"]},{word:"tiny",categories:["size"]},{word:"ugly",categories:["appearance"]},{word:"uneven",categories:["touch"]},{word:"unimportant",categories:["condition"]},{word:"uninterested",categories:["condition"]},{word:"unkempt",categories:["appearance"]},{word:"unsightly",categories:["appearance"]},{word:"uptight",categories:["personality"]},{word:"vast",categories:["condition"]},{word:"victorious",categories:["personality"]},{word:"wailing",categories:["sounds"]},{word:"warm",categories:["touch"]},{word:"weak",categories:["touch"]},{word:"wet",categories:["touch"]},{word:"whining",categories:["sounds"]},{word:"whispering",categories:["sounds"]},{word:"white",categories:["color"]},{word:"wide",categories:["shapes"]},{word:"witty",categories:["personality"]},{word:"wonderful",categories:["personality"]},{word:"wooden",categories:["touch"]},{word:"worried",categories:["personality"]},{word:"wrong",categories:["condition"]},{word:"yellow",categories:["color"]},{word:"young",categories:["time"]},{word:"yummy",categories:["taste"]},{word:"zealous",categories:["personality"]}]};function uE(r,e){var t,i;e===void 0&&(e=[]);var n=new Set(e),s=[];try{for(var o=cE(Wi.wordList[r]),a=o.next();!a.done;a=o.next()){var l=a.value;(e.length===0||l.categories.some(function(c){return n.has(c)}))&&s.push(l.word)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return s}Wi.getWordsByCategory=uE});var Bm=Kn(An=>{"use strict";var Nl=An&&An.__assign||function(){return Nl=Object.assign||function(r){for(var e,t=1,i=arguments.length;t{"use strict";var Ih=Object.defineProperty,fE=Object.getOwnPropertyDescriptor,mE=Object.getOwnPropertyNames,gE=Object.prototype.hasOwnProperty,yE=(r,e)=>{for(var t in e)Ih(r,t,{get:e[t],enumerable:!0})},xE=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mE(e))!gE.call(r,n)&&n!==t&&Ih(r,n,{get:()=>e[n],enumerable:!(i=fE(e,n))||i.enumerable});return r},vE=r=>xE(Ih({},"__esModule",{value:!0}),r),Nm={};yE(Nm,{FileInputSuggest:()=>bE,FolderInputSuggest:()=>wE,FuzzyInputSuggest:()=>Nh,setNodeIcon:()=>AE});km.exports=vE(Nm);var Ph=require("obsidian"),Nh=class extends Ph.AbstractInputSuggest{constructor(r,e,t){super(r,e.inputEl),this.items=t}getSuggestions(r){let e=(0,Ph.prepareSimpleSearch)(r),t=[];for(let i of this.items){let n=e(this.getItemText(i));n&&t.push({item:i,match:n})}return t}renderSuggestion(r,e){e.addClass("mod-complex");let t=e.createDiv({cls:"suggestion-content"});if(!r?.item){t.setText("No match found"),t.parentElement?.addClass("is-selected");return}let i=t.createDiv("suggestion-title");this.renderTitle(i,r);let n=t.createDiv("suggestion-note");this.renderNote(n,r)}renderMatches(r,e,t,i){(0,Ph.renderMatches)(r,e,t,i)}},Pm=require("obsidian"),wE=class extends Nh{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:i}=e;(0,Pm.renderMatches)(r,t.path,i.matches)}renderTitle(r,e){let{item:t,match:i}=e;(0,Pm.renderMatches)(r,t.name,i.matches,t.path.length-t.name.length)}},Im=require("obsidian"),bE=class extends Nh{getItemText(r){return r.path}renderNote(r,e){let{item:t,match:i}=e;(0,Im.renderMatches)(r,t.path,i.matches)}renderTitle(r,e){let{item:t,match:i}=e;(0,Im.renderMatches)(r,t.name,i.matches,t.path.length-t.name.length)}},_E=require("obsidian"),EE={"has-node-icon":"helpers_has-node-icon","x-small":"helpers_x-small",small:"helpers_small",medium:"helpers_medium",large:"helpers_large","x-large":"helpers_x-large"};function AE(r,e){r.addClass(EE["has-node-icon"]),(0,_E.setIcon)(r,e)}});var nA={};Lg(nA,{default:()=>Wl});module.exports=Bg(nA);var Yi=require("obsidian");var bn=require("obsidian");var rA=require("obsidian");function rd(r,e,t){[...r].slice(e).reverse().forEach(([n,s])=>{r.set(n+1,s)}),r.set(e,t)}function Ro(r,e){return Object.entries(r).reduce((t,i)=>{let n=i[0],o=i[1]?e.parent.path.startsWith(n):e.parent.path==n;return t||o},!1)}var Di=require("obsidian");var sr=class extends Di.Events{getRandomBetween(e,t){let i=new Uint32Array(1);crypto.getRandomValues(i);let n=i[0]/4294967296;return Math.floor(n*(t-e+1))+e}},Fo=class extends sr{constructor(t,i="",n=t.showDice){super();this.data=t;this.original=i;this.loaded=!1;this.original||(this.original=""),this.containerEl=createSpan({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}}),this.resultEl=this.containerEl.createSpan("dice-roller-result"),n?(this.iconEl=this.containerEl.createSpan({cls:"dice-roller-button"}),(0,Di.setIcon)(this.iconEl,"dices"),this.iconEl.onclick=this.onClick.bind(this)):this.containerEl.addClass("no-icon"),this.containerEl.onclick=this.onClick.bind(this)}onLoad(t){this.loaded?t():this.on("loaded",()=>t())}setTooltip(){this.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(t,i){let n=new Uint32Array(1);crypto.getRandomValues(n);let s=n[0]/4294967296;return Math.floor(s*(i-t+1))+t}async render(){this.setTooltip(),await this.build()}async onClick(t){t.stopPropagation(),t.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},Dn=class extends Fo{constructor(t,i,n,s=t.showDice){super(t,i,s);this.data=t;this.original=i;this.lexemes=n;this.showDice=s;this.save=!1}setSource(t){this.source=t}getSource(){return this.source}get inlineText(){return`${this.tooltip.split(` -`).join(" -> ")} -> `}},rr=class extends Dn{constructor(t,i,n,s,o,a=t.showDice){super(t,i,[n],a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.app=o;this.watch=!0;this.getPath(),this.init=this.getFile()}async getFile(){if(this.file=this.app.metadataCache.getFirstLinkpathDest(this.path,this.source),!this.file||!(this.file instanceof Di.TFile))throw new Error("Could not load file.");await this.load()}},es=class extends rr{constructor(t,i,n,s,o,a=!0,l=t.showDice){super(t,i,n,s,o,l);this.data=t;this.original=i;this.lexeme=n;this.app=o;this.inline=a;this.data.displayAsEmbed&&(this.containerEl.addClasses(["has-embed","markdown-embed"]),this.resultEl.addClass("internal-embed")),this.resultEl.setAttrs({src:s}),this.copy=this.containerEl.createDiv({cls:"dice-content-copy dice-roller-button no-show",attr:{"aria-label":"Copy Contents"}}),this.copy.addEventListener("click",c=>{c.stopPropagation(),navigator.clipboard.writeText(this.transformResultsToString()).then(async()=>{new Di.Notice("Result copied to clipboard.")})}),(0,Di.setIcon)(this.copy,"copy")}getEmbedClass(){return this.data.displayAsEmbed?"markdown-embed":""}},Lo=class extends Fo{constructor(t,i,n){super(t,"");this.options=i;this.rolls=n}get tooltip(){return`${this.options.toString()} - -${this.results.toString()}`}async roll(){let t=[...this.options];return this.results=[...Array(this.rolls)].map(()=>{let i=t[this.getRandomBetween(0,t.length-1)];return t.splice(t.indexOf(i),1),i}).filter(i=>i),this.render(),this.trigger("new-result"),this.result=this.results[0],this.results[0]}async build(){this.resultEl.empty(),this.resultEl.setText(this.results.toString())}};var Hn=require("obsidian");var gi=class r{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){let e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){let e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){let t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new b){let t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new b){let i=this.elements,n=e.x,s=e.y,o=e.z;return t.x=i[0]*n+i[1]*s+i[2]*o,t.y=i[3]*n+i[4]*s+i[5]*o,t.z=i[6]*n+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){let s=1/n;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return n}unit(e=new r){let t=this.x,i=this.y,n=this.z,s=Math.sqrt(t*t+i*i+n*n);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=n*s):(e.x=1,e.y=0,e.z=0),e}length(){let e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-n)*(a-n))}distanceSquared(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-n)*(a-n)}scale(e,t=new r){let i=this.x,n=this.y,s=this.z;return t.x=e*i,t.y=e*n,t.z=e*s,t}vmul(e,t=new r){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new r){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e=new r){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){let i=this.length();if(i>0){let n=Ig,s=1/i;n.set(this.x*s,this.y*s,this.z*s);let o=Ng;Math.abs(n.x)<.9?(o.set(1,0,0),n.cross(o,e)):(o.set(0,1,0),n.cross(o,e)),n.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){let n=this.x,s=this.y,o=this.z;i.x=n+(e.x-n)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(od),od.almostEquals(e,t)}clone(){return new r(this.x,this.y,this.z)}};b.ZERO=void 0;b.UNIT_X=void 0;b.UNIT_Y=void 0;b.UNIT_Z=void 0;b.ZERO=new b(0,0,0);b.UNIT_X=new b(1,0,0);b.UNIT_Y=new b(0,1,0);b.UNIT_Z=new b(0,0,1);var Ig=new b,Ng=new b,od=new b,Ht=class r{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new b,this.upperBound=new b,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,n){let s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=n.y&&i.y>=s.y&&t.z<=n.z&&i.z>=s.z}getCorners(e,t,i,n,s,o,a,l){let c=this.lowerBound,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),n.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){let i=ld,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7];this.getCorners(n,s,o,a,l,c,u,h);for(let d=0;d!==8;d++){let p=i[d];e.pointToLocal(p,p)}return t.setFromPoints(i)}toWorldFrame(e,t){let i=ld,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7];this.getCorners(n,s,o,a,l,c,u,h);for(let d=0;d!==8;d++){let p=i[d];e.pointToWorld(p,p)}return t.setFromPoints(i)}overlapsRay(e){let{direction:t,from:i}=e,n=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*n,l=(this.upperBound.x-i.x)*n,c=(this.lowerBound.y-i.y)*s,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,p=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,d)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,d));return!(m<0||p>m)}},ad=new b,ld=[new b,new b,new b,new b,new b,new b,new b,new b],zo=class{constructor(){this.matrix=void 0,this.matrix=[]}get(e,t){let{index:i}=e,{index:n}=t;if(n>i){let s=n;n=i,i=s}return this.matrix[(i*(i+1)>>1)+n-1]}set(e,t,i){let{index:n}=e,{index:s}=t;if(s>n){let o=s;s=n,n=o}this.matrix[(n*(n+1)>>1)+s-1]=i?1:0}reset(){for(let e=0,t=this.matrix.length;e!==t;e++)this.matrix[e]=0}setNumObjects(e){this.matrix.length=e*(e-1)>>1}},Oo=class{constructor(){this._listeners=void 0}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].includes(t)||i[e].push(t),this}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return!!(i[e]!==void 0&&i[e].includes(t))}hasAnyEventListener(e){return this._listeners===void 0?!1:this._listeners[e]!==void 0}removeEventListener(e,t){if(this._listeners===void 0)return this;let i=this._listeners;if(i[e]===void 0)return this;let n=i[e].indexOf(t);return n!==-1&&i[e].splice(n,1),this}dispatchEvent(e){if(this._listeners===void 0)return this;let i=this._listeners[e.type];if(i!==void 0){e.target=this;for(let n=0,s=i.length;n.499&&(i=2*Math.atan2(o,c),n=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),n=-Math.PI/2,s=0),i===void 0){let h=o*o,d=a*a,p=l*l;i=Math.atan2(2*a*c-2*o*l,1-2*d-2*p),n=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-2*p)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=n,e.x=s}setFromEuler(e,t,i,n="XYZ"){let s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),u=Math.sin(i/2);return n==="XYZ"?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):n==="YXZ"?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):n==="ZXY"?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):n==="ZYX"?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):n==="YZX"?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):n==="XZY"&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new r(this.x,this.y,this.z,this.w)}slerp(e,t,i=new r){let n=this.x,s=this.y,o=this.z,a=this.w,l=e.x,c=e.y,u=e.z,h=e.w,d,p,m,y,x;return p=n*l+s*c+o*u+a*h,p<0&&(p=-p,l=-l,c=-c,u=-u,h=-h),1-p>1e-6?(d=Math.acos(p),m=Math.sin(d),y=Math.sin((1-t)*d)/m,x=Math.sin(t*d)/m):(y=1-t,x=t),i.x=y*n+x*l,i.y=y*s+x*c,i.z=y*o+x*u,i.w=y*a+x*h,i}integrate(e,t,i,n=new r){let s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,d=t*.5;return n.x+=d*(s*h+o*u-a*c),n.y+=d*(o*h+a*l-s*u),n.z+=d*(a*h+s*c-o*l),n.w+=d*(-s*l-o*c-a*u),n}},kg=new b,zg=new b,Og={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},me=class r{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=r.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(e,t,i,n){throw"calculateWorldAABB() not implemented for shape type "+this.type}};me.idCounter=0;me.types=Og;var He=class r{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new b,this.quaternion=new mt,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return r.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return r.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,n=new b){return i.vsub(e,n),t.conjugate(cd),cd.vmult(n,n),n}static pointToWorldFrame(e,t,i,n=new b){return t.vmult(i,n),n.vadd(e,n),n}static vectorToWorldFrame(e,t,i=new b){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,n=new b){return t.w*=-1,t.vmult(i,n),t.w*=-1,n}},cd=new mt,ur=class r extends me{constructor(e={}){let{vertices:t=[],faces:i=[],normals:n=[],axes:s,boundingSphereRadius:o}=e;super({type:me.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=n,this.faceNormals.length===0&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){let e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;let n=new b;for(let s=0;s!==e.length;s++){let o=e[s],a=o.length;for(let l=0;l!==a;l++){let c=(l+1)%a;t[o[l]].vsub(t[o[c]],n),n.normalize();let u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(n)||i[h].almostEquals(n)){u=!0;break}u||i.push(n.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ed&&(d=y,h=m)}let p=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,p,a,l,c)}findSeparatingAxis(e,t,i,n,s,o,a,l){let c=new b,u=new b,h=new b,d=new b,p=new b,m=new b,y=Number.MAX_VALUE,x=this;if(x.uniqueAxes)for(let g=0;g!==x.uniqueAxes.length;g++){i.vmult(x.uniqueAxes[g],c);let f=x.testSepAxis(c,e,t,i,n,s);if(f===!1)return!1;f0&&o.negate(o),!0}testSepAxis(e,t,i,n,s,o){let a=this;r.project(a,e,i,n,jl),r.project(t,e,s,o,Xl);let l=jl[0],c=jl[1],u=Xl[0],h=Xl[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping=typeof e.linearDamping=="number"?e.linearDamping:.01,this.type=t<=0?r.STATIC:r.DYNAMIC,typeof e.type==typeof r.STATIC&&(this.type=e.type),this.allowSleep=typeof e.allowSleep<"u"?e.allowSleep:!0,this.sleepState=r.AWAKE,this.sleepSpeedLimit=typeof e.sleepSpeedLimit<"u"?e.sleepSpeedLimit:.1,this.sleepTimeLimit=typeof e.sleepTimeLimit<"u"?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new b,this.quaternion=new mt,this.initQuaternion=new mt,this.previousQuaternion=new mt,this.interpolatedQuaternion=new mt,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new b,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new b,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new b,this.invInertia=new b,this.invInertiaWorld=new gi,this.invMassSolve=0,this.invInertiaSolve=new b,this.invInertiaWorldSolve=new gi,this.fixedRotation=typeof e.fixedRotation<"u"?e.fixedRotation:!1,this.angularDamping=typeof e.angularDamping<"u"?e.angularDamping:.01,this.linearFactor=new b(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new b(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Ht,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new b,this.isTrigger=!!e.isTrigger,e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){let e=this.sleepState;this.sleepState=r.AWAKE,this.wakeUpAfterNarrowphase=!1,e===r.SLEEPING&&this.dispatchEvent(r.wakeupEvent)}sleep(){this.sleepState=r.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){let t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),n=this.sleepSpeedLimit**2;t===r.AWAKE&&in?this.wakeUp():t===r.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(r.sleepEvent))}}updateSolveMassProperties(){this.sleepState===r.SLEEPING||this.type===r.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new b){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new b){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t}addShape(e,t,i){let n=new b,s=new mt;return t&&n.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(n),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){let t=this.shapes.indexOf(e);return t===-1?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){let e=this.shapes,t=this.shapeOffsets,i=e.length,n=0;for(let s=0;s!==i;s++){let o=e[s];o.updateBoundingSphereRadius();let a=t[s].length(),l=o.boundingSphereRadius;a+l>n&&(n=a+l)}this.boundingRadius=n}updateAABB(){let e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,n=e.length,s=Hg,o=Gg,a=this.quaternion,l=this.aabb,c=qg;for(let u=0;u!==n;u++){let h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),u===0?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){let t=this.invInertia;if(!(t.x===t.y&&t.y===t.z&&!e)){let i=Wg,n=$g;i.setRotationFromQuaternion(this.quaternion),i.transpose(n),i.scale(t,i),i.mmult(n,this.invInertiaWorld)}}applyForce(e,t=new b){if(this.type!==r.DYNAMIC)return;this.sleepState===r.SLEEPING&&this.wakeUp();let i=jg;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new b){if(this.type!==r.DYNAMIC)return;let i=Xg,n=Yg;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,n),this.applyForce(i,n)}applyTorque(e){this.type===r.DYNAMIC&&(this.sleepState===r.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new b){if(this.type!==r.DYNAMIC)return;this.sleepState===r.SLEEPING&&this.wakeUp();let i=t,n=Zg;n.copy(e),n.scale(this.invMass,n),this.velocity.vadd(n,this.velocity);let s=Jg;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new b){if(this.type!==r.DYNAMIC)return;let i=Kg,n=Qg;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,n),this.applyImpulse(i,n)}updateMassProperties(){let e=e0;this.invMass=this.mass>0?1/this.mass:0;let t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),Kl.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){let i=new b;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),!(this.type===r.DYNAMIC||this.type===r.KINEMATIC)||this.sleepState===r.SLEEPING)return;let n=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,u=this.invMass,h=this.invInertiaWorld,d=this.linearFactor,p=u*e;n.x+=a.x*p*d.x,n.y+=a.y*p*d.y,n.z+=a.z*p*d.z;let m=h.elements,y=this.angularFactor,x=l.x*y.x,g=l.y*y.y,f=l.z*y.z;s.x+=e*(m[0]*x+m[1]*g+m[2]*f),s.y+=e*(m[3]*x+m[4]*g+m[5]*f),s.z+=e*(m[6]*x+m[7]*g+m[8]*f),o.x+=n.x*e,o.y+=n.y*e,o.z+=n.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}};De.idCounter=0;De.COLLIDE_EVENT_NAME="collide";De.DYNAMIC=lc.DYNAMIC;De.STATIC=lc.STATIC;De.KINEMATIC=lc.KINEMATIC;De.AWAKE=cc.AWAKE;De.SLEEPY=cc.SLEEPY;De.SLEEPING=cc.SLEEPING;De.wakeupEvent={type:"wakeup"};De.sleepyEvent={type:"sleepy"};De.sleepEvent={type:"sleep"};var Hg=new b,Gg=new mt,qg=new Ht,Wg=new gi,$g=new gi,jg=new b,Xg=new b,Yg=new b,Zg=new b,Jg=new b,Kg=new b,Qg=new b,e0=new b,Ql=class{constructor(){this.world=void 0,this.useBoundingBoxes=void 0,this.dirty=void 0,this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(e,t,i){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(e,t){return!(!(e.collisionFilterGroup&t.collisionFilterMask)||!(t.collisionFilterGroup&e.collisionFilterMask)||(e.type&De.STATIC||e.sleepState===De.SLEEPING)&&(t.type&De.STATIC||t.sleepState===De.SLEEPING))}intersectionTest(e,t,i,n){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,t,i,n):this.doBoundingSphereBroadphase(e,t,i,n)}doBoundingSphereBroadphase(e,t,i,n){let s=t0;t.position.vsub(e.position,s);let o=(e.boundingRadius+t.boundingRadius)**2;s.lengthSquared()i.lengthSquared()}aabbQuery(e,t,i){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},t0=new b,i0={keys:[]},n0=[],s0=[];var pA=new b,hr=class extends Ql{constructor(){super()}collisionPairs(e,t,i){let n=e.bodies,s=n.length,o,a;for(let l=0;l!==s;l++)for(let c=0;c!==l;c++)o=n[l],a=n[c],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,t,i)}aabbQuery(e,t,i=[]){for(let n=0;n{}}intersectWorld(e,t){return this.mode=t.mode||r.ANY,this.result=t.result||new dr,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(ud),Yl.length=0,e.broadphase.aabbQuery(e,ud,Yl),this.intersectBodies(Yl),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());let i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;let n=r0,s=o0;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;let a=this[e.type];a&&a.call(this,e,t,i,n,e)}_intersectBox(e,t,i,n,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,n,s)}_intersectPlane(e,t,i,n,s){let o=this.from,a=this.to,l=this.direction,c=new b(0,0,1);t.vmult(c,c);let u=new b;o.vsub(i,u);let h=u.dot(c);a.vsub(i,u);let d=u.dot(c);if(h*d>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,p),p.vsub(i,m),m.normalize(),this.reportIntersection(m,p,s,n,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,p),p.vsub(i,m),m.normalize(),this.reportIntersection(m,p,s,n,-1))}}_intersectConvex(e,t,i,n,s,o){let a=h0,l=dd,c=o&&o.faceList||null,u=e.faces,h=e.vertices,d=e.faceNormals,p=this.direction,m=this.from,y=this.to,x=m.distanceTo(y),g=c?c.length:u.length,f=this.result;for(let E=0;!f.shouldStop&&Ex||this.reportIntersection(a,Nt,s,n,w)}}}}_intersectTrimesh(e,t,i,n,s,o){let a=d0,l=x0,c=v0,u=dd,h=p0,d=f0,p=m0,m=y0,y=g0,x=e.indices;e.vertices;let g=this.from,f=this.to,E=this.direction;c.position.copy(i),c.quaternion.copy(t),He.vectorToLocalFrame(i,t,E,h),He.pointToLocalFrame(i,t,g,d),He.pointToLocalFrame(i,t,f,p),p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,p.vsub(d,h),h.normalize();let w=d.distanceSquared(p);e.tree.rayQuery(this,c,l);for(let _=0,D=l.length;!this.result.shouldStop&&_!==D;_++){let T=l[_];e.getNormal(T,a),e.getVertex(x[T*3],ei),ei.vsub(d,u);let O=h.dot(a),W=a.dot(u)/O;if(W<0)continue;h.scale(W,Nt),Nt.vadd(d,Nt),e.getVertex(x[T*3+1],fi),e.getVertex(x[T*3+2],mi);let A=Nt.distanceSquared(d);!(r.pointInTriangle(Nt,fi,ei,mi)||r.pointInTriangle(Nt,ei,fi,mi))||A>w||(He.vectorToWorldFrame(t,a,y),He.pointToWorldFrame(i,t,Nt,m),this.reportIntersection(y,m,s,n,T))}l.length=0}reportIntersection(e,t,i,n,s){let o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=typeof s<"u"?s:-1,this.mode){case r.ALL:this.hasHit=!0,c.set(o,a,e,t,i,n,l),c.hasHit=!0,this.callback(c);break;case r.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hT.maxForce&&(p=T.maxForce-x),E[D]+=p,m+=p>0?p:-p,T.addToWlambda(p)}if(m*me;)t.pop();for(;t.length=0&&u.restitution>=0&&(a.restitution=c.restitution*u.restitution),a.si=s||i,a.sj=o||n,a}createFrictionEquationsFromContact(e,t){let i=e.bi,n=e.bj,s=e.si,o=e.sj,a=this.world,l=this.currentContactMaterial,c=l.friction,u=s.material||i.material,h=o.material||n.material;if(u&&h&&u.friction>=0&&h.friction>=0&&(c=u.friction*h.friction),c>0){let d=c*a.gravity.length(),p=i.invMass+n.invMass;p>0&&(p=1/p);let m=this.frictionEquationPool,y=m.length?m.pop():new Ho(i,n,d*p),x=m.length?m.pop():new Ho(i,n,d*p);return y.bi=x.bi=i,y.bj=x.bj=n,y.minForce=x.minForce=-d*p,y.maxForce=x.maxForce=d*p,y.ri.copy(e.ri),y.rj.copy(e.rj),x.ri.copy(e.ri),x.rj.copy(e.rj),e.ni.tangents(y.t,x.t),y.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,a.dt),x.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,a.dt),y.enabled=x.enabled=e.enabled,t.push(y,x),!0}return!1}createFrictionFromAverage(e){let t=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(t,this.frictionResult)||e===1)return;let i=this.frictionResult[this.frictionResult.length-2],n=this.frictionResult[this.frictionResult.length-1];Tn.setZero(),is.setZero(),ns.setZero();let s=t.bi;t.bj;for(let a=0;a!==e;a++)t=this.result[this.result.length-1-a],t.bi!==s?(Tn.vadd(t.ni,Tn),is.vadd(t.ri,is),ns.vadd(t.rj,ns)):(Tn.vsub(t.ni,Tn),is.vadd(t.rj,is),ns.vadd(t.ri,ns));let o=1/e;is.scale(o,i.ri),ns.scale(o,i.rj),n.ri.copy(i.ri),n.rj.copy(i.rj),Tn.normalize(),Tn.tangents(i.t,n.t)}getContacts(e,t,i,n,s,o,a){this.contactPointPool=s,this.frictionEquationPool=a,this.result=n,this.frictionResult=o;let l=k0,c=z0,u=I0,h=N0;for(let d=0,p=e.length;d!==p;d++){let m=e[d],y=t[d],x=null;m.material&&y.material&&(x=i.getContactMaterial(m.material,y.material)||null);let g=m.type&De.KINEMATIC&&y.type&De.STATIC||m.type&De.STATIC&&y.type&De.KINEMATIC||m.type&De.KINEMATIC&&y.type&De.KINEMATIC;for(let f=0;fE.boundingSphereRadius+_.boundingSphereRadius)continue;let D=null;E.material&&_.material&&(D=i.getContactMaterial(E.material,_.material)||null),this.currentContactMaterial=D||x||i.defaultContactMaterial;let T=E.type|_.type,O=this[T];if(O){let W=!1;E.type<_.type?W=O.call(this,E,_,u,h,l,c,m,y,E,_,g):W=O.call(this,_,E,h,u,c,l,y,m,E,_,g),W&&g&&(i.shapeOverlapKeeper.set(E.id,_.id),i.bodyOverlapKeeper.set(m.id,y.id))}}}}}sphereSphere(e,t,i,n,s,o,a,l,c,u,h){if(h)return i.distanceSquared(n)<(e.radius+t.radius)**2;let d=this.createContactEquation(a,l,e,t,c,u);n.vsub(i,d.ni),d.ni.normalize(),d.ri.copy(d.ni),d.rj.copy(d.ni),d.ri.scale(e.radius,d.ri),d.rj.scale(-t.radius,d.rj),d.ri.vadd(i,d.ri),d.ri.vsub(a.position,d.ri),d.rj.vadd(n,d.rj),d.rj.vsub(l.position,d.rj),this.result.push(d),this.createFrictionEquationsFromContact(d,this.frictionResult)}spherePlane(e,t,i,n,s,o,a,l,c,u,h){let d=this.createContactEquation(a,l,e,t,c,u);if(d.ni.set(0,0,1),o.vmult(d.ni,d.ni),d.ni.negate(d.ni),d.ni.normalize(),d.ni.scale(e.radius,d.ri),i.vsub(n,No),d.ni.scale(d.ni.dot(No),yd),No.vsub(yd,d.rj),-No.dot(d.ni)<=e.radius){if(h)return!0;let p=d.ri,m=d.rj;p.vadd(i,p),p.vsub(a.position,p),m.vadd(n,m),m.vsub(l.position,m),this.result.push(d),this.createFrictionEquationsFromContact(d,this.frictionResult)}}boxBox(e,t,i,n,s,o,a,l,c,u,h){return e.convexPolyhedronRepresentation.material=e.material,t.convexPolyhedronRepresentation.material=t.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexConvex(e.convexPolyhedronRepresentation,t.convexPolyhedronRepresentation,i,n,s,o,a,l,e,t,h)}sphereBox(e,t,i,n,s,o,a,l,c,u,h){let d=this.v3pool,p=uy;i.vsub(n,ko),t.getSideNormals(p,o);let m=e.radius,y=!1,x=dy,g=py,f=fy,E=null,w=0,_=0,D=0,T=null;for(let C=0,N=p.length;C!==N&&y===!1;C++){let k=ay;k.copy(p[C]);let V=k.length();k.normalize();let U=ko.dot(k);if(U0){let q=ly,j=cy;q.copy(p[(C+1)%3]),j.copy(p[(C+2)%3]);let ne=q.length(),ae=j.length();q.normalize(),j.normalize();let H=ko.dot(q),Te=ko.dot(j);if(H-ne&&Te-ae){let ue=Math.abs(U-V-m);if((T===null||uee.boundingSphereRadius+t.boundingSphereRadius)&&e.findSeparatingAxis(t,i,s,n,o,m,d,p)){let y=[],x=Ry;e.clipAgainstHull(i,s,t,n,o,m,-100,100,y);let g=0;for(let f=0;f!==y.length;f++){if(h)return!0;let E=this.createContactEquation(a,l,e,t,c,u),w=E.ri,_=E.rj;m.negate(E.ni),y[f].normal.negate(x),x.scale(y[f].depth,x),y[f].point.vadd(x,w),_.copy(y[f].point),w.vsub(i,w),_.vsub(n,_),w.vadd(i,w),w.vsub(a.position,w),_.vadd(n,_),_.vsub(l.position,_),this.result.push(E),g++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(E,this.frictionResult)}this.enableFrictionReduction&&g&&this.createFrictionFromAverage(g)}}sphereConvex(e,t,i,n,s,o,a,l,c,u,h){let d=this.v3pool;i.vsub(n,my);let p=t.faceNormals,m=t.faces,y=t.vertices,x=e.radius,g=!1;for(let f=0;f!==y.length;f++){let E=y[f],w=vy;o.vmult(E,w),n.vadd(w,w);let _=xy;if(w.vsub(i,_),_.lengthSquared()0){let R=[];for(let S=0,B=_.length;S!==B;S++){let L=d.get();o.vmult(y[_[S]],L),n.vadd(L,L),R.push(L)}if(oy(R,D,i)){if(h)return!0;g=!0;let S=this.createContactEquation(a,l,e,t,c,u);D.scale(-x,S.ri),D.negate(S.ni);let B=d.get();D.scale(-A,B);let L=d.get();D.scale(-x,L),i.vsub(n,S.rj),S.rj.vadd(L,S.rj),S.rj.vadd(B,S.rj),S.rj.vadd(n,S.rj),S.rj.vsub(l.position,S.rj),S.ri.vadd(i,S.ri),S.ri.vsub(a.position,S.ri),d.release(B),d.release(L),this.result.push(S),this.createFrictionEquationsFromContact(S,this.frictionResult);for(let C=0,N=R.length;C!==N;C++)d.release(R[C]);return}else for(let S=0;S!==_.length;S++){let B=d.get(),L=d.get();o.vmult(y[_[(S+1)%_.length]],B),o.vmult(y[_[(S+2)%_.length]],L),n.vadd(B,B),n.vadd(L,L);let C=gy;L.vsub(B,C);let N=yy;C.unit(N);let k=d.get(),V=d.get();i.vsub(B,V);let U=V.dot(N);N.scale(U,k),k.vadd(B,k);let q=d.get();if(k.vsub(i,q),U>0&&U*Ud.length||E>d[0].length)return;g<0&&(g=0),f<0&&(f=0),E<0&&(E=0),w<0&&(w=0),g>=d.length&&(g=d.length-1),f>=d.length&&(f=d.length-1),w>=d[0].length&&(w=d[0].length-1),E>=d[0].length&&(E=d[0].length-1);let _=[];t.getRectMinMax(g,E,f,w,_);let D=_[0],T=_[1];if(x.z-p>T||x.z+p2)return}}boxHeightfield(e,t,i,n,s,o,a,l,c,u,h){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexHeightfield(e.convexPolyhedronRepresentation,t,i,n,s,o,a,l,e,t,h)}convexHeightfield(e,t,i,n,s,o,a,l,c,u,h){let d=t.data,p=t.elementSize,m=e.boundingSphereRadius,y=Oy,x=Vy,g=zy;He.pointToLocalFrame(n,o,i,g);let f=Math.floor((g.x-m)/p)-1,E=Math.ceil((g.x+m)/p)+1,w=Math.floor((g.y-m)/p)-1,_=Math.ceil((g.y+m)/p)+1;if(E<0||_<0||f>d.length||w>d[0].length)return;f<0&&(f=0),E<0&&(E=0),w<0&&(w=0),_<0&&(_=0),f>=d.length&&(f=d.length-1),E>=d.length&&(E=d.length-1),_>=d[0].length&&(_=d[0].length-1),w>=d[0].length&&(w=d[0].length-1);let D=[];t.getRectMinMax(f,w,E,_,D);let T=D[0],O=D[1];if(!(g.z-m>O||g.z+m0&&L<0&&(x.vsub(d,g),y.copy(m),y.normalize(),C=g.dot(y),y.scale(C,g),g.vadd(d,g),g.distanceTo(x)0&&i===!0||u<=0&&i===!1){i===null&&(i=u>0);continue}else return!1}return!0}var ko=new b,ay=new b,ly=new b,cy=new b,uy=[new b,new b,new b,new b,new b,new b],hy=new b,dy=new b,py=new b,fy=new b,my=new b,gy=new b,yy=new b,xy=new b,vy=new b,wy=new b,by=new b,_y=new b,Ey=new b,Ay=new b,Sy=new b,My=new b,Dy=new b,Ty=new b,Cy=new b,Ry=new b,Fy=new b,Ly=new b,By=new b,Py=new b,xd=new mt,Iy=new b,Ny=new b,vd=new b,ky=new b,zy=new b,Oy=new b,Vy=[0],Uy=new b,Hy=new b,Go=class{constructor(){this.current=void 0,this.previous=void 0,this.current=[],this.previous=[]}getKey(e,t){if(tn[s];)s++;if(i!==n[s]){for(let o=n.length-1;o>=s;o--)n[o+1]=n[o];n[s]=i}}tick(){let e=this.current;this.current=this.previous,this.previous=e,this.current.length=0}getDiff(e,t){let i=this.current,n=this.previous,s=i.length,o=n.length,a=0;for(let l=0;ln[a];)a++;c=u===n[a],c||wd(e,u)}a=0;for(let l=0;li[a];)a++;c=i[a]===u,c||wd(t,u)}}};function wd(r,e){r.push((e&4294901760)>>16,e&65535)}var ac=class{constructor(){this.data={keys:[]}}get(e,t){if(e>t){let i=t;t=e,e=i}return this.data[e+"-"+t]}set(e,t,i){if(e>t){let s=t;t=e,e=s}let n=e+"-"+t;this.get(e,t)||this.data.keys.push(n),this.data[n]=i}reset(){let e=this.data,t=e.keys;for(;t.length>0;){let i=t.pop();delete e[i]}}},qo=class extends Oo{constructor(e={}){super(),this.dt=void 0,this.allowSleep=void 0,this.contacts=void 0,this.frictionEquations=void 0,this.quatNormalizeSkip=void 0,this.quatNormalizeFast=void 0,this.time=void 0,this.stepnumber=void 0,this.default_dt=void 0,this.nextId=void 0,this.gravity=void 0,this.broadphase=void 0,this.bodies=void 0,this.hasActiveBodies=void 0,this.solver=void 0,this.constraints=void 0,this.narrowphase=void 0,this.collisionMatrix=void 0,this.collisionMatrixPrevious=void 0,this.bodyOverlapKeeper=void 0,this.shapeOverlapKeeper=void 0,this.materials=void 0,this.contactmaterials=void 0,this.contactMaterialTable=void 0,this.defaultMaterial=void 0,this.defaultContactMaterial=void 0,this.doProfiling=void 0,this.profile=void 0,this.accumulator=void 0,this.subsystems=void 0,this.addBodyEvent=void 0,this.removeBodyEvent=void 0,this.idToBodyMap=void 0,this.dt=-1,this.allowSleep=!!e.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=e.quatNormalizeSkip!==void 0?e.quatNormalizeSkip:0,this.quatNormalizeFast=e.quatNormalizeFast!==void 0?e.quatNormalizeFast:!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new b,e.gravity&&this.gravity.copy(e.gravity),this.broadphase=e.broadphase!==void 0?e.broadphase:new hr,this.bodies=[],this.hasActiveBodies=!1,this.solver=e.solver!==void 0?e.solver:new nc,this.constraints=[],this.narrowphase=new oc(this),this.collisionMatrix=new zo,this.collisionMatrixPrevious=new zo,this.bodyOverlapKeeper=new Go,this.shapeOverlapKeeper=new Go,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new ac,this.defaultMaterial=new Ki("default"),this.defaultContactMaterial=new Ji(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(e,t){return this.contactMaterialTable.get(e.id,t.id)}numObjects(){return this.bodies.length}collisionMatrixTick(){let e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(e){this.constraints.push(e)}removeConstraint(e){let t=this.constraints.indexOf(e);t!==-1&&this.constraints.splice(t,1)}rayTest(e,t,i){i instanceof dr?this.raycastClosest(e,t,{skipBackfaces:!0},i):this.raycastAll(e,t,{skipBackfaces:!0},i)}raycastAll(e,t,i={},n){return i.mode=Xt.ALL,i.from=e,i.to=t,i.callback=n,Jl.intersectWorld(this,i)}raycastAny(e,t,i={},n){return i.mode=Xt.ANY,i.from=e,i.to=t,i.result=n,Jl.intersectWorld(this,i)}raycastClosest(e,t,i={},n){return i.mode=Xt.CLOSEST,i.from=e,i.to=t,i.result=n,Jl.intersectWorld(this,i)}addBody(e){this.bodies.includes(e)||(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof De&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.idToBodyMap[e.id]=e,this.dispatchEvent(this.addBodyEvent))}removeBody(e){e.world=null;let t=this.bodies.length-1,i=this.bodies,n=i.indexOf(e);if(n!==-1){i.splice(n,1);for(let s=0;s!==i.length;s++)i[s].index=s;this.collisionMatrix.setNumObjects(t),this.removeBodyEvent.body=e,delete this.idToBodyMap[e.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(e){return this.idToBodyMap[e]}getShapeById(e){let t=this.bodies;for(let i=0;i=e&&se*1e3)););this.accumulator=this.accumulator%e;let o=this.accumulator/e;for(let a=0;a!==this.bodies.length;a++){let l=this.bodies[a];l.previousPosition.lerp(l.position,o,l.interpolatedPosition),l.previousQuaternion.slerp(l.quaternion,o,l.interpolatedQuaternion),l.previousQuaternion.normalize()}this.time+=t}}internalStep(e){this.dt=e;let t=this.contacts,i=jy,n=Xy,s=this.numObjects(),o=this.bodies,a=this.solver,l=this.gravity,c=this.doProfiling,u=this.profile,h=De.DYNAMIC,d=-1/0,p=this.constraints,m=$y;l.length();let y=l.x,x=l.y,g=l.z,f=0;for(c&&(d=wt.now()),f=0;f!==s;f++){let S=o[f];if(S.type===h){let B=S.force,L=S.mass;B.x+=L*y,B.y+=L*x,B.z+=L*g}}for(let S=0,B=this.subsystems.length;S!==B;S++)this.subsystems[S].update();c&&(d=wt.now()),i.length=0,n.length=0,this.broadphase.collisionPairs(this,i,n),c&&(u.broadphase=wt.now()-d);let E=p.length;for(f=0;f!==E;f++){let S=p[f];if(!S.collideConnected)for(let B=i.length-1;B>=0;B-=1)(S.bodyA===i[B]&&S.bodyB===n[B]||S.bodyB===i[B]&&S.bodyA===n[B])&&(i.splice(B,1),n.splice(B,1))}this.collisionMatrixTick(),c&&(d=wt.now());let w=Wy,_=t.length;for(f=0;f!==_;f++)w.push(t[f]);t.length=0;let D=this.frictionEquations.length;for(f=0;f!==D;f++)m.push(this.frictionEquations[f]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,n,this,t,w,this.frictionEquations,m),c&&(u.narrowphase=wt.now()-d),c&&(d=wt.now()),f=0;f=0&&C.material.friction>=0&&L.material.friction*C.material.friction,L.material.restitution>=0&&C.material.restitution>=0&&(B.restitution=L.material.restitution*C.material.restitution)),a.addEquation(B),L.allowSleep&&L.type===De.DYNAMIC&&L.sleepState===De.SLEEPING&&C.sleepState===De.AWAKE&&C.type!==De.STATIC){let U=C.velocity.lengthSquared()+C.angularVelocity.lengthSquared(),q=C.sleepSpeedLimit**2;U>=q*2&&(L.wakeUpAfterNarrowphase=!0)}if(C.allowSleep&&C.type===De.DYNAMIC&&C.sleepState===De.SLEEPING&&L.sleepState===De.AWAKE&&L.type!==De.STATIC){let U=L.velocity.lengthSquared()+L.angularVelocity.lengthSquared(),q=L.sleepSpeedLimit**2;U>=q*2&&(C.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(L,C,!0),this.collisionMatrixPrevious.get(L,C)||(ar.body=C,ar.contact=B,L.dispatchEvent(ar),ar.body=L,C.dispatchEvent(ar)),this.bodyOverlapKeeper.set(L.id,C.id),this.shapeOverlapKeeper.set(N.id,k.id)}for(this.emitContactEvents(),c&&(u.makeContactConstraints=wt.now()-d,d=wt.now()),f=0;f!==s;f++){let S=o[f];S.wakeUpAfterNarrowphase&&(S.wakeUp(),S.wakeUpAfterNarrowphase=!1)}for(E=p.length,f=0;f!==E;f++){let S=p[f];S.update();for(let B=0,L=S.equations.length;B!==L;B++){let C=S.equations[B];a.addEquation(C)}}a.solve(e,this),c&&(u.solve=wt.now()-d),a.removeAllEquations();let O=Math.pow;for(f=0;f!==s;f++){let S=o[f];if(S.type&h){let B=O(1-S.linearDamping,e),L=S.velocity;L.scale(B,L);let C=S.angularVelocity;if(C){let N=O(1-S.angularDamping,e);C.scale(N,C)}}}for(this.dispatchEvent(qy),f=0;f!==s;f++){let S=o[f];S.preStep&&S.preStep.call(S)}c&&(d=wt.now());let A=this.stepnumber%(this.quatNormalizeSkip+1)===0,v=this.quatNormalizeFast;for(f=0;f!==s;f++)o[f].integrate(e,A,v);for(this.clearForces(),this.broadphase.dirty=!0,c&&(u.integrate=wt.now()-d),this.stepnumber+=1,this.dispatchEvent(Gy),f=0;f!==s;f++){let S=o[f],B=S.postStep;B&&B.call(S)}let R=!0;if(this.allowSleep)for(R=!1,f=0;f!==s;f++){let S=o[f];S.sleepTick(this.time),S.sleepState!==De.SLEEPING&&(R=!0)}this.hasActiveBodies=R}emitContactEvents(){let e=this.hasAnyEventListener("beginContact"),t=this.hasAnyEventListener("endContact");if((e||t)&&this.bodyOverlapKeeper.getDiff(Ci,Ri),e){for(let s=0,o=Ci.length;sDate.now()-r}var Gy={type:"postStep"},qy={type:"preStep"},ar={type:De.COLLIDE_EVENT_NAME,body:null,contact:null},Wy=[],$y=[],jy=[],Xy=[],Ci=[],Ri=[],lr={type:"beginContact",bodyA:null,bodyB:null},cr={type:"endContact",bodyA:null,bodyB:null},Fi={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Li={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};var uh="137";var Yy=0,Qd=1,Zy=2;var If=1,hh=2,Er=3,Cr=0,gt=1,Fs=2,Nf=1;var ln=0,Sr=1,ep=2,tp=3,ip=4,Jy=5,Es=100,Ky=101,Qy=102,np=103,sp=104,ex=200,tx=201,ix=202,nx=203,kf=204,zf=205,sx=206,rx=207,ox=208,ax=209,lx=210,cx=0,ux=1,hx=2,Zc=3,dx=4,px=5,fx=6,mx=7,el=0,gx=1,yx=2,cn=0,xx=1,vx=2,wx=3,bx=4,_x=5,Of=300,so=301,ro=302,Jc=303,Kc=304,tl=306,dh=307,Qc=1e3,Wt=1001,eu=1002,yt=1003,rp=1004;var op=1005;var Dt=1006,Ex=1007;var il=1008;var un=1009,Ax=1010,Sx=1011,Rr=1012,Mx=1013,Aa=1014,Pn=1015,Ds=1016,Dx=1017,Tx=1018,Ts=1020,Cx=1021,Rx=1022,Lt=1023,Fx=1024,Lx=1025,Nn=1026,Ls=1027,Bx=1028,Px=1029,Ix=1030,Nx=1031,kx=1033,hc=33776,dc=33777,pc=33778,fc=33779,ap=35840,lp=35841,cp=35842,up=35843,zx=36196,hp=37492,dp=37496,pp=37808,fp=37809,mp=37810,gp=37811,yp=37812,xp=37813,vp=37814,wp=37815,bp=37816,_p=37817,Ep=37818,Ap=37819,Sp=37820,Mp=37821,Dp=36492,Ox=2200,Vx=2201,Ux=2202,Sa=2300,Ma=2301,mc=2302,As=2400,Ss=2401,Da=2402,ph=2500,Vf=2501,Hx=0;var fn=3e3,et=3001,Gx=3200,qx=3201,$s=0,Wx=1;var gc=7680;var $x=519,Fr=35044,Ta=35048;var Tp="300 es",tu=1035,Vi=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let s=0,o=n.length;s>8&255]+Et[r>>16&255]+Et[r>>24&255]+"-"+Et[e&255]+Et[e>>8&255]+"-"+Et[e>>16&15|64]+Et[e>>24&255]+"-"+Et[t&63|128]+Et[t>>8&255]+"-"+Et[t>>16&255]+Et[t>>24&255]+Et[i&255]+Et[i>>8&255]+Et[i>>16&255]+Et[i>>24&255]).toUpperCase()}function kt(r,e,t){return Math.max(e,Math.min(t,r))}function jx(r,e){return(r%e+e)%e}function xc(r,e,t){return(1-t)*r+t*e}function Cp(r){return(r&r-1)===0&&r!==0}function Xx(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}var ee=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*n+e.x,this.y=s*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};ee.prototype.isVector2=!0;var xt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=n,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],p=i[5],m=i[8],y=n[0],x=n[3],g=n[6],f=n[1],E=n[4],w=n[7],_=n[2],D=n[5],T=n[8];return s[0]=o*y+a*f+l*_,s[3]=o*x+a*E+l*D,s[6]=o*g+a*w+l*T,s[1]=c*y+u*f+h*_,s[4]=c*x+u*E+h*D,s[7]=c*g+u*w+h*T,s[2]=d*y+p*f+m*_,s[5]=d*x+p*E+m*D,s[8]=d*g+p*w+m*T,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+n*s*c-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,p=c*s-o*l,m=t*h+i*d+n*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/m;return e[0]=h*y,e[1]=(n*c-u*i)*y,e[2]=(a*i-n*o)*y,e[3]=d*y,e[4]=(u*t-n*l)*y,e[5]=(n*s-a*t)*y,e[6]=p*y,e[7]=(i*l-c*t)*y,e[8]=(o*t-i*s)*y,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-n*c,n*l,-n*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),n=this.elements,s=n[0],o=n[3],a=n[6],l=n[1],c=n[4],u=n[7];return n[0]=t*s+i*l,n[3]=t*o+i*c,n[6]=t*a+i*u,n[1]=-i*s+t*l,n[4]=-i*o+t*c,n[7]=-i*a+t*u,this}translate(e,t){let i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};xt.prototype.isMatrix3=!0;function Uf(r){for(let e=r.length-1;e>=0;--e)if(r[e]>65535)return!0;return!1}function Lr(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}var Hf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ti={h:0,s:0,l:0},Wo={h:0,s:0,l:0};function vc(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function Cs(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function wc(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var ye=class{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=jx(e,1),t=kt(t,0,1),i=kt(i,0,1),t===0)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,s=2*i-n;this.r=vc(s,n,e+1/3),this.g=vc(s,n,e),this.b=vc(s,n,e-1/3)}return this}setStyle(e){function t(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let n,s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(n[1])/360,l=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return t(n[4]),this.setHSL(a,l,c)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=i[1],s=n.length;if(s===3)return this.r=parseInt(n.charAt(0)+n.charAt(0),16)/255,this.g=parseInt(n.charAt(1)+n.charAt(1),16)/255,this.b=parseInt(n.charAt(2)+n.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(n.charAt(0)+n.charAt(1),16)/255,this.g=parseInt(n.charAt(2)+n.charAt(3),16)/255,this.b=parseInt(n.charAt(4)+n.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=Hf[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Cs(e.r),this.g=Cs(e.g),this.b=Cs(e.b),this}copyLinearToSRGB(e){return this.r=wc(e.r),this.g=wc(e.g),this.b=wc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,i=this.g,n=this.b,s=Math.max(t,i,n),o=Math.min(t,i,n),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(i-n)/u+(i"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{ss===void 0&&(ss=Lr("canvas")),ss.width=e.width,ss.height=e.height;let i=ss.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=ss}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Lr("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),s=n.data;for(let o=0;o1)switch(this.wrapS){case Qc:e.x=e.x-Math.floor(e.x);break;case Wt:e.x=e.x<0?0:1;break;case eu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Qc:e.y=e.y-Math.floor(e.y);break;case Wt:e.y=e.y<0?0:1;break;case eu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};at.DEFAULT_IMAGE=void 0;at.DEFAULT_MAPPING=Of;at.prototype.isTexture=!0;function bc(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Ui.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var $e=class{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,s,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],p=l[5],m=l[9],y=l[2],x=l[6],g=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-y)<.01&&Math.abs(m-x)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+y)<.1&&Math.abs(m+x)<.1&&Math.abs(c+p+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let E=(c+1)/2,w=(p+1)/2,_=(g+1)/2,D=(u+d)/4,T=(h+y)/4,O=(m+x)/4;return E>w&&E>_?E<.01?(i=0,n=.707106781,s=.707106781):(i=Math.sqrt(E),n=D/i,s=T/i):w>_?w<.01?(i=.707106781,n=0,s=.707106781):(n=Math.sqrt(w),i=D/n,s=O/n):_<.01?(i=.707106781,n=.707106781,s=0):(s=Math.sqrt(_),i=T/s,n=O/s),this.set(i,n,s,t),this}let f=Math.sqrt((x-m)*(x-m)+(h-y)*(h-y)+(d-u)*(d-u));return Math.abs(f)<.001&&(f=1),this.x=(x-m)/f,this.y=(h-y)/f,this.z=(d-u)/f,this.w=Math.acos((c+p+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};$e.prototype.isVector4=!0;var zt=class extends Vi{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new $e(0,0,e,t),this.scissorTest=!1,this.viewport=new $e(0,0,e,t),this.texture=new at(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Dt,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=Object.assign({},e.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}};zt.prototype.isWebGLRenderTarget=!0;var nu=class extends zt{constructor(e,t,i){super(e,t);let n=this.texture;this.texture=[];for(let s=0;s=0?1:-1,E=1-g*g;if(E>Number.EPSILON){let _=Math.sqrt(E),D=Math.atan2(_,g*f);x=Math.sin(x*D)/_,a=Math.sin(a*D)/_}let w=a*f;if(l=l*x+d*w,c=c*x+p*w,u=u*x+m*w,h=h*x+y*w,x===1-a){let _=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=_,c*=_,u*=_,h*=_}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,s,o){let a=i[n],l=i[n+1],c=i[n+2],u=i[n+3],h=s[o],d=s[o+1],p=s[o+2],m=s[o+3];return e[t]=a*m+u*h+l*p-c*d,e[t+1]=l*m+u*d+c*h-a*p,e[t+2]=c*m+u*p+a*d-l*h,e[t+3]=u*m-a*h-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=e._x,n=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(n/2),h=a(s/2),d=l(i/2),p=l(n/2),m=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h-d*p*m;break;case"YXZ":this._x=d*u*h+c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h+d*p*m;break;case"ZXY":this._x=d*u*h-c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h-d*p*m;break;case"ZYX":this._x=d*u*h-c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h+d*p*m;break;case"YZX":this._x=d*u*h+c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h-d*p*m;break;case"XZY":this._x=d*u*h-c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h+d*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){let p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(o-n)*p}else if(i>a&&i>h){let p=2*Math.sqrt(1+i-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(s+c)/p}else if(a>h){let p=2*Math.sqrt(1+a-i-h);this._w=(s-c)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+u)/p}else{let p=2*Math.sqrt(1+h-i-a);this._w=(o-n)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(kt(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+n*c-s*l,this._y=n*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-n*a,this._w=o*u-i*a-n*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,s=this._z,o=this._w,a=o*e._w+i*e._x+n*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=n,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=n*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(s),i*Math.cos(s),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Tt.prototype.isQuaternion=!0;var P=class{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Rp.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Rp.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*n,this.y=s[1]*t+s[4]*i+s[7]*n,this.z=s[2]*t+s[5]*i+s[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*n+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*n+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*n+s[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*n-a*i,u=l*i+a*t-s*n,h=l*n+s*i-o*t,d=-s*t-o*i-a*n;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n,this.y=s[1]*t+s[5]*i+s[9]*n,this.z=s[2]*t+s[6]*i+s[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=n*l-s*a,this.y=s*o-i*l,this.z=i*a-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return _c.copy(this).projectOnVector(e),this.sub(_c)}reflect(e){return this.sub(_c.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(kt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};P.prototype.isVector3=!0;var _c=new P,Rp=new Tt,$t=class{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,n=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,i,n),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,n=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,i,n),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Rn),Rn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fr),$o.subVectors(this.max,fr),rs.subVectors(e.a,fr),os.subVectors(e.b,fr),as.subVectors(e.c,fr),Qi.subVectors(os,rs),en.subVectors(as,os),Fn.subVectors(rs,as);let t=[0,-Qi.z,Qi.y,0,-en.z,en.y,0,-Fn.z,Fn.y,Qi.z,0,-Qi.x,en.z,0,-en.x,Fn.z,0,-Fn.x,-Qi.y,Qi.x,0,-en.y,en.x,0,-Fn.y,Fn.x,0];return!Ac(t,rs,os,as,$o)||(t=[1,0,0,0,1,0,0,0,1],!Ac(t,rs,os,as,$o))?!1:(jo.crossVectors(Qi,en),t=[jo.x,jo.y,jo.z],Ac(t,rs,os,as,$o))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Rn.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Rn).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Pi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};$t.prototype.isBox3=!0;var Pi=[new P,new P,new P,new P,new P,new P,new P,new P],Rn=new P,Ec=new $t,rs=new P,os=new P,as=new P,Qi=new P,en=new P,Fn=new P,fr=new P,$o=new P,jo=new P,Ln=new P;function Ac(r,e,t,i,n){for(let s=0,o=r.length-3;s<=o;s+=3){Ln.fromArray(r,s);let a=n.x*Math.abs(Ln.x)+n.y*Math.abs(Ln.y)+n.z*Math.abs(Ln.z),l=e.dot(Ln),c=t.dot(Ln),u=i.dot(Ln);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var Zx=new $t,Fp=new P,Xo=new P,Sc=new P,vi=class{constructor(e=new P,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):Zx.setFromPoints(e).getCenter(i);let n=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){Sc.subVectors(e,this.center);let t=Sc.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.add(Sc.multiplyScalar(n/i)),this.radius+=n}return this}union(e){return this.center.equals(e.center)===!0?Xo.set(0,0,1).multiplyScalar(e.radius):Xo.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Fp.copy(e.center).add(Xo)),this.expandByPoint(Fp.copy(e.center).sub(Xo)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Ii=new P,Mc=new P,Yo=new P,tn=new P,Dc=new P,Zo=new P,Tc=new P,mn=class{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ii)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Ii.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ii.copy(this.direction).multiplyScalar(t).add(this.origin),Ii.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Mc.copy(e).add(t).multiplyScalar(.5),Yo.copy(t).sub(e).normalize(),tn.copy(this.origin).sub(Mc);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Yo),a=tn.dot(this.direction),l=-tn.dot(Yo),c=tn.lengthSq(),u=Math.abs(1-o*o),h,d,p,m;if(u>0)if(h=o*l-a,d=o*a-l,m=s*u,h>=0)if(d>=-m)if(d<=m){let y=1/u;h*=y,d*=y,p=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d<=-m?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+d*(d+2*l)+c):d<=m?(h=0,d=Math.min(Math.max(-s,-l),s),p=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(Yo).multiplyScalar(d).add(Mc),p}intersectSphere(e,t){Ii.subVectors(e.center,this.origin);let i=Ii.dot(this.direction),n=Ii.dot(Ii)-i*i,s=e.radius*e.radius;if(n>s)return null;let o=Math.sqrt(s-n),a=i-o,l=i+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,n=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,n=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>n||((s>i||i!==i)&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>n)||((a>i||i!==i)&&(i=a),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Ii)!==null}intersectTriangle(e,t,i,n,s){Dc.subVectors(t,e),Zo.subVectors(i,e),Tc.crossVectors(Dc,Zo);let o=this.direction.dot(Tc),a;if(o>0){if(n)return null;a=1}else if(o<0)a=-1,o=-o;else return null;tn.subVectors(this.origin,e);let l=a*this.direction.dot(Zo.crossVectors(tn,Zo));if(l<0)return null;let c=a*this.direction.dot(Dc.cross(tn));if(c<0||l+c>o)return null;let u=-a*tn.dot(Tc);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Ee=class r{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,s,o,a,l,c,u,h,d,p,m,y,x){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=p,g[7]=m,g[11]=y,g[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/ls.setFromMatrixColumn(e,0).length(),s=1/ls.setFromMatrixColumn(e,1).length(),o=1/ls.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,i=e.x,n=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(n),c=Math.sin(n),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,p=o*h,m=a*u,y=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+m*c,t[5]=d-y*c,t[9]=-a*l,t[2]=y-d*c,t[6]=m+p*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,p=l*h,m=c*u,y=c*h;t[0]=d+y*a,t[4]=m*a-p,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=p*a-m,t[6]=y+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,p=l*h,m=c*u,y=c*h;t[0]=d-y*a,t[4]=-o*h,t[8]=m+p*a,t[1]=p+m*a,t[5]=o*u,t[9]=y-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,p=o*h,m=a*u,y=a*h;t[0]=l*u,t[4]=m*c-p,t[8]=d*c+y,t[1]=l*h,t[5]=y*c+d,t[9]=p*c-m,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,p=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=y-d*h,t[8]=m*h+p,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=p*h+m,t[10]=d-y*h}else if(e.order==="XZY"){let d=o*l,p=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+y,t[5]=o*u,t[9]=p*h-m,t[2]=m*h-p,t[6]=a*u,t[10]=y*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Jx,e,Kx)}lookAt(e,t,i){let n=this.elements;return Gt.subVectors(e,t),Gt.lengthSq()===0&&(Gt.z=1),Gt.normalize(),nn.crossVectors(i,Gt),nn.lengthSq()===0&&(Math.abs(i.z)===1?Gt.x+=1e-4:Gt.z+=1e-4,Gt.normalize(),nn.crossVectors(i,Gt)),nn.normalize(),Jo.crossVectors(Gt,nn),n[0]=nn.x,n[4]=Jo.x,n[8]=Gt.x,n[1]=nn.y,n[5]=Jo.y,n[9]=Gt.y,n[2]=nn.z,n[6]=Jo.z,n[10]=Gt.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],p=i[13],m=i[2],y=i[6],x=i[10],g=i[14],f=i[3],E=i[7],w=i[11],_=i[15],D=n[0],T=n[4],O=n[8],W=n[12],A=n[1],v=n[5],R=n[9],S=n[13],B=n[2],L=n[6],C=n[10],N=n[14],k=n[3],V=n[7],U=n[11],q=n[15];return s[0]=o*D+a*A+l*B+c*k,s[4]=o*T+a*v+l*L+c*V,s[8]=o*O+a*R+l*C+c*U,s[12]=o*W+a*S+l*N+c*q,s[1]=u*D+h*A+d*B+p*k,s[5]=u*T+h*v+d*L+p*V,s[9]=u*O+h*R+d*C+p*U,s[13]=u*W+h*S+d*N+p*q,s[2]=m*D+y*A+x*B+g*k,s[6]=m*T+y*v+x*L+g*V,s[10]=m*O+y*R+x*C+g*U,s[14]=m*W+y*S+x*N+g*q,s[3]=f*D+E*A+w*B+_*k,s[7]=f*T+E*v+w*L+_*V,s[11]=f*O+E*R+w*C+_*U,s[15]=f*W+E*S+w*N+_*q,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],p=e[14],m=e[3],y=e[7],x=e[11],g=e[15];return m*(+s*l*h-n*c*h-s*a*d+i*c*d+n*a*p-i*l*p)+y*(+t*l*p-t*c*d+s*o*d-n*o*p+n*c*u-s*l*u)+x*(+t*c*h-t*a*p-s*o*h+i*o*p+s*a*u-i*c*u)+g*(-n*a*u-t*l*h+t*a*d+n*o*h-i*o*d+i*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],m=e[12],y=e[13],x=e[14],g=e[15],f=h*x*c-y*d*c+y*l*p-a*x*p-h*l*g+a*d*g,E=m*d*c-u*x*c-m*l*p+o*x*p+u*l*g-o*d*g,w=u*y*c-m*h*c+m*a*p-o*y*p-u*a*g+o*h*g,_=m*h*l-u*y*l-m*a*d+o*y*d+u*a*x-o*h*x,D=t*f+i*E+n*w+s*_;if(D===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let T=1/D;return e[0]=f*T,e[1]=(y*d*s-h*x*s-y*n*p+i*x*p+h*n*g-i*d*g)*T,e[2]=(a*x*s-y*l*s+y*n*c-i*x*c-a*n*g+i*l*g)*T,e[3]=(h*l*s-a*d*s-h*n*c+i*d*c+a*n*p-i*l*p)*T,e[4]=E*T,e[5]=(u*x*s-m*d*s+m*n*p-t*x*p-u*n*g+t*d*g)*T,e[6]=(m*l*s-o*x*s-m*n*c+t*x*c+o*n*g-t*l*g)*T,e[7]=(o*d*s-u*l*s+u*n*c-t*d*c-o*n*p+t*l*p)*T,e[8]=w*T,e[9]=(m*h*s-u*y*s-m*i*p+t*y*p+u*i*g-t*h*g)*T,e[10]=(o*y*s-m*a*s+m*i*c-t*y*c-o*i*g+t*a*g)*T,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*p-t*a*p)*T,e[12]=_*T,e[13]=(u*y*n-m*h*n+m*i*d-t*y*d-u*i*x+t*h*x)*T,e[14]=(m*a*n-o*y*n-m*i*l+t*y*l+o*i*x-t*a*x)*T,e[15]=(o*h*n-u*a*n+u*i*l-t*h*l-o*i*d+t*a*d)*T,this}scale(e){let t=this.elements,i=e.x,n=e.y,s=e.z;return t[0]*=i,t[4]*=n,t[8]*=s,t[1]*=i,t[5]*=n,t[9]*=s,t[2]*=i,t[6]*=n,t[10]*=s,t[3]*=i,t[7]*=n,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-n*l,c*l+n*a,0,c*a+n*l,u*a+i,u*l-n*o,0,c*l-n*a,u*l+n*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,s,o){return this.set(1,i,s,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,p=s*u,m=s*h,y=o*u,x=o*h,g=a*h,f=l*c,E=l*u,w=l*h,_=i.x,D=i.y,T=i.z;return n[0]=(1-(y+g))*_,n[1]=(p+w)*_,n[2]=(m-E)*_,n[3]=0,n[4]=(p-w)*D,n[5]=(1-(d+g))*D,n[6]=(x+f)*D,n[7]=0,n[8]=(m+E)*T,n[9]=(x-f)*T,n[10]=(1-(d+y))*T,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,s=ls.set(n[0],n[1],n[2]).length(),o=ls.set(n[4],n[5],n[6]).length(),a=ls.set(n[8],n[9],n[10]).length();this.determinant()<0&&(s=-s),e.x=n[12],e.y=n[13],e.z=n[14],ii.copy(this);let c=1/s,u=1/o,h=1/a;return ii.elements[0]*=c,ii.elements[1]*=c,ii.elements[2]*=c,ii.elements[4]*=u,ii.elements[5]*=u,ii.elements[6]*=u,ii.elements[8]*=h,ii.elements[9]*=h,ii.elements[10]*=h,t.setFromRotationMatrix(ii),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,n,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(i-n),u=(t+e)/(t-e),h=(i+n)/(i-n),d=-(o+s)/(o-s),p=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,n,s,o){let a=this.elements,l=1/(t-e),c=1/(i-n),u=1/(o-s),h=(t+e)*l,d=(i+n)*c,p=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ee.prototype.isMatrix4=!0;var ls=new P,ii=new Ee,Jx=new P(0,0,0),Kx=new P(1,1,1),nn=new P,Jo=new P,Gt=new P,Lp=new Ee,Bp=new Tt,Bs=class r{constructor(e=0,t=0,i=0,n=r.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let n=e.elements,s=n[0],o=n[4],a=n[8],l=n[1],c=n[5],u=n[9],h=n[2],d=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(kt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-kt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(kt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-kt(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(kt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-kt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return Lp.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Lp,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Bp.setFromEuler(this),this.setFromQuaternion(Bp,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new P(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Bs.prototype.isEuler=!0;Bs.DefaultOrder="XYZ";Bs.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Ca=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0){n.children=[];for(let a=0;a0){n.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),p.length>0&&(i.animations=p)}return i.object=n,i;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?n.multiplyScalar(1/Math.sqrt(s)):n.set(0,0,0)}static getBarycoord(e,t,i,n,s){ni.subVectors(n,t),ki.subVectors(i,t),Cc.subVectors(e,t);let o=ni.dot(ni),a=ni.dot(ki),l=ni.dot(Cc),c=ki.dot(ki),u=ki.dot(Cc),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,p=(c*l-a*u)*d,m=(o*u-a*l)*d;return s.set(1-p-m,m,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,zi),zi.x>=0&&zi.y>=0&&zi.x+zi.y<=1}static getUV(e,t,i,n,s,o,a,l){return this.getBarycoord(e,t,i,n,zi),l.set(0,0),l.addScaledVector(s,zi.x),l.addScaledVector(o,zi.y),l.addScaledVector(a,zi.z),l}static isFrontFacing(e,t,i,n){return ni.subVectors(i,t),ki.subVectors(e,t),ni.cross(ki).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ni.subVectors(this.c,this.b),ki.subVectors(this.a,this.b),ni.cross(ki).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,s){return r.getUV(e,this.a,this.b,this.c,t,i,n,s)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,s=this.c,o,a;us.subVectors(n,i),hs.subVectors(s,i),Rc.subVectors(e,i);let l=us.dot(Rc),c=hs.dot(Rc);if(l<=0&&c<=0)return t.copy(i);Fc.subVectors(e,n);let u=us.dot(Fc),h=hs.dot(Fc);if(u>=0&&h<=u)return t.copy(n);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(us,o);Lc.subVectors(e,s);let p=us.dot(Lc),m=hs.dot(Lc);if(m>=0&&p<=m)return t.copy(s);let y=p*c-l*m;if(y<=0&&c>=0&&m<=0)return a=c/(c-m),t.copy(i).addScaledVector(hs,a);let x=u*m-p*h;if(x<=0&&h-u>=0&&p-m>=0)return Op.subVectors(s,n),a=(h-u)/(h-u+(p-m)),t.copy(n).addScaledVector(Op,a);let g=1/(x+y+d);return o=y*g,a=d*g,t.copy(i).addScaledVector(us,o).addScaledVector(hs,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},nv=0,dt=class extends Vi{constructor(){super(),Object.defineProperty(this,"id",{value:nv++}),this.uuid=ri(),this.name="",this.type="Material",this.fog=!0,this.blending=Sr,this.side=Cr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=kf,this.blendDst=zf,this.blendEquation=Es,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Zc,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=$x,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=gc,this.stencilZFail=gc,this.stencilZPass=gc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===Nf;continue}let n=this[t];if(n===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Sr&&(i.blending=this.blending),this.side!==Cr&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function n(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=n(e.textures),o=n(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let s=0;s!==n;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};dt.prototype.isMaterial=!0;var Pr=class extends dt{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=el,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Pr.prototype.isMeshBasicMaterial=!0;var Je=new P,Qo=new ee,ut=class{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i===!0,this.usage=Fr,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,s=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let c=i[l];e.data.attributes[l]=c.toJSON(e.data)}let n={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(n[l]=u,s=!0)}s&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let c in n){let u=n[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,p=h.length;d0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let i=this.geometry,n=this.material,s=this.matrixWorld;if(n===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),Pc.copy(i.boundingSphere),Pc.applyMatrix4(s),e.ray.intersectsSphere(Pc)===!1)||(Vp.copy(s).invert(),ps.copy(e.ray).applyMatrix4(Vp),i.boundingBox!==null&&ps.intersectsBox(i.boundingBox)===!1))return;let o;if(i.isBufferGeometry){let a=i.index,l=i.attributes.position,c=i.morphAttributes.position,u=i.morphTargetsRelative,h=i.attributes.uv,d=i.attributes.uv2,p=i.groups,m=i.drawRange;if(a!==null)if(Array.isArray(n))for(let y=0,x=p.length;yt.far?null:{distance:c,point:oa.clone(),object:r}}function aa(r,e,t,i,n,s,o,a,l,c,u,h){sn.fromBufferAttribute(n,c),rn.fromBufferAttribute(n,u),on.fromBufferAttribute(n,h);let d=r.morphTargetInfluences;if(s&&d){ea.set(0,0,0),ta.set(0,0,0),ia.set(0,0,0);for(let m=0,y=s.length;m0?1:-1,u.push(V.x,V.y,V.z),h.push(j/T),h.push(1-U/O),N+=1}}for(let U=0;U{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.isNone=Wt.isSome=Wt.None=Wt.Some=Wt.OptionType=void 0;Wt.OptionType={Some:Symbol(":some"),None:Symbol(":none")};function OE(r){return typeof r>"u"?xo():eg(r)}Wt.Some=OE;Wt.None=xo();function eg(r){return{type:Wt.OptionType.Some,isSome(){return!0},isNone(){return!1},match(e){return e.some(r)},map(e){return eg(e(r))},andThen(e){return e(r)},or(e){return this},and(e){return e},unwrapOr(e){return r},unwrap(){return r}}}function xo(){return{type:Wt.OptionType.None,isSome(){return!1},isNone(){return!0},match(r){let{none:e}=r;return typeof e=="function"?e():e},map(r){return xo()},andThen(r){return xo()},or(r){return r},and(r){return xo()},unwrapOr(r){if(r==null)throw new Error("Cannot call unwrapOr with a missing value.");return r},unwrap(){throw new ReferenceError("Trying to unwrap None.")}}}function zE(r){return r.isSome()}Wt.isSome=zE;function VE(r){return r.isNone()}Wt.isNone=VE});var tg=_i($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.isRight=$t.isLeft=$t.Right=$t.Left=$t.EitherType=void 0;var ql=Gl();$t.EitherType={Left:Symbol(":left"),Right:Symbol(":right")};function vo(r){return{type:$t.EitherType.Left,isLeft(){return!0},isRight(){return!1},left(){return(0,ql.Some)(r)},leftAndThen(e){return e(r)},right(){return ql.None},rightAndThen(e){return vo(r)},unwrap(){return r},unwrapLeft(){return r},unwrapLeftOr(e){return r},unwrapLeftOrElse(e){return r},unwrapRight(){throw new ReferenceError("Cannot unwrap Right value of Either.Left")},unwrapRightOr(e){return e},unwrapRightOrElse(e){return e(r)},match(e){return e.left(r)},map(e){return vo(e(r))},mapLeft(e){return vo(e(r))},mapRight(e){return vo(r)}}}$t.Left=vo;function wo(r){return{type:$t.EitherType.Right,isLeft(){return!1},isRight(){return!0},left(){return ql.None},leftAndThen(e){return wo(r)},right(){return(0,ql.Some)(r)},rightAndThen(e){return e(r)},unwrap(){return r},unwrapLeft(){throw new ReferenceError("Cannot unwrap Left value of Either.Right")},unwrapLeftOr(e){return e},unwrapLeftOrElse(e){return e(r)},unwrapRight(){return r},unwrapRightOr(e){return r},unwrapRightOrElse(e){return r},match(e){return e.right(r)},map(e){return wo(e(r))},mapLeft(e){return wo(r)},mapRight(e){return wo(e(r))}}}$t.Right=wo;function UE(r){return r.isLeft()}$t.isLeft=UE;function HE(r){return r.isRight()}$t.isRight=HE});var ig=_i(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.isErr=jt.isOk=jt.Err=jt.Ok=jt.ResultType=void 0;var jl=Gl();jt.ResultType={Ok:Symbol(":ok"),Err:Symbol(":err")};function Wl(r){return{type:jt.ResultType.Ok,isOk(){return!0},isErr(){return!1},ok(){return(0,jl.Some)(r)},err(){return jl.None},unwrap(){return r},unwrapOr(e){return r},unwrapOrElse(e){return r},unwrapErr(){throw new ReferenceError("Cannot unwrap Err value of Result.Ok")},match(e){return e.ok(r)},map(e){return Wl(e(r))},mapErr(e){return Wl(r)},andThen(e){return e(r)},orElse(e){return Wl(r)}}}jt.Ok=Wl;function $l(r){return{type:jt.ResultType.Err,isOk(){return!1},isErr(){return!0},ok(){return jl.None},err(){return(0,jl.Some)(r)},unwrap(){throw new ReferenceError("Cannot unwrap Ok value of Result.Err")},unwrapOr(e){return e},unwrapOrElse(e){return e(r)},unwrapErr(){return r},match(e){return e.err(r)},map(e){return $l(r)},mapErr(e){return $l(e(r))},andThen(e){return $l(r)},orElse(e){return e(r)}}}jt.Err=$l;function GE(r){return r.isOk()}jt.isOk=GE;function qE(r){return r.isErr()}jt.isErr=qE});var td=_i(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Ok=Qe.isOk=Qe.isErr=Qe.Err=Qe.Some=Qe.None=Qe.isSome=Qe.isNone=Qe.Right=Qe.Left=Qe.isRight=Qe.isLeft=void 0;var Xl=tg();Object.defineProperty(Qe,"isLeft",{enumerable:!0,get:function(){return Xl.isLeft}});Object.defineProperty(Qe,"isRight",{enumerable:!0,get:function(){return Xl.isRight}});Object.defineProperty(Qe,"Left",{enumerable:!0,get:function(){return Xl.Left}});Object.defineProperty(Qe,"Right",{enumerable:!0,get:function(){return Xl.Right}});var Yl=Gl();Object.defineProperty(Qe,"isNone",{enumerable:!0,get:function(){return Yl.isNone}});Object.defineProperty(Qe,"isSome",{enumerable:!0,get:function(){return Yl.isSome}});Object.defineProperty(Qe,"None",{enumerable:!0,get:function(){return Yl.None}});Object.defineProperty(Qe,"Some",{enumerable:!0,get:function(){return Yl.Some}});var Zl=ig();Object.defineProperty(Qe,"Err",{enumerable:!0,get:function(){return Zl.Err}});Object.defineProperty(Qe,"isErr",{enumerable:!0,get:function(){return Zl.isErr}});Object.defineProperty(Qe,"isOk",{enumerable:!0,get:function(){return Zl.isOk}});Object.defineProperty(Qe,"Ok",{enumerable:!0,get:function(){return Zl.Ok}})});var ng=_i(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});require("obsidian");var WE=r=>{var e;return r?(e=r.plugins.plugins.dataview)===null||e===void 0?void 0:e.api:window.DataviewAPI},$E=r=>r.plugins.enabledPlugins.has("dataview");Jl.getAPI=WE;Jl.isPluginEnabled=$E});var lg=_i((Ql,_o)=>{(function(r){var e=typeof Ql=="object"&&Ql,t=typeof _o=="object"&&_o&&_o.exports==e&&_o,i=typeof global=="object"&&global;(i.global===i||i.window===i)&&(r=i);var n=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\x01-\x7F]/g,o=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,a=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,l={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline",_:"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent",$:"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr",\u00AA:"ordf",\u00E1:"aacute",\u00C1:"Aacute",\u00E0:"agrave",\u00C0:"Agrave",\u0103:"abreve",\u0102:"Abreve",\u00E2:"acirc",\u00C2:"Acirc",\u00E5:"aring",\u00C5:"angst",\u00E4:"auml",\u00C4:"Auml",\u00E3:"atilde",\u00C3:"Atilde",\u0105:"aogon",\u0104:"Aogon",\u0101:"amacr",\u0100:"Amacr",\u00E6:"aelig",\u00C6:"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf",\u212C:"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf",\u212D:"Cfr","\u{1D49E}":"Cscr",\u2102:"Copf",\u0107:"cacute",\u0106:"Cacute",\u0109:"ccirc",\u0108:"Ccirc",\u010D:"ccaron",\u010C:"Ccaron",\u010B:"cdot",\u010A:"Cdot",\u00E7:"ccedil",\u00C7:"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf",\u010F:"dcaron",\u010E:"Dcaron",\u0111:"dstrok",\u0110:"Dstrok",\u00F0:"eth",\u00D0:"ETH","\u2147":"ee",\u212F:"escr","\u{1D522}":"efr","\u{1D556}":"eopf",\u2130:"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf",\u00E9:"eacute",\u00C9:"Eacute",\u00E8:"egrave",\u00C8:"Egrave",\u00EA:"ecirc",\u00CA:"Ecirc",\u011B:"ecaron",\u011A:"Ecaron",\u00EB:"euml",\u00CB:"Euml",\u0117:"edot",\u0116:"Edot",\u0119:"eogon",\u0118:"Eogon",\u0113:"emacr",\u0112:"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf",\u2131:"Fscr",\uFB00:"fflig",\uFB03:"ffilig",\uFB04:"ffllig",\uFB01:"filig",fj:"fjlig",\uFB02:"fllig",\u0192:"fnof",\u210A:"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr",\u01F5:"gacute",\u011F:"gbreve",\u011E:"Gbreve",\u011D:"gcirc",\u011C:"Gcirc",\u0121:"gdot",\u0120:"Gdot",\u0122:"Gcedil","\u{1D525}":"hfr",\u210E:"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf",\u210B:"Hscr",\u210C:"Hfr",\u210D:"Hopf",\u0125:"hcirc",\u0124:"Hcirc",\u210F:"hbar",\u0127:"hstrok",\u0126:"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf",\u2110:"Iscr",\u2111:"Im",\u00ED:"iacute",\u00CD:"Iacute",\u00EC:"igrave",\u00CC:"Igrave",\u00EE:"icirc",\u00CE:"Icirc",\u00EF:"iuml",\u00CF:"Iuml",\u0129:"itilde",\u0128:"Itilde",\u0130:"Idot",\u012F:"iogon",\u012E:"Iogon",\u012B:"imacr",\u012A:"Imacr",\u0133:"ijlig",\u0132:"IJlig",\u0131:"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf",\u0135:"jcirc",\u0134:"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr",\u0137:"kcedil",\u0136:"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr",\u2113:"ell","\u{1D55D}":"lopf",\u2112:"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf",\u013A:"lacute",\u0139:"Lacute",\u013E:"lcaron",\u013D:"Lcaron",\u013C:"lcedil",\u013B:"Lcedil",\u0142:"lstrok",\u0141:"Lstrok",\u0140:"lmidot",\u013F:"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf",\u2133:"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr",\u2115:"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr",\u0144:"nacute",\u0143:"Nacute",\u0148:"ncaron",\u0147:"Ncaron",\u00F1:"ntilde",\u00D1:"Ntilde",\u0146:"ncedil",\u0145:"Ncedil","\u2116":"numero",\u014B:"eng",\u014A:"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr",\u2134:"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf",\u00BA:"ordm",\u00F3:"oacute",\u00D3:"Oacute",\u00F2:"ograve",\u00D2:"Ograve",\u00F4:"ocirc",\u00D4:"Ocirc",\u00F6:"ouml",\u00D6:"Ouml",\u0151:"odblac",\u0150:"Odblac",\u00F5:"otilde",\u00D5:"Otilde",\u00F8:"oslash",\u00D8:"Oslash",\u014D:"omacr",\u014C:"Omacr",\u0153:"oelig",\u0152:"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf",\u2119:"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr",\u211A:"Qopf",\u0138:"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr",\u211B:"Rscr",\u211C:"Re",\u211D:"Ropf",\u0155:"racute",\u0154:"Racute",\u0159:"rcaron",\u0158:"Rcaron",\u0157:"rcedil",\u0156:"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS",\u015B:"sacute",\u015A:"Sacute",\u015D:"scirc",\u015C:"Scirc",\u0161:"scaron",\u0160:"Scaron",\u015F:"scedil",\u015E:"Scedil",\u00DF:"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf",\u0165:"tcaron",\u0164:"Tcaron",\u0163:"tcedil",\u0162:"Tcedil","\u2122":"trade",\u0167:"tstrok",\u0166:"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr",\u00FA:"uacute",\u00DA:"Uacute",\u00F9:"ugrave",\u00D9:"Ugrave",\u016D:"ubreve",\u016C:"Ubreve",\u00FB:"ucirc",\u00DB:"Ucirc",\u016F:"uring",\u016E:"Uring",\u00FC:"uuml",\u00DC:"Uuml",\u0171:"udblac",\u0170:"Udblac",\u0169:"utilde",\u0168:"Utilde",\u0173:"uogon",\u0172:"Uogon",\u016B:"umacr",\u016A:"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr",\u0175:"wcirc",\u0174:"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf",\u00FD:"yacute",\u00DD:"Yacute",\u0177:"ycirc",\u0176:"Ycirc",\u00FF:"yuml",\u0178:"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf",\u2128:"Zfr",\u2124:"Zopf","\u{1D4B5}":"Zscr",\u017A:"zacute",\u0179:"Zacute",\u017E:"zcaron",\u017D:"Zcaron",\u017C:"zdot",\u017B:"Zdot",\u01B5:"imped",\u00FE:"thorn",\u00DE:"THORN",\u0149:"napos",\u03B1:"alpha",\u0391:"Alpha",\u03B2:"beta",\u0392:"Beta",\u03B3:"gamma",\u0393:"Gamma",\u03B4:"delta",\u0394:"Delta",\u03B5:"epsi","\u03F5":"epsiv",\u0395:"Epsilon",\u03DD:"gammad",\u03DC:"Gammad",\u03B6:"zeta",\u0396:"Zeta",\u03B7:"eta",\u0397:"Eta",\u03B8:"theta",\u03D1:"thetav",\u0398:"Theta",\u03B9:"iota",\u0399:"Iota",\u03BA:"kappa",\u03F0:"kappav",\u039A:"Kappa",\u03BB:"lambda",\u039B:"Lambda",\u03BC:"mu",\u00B5:"micro",\u039C:"Mu",\u03BD:"nu",\u039D:"Nu",\u03BE:"xi",\u039E:"Xi",\u03BF:"omicron",\u039F:"Omicron",\u03C0:"pi",\u03D6:"piv",\u03A0:"Pi",\u03C1:"rho",\u03F1:"rhov",\u03A1:"Rho",\u03C3:"sigma",\u03A3:"Sigma",\u03C2:"sigmaf",\u03C4:"tau",\u03A4:"Tau",\u03C5:"upsi",\u03A5:"Upsilon",\u03D2:"Upsi",\u03C6:"phi",\u03D5:"phiv",\u03A6:"Phi",\u03C7:"chi",\u03A7:"Chi",\u03C8:"psi",\u03A8:"Psi",\u03C9:"omega",\u03A9:"ohm",\u0430:"acy",\u0410:"Acy",\u0431:"bcy",\u0411:"Bcy",\u0432:"vcy",\u0412:"Vcy",\u0433:"gcy",\u0413:"Gcy",\u0453:"gjcy",\u0403:"GJcy",\u0434:"dcy",\u0414:"Dcy",\u0452:"djcy",\u0402:"DJcy",\u0435:"iecy",\u0415:"IEcy",\u0451:"iocy",\u0401:"IOcy",\u0454:"jukcy",\u0404:"Jukcy",\u0436:"zhcy",\u0416:"ZHcy",\u0437:"zcy",\u0417:"Zcy",\u0455:"dscy",\u0405:"DScy",\u0438:"icy",\u0418:"Icy",\u0456:"iukcy",\u0406:"Iukcy",\u0457:"yicy",\u0407:"YIcy",\u0439:"jcy",\u0419:"Jcy",\u0458:"jsercy",\u0408:"Jsercy",\u043A:"kcy",\u041A:"Kcy",\u045C:"kjcy",\u040C:"KJcy",\u043B:"lcy",\u041B:"Lcy",\u0459:"ljcy",\u0409:"LJcy",\u043C:"mcy",\u041C:"Mcy",\u043D:"ncy",\u041D:"Ncy",\u045A:"njcy",\u040A:"NJcy",\u043E:"ocy",\u041E:"Ocy",\u043F:"pcy",\u041F:"Pcy",\u0440:"rcy",\u0420:"Rcy",\u0441:"scy",\u0421:"Scy",\u0442:"tcy",\u0422:"Tcy",\u045B:"tshcy",\u040B:"TSHcy",\u0443:"ucy",\u0423:"Ucy",\u045E:"ubrcy",\u040E:"Ubrcy",\u0444:"fcy",\u0424:"Fcy",\u0445:"khcy",\u0425:"KHcy",\u0446:"tscy",\u0426:"TScy",\u0447:"chcy",\u0427:"CHcy",\u045F:"dzcy",\u040F:"DZcy",\u0448:"shcy",\u0428:"SHcy",\u0449:"shchcy",\u0429:"SHCHcy",\u044A:"hardcy",\u042A:"HARDcy",\u044B:"ycy",\u042B:"Ycy",\u044C:"softcy",\u042C:"SOFTcy",\u044D:"ecy",\u042D:"Ecy",\u044E:"yucy",\u042E:"YUcy",\u044F:"yacy",\u042F:"YAcy",\u2135:"aleph",\u2136:"beth",\u2137:"gimel",\u2138:"daleth"},c=/["&'<>`]/g,u={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"},h=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,d=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,m={aacute:"\xE1",Aacute:"\xC1",abreve:"\u0103",Abreve:"\u0102",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",acy:"\u0430",Acy:"\u0410",aelig:"\xE6",AElig:"\xC6",af:"\u2061",afr:"\u{1D51E}",Afr:"\u{1D504}",agrave:"\xE0",Agrave:"\xC0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",Alpha:"\u0391",amacr:"\u0101",Amacr:"\u0100",amalg:"\u2A3F",amp:"&",AMP:"&",and:"\u2227",And:"\u2A53",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",Aogon:"\u0104",aopf:"\u{1D552}",Aopf:"\u{1D538}",ap:"\u2248",apacir:"\u2A6F",ape:"\u224A",apE:"\u2A70",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",Aring:"\xC5",ascr:"\u{1D4B6}",Ascr:"\u{1D49C}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",Bcy:"\u0411",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",beta:"\u03B2",Beta:"\u0392",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",Bfr:"\u{1D505}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bNot:"\u2AED",bopf:"\u{1D553}",Bopf:"\u{1D539}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxhD:"\u2565",boxHd:"\u2564",boxHD:"\u2566",boxhu:"\u2534",boxhU:"\u2568",boxHu:"\u2567",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",Bscr:"\u212C",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpe:"\u224F",bumpE:"\u2AAE",bumpeq:"\u224F",Bumpeq:"\u224E",cacute:"\u0107",Cacute:"\u0106",cap:"\u2229",Cap:"\u22D2",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",ccaron:"\u010D",Ccaron:"\u010C",ccedil:"\xE7",Ccedil:"\xC7",ccirc:"\u0109",Ccirc:"\u0108",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",Cdot:"\u010A",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",CenterDot:"\xB7",cfr:"\u{1D520}",Cfr:"\u212D",chcy:"\u0447",CHcy:"\u0427",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",Chi:"\u03A7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cire:"\u2257",cirE:"\u29C3",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",colone:"\u2254",Colone:"\u2A74",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",conint:"\u222E",Conint:"\u222F",ContourIntegral:"\u222E",copf:"\u{1D554}",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xA9",COPY:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",cross:"\u2717",Cross:"\u2A2F",cscr:"\u{1D4B8}",Cscr:"\u{1D49E}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",Cup:"\u22D3",cupbrcap:"\u2A48",cupcap:"\u2A46",CupCap:"\u224D",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",dArr:"\u21D3",Darr:"\u21A1",dash:"\u2010",dashv:"\u22A3",Dashv:"\u2AE4",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",Dcaron:"\u010E",dcy:"\u0434",Dcy:"\u0414",dd:"\u2146",DD:"\u2145",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",delta:"\u03B4",Delta:"\u0394",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",Dfr:"\u{1D507}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",diamond:"\u22C4",Diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",DJcy:"\u0402",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",Dopf:"\u{1D53B}",dot:"\u02D9",Dot:"\xA8",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",downarrow:"\u2193",Downarrow:"\u21D3",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",Dscr:"\u{1D49F}",dscy:"\u0455",DScy:"\u0405",dsol:"\u29F6",dstrok:"\u0111",Dstrok:"\u0110",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",DZcy:"\u040F",dzigrarr:"\u27FF",eacute:"\xE9",Eacute:"\xC9",easter:"\u2A6E",ecaron:"\u011B",Ecaron:"\u011A",ecir:"\u2256",ecirc:"\xEA",Ecirc:"\xCA",ecolon:"\u2255",ecy:"\u044D",Ecy:"\u042D",eDDot:"\u2A77",edot:"\u0117",eDot:"\u2251",Edot:"\u0116",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",Efr:"\u{1D508}",eg:"\u2A9A",egrave:"\xE8",Egrave:"\xC8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",Emacr:"\u0112",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",eng:"\u014B",ENG:"\u014A",ensp:"\u2002",eogon:"\u0119",Eogon:"\u0118",eopf:"\u{1D556}",Eopf:"\u{1D53C}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",Epsilon:"\u0395",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",escr:"\u212F",Escr:"\u2130",esdot:"\u2250",esim:"\u2242",Esim:"\u2A73",eta:"\u03B7",Eta:"\u0397",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",Fcy:"\u0424",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",Ffr:"\u{1D509}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",Fopf:"\u{1D53D}",forall:"\u2200",ForAll:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",Fscr:"\u2131",gacute:"\u01F5",gamma:"\u03B3",Gamma:"\u0393",gammad:"\u03DD",Gammad:"\u03DC",gap:"\u2A86",gbreve:"\u011F",Gbreve:"\u011E",Gcedil:"\u0122",gcirc:"\u011D",Gcirc:"\u011C",gcy:"\u0433",Gcy:"\u0413",gdot:"\u0121",Gdot:"\u0120",ge:"\u2265",gE:"\u2267",gel:"\u22DB",gEl:"\u2A8C",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",Gfr:"\u{1D50A}",gg:"\u226B",Gg:"\u22D9",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",GJcy:"\u0403",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gnE:"\u2269",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",Gopf:"\u{1D53E}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",gscr:"\u210A",Gscr:"\u{1D4A2}",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",Gt:"\u226B",GT:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",HARDcy:"\u042A",harr:"\u2194",hArr:"\u21D4",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",hcirc:"\u0125",Hcirc:"\u0124",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",Hfr:"\u210C",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",Hopf:"\u210D",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\u{1D4BD}",Hscr:"\u210B",hslash:"\u210F",hstrok:"\u0127",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",Iacute:"\xCD",ic:"\u2063",icirc:"\xEE",Icirc:"\xCE",icy:"\u0438",Icy:"\u0418",Idot:"\u0130",iecy:"\u0435",IEcy:"\u0415",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",Ifr:"\u2111",igrave:"\xEC",Igrave:"\xCC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",IJlig:"\u0132",Im:"\u2111",imacr:"\u012B",Imacr:"\u012A",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",Int:"\u222C",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",iocy:"\u0451",IOcy:"\u0401",iogon:"\u012F",Iogon:"\u012E",iopf:"\u{1D55A}",Iopf:"\u{1D540}",iota:"\u03B9",Iota:"\u0399",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",Iscr:"\u2110",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",Itilde:"\u0128",iukcy:"\u0456",Iukcy:"\u0406",iuml:"\xEF",Iuml:"\xCF",jcirc:"\u0135",Jcirc:"\u0134",jcy:"\u0439",Jcy:"\u0419",jfr:"\u{1D527}",Jfr:"\u{1D50D}",jmath:"\u0237",jopf:"\u{1D55B}",Jopf:"\u{1D541}",jscr:"\u{1D4BF}",Jscr:"\u{1D4A5}",jsercy:"\u0458",Jsercy:"\u0408",jukcy:"\u0454",Jukcy:"\u0404",kappa:"\u03BA",Kappa:"\u039A",kappav:"\u03F0",kcedil:"\u0137",Kcedil:"\u0136",kcy:"\u043A",Kcy:"\u041A",kfr:"\u{1D528}",Kfr:"\u{1D50E}",kgreen:"\u0138",khcy:"\u0445",KHcy:"\u0425",kjcy:"\u045C",KJcy:"\u040C",kopf:"\u{1D55C}",Kopf:"\u{1D542}",kscr:"\u{1D4C0}",Kscr:"\u{1D4A6}",lAarr:"\u21DA",lacute:"\u013A",Lacute:"\u0139",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",Lambda:"\u039B",lang:"\u27E8",Lang:"\u27EA",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",larr:"\u2190",lArr:"\u21D0",Larr:"\u219E",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",lAtail:"\u291B",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lBarr:"\u290E",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",Lcaron:"\u013D",lcedil:"\u013C",Lcedil:"\u013B",lceil:"\u2308",lcub:"{",lcy:"\u043B",Lcy:"\u041B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27E8",leftarrow:"\u2190",Leftarrow:"\u21D0",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",Leftrightarrow:"\u21D4",LeftRightArrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",leg:"\u22DA",lEg:"\u2A8B",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",Lfr:"\u{1D50F}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",LJcy:"\u0409",ll:"\u226A",Ll:"\u22D8",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",Lmidot:"\u013F",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lnE:"\u2268",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",Longleftarrow:"\u27F8",LongLeftArrow:"\u27F5",longleftrightarrow:"\u27F7",Longleftrightarrow:"\u27FA",LongLeftRightArrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",Longrightarrow:"\u27F9",LongRightArrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",Lopf:"\u{1D543}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",Lscr:"\u2112",lsh:"\u21B0",Lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",Lstrok:"\u0141",lt:"<",Lt:"\u226A",LT:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",Map:"\u2905",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",Mcy:"\u041C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",mfr:"\u{1D52A}",Mfr:"\u{1D510}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",Mopf:"\u{1D544}",mp:"\u2213",mscr:"\u{1D4C2}",Mscr:"\u2133",mstpos:"\u223E",mu:"\u03BC",Mu:"\u039C",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",nacute:"\u0144",Nacute:"\u0143",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",Ncaron:"\u0147",ncedil:"\u0146",Ncedil:"\u0145",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",Ncy:"\u041D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21D7",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:` +`,nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",Nfr:"\u{1D511}",nge:"\u2271",ngE:"\u2267\u0338",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",ngt:"\u226F",nGt:"\u226B\u20D2",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",NJcy:"\u040A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nle:"\u2270",nlE:"\u2266\u0338",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nlt:"\u226E",nLt:"\u226A\u20D2",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",not:"\xAC",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",Nscr:"\u{1D4A9}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsube:"\u2288",nsubE:"\u2AC5\u0338",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupe:"\u2289",nsupE:"\u2AC6\u0338",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",Ntilde:"\xD1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",Nu:"\u039D",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",oacute:"\xF3",Oacute:"\xD3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",Ocirc:"\xD4",ocy:"\u043E",Ocy:"\u041E",odash:"\u229D",odblac:"\u0151",Odblac:"\u0150",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",OElig:"\u0152",ofcir:"\u29BF",ofr:"\u{1D52C}",Ofr:"\u{1D512}",ogon:"\u02DB",ograve:"\xF2",Ograve:"\xD2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",Omacr:"\u014C",omega:"\u03C9",Omega:"\u03A9",omicron:"\u03BF",Omicron:"\u039F",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",Oopf:"\u{1D546}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",or:"\u2228",Or:"\u2A54",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",oscr:"\u2134",Oscr:"\u{1D4AA}",oslash:"\xF8",Oslash:"\xD8",osol:"\u2298",otilde:"\xF5",Otilde:"\xD5",otimes:"\u2297",Otimes:"\u2A37",otimesas:"\u2A36",ouml:"\xF6",Ouml:"\xD6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",pcy:"\u043F",Pcy:"\u041F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",Pfr:"\u{1D513}",phi:"\u03C6",Phi:"\u03A6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",Pi:"\u03A0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",popf:"\u{1D561}",Popf:"\u2119",pound:"\xA3",pr:"\u227A",Pr:"\u2ABB",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prE:"\u2AB3",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",Pscr:"\u{1D4AB}",psi:"\u03C8",Psi:"\u03A8",puncsp:"\u2008",qfr:"\u{1D52E}",Qfr:"\u{1D514}",qint:"\u2A0C",qopf:"\u{1D562}",Qopf:"\u211A",qprime:"\u2057",qscr:"\u{1D4C6}",Qscr:"\u{1D4AC}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',QUOT:'"',rAarr:"\u21DB",race:"\u223D\u0331",racute:"\u0155",Racute:"\u0154",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",Rang:"\u27EB",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rArr:"\u21D2",Rarr:"\u21A0",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",Rarrtl:"\u2916",rarrw:"\u219D",ratail:"\u291A",rAtail:"\u291C",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rBarr:"\u290F",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",Rcaron:"\u0158",rcedil:"\u0157",Rcedil:"\u0156",rceil:"\u2309",rcub:"}",rcy:"\u0440",Rcy:"\u0420",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",REG:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",Rfr:"\u211C",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",Rho:"\u03A1",rhov:"\u03F1",RightAngleBracket:"\u27E9",rightarrow:"\u2192",Rightarrow:"\u21D2",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",Ropf:"\u211D",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",rscr:"\u{1D4C7}",Rscr:"\u211B",rsh:"\u21B1",Rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",Sacute:"\u015A",sbquo:"\u201A",sc:"\u227B",Sc:"\u2ABC",scap:"\u2AB8",scaron:"\u0161",Scaron:"\u0160",sccue:"\u227D",sce:"\u2AB0",scE:"\u2AB4",scedil:"\u015F",Scedil:"\u015E",scirc:"\u015D",Scirc:"\u015C",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",Scy:"\u0421",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",searr:"\u2198",seArr:"\u21D8",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",Sfr:"\u{1D516}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",SHCHcy:"\u0429",shcy:"\u0448",SHcy:"\u0428",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",sigma:"\u03C3",Sigma:"\u03A3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",SOFTcy:"\u042C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",Sopf:"\u{1D54A}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",Sscr:"\u{1D4AE}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",Star:"\u22C6",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",Sub:"\u22D0",subdot:"\u2ABD",sube:"\u2286",subE:"\u2AC5",subedot:"\u2AC3",submult:"\u2AC1",subne:"\u228A",subnE:"\u2ACB",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",Subset:"\u22D0",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",sum:"\u2211",Sum:"\u2211",sung:"\u266A",sup:"\u2283",Sup:"\u22D1",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supE:"\u2AC6",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supne:"\u228B",supnE:"\u2ACC",supplus:"\u2AC0",supset:"\u2283",Supset:"\u22D1",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21D9",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",tau:"\u03C4",Tau:"\u03A4",tbrk:"\u23B4",tcaron:"\u0165",Tcaron:"\u0164",tcedil:"\u0163",Tcedil:"\u0162",tcy:"\u0442",Tcy:"\u0422",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",Tfr:"\u{1D517}",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",theta:"\u03B8",Theta:"\u0398",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",THORN:"\xDE",tilde:"\u02DC",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",Topf:"\u{1D54B}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",Tscr:"\u{1D4AF}",tscy:"\u0446",TScy:"\u0426",tshcy:"\u045B",TSHcy:"\u040B",tstrok:"\u0167",Tstrok:"\u0166",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uacute:"\xFA",Uacute:"\xDA",uarr:"\u2191",uArr:"\u21D1",Uarr:"\u219F",Uarrocir:"\u2949",ubrcy:"\u045E",Ubrcy:"\u040E",ubreve:"\u016D",Ubreve:"\u016C",ucirc:"\xFB",Ucirc:"\xDB",ucy:"\u0443",Ucy:"\u0423",udarr:"\u21C5",udblac:"\u0171",Udblac:"\u0170",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",Ufr:"\u{1D518}",ugrave:"\xF9",Ugrave:"\xD9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",Umacr:"\u016A",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",uogon:"\u0173",Uogon:"\u0172",uopf:"\u{1D566}",Uopf:"\u{1D54C}",uparrow:"\u2191",Uparrow:"\u21D1",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",updownarrow:"\u2195",Updownarrow:"\u21D5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03C5",Upsi:"\u03D2",upsih:"\u03D2",upsilon:"\u03C5",Upsilon:"\u03A5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",Uring:"\u016E",urtri:"\u25F9",uscr:"\u{1D4CA}",Uscr:"\u{1D4B0}",utdot:"\u22F0",utilde:"\u0169",Utilde:"\u0168",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",Uuml:"\xDC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",vArr:"\u21D5",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vBar:"\u2AE8",Vbar:"\u2AEB",vBarv:"\u2AE9",vcy:"\u0432",Vcy:"\u0412",vdash:"\u22A2",vDash:"\u22A8",Vdash:"\u22A9",VDash:"\u22AB",Vdashl:"\u2AE6",vee:"\u2228",Vee:"\u22C1",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",vfr:"\u{1D533}",Vfr:"\u{1D519}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",Vopf:"\u{1D54D}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",Vscr:"\u{1D4B1}",vsubne:"\u228A\uFE00",vsubnE:"\u2ACB\uFE00",vsupne:"\u228B\uFE00",vsupnE:"\u2ACC\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",wcirc:"\u0175",Wcirc:"\u0174",wedbar:"\u2A5F",wedge:"\u2227",Wedge:"\u22C0",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",Wfr:"\u{1D51A}",wopf:"\u{1D568}",Wopf:"\u{1D54E}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",Wscr:"\u{1D4B2}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",Xfr:"\u{1D51B}",xharr:"\u27F7",xhArr:"\u27FA",xi:"\u03BE",Xi:"\u039E",xlarr:"\u27F5",xlArr:"\u27F8",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",Xopf:"\u{1D54F}",xoplus:"\u2A01",xotime:"\u2A02",xrarr:"\u27F6",xrArr:"\u27F9",xscr:"\u{1D4CD}",Xscr:"\u{1D4B3}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",Yacute:"\xDD",yacy:"\u044F",YAcy:"\u042F",ycirc:"\u0177",Ycirc:"\u0176",ycy:"\u044B",Ycy:"\u042B",yen:"\xA5",yfr:"\u{1D536}",Yfr:"\u{1D51C}",yicy:"\u0457",YIcy:"\u0407",yopf:"\u{1D56A}",Yopf:"\u{1D550}",yscr:"\u{1D4CE}",Yscr:"\u{1D4B4}",yucy:"\u044E",YUcy:"\u042E",yuml:"\xFF",Yuml:"\u0178",zacute:"\u017A",Zacute:"\u0179",zcaron:"\u017E",Zcaron:"\u017D",zcy:"\u0437",Zcy:"\u0417",zdot:"\u017C",Zdot:"\u017B",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",zeta:"\u03B6",Zeta:"\u0396",zfr:"\u{1D537}",Zfr:"\u2128",zhcy:"\u0436",ZHcy:"\u0416",zigrarr:"\u21DD",zopf:"\u{1D56B}",Zopf:"\u2124",zscr:"\u{1D4CF}",Zscr:"\u{1D4B5}",zwj:"\u200D",zwnj:"\u200C"},y={aacute:"\xE1",Aacute:"\xC1",acirc:"\xE2",Acirc:"\xC2",acute:"\xB4",aelig:"\xE6",AElig:"\xC6",agrave:"\xE0",Agrave:"\xC0",amp:"&",AMP:"&",aring:"\xE5",Aring:"\xC5",atilde:"\xE3",Atilde:"\xC3",auml:"\xE4",Auml:"\xC4",brvbar:"\xA6",ccedil:"\xE7",Ccedil:"\xC7",cedil:"\xB8",cent:"\xA2",copy:"\xA9",COPY:"\xA9",curren:"\xA4",deg:"\xB0",divide:"\xF7",eacute:"\xE9",Eacute:"\xC9",ecirc:"\xEA",Ecirc:"\xCA",egrave:"\xE8",Egrave:"\xC8",eth:"\xF0",ETH:"\xD0",euml:"\xEB",Euml:"\xCB",frac12:"\xBD",frac14:"\xBC",frac34:"\xBE",gt:">",GT:">",iacute:"\xED",Iacute:"\xCD",icirc:"\xEE",Icirc:"\xCE",iexcl:"\xA1",igrave:"\xEC",Igrave:"\xCC",iquest:"\xBF",iuml:"\xEF",Iuml:"\xCF",laquo:"\xAB",lt:"<",LT:"<",macr:"\xAF",micro:"\xB5",middot:"\xB7",nbsp:"\xA0",not:"\xAC",ntilde:"\xF1",Ntilde:"\xD1",oacute:"\xF3",Oacute:"\xD3",ocirc:"\xF4",Ocirc:"\xD4",ograve:"\xF2",Ograve:"\xD2",ordf:"\xAA",ordm:"\xBA",oslash:"\xF8",Oslash:"\xD8",otilde:"\xF5",Otilde:"\xD5",ouml:"\xF6",Ouml:"\xD6",para:"\xB6",plusmn:"\xB1",pound:"\xA3",quot:'"',QUOT:'"',raquo:"\xBB",reg:"\xAE",REG:"\xAE",sect:"\xA7",shy:"\xAD",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",szlig:"\xDF",thorn:"\xFE",THORN:"\xDE",times:"\xD7",uacute:"\xFA",Uacute:"\xDA",ucirc:"\xFB",Ucirc:"\xDB",ugrave:"\xF9",Ugrave:"\xD9",uml:"\xA8",uuml:"\xFC",Uuml:"\xDC",yacute:"\xFD",Yacute:"\xDD",yen:"\xA5",yuml:"\xFF"},x={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},g=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],f=String.fromCharCode,E={},w=E.hasOwnProperty,_=function(N,k){return w.call(N,k)},M=function(N,k){for(var V=-1,U=N.length;++V=55296&&N<=57343||N>1114111?(k&&v("character reference outside the permissible Unicode range"),"\uFFFD"):_(x,N)?(k&&v("disallowed character reference"),x[N]):(k&&M(g,N)&&v("disallowed character reference"),N>65535&&(N-=65536,V+=f(N>>>10&1023|55296),N=56320|N&1023),V+=f(N),V)},W=function(N){return"&#x"+N.toString(16).toUpperCase()+";"},A=function(N){return"&#"+N+";"},v=function(N){throw Error("Parse error: "+N)},R=function(N,k){k=T(k,R.options);var V=k.strict;V&&d.test(N)&&v("forbidden code point");var U=k.encodeEverything,q=k.useNamedReferences,j=k.allowUnsafeSymbols,ne=k.decimal?A:W,ae=function(H){return ne(H.charCodeAt(0))};return U?(N=N.replace(s,function(H){return q&&_(l,H)?"&"+l[H]+";":ae(H)}),q&&(N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")),q&&(N=N.replace(a,function(H){return"&"+l[H]+";"}))):q?(j||(N=N.replace(c,function(H){return"&"+l[H]+";"})),N=N.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒"),N=N.replace(a,function(H){return"&"+l[H]+";"})):j||(N=N.replace(c,ae)),N.replace(n,function(H){var Te=H.charCodeAt(0),ue=H.charCodeAt(1),we=(Te-55296)*1024+ue-56320+65536;return ne(we)}).replace(o,ae)};R.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var S=function(N,k){k=T(k,S.options);var V=k.strict;return V&&h.test(N)&&v("malformed character reference"),N.replace(p,function(U,q,j,ne,ae,H,Te,ue,we){var oe,Ce,Ae,Z,ie,te;return q?(ie=q,m[ie]):j?(ie=j,te=ne,te&&k.isAttributeValue?(V&&te=="="&&v("`&` did not start a character reference"),U):(V&&v("named character reference was not terminated by a semicolon"),y[ie]+(te||""))):ae?(Ae=ae,Ce=H,V&&!Ce&&v("character reference was not terminated by a semicolon"),oe=parseInt(Ae,10),z(oe,V)):Te?(Z=Te,Ce=ue,V&&!Ce&&v("character reference was not terminated by a semicolon"),oe=parseInt(Z,16),z(oe,V)):(V&&v("named character reference was not terminated by a semicolon"),U)})};S.options={isAttributeValue:!1,strict:!1};var B=function(N){return N.replace(c,function(k){return u[k]})},L={version:"1.2.0",encode:R,decode:S,escape:B,unescape:S};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd)define(function(){return L});else if(e&&!e.nodeType)if(t)t.exports=L;else for(var C in L)_(L,C)&&(e[C]=L[C]);else r.he=L})(Ql)});var kA={};r0(kA,{default:()=>pc});module.exports=o0(kA);var is=require("obsidian");var Bl=require("obsidian");var Xn=require("obsidian");var ho=require("obsidian");var zA=require("obsidian");function Cd(r,e,t){[...r].slice(e).reverse().forEach(([n,s])=>{r.set(n+1,s)}),r.set(e,t)}function Po(r,e){return Object.entries(r).reduce((t,i)=>{let n=i[0],o=i[1]?e.parent.path.startsWith(n):e.parent.path==n;return t||o},!1)}var Mi=class r{constructor(e=[0,0,0,0,0,0,0,0,0]){this.elements=void 0,this.elements=e}identity(){let e=this.elements;e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1}setZero(){let e=this.elements;e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e[8]=0}setTrace(e){let t=this.elements;t[0]=e.x,t[4]=e.y,t[8]=e.z}getTrace(e=new b){let t=this.elements;return e.x=t[0],e.y=t[4],e.z=t[8],e}vmult(e,t=new b){let i=this.elements,n=e.x,s=e.y,o=e.z;return t.x=i[0]*n+i[1]*s+i[2]*o,t.y=i[3]*n+i[4]*s+i[5]*o,t.z=i[6]*n+i[7]*s+i[8]*o,t}smult(e){for(let t=0;t0){let s=1/n;this.x*=s,this.y*=s,this.z*=s}else this.x=0,this.y=0,this.z=0;return n}unit(e=new r){let t=this.x,i=this.y,n=this.z,s=Math.sqrt(t*t+i*i+n*n);return s>0?(s=1/s,e.x=t*s,e.y=i*s,e.z=n*s):(e.x=1,e.y=0,e.z=0),e}length(){let e=this.x,t=this.y,i=this.z;return Math.sqrt(e*e+t*t+i*i)}lengthSquared(){return this.dot(this)}distanceTo(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z;return Math.sqrt((s-t)*(s-t)+(o-i)*(o-i)+(a-n)*(a-n))}distanceSquared(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z;return(s-t)*(s-t)+(o-i)*(o-i)+(a-n)*(a-n)}scale(e,t=new r){let i=this.x,n=this.y,s=this.z;return t.x=e*i,t.y=e*n,t.z=e*s,t}vmul(e,t=new r){return t.x=e.x*this.x,t.y=e.y*this.y,t.z=e.z*this.z,t}addScaledVector(e,t,i=new r){return i.x=this.x+e*t.x,i.y=this.y+e*t.y,i.z=this.z+e*t.z,i}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}isZero(){return this.x===0&&this.y===0&&this.z===0}negate(e=new r){return e.x=-this.x,e.y=-this.y,e.z=-this.z,e}tangents(e,t){let i=this.length();if(i>0){let n=l0,s=1/i;n.set(this.x*s,this.y*s,this.z*s);let o=c0;Math.abs(n.x)<.9?(o.set(1,0,0),n.cross(o,e)):(o.set(0,1,0),n.cross(o,e)),n.cross(e,t)}else e.set(1,0,0),t.set(0,1,0)}toString(){return this.x+","+this.y+","+this.z}toArray(){return[this.x,this.y,this.z]}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}lerp(e,t,i){let n=this.x,s=this.y,o=this.z;i.x=n+(e.x-n)*t,i.y=s+(e.y-s)*t,i.z=o+(e.z-o)*t}almostEquals(e,t=1e-6){return!(Math.abs(this.x-e.x)>t||Math.abs(this.y-e.y)>t||Math.abs(this.z-e.z)>t)}almostZero(e=1e-6){return!(Math.abs(this.x)>e||Math.abs(this.y)>e||Math.abs(this.z)>e)}isAntiparallelTo(e,t){return this.negate(Rd),Rd.almostEquals(e,t)}clone(){return new r(this.x,this.y,this.z)}};b.ZERO=void 0;b.UNIT_X=void 0;b.UNIT_Y=void 0;b.UNIT_Z=void 0;b.ZERO=new b(0,0,0);b.UNIT_X=new b(1,0,0);b.UNIT_Y=new b(0,1,0);b.UNIT_Z=new b(0,0,1);var l0=new b,c0=new b,Rd=new b,Yt=class r{constructor(e={}){this.lowerBound=void 0,this.upperBound=void 0,this.lowerBound=new b,this.upperBound=new b,e.lowerBound&&this.lowerBound.copy(e.lowerBound),e.upperBound&&this.upperBound.copy(e.upperBound)}setFromPoints(e,t,i,n){let s=this.lowerBound,o=this.upperBound,a=i;s.copy(e[0]),a&&a.vmult(s,s),o.copy(s);for(let l=1;lo.x&&(o.x=c.x),c.xo.y&&(o.y=c.y),c.yo.z&&(o.z=c.z),c.z=s.x&&t.y<=n.y&&i.y>=s.y&&t.z<=n.z&&i.z>=s.z}getCorners(e,t,i,n,s,o,a,l){let c=this.lowerBound,u=this.upperBound;e.copy(c),t.set(u.x,c.y,c.z),i.set(u.x,u.y,c.z),n.set(c.x,u.y,u.z),s.set(u.x,c.y,u.z),o.set(c.x,u.y,c.z),a.set(c.x,c.y,u.z),l.copy(u)}toLocalFrame(e,t){let i=Ld,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7];this.getCorners(n,s,o,a,l,c,u,h);for(let d=0;d!==8;d++){let p=i[d];e.pointToLocal(p,p)}return t.setFromPoints(i)}toWorldFrame(e,t){let i=Ld,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7];this.getCorners(n,s,o,a,l,c,u,h);for(let d=0;d!==8;d++){let p=i[d];e.pointToWorld(p,p)}return t.setFromPoints(i)}overlapsRay(e){let{direction:t,from:i}=e,n=1/t.x,s=1/t.y,o=1/t.z,a=(this.lowerBound.x-i.x)*n,l=(this.upperBound.x-i.x)*n,c=(this.lowerBound.y-i.y)*s,u=(this.upperBound.y-i.y)*s,h=(this.lowerBound.z-i.z)*o,d=(this.upperBound.z-i.z)*o,p=Math.max(Math.max(Math.min(a,l),Math.min(c,u)),Math.min(h,d)),m=Math.min(Math.min(Math.max(a,l),Math.max(c,u)),Math.max(h,d));return!(m<0||p>m)}},Fd=new b,Ld=[new b,new b,new b,new b,new b,new b,new b,new b],Vo=class{constructor(){this.matrix=void 0,this.matrix=[]}get(e,t){let{index:i}=e,{index:n}=t;if(n>i){let s=n;n=i,i=s}return this.matrix[(i*(i+1)>>1)+n-1]}set(e,t,i){let{index:n}=e,{index:s}=t;if(s>n){let o=s;s=n,n=o}this.matrix[(n*(n+1)>>1)+s-1]=i?1:0}reset(){for(let e=0,t=this.matrix.length;e!==t;e++)this.matrix[e]=0}setNumObjects(e){this.matrix.length=e*(e-1)>>1}},Uo=class{constructor(){this._listeners=void 0}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;return i[e]===void 0&&(i[e]=[]),i[e].includes(t)||i[e].push(t),this}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return!!(i[e]!==void 0&&i[e].includes(t))}hasAnyEventListener(e){return this._listeners===void 0?!1:this._listeners[e]!==void 0}removeEventListener(e,t){if(this._listeners===void 0)return this;let i=this._listeners;if(i[e]===void 0)return this;let n=i[e].indexOf(t);return n!==-1&&i[e].splice(n,1),this}dispatchEvent(e){if(this._listeners===void 0)return this;let i=this._listeners[e.type];if(i!==void 0){e.target=this;for(let n=0,s=i.length;n.499&&(i=2*Math.atan2(o,c),n=Math.PI/2,s=0),u<-.499&&(i=-2*Math.atan2(o,c),n=-Math.PI/2,s=0),i===void 0){let h=o*o,d=a*a,p=l*l;i=Math.atan2(2*a*c-2*o*l,1-2*d-2*p),n=Math.asin(2*u),s=Math.atan2(2*o*c-2*a*l,1-2*h-2*p)}break;default:throw new Error("Euler order "+t+" not supported yet.")}e.y=i,e.z=n,e.x=s}setFromEuler(e,t,i,n="XYZ"){let s=Math.cos(e/2),o=Math.cos(t/2),a=Math.cos(i/2),l=Math.sin(e/2),c=Math.sin(t/2),u=Math.sin(i/2);return n==="XYZ"?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):n==="YXZ"?(this.x=l*o*a+s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):n==="ZXY"?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a-l*c*u):n==="ZYX"?(this.x=l*o*a-s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a+l*c*u):n==="YZX"?(this.x=l*o*a+s*c*u,this.y=s*c*a+l*o*u,this.z=s*o*u-l*c*a,this.w=s*o*a-l*c*u):n==="XZY"&&(this.x=l*o*a-s*c*u,this.y=s*c*a-l*o*u,this.z=s*o*u+l*c*a,this.w=s*o*a+l*c*u),this}clone(){return new r(this.x,this.y,this.z,this.w)}slerp(e,t,i=new r){let n=this.x,s=this.y,o=this.z,a=this.w,l=e.x,c=e.y,u=e.z,h=e.w,d,p,m,y,x;return p=n*l+s*c+o*u+a*h,p<0&&(p=-p,l=-l,c=-c,u=-u,h=-h),1-p>1e-6?(d=Math.acos(p),m=Math.sin(d),y=Math.sin((1-t)*d)/m,x=Math.sin(t*d)/m):(y=1-t,x=t),i.x=y*n+x*l,i.y=y*s+x*c,i.z=y*o+x*u,i.w=y*a+x*h,i}integrate(e,t,i,n=new r){let s=e.x*i.x,o=e.y*i.y,a=e.z*i.z,l=this.x,c=this.y,u=this.z,h=this.w,d=t*.5;return n.x+=d*(s*h+o*u-a*c),n.y+=d*(o*h+a*l-s*u),n.z+=d*(a*h+s*c-o*l),n.w+=d*(-s*l-o*c-a*u),n}},u0=new b,h0=new b,d0={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256},me=class r{constructor(e={}){this.id=void 0,this.type=void 0,this.boundingSphereRadius=void 0,this.collisionResponse=void 0,this.collisionFilterGroup=void 0,this.collisionFilterMask=void 0,this.material=void 0,this.body=void 0,this.id=r.idCounter++,this.type=e.type||0,this.boundingSphereRadius=0,this.collisionResponse=e.collisionResponse?e.collisionResponse:!0,this.collisionFilterGroup=e.collisionFilterGroup!==void 0?e.collisionFilterGroup:1,this.collisionFilterMask=e.collisionFilterMask!==void 0?e.collisionFilterMask:-1,this.material=e.material?e.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(e,t){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(e,t,i,n){throw"calculateWorldAABB() not implemented for shape type "+this.type}};me.idCounter=0;me.types=d0;var He=class r{constructor(e={}){this.position=void 0,this.quaternion=void 0,this.position=new b,this.quaternion=new yt,e.position&&this.position.copy(e.position),e.quaternion&&this.quaternion.copy(e.quaternion)}pointToLocal(e,t){return r.pointToLocalFrame(this.position,this.quaternion,e,t)}pointToWorld(e,t){return r.pointToWorldFrame(this.position,this.quaternion,e,t)}vectorToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t}static pointToLocalFrame(e,t,i,n=new b){return i.vsub(e,n),t.conjugate(Bd),Bd.vmult(n,n),n}static pointToWorldFrame(e,t,i,n=new b){return t.vmult(i,n),n.vadd(e,n),n}static vectorToWorldFrame(e,t,i=new b){return e.vmult(t,i),i}static vectorToLocalFrame(e,t,i,n=new b){return t.w*=-1,t.vmult(i,n),t.w*=-1,n}},Bd=new yt,mr=class r extends me{constructor(e={}){let{vertices:t=[],faces:i=[],normals:n=[],axes:s,boundingSphereRadius:o}=e;super({type:me.types.CONVEXPOLYHEDRON}),this.vertices=void 0,this.faces=void 0,this.faceNormals=void 0,this.worldVertices=void 0,this.worldVerticesNeedsUpdate=void 0,this.worldFaceNormals=void 0,this.worldFaceNormalsNeedsUpdate=void 0,this.uniqueAxes=void 0,this.uniqueEdges=void 0,this.vertices=t,this.faces=i,this.faceNormals=n,this.faceNormals.length===0&&this.computeNormals(),o?this.boundingSphereRadius=o:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=s?s.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){let e=this.faces,t=this.vertices,i=this.uniqueEdges;i.length=0;let n=new b;for(let s=0;s!==e.length;s++){let o=e[s],a=o.length;for(let l=0;l!==a;l++){let c=(l+1)%a;t[o[l]].vsub(t[o[c]],n),n.normalize();let u=!1;for(let h=0;h!==i.length;h++)if(i[h].almostEquals(n)||i[h].almostEquals(n)){u=!0;break}u||i.push(n.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let e=0;ed&&(d=y,h=m)}let p=[];for(let m=0;m=0&&this.clipFaceAgainstHull(o,e,t,p,a,l,c)}findSeparatingAxis(e,t,i,n,s,o,a,l){let c=new b,u=new b,h=new b,d=new b,p=new b,m=new b,y=Number.MAX_VALUE,x=this;if(x.uniqueAxes)for(let g=0;g!==x.uniqueAxes.length;g++){i.vmult(x.uniqueAxes[g],c);let f=x.testSepAxis(c,e,t,i,n,s);if(f===!1)return!1;f0&&o.negate(o),!0}testSepAxis(e,t,i,n,s,o){let a=this;r.project(a,e,i,n,mc),r.project(t,e,s,o,gc);let l=mc[0],c=mc[1],u=gc[0],h=gc[1];if(l0?1/t:0,this.material=e.material||null,this.linearDamping=typeof e.linearDamping=="number"?e.linearDamping:.01,this.type=t<=0?r.STATIC:r.DYNAMIC,typeof e.type==typeof r.STATIC&&(this.type=e.type),this.allowSleep=typeof e.allowSleep<"u"?e.allowSleep:!0,this.sleepState=r.AWAKE,this.sleepSpeedLimit=typeof e.sleepSpeedLimit<"u"?e.sleepSpeedLimit:.1,this.sleepTimeLimit=typeof e.sleepTimeLimit<"u"?e.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new b,this.quaternion=new yt,this.initQuaternion=new yt,this.previousQuaternion=new yt,this.interpolatedQuaternion=new yt,e.quaternion&&(this.quaternion.copy(e.quaternion),this.initQuaternion.copy(e.quaternion),this.previousQuaternion.copy(e.quaternion),this.interpolatedQuaternion.copy(e.quaternion)),this.angularVelocity=new b,e.angularVelocity&&this.angularVelocity.copy(e.angularVelocity),this.initAngularVelocity=new b,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new b,this.invInertia=new b,this.invInertiaWorld=new Mi,this.invMassSolve=0,this.invInertiaSolve=new b,this.invInertiaWorldSolve=new Mi,this.fixedRotation=typeof e.fixedRotation<"u"?e.fixedRotation:!1,this.angularDamping=typeof e.angularDamping<"u"?e.angularDamping:.01,this.linearFactor=new b(1,1,1),e.linearFactor&&this.linearFactor.copy(e.linearFactor),this.angularFactor=new b(1,1,1),e.angularFactor&&this.angularFactor.copy(e.angularFactor),this.aabb=new Yt,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new b,this.isTrigger=!!e.isTrigger,e.shape&&this.addShape(e.shape),this.updateMassProperties()}wakeUp(){let e=this.sleepState;this.sleepState=r.AWAKE,this.wakeUpAfterNarrowphase=!1,e===r.SLEEPING&&this.dispatchEvent(r.wakeupEvent)}sleep(){this.sleepState=r.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(e){if(this.allowSleep){let t=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),n=this.sleepSpeedLimit**2;t===r.AWAKE&&in?this.wakeUp():t===r.SLEEPY&&e-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(r.sleepEvent))}}updateSolveMassProperties(){this.sleepState===r.SLEEPING||this.type===r.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(e,t=new b){return e.vsub(this.position,t),this.quaternion.conjugate().vmult(t,t),t}vectorToLocalFrame(e,t=new b){return this.quaternion.conjugate().vmult(e,t),t}pointToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t.vadd(this.position,t),t}vectorToWorldFrame(e,t=new b){return this.quaternion.vmult(e,t),t}addShape(e,t,i){let n=new b,s=new yt;return t&&n.copy(t),i&&s.copy(i),this.shapes.push(e),this.shapeOffsets.push(n),this.shapeOrientations.push(s),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=this,this}removeShape(e){let t=this.shapes.indexOf(e);return t===-1?(console.warn("Shape does not belong to the body"),this):(this.shapes.splice(t,1),this.shapeOffsets.splice(t,1),this.shapeOrientations.splice(t,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,e.body=null,this)}updateBoundingRadius(){let e=this.shapes,t=this.shapeOffsets,i=e.length,n=0;for(let s=0;s!==i;s++){let o=e[s];o.updateBoundingSphereRadius();let a=t[s].length(),l=o.boundingSphereRadius;a+l>n&&(n=a+l)}this.boundingRadius=n}updateAABB(){let e=this.shapes,t=this.shapeOffsets,i=this.shapeOrientations,n=e.length,s=m0,o=g0,a=this.quaternion,l=this.aabb,c=y0;for(let u=0;u!==n;u++){let h=e[u];a.vmult(t[u],s),s.vadd(this.position,s),a.mult(i[u],o),h.calculateWorldAABB(s,o,c.lowerBound,c.upperBound),u===0?l.copy(c):l.extend(c)}this.aabbNeedsUpdate=!1}updateInertiaWorld(e){let t=this.invInertia;if(!(t.x===t.y&&t.y===t.z&&!e)){let i=x0,n=v0;i.setRotationFromQuaternion(this.quaternion),i.transpose(n),i.scale(t,i),i.mmult(n,this.invInertiaWorld)}}applyForce(e,t=new b){if(this.type!==r.DYNAMIC)return;this.sleepState===r.SLEEPING&&this.wakeUp();let i=w0;t.cross(e,i),this.force.vadd(e,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(e,t=new b){if(this.type!==r.DYNAMIC)return;let i=b0,n=_0;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,n),this.applyForce(i,n)}applyTorque(e){this.type===r.DYNAMIC&&(this.sleepState===r.SLEEPING&&this.wakeUp(),this.torque.vadd(e,this.torque))}applyImpulse(e,t=new b){if(this.type!==r.DYNAMIC)return;this.sleepState===r.SLEEPING&&this.wakeUp();let i=t,n=E0;n.copy(e),n.scale(this.invMass,n),this.velocity.vadd(n,this.velocity);let s=A0;i.cross(e,s),this.invInertiaWorld.vmult(s,s),this.angularVelocity.vadd(s,this.angularVelocity)}applyLocalImpulse(e,t=new b){if(this.type!==r.DYNAMIC)return;let i=S0,n=M0;this.vectorToWorldFrame(e,i),this.vectorToWorldFrame(t,n),this.applyImpulse(i,n)}updateMassProperties(){let e=D0;this.invMass=this.mass>0?1/this.mass:0;let t=this.inertia,i=this.fixedRotation;this.updateAABB(),e.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),wc.calculateInertia(e,this.mass,t),this.invInertia.set(t.x>0&&!i?1/t.x:0,t.y>0&&!i?1/t.y:0,t.z>0&&!i?1/t.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(e,t){let i=new b;return e.vsub(this.position,i),this.angularVelocity.cross(i,t),this.velocity.vadd(t,t),t}integrate(e,t,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),!(this.type===r.DYNAMIC||this.type===r.KINEMATIC)||this.sleepState===r.SLEEPING)return;let n=this.velocity,s=this.angularVelocity,o=this.position,a=this.force,l=this.torque,c=this.quaternion,u=this.invMass,h=this.invInertiaWorld,d=this.linearFactor,p=u*e;n.x+=a.x*p*d.x,n.y+=a.y*p*d.y,n.z+=a.z*p*d.z;let m=h.elements,y=this.angularFactor,x=l.x*y.x,g=l.y*y.y,f=l.z*y.z;s.x+=e*(m[0]*x+m[1]*g+m[2]*f),s.y+=e*(m[3]*x+m[4]*g+m[5]*f),s.z+=e*(m[6]*x+m[7]*g+m[8]*f),o.x+=n.x*e,o.y+=n.y*e,o.z+=n.z*e,c.integrate(this.angularVelocity,e,this.angularFactor,c),t&&(i?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}};De.idCounter=0;De.COLLIDE_EVENT_NAME="collide";De.DYNAMIC=Rc.DYNAMIC;De.STATIC=Rc.STATIC;De.KINEMATIC=Rc.KINEMATIC;De.AWAKE=Fc.AWAKE;De.SLEEPY=Fc.SLEEPY;De.SLEEPING=Fc.SLEEPING;De.wakeupEvent={type:"wakeup"};De.sleepyEvent={type:"sleepy"};De.sleepEvent={type:"sleep"};var m0=new b,g0=new yt,y0=new Yt,x0=new Mi,v0=new Mi,w0=new b,b0=new b,_0=new b,E0=new b,A0=new b,S0=new b,M0=new b,D0=new b,bc=class{constructor(){this.world=void 0,this.useBoundingBoxes=void 0,this.dirty=void 0,this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(e,t,i){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(e,t){return!(!(e.collisionFilterGroup&t.collisionFilterMask)||!(t.collisionFilterGroup&e.collisionFilterMask)||(e.type&De.STATIC||e.sleepState===De.SLEEPING)&&(t.type&De.STATIC||t.sleepState===De.SLEEPING))}intersectionTest(e,t,i,n){this.useBoundingBoxes?this.doBoundingBoxBroadphase(e,t,i,n):this.doBoundingSphereBroadphase(e,t,i,n)}doBoundingSphereBroadphase(e,t,i,n){let s=T0;t.position.vsub(e.position,s);let o=(e.boundingRadius+t.boundingRadius)**2;s.lengthSquared()i.lengthSquared()}aabbQuery(e,t,i){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},T0=new b,C0={keys:[]},R0=[],F0=[];var HA=new b,gr=class extends bc{constructor(){super()}collisionPairs(e,t,i){let n=e.bodies,s=n.length,o,a;for(let l=0;l!==s;l++)for(let c=0;c!==l;c++)o=n[l],a=n[c],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,t,i)}aabbQuery(e,t,i=[]){for(let n=0;n{}}intersectWorld(e,t){return this.mode=t.mode||r.ANY,this.result=t.result||new yr,this.skipBackfaces=!!t.skipBackfaces,this.collisionFilterMask=typeof t.collisionFilterMask<"u"?t.collisionFilterMask:-1,this.collisionFilterGroup=typeof t.collisionFilterGroup<"u"?t.collisionFilterGroup:-1,this.checkCollisionResponse=typeof t.checkCollisionResponse<"u"?t.checkCollisionResponse:!0,t.from&&this.from.copy(t.from),t.to&&this.to.copy(t.to),this.callback=t.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(Pd),yc.length=0,e.broadphase.aabbQuery(e,Pd,yc),this.intersectBodies(yc),this.hasHit}intersectBody(e,t){t&&(this.result=t,this.updateDirection());let i=this.checkCollisionResponse;if(i&&!e.collisionResponse||!(this.collisionFilterGroup&e.collisionFilterMask)||!(e.collisionFilterGroup&this.collisionFilterMask))return;let n=L0,s=B0;for(let o=0,a=e.shapes.length;oe.boundingSphereRadius)return;let a=this[e.type];a&&a.call(this,e,t,i,n,e)}_intersectBox(e,t,i,n,s){return this._intersectConvex(e.convexPolyhedronRepresentation,t,i,n,s)}_intersectPlane(e,t,i,n,s){let o=this.from,a=this.to,l=this.direction,c=new b(0,0,1);t.vmult(c,c);let u=new b;o.vsub(i,u);let h=u.dot(c);a.vsub(i,u);let d=u.dot(c);if(h*d>0||o.distanceTo(a)=0&&y<=1&&(o.lerp(a,y,p),p.vsub(i,m),m.normalize(),this.reportIntersection(m,p,s,n,-1)),this.result.shouldStop)return;x>=0&&x<=1&&(o.lerp(a,x,p),p.vsub(i,m),m.normalize(),this.reportIntersection(m,p,s,n,-1))}}_intersectConvex(e,t,i,n,s,o){let a=O0,l=Nd,c=o&&o.faceList||null,u=e.faces,h=e.vertices,d=e.faceNormals,p=this.direction,m=this.from,y=this.to,x=m.distanceTo(y),g=c?c.length:u.length,f=this.result;for(let E=0;!f.shouldStop&&Ex||this.reportIntersection(a,Vt,s,n,w)}}}}_intersectTrimesh(e,t,i,n,s,o){let a=z0,l=W0,c=$0,u=Nd,h=V0,d=U0,p=H0,m=q0,y=G0,x=e.indices;e.vertices;let g=this.from,f=this.to,E=this.direction;c.position.copy(i),c.quaternion.copy(t),He.vectorToLocalFrame(i,t,E,h),He.pointToLocalFrame(i,t,g,d),He.pointToLocalFrame(i,t,f,p),p.x*=e.scale.x,p.y*=e.scale.y,p.z*=e.scale.z,d.x*=e.scale.x,d.y*=e.scale.y,d.z*=e.scale.z,p.vsub(d,h),h.normalize();let w=d.distanceSquared(p);e.tree.rayQuery(this,c,l);for(let _=0,M=l.length;!this.result.shouldStop&&_!==M;_++){let T=l[_];e.getNormal(T,a),e.getVertex(x[T*3],li),li.vsub(d,u);let z=h.dot(a),W=a.dot(u)/z;if(W<0)continue;h.scale(W,Vt),Vt.vadd(d,Vt),e.getVertex(x[T*3+1],Ai),e.getVertex(x[T*3+2],Si);let A=Vt.distanceSquared(d);!(r.pointInTriangle(Vt,Ai,li,Si)||r.pointInTriangle(Vt,li,Ai,Si))||A>w||(He.vectorToWorldFrame(t,a,y),He.pointToWorldFrame(i,t,Vt,m),this.reportIntersection(y,m,s,n,T))}l.length=0}reportIntersection(e,t,i,n,s){let o=this.from,a=this.to,l=o.distanceTo(t),c=this.result;if(!(this.skipBackfaces&&e.dot(this.direction)>0))switch(c.hitFaceIndex=typeof s<"u"?s:-1,this.mode){case r.ALL:this.hasHit=!0,c.set(o,a,e,t,i,n,l),c.hasHit=!0,this.callback(c);break;case r.CLOSEST:(l=0&&(h=s*c-o*a)>=0&&u+hT.maxForce&&(p=T.maxForce-x),E[M]+=p,m+=p>0?p:-p,T.addToWlambda(p)}if(m*me;)t.pop();for(;t.length=0&&u.restitution>=0&&(a.restitution=c.restitution*u.restitution),a.si=s||i,a.sj=o||n,a}createFrictionEquationsFromContact(e,t){let i=e.bi,n=e.bj,s=e.si,o=e.sj,a=this.world,l=this.currentContactMaterial,c=l.friction,u=s.material||i.material,h=o.material||n.material;if(u&&h&&u.friction>=0&&h.friction>=0&&(c=u.friction*h.friction),c>0){let d=c*a.gravity.length(),p=i.invMass+n.invMass;p>0&&(p=1/p);let m=this.frictionEquationPool,y=m.length?m.pop():new qo(i,n,d*p),x=m.length?m.pop():new qo(i,n,d*p);return y.bi=x.bi=i,y.bj=x.bj=n,y.minForce=x.minForce=-d*p,y.maxForce=x.maxForce=d*p,y.ri.copy(e.ri),y.rj.copy(e.rj),x.ri.copy(e.ri),x.rj.copy(e.rj),e.ni.tangents(y.t,x.t),y.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,a.dt),x.setSpookParams(l.frictionEquationStiffness,l.frictionEquationRelaxation,a.dt),y.enabled=x.enabled=e.enabled,t.push(y,x),!0}return!1}createFrictionFromAverage(e){let t=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(t,this.frictionResult)||e===1)return;let i=this.frictionResult[this.frictionResult.length-2],n=this.frictionResult[this.frictionResult.length-1];Pn.setZero(),ss.setZero(),rs.setZero();let s=t.bi;t.bj;for(let a=0;a!==e;a++)t=this.result[this.result.length-1-a],t.bi!==s?(Pn.vadd(t.ni,Pn),ss.vadd(t.ri,ss),rs.vadd(t.rj,rs)):(Pn.vsub(t.ni,Pn),ss.vadd(t.rj,ss),rs.vadd(t.ri,rs));let o=1/e;ss.scale(o,i.ri),rs.scale(o,i.rj),n.ri.copy(i.ri),n.rj.copy(i.rj),Pn.normalize(),Pn.tangents(i.t,n.t)}getContacts(e,t,i,n,s,o,a){this.contactPointPool=s,this.frictionEquationPool=a,this.result=n,this.frictionResult=o;let l=uy,c=hy,u=ly,h=cy;for(let d=0,p=e.length;d!==p;d++){let m=e[d],y=t[d],x=null;m.material&&y.material&&(x=i.getContactMaterial(m.material,y.material)||null);let g=m.type&De.KINEMATIC&&y.type&De.STATIC||m.type&De.STATIC&&y.type&De.KINEMATIC||m.type&De.KINEMATIC&&y.type&De.KINEMATIC;for(let f=0;fE.boundingSphereRadius+_.boundingSphereRadius)continue;let M=null;E.material&&_.material&&(M=i.getContactMaterial(E.material,_.material)||null),this.currentContactMaterial=M||x||i.defaultContactMaterial;let T=E.type|_.type,z=this[T];if(z){let W=!1;E.type<_.type?W=z.call(this,E,_,u,h,l,c,m,y,E,_,g):W=z.call(this,_,E,h,u,c,l,y,m,E,_,g),W&&g&&(i.shapeOverlapKeeper.set(E.id,_.id),i.bodyOverlapKeeper.set(m.id,y.id))}}}}}sphereSphere(e,t,i,n,s,o,a,l,c,u,h){if(h)return i.distanceSquared(n)<(e.radius+t.radius)**2;let d=this.createContactEquation(a,l,e,t,c,u);n.vsub(i,d.ni),d.ni.normalize(),d.ri.copy(d.ni),d.rj.copy(d.ni),d.ri.scale(e.radius,d.ri),d.rj.scale(-t.radius,d.rj),d.ri.vadd(i,d.ri),d.ri.vsub(a.position,d.ri),d.rj.vadd(n,d.rj),d.rj.vsub(l.position,d.rj),this.result.push(d),this.createFrictionEquationsFromContact(d,this.frictionResult)}spherePlane(e,t,i,n,s,o,a,l,c,u,h){let d=this.createContactEquation(a,l,e,t,c,u);if(d.ni.set(0,0,1),o.vmult(d.ni,d.ni),d.ni.negate(d.ni),d.ni.normalize(),d.ni.scale(e.radius,d.ri),i.vsub(n,Oo),d.ni.scale(d.ni.dot(Oo),Ud),Oo.vsub(Ud,d.rj),-Oo.dot(d.ni)<=e.radius){if(h)return!0;let p=d.ri,m=d.rj;p.vadd(i,p),p.vsub(a.position,p),m.vadd(n,m),m.vsub(l.position,m),this.result.push(d),this.createFrictionEquationsFromContact(d,this.frictionResult)}}boxBox(e,t,i,n,s,o,a,l,c,u,h){return e.convexPolyhedronRepresentation.material=e.material,t.convexPolyhedronRepresentation.material=t.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexConvex(e.convexPolyhedronRepresentation,t.convexPolyhedronRepresentation,i,n,s,o,a,l,e,t,h)}sphereBox(e,t,i,n,s,o,a,l,c,u,h){let d=this.v3pool,p=ky;i.vsub(n,zo),t.getSideNormals(p,o);let m=e.radius,y=!1,x=zy,g=Vy,f=Uy,E=null,w=0,_=0,M=0,T=null;for(let C=0,N=p.length;C!==N&&y===!1;C++){let k=Py;k.copy(p[C]);let V=k.length();k.normalize();let U=zo.dot(k);if(U0){let q=Iy,j=Ny;q.copy(p[(C+1)%3]),j.copy(p[(C+2)%3]);let ne=q.length(),ae=j.length();q.normalize(),j.normalize();let H=zo.dot(q),Te=zo.dot(j);if(H-ne&&Te-ae){let ue=Math.abs(U-V-m);if((T===null||uee.boundingSphereRadius+t.boundingSphereRadius)&&e.findSeparatingAxis(t,i,s,n,o,m,d,p)){let y=[],x=nx;e.clipAgainstHull(i,s,t,n,o,m,-100,100,y);let g=0;for(let f=0;f!==y.length;f++){if(h)return!0;let E=this.createContactEquation(a,l,e,t,c,u),w=E.ri,_=E.rj;m.negate(E.ni),y[f].normal.negate(x),x.scale(y[f].depth,x),y[f].point.vadd(x,w),_.copy(y[f].point),w.vsub(i,w),_.vsub(n,_),w.vadd(i,w),w.vsub(a.position,w),_.vadd(n,_),_.vsub(l.position,_),this.result.push(E),g++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(E,this.frictionResult)}this.enableFrictionReduction&&g&&this.createFrictionFromAverage(g)}}sphereConvex(e,t,i,n,s,o,a,l,c,u,h){let d=this.v3pool;i.vsub(n,Hy);let p=t.faceNormals,m=t.faces,y=t.vertices,x=e.radius,g=!1;for(let f=0;f!==y.length;f++){let E=y[f],w=$y;o.vmult(E,w),n.vadd(w,w);let _=Wy;if(w.vsub(i,_),_.lengthSquared()0){let R=[];for(let S=0,B=_.length;S!==B;S++){let L=d.get();o.vmult(y[_[S]],L),n.vadd(L,L),R.push(L)}if(By(R,M,i)){if(h)return!0;g=!0;let S=this.createContactEquation(a,l,e,t,c,u);M.scale(-x,S.ri),M.negate(S.ni);let B=d.get();M.scale(-A,B);let L=d.get();M.scale(-x,L),i.vsub(n,S.rj),S.rj.vadd(L,S.rj),S.rj.vadd(B,S.rj),S.rj.vadd(n,S.rj),S.rj.vsub(l.position,S.rj),S.ri.vadd(i,S.ri),S.ri.vsub(a.position,S.ri),d.release(B),d.release(L),this.result.push(S),this.createFrictionEquationsFromContact(S,this.frictionResult);for(let C=0,N=R.length;C!==N;C++)d.release(R[C]);return}else for(let S=0;S!==_.length;S++){let B=d.get(),L=d.get();o.vmult(y[_[(S+1)%_.length]],B),o.vmult(y[_[(S+2)%_.length]],L),n.vadd(B,B),n.vadd(L,L);let C=Gy;L.vsub(B,C);let N=qy;C.unit(N);let k=d.get(),V=d.get();i.vsub(B,V);let U=V.dot(N);N.scale(U,k),k.vadd(B,k);let q=d.get();if(k.vsub(i,q),U>0&&U*Ud.length||E>d[0].length)return;g<0&&(g=0),f<0&&(f=0),E<0&&(E=0),w<0&&(w=0),g>=d.length&&(g=d.length-1),f>=d.length&&(f=d.length-1),w>=d[0].length&&(w=d[0].length-1),E>=d[0].length&&(E=d[0].length-1);let _=[];t.getRectMinMax(g,E,f,w,_);let M=_[0],T=_[1];if(x.z-p>T||x.z+p2)return}}boxHeightfield(e,t,i,n,s,o,a,l,c,u,h){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexHeightfield(e.convexPolyhedronRepresentation,t,i,n,s,o,a,l,e,t,h)}convexHeightfield(e,t,i,n,s,o,a,l,c,u,h){let d=t.data,p=t.elementSize,m=e.boundingSphereRadius,y=dx,x=px,g=hx;He.pointToLocalFrame(n,o,i,g);let f=Math.floor((g.x-m)/p)-1,E=Math.ceil((g.x+m)/p)+1,w=Math.floor((g.y-m)/p)-1,_=Math.ceil((g.y+m)/p)+1;if(E<0||_<0||f>d.length||w>d[0].length)return;f<0&&(f=0),E<0&&(E=0),w<0&&(w=0),_<0&&(_=0),f>=d.length&&(f=d.length-1),E>=d.length&&(E=d.length-1),_>=d[0].length&&(_=d[0].length-1),w>=d[0].length&&(w=d[0].length-1);let M=[];t.getRectMinMax(f,w,E,_,M);let T=M[0],z=M[1];if(!(g.z-m>z||g.z+m0&&L<0&&(x.vsub(d,g),y.copy(m),y.normalize(),C=g.dot(y),y.scale(C,g),g.vadd(d,g),g.distanceTo(x)0&&i===!0||u<=0&&i===!1){i===null&&(i=u>0);continue}else return!1}return!0}var zo=new b,Py=new b,Iy=new b,Ny=new b,ky=[new b,new b,new b,new b,new b,new b],Oy=new b,zy=new b,Vy=new b,Uy=new b,Hy=new b,Gy=new b,qy=new b,Wy=new b,$y=new b,jy=new b,Xy=new b,Yy=new b,Zy=new b,Jy=new b,Ky=new b,Qy=new b,ex=new b,tx=new b,ix=new b,nx=new b,sx=new b,rx=new b,ox=new b,ax=new b,Hd=new yt,lx=new b,cx=new b,Gd=new b,ux=new b,hx=new b,dx=new b,px=[0],fx=new b,mx=new b,Wo=class{constructor(){this.current=void 0,this.previous=void 0,this.current=[],this.previous=[]}getKey(e,t){if(tn[s];)s++;if(i!==n[s]){for(let o=n.length-1;o>=s;o--)n[o+1]=n[o];n[s]=i}}tick(){let e=this.current;this.current=this.previous,this.previous=e,this.current.length=0}getDiff(e,t){let i=this.current,n=this.previous,s=i.length,o=n.length,a=0;for(let l=0;ln[a];)a++;c=u===n[a],c||qd(e,u)}a=0;for(let l=0;li[a];)a++;c=i[a]===u,c||qd(t,u)}}};function qd(r,e){r.push((e&4294901760)>>16,e&65535)}var Cc=class{constructor(){this.data={keys:[]}}get(e,t){if(e>t){let i=t;t=e,e=i}return this.data[e+"-"+t]}set(e,t,i){if(e>t){let s=t;t=e,e=s}let n=e+"-"+t;this.get(e,t)||this.data.keys.push(n),this.data[n]=i}reset(){let e=this.data,t=e.keys;for(;t.length>0;){let i=t.pop();delete e[i]}}},$o=class extends Uo{constructor(e={}){super(),this.dt=void 0,this.allowSleep=void 0,this.contacts=void 0,this.frictionEquations=void 0,this.quatNormalizeSkip=void 0,this.quatNormalizeFast=void 0,this.time=void 0,this.stepnumber=void 0,this.default_dt=void 0,this.nextId=void 0,this.gravity=void 0,this.broadphase=void 0,this.bodies=void 0,this.hasActiveBodies=void 0,this.solver=void 0,this.constraints=void 0,this.narrowphase=void 0,this.collisionMatrix=void 0,this.collisionMatrixPrevious=void 0,this.bodyOverlapKeeper=void 0,this.shapeOverlapKeeper=void 0,this.materials=void 0,this.contactmaterials=void 0,this.contactMaterialTable=void 0,this.defaultMaterial=void 0,this.defaultContactMaterial=void 0,this.doProfiling=void 0,this.profile=void 0,this.accumulator=void 0,this.subsystems=void 0,this.addBodyEvent=void 0,this.removeBodyEvent=void 0,this.idToBodyMap=void 0,this.dt=-1,this.allowSleep=!!e.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=e.quatNormalizeSkip!==void 0?e.quatNormalizeSkip:0,this.quatNormalizeFast=e.quatNormalizeFast!==void 0?e.quatNormalizeFast:!1,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new b,e.gravity&&this.gravity.copy(e.gravity),this.broadphase=e.broadphase!==void 0?e.broadphase:new gr,this.bodies=[],this.hasActiveBodies=!1,this.solver=e.solver!==void 0?e.solver:new Sc,this.constraints=[],this.narrowphase=new Tc(this),this.collisionMatrix=new Vo,this.collisionMatrixPrevious=new Vo,this.bodyOverlapKeeper=new Wo,this.shapeOverlapKeeper=new Wo,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new Cc,this.defaultMaterial=new on("default"),this.defaultContactMaterial=new rn(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(e,t){return this.contactMaterialTable.get(e.id,t.id)}numObjects(){return this.bodies.length}collisionMatrixTick(){let e=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=e,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(e){this.constraints.push(e)}removeConstraint(e){let t=this.constraints.indexOf(e);t!==-1&&this.constraints.splice(t,1)}rayTest(e,t,i){i instanceof yr?this.raycastClosest(e,t,{skipBackfaces:!0},i):this.raycastAll(e,t,{skipBackfaces:!0},i)}raycastAll(e,t,i={},n){return i.mode=ti.ALL,i.from=e,i.to=t,i.callback=n,vc.intersectWorld(this,i)}raycastAny(e,t,i={},n){return i.mode=ti.ANY,i.from=e,i.to=t,i.result=n,vc.intersectWorld(this,i)}raycastClosest(e,t,i={},n){return i.mode=ti.CLOSEST,i.from=e,i.to=t,i.result=n,vc.intersectWorld(this,i)}addBody(e){this.bodies.includes(e)||(e.index=this.bodies.length,this.bodies.push(e),e.world=this,e.initPosition.copy(e.position),e.initVelocity.copy(e.velocity),e.timeLastSleepy=this.time,e instanceof De&&(e.initAngularVelocity.copy(e.angularVelocity),e.initQuaternion.copy(e.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=e,this.idToBodyMap[e.id]=e,this.dispatchEvent(this.addBodyEvent))}removeBody(e){e.world=null;let t=this.bodies.length-1,i=this.bodies,n=i.indexOf(e);if(n!==-1){i.splice(n,1);for(let s=0;s!==i.length;s++)i[s].index=s;this.collisionMatrix.setNumObjects(t),this.removeBodyEvent.body=e,delete this.idToBodyMap[e.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(e){return this.idToBodyMap[e]}getShapeById(e){let t=this.bodies;for(let i=0;i=e&&se*1e3)););this.accumulator=this.accumulator%e;let o=this.accumulator/e;for(let a=0;a!==this.bodies.length;a++){let l=this.bodies[a];l.previousPosition.lerp(l.position,o,l.interpolatedPosition),l.previousQuaternion.slerp(l.quaternion,o,l.interpolatedQuaternion),l.previousQuaternion.normalize()}this.time+=t}}internalStep(e){this.dt=e;let t=this.contacts,i=wx,n=bx,s=this.numObjects(),o=this.bodies,a=this.solver,l=this.gravity,c=this.doProfiling,u=this.profile,h=De.DYNAMIC,d=-1/0,p=this.constraints,m=vx;l.length();let y=l.x,x=l.y,g=l.z,f=0;for(c&&(d=bt.now()),f=0;f!==s;f++){let S=o[f];if(S.type===h){let B=S.force,L=S.mass;B.x+=L*y,B.y+=L*x,B.z+=L*g}}for(let S=0,B=this.subsystems.length;S!==B;S++)this.subsystems[S].update();c&&(d=bt.now()),i.length=0,n.length=0,this.broadphase.collisionPairs(this,i,n),c&&(u.broadphase=bt.now()-d);let E=p.length;for(f=0;f!==E;f++){let S=p[f];if(!S.collideConnected)for(let B=i.length-1;B>=0;B-=1)(S.bodyA===i[B]&&S.bodyB===n[B]||S.bodyB===i[B]&&S.bodyA===n[B])&&(i.splice(B,1),n.splice(B,1))}this.collisionMatrixTick(),c&&(d=bt.now());let w=xx,_=t.length;for(f=0;f!==_;f++)w.push(t[f]);t.length=0;let M=this.frictionEquations.length;for(f=0;f!==M;f++)m.push(this.frictionEquations[f]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,n,this,t,w,this.frictionEquations,m),c&&(u.narrowphase=bt.now()-d),c&&(d=bt.now()),f=0;f=0&&C.material.friction>=0&&L.material.friction*C.material.friction,L.material.restitution>=0&&C.material.restitution>=0&&(B.restitution=L.material.restitution*C.material.restitution)),a.addEquation(B),L.allowSleep&&L.type===De.DYNAMIC&&L.sleepState===De.SLEEPING&&C.sleepState===De.AWAKE&&C.type!==De.STATIC){let U=C.velocity.lengthSquared()+C.angularVelocity.lengthSquared(),q=C.sleepSpeedLimit**2;U>=q*2&&(L.wakeUpAfterNarrowphase=!0)}if(C.allowSleep&&C.type===De.DYNAMIC&&C.sleepState===De.SLEEPING&&L.sleepState===De.AWAKE&&L.type!==De.STATIC){let U=L.velocity.lengthSquared()+L.angularVelocity.lengthSquared(),q=L.sleepSpeedLimit**2;U>=q*2&&(C.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(L,C,!0),this.collisionMatrixPrevious.get(L,C)||(dr.body=C,dr.contact=B,L.dispatchEvent(dr),dr.body=L,C.dispatchEvent(dr)),this.bodyOverlapKeeper.set(L.id,C.id),this.shapeOverlapKeeper.set(N.id,k.id)}for(this.emitContactEvents(),c&&(u.makeContactConstraints=bt.now()-d,d=bt.now()),f=0;f!==s;f++){let S=o[f];S.wakeUpAfterNarrowphase&&(S.wakeUp(),S.wakeUpAfterNarrowphase=!1)}for(E=p.length,f=0;f!==E;f++){let S=p[f];S.update();for(let B=0,L=S.equations.length;B!==L;B++){let C=S.equations[B];a.addEquation(C)}}a.solve(e,this),c&&(u.solve=bt.now()-d),a.removeAllEquations();let z=Math.pow;for(f=0;f!==s;f++){let S=o[f];if(S.type&h){let B=z(1-S.linearDamping,e),L=S.velocity;L.scale(B,L);let C=S.angularVelocity;if(C){let N=z(1-S.angularDamping,e);C.scale(N,C)}}}for(this.dispatchEvent(yx),f=0;f!==s;f++){let S=o[f];S.preStep&&S.preStep.call(S)}c&&(d=bt.now());let A=this.stepnumber%(this.quatNormalizeSkip+1)===0,v=this.quatNormalizeFast;for(f=0;f!==s;f++)o[f].integrate(e,A,v);for(this.clearForces(),this.broadphase.dirty=!0,c&&(u.integrate=bt.now()-d),this.stepnumber+=1,this.dispatchEvent(gx),f=0;f!==s;f++){let S=o[f],B=S.postStep;B&&B.call(S)}let R=!0;if(this.allowSleep)for(R=!1,f=0;f!==s;f++){let S=o[f];S.sleepTick(this.time),S.sleepState!==De.SLEEPING&&(R=!0)}this.hasActiveBodies=R}emitContactEvents(){let e=this.hasAnyEventListener("beginContact"),t=this.hasAnyEventListener("endContact");if((e||t)&&this.bodyOverlapKeeper.getDiff(ki,Oi),e){for(let s=0,o=ki.length;sDate.now()-r}var gx={type:"postStep"},yx={type:"preStep"},dr={type:De.COLLIDE_EVENT_NAME,body:null,contact:null},xx=[],vx=[],wx=[],bx=[],ki=[],Oi=[],pr={type:"beginContact",bodyA:null,bodyB:null},fr={type:"endContact",bodyA:null,bodyB:null},zi={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},Vi={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null};var Lh="137";var _x=0,Ep=1,Ex=2;var rm=1,Bh=2,Tr=3,Pr=0,xt=1,Bs=2,om=1;var mn=0,Rr=1,Ap=2,Sp=3,Mp=4,Ax=5,Ss=100,Sx=101,Mx=102,Dp=103,Tp=104,Dx=200,Tx=201,Cx=202,Rx=203,am=204,lm=205,Fx=206,Lx=207,Bx=208,Px=209,Ix=210,Nx=0,kx=1,Ox=2,xu=3,zx=4,Vx=5,Ux=6,Hx=7,il=0,Gx=1,qx=2,gn=0,Wx=1,$x=2,jx=3,Xx=4,Yx=5,cm=300,co=301,uo=302,vu=303,wu=304,nl=306,Ph=307,bu=1e3,Kt=1001,_u=1002,vt=1003,Cp=1004;var Rp=1005;var Ft=1006,Zx=1007;var sl=1008;var yn=1009,Jx=1010,Kx=1011,Ir=1012,Qx=1013,Ma=1014,Vn=1015,Cs=1016,ev=1017,tv=1018,Rs=1020,iv=1021,nv=1022,Nt=1023,sv=1024,rv=1025,Hn=1026,Ps=1027,ov=1028,av=1029,lv=1030,cv=1031,uv=1033,Bc=33776,Pc=33777,Ic=33778,Nc=33779,Fp=35840,Lp=35841,Bp=35842,Pp=35843,hv=36196,Ip=37492,Np=37496,kp=37808,Op=37809,zp=37810,Vp=37811,Up=37812,Hp=37813,Gp=37814,qp=37815,Wp=37816,$p=37817,jp=37818,Xp=37819,Yp=37820,Zp=37821,Jp=36492,dv=2200,pv=2201,fv=2202,Da=2300,Ta=2301,kc=2302,Ms=2400,Ds=2401,Ca=2402,Ih=2500,um=2501,mv=0;var bn=3e3,tt=3001,gv=3200,yv=3201,Xs=0,xv=1;var Oc=7680;var vv=519,Nr=35044,Ra=35048;var Kp="300 es",Eu=1035,Xi=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let i=this._listeners[e.type];if(i!==void 0){e.target=this;let n=i.slice(0);for(let s=0,o=n.length;s>8&255]+St[r>>16&255]+St[r>>24&255]+"-"+St[e&255]+St[e>>8&255]+"-"+St[e>>16&15|64]+St[e>>24&255]+"-"+St[t&63|128]+St[t>>8&255]+"-"+St[t>>16&255]+St[t>>24&255]+St[i&255]+St[i>>8&255]+St[i>>16&255]+St[i>>24&255]).toUpperCase()}function Ut(r,e,t){return Math.max(e,Math.min(t,r))}function wv(r,e){return(r%e+e)%e}function Vc(r,e,t){return(1-t)*r+t*e}function Qp(r){return(r&r-1)===0&&r!==0}function bv(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}var ee=class{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*n+e.x,this.y=s*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};ee.prototype.isVector2=!0;var wt=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,s,o,a,l,c){let u=this.elements;return u[0]=e,u[1]=n,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],h=i[7],d=i[2],p=i[5],m=i[8],y=n[0],x=n[3],g=n[6],f=n[1],E=n[4],w=n[7],_=n[2],M=n[5],T=n[8];return s[0]=o*y+a*f+l*_,s[3]=o*x+a*E+l*M,s[6]=o*g+a*w+l*T,s[1]=c*y+u*f+h*_,s[4]=c*x+u*E+h*M,s[7]=c*g+u*w+h*T,s[2]=d*y+p*f+m*_,s[5]=d*x+p*E+m*M,s[8]=d*g+p*w+m*T,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*s*u+i*a*l+n*s*c-n*o*l}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,d=a*l-u*s,p=c*s-o*l,m=t*h+i*d+n*p;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/m;return e[0]=h*y,e[1]=(n*c-u*i)*y,e[2]=(a*i-n*o)*y,e[3]=d*y,e[4]=(u*t-n*l)*y,e[5]=(n*s-a*t)*y,e[6]=p*y,e[7]=(i*l-c*t)*y,e[8]=(o*t-i*s)*y,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,n,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-n*c,n*l,-n*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){let i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=t,i[4]*=t,i[7]*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),n=this.elements,s=n[0],o=n[3],a=n[6],l=n[1],c=n[4],u=n[7];return n[0]=t*s+i*l,n[3]=t*o+i*c,n[6]=t*a+i*u,n[1]=-i*s+t*l,n[4]=-i*o+t*c,n[7]=-i*a+t*u,this}translate(e,t){let i=this.elements;return i[0]+=e*i[2],i[3]+=e*i[5],i[6]+=e*i[8],i[1]+=t*i[2],i[4]+=t*i[5],i[7]+=t*i[8],this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}};wt.prototype.isMatrix3=!0;function hm(r){for(let e=r.length-1;e>=0;--e)if(r[e]>65535)return!0;return!1}function kr(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}var dm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ci={h:0,s:0,l:0},jo={h:0,s:0,l:0};function Uc(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}function Fs(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Hc(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var ye=class{constructor(e,t,i){return t===void 0&&i===void 0?this.set(e):this.setRGB(e,t,i)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}setRGB(e,t,i){return this.r=e,this.g=t,this.b=i,this}setHSL(e,t,i){if(e=wv(e,1),t=Ut(t,0,1),i=Ut(i,0,1),t===0)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,s=2*i-n;this.r=Uc(s,n,e+1/3),this.g=Uc(s,n,e),this.b=Uc(s,n,e-1/3)}return this}setStyle(e){function t(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let n,s=i[1],o=i[2];switch(s){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[4]),this;if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[4]),this;break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let a=parseFloat(n[1])/360,l=parseInt(n[2],10)/100,c=parseInt(n[3],10)/100;return t(n[4]),this.setHSL(a,l,c)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=i[1],s=n.length;if(s===3)return this.r=parseInt(n.charAt(0)+n.charAt(0),16)/255,this.g=parseInt(n.charAt(1)+n.charAt(1),16)/255,this.b=parseInt(n.charAt(2)+n.charAt(2),16)/255,this;if(s===6)return this.r=parseInt(n.charAt(0)+n.charAt(1),16)/255,this.g=parseInt(n.charAt(2)+n.charAt(3),16)/255,this.b=parseInt(n.charAt(4)+n.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){let t=dm[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Fs(e.r),this.g=Fs(e.g),this.b=Fs(e.b),this}copyLinearToSRGB(e){return this.r=Hc(e.r),this.g=Hc(e.g),this.b=Hc(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){let t=this.r,i=this.g,n=this.b,s=Math.max(t,i,n),o=Math.min(t,i,n),a,l,c=(o+s)/2;if(o===s)a=0,l=0;else{let u=s-o;switch(l=c<=.5?u/(s+o):u/(2-s-o),s){case t:a=(i-n)/u+(i"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{os===void 0&&(os=kr("canvas")),os.width=e.width,os.height=e.height;let i=os.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=os}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=kr("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),s=n.data;for(let o=0;o1)switch(this.wrapS){case bu:e.x=e.x-Math.floor(e.x);break;case Kt:e.x=e.x<0?0:1;break;case _u:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case bu:e.y=e.y-Math.floor(e.y);break;case Kt:e.y=e.y<0?0:1;break;case _u:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&this.version++}};lt.DEFAULT_IMAGE=void 0;lt.DEFAULT_MAPPING=cm;lt.prototype.isTexture=!0;function Gc(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Yi.getDataURL(r):r.data?{data:Array.prototype.slice.call(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var $e=class{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,s,l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],p=l[5],m=l[9],y=l[2],x=l[6],g=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-y)<.01&&Math.abs(m-x)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+y)<.1&&Math.abs(m+x)<.1&&Math.abs(c+p+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;let E=(c+1)/2,w=(p+1)/2,_=(g+1)/2,M=(u+d)/4,T=(h+y)/4,z=(m+x)/4;return E>w&&E>_?E<.01?(i=0,n=.707106781,s=.707106781):(i=Math.sqrt(E),n=M/i,s=T/i):w>_?w<.01?(i=.707106781,n=0,s=.707106781):(n=Math.sqrt(w),i=M/n,s=z/n):_<.01?(i=.707106781,n=.707106781,s=0):(s=Math.sqrt(_),i=T/s,n=z/s),this.set(i,n,s,t),this}let f=Math.sqrt((x-m)*(x-m)+(h-y)*(h-y)+(d-u)*(d-u));return Math.abs(f)<.001&&(f=1),this.x=(x-m)/f,this.y=(h-y)/f,this.z=(d-u)/f,this.w=Math.acos((c+p+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};$e.prototype.isVector4=!0;var Ht=class extends Xi{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new $e(0,0,e,t),this.scissorTest=!1,this.viewport=new $e(0,0,e,t),this.texture=new lt(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.image={width:e,height:t,depth:1},this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Ft,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null}setTexture(e){e.image={width:this.width,height:this.height,depth:this.depth},this.texture=e}setSize(e,t,i=1){(this.width!==e||this.height!==t||this.depth!==i)&&(this.width=e,this.height=t,this.depth=i,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.image=Object.assign({},e.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}};Ht.prototype.isWebGLRenderTarget=!0;var Su=class extends Ht{constructor(e,t,i){super(e,t);let n=this.texture;this.texture=[];for(let s=0;s=0?1:-1,E=1-g*g;if(E>Number.EPSILON){let _=Math.sqrt(E),M=Math.atan2(_,g*f);x=Math.sin(x*M)/_,a=Math.sin(a*M)/_}let w=a*f;if(l=l*x+d*w,c=c*x+p*w,u=u*x+m*w,h=h*x+y*w,x===1-a){let _=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=_,c*=_,u*=_,h*=_}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,n,s,o){let a=i[n],l=i[n+1],c=i[n+2],u=i[n+3],h=s[o],d=s[o+1],p=s[o+2],m=s[o+3];return e[t]=a*m+u*h+l*p-c*d,e[t+1]=l*m+u*d+c*h-a*p,e[t+2]=c*m+u*p+a*d-l*h,e[t+3]=u*m-a*h-l*d-c*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=e._x,n=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(n/2),h=a(s/2),d=l(i/2),p=l(n/2),m=l(s/2);switch(o){case"XYZ":this._x=d*u*h+c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h-d*p*m;break;case"YXZ":this._x=d*u*h+c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h+d*p*m;break;case"ZXY":this._x=d*u*h-c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h-d*p*m;break;case"ZYX":this._x=d*u*h-c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h+d*p*m;break;case"YZX":this._x=d*u*h+c*p*m,this._y=c*p*h+d*u*m,this._z=c*u*m-d*p*h,this._w=c*u*h-d*p*m;break;case"XZY":this._x=d*u*h-c*p*m,this._y=c*p*h-d*u*m,this._z=c*u*m+d*p*h,this._w=c*u*h+d*p*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=i+a+h;if(d>0){let p=.5/Math.sqrt(d+1);this._w=.25/p,this._x=(u-l)*p,this._y=(s-c)*p,this._z=(o-n)*p}else if(i>a&&i>h){let p=2*Math.sqrt(1+i-a-h);this._w=(u-l)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(s+c)/p}else if(a>h){let p=2*Math.sqrt(1+a-i-h);this._w=(s-c)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(l+u)/p}else{let p=2*Math.sqrt(1+h-i-a);this._w=(o-n)/p,this._x=(s+c)/p,this._y=(l+u)/p,this._z=.25*p}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ut(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return t!==void 0?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+n*c-s*l,this._y=n*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-n*a,this._w=o*u-i*a-n*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,n=this._y,s=this._z,o=this._w,a=o*e._w+i*e._x+n*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=n,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let p=1-t;return this._w=p*o+t*this._w,this._x=p*i+t*this._x,this._y=p*n+t*this._y,this._z=p*s+t*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*h+this._w*d,this._x=i*h+this._x*d,this._y=n*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=Math.random(),t=Math.sqrt(1-e),i=Math.sqrt(e),n=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(n),i*Math.sin(s),i*Math.cos(s),t*Math.sin(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Lt.prototype.isQuaternion=!0;var P=class{constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return t!==void 0?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return t!==void 0?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(ef.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ef.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*n,this.y=s[1]*t+s[4]*i+s[7]*n,this.z=s[2]*t+s[5]*i+s[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*n+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*n+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*n+s[14])*o,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*n-a*i,u=l*i+a*t-s*n,h=l*n+s*i-o*t,d=-s*t-o*i-a*n;return this.x=c*l+d*-s+u*-a-h*-o,this.y=u*l+d*-o+h*-s-c*-a,this.z=h*l+d*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n,this.y=s[1]*t+s[5]*i+s[9]*n,this.z=s[2]*t+s[6]*i+s[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e,t){return t!==void 0?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=n*l-s*a,this.y=s*o-i*l,this.z=i*a-n*o,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return qc.copy(this).projectOnVector(e),this.sub(qc)}reflect(e){return this.sub(qc.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let i=this.dot(e)/t;return Math.acos(Ut(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,i){return i!==void 0&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,i=Math.sqrt(1-e**2);return this.x=i*Math.cos(t),this.y=i*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};P.prototype.isVector3=!0;var qc=new P,ef=new Lt,Qt=class{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,i=1/0,n=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.length;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,i,n),this.max.set(s,o,a),this}setFromBufferAttribute(e){let t=1/0,i=1/0,n=1/0,s=-1/0,o=-1/0,a=-1/0;for(let l=0,c=e.count;ls&&(s=u),h>o&&(o=h),d>a&&(a=d)}return this.min.set(t,i,n),this.max.set(s,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Nn),Nn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(vr),Xo.subVectors(this.max,vr),as.subVectors(e.a,vr),ls.subVectors(e.b,vr),cs.subVectors(e.c,vr),an.subVectors(ls,as),ln.subVectors(cs,ls),kn.subVectors(as,cs);let t=[0,-an.z,an.y,0,-ln.z,ln.y,0,-kn.z,kn.y,an.z,0,-an.x,ln.z,0,-ln.x,kn.z,0,-kn.x,-an.y,an.x,0,-ln.y,ln.x,0,-kn.y,kn.x,0];return!$c(t,as,ls,cs,Xo)||(t=[1,0,0,0,1,0,0,0,1],!$c(t,as,ls,cs,Xo))?!1:(Yo.crossVectors(an,ln),t=[Yo.x,Yo.y,Yo.z],$c(t,as,ls,cs,Xo))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Nn.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Nn).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Hi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Hi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Hi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Hi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Hi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Hi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Hi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Hi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Hi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Qt.prototype.isBox3=!0;var Hi=[new P,new P,new P,new P,new P,new P,new P,new P],Nn=new P,Wc=new Qt,as=new P,ls=new P,cs=new P,an=new P,ln=new P,kn=new P,vr=new P,Xo=new P,Yo=new P,On=new P;function $c(r,e,t,i,n){for(let s=0,o=r.length-3;s<=o;s+=3){On.fromArray(r,s);let a=n.x*Math.abs(On.x)+n.y*Math.abs(On.y)+n.z*Math.abs(On.z),l=e.dot(On),c=t.dot(On),u=i.dot(On);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}var Ev=new Qt,tf=new P,Zo=new P,jc=new P,Ci=class{constructor(e=new P,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):Ev.setFromPoints(e).getCenter(i);let n=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){jc.subVectors(e,this.center);let t=jc.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),n=(i-this.radius)*.5;this.center.add(jc.multiplyScalar(n/i)),this.radius+=n}return this}union(e){return this.center.equals(e.center)===!0?Zo.set(0,0,1).multiplyScalar(e.radius):Zo.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(tf.copy(e.center).add(Zo)),this.expandByPoint(tf.copy(e.center).sub(Zo)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Gi=new P,Xc=new P,Jo=new P,cn=new P,Yc=new P,Ko=new P,Zc=new P,_n=class{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Gi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Gi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gi.copy(this.direction).multiplyScalar(t).add(this.origin),Gi.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Xc.copy(e).add(t).multiplyScalar(.5),Jo.copy(t).sub(e).normalize(),cn.copy(this.origin).sub(Xc);let s=e.distanceTo(t)*.5,o=-this.direction.dot(Jo),a=cn.dot(this.direction),l=-cn.dot(Jo),c=cn.lengthSq(),u=Math.abs(1-o*o),h,d,p,m;if(u>0)if(h=o*l-a,d=o*a-l,m=s*u,h>=0)if(d>=-m)if(d<=m){let y=1/u;h*=y,d*=y,p=h*(h+o*d+2*a)+d*(o*h+d+2*l)+c}else d=s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;else d<=-m?(h=Math.max(0,-(-o*s+a)),d=h>0?-s:Math.min(Math.max(-s,-l),s),p=-h*h+d*(d+2*l)+c):d<=m?(h=0,d=Math.min(Math.max(-s,-l),s),p=d*(d+2*l)+c):(h=Math.max(0,-(o*s+a)),d=h>0?s:Math.min(Math.max(-s,-l),s),p=-h*h+d*(d+2*l)+c);else d=o>0?-s:s,h=Math.max(0,-(o*d+a)),p=-h*h+d*(d+2*l)+c;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(Jo).multiplyScalar(d).add(Xc),p}intersectSphere(e,t){Gi.subVectors(e.center,this.origin);let i=Gi.dot(this.direction),n=Gi.dot(Gi)-i*i,s=e.radius*e.radius;if(n>s)return null;let o=Math.sqrt(s-n),a=i-o,l=i+o;return a<0&&l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,s,o,a,l,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,n=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,n=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||s>n||((s>i||i!==i)&&(i=s),(o=0?(a=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),i>l||a>n)||((a>i||i!==i)&&(i=a),(l=0?i:n,t)}intersectsBox(e){return this.intersectBox(e,Gi)!==null}intersectTriangle(e,t,i,n,s){Yc.subVectors(t,e),Ko.subVectors(i,e),Zc.crossVectors(Yc,Ko);let o=this.direction.dot(Zc),a;if(o>0){if(n)return null;a=1}else if(o<0)a=-1,o=-o;else return null;cn.subVectors(this.origin,e);let l=a*this.direction.dot(Ko.crossVectors(cn,Ko));if(l<0)return null;let c=a*this.direction.dot(Yc.cross(cn));if(c<0||l+c>o)return null;let u=-a*cn.dot(Zc);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},Ee=class r{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,i,n,s,o,a,l,c,u,h,d,p,m,y,x){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=d,g[3]=p,g[7]=m,g[11]=y,g[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/us.setFromMatrixColumn(e,0).length(),s=1/us.setFromMatrixColumn(e,1).length(),o=1/us.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let t=this.elements,i=e.x,n=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(n),c=Math.sin(n),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){let d=o*u,p=o*h,m=a*u,y=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=p+m*c,t[5]=d-y*c,t[9]=-a*l,t[2]=y-d*c,t[6]=m+p*c,t[10]=o*l}else if(e.order==="YXZ"){let d=l*u,p=l*h,m=c*u,y=c*h;t[0]=d+y*a,t[4]=m*a-p,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=p*a-m,t[6]=y+d*a,t[10]=o*l}else if(e.order==="ZXY"){let d=l*u,p=l*h,m=c*u,y=c*h;t[0]=d-y*a,t[4]=-o*h,t[8]=m+p*a,t[1]=p+m*a,t[5]=o*u,t[9]=y-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){let d=o*u,p=o*h,m=a*u,y=a*h;t[0]=l*u,t[4]=m*c-p,t[8]=d*c+y,t[1]=l*h,t[5]=y*c+d,t[9]=p*c-m,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){let d=o*l,p=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=y-d*h,t[8]=m*h+p,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=p*h+m,t[10]=d-y*h}else if(e.order==="XZY"){let d=o*l,p=o*c,m=a*l,y=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+y,t[5]=o*u,t[9]=p*h-m,t[2]=m*h-p,t[6]=a*u,t[10]=y*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Av,e,Sv)}lookAt(e,t,i){let n=this.elements;return Zt.subVectors(e,t),Zt.lengthSq()===0&&(Zt.z=1),Zt.normalize(),un.crossVectors(i,Zt),un.lengthSq()===0&&(Math.abs(i.z)===1?Zt.x+=1e-4:Zt.z+=1e-4,Zt.normalize(),un.crossVectors(i,Zt)),un.normalize(),Qo.crossVectors(Zt,un),n[0]=un.x,n[4]=Qo.x,n[8]=Zt.x,n[1]=un.y,n[5]=Qo.y,n[9]=Zt.y,n[2]=un.z,n[6]=Qo.z,n[10]=Zt.z,this}multiply(e,t){return t!==void 0?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],h=i[5],d=i[9],p=i[13],m=i[2],y=i[6],x=i[10],g=i[14],f=i[3],E=i[7],w=i[11],_=i[15],M=n[0],T=n[4],z=n[8],W=n[12],A=n[1],v=n[5],R=n[9],S=n[13],B=n[2],L=n[6],C=n[10],N=n[14],k=n[3],V=n[7],U=n[11],q=n[15];return s[0]=o*M+a*A+l*B+c*k,s[4]=o*T+a*v+l*L+c*V,s[8]=o*z+a*R+l*C+c*U,s[12]=o*W+a*S+l*N+c*q,s[1]=u*M+h*A+d*B+p*k,s[5]=u*T+h*v+d*L+p*V,s[9]=u*z+h*R+d*C+p*U,s[13]=u*W+h*S+d*N+p*q,s[2]=m*M+y*A+x*B+g*k,s[6]=m*T+y*v+x*L+g*V,s[10]=m*z+y*R+x*C+g*U,s[14]=m*W+y*S+x*N+g*q,s[3]=f*M+E*A+w*B+_*k,s[7]=f*T+E*v+w*L+_*V,s[11]=f*z+E*R+w*C+_*U,s[15]=f*W+E*S+w*N+_*q,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],i=e[4],n=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],p=e[14],m=e[3],y=e[7],x=e[11],g=e[15];return m*(+s*l*h-n*c*h-s*a*d+i*c*d+n*a*p-i*l*p)+y*(+t*l*p-t*c*d+s*o*d-n*o*p+n*c*u-s*l*u)+x*(+t*c*h-t*a*p-s*o*h+i*o*p+s*a*u-i*c*u)+g*(-n*a*u-t*l*h+t*a*d+n*o*h-i*o*d+i*l*u)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],m=e[12],y=e[13],x=e[14],g=e[15],f=h*x*c-y*d*c+y*l*p-a*x*p-h*l*g+a*d*g,E=m*d*c-u*x*c-m*l*p+o*x*p+u*l*g-o*d*g,w=u*y*c-m*h*c+m*a*p-o*y*p-u*a*g+o*h*g,_=m*h*l-u*y*l-m*a*d+o*y*d+u*a*x-o*h*x,M=t*f+i*E+n*w+s*_;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let T=1/M;return e[0]=f*T,e[1]=(y*d*s-h*x*s-y*n*p+i*x*p+h*n*g-i*d*g)*T,e[2]=(a*x*s-y*l*s+y*n*c-i*x*c-a*n*g+i*l*g)*T,e[3]=(h*l*s-a*d*s-h*n*c+i*d*c+a*n*p-i*l*p)*T,e[4]=E*T,e[5]=(u*x*s-m*d*s+m*n*p-t*x*p-u*n*g+t*d*g)*T,e[6]=(m*l*s-o*x*s-m*n*c+t*x*c+o*n*g-t*l*g)*T,e[7]=(o*d*s-u*l*s+u*n*c-t*d*c-o*n*p+t*l*p)*T,e[8]=w*T,e[9]=(m*h*s-u*y*s-m*i*p+t*y*p+u*i*g-t*h*g)*T,e[10]=(o*y*s-m*a*s+m*i*c-t*y*c-o*i*g+t*a*g)*T,e[11]=(u*a*s-o*h*s-u*i*c+t*h*c+o*i*p-t*a*p)*T,e[12]=_*T,e[13]=(u*y*n-m*h*n+m*i*d-t*y*d-u*i*x+t*h*x)*T,e[14]=(m*a*n-o*y*n-m*i*l+t*y*l+o*i*x-t*a*x)*T,e[15]=(o*h*n-u*a*n+u*i*l-t*h*l-o*i*d+t*a*d)*T,this}scale(e){let t=this.elements,i=e.x,n=e.y,s=e.z;return t[0]*=i,t[4]*=n,t[8]*=s,t[1]*=i,t[5]*=n,t[9]*=s,t[2]*=i,t[6]*=n,t[10]*=s,t[3]*=i,t[7]*=n,t[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-n*l,c*l+n*a,0,c*a+n*l,u*a+i,u*l-n*o,0,c*l-n*a,u*l+n*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,s,o){return this.set(1,i,s,0,e,1,o,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,d=s*c,p=s*u,m=s*h,y=o*u,x=o*h,g=a*h,f=l*c,E=l*u,w=l*h,_=i.x,M=i.y,T=i.z;return n[0]=(1-(y+g))*_,n[1]=(p+w)*_,n[2]=(m-E)*_,n[3]=0,n[4]=(p-w)*M,n[5]=(1-(d+g))*M,n[6]=(x+f)*M,n[7]=0,n[8]=(m+E)*T,n[9]=(x-f)*T,n[10]=(1-(d+y))*T,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,s=us.set(n[0],n[1],n[2]).length(),o=us.set(n[4],n[5],n[6]).length(),a=us.set(n[8],n[9],n[10]).length();this.determinant()<0&&(s=-s),e.x=n[12],e.y=n[13],e.z=n[14],ui.copy(this);let c=1/s,u=1/o,h=1/a;return ui.elements[0]*=c,ui.elements[1]*=c,ui.elements[2]*=c,ui.elements[4]*=u,ui.elements[5]*=u,ui.elements[6]*=u,ui.elements[8]*=h,ui.elements[9]*=h,ui.elements[10]*=h,t.setFromRotationMatrix(ui),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,n,s,o){o===void 0&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,l=2*s/(t-e),c=2*s/(i-n),u=(t+e)/(t-e),h=(i+n)/(i-n),d=-(o+s)/(o-s),p=-2*o*s/(o-s);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,i,n,s,o){let a=this.elements,l=1/(t-e),c=1/(i-n),u=1/(o-s),h=(t+e)*l,d=(i+n)*c,p=(o+s)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){let i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}};Ee.prototype.isMatrix4=!0;var us=new P,ui=new Ee,Av=new P(0,0,0),Sv=new P(1,1,1),un=new P,Qo=new P,Zt=new P,nf=new Ee,sf=new Lt,Is=class r{constructor(e=0,t=0,i=0,n=r.DefaultOrder){this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){let n=e.elements,s=n[0],o=n[4],a=n[8],l=n[1],c=n[5],u=n[9],h=n[2],d=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(Ut(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ut(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Ut(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Ut(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Ut(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-Ut(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return nf.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nf,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return sf.setFromEuler(this),this.setFromQuaternion(sf,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new P(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}};Is.prototype.isEuler=!0;Is.DefaultOrder="XYZ";Is.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var Fa=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0){n.children=[];for(let a=0;a0){n.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),h.length>0&&(i.shapes=h),d.length>0&&(i.skeletons=d),p.length>0&&(i.animations=p)}return i.object=n,i;function o(a){let l=[];for(let c in a){let u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?n.multiplyScalar(1/Math.sqrt(s)):n.set(0,0,0)}static getBarycoord(e,t,i,n,s){hi.subVectors(n,t),Wi.subVectors(i,t),Jc.subVectors(e,t);let o=hi.dot(hi),a=hi.dot(Wi),l=hi.dot(Jc),c=Wi.dot(Wi),u=Wi.dot(Jc),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);let d=1/h,p=(c*l-a*u)*d,m=(o*u-a*l)*d;return s.set(1-p-m,m,p)}static containsPoint(e,t,i,n){return this.getBarycoord(e,t,i,n,$i),$i.x>=0&&$i.y>=0&&$i.x+$i.y<=1}static getUV(e,t,i,n,s,o,a,l){return this.getBarycoord(e,t,i,n,$i),l.set(0,0),l.addScaledVector(s,$i.x),l.addScaledVector(o,$i.y),l.addScaledVector(a,$i.z),l}static isFrontFacing(e,t,i,n){return hi.subVectors(i,t),Wi.subVectors(e,t),hi.cross(Wi).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return hi.subVectors(this.c,this.b),Wi.subVectors(this.a,this.b),hi.cross(Wi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return r.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return r.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,n,s){return r.getUV(e,this.a,this.b,this.c,t,i,n,s)}containsPoint(e){return r.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return r.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i=this.a,n=this.b,s=this.c,o,a;ds.subVectors(n,i),ps.subVectors(s,i),Kc.subVectors(e,i);let l=ds.dot(Kc),c=ps.dot(Kc);if(l<=0&&c<=0)return t.copy(i);Qc.subVectors(e,n);let u=ds.dot(Qc),h=ps.dot(Qc);if(u>=0&&h<=u)return t.copy(n);let d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(ds,o);eu.subVectors(e,s);let p=ds.dot(eu),m=ps.dot(eu);if(m>=0&&p<=m)return t.copy(s);let y=p*c-l*m;if(y<=0&&c>=0&&m<=0)return a=c/(c-m),t.copy(i).addScaledVector(ps,a);let x=u*m-p*h;if(x<=0&&h-u>=0&&p-m>=0)return uf.subVectors(s,n),a=(h-u)/(h-u+(p-m)),t.copy(n).addScaledVector(uf,a);let g=1/(x+y+d);return o=y*g,a=d*g,t.copy(i).addScaledVector(ds,o).addScaledVector(ps,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Rv=0,ft=class extends Xi{constructor(){super(),Object.defineProperty(this,"id",{value:Rv++}),this.uuid=pi(),this.name="",this.type="Material",this.fog=!0,this.blending=Rr,this.side=Pr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=am,this.blendDst=lm,this.blendEquation=Ss,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=xu,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vv,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Oc,this.stencilZFail=Oc,this.stencilZPass=Oc,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if(t==="shading"){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===om;continue}let n=this[t];if(n===void 0){console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.");continue}n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Rr&&(i.blending=this.blending),this.side!==Pr&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData);function n(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(t){let s=n(e.textures),o=n(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let n=t.length;i=new Array(n);for(let s=0;s!==n;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};ft.prototype.isMaterial=!0;var zr=class extends ft{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=il,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};zr.prototype.isMeshBasicMaterial=!0;var Je=new P,ta=new ee,ht=class{constructor(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i===!0,this.usage=Nr,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,s=this.itemSize;n0&&(e.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let l in i){let c=i[l];e.data.attributes[l]=c.toJSON(e.data)}let n={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h0&&(n[l]=u,s=!0)}s&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;i!==null&&this.setIndex(i.clone(t));let n=e.attributes;for(let c in n){let u=n[c];this.setAttribute(c,u.clone(t))}let s=e.morphAttributes;for(let c in s){let u=[],h=s[c];for(let d=0,p=h.length;d0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){let i=this.geometry,n=this.material,s=this.matrixWorld;if(n===void 0||(i.boundingSphere===null&&i.computeBoundingSphere(),iu.copy(i.boundingSphere),iu.applyMatrix4(s),e.ray.intersectsSphere(iu)===!1)||(hf.copy(s).invert(),ms.copy(e.ray).applyMatrix4(hf),i.boundingBox!==null&&ms.intersectsBox(i.boundingBox)===!1))return;let o;if(i.isBufferGeometry){let a=i.index,l=i.attributes.position,c=i.morphAttributes.position,u=i.morphTargetsRelative,h=i.attributes.uv,d=i.attributes.uv2,p=i.groups,m=i.drawRange;if(a!==null)if(Array.isArray(n))for(let y=0,x=p.length;yt.far?null:{distance:c,point:la.clone(),object:r}}function ca(r,e,t,i,n,s,o,a,l,c,u,h){hn.fromBufferAttribute(n,c),dn.fromBufferAttribute(n,u),pn.fromBufferAttribute(n,h);let d=r.morphTargetInfluences;if(s&&d){ia.set(0,0,0),na.set(0,0,0),sa.set(0,0,0);for(let m=0,y=s.length;m0?1:-1,u.push(V.x,V.y,V.z),h.push(j/T),h.push(1-U/z),N+=1}}for(let U=0;U0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};Hi.prototype.isShaderMaterial=!0;var Nr=class extends Ge{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Ee,this.projectionMatrix=new Ee,this.projectionMatrixInverse=new Ee}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Nr.prototype.isCamera=!0;var _t=class extends Nr{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=iu*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(yc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return iu*2*Math.atan(Math.tan(yc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(yc*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,s=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*n/l,t-=o.offsetY*i/c,n*=o.width/l,i*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};_t.prototype.isPerspectiveCamera=!0;var fs=90,ms=1,kr=class extends Ge{constructor(e,t,i){if(super(),this.type="CubeCamera",i.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=i;let n=new _t(fs,ms,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new P(1,0,0)),this.add(n);let s=new _t(fs,ms,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new P(-1,0,0)),this.add(s);let o=new _t(fs,ms,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new P(0,1,0)),this.add(o);let a=new _t(fs,ms,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new P(0,-1,0)),this.add(a);let l=new _t(fs,ms,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new P(0,0,1)),this.add(l);let c=new _t(fs,ms,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new P(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let i=this.renderTarget,[n,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=d,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u,i.texture.needsPMREMUpdate=!0}},Is=class extends at{constructor(e,t,i,n,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:so,super(e,t,i,n,s,o,a,l,c,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};Is.prototype.isCubeTexture=!0;var La=class extends zt{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new Is(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Dt}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Lt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`,Zi=class extends ft{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Pv,this.fragmentShader=Iv,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&(e.attributes!==void 0&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ns(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let n in this.uniforms){let o=this.uniforms[n].value;o&&o.isTexture?t.uniforms[n]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[n]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[n]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[n]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[n]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[n]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[n]={type:"m4",value:o.toArray()}:t.uniforms[n]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;let i={};for(let n in this.extensions)this.extensions[n]===!0&&(i[n]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}};Zi.prototype.isShaderMaterial=!0;var Ur=class extends Ge{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Ee,this.projectionMatrix=new Ee,this.projectionMatrixInverse=new Ee}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};Ur.prototype.isCamera=!0;var Et=class extends Ur{constructor(e=50,t=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=Au*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(zc*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Au*2*Math.atan(Math.tan(zc*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,i,n,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(zc*.5*this.fov)/this.zoom,i=2*t,n=this.aspect*i,s=-.5*n,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*n/l,t-=o.offsetY*i/c,n*=o.width/l,i*=o.height/c}let a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+n,t,t-i,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};Et.prototype.isPerspectiveCamera=!0;var gs=90,ys=1,Hr=class extends Ge{constructor(e,t,i){if(super(),this.type="CubeCamera",i.isWebGLCubeRenderTarget!==!0){console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");return}this.renderTarget=i;let n=new Et(gs,ys,e,t);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new P(1,0,0)),this.add(n);let s=new Et(gs,ys,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new P(-1,0,0)),this.add(s);let o=new Et(gs,ys,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new P(0,1,0)),this.add(o);let a=new Et(gs,ys,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new P(0,-1,0)),this.add(a);let l=new Et(gs,ys,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new P(0,0,1)),this.add(l);let c=new Et(gs,ys,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new P(0,0,-1)),this.add(c)}update(e,t){this.parent===null&&this.updateMatrixWorld();let i=this.renderTarget,[n,s,o,a,l,c]=this.children,u=e.xr.enabled,h=e.getRenderTarget();e.xr.enabled=!1;let d=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,n),e.setRenderTarget(i,1),e.render(t,s),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,a),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=d,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(h),e.xr.enabled=u,i.texture.needsPMREMUpdate=!0}},ks=class extends lt{constructor(e,t,i,n,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:co,super(e,t,i,n,s,o,a,l,c,u),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}};ks.prototype.isCubeTexture=!0;var Pa=class extends Ht{constructor(e,t,i){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=i),super(e,e,t),t=t||{},this.texture=new ks(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:Ft}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=Nt,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -53,28 +50,28 @@ ${this.results.toString()}`}async roll(){let t=[...this.options];return this.res gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},n=new Ir(5,5,5),s=new Hi({name:"CubemapFromEquirect",uniforms:Ps(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:gt,blending:ln});s.uniforms.tEquirect.value=t;let o=new ht(n,s),a=t.minFilter;return t.minFilter===il&&(t.minFilter=Dt),new kr(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,n){let s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,n);e.setRenderTarget(s)}};La.prototype.isWebGLCubeRenderTarget=!0;var Oc=new P,cv=new P,uv=new xt,si=class{constructor(e=new P(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=Oc.subVectors(i,t).cross(cv.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(Oc),n=this.normal.dot(i);if(n===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let s=-(e.start.dot(this.normal)+this.constant)/n;return s<0||s>1?null:t.copy(i).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||uv.getNormalMatrix(e),n=this.coplanarPoint(Oc).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};si.prototype.isPlane=!0;var gs=new vi,la=new P,Ns=class{constructor(e=new si,t=new si,i=new si,n=new si,s=new si,o=new si){this.planes=[e,t,i,n,s,o]}set(e,t,i,n,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7],d=i[8],p=i[9],m=i[10],y=i[11],x=i[12],g=i[13],f=i[14],E=i[15];return t[0].setComponents(a-n,h-l,y-d,E-x).normalize(),t[1].setComponents(a+n,h+l,y+d,E+x).normalize(),t[2].setComponents(a+s,h+c,y+p,E+g).normalize(),t[3].setComponents(a-s,h-c,y-p,E-g).normalize(),t[4].setComponents(a-o,h-u,y-m,E-f).normalize(),t[5].setComponents(a+o,h+u,y+m,E+f).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),gs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(gs)}intersectsSprite(e){return gs.center.set(0,0,0),gs.radius=.7071067811865476,gs.applyMatrix4(e.matrixWorld),this.intersectsSphere(gs)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,la.y=n.normal.y>0?e.max.y:e.min.y,la.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(la)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Gf(){let r=null,e=!1,t=null,i=null;function n(s,o){t(s,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function hv(r,e){let t=e.isWebGL2,i=new WeakMap;function n(c,u){let h=c.array,d=c.usage,p=r.createBuffer();r.bindBuffer(u,p),r.bufferData(u,h,d),c.onUploadCallback();let m=5126;return h instanceof Float32Array?m=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?m=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):m=5123:h instanceof Int16Array?m=5122:h instanceof Uint32Array?m=5125:h instanceof Int32Array?m=5124:h instanceof Int8Array?m=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(m=5121),{buffer:p,type:m,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,p=u.updateRange;r.bindBuffer(h,c),p.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,p.offset*d.BYTES_PER_ELEMENT,d,p.offset,p.count):r.bufferSubData(h,p.offset*d.BYTES_PER_ELEMENT,d.subarray(p.offset,p.offset+p.count)),p.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),i.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=i.get(c);u&&(r.deleteBuffer(u.buffer),i.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=i.get(c);(!d||d.version1?null:t.copy(i).multiplyScalar(s).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||kv.getNormalMatrix(e),n=this.coplanarPoint(au).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};di.prototype.isPlane=!0;var xs=new Ci,ua=new P,Os=class{constructor(e=new di,t=new di,i=new di,n=new di,s=new di,o=new di){this.planes=[e,t,i,n,s,o]}set(e,t,i,n,s,o){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(s),a[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],u=i[6],h=i[7],d=i[8],p=i[9],m=i[10],y=i[11],x=i[12],g=i[13],f=i[14],E=i[15];return t[0].setComponents(a-n,h-l,y-d,E-x).normalize(),t[1].setComponents(a+n,h+l,y+d,E+x).normalize(),t[2].setComponents(a+s,h+c,y+p,E+g).normalize(),t[3].setComponents(a-s,h-c,y-p,E-g).normalize(),t[4].setComponents(a-o,h-u,y-m,E-f).normalize(),t[5].setComponents(a+o,h+u,y+m,E+f).normalize(),this}intersectsObject(e){let t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),xs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(xs)}intersectsSprite(e){return xs.center.set(0,0,0),xs.radius=.7071067811865476,xs.applyMatrix4(e.matrixWorld),this.intersectsSphere(xs)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,ua.y=n.normal.y>0?e.max.y:e.min.y,ua.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(ua)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function pm(){let r=null,e=!1,t=null,i=null;function n(s,o){t(s,o),i=r.requestAnimationFrame(n)}return{start:function(){e!==!0&&t!==null&&(i=r.requestAnimationFrame(n),e=!0)},stop:function(){r.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function Ov(r,e){let t=e.isWebGL2,i=new WeakMap;function n(c,u){let h=c.array,d=c.usage,p=r.createBuffer();r.bindBuffer(u,p),r.bufferData(u,h,d),c.onUploadCallback();let m=5126;return h instanceof Float32Array?m=5126:h instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):h instanceof Uint16Array?c.isFloat16BufferAttribute?t?m=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):m=5123:h instanceof Int16Array?m=5122:h instanceof Uint32Array?m=5125:h instanceof Int32Array?m=5124:h instanceof Int8Array?m=5120:(h instanceof Uint8Array||h instanceof Uint8ClampedArray)&&(m=5121),{buffer:p,type:m,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){let d=u.array,p=u.updateRange;r.bindBuffer(h,c),p.count===-1?r.bufferSubData(h,0,d):(t?r.bufferSubData(h,p.offset*d.BYTES_PER_ELEMENT,d,p.offset,p.count):r.bufferSubData(h,p.offset*d.BYTES_PER_ELEMENT,d.subarray(p.offset,p.offset+p.count)),p.count=-1)}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),i.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);let u=i.get(c);u&&(r.deleteBuffer(u.buffer),i.delete(c))}function l(c,u){if(c.isGLBufferAttribute){let d=i.get(c);(!d||d.version 0 +#endif`,Yv=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -226,26 +223,26 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,Ev=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Zv=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,Av=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Jv=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,Sv=`#if NUM_CLIPPING_PLANES > 0 +#endif`,Kv=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,Mv=`#if defined( USE_COLOR_ALPHA ) +#endif`,Qv=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,Dv=`#if defined( USE_COLOR_ALPHA ) +#endif`,e2=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,Tv=`#if defined( USE_COLOR_ALPHA ) +#endif`,t2=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,Cv=`#if defined( USE_COLOR_ALPHA ) +#endif`,i2=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -255,7 +252,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,Rv=`#define PI 3.141592653589793 +#endif`,n2=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -326,7 +323,7 @@ vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); -}`,Fv=`#ifdef ENVMAP_TYPE_CUBE_UV +}`,s2=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_maxMipLevel 8.0 #define cubeUV_minMipLevel 4.0 #define cubeUV_maxTileSize 256.0 @@ -425,7 +422,7 @@ vec2 equirectUv( in vec3 dir ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,Lv=`vec3 transformedNormal = objectNormal; +#endif`,r2=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); @@ -440,23 +437,23 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,Bv=`#ifdef USE_DISPLACEMENTMAP +#endif`,o2=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,Pv=`#ifdef USE_DISPLACEMENTMAP +#endif`,a2=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,Iv=`#ifdef USE_EMISSIVEMAP +#endif`,l2=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,Nv=`#ifdef USE_EMISSIVEMAP +#endif`,c2=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,kv="gl_FragColor = linearToOutputTexel( gl_FragColor );",zv=`vec4 LinearToLinear( in vec4 value ) { +#endif`,u2="gl_FragColor = linearToOutputTexel( gl_FragColor );",h2=`vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,Ov=`#ifdef USE_ENVMAP +}`,d2=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -487,7 +484,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,Vv=`#ifdef USE_ENVMAP +#endif`,p2=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -496,7 +493,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,Uv=`#ifdef USE_ENVMAP +#endif`,f2=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) #define ENV_WORLDPOS @@ -507,7 +504,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,Hv=`#ifdef USE_ENVMAP +#endif`,m2=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) #define ENV_WORLDPOS #endif @@ -518,7 +515,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Gv=`#ifdef USE_ENVMAP +#endif`,g2=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -535,18 +532,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,qv=`#ifdef USE_FOG +#endif`,y2=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,Wv=`#ifdef USE_FOG +#endif`,x2=`#ifdef USE_FOG varying float vFogDepth; -#endif`,$v=`#ifdef USE_FOG +#endif`,v2=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,jv=`#ifdef USE_FOG +#endif`,w2=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -555,7 +552,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,Xv=`#ifdef USE_GRADIENTMAP +#endif`,b2=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -566,17 +563,17 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { #else return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); #endif -}`,Yv=`#ifdef USE_LIGHTMAP +}`,_2=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; #ifndef PHYSICALLY_CORRECT_LIGHTS lightMapIrradiance *= PI; #endif reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,Zv=`#ifdef USE_LIGHTMAP +#endif`,E2=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,Jv=`vec3 diffuse = vec3( 1.0 ); +#endif`,A2=`vec3 diffuse = vec3( 1.0 ); GeometricContext geometry; geometry.position = mvPosition.xyz; geometry.normal = normalize( transformedNormal ); @@ -648,7 +645,7 @@ vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal ); #endif } #pragma unroll_loop_end -#endif`,Kv=`uniform bool receiveShadow; +#endif`,S2=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { @@ -769,7 +766,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,Qv=`#if defined( USE_ENVMAP ) +#endif`,M2=`#if defined( USE_ENVMAP ) #ifdef ENVMAP_MODE_REFRACTION uniform float refractionRatio; #endif @@ -798,8 +795,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi return vec3( 0.0 ); #endif } -#endif`,e2=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,t2=`varying vec3 vViewPosition; +#endif`,D2=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,T2=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -812,11 +809,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,i2=`BlinnPhongMaterial material; +#define Material_LightProbeLOD( material ) (0)`,C2=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,n2=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,R2=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -834,7 +831,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,s2=`PhysicalMaterial material; +#define Material_LightProbeLOD( material ) (0)`,F2=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -885,7 +882,7 @@ material.roughness = min( material.roughness, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif -#endif`,r2=`struct PhysicalMaterial { +#endif`,L2=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -999,7 +996,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,o2=` +}`,B2=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1083,7 +1080,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,a2=`#if defined( RE_IndirectDiffuse ) +#endif`,P2=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1101,25 +1098,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,l2=`#if defined( RE_IndirectDiffuse ) +#endif`,I2=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,c2=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,N2=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,u2=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,k2=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,h2=`#ifdef USE_LOGDEPTHBUF +#endif`,O2=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,d2=`#ifdef USE_LOGDEPTHBUF +#endif`,z2=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1129,15 +1126,15 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,p2=`#ifdef USE_MAP +#endif`,V2=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,f2=`#ifdef USE_MAP +#endif`,U2=`#ifdef USE_MAP uniform sampler2D map; -#endif`,m2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,H2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP @@ -1145,7 +1142,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,g2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,G2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP @@ -1153,13 +1150,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,y2=`float metalnessFactor = metalness; +#endif`,q2=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; -#endif`,x2=`#ifdef USE_METALNESSMAP +#endif`,W2=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,v2=`#ifdef USE_MORPHNORMALS +#endif`,$2=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1171,7 +1168,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,w2=`#ifdef USE_MORPHTARGETS +#endif`,j2=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1191,7 +1188,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,b2=`#ifdef USE_MORPHTARGETS +#endif`,X2=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1213,7 +1210,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,_2=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,Y2=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); @@ -1235,7 +1232,7 @@ IncidentLight directLight; #endif #endif #endif -vec3 geometryNormal = normal;`,E2=`#ifdef OBJECTSPACE_NORMALMAP +vec3 geometryNormal = normal;`,Z2=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1254,25 +1251,25 @@ vec3 geometryNormal = normal;`,E2=`#ifdef OBJECTSPACE_NORMALMAP #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,A2=`#ifndef FLAT_SHADED +#endif`,J2=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,S2=`#ifndef FLAT_SHADED +#endif`,K2=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,M2=`#ifndef FLAT_SHADED +#endif`,Q2=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,D2=`#ifdef USE_NORMALMAP +#endif`,ew=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1294,9 +1291,9 @@ vec3 geometryNormal = normal;`,E2=`#ifdef OBJECTSPACE_NORMALMAP float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } -#endif`,T2=`#ifdef USE_CLEARCOAT +#endif`,tw=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; -#endif`,C2=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,iw=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT @@ -1304,7 +1301,7 @@ vec3 geometryNormal = normal;`,E2=`#ifdef OBJECTSPACE_NORMALMAP #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif -#endif`,R2=`#ifdef USE_CLEARCOATMAP +#endif`,nw=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP @@ -1313,13 +1310,13 @@ vec3 geometryNormal = normal;`,E2=`#ifdef OBJECTSPACE_NORMALMAP #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; -#endif`,F2=`#ifdef OPAQUE +#endif`,sw=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= transmissionAlpha + 0.1; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,L2=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rw=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1354,29 +1351,29 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,B2=`#ifdef PREMULTIPLIED_ALPHA +}`,ow=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,P2=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,aw=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,lw=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,N2=`#ifdef DITHERING +#endif`,cw=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,k2=`float roughnessFactor = roughness; +#endif`,uw=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; -#endif`,z2=`#ifdef USE_ROUGHNESSMAP +#endif`,hw=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,O2=`#ifdef USE_SHADOWMAP +#endif`,dw=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; @@ -1550,7 +1547,7 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,V2=`#ifdef USE_SHADOWMAP +#endif`,pw=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; @@ -1586,7 +1583,7 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,U2=`#ifdef USE_SHADOWMAP +#endif`,fw=`#ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; @@ -1615,7 +1612,7 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING } #pragma unroll_loop_end #endif -#endif`,H2=`float getShadowMask() { +#endif`,mw=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -1647,12 +1644,12 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING #endif #endif return shadow; -}`,G2=`#ifdef USE_SKINNING +}`,gw=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,q2=`#ifdef USE_SKINNING +#endif`,yw=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; #ifdef BONE_TEXTURE @@ -1679,7 +1676,7 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING return bone; } #endif -#endif`,W2=`#ifdef USE_SKINNING +#endif`,xw=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -1687,7 +1684,7 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,$2=`#ifdef USE_SKINNING +#endif`,vw=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -1698,17 +1695,17 @@ gl_Position = projectionMatrix * mvPosition;`,I2=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,j2=`float specularStrength; +#endif`,ww=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,X2=`#ifdef USE_SPECULARMAP +#endif`,bw=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,Y2=`#if defined( TONE_MAPPING ) +#endif`,_w=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,Z2=`#ifndef saturate +#endif`,Ew=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -1744,7 +1741,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,J2=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,Aw=`#ifdef USE_TRANSMISSION float transmissionAlpha = 1.0; float transmissionFactor = transmission; float thicknessFactor = thickness; @@ -1763,7 +1760,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,J2=`#ifdef USE_TRANSMISS attenuationColor, attenuationDistance ); totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor ); transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor ); -#endif`,K2=`#ifdef USE_TRANSMISSION +#endif`,Sw=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -1821,50 +1818,50 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,J2=`#ifdef USE_TRANSMISS vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } -#endif`,Q2=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) +#endif`,Mw=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; -#endif`,ew=`#ifdef USE_UV +#endif`,Dw=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; -#endif`,tw=`#ifdef USE_UV +#endif`,Tw=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,iw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Cw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,nw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Rw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; -#endif`,sw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,Fw=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,rw=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) +#endif`,Lw=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`,ow=`varying vec2 vUv; +#endif`,Bw=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,aw=`uniform sampler2D t2D; +}`,Pw=`uniform sampler2D t2D; varying vec2 vUv; void main() { gl_FragColor = texture2D( t2D, vUv ); #include #include -}`,lw=`varying vec3 vWorldDirection; +}`,Iw=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,cw=`#include +}`,Nw=`#include uniform float opacity; varying vec3 vWorldDirection; #include @@ -1875,7 +1872,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,uw=`#include +}`,kw=`#include #include #include #include @@ -1899,7 +1896,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,hw=`#if DEPTH_PACKING == 3200 +}`,Ow=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -1927,7 +1924,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,dw=`#define DISTANCE +}`,zw=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -1951,7 +1948,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,pw=`#define DISTANCE +}`,Vw=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -1973,13 +1970,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,fw=`varying vec3 vWorldDirection; +}`,Uw=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,mw=`uniform sampler2D tEquirect; +}`,Hw=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -1988,7 +1985,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,gw=`uniform float scale; +}`,Gw=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2006,7 +2003,7 @@ void main() { #include #include #include -}`,yw=`uniform vec3 diffuse; +}`,qw=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2031,7 +2028,7 @@ void main() { #include #include #include -}`,xw=`#include +}`,Ww=`#include #include #include #include @@ -2061,7 +2058,7 @@ void main() { #include #include #include -}`,vw=`uniform vec3 diffuse; +}`,$w=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2109,7 +2106,7 @@ void main() { #include #include #include -}`,ww=`#define LAMBERT +}`,jw=`#define LAMBERT varying vec3 vLightFront; varying vec3 vIndirectFront; #ifdef DOUBLE_SIDED @@ -2149,7 +2146,7 @@ void main() { #include #include #include -}`,bw=`uniform vec3 diffuse; +}`,Xw=`uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; varying vec3 vLightFront; @@ -2215,7 +2212,7 @@ void main() { #include #include #include -}`,_w=`#define MATCAP +}`,Yw=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2245,7 +2242,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,Ew=`#define MATCAP +}`,Zw=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2289,7 +2286,7 @@ void main() { #include #include #include -}`,Aw=`#define NORMAL +}`,Jw=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2319,7 +2316,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif -}`,Sw=`#define NORMAL +}`,Kw=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; @@ -2340,7 +2337,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,Mw=`#define PHONG +}`,Qw=`#define PHONG varying vec3 vViewPosition; #include #include @@ -2377,7 +2374,7 @@ void main() { #include #include #include -}`,Dw=`#define PHONG +}`,eb=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -2436,7 +2433,7 @@ void main() { #include #include #include -}`,Tw=`#define STANDARD +}`,tb=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -2477,7 +2474,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,Cw=`#define STANDARD +}`,ib=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR @@ -2585,7 +2582,7 @@ void main() { #include #include #include -}`,Rw=`#define TOON +}`,nb=`#define TOON varying vec3 vViewPosition; #include #include @@ -2620,7 +2617,7 @@ void main() { #include #include #include -}`,Fw=`#define TOON +}`,sb=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2672,7 +2669,7 @@ void main() { #include #include #include -}`,Lw=`uniform float size; +}`,rb=`uniform float size; uniform float scale; #include #include @@ -2694,7 +2691,7 @@ void main() { #include #include #include -}`,Bw=`uniform vec3 diffuse; +}`,ob=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -2717,7 +2714,7 @@ void main() { #include #include #include -}`,Pw=`#include +}`,ab=`#include #include #include #include @@ -2735,7 +2732,7 @@ void main() { #include #include #include -}`,Iw=`uniform vec3 color; +}`,lb=`uniform vec3 color; uniform float opacity; #include #include @@ -2749,7 +2746,7 @@ void main() { #include #include #include -}`,Nw=`uniform float rotation; +}`,cb=`uniform float rotation; uniform vec2 center; #include #include @@ -2775,7 +2772,7 @@ void main() { #include #include #include -}`,kw=`uniform vec3 diffuse; +}`,ub=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -2798,7 +2795,7 @@ void main() { #include #include #include -}`,Ne={alphamap_fragment:dv,alphamap_pars_fragment:pv,alphatest_fragment:fv,alphatest_pars_fragment:mv,aomap_fragment:gv,aomap_pars_fragment:yv,begin_vertex:xv,beginnormal_vertex:vv,bsdfs:wv,bumpmap_pars_fragment:bv,clipping_planes_fragment:_v,clipping_planes_pars_fragment:Ev,clipping_planes_pars_vertex:Av,clipping_planes_vertex:Sv,color_fragment:Mv,color_pars_fragment:Dv,color_pars_vertex:Tv,color_vertex:Cv,common:Rv,cube_uv_reflection_fragment:Fv,defaultnormal_vertex:Lv,displacementmap_pars_vertex:Bv,displacementmap_vertex:Pv,emissivemap_fragment:Iv,emissivemap_pars_fragment:Nv,encodings_fragment:kv,encodings_pars_fragment:zv,envmap_fragment:Ov,envmap_common_pars_fragment:Vv,envmap_pars_fragment:Uv,envmap_pars_vertex:Hv,envmap_physical_pars_fragment:Qv,envmap_vertex:Gv,fog_vertex:qv,fog_pars_vertex:Wv,fog_fragment:$v,fog_pars_fragment:jv,gradientmap_pars_fragment:Xv,lightmap_fragment:Yv,lightmap_pars_fragment:Zv,lights_lambert_vertex:Jv,lights_pars_begin:Kv,lights_toon_fragment:e2,lights_toon_pars_fragment:t2,lights_phong_fragment:i2,lights_phong_pars_fragment:n2,lights_physical_fragment:s2,lights_physical_pars_fragment:r2,lights_fragment_begin:o2,lights_fragment_maps:a2,lights_fragment_end:l2,logdepthbuf_fragment:c2,logdepthbuf_pars_fragment:u2,logdepthbuf_pars_vertex:h2,logdepthbuf_vertex:d2,map_fragment:p2,map_pars_fragment:f2,map_particle_fragment:m2,map_particle_pars_fragment:g2,metalnessmap_fragment:y2,metalnessmap_pars_fragment:x2,morphnormal_vertex:v2,morphtarget_pars_vertex:w2,morphtarget_vertex:b2,normal_fragment_begin:_2,normal_fragment_maps:E2,normal_pars_fragment:A2,normal_pars_vertex:S2,normal_vertex:M2,normalmap_pars_fragment:D2,clearcoat_normal_fragment_begin:T2,clearcoat_normal_fragment_maps:C2,clearcoat_pars_fragment:R2,output_fragment:F2,packing:L2,premultiplied_alpha_fragment:B2,project_vertex:P2,dithering_fragment:I2,dithering_pars_fragment:N2,roughnessmap_fragment:k2,roughnessmap_pars_fragment:z2,shadowmap_pars_fragment:O2,shadowmap_pars_vertex:V2,shadowmap_vertex:U2,shadowmask_pars_fragment:H2,skinbase_vertex:G2,skinning_pars_vertex:q2,skinning_vertex:W2,skinnormal_vertex:$2,specularmap_fragment:j2,specularmap_pars_fragment:X2,tonemapping_fragment:Y2,tonemapping_pars_fragment:Z2,transmission_fragment:J2,transmission_pars_fragment:K2,uv_pars_fragment:Q2,uv_pars_vertex:ew,uv_vertex:tw,uv2_pars_fragment:iw,uv2_pars_vertex:nw,uv2_vertex:sw,worldpos_vertex:rw,background_vert:ow,background_frag:aw,cube_vert:lw,cube_frag:cw,depth_vert:uw,depth_frag:hw,distanceRGBA_vert:dw,distanceRGBA_frag:pw,equirect_vert:fw,equirect_frag:mw,linedashed_vert:gw,linedashed_frag:yw,meshbasic_vert:xw,meshbasic_frag:vw,meshlambert_vert:ww,meshlambert_frag:bw,meshmatcap_vert:_w,meshmatcap_frag:Ew,meshnormal_vert:Aw,meshnormal_frag:Sw,meshphong_vert:Mw,meshphong_frag:Dw,meshphysical_vert:Tw,meshphysical_frag:Cw,meshtoon_vert:Rw,meshtoon_frag:Fw,points_vert:Lw,points_frag:Bw,shadow_vert:Pw,shadow_frag:Iw,sprite_vert:Nw,sprite_frag:kw},re={common:{diffuse:{value:new ye(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new xt},uv2Transform:{value:new xt},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ye(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ye(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new xt}},sprite:{diffuse:{value:new ye(16777215)},opacity:{value:1},center:{value:new ee(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new xt}}},xi={basic:{uniforms:Mt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.fog]),vertexShader:Ne.meshbasic_vert,fragmentShader:Ne.meshbasic_frag},lambert:{uniforms:Mt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.fog,re.lights,{emissive:{value:new ye(0)}}]),vertexShader:Ne.meshlambert_vert,fragmentShader:Ne.meshlambert_frag},phong:{uniforms:Mt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.fog,re.lights,{emissive:{value:new ye(0)},specular:{value:new ye(1118481)},shininess:{value:30}}]),vertexShader:Ne.meshphong_vert,fragmentShader:Ne.meshphong_frag},standard:{uniforms:Mt([re.common,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.roughnessmap,re.metalnessmap,re.fog,re.lights,{emissive:{value:new ye(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ne.meshphysical_vert,fragmentShader:Ne.meshphysical_frag},toon:{uniforms:Mt([re.common,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.gradientmap,re.fog,re.lights,{emissive:{value:new ye(0)}}]),vertexShader:Ne.meshtoon_vert,fragmentShader:Ne.meshtoon_frag},matcap:{uniforms:Mt([re.common,re.bumpmap,re.normalmap,re.displacementmap,re.fog,{matcap:{value:null}}]),vertexShader:Ne.meshmatcap_vert,fragmentShader:Ne.meshmatcap_frag},points:{uniforms:Mt([re.points,re.fog]),vertexShader:Ne.points_vert,fragmentShader:Ne.points_frag},dashed:{uniforms:Mt([re.common,re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ne.linedashed_vert,fragmentShader:Ne.linedashed_frag},depth:{uniforms:Mt([re.common,re.displacementmap]),vertexShader:Ne.depth_vert,fragmentShader:Ne.depth_frag},normal:{uniforms:Mt([re.common,re.bumpmap,re.normalmap,re.displacementmap,{opacity:{value:1}}]),vertexShader:Ne.meshnormal_vert,fragmentShader:Ne.meshnormal_frag},sprite:{uniforms:Mt([re.sprite,re.fog]),vertexShader:Ne.sprite_vert,fragmentShader:Ne.sprite_frag},background:{uniforms:{uvTransform:{value:new xt},t2D:{value:null}},vertexShader:Ne.background_vert,fragmentShader:Ne.background_frag},cube:{uniforms:Mt([re.envmap,{opacity:{value:1}}]),vertexShader:Ne.cube_vert,fragmentShader:Ne.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ne.equirect_vert,fragmentShader:Ne.equirect_frag},distanceRGBA:{uniforms:Mt([re.common,re.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ne.distanceRGBA_vert,fragmentShader:Ne.distanceRGBA_frag},shadow:{uniforms:Mt([re.lights,re.fog,{color:{value:new ye(0)},opacity:{value:1}}]),vertexShader:Ne.shadow_vert,fragmentShader:Ne.shadow_frag}};xi.physical={uniforms:Mt([xi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ee(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new ye(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new ye(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new ye(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Ne.meshphysical_vert,fragmentShader:Ne.meshphysical_frag};function zw(r,e,t,i,n,s){let o=new ye(0),a=n===!0?0:1,l,c,u=null,h=0,d=null;function p(y,x){let g=!1,f=x.isScene===!0?x.background:null;f&&f.isTexture&&(f=e.get(f));let E=r.xr,w=E.getSession&&E.getSession();w&&w.environmentBlendMode==="additive"&&(f=null),f===null?m(o,a):f&&f.isColor&&(m(f,1),g=!0),(r.autoClear||g)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),f&&(f.isCubeTexture||f.mapping===tl)?(c===void 0&&(c=new ht(new Ir(1,1,1),new Hi({name:"BackgroundCubeMaterial",uniforms:Ps(xi.cube.uniforms),vertexShader:xi.cube.vertexShader,fragmentShader:xi.cube.fragmentShader,side:gt,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(_,D,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=f,c.material.uniforms.flipEnvMap.value=f.isCubeTexture&&f.isRenderTargetTexture===!1?-1:1,(u!==f||h!==f.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,u=f,h=f.version,d=r.toneMapping),y.unshift(c,c.geometry,c.material,0,0,null)):f&&f.isTexture&&(l===void 0&&(l=new ht(new zr(2,2),new Hi({name:"BackgroundMaterial",uniforms:Ps(xi.background.uniforms),vertexShader:xi.background.vertexShader,fragmentShader:xi.background.fragmentShader,side:Cr,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=f,f.matrixAutoUpdate===!0&&f.updateMatrix(),l.material.uniforms.uvTransform.value.copy(f.matrix),(u!==f||h!==f.version||d!==r.toneMapping)&&(l.material.needsUpdate=!0,u=f,h=f.version,d=r.toneMapping),y.unshift(l,l.geometry,l.material,0,0,null))}function m(y,x){t.buffers.color.setClear(y.r,y.g,y.b,x,s)}return{getClearColor:function(){return o},setClearColor:function(y,x=1){o.set(y),a=x,m(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(y){a=y,m(o,a)},render:p}}function Ow(r,e,t,i){let n=r.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=y(null),c=l;function u(S,B,L,C,N){let k=!1;if(o){let V=m(C,L,B);c!==V&&(c=V,d(c.object)),k=x(C,N),k&&g(C,N)}else{let V=B.wireframe===!0;(c.geometry!==C.id||c.program!==L.id||c.wireframe!==V)&&(c.geometry=C.id,c.program=L.id,c.wireframe=V,k=!0)}S.isInstancedMesh===!0&&(k=!0),N!==null&&t.update(N,34963),k&&(T(S,B,L,C),N!==null&&r.bindBuffer(34963,t.get(N).buffer))}function h(){return i.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(S){return i.isWebGL2?r.bindVertexArray(S):s.bindVertexArrayOES(S)}function p(S){return i.isWebGL2?r.deleteVertexArray(S):s.deleteVertexArrayOES(S)}function m(S,B,L){let C=L.wireframe===!0,N=a[S.id];N===void 0&&(N={},a[S.id]=N);let k=N[B.id];k===void 0&&(k={},N[B.id]=k);let V=k[C];return V===void 0&&(V=y(h()),k[C]=V),V}function y(S){let B=[],L=[],C=[];for(let N=0;N=0){let j=N[U];if(j===void 0&&(U==="instanceMatrix"&&S.instanceMatrix&&(j=S.instanceMatrix),U==="instanceColor"&&S.instanceColor&&(j=S.instanceColor)),j!==void 0){let ne=j.normalized,ae=j.itemSize,H=t.get(j);if(H===void 0)continue;let Te=H.buffer,ue=H.type,we=H.bytesPerElement;if(j.isInterleavedBufferAttribute){let oe=j.data,Ce=oe.stride,Ae=j.offset;if(oe&&oe.isInstancedInterleavedBuffer){for(let Z=0;Z0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),p=r.getParameter(3379),m=r.getParameter(34076),y=r.getParameter(34921),x=r.getParameter(36347),g=r.getParameter(36348),f=r.getParameter(36349),E=d>0,w=o||e.has("OES_texture_float"),_=E&&w,D=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:n,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:m,maxAttributes:y,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:f,vertexTextures:E,floatFragmentTextures:w,floatVertexTextures:_,maxSamples:D}}function Hw(r){let e=this,t=null,i=0,n=!1,s=!1,o=new si,a=new xt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,p){let m=h.length!==0||d||i!==0||n;return n=d,t=u(h,p,0),i=h.length,m},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,p){let m=h.clippingPlanes,y=h.clipIntersection,x=h.clipShadows,g=r.get(h);if(!n||m===null||m.length===0||s&&!x)s?u(null):c();else{let f=s?0:i,E=f*4,w=g.clippingState||null;l.value=w,w=u(m,d,E,p);for(let _=0;_!==E;++_)w[_]=t[_];g.clippingState=w,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=f}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,p,m){let y=h!==null?h.length:0,x=null;if(y!==0){if(x=l.value,m!==!0||x===null){let g=p+y*4,f=d.matrixWorldInverse;a.getNormalMatrix(f),(x===null||x.length0){let c=new La(l.height/2);return c.fromEquirectangularTexture(r,o),e.set(o,c),o.addEventListener("dispose",n),t(c.texture,o.mapping)}else return null}}return o}function n(o){let a=o.target;a.removeEventListener("dispose",n);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}var Or=class extends Nr{constructor(e=-1,t=1,i=1,n=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,s=i-e,o=i+e,a=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};Or.prototype.isOrthographicCamera=!0;var ks=class extends Hi{constructor(e){super(e),this.type="RawShaderMaterial"}};ks.prototype.isRawShaderMaterial=!0;var Rs=4,hn=8,yi=Math.pow(2,hn),qf=[.125,.215,.35,.446,.526,.582],Wf=hn-Rs+1+qf.length,ys=20,Vc=new Or,{_lodPlanes:yr,_sizeLods:Up,_sigmas:ca}=qw(),Hp=new ye,Uc=null,Bn=(1+Math.sqrt(5))/2,xs=1/Bn,Gp=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,Bn,xs),new P(0,Bn,-xs),new P(xs,0,Bn),new P(-xs,0,Bn),new P(Bn,xs,0),new P(-Bn,xs,0)],Ba=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=Ww(ys),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){Uc=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,i,n,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=$p(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=Wp(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e2?yi:0,yi,yi),u.setRenderTarget(n),y&&u.render(m,a),u.render(e,a)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=x}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===so||e.mapping===ro;n?(this._cubemapShader===null&&(this._cubemapShader=$p()),this._cubemapShader.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectShader===null&&(this._equirectShader=Wp());let s=n?this._cubemapShader:this._equirectShader,o=new ht(yr[0],s),a=s.uniforms;a.envMap.value=e,n||a.texelSize.value.set(1/e.image.width,1/e.image.height),ua(t,0,0,3*yi,2*yi),i.setRenderTarget(t),i.render(o,Vc)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;nys&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${ys}`);let g=[],f=0;for(let D=0;Dhn-Rs?n-hn+Rs:0);ua(t,w,_,3*E,2*E),l.setRenderTarget(t),l.render(h,Vc)}};function qw(){let r=[],e=[],t=[],i=hn;for(let n=0;nhn-Rs?o=qf[n-hn+Rs-1]:n===0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,p=3,m=2,y=1,x=new Float32Array(p*d*h),g=new Float32Array(m*d*h),f=new Float32Array(y*d*h);for(let w=0;w2?0:-1,T=[_,D,0,_+2/3,D,0,_+2/3,D+1,0,_,D,0,_+2/3,D+1,0,_,D+1,0];x.set(T,p*d*w),g.set(u,m*d*w);let O=[w,w,w,w,w,w];f.set(O,y*d*w)}let E=new Ke;E.setAttribute("position",new ut(x,p)),E.setAttribute("uv",new ut(g,m)),E.setAttribute("faceIndex",new ut(f,y)),r.push(E),i>Rs&&i--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function qp(r){let e=new zt(3*yi,3*yi,r);return e.texture.mapping=tl,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function ua(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function Ww(r){let e=new Float32Array(r),t=new P(0,1,0);return new ks({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:fh(),fragmentShader:` +}`,Ne={alphamap_fragment:zv,alphamap_pars_fragment:Vv,alphatest_fragment:Uv,alphatest_pars_fragment:Hv,aomap_fragment:Gv,aomap_pars_fragment:qv,begin_vertex:Wv,beginnormal_vertex:$v,bsdfs:jv,bumpmap_pars_fragment:Xv,clipping_planes_fragment:Yv,clipping_planes_pars_fragment:Zv,clipping_planes_pars_vertex:Jv,clipping_planes_vertex:Kv,color_fragment:Qv,color_pars_fragment:e2,color_pars_vertex:t2,color_vertex:i2,common:n2,cube_uv_reflection_fragment:s2,defaultnormal_vertex:r2,displacementmap_pars_vertex:o2,displacementmap_vertex:a2,emissivemap_fragment:l2,emissivemap_pars_fragment:c2,encodings_fragment:u2,encodings_pars_fragment:h2,envmap_fragment:d2,envmap_common_pars_fragment:p2,envmap_pars_fragment:f2,envmap_pars_vertex:m2,envmap_physical_pars_fragment:M2,envmap_vertex:g2,fog_vertex:y2,fog_pars_vertex:x2,fog_fragment:v2,fog_pars_fragment:w2,gradientmap_pars_fragment:b2,lightmap_fragment:_2,lightmap_pars_fragment:E2,lights_lambert_vertex:A2,lights_pars_begin:S2,lights_toon_fragment:D2,lights_toon_pars_fragment:T2,lights_phong_fragment:C2,lights_phong_pars_fragment:R2,lights_physical_fragment:F2,lights_physical_pars_fragment:L2,lights_fragment_begin:B2,lights_fragment_maps:P2,lights_fragment_end:I2,logdepthbuf_fragment:N2,logdepthbuf_pars_fragment:k2,logdepthbuf_pars_vertex:O2,logdepthbuf_vertex:z2,map_fragment:V2,map_pars_fragment:U2,map_particle_fragment:H2,map_particle_pars_fragment:G2,metalnessmap_fragment:q2,metalnessmap_pars_fragment:W2,morphnormal_vertex:$2,morphtarget_pars_vertex:j2,morphtarget_vertex:X2,normal_fragment_begin:Y2,normal_fragment_maps:Z2,normal_pars_fragment:J2,normal_pars_vertex:K2,normal_vertex:Q2,normalmap_pars_fragment:ew,clearcoat_normal_fragment_begin:tw,clearcoat_normal_fragment_maps:iw,clearcoat_pars_fragment:nw,output_fragment:sw,packing:rw,premultiplied_alpha_fragment:ow,project_vertex:aw,dithering_fragment:lw,dithering_pars_fragment:cw,roughnessmap_fragment:uw,roughnessmap_pars_fragment:hw,shadowmap_pars_fragment:dw,shadowmap_pars_vertex:pw,shadowmap_vertex:fw,shadowmask_pars_fragment:mw,skinbase_vertex:gw,skinning_pars_vertex:yw,skinning_vertex:xw,skinnormal_vertex:vw,specularmap_fragment:ww,specularmap_pars_fragment:bw,tonemapping_fragment:_w,tonemapping_pars_fragment:Ew,transmission_fragment:Aw,transmission_pars_fragment:Sw,uv_pars_fragment:Mw,uv_pars_vertex:Dw,uv_vertex:Tw,uv2_pars_fragment:Cw,uv2_pars_vertex:Rw,uv2_vertex:Fw,worldpos_vertex:Lw,background_vert:Bw,background_frag:Pw,cube_vert:Iw,cube_frag:Nw,depth_vert:kw,depth_frag:Ow,distanceRGBA_vert:zw,distanceRGBA_frag:Vw,equirect_vert:Uw,equirect_frag:Hw,linedashed_vert:Gw,linedashed_frag:qw,meshbasic_vert:Ww,meshbasic_frag:$w,meshlambert_vert:jw,meshlambert_frag:Xw,meshmatcap_vert:Yw,meshmatcap_frag:Zw,meshnormal_vert:Jw,meshnormal_frag:Kw,meshphong_vert:Qw,meshphong_frag:eb,meshphysical_vert:tb,meshphysical_frag:ib,meshtoon_vert:nb,meshtoon_frag:sb,points_vert:rb,points_frag:ob,shadow_vert:ab,shadow_frag:lb,sprite_vert:cb,sprite_frag:ub},re={common:{diffuse:{value:new ye(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new wt},uv2Transform:{value:new wt},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ye(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ye(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new ye(16777215)},opacity:{value:1},center:{value:new ee(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new wt}}},Ti={basic:{uniforms:Rt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.fog]),vertexShader:Ne.meshbasic_vert,fragmentShader:Ne.meshbasic_frag},lambert:{uniforms:Rt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.fog,re.lights,{emissive:{value:new ye(0)}}]),vertexShader:Ne.meshlambert_vert,fragmentShader:Ne.meshlambert_frag},phong:{uniforms:Rt([re.common,re.specularmap,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.fog,re.lights,{emissive:{value:new ye(0)},specular:{value:new ye(1118481)},shininess:{value:30}}]),vertexShader:Ne.meshphong_vert,fragmentShader:Ne.meshphong_frag},standard:{uniforms:Rt([re.common,re.envmap,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.roughnessmap,re.metalnessmap,re.fog,re.lights,{emissive:{value:new ye(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ne.meshphysical_vert,fragmentShader:Ne.meshphysical_frag},toon:{uniforms:Rt([re.common,re.aomap,re.lightmap,re.emissivemap,re.bumpmap,re.normalmap,re.displacementmap,re.gradientmap,re.fog,re.lights,{emissive:{value:new ye(0)}}]),vertexShader:Ne.meshtoon_vert,fragmentShader:Ne.meshtoon_frag},matcap:{uniforms:Rt([re.common,re.bumpmap,re.normalmap,re.displacementmap,re.fog,{matcap:{value:null}}]),vertexShader:Ne.meshmatcap_vert,fragmentShader:Ne.meshmatcap_frag},points:{uniforms:Rt([re.points,re.fog]),vertexShader:Ne.points_vert,fragmentShader:Ne.points_frag},dashed:{uniforms:Rt([re.common,re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ne.linedashed_vert,fragmentShader:Ne.linedashed_frag},depth:{uniforms:Rt([re.common,re.displacementmap]),vertexShader:Ne.depth_vert,fragmentShader:Ne.depth_frag},normal:{uniforms:Rt([re.common,re.bumpmap,re.normalmap,re.displacementmap,{opacity:{value:1}}]),vertexShader:Ne.meshnormal_vert,fragmentShader:Ne.meshnormal_frag},sprite:{uniforms:Rt([re.sprite,re.fog]),vertexShader:Ne.sprite_vert,fragmentShader:Ne.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null}},vertexShader:Ne.background_vert,fragmentShader:Ne.background_frag},cube:{uniforms:Rt([re.envmap,{opacity:{value:1}}]),vertexShader:Ne.cube_vert,fragmentShader:Ne.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ne.equirect_vert,fragmentShader:Ne.equirect_frag},distanceRGBA:{uniforms:Rt([re.common,re.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ne.distanceRGBA_vert,fragmentShader:Ne.distanceRGBA_frag},shadow:{uniforms:Rt([re.lights,re.fog,{color:{value:new ye(0)},opacity:{value:1}}]),vertexShader:Ne.shadow_vert,fragmentShader:Ne.shadow_frag}};Ti.physical={uniforms:Rt([Ti.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ee(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new ye(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new ye(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new ye(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Ne.meshphysical_vert,fragmentShader:Ne.meshphysical_frag};function hb(r,e,t,i,n,s){let o=new ye(0),a=n===!0?0:1,l,c,u=null,h=0,d=null;function p(y,x){let g=!1,f=x.isScene===!0?x.background:null;f&&f.isTexture&&(f=e.get(f));let E=r.xr,w=E.getSession&&E.getSession();w&&w.environmentBlendMode==="additive"&&(f=null),f===null?m(o,a):f&&f.isColor&&(m(f,1),g=!0),(r.autoClear||g)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),f&&(f.isCubeTexture||f.mapping===nl)?(c===void 0&&(c=new pt(new Vr(1,1,1),new Zi({name:"BackgroundCubeMaterial",uniforms:Ns(Ti.cube.uniforms),vertexShader:Ti.cube.vertexShader,fragmentShader:Ti.cube.fragmentShader,side:xt,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(_,M,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=f,c.material.uniforms.flipEnvMap.value=f.isCubeTexture&&f.isRenderTargetTexture===!1?-1:1,(u!==f||h!==f.version||d!==r.toneMapping)&&(c.material.needsUpdate=!0,u=f,h=f.version,d=r.toneMapping),y.unshift(c,c.geometry,c.material,0,0,null)):f&&f.isTexture&&(l===void 0&&(l=new pt(new Gr(2,2),new Zi({name:"BackgroundMaterial",uniforms:Ns(Ti.background.uniforms),vertexShader:Ti.background.vertexShader,fragmentShader:Ti.background.fragmentShader,side:Pr,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=f,f.matrixAutoUpdate===!0&&f.updateMatrix(),l.material.uniforms.uvTransform.value.copy(f.matrix),(u!==f||h!==f.version||d!==r.toneMapping)&&(l.material.needsUpdate=!0,u=f,h=f.version,d=r.toneMapping),y.unshift(l,l.geometry,l.material,0,0,null))}function m(y,x){t.buffers.color.setClear(y.r,y.g,y.b,x,s)}return{getClearColor:function(){return o},setClearColor:function(y,x=1){o.set(y),a=x,m(o,a)},getClearAlpha:function(){return a},setClearAlpha:function(y){a=y,m(o,a)},render:p}}function db(r,e,t,i){let n=r.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=y(null),c=l;function u(S,B,L,C,N){let k=!1;if(o){let V=m(C,L,B);c!==V&&(c=V,d(c.object)),k=x(C,N),k&&g(C,N)}else{let V=B.wireframe===!0;(c.geometry!==C.id||c.program!==L.id||c.wireframe!==V)&&(c.geometry=C.id,c.program=L.id,c.wireframe=V,k=!0)}S.isInstancedMesh===!0&&(k=!0),N!==null&&t.update(N,34963),k&&(T(S,B,L,C),N!==null&&r.bindBuffer(34963,t.get(N).buffer))}function h(){return i.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function d(S){return i.isWebGL2?r.bindVertexArray(S):s.bindVertexArrayOES(S)}function p(S){return i.isWebGL2?r.deleteVertexArray(S):s.deleteVertexArrayOES(S)}function m(S,B,L){let C=L.wireframe===!0,N=a[S.id];N===void 0&&(N={},a[S.id]=N);let k=N[B.id];k===void 0&&(k={},N[B.id]=k);let V=k[C];return V===void 0&&(V=y(h()),k[C]=V),V}function y(S){let B=[],L=[],C=[];for(let N=0;N=0){let j=N[U];if(j===void 0&&(U==="instanceMatrix"&&S.instanceMatrix&&(j=S.instanceMatrix),U==="instanceColor"&&S.instanceColor&&(j=S.instanceColor)),j!==void 0){let ne=j.normalized,ae=j.itemSize,H=t.get(j);if(H===void 0)continue;let Te=H.buffer,ue=H.type,we=H.bytesPerElement;if(j.isInterleavedBufferAttribute){let oe=j.data,Ce=oe.stride,Ae=j.offset;if(oe&&oe.isInstancedInterleavedBuffer){for(let Z=0;Z0&&r.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(35633,36337).precision>0&&r.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&r instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&r instanceof WebGL2ComputeRenderingContext,a=t.precision!==void 0?t.precision:"highp",l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);let c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(34930),d=r.getParameter(35660),p=r.getParameter(3379),m=r.getParameter(34076),y=r.getParameter(34921),x=r.getParameter(36347),g=r.getParameter(36348),f=r.getParameter(36349),E=d>0,w=o||e.has("OES_texture_float"),_=E&&w,M=o?r.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:n,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:m,maxAttributes:y,maxVertexUniforms:x,maxVaryings:g,maxFragmentUniforms:f,vertexTextures:E,floatFragmentTextures:w,floatVertexTextures:_,maxSamples:M}}function mb(r){let e=this,t=null,i=0,n=!1,s=!1,o=new di,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d,p){let m=h.length!==0||d||i!==0||n;return n=d,t=u(h,p,0),i=h.length,m},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,c()},this.setState=function(h,d,p){let m=h.clippingPlanes,y=h.clipIntersection,x=h.clipShadows,g=r.get(h);if(!n||m===null||m.length===0||s&&!x)s?u(null):c();else{let f=s?0:i,E=f*4,w=g.clippingState||null;l.value=w,w=u(m,d,E,p);for(let _=0;_!==E;++_)w[_]=t[_];g.clippingState=w,this.numIntersection=y?this.numPlanes:0,this.numPlanes+=f}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(h,d,p,m){let y=h!==null?h.length:0,x=null;if(y!==0){if(x=l.value,m!==!0||x===null){let g=p+y*4,f=d.matrixWorldInverse;a.getNormalMatrix(f),(x===null||x.length0){let c=new Pa(l.height/2);return c.fromEquirectangularTexture(r,o),e.set(o,c),o.addEventListener("dispose",n),t(c.texture,o.mapping)}else return null}}return o}function n(o){let a=o.target;a.removeEventListener("dispose",n);let l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}var qr=class extends Ur{constructor(e=-1,t=1,i=1,n=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,s=i-e,o=i+e,a=n+t,l=n-t;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}};qr.prototype.isOrthographicCamera=!0;var zs=class extends Zi{constructor(e){super(e),this.type="RawShaderMaterial"}};zs.prototype.isRawShaderMaterial=!0;var Ls=4,xn=8,Di=Math.pow(2,xn),fm=[.125,.215,.35,.446,.526,.582],mm=xn-Ls+1+fm.length,vs=20,lu=new qr,{_lodPlanes:_r,_sizeLods:df,_sigmas:ha}=yb(),pf=new ye,cu=null,zn=(1+Math.sqrt(5))/2,ws=1/zn,ff=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,zn,ws),new P(0,zn,-ws),new P(ws,0,zn),new P(-ws,0,zn),new P(zn,ws,0),new P(-zn,ws,0)],Ia=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=xb(vs),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,n=100){cu=this._renderer.getRenderTarget();let s=this._allocateTargets();return this._sceneToCubeUV(e,i,n,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=yf(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=gf(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<_r.length;e++)_r[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(cu),e.scissorTest=!1,da(e,0,0,e.width,e.height)}_fromTexture(e,t){cu=this._renderer.getRenderTarget();let i=t||this._allocateTargets(e);return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(e){let t={magFilter:Ft,minFilter:Ft,generateMipmaps:!1,type:Cs,format:Nt,encoding:bn,depthBuffer:!1},i=mf(t);return i.depthBuffer=!e,this._pingPongRenderTarget===null&&(this._pingPongRenderTarget=mf(t)),i}_compileMaterial(e){let t=new pt(_r[0],e);this._renderer.compile(t,lu)}_sceneToCubeUV(e,t,i,n){let a=new Et(90,1,t,i),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,h=u.autoClear,d=u.toneMapping;u.getClearColor(pf),u.toneMapping=gn,u.autoClear=!1;let p=new zr({name:"PMREM.Background",side:xt,depthWrite:!1,depthTest:!1}),m=new pt(new Vr,p),y=!1,x=e.background;x?x.isColor&&(p.color.copy(x),e.background=null,y=!0):(p.color.copy(pf),y=!0);for(let g=0;g<6;g++){let f=g%3;f===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):f===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g])),da(n,f*Di,g>2?Di:0,Di,Di),u.setRenderTarget(n),y&&u.render(m,a),u.render(e,a)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=d,u.autoClear=h,e.background=x}_textureToCubeUV(e,t){let i=this._renderer,n=e.mapping===co||e.mapping===uo;n?(this._cubemapShader===null&&(this._cubemapShader=yf()),this._cubemapShader.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectShader===null&&(this._equirectShader=gf());let s=n?this._cubemapShader:this._equirectShader,o=new pt(_r[0],s),a=s.uniforms;a.envMap.value=e,n||a.texelSize.value.set(1/e.image.width,1/e.image.height),da(t,0,0,3*Di,2*Di),i.setRenderTarget(t),i.render(o,lu)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;nvs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${vs}`);let g=[],f=0;for(let M=0;Mxn-Ls?n-xn+Ls:0);da(t,w,_,3*E,2*E),l.setRenderTarget(t),l.render(h,lu)}};function yb(){let r=[],e=[],t=[],i=xn;for(let n=0;nxn-Ls?o=fm[n-xn+Ls-1]:n===0&&(o=0),t.push(o);let a=1/(s-1),l=-a/2,c=1+a/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,p=3,m=2,y=1,x=new Float32Array(p*d*h),g=new Float32Array(m*d*h),f=new Float32Array(y*d*h);for(let w=0;w2?0:-1,T=[_,M,0,_+2/3,M,0,_+2/3,M+1,0,_,M,0,_+2/3,M+1,0,_,M+1,0];x.set(T,p*d*w),g.set(u,m*d*w);let z=[w,w,w,w,w,w];f.set(z,y*d*w)}let E=new Ke;E.setAttribute("position",new ht(x,p)),E.setAttribute("uv",new ht(g,m)),E.setAttribute("faceIndex",new ht(f,y)),r.push(E),i>Ls&&i--}return{_lodPlanes:r,_sizeLods:e,_sigmas:t}}function mf(r){let e=new Ht(3*Di,3*Di,r);return e.texture.mapping=nl,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function da(r,e,t,i,n){r.viewport.set(e,t,i,n),r.scissor.set(e,t,i,n)}function xb(r){let e=new Float32Array(r),t=new P(0,1,0);return new zs({name:"SphericalGaussianBlur",defines:{n:r},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t}},vertexShader:Nh(),fragmentShader:` precision mediump float; precision mediump int; @@ -2858,7 +2855,7 @@ void main() { } } - `,blending:ln,depthTest:!1,depthWrite:!1})}function Wp(){let r=new ee(1,1);return new ks({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r}},vertexShader:fh(),fragmentShader:` + `,blending:mn,depthTest:!1,depthWrite:!1})}function gf(){let r=new ee(1,1);return new zs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:r}},vertexShader:Nh(),fragmentShader:` precision mediump float; precision mediump int; @@ -2892,7 +2889,7 @@ void main() { gl_FragColor.rgb = mix( tm, bm, f.y ); } - `,blending:ln,depthTest:!1,depthWrite:!1})}function $p(){return new ks({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:fh(),fragmentShader:` + `,blending:mn,depthTest:!1,depthWrite:!1})}function yf(){return new zs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Nh(),fragmentShader:` precision mediump float; precision mediump int; @@ -2908,7 +2905,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:ln,depthTest:!1,depthWrite:!1})}function fh(){return` + `,blending:mn,depthTest:!1,depthWrite:!1})}function Nh(){return` precision mediump float; precision mediump int; @@ -2965,39 +2962,39 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function $w(r){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){let l=a.mapping,c=l===Jc||l===Kc,u=l===so||l===ro;if(c||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new Ba(r)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{let h=a.image;if(c&&h&&h.height>0||u&&h&&n(h)){t===null&&(t=new Ba(r));let d=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",s),d.texture}else return null}}}return a}function n(a){let l=0,c=6;for(let u=0;ue.maxTextureSize&&(O=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let W=new Float32Array(T*O*4*m),A=new Vr(W,T,O,m);A.format=Lt,A.type=Pn,A.needsUpdate=!0;let v=D*4;for(let S=0;S0)return r;let n=e*t,s=Xp[n];if(s===void 0&&(s=new Float32Array(n),Xp[n]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Bt(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t0||u&&h&&n(h)){t===null&&(t=new Ia(r));let d=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",s),d.texture}else return null}}}return a}function n(a){let l=0,c=6;for(let u=0;ue.maxTextureSize&&(z=Math.ceil(T/e.maxTextureSize),T=e.maxTextureSize);let W=new Float32Array(T*z*4*m),A=new Wr(W,T,z,m);A.format=Nt,A.type=Vn,A.needsUpdate=!0;let v=M*4;for(let S=0;S0)return r;let n=e*t,s=vf[n];if(s===void 0&&(s=new Float32Array(n),vf[n]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function kt(r,e){if(r.length!==e.length)return!1;for(let t=0,i=r.length;t/gm;function ru(r){return r.replace(Jb,Kb)}function Kb(r,e){let t=Ne[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return ru(t)}var Qb=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,e1=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function rf(r){return r.replace(e1,Kf).replace(Qb,t1)}function t1(r,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Kf(r,e,t,i)}function Kf(r,e,t,i){let n="";for(let s=parseInt(e);s/gm;function Du(r){return r.replace(A1,S1)}function S1(r,e){let t=Ne[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return Du(t)}var M1=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,D1=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Cf(r){return r.replace(D1,_m).replace(M1,T1)}function T1(r,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),_m(r,e,t,i)}function _m(r,e,t,i){let n="";for(let s=parseInt(e);s0&&(y+=` -`),x=[d,p].filter(Ar).join(` +`),x=[d,p].filter(Cr).join(` `),x.length>0&&(x+=` -`)):(y=[of(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(Ar).join(` -`),x=[d,of(t),"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==cn?"#define TONE_MAPPING":"",t.toneMapping!==cn?Ne.tonemapping_pars_fragment:"",t.toneMapping!==cn?jb("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.transparent?"":"#define OPAQUE",Ne.encodings_pars_fragment,$b("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(Ar).join(` -`)),o=ru(o),o=nf(o,t),o=sf(o,t),a=ru(a),a=nf(a,t),a=sf(a,t),o=rf(o),a=rf(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(g=`#version 300 es +`)):(y=[Rf(t),"#define SHADER_NAME "+t.shaderName,p,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+t.maxBones,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.displacementMap&&t.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.useVertexTexture?"#define BONE_TEXTURE":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargets&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Cr).join(` +`),x=[d,Rf(t),"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMap&&t.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",t.normalMap&&t.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",t.specularColorMap?"#define USE_SPECULARCOLORMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEENCOLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.vertexTangents?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUvs?"#define USE_UV":"",t.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==gn?"#define TONE_MAPPING":"",t.toneMapping!==gn?Ne.tonemapping_pars_fragment:"",t.toneMapping!==gn?w1("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.transparent?"":"#define OPAQUE",Ne.encodings_pars_fragment,v1("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(Cr).join(` +`)),o=Du(o),o=Df(o,t),o=Tf(o,t),a=Du(a),a=Df(a,t),a=Tf(a,t),o=Cf(o),a=Cf(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(g=`#version 300 es `,y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+y,x=["#define varying in",t.glslVersion===Tp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Tp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+y,x=["#define varying in",t.glslVersion===Kp?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===Kp?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+x);let f=g+y+o,E=g+x+a,w=ef(n,35633,f),_=ef(n,35632,E);if(n.attachShader(m,w),n.attachShader(m,_),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m),r.debug.checkShaderErrors){let O=n.getProgramInfoLog(m).trim(),W=n.getShaderInfoLog(w).trim(),A=n.getShaderInfoLog(_).trim(),v=!0,R=!0;if(n.getProgramParameter(m,35714)===!1){v=!1;let S=tf(n,w,"vertex"),B=tf(n,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,35715)+` +`+x);let f=g+y+o,E=g+x+a,w=Sf(n,35633,f),_=Sf(n,35632,E);if(n.attachShader(m,w),n.attachShader(m,_),t.index0AttributeName!==void 0?n.bindAttribLocation(m,0,t.index0AttributeName):t.morphTargets===!0&&n.bindAttribLocation(m,0,"position"),n.linkProgram(m),r.debug.checkShaderErrors){let z=n.getProgramInfoLog(m).trim(),W=n.getShaderInfoLog(w).trim(),A=n.getShaderInfoLog(_).trim(),v=!0,R=!0;if(n.getProgramParameter(m,35714)===!1){v=!1;let S=Mf(n,w,"vertex"),B=Mf(n,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(m,35715)+` -Program Info Log: `+O+` +Program Info Log: `+z+` `+S+` -`+B)}else O!==""?console.warn("THREE.WebGLProgram: Program Info Log:",O):(W===""||A==="")&&(R=!1);R&&(this.diagnostics={runnable:v,programLog:O,vertexShader:{log:W,prefix:y},fragmentShader:{log:A,prefix:x}})}n.deleteShader(w),n.deleteShader(_);let D;this.getUniforms=function(){return D===void 0&&(D=new dn(n,m)),D};let T;return this.getAttributes=function(){return T===void 0&&(T=Zb(n,m)),T},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=Gb++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}var a1=0,ou=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache;return t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){let t=this.shaderCache;if(t.has(e)===!1){let i=new au;t.set(e,i)}return t.get(e)}},au=class{constructor(){this.id=a1++,this.usedTimes=0}};function l1(r,e,t,i,n,s,o){let a=new Ca,l=new ou,c=[],u=n.isWebGL2,h=n.logarithmicDepthBuffer,d=n.floatVertexTextures,p=n.maxVertexUniforms,m=n.vertexTextures,y=n.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){let S=v.skeleton.bones;if(d)return 1024;{let L=Math.floor((p-20)/4),C=Math.min(L,S.length);return C0,ue=v.clearcoat>0;return{isWebGL2:u,shaderID:V,shaderName:v.type,vertexShader:q,fragmentShader:j,defines:v.defines,customVertexShaderID:ne,customFragmentShaderID:ae,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:y,instancing:L.isInstancedMesh===!0,instancingColor:L.isInstancedMesh===!0&&L.instanceColor!==null,supportsVertexTextures:m,outputEncoding:H===null?r.outputEncoding:H.isXRRenderTarget===!0?H.texture.encoding:fn,map:!!v.map,matcap:!!v.matcap,envMap:!!k,envMapMode:k&&k.mapping,envMapCubeUV:!!k&&(k.mapping===tl||k.mapping===dh),lightMap:!!v.lightMap,aoMap:!!v.aoMap,emissiveMap:!!v.emissiveMap,bumpMap:!!v.bumpMap,normalMap:!!v.normalMap,objectSpaceNormalMap:v.normalMapType===Wx,tangentSpaceNormalMap:v.normalMapType===$s,decodeVideoTexture:!!v.map&&v.map.isVideoTexture===!0&&v.map.encoding===et,clearcoat:ue,clearcoatMap:ue&&!!v.clearcoatMap,clearcoatRoughnessMap:ue&&!!v.clearcoatRoughnessMap,clearcoatNormalMap:ue&&!!v.clearcoatNormalMap,displacementMap:!!v.displacementMap,roughnessMap:!!v.roughnessMap,metalnessMap:!!v.metalnessMap,specularMap:!!v.specularMap,specularIntensityMap:!!v.specularIntensityMap,specularColorMap:!!v.specularColorMap,transparent:v.transparent,alphaMap:!!v.alphaMap,alphaTest:Te,gradientMap:!!v.gradientMap,sheen:v.sheen>0,sheenColorMap:!!v.sheenColorMap,sheenRoughnessMap:!!v.sheenRoughnessMap,transmission:v.transmission>0,transmissionMap:!!v.transmissionMap,thicknessMap:!!v.thicknessMap,combine:v.combine,vertexTangents:!!v.normalMap&&!!L.geometry&&!!L.geometry.attributes.tangent,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!L.geometry&&!!L.geometry.attributes.color&&L.geometry.attributes.color.itemSize===4,vertexUvs:!!v.map||!!v.bumpMap||!!v.normalMap||!!v.specularMap||!!v.alphaMap||!!v.emissiveMap||!!v.roughnessMap||!!v.metalnessMap||!!v.clearcoatMap||!!v.clearcoatRoughnessMap||!!v.clearcoatNormalMap||!!v.displacementMap||!!v.transmissionMap||!!v.thicknessMap||!!v.specularIntensityMap||!!v.specularColorMap||!!v.sheenColorMap||!!v.sheenRoughnessMap,uvsVertexOnly:!(v.map||v.bumpMap||v.normalMap||v.specularMap||v.alphaMap||v.emissiveMap||v.roughnessMap||v.metalnessMap||v.clearcoatNormalMap||v.transmission>0||v.transmissionMap||v.thicknessMap||v.specularIntensityMap||v.specularColorMap||v.sheen>0||v.sheenColorMap||v.sheenRoughnessMap)&&!!v.displacementMap,fog:!!C,useFog:v.fog,fogExp2:C&&C.isFogExp2,flatShading:!!v.flatShading,sizeAttenuation:v.sizeAttenuation,logarithmicDepthBuffer:h,skinning:L.isSkinnedMesh===!0&&U>0,maxBones:U,useVertexTexture:d,morphTargets:!!L.geometry&&!!L.geometry.morphAttributes.position,morphNormals:!!L.geometry&&!!L.geometry.morphAttributes.normal,morphTargetsCount:L.geometry&&L.geometry.morphAttributes.position?L.geometry.morphAttributes.position.length:0,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&S.length>0,shadowMapType:r.shadowMap.type,toneMapping:v.toneMapped?r.toneMapping:cn,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Fs,flipSided:v.side===gt,depthPacking:v.depthPacking!==void 0?v.depthPacking:!1,index0AttributeName:v.index0AttributeName,extensionDerivatives:v.extensions&&v.extensions.derivatives,extensionFragDepth:v.extensions&&v.extensions.fragDepth,extensionDrawBuffers:v.extensions&&v.extensions.drawBuffers,extensionShaderTextureLOD:v.extensions&&v.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:v.customProgramCacheKey()}}function E(v){let R=[];if(v.shaderID?R.push(v.shaderID):(R.push(v.customVertexShaderID),R.push(v.customFragmentShaderID)),v.defines!==void 0)for(let S in v.defines)R.push(S),R.push(v.defines[S]);return v.isRawShaderMaterial===!1&&(w(R,v),_(R,v),R.push(r.outputEncoding)),R.push(v.customProgramCacheKey),R.join()}function w(v,R){v.push(R.precision),v.push(R.outputEncoding),v.push(R.envMapMode),v.push(R.combine),v.push(R.vertexUvs),v.push(R.fogExp2),v.push(R.sizeAttenuation),v.push(R.maxBones),v.push(R.morphTargetsCount),v.push(R.numDirLights),v.push(R.numPointLights),v.push(R.numSpotLights),v.push(R.numHemiLights),v.push(R.numRectAreaLights),v.push(R.numDirLightShadows),v.push(R.numPointLightShadows),v.push(R.numSpotLightShadows),v.push(R.shadowMapType),v.push(R.toneMapping),v.push(R.numClippingPlanes),v.push(R.numClipIntersection)}function _(v,R){a.disableAll(),R.isWebGL2&&a.enable(0),R.supportsVertexTextures&&a.enable(1),R.instancing&&a.enable(2),R.instancingColor&&a.enable(3),R.map&&a.enable(4),R.matcap&&a.enable(5),R.envMap&&a.enable(6),R.envMapCubeUV&&a.enable(7),R.lightMap&&a.enable(8),R.aoMap&&a.enable(9),R.emissiveMap&&a.enable(10),R.bumpMap&&a.enable(11),R.normalMap&&a.enable(12),R.objectSpaceNormalMap&&a.enable(13),R.tangentSpaceNormalMap&&a.enable(14),R.clearcoat&&a.enable(15),R.clearcoatMap&&a.enable(16),R.clearcoatRoughnessMap&&a.enable(17),R.clearcoatNormalMap&&a.enable(18),R.displacementMap&&a.enable(19),R.specularMap&&a.enable(20),R.roughnessMap&&a.enable(21),R.metalnessMap&&a.enable(22),R.gradientMap&&a.enable(23),R.alphaMap&&a.enable(24),R.alphaTest&&a.enable(25),R.vertexColors&&a.enable(26),R.vertexAlphas&&a.enable(27),R.vertexUvs&&a.enable(28),R.vertexTangents&&a.enable(29),R.uvsVertexOnly&&a.enable(30),R.fog&&a.enable(31),v.push(a.mask),a.disableAll(),R.useFog&&a.enable(0),R.flatShading&&a.enable(1),R.logarithmicDepthBuffer&&a.enable(2),R.skinning&&a.enable(3),R.useVertexTexture&&a.enable(4),R.morphTargets&&a.enable(5),R.morphNormals&&a.enable(6),R.premultipliedAlpha&&a.enable(7),R.shadowMapEnabled&&a.enable(8),R.physicallyCorrectLights&&a.enable(9),R.doubleSided&&a.enable(10),R.flipSided&&a.enable(11),R.depthPacking&&a.enable(12),R.dithering&&a.enable(13),R.specularIntensityMap&&a.enable(14),R.specularColorMap&&a.enable(15),R.transmission&&a.enable(16),R.transmissionMap&&a.enable(17),R.thicknessMap&&a.enable(18),R.sheen&&a.enable(19),R.sheenColorMap&&a.enable(20),R.sheenRoughnessMap&&a.enable(21),R.decodeVideoTexture&&a.enable(22),R.transparent&&a.enable(23),v.push(a.mask)}function D(v){let R=x[v.type],S;if(R){let B=xi[R];S=ov.clone(B.uniforms)}else S=v.uniforms;return S}function T(v,R){let S;for(let B=0,L=c.length;B0?i.push(g):p.transparent===!0?n.push(g):t.push(g)}function l(h,d,p,m,y,x){let g=o(h,d,p,m,y,x);p.transmission>0?i.unshift(g):p.transparent===!0?n.unshift(g):t.unshift(g)}function c(h,d){t.length>1&&t.sort(h||u1),i.length>1&&i.sort(d||af),n.length>1&&n.sort(d||af)}function u(){for(let h=e,d=r.length;h=r.get(i).length?(s=new lf,r.get(i).push(s)):s=r.get(i)[n],s}function t(){r=new WeakMap}return{get:e,dispose:t}}function d1(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new P,color:new ye};break;case"SpotLight":t={position:new P,direction:new P,color:new ye,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new P,color:new ye,distance:0,decay:0};break;case"HemisphereLight":t={direction:new P,skyColor:new ye,groundColor:new ye};break;case"RectAreaLight":t={color:new ye,position:new P,halfWidth:new P,halfHeight:new P};break}return r[e.id]=t,t}}}function p1(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var f1=0;function m1(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function g1(r,e){let t=new d1,i=p1(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)n.probe.push(new P);let s=new P,o=new Ee,a=new Ee;function l(u,h){let d=0,p=0,m=0;for(let W=0;W<9;W++)n.probe[W].set(0,0,0);let y=0,x=0,g=0,f=0,E=0,w=0,_=0,D=0;u.sort(m1);let T=h!==!0?Math.PI:1;for(let W=0,A=u.length;W0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=re.LTC_FLOAT_1,n.rectAreaLTC2=re.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=re.LTC_HALF_1,n.rectAreaLTC2=re.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=d,n.ambient[1]=p,n.ambient[2]=m;let O=n.hash;(O.directionalLength!==y||O.pointLength!==x||O.spotLength!==g||O.rectAreaLength!==f||O.hemiLength!==E||O.numDirectionalShadows!==w||O.numPointShadows!==_||O.numSpotShadows!==D)&&(n.directional.length=y,n.spot.length=g,n.rectArea.length=f,n.point.length=x,n.hemi.length=E,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=_,n.pointShadowMap.length=_,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=_,n.spotShadowMatrix.length=D,O.directionalLength=y,O.pointLength=x,O.spotLength=g,O.rectAreaLength=f,O.hemiLength=E,O.numDirectionalShadows=w,O.numPointShadows=_,O.numSpotShadows=D,n.version=f1++)}function c(u,h){let d=0,p=0,m=0,y=0,x=0,g=h.matrixWorldInverse;for(let f=0,E=u.length;f=t.get(s).length?(a=new cf(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function n(){t=new WeakMap}return{get:i,dispose:n}}var Ia=class extends dt{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=Gx,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};Ia.prototype.isMeshDepthMaterial=!0;var Na=class extends dt{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new P,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Na.prototype.isMeshDistanceMaterial=!0;var x1=`void main() { +`+B)}else z!==""?console.warn("THREE.WebGLProgram: Program Info Log:",z):(W===""||A==="")&&(R=!1);R&&(this.diagnostics={runnable:v,programLog:z,vertexShader:{log:W,prefix:y},fragmentShader:{log:A,prefix:x}})}n.deleteShader(w),n.deleteShader(_);let M;this.getUniforms=function(){return M===void 0&&(M=new vn(n,m)),M};let T;return this.getAttributes=function(){return T===void 0&&(T=E1(n,m)),T},this.destroy=function(){i.releaseStatesOfProgram(this),n.deleteProgram(m),this.program=void 0},this.name=t.shaderName,this.id=g1++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=_,this}var P1=0,Tu=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(n)===!1&&(o.add(n),n.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache;return t.has(e)===!1&&t.set(e,new Set),t.get(e)}_getShaderStage(e){let t=this.shaderCache;if(t.has(e)===!1){let i=new Cu;t.set(e,i)}return t.get(e)}},Cu=class{constructor(){this.id=P1++,this.usedTimes=0}};function I1(r,e,t,i,n,s,o){let a=new Fa,l=new Tu,c=[],u=n.isWebGL2,h=n.logarithmicDepthBuffer,d=n.floatVertexTextures,p=n.maxVertexUniforms,m=n.vertexTextures,y=n.precision,x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(v){let S=v.skeleton.bones;if(d)return 1024;{let L=Math.floor((p-20)/4),C=Math.min(L,S.length);return C0,ue=v.clearcoat>0;return{isWebGL2:u,shaderID:V,shaderName:v.type,vertexShader:q,fragmentShader:j,defines:v.defines,customVertexShaderID:ne,customFragmentShaderID:ae,isRawShaderMaterial:v.isRawShaderMaterial===!0,glslVersion:v.glslVersion,precision:y,instancing:L.isInstancedMesh===!0,instancingColor:L.isInstancedMesh===!0&&L.instanceColor!==null,supportsVertexTextures:m,outputEncoding:H===null?r.outputEncoding:H.isXRRenderTarget===!0?H.texture.encoding:bn,map:!!v.map,matcap:!!v.matcap,envMap:!!k,envMapMode:k&&k.mapping,envMapCubeUV:!!k&&(k.mapping===nl||k.mapping===Ph),lightMap:!!v.lightMap,aoMap:!!v.aoMap,emissiveMap:!!v.emissiveMap,bumpMap:!!v.bumpMap,normalMap:!!v.normalMap,objectSpaceNormalMap:v.normalMapType===xv,tangentSpaceNormalMap:v.normalMapType===Xs,decodeVideoTexture:!!v.map&&v.map.isVideoTexture===!0&&v.map.encoding===tt,clearcoat:ue,clearcoatMap:ue&&!!v.clearcoatMap,clearcoatRoughnessMap:ue&&!!v.clearcoatRoughnessMap,clearcoatNormalMap:ue&&!!v.clearcoatNormalMap,displacementMap:!!v.displacementMap,roughnessMap:!!v.roughnessMap,metalnessMap:!!v.metalnessMap,specularMap:!!v.specularMap,specularIntensityMap:!!v.specularIntensityMap,specularColorMap:!!v.specularColorMap,transparent:v.transparent,alphaMap:!!v.alphaMap,alphaTest:Te,gradientMap:!!v.gradientMap,sheen:v.sheen>0,sheenColorMap:!!v.sheenColorMap,sheenRoughnessMap:!!v.sheenRoughnessMap,transmission:v.transmission>0,transmissionMap:!!v.transmissionMap,thicknessMap:!!v.thicknessMap,combine:v.combine,vertexTangents:!!v.normalMap&&!!L.geometry&&!!L.geometry.attributes.tangent,vertexColors:v.vertexColors,vertexAlphas:v.vertexColors===!0&&!!L.geometry&&!!L.geometry.attributes.color&&L.geometry.attributes.color.itemSize===4,vertexUvs:!!v.map||!!v.bumpMap||!!v.normalMap||!!v.specularMap||!!v.alphaMap||!!v.emissiveMap||!!v.roughnessMap||!!v.metalnessMap||!!v.clearcoatMap||!!v.clearcoatRoughnessMap||!!v.clearcoatNormalMap||!!v.displacementMap||!!v.transmissionMap||!!v.thicknessMap||!!v.specularIntensityMap||!!v.specularColorMap||!!v.sheenColorMap||!!v.sheenRoughnessMap,uvsVertexOnly:!(v.map||v.bumpMap||v.normalMap||v.specularMap||v.alphaMap||v.emissiveMap||v.roughnessMap||v.metalnessMap||v.clearcoatNormalMap||v.transmission>0||v.transmissionMap||v.thicknessMap||v.specularIntensityMap||v.specularColorMap||v.sheen>0||v.sheenColorMap||v.sheenRoughnessMap)&&!!v.displacementMap,fog:!!C,useFog:v.fog,fogExp2:C&&C.isFogExp2,flatShading:!!v.flatShading,sizeAttenuation:v.sizeAttenuation,logarithmicDepthBuffer:h,skinning:L.isSkinnedMesh===!0&&U>0,maxBones:U,useVertexTexture:d,morphTargets:!!L.geometry&&!!L.geometry.morphAttributes.position,morphNormals:!!L.geometry&&!!L.geometry.morphAttributes.normal,morphTargetsCount:L.geometry&&L.geometry.morphAttributes.position?L.geometry.morphAttributes.position.length:0,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:v.dithering,shadowMapEnabled:r.shadowMap.enabled&&S.length>0,shadowMapType:r.shadowMap.type,toneMapping:v.toneMapped?r.toneMapping:gn,physicallyCorrectLights:r.physicallyCorrectLights,premultipliedAlpha:v.premultipliedAlpha,doubleSided:v.side===Bs,flipSided:v.side===xt,depthPacking:v.depthPacking!==void 0?v.depthPacking:!1,index0AttributeName:v.index0AttributeName,extensionDerivatives:v.extensions&&v.extensions.derivatives,extensionFragDepth:v.extensions&&v.extensions.fragDepth,extensionDrawBuffers:v.extensions&&v.extensions.drawBuffers,extensionShaderTextureLOD:v.extensions&&v.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||i.has("EXT_shader_texture_lod"),customProgramCacheKey:v.customProgramCacheKey()}}function E(v){let R=[];if(v.shaderID?R.push(v.shaderID):(R.push(v.customVertexShaderID),R.push(v.customFragmentShaderID)),v.defines!==void 0)for(let S in v.defines)R.push(S),R.push(v.defines[S]);return v.isRawShaderMaterial===!1&&(w(R,v),_(R,v),R.push(r.outputEncoding)),R.push(v.customProgramCacheKey),R.join()}function w(v,R){v.push(R.precision),v.push(R.outputEncoding),v.push(R.envMapMode),v.push(R.combine),v.push(R.vertexUvs),v.push(R.fogExp2),v.push(R.sizeAttenuation),v.push(R.maxBones),v.push(R.morphTargetsCount),v.push(R.numDirLights),v.push(R.numPointLights),v.push(R.numSpotLights),v.push(R.numHemiLights),v.push(R.numRectAreaLights),v.push(R.numDirLightShadows),v.push(R.numPointLightShadows),v.push(R.numSpotLightShadows),v.push(R.shadowMapType),v.push(R.toneMapping),v.push(R.numClippingPlanes),v.push(R.numClipIntersection)}function _(v,R){a.disableAll(),R.isWebGL2&&a.enable(0),R.supportsVertexTextures&&a.enable(1),R.instancing&&a.enable(2),R.instancingColor&&a.enable(3),R.map&&a.enable(4),R.matcap&&a.enable(5),R.envMap&&a.enable(6),R.envMapCubeUV&&a.enable(7),R.lightMap&&a.enable(8),R.aoMap&&a.enable(9),R.emissiveMap&&a.enable(10),R.bumpMap&&a.enable(11),R.normalMap&&a.enable(12),R.objectSpaceNormalMap&&a.enable(13),R.tangentSpaceNormalMap&&a.enable(14),R.clearcoat&&a.enable(15),R.clearcoatMap&&a.enable(16),R.clearcoatRoughnessMap&&a.enable(17),R.clearcoatNormalMap&&a.enable(18),R.displacementMap&&a.enable(19),R.specularMap&&a.enable(20),R.roughnessMap&&a.enable(21),R.metalnessMap&&a.enable(22),R.gradientMap&&a.enable(23),R.alphaMap&&a.enable(24),R.alphaTest&&a.enable(25),R.vertexColors&&a.enable(26),R.vertexAlphas&&a.enable(27),R.vertexUvs&&a.enable(28),R.vertexTangents&&a.enable(29),R.uvsVertexOnly&&a.enable(30),R.fog&&a.enable(31),v.push(a.mask),a.disableAll(),R.useFog&&a.enable(0),R.flatShading&&a.enable(1),R.logarithmicDepthBuffer&&a.enable(2),R.skinning&&a.enable(3),R.useVertexTexture&&a.enable(4),R.morphTargets&&a.enable(5),R.morphNormals&&a.enable(6),R.premultipliedAlpha&&a.enable(7),R.shadowMapEnabled&&a.enable(8),R.physicallyCorrectLights&&a.enable(9),R.doubleSided&&a.enable(10),R.flipSided&&a.enable(11),R.depthPacking&&a.enable(12),R.dithering&&a.enable(13),R.specularIntensityMap&&a.enable(14),R.specularColorMap&&a.enable(15),R.transmission&&a.enable(16),R.transmissionMap&&a.enable(17),R.thicknessMap&&a.enable(18),R.sheen&&a.enable(19),R.sheenColorMap&&a.enable(20),R.sheenRoughnessMap&&a.enable(21),R.decodeVideoTexture&&a.enable(22),R.transparent&&a.enable(23),v.push(a.mask)}function M(v){let R=x[v.type],S;if(R){let B=Ti[R];S=Bv.clone(B.uniforms)}else S=v.uniforms;return S}function T(v,R){let S;for(let B=0,L=c.length;B0?i.push(g):p.transparent===!0?n.push(g):t.push(g)}function l(h,d,p,m,y,x){let g=o(h,d,p,m,y,x);p.transmission>0?i.unshift(g):p.transparent===!0?n.unshift(g):t.unshift(g)}function c(h,d){t.length>1&&t.sort(h||k1),i.length>1&&i.sort(d||Ff),n.length>1&&n.sort(d||Ff)}function u(){for(let h=e,d=r.length;h=r.get(i).length?(s=new Lf,r.get(i).push(s)):s=r.get(i)[n],s}function t(){r=new WeakMap}return{get:e,dispose:t}}function z1(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new P,color:new ye};break;case"SpotLight":t={position:new P,direction:new P,color:new ye,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new P,color:new ye,distance:0,decay:0};break;case"HemisphereLight":t={direction:new P,skyColor:new ye,groundColor:new ye};break;case"RectAreaLight":t={color:new ye,position:new P,halfWidth:new P,halfHeight:new P};break}return r[e.id]=t,t}}}function V1(){let r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ee,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}var U1=0;function H1(r,e){return(e.castShadow?1:0)-(r.castShadow?1:0)}function G1(r,e){let t=new z1,i=V1(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let u=0;u<9;u++)n.probe.push(new P);let s=new P,o=new Ee,a=new Ee;function l(u,h){let d=0,p=0,m=0;for(let W=0;W<9;W++)n.probe[W].set(0,0,0);let y=0,x=0,g=0,f=0,E=0,w=0,_=0,M=0;u.sort(H1);let T=h!==!0?Math.PI:1;for(let W=0,A=u.length;W0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=re.LTC_FLOAT_1,n.rectAreaLTC2=re.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(n.rectAreaLTC1=re.LTC_HALF_1,n.rectAreaLTC2=re.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),n.ambient[0]=d,n.ambient[1]=p,n.ambient[2]=m;let z=n.hash;(z.directionalLength!==y||z.pointLength!==x||z.spotLength!==g||z.rectAreaLength!==f||z.hemiLength!==E||z.numDirectionalShadows!==w||z.numPointShadows!==_||z.numSpotShadows!==M)&&(n.directional.length=y,n.spot.length=g,n.rectArea.length=f,n.point.length=x,n.hemi.length=E,n.directionalShadow.length=w,n.directionalShadowMap.length=w,n.pointShadow.length=_,n.pointShadowMap.length=_,n.spotShadow.length=M,n.spotShadowMap.length=M,n.directionalShadowMatrix.length=w,n.pointShadowMatrix.length=_,n.spotShadowMatrix.length=M,z.directionalLength=y,z.pointLength=x,z.spotLength=g,z.rectAreaLength=f,z.hemiLength=E,z.numDirectionalShadows=w,z.numPointShadows=_,z.numSpotShadows=M,n.version=U1++)}function c(u,h){let d=0,p=0,m=0,y=0,x=0,g=h.matrixWorldInverse;for(let f=0,E=u.length;f=t.get(s).length?(a=new Bf(r,e),t.get(s).push(a)):a=t.get(s)[o],a}function n(){t=new WeakMap}return{get:i,dispose:n}}var ka=class extends ft{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=gv,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}};ka.prototype.isMeshDepthMaterial=!0;var Oa=class extends ft{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new P,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}};Oa.prototype.isMeshDistanceMaterial=!0;var W1=`void main() { gl_Position = vec4( position, 1.0 ); -}`,v1=`uniform sampler2D shadow_pass; +}`,$1=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3023,62 +3020,65 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function Qf(r,e,t){let i=new Ns,n=new ee,s=new ee,o=new $e,a=new Ia({depthPacking:qx}),l=new Na,c={},u=t.maxTextureSize,h={0:gt,1:Cr,2:Fs},d=new Hi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ee},radius:{value:4}},vertexShader:x1,fragmentShader:v1}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let m=new Ke;m.setAttribute("position",new ut(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let y=new ht(m,d),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=If,this.render=function(w,_,D){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||w.length===0)return;let T=r.getRenderTarget(),O=r.getActiveCubeFace(),W=r.getActiveMipmapLevel(),A=r.state;A.setBlending(ln),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);for(let v=0,R=w.length;vu||n.y>u)&&(n.x>u&&(s.x=Math.floor(u/L.x),n.x=s.x*L.x,B.mapSize.x=s.x),n.y>u&&(s.y=Math.floor(u/L.y),n.y=s.y*L.y,B.mapSize.y=s.y)),B.map===null&&!B.isPointLightShadow&&this.type===Er){let N={minFilter:Dt,magFilter:Dt,format:Lt};B.map=new zt(n.x,n.y,N),B.map.texture.name=S.name+".shadowMap",B.mapPass=new zt(n.x,n.y,N),B.camera.updateProjectionMatrix()}if(B.map===null){let N={minFilter:yt,magFilter:yt,format:Lt};B.map=new zt(n.x,n.y,N),B.map.texture.name=S.name+".shadowMap",B.camera.updateProjectionMatrix()}r.setRenderTarget(B.map),r.clear();let C=B.getViewportCount();for(let N=0;N0){let S=v.uuid,B=D.uuid,L=c[S];L===void 0&&(L={},c[S]=L);let C=L[B];C===void 0&&(C=v.clone(),L[B]=C),v=C}return v.visible=D.visible,v.wireframe=D.wireframe,A===Er?v.side=D.shadowSide!==null?D.shadowSide:D.side:v.side=D.shadowSide!==null?D.shadowSide:h[D.side],v.alphaMap=D.alphaMap,v.alphaTest=D.alphaTest,v.clipShadows=D.clipShadows,v.clippingPlanes=D.clippingPlanes,v.clipIntersection=D.clipIntersection,v.displacementMap=D.displacementMap,v.displacementScale=D.displacementScale,v.displacementBias=D.displacementBias,v.wireframeLinewidth=D.wireframeLinewidth,v.linewidth=D.linewidth,T.isPointLight===!0&&v.isMeshDistanceMaterial===!0&&(v.referencePosition.setFromMatrixPosition(T.matrixWorld),v.nearDistance=O,v.farDistance=W),v}function E(w,_,D,T,O){if(w.visible===!1)return;if(w.layers.test(_.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&O===Er)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,w.matrixWorld);let v=e.update(w),R=w.material;if(Array.isArray(R)){let S=v.groups;for(let B=0,L=S.length;B=1):C.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),B=L>=2);let N=null,k={},V=r.getParameter(3088),U=r.getParameter(2978),q=new $e().fromArray(V),j=new $e().fromArray(U);function ne(z,ge,pe){let Me=new Uint8Array(4),K=r.createTexture();r.bindTexture(z,K),r.texParameteri(z,10241,9728),r.texParameteri(z,10240,9728);for(let _e=0;_ese||I.height>se)&&(xe=se/Math.max(I.width,I.height)),xe<1||M===!0)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap){let Y=M?Xx:Math.floor,be=Y(xe*I.width),ve=Y(xe*I.height);y===void 0&&(y=g(be,ve));let he=J?g(be,ve):y;return he.width=be,he.height=ve,he.getContext("2d").drawImage(I,0,0,be,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+be+"x"+ve+")."),he}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function E(I){return Cp(I.width)&&Cp(I.height)}function w(I){return a?!1:I.wrapS!==Wt||I.wrapT!==Wt||I.minFilter!==yt&&I.minFilter!==Dt}function _(I,M){return I.generateMipmaps&&M&&I.minFilter!==yt&&I.minFilter!==Dt}function D(I){r.generateMipmap(I)}function T(I,M,J,se,xe=!1){if(a===!1)return M;if(I!==null){if(r[I]!==void 0)return r[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let Y=M;return M===6403&&(J===5126&&(Y=33326),J===5131&&(Y=33325),J===5121&&(Y=33321)),M===33319&&(J===5126&&(Y=33328),J===5131&&(Y=33327),J===5121&&(Y=33323)),M===6408&&(J===5126&&(Y=34836),J===5131&&(Y=34842),J===5121&&(Y=se===et&&xe===!1?35907:32856),J===32819&&(Y=32854),J===32820&&(Y=32855)),(Y===33325||Y===33326||Y===33327||Y===33328||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function O(I,M,J){return _(I,J)===!0||I.isFramebufferTexture&&I.minFilter!==yt&&I.minFilter!==Dt?Math.log2(Math.max(M.width,M.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?M.mipmaps.length:1}function W(I){return I===yt||I===rp||I===op?9728:9729}function A(I){let M=I.target;M.removeEventListener("dispose",A),R(M),M.isVideoTexture&&m.delete(M),o.memory.textures--}function v(I){let M=I.target;M.removeEventListener("dispose",v),S(M)}function R(I){let M=i.get(I);M.__webglInit!==void 0&&(r.deleteTexture(M.__webglTexture),i.remove(I))}function S(I){let M=I.texture,J=i.get(I),se=i.get(M);if(I){if(se.__webglTexture!==void 0&&(r.deleteTexture(se.__webglTexture),o.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let xe=0;xe<6;xe++)r.deleteFramebuffer(J.__webglFramebuffer[xe]),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer[xe]);else r.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&r.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer&&r.deleteRenderbuffer(J.__webglColorRenderbuffer),J.__webglDepthRenderbuffer&&r.deleteRenderbuffer(J.__webglDepthRenderbuffer);if(I.isWebGLMultipleRenderTargets)for(let xe=0,Y=M.length;xe=l&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+l),B+=1,I}function N(I,M){let J=i.get(I);if(I.isVideoTexture&&de(I),I.version>0&&J.__version!==I.version){let se=I.image;if(se===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{H(J,I,M);return}}t.activeTexture(33984+M),t.bindTexture(3553,J.__webglTexture)}function k(I,M){let J=i.get(I);if(I.version>0&&J.__version!==I.version){H(J,I,M);return}t.activeTexture(33984+M),t.bindTexture(35866,J.__webglTexture)}function V(I,M){let J=i.get(I);if(I.version>0&&J.__version!==I.version){H(J,I,M);return}t.activeTexture(33984+M),t.bindTexture(32879,J.__webglTexture)}function U(I,M){let J=i.get(I);if(I.version>0&&J.__version!==I.version){Te(J,I,M);return}t.activeTexture(33984+M),t.bindTexture(34067,J.__webglTexture)}let q={[Qc]:10497,[Wt]:33071,[eu]:33648},j={[yt]:9728,[rp]:9984,[op]:9986,[Dt]:9729,[Ex]:9985,[il]:9987};function ne(I,M,J){if(J?(r.texParameteri(I,10242,q[M.wrapS]),r.texParameteri(I,10243,q[M.wrapT]),(I===32879||I===35866)&&r.texParameteri(I,32882,q[M.wrapR]),r.texParameteri(I,10240,j[M.magFilter]),r.texParameteri(I,10241,j[M.minFilter])):(r.texParameteri(I,10242,33071),r.texParameteri(I,10243,33071),(I===32879||I===35866)&&r.texParameteri(I,32882,33071),(M.wrapS!==Wt||M.wrapT!==Wt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(I,10240,W(M.magFilter)),r.texParameteri(I,10241,W(M.minFilter)),M.minFilter!==yt&&M.minFilter!==Dt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let se=e.get("EXT_texture_filter_anisotropic");if(M.type===Pn&&e.has("OES_texture_float_linear")===!1||a===!1&&M.type===Ds&&e.has("OES_texture_half_float_linear")===!1)return;(M.anisotropy>1||i.get(M).__currentAnisotropy)&&(r.texParameterf(I,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(M.anisotropy,n.getMaxAnisotropy())),i.get(M).__currentAnisotropy=M.anisotropy)}}function ae(I,M){I.__webglInit===void 0&&(I.__webglInit=!0,M.addEventListener("dispose",A),I.__webglTexture=r.createTexture(),o.memory.textures++)}function H(I,M,J){let se=3553;M.isDataTexture2DArray&&(se=35866),M.isDataTexture3D&&(se=32879),ae(I,M),t.activeTexture(33984+J),t.bindTexture(se,I.__webglTexture),r.pixelStorei(37440,M.flipY),r.pixelStorei(37441,M.premultiplyAlpha),r.pixelStorei(3317,M.unpackAlignment),r.pixelStorei(37443,0);let xe=w(M)&&E(M.image)===!1,Y=f(M.image,xe,!1,u);Y=Se(M,Y);let be=E(Y)||a,ve=s.convert(M.format,M.encoding),he=s.convert(M.type),le=T(M.internalFormat,ve,he,M.encoding,M.isVideoTexture);ne(se,M,be);let Le,z=M.mipmaps,ge=a&&M.isVideoTexture!==!0,pe=I.__version===void 0,Me=O(M,Y,be);if(M.isDepthTexture)le=6402,a?M.type===Pn?le=36012:M.type===Aa?le=33190:M.type===Ts?le=35056:le=33189:M.type===Pn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),M.format===Nn&&le===6402&&M.type!==Rr&&M.type!==Aa&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),M.type=Rr,he=s.convert(M.type)),M.format===Ls&&le===6402&&(le=34041,M.type!==Ts&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),M.type=Ts,he=s.convert(M.type))),ge&&pe?t.texStorage2D(3553,1,le,Y.width,Y.height):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,null);else if(M.isDataTexture)if(z.length>0&&be){ge&&pe&&t.texStorage2D(3553,Me,le,z[0].width,z[0].height);for(let K=0,_e=z.length;K<_e;K++)Le=z[K],ge?t.texSubImage2D(3553,0,0,0,Le.width,Le.height,ve,he,Le.data):t.texImage2D(3553,K,le,Le.width,Le.height,0,ve,he,Le.data);M.generateMipmaps=!1}else ge?(pe&&t.texStorage2D(3553,Me,le,Y.width,Y.height),t.texSubImage2D(3553,0,0,0,Y.width,Y.height,ve,he,Y.data)):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,Y.data);else if(M.isCompressedTexture){ge&&pe&&t.texStorage2D(3553,Me,le,z[0].width,z[0].height);for(let K=0,_e=z.length;K<_e;K++)Le=z[K],M.format!==Lt?ve!==null?ge?t.compressedTexSubImage2D(3553,K,0,0,Le.width,Le.height,ve,Le.data):t.compressedTexImage2D(3553,K,le,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ge?t.texSubImage2D(3553,K,0,0,Le.width,Le.height,ve,he,Le.data):t.texImage2D(3553,K,le,Le.width,Le.height,0,ve,he,Le.data)}else if(M.isDataTexture2DArray)ge?(pe&&t.texStorage3D(35866,Me,le,Y.width,Y.height,Y.depth),t.texSubImage3D(35866,0,0,0,0,Y.width,Y.height,Y.depth,ve,he,Y.data)):t.texImage3D(35866,0,le,Y.width,Y.height,Y.depth,0,ve,he,Y.data);else if(M.isDataTexture3D)ge?(pe&&t.texStorage3D(32879,Me,le,Y.width,Y.height,Y.depth),t.texSubImage3D(32879,0,0,0,0,Y.width,Y.height,Y.depth,ve,he,Y.data)):t.texImage3D(32879,0,le,Y.width,Y.height,Y.depth,0,ve,he,Y.data);else if(M.isFramebufferTexture)ge&&pe?t.texStorage2D(3553,Me,le,Y.width,Y.height):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,null);else if(z.length>0&&be){ge&&pe&&t.texStorage2D(3553,Me,le,z[0].width,z[0].height);for(let K=0,_e=z.length;K<_e;K++)Le=z[K],ge?t.texSubImage2D(3553,K,0,0,ve,he,Le):t.texImage2D(3553,K,le,ve,he,Le);M.generateMipmaps=!1}else ge?(pe&&t.texStorage2D(3553,Me,le,Y.width,Y.height),t.texSubImage2D(3553,0,0,0,ve,he,Y)):t.texImage2D(3553,0,le,ve,he,Y);_(M,be)&&D(se),I.__version=M.version,M.onUpdate&&M.onUpdate(M)}function Te(I,M,J){if(M.image.length!==6)return;ae(I,M),t.activeTexture(33984+J),t.bindTexture(34067,I.__webglTexture),r.pixelStorei(37440,M.flipY),r.pixelStorei(37441,M.premultiplyAlpha),r.pixelStorei(3317,M.unpackAlignment),r.pixelStorei(37443,0);let se=M&&(M.isCompressedTexture||M.image[0].isCompressedTexture),xe=M.image[0]&&M.image[0].isDataTexture,Y=[];for(let K=0;K<6;K++)!se&&!xe?Y[K]=f(M.image[K],!1,!0,c):Y[K]=xe?M.image[K].image:M.image[K],Y[K]=Se(M,Y[K]);let be=Y[0],ve=E(be)||a,he=s.convert(M.format,M.encoding),le=s.convert(M.type),Le=T(M.internalFormat,he,le,M.encoding),z=a&&M.isVideoTexture!==!0,ge=I.__version===void 0,pe=O(M,be,ve);ne(34067,M,ve);let Me;if(se){z&&ge&&t.texStorage2D(34067,pe,Le,be.width,be.height);for(let K=0;K<6;K++){Me=Y[K].mipmaps;for(let _e=0;_e0&&pe++,t.texStorage2D(34067,pe,Le,Y[0].width,Y[0].height));for(let K=0;K<6;K++)if(xe){z?t.texSubImage2D(34069+K,0,0,0,Y[K].width,Y[K].height,he,le,Y[K].data):t.texImage2D(34069+K,0,Le,Y[K].width,Y[K].height,0,he,le,Y[K].data);for(let _e=0;_ep+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=n!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},Ur=class extends at{constructor(e,t,i,n,s,o,a,l,c,u){if(u=u!==void 0?u:Nn,u!==Nn&&u!==Ls)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===Nn&&(i=Rr),i===void 0&&u===Ls&&(i=Ts),super(null,n,s,o,a,l,u,i,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:yt,this.minFilter=l!==void 0?l:yt,this.flipY=!1,this.generateMipmaps=!1}};Ur.prototype.isDepthTexture=!0;var lu=class extends Vi{constructor(e,t){super();let i=this,n=null,s=1,o=null,a="local-floor",l=e.extensions.has("WEBGL_multisampled_render_to_texture"),c=null,u=null,h=null,d=null,p=!1,m=null,y=t.getContextAttributes(),x=null,g=null,f=[],E=new Map,w=new _t;w.layers.enable(1),w.viewport=new $e;let _=new _t;_.layers.enable(2),_.viewport=new $e;let D=[w,_],T=new ka;T.layers.enable(1),T.layers.enable(2);let O=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let q=f[U];return q===void 0&&(q=new Mr,f[U]=q),q.getTargetRaySpace()},this.getControllerGrip=function(U){let q=f[U];return q===void 0&&(q=new Mr,f[U]=q),q.getGripSpace()},this.getHand=function(U){let q=f[U];return q===void 0&&(q=new Mr,f[U]=q),q.getHandSpace()};function A(U){let q=E.get(U.inputSource);q&&q.dispatchEvent({type:U.type,data:U.inputSource})}function v(){E.forEach(function(U,q){U.disconnect(q)}),E.clear(),O=null,W=null,e.setRenderTarget(x),d=null,h=null,u=null,n=null,g=null,V.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(U){s=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(U){a=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return n},this.setSession=async function(U){if(n=U,n!==null){if(x=e.getRenderTarget(),n.addEventListener("select",A),n.addEventListener("selectstart",A),n.addEventListener("selectend",A),n.addEventListener("squeeze",A),n.addEventListener("squeezestart",A),n.addEventListener("squeezeend",A),n.addEventListener("end",v),n.addEventListener("inputsourceschange",R),y.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let q={antialias:n.renderState.layers===void 0?y.antialias:!0,alpha:y.alpha,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(n,t,q),n.updateRenderState({baseLayer:d}),g=new zt(d.framebufferWidth,d.framebufferHeight,{format:Lt,type:un,encoding:e.outputEncoding})}else{p=y.antialias;let q=null,j=null,ne=null;y.depth&&(ne=y.stencil?35056:33190,q=y.stencil?Ls:Nn,j=y.stencil?Ts:Rr);let ae={colorFormat:e.outputEncoding===et?35907:32856,depthFormat:ne,scaleFactor:s};u=new XRWebGLBinding(n,t),h=u.createProjectionLayer(ae),n.updateRenderState({layers:[h]}),p?g=new Br(h.textureWidth,h.textureHeight,{format:Lt,type:un,depthTexture:new Ur(h.textureWidth,h.textureHeight,j,void 0,void 0,void 0,void 0,void 0,void 0,q),stencilBuffer:y.stencil,ignoreDepth:h.ignoreDepthValues,useRenderToTexture:l,encoding:e.outputEncoding}):g=new zt(h.textureWidth,h.textureHeight,{format:Lt,type:un,depthTexture:new Ur(h.textureWidth,h.textureHeight,j,void 0,void 0,void 0,void 0,void 0,void 0,q),stencilBuffer:y.stencil,ignoreDepth:h.ignoreDepthValues,encoding:e.outputEncoding})}g.isXRRenderTarget=!0,this.setFoveation(1),o=await n.requestReferenceSpace(a),V.setContext(n),V.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function R(U){let q=n.inputSources;for(let j=0;j0&&(g.alphaTest.value=f.alphaTest);let E=r.get(f).envMap;E&&(g.envMap.value=E,g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=f.reflectivity,g.ior.value=f.ior,g.refractionRatio.value=f.refractionRatio),f.lightMap&&(g.lightMap.value=f.lightMap,g.lightMapIntensity.value=f.lightMapIntensity),f.aoMap&&(g.aoMap.value=f.aoMap,g.aoMapIntensity.value=f.aoMapIntensity);let w;f.map?w=f.map:f.specularMap?w=f.specularMap:f.displacementMap?w=f.displacementMap:f.normalMap?w=f.normalMap:f.bumpMap?w=f.bumpMap:f.roughnessMap?w=f.roughnessMap:f.metalnessMap?w=f.metalnessMap:f.alphaMap?w=f.alphaMap:f.emissiveMap?w=f.emissiveMap:f.clearcoatMap?w=f.clearcoatMap:f.clearcoatNormalMap?w=f.clearcoatNormalMap:f.clearcoatRoughnessMap?w=f.clearcoatRoughnessMap:f.specularIntensityMap?w=f.specularIntensityMap:f.specularColorMap?w=f.specularColorMap:f.transmissionMap?w=f.transmissionMap:f.thicknessMap?w=f.thicknessMap:f.sheenColorMap?w=f.sheenColorMap:f.sheenRoughnessMap&&(w=f.sheenRoughnessMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),g.uvTransform.value.copy(w.matrix));let _;f.aoMap?_=f.aoMap:f.lightMap&&(_=f.lightMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),g.uv2Transform.value.copy(_.matrix))}function n(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity}function s(g,f){g.dashSize.value=f.dashSize,g.totalSize.value=f.dashSize+f.gapSize,g.scale.value=f.scale}function o(g,f,E,w){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.size.value=f.size*E,g.scale.value=w*.5,f.map&&(g.map.value=f.map),f.alphaMap&&(g.alphaMap.value=f.alphaMap),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);let _;f.map?_=f.map:f.alphaMap&&(_=f.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),g.uvTransform.value.copy(_.matrix))}function a(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.rotation.value=f.rotation,f.map&&(g.map.value=f.map),f.alphaMap&&(g.alphaMap.value=f.alphaMap),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);let E;f.map?E=f.map:f.alphaMap&&(E=f.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),g.uvTransform.value.copy(E.matrix))}function l(g,f){f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap)}function c(g,f){g.specular.value.copy(f.specular),g.shininess.value=Math.max(f.shininess,1e-4),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===gt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===gt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function u(g,f){f.gradientMap&&(g.gradientMap.value=f.gradientMap),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===gt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===gt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function h(g,f){g.roughness.value=f.roughness,g.metalness.value=f.metalness,f.roughnessMap&&(g.roughnessMap.value=f.roughnessMap),f.metalnessMap&&(g.metalnessMap.value=f.metalnessMap),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===gt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===gt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),r.get(f).envMap&&(g.envMapIntensity.value=f.envMapIntensity)}function d(g,f,E){h(g,f),g.ior.value=f.ior,f.sheen>0&&(g.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),g.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(g.sheenColorMap.value=f.sheenColorMap),f.sheenRoughnessMap&&(g.sheenRoughnessMap.value=f.sheenRoughnessMap)),f.clearcoat>0&&(g.clearcoat.value=f.clearcoat,g.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(g.clearcoatMap.value=f.clearcoatMap),f.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap),f.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),g.clearcoatNormalMap.value=f.clearcoatNormalMap,f.side===gt&&g.clearcoatNormalScale.value.negate())),f.transmission>0&&(g.transmission.value=f.transmission,g.transmissionSamplerMap.value=E.texture,g.transmissionSamplerSize.value.set(E.width,E.height),f.transmissionMap&&(g.transmissionMap.value=f.transmissionMap),g.thickness.value=f.thickness,f.thicknessMap&&(g.thicknessMap.value=f.thicknessMap),g.attenuationDistance.value=f.attenuationDistance,g.attenuationColor.value.copy(f.attenuationColor)),g.specularIntensity.value=f.specularIntensity,g.specularColor.value.copy(f.specularColor),f.specularIntensityMap&&(g.specularIntensityMap.value=f.specularIntensityMap),f.specularColorMap&&(g.specularColorMap.value=f.specularColorMap)}function p(g,f){f.matcap&&(g.matcap.value=f.matcap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===gt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===gt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function m(g,f){f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function y(g,f){f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),g.referencePosition.value.copy(f.referencePosition),g.nearDistance.value=f.nearDistance,g.farDistance.value=f.farDistance}function x(g,f){f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===gt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===gt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function S1(){let r=Lr("canvas");return r.style.display="block",r}function qe(r={}){let e=r.canvas!==void 0?r.canvas:S1(),t=r.context!==void 0?r.context:null,i=r.alpha!==void 0?r.alpha:!1,n=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,p=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=fn,this.physicallyCorrectLights=!1,this.toneMapping=cn,this.toneMappingExposure=1;let y=this,x=!1,g=0,f=0,E=null,w=-1,_=null,D=new $e,T=new $e,O=null,W=e.width,A=e.height,v=1,R=null,S=null,B=new $e(0,0,W,A),L=new $e(0,0,W,A),C=!1,N=new Ns,k=!1,V=!1,U=null,q=new Ee,j=new P,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return E===null?v:1}let H=t;function Te(F,G){for(let X=0;X0?d=m[m.length-1]:d=null,p.pop(),p.length>0?h=p[p.length-1]:h=null};function rt(F,G,X,$){if(F.visible===!1)return;if(F.layers.test(G.layers)){if(F.isGroup)X=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(G);else if(F.isLight)d.pushLight(F),F.castShadow&&d.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||N.intersectsSprite(F)){$&&j.setFromMatrixPosition(F.matrixWorld).applyMatrix4(q);let Be=Se.update(F),Ie=F.material;Ie.visible&&h.push(F,Be,Ie,X,j.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(F.isSkinnedMesh&&F.skeleton.frame!==Ce.render.frame&&(F.skeleton.update(),F.skeleton.frame=Ce.render.frame),!F.frustumCulled||N.intersectsObject(F))){$&&j.setFromMatrixPosition(F.matrixWorld).applyMatrix4(q);let Be=Se.update(F),Ie=F.material;if(Array.isArray(Ie)){let Pe=Be.groups;for(let We=0,Oe=Pe.length;We0&&Si(Q,G,X),$&&oe.viewport(D.copy($)),Q.length>0&&Do(Q,G,X),Fe.length>0&&Do(Fe,G,X),Be.length>0&&Do(Be,G,X)}function Si(F,G,X){if(U===null){let Be=o===!0&&we.isWebGL2===!0?Br:zt;U=new Be(1024,1024,{generateMipmaps:!0,type:be.convert(Ds)!==null?Ds:un,minFilter:il,magFilter:yt,wrapS:Wt,wrapT:Wt,useRenderToTexture:ue.has("WEBGL_multisampled_render_to_texture")})}let $=y.getRenderTarget();y.setRenderTarget(U),y.clear();let Q=y.toneMapping;y.toneMapping=cn,Do(F,G,X),y.toneMapping=Q,Z.updateMultisampleRenderTarget(U),Z.updateRenderTargetMipmap(U),y.setRenderTarget($)}function Do(F,G,X){let $=G.isScene===!0?G.overrideMaterial:null;for(let Q=0,Fe=F.length;Q=0&&G<=F.width-$&&X>=0&&X<=F.height-Q&&H.readPixels(G,X,$,Q,be.convert(We),be.convert(Oe),Fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let Pe=E!==null?Ae.get(E).__webglFramebuffer:null;oe.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(F,G,X=0){if(G.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let $=Math.pow(2,-X),Q=Math.floor(G.image.width*$),Fe=Math.floor(G.image.height*$);Z.setTexture2D(G,0),H.copyTexSubImage2D(3553,X,0,0,F.x,F.y,Q,Fe),oe.unbindTexture()},this.copyTextureToTexture=function(F,G,X,$=0){let Q=G.image.width,Fe=G.image.height,Be=be.convert(X.format),Ie=be.convert(X.type);Z.setTexture2D(X,0),H.pixelStorei(37440,X.flipY),H.pixelStorei(37441,X.premultiplyAlpha),H.pixelStorei(3317,X.unpackAlignment),G.isDataTexture?H.texSubImage2D(3553,$,F.x,F.y,Q,Fe,Be,Ie,G.image.data):G.isCompressedTexture?H.compressedTexSubImage2D(3553,$,F.x,F.y,G.mipmaps[0].width,G.mipmaps[0].height,Be,G.mipmaps[0].data):H.texSubImage2D(3553,$,F.x,F.y,Be,Ie,G.image),$===0&&X.generateMipmaps&&H.generateMipmap(3553),oe.unbindTexture()},this.copyTextureToTexture3D=function(F,G,X,$,Q=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Fe=F.max.x-F.min.x+1,Be=F.max.y-F.min.y+1,Ie=F.max.z-F.min.z+1,Pe=be.convert($.format),We=be.convert($.type),Oe;if($.isDataTexture3D)Z.setTexture3D($,0),Oe=32879;else if($.isDataTexture2DArray)Z.setTexture2DArray($,0),Oe=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(37440,$.flipY),H.pixelStorei(37441,$.premultiplyAlpha),H.pixelStorei(3317,$.unpackAlignment);let Ve=H.getParameter(3314),ot=H.getParameter(32878),Mn=H.getParameter(3316),Jn=H.getParameter(3315),Ue=H.getParameter(32877),ui=X.isCompressedTexture?X.mipmaps[0]:X.image;H.pixelStorei(3314,ui.width),H.pixelStorei(32878,ui.height),H.pixelStorei(3316,F.min.x),H.pixelStorei(3315,F.min.y),H.pixelStorei(32877,F.min.z),X.isDataTexture||X.isDataTexture3D?H.texSubImage3D(Oe,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,We,ui.data):X.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),H.compressedTexSubImage3D(Oe,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,ui.data)):H.texSubImage3D(Oe,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,We,ui),H.pixelStorei(3314,Ve),H.pixelStorei(32878,ot),H.pixelStorei(3316,Mn),H.pixelStorei(3315,Jn),H.pixelStorei(32877,Ue),Q===0&&$.generateMipmaps&&H.generateMipmap(Oe),oe.unbindTexture()},this.initTexture=function(F){Z.setTexture2D(F,0),oe.unbindTexture()},this.resetState=function(){g=0,f=0,E=null,oe.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}qe.prototype.isWebGLRenderer=!0;var cu=class extends qe{};cu.prototype.isWebGL1Renderer=!0;var uu=class r{constructor(e,t=25e-5){this.name="",this.color=new ye(e),this.density=t}clone(){return new r(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};uu.prototype.isFogExp2=!0;var hu=class r{constructor(e,t=1,i=1e3){this.name="",this.color=new ye(e),this.near=t,this.far=i}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};hu.prototype.isFog=!0;var zs=class extends Ge{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};zs.prototype.isScene=!0;var kn=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fr,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ri()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,s=this.stride;ne.far||t.push({distance:l,point:xr.clone(),uv:Ct.getUV(xr,ha,wr,da,uf,Gc,hf,new ee),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};du.prototype.isSprite=!0;function pa(r,e,t,i,n,s){_s.subVectors(r,t).addScalar(.5).multiply(i),n!==void 0?(vr.x=s*_s.x-n*_s.y,vr.y=n*_s.x+s*_s.y):vr.copy(_s),r.copy(e),r.x+=vr.x,r.y+=vr.y,r.applyMatrix4(em)}var df=new P,pf=new $e,ff=new $e,M1=new P,mf=new Ee,Oa=class extends ht{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ee,this.bindMatrixInverse=new Ee}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new $e,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;il)continue;d.applyMatrix4(this.matrixWorld);let O=e.ray.origin.distanceTo(d);Oe.far||t.push({distance:O,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),f=Math.min(x.count,o.start+o.count);for(let E=g,w=f-1;El)continue;d.applyMatrix4(this.matrixWorld);let D=e.ray.origin.distanceTo(d);De.far||t.push({distance:D,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};qr.prototype.isLine=!0;var bf=new P,_f=new P,Wr=class extends qr{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,i=[];for(let n=0,s=t.count;n0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};xu.prototype.isPoints=!0;function Af(r,e,t,i,n,s,o){let a=yu.distanceSqToPoint(r);if(an.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var vu=class extends at{constructor(e,t,i,n,s,o,a,l,c){super(e,t,i,n,s,o,a,l,c),this.minFilter=o!==void 0?o:Dt,this.magFilter=s!==void 0?s:Dt,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};vu.prototype.isVideoTexture=!0;var wu=class extends at{constructor(e,t,i){super({width:e,height:t}),this.format=i,this.magFilter=yt,this.minFilter=yt,this.generateMipmaps=!1,this.needsUpdate=!0}};wu.prototype.isFramebufferTexture=!0;var bu=class extends at{constructor(e,t,i,n,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,n,s,h,d),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};bu.prototype.isCompressedTexture=!0;var _u=class extends at{constructor(e,t,i,n,s,o,a,l,c){super(e,t,i,n,s,o,a,l,c),this.needsUpdate=!0}};_u.prototype.isCanvasTexture=!0;var FS=new P,LS=new P,BS=new P,PS=new Ct;var Ot=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],i,n=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(n),t.push(s),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i=this.getLengths(),n=0,s=i.length,o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),c=i[n]-o,c<0)a=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,i[n]===o)return n/(s-1);let u=i[n],d=i[n+1]-u,p=(o-u)/d;return(n+p)/(s-1)}getTangent(e,t){let n=e-1e-4,s=e+1e-4;n<0&&(n=0),s>1&&(s=1);let o=this.getPoint(n),a=this.getPoint(s),l=t||(o.isVector2?new ee:new P);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new P,n=[],s=[],o=[],a=new P,l=new Ee;for(let p=0;p<=e;p++){let m=p/e;n[p]=this.getTangentAt(m,new P)}s[0]=new P,o[0]=new P;let c=Number.MAX_VALUE,u=Math.abs(n[0].x),h=Math.abs(n[0].y),d=Math.abs(n[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),s[0].crossVectors(n[0],a),o[0].crossVectors(n[0],s[0]);for(let p=1;p<=e;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(n[p-1],n[p]),a.length()>Number.EPSILON){a.normalize();let m=Math.acos(kt(n[p-1].dot(n[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,m))}o[p].crossVectors(n[p],s[p])}if(t===!0){let p=Math.acos(kt(s[0].dot(s[e]),-1,1));p/=e,n[0].dot(a.crossVectors(s[0],s[e]))>0&&(p=-p);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(n[m],p*m)),o[m].crossVectors(n[m],s[m])}return{tangents:n,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Os=class extends Ot{constructor(e=0,t=0,i=1,n=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let i=t||new ee,n=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)n;)s-=n;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=n[(a-1)%s]:(xa.subVectors(n[0],n[1]).add(n[0]),c=xa);let h=n[a%s],d=n[(a+1)%s];if(this.closed||a+2n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(Sf(a,l.x,c.x,u.x,h.x),Sf(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){let o=n[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,n=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},On=class extends Yr{constructor(e){super(e),this.uuid=ri(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,n=this.holes.length;i80*t){a=c=r[0],l=u=r[1];for(let m=t;mc&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=p!==0?1/p:0}return Zr(s,o,t,a,l,p),o}};function im(r,e,t,i,n){let s,o;if(n===Z1(r,e,t,i)>0)for(s=e;s=e;s-=i)o=Mf(s,r[s],r[s+1],o);return o&&sl(o,o.next)&&(Kr(o),o=o.next),o}function gn(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=!1,!t.steiner&&(sl(t,t.next)||st(t.prev,t,t.next)===0)){if(Kr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Zr(r,e,t,i,n,s,o){if(!r)return;!o&&s&&q1(r,i,n,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?N1(r,i,n,s):I1(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),Kr(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=k1(gn(r),e,t),Zr(r,e,t,i,n,s,2)):o===2&&z1(r,e,t,i,n,s):Zr(gn(r),e,t,i,n,s,1);break}}}function I1(r){let e=r.prev,t=r,i=r.next;if(st(e,t,i)>=0)return!1;let n=r.next.next;for(;n!==r.prev;){if(Ms(e.x,e.y,t.x,t.y,i.x,i.y,n.x,n.y)&&st(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function N1(r,e,t,i){let n=r.prev,s=r,o=r.next;if(st(n,s,o)>=0)return!1;let a=n.xs.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=Su(a,l,e,t,i),d=Su(c,u,e,t,i),p=r.prevZ,m=r.nextZ;for(;p&&p.z>=h&&m&&m.z<=d;){if(p!==r.prev&&p!==r.next&&Ms(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&st(p.prev,p,p.next)>=0||(p=p.prevZ,m!==r.prev&&m!==r.next&&Ms(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&st(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=h;){if(p!==r.prev&&p!==r.next&&Ms(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&st(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==r.prev&&m!==r.next&&Ms(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&st(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function k1(r,e,t){let i=r;do{let n=i.prev,s=i.next.next;!sl(n,s)&&nm(n,i,i.next,s)&&Jr(n,s)&&Jr(s,n)&&(e.push(n.i/t),e.push(i.i/t),e.push(s.i/t),Kr(i),Kr(i.next),i=r=s),i=i.next}while(i!==r);return gn(i)}function z1(r,e,t,i,n,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&j1(o,a)){let l=sm(o,a);o=gn(o,o.next),l=gn(l,l.next),Zr(o,e,t,i,n,s),Zr(l,e,t,i,n,s);return}a=a.next}o=o.next}while(o!==r)}function O1(r,e,t,i){let n=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=i&&d>s){if(s=d,d===i){if(n===t.y)return t;if(n===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&i!==t.x&&Ms(no.x||t.x===o.x&&G1(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function G1(r,e){return st(r.prev,r,e.prev)<0&&st(e.next,r,r.next)<0}function q1(r,e,t,i){let n=r;do n.z===null&&(n.z=Su(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,W1(n)}function W1(r){let e,t,i,n,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;t=i}s.nextZ=null,c*=2}while(o>1);return r}function Su(r,e,t,i,n){return r=32767*(r-t)*n,e=32767*(e-i)*n,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function $1(r){let e=r,t=r;do(e.x=0&&(r-o)*(i-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(i-a)>=0}function j1(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!X1(r,e)&&(Jr(r,e)&&Jr(e,r)&&Y1(r,e)&&(st(r.prev,r,e.prev)||st(r,e.prev,e))||sl(r,e)&&st(r.prev,r,r.next)>0&&st(e.prev,e,e.next)>0)}function st(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function sl(r,e){return r.x===e.x&&r.y===e.y}function nm(r,e,t,i){let n=wa(st(r,e,t)),s=wa(st(r,e,i)),o=wa(st(t,i,r)),a=wa(st(t,i,e));return!!(n!==s&&o!==a||n===0&&va(r,t,e)||s===0&&va(r,i,e)||o===0&&va(t,r,i)||a===0&&va(t,e,i))}function va(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function wa(r){return r>0?1:r<0?-1:0}function X1(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&nm(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Jr(r,e){return st(r.prev,r,r.next)<0?st(r,e,r.next)>=0&&st(r,r.prev,e)>=0:st(r,e,r.prev)<0||st(r,r.next,e)<0}function Y1(r,e){let t=r,i=!1,n=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function sm(r,e){let t=new Mu(r.i,r.x,r.y),i=new Mu(e.i,e.x,e.y),n=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Mf(r,e,t,i){let n=new Mu(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Kr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Mu(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Z1(r,e,t,i){let n=0;for(let s=e,o=t-i;s2&&r[e-1].equals(r[0])&&r.pop()}function Tf(r,e){for(let t=0;tNumber.EPSILON){let J=Math.sqrt(I),se=Math.sqrt(Ze*Ze+je*je),xe=ie.x-ze/J,Y=ie.y+Re/J,be=te.x-je/se,ve=te.y+Ze/se,he=((be-xe)*je-(ve-Y)*Ze)/(Re*je-ze*Ze);fe=xe+Re*he-Z.x,de=Y+ze*he-Z.y;let le=fe*fe+de*de;if(le<=2)return new ee(fe,de);Se=Math.sqrt(le/2)}else{let J=!1;Re>Number.EPSILON?Ze>Number.EPSILON&&(J=!0):Re<-Number.EPSILON?Ze<-Number.EPSILON&&(J=!0):Math.sign(ze)===Math.sign(je)&&(J=!0),J?(fe=-ze,de=Re,Se=Math.sqrt(I)):(fe=Re,de=ze,Se=Math.sqrt(I/2))}return new ee(fe/Se,de/Se)}let V=[];for(let Z=0,ie=B.length,te=ie-1,fe=Z+1;Z=0;Z--){let ie=Z/x,te=p*Math.cos(ie*Math.PI/2),fe=m*Math.sin(ie*Math.PI/2)+y;for(let de=0,Se=B.length;de=0;){let fe=te,de=te-1;de<0&&(de=Z.length-1);for(let Se=0,Re=u+x*2;Se0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};Tu.prototype.isMeshPhysicalMaterial=!0;var Hs=class extends dt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new ye(16777215),this.specular=new ye(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$s,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=el,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};Hs.prototype.isMeshPhongMaterial=!0;var Cu=class extends dt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ye(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$s,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Cu.prototype.isMeshToonMaterial=!0;var Ru=class extends dt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$s,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Ru.prototype.isMeshNormalMaterial=!0;var Fu=class extends dt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=el,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Fu.prototype.isMeshLambertMaterial=!0;var Lu=class extends dt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ye(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=$s,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}};Lu.prototype.isMeshMatcapMaterial=!0;var Bu=class extends zn{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};Bu.prototype.isLineDashedMaterial=!0;var tt={arraySlice:function(r,e,t){return tt.isTypedArray(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){function e(n,s){return r[n]-r[s]}let t=r.length,i=new Array(t);for(let n=0;n!==t;++n)i[n]=n;return i.sort(e),i},sortedArray:function(r,e,t){let i=r.length,n=new r.constructor(i);for(let s=0,o=0;o!==i;++s){let a=t[s]*e;for(let l=0;l!==e;++l)n[o++]=r[a+l]}return n},flattenJSON:function(r,e,t,i){let n=1,s=r[0];for(;s!==void 0&&s[i]===void 0;)s=r[n++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[n++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[n++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=r[n++];while(s!==void 0)},subclip:function(r,e,t,i,n=30){let s=r.clone();s.name=e;let o=[];for(let l=0;l=i)){h.push(c.times[p]);for(let y=0;ys.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[m]){let g=m*h+u,f=g+h-u;y=tt.arraySlice(a.values,g,f)}else{let g=a.createInterpolant(),f=u,E=h-u;g.evaluate(s),y=tt.arraySlice(g.resultBuffer,f,E)}l==="quaternion"&&new Tt().fromArray(y).normalize().conjugate().toArray(y);let x=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=i,i=0;break i}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==n){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=tt.arraySlice(i,s,o),this.values=tt.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(n!==void 0&&tt.isTypedArray(n))for(let a=0,l=n.length;a!==l;++a){let c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=tt.arraySlice(this.times),t=tt.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===mc,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=tt.arraySlice(e,0,o),this.values=tt.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){let e=tt.arraySlice(this.times,0),t=tt.arraySlice(this.values,0),i=this.constructor,n=new i(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};Zt.prototype.TimeBufferType=Float32Array;Zt.prototype.ValueBufferType=Float32Array;Zt.prototype.DefaultInterpolation=Ma;var yn=class extends Zt{};yn.prototype.ValueTypeName="bool";yn.prototype.ValueBufferType=Array;yn.prototype.DefaultInterpolation=Sa;yn.prototype.InterpolantFactoryMethodLinear=void 0;yn.prototype.InterpolantFactoryMethodSmooth=void 0;var ja=class extends Zt{};ja.prototype.ValueTypeName="color";var Gs=class extends Zt{};Gs.prototype.ValueTypeName="number";var Nu=class extends wi{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(n-t),c=e*a;for(let u=c+a;c!==u;c+=4)Tt.slerpFlat(s,0,o,c-a,o,c,l);return s}},Vn=class extends Zt{InterpolantFactoryMethodLinear(e){return new Nu(this.times,this.values,this.getValueSize(),e)}};Vn.prototype.ValueTypeName="quaternion";Vn.prototype.DefaultInterpolation=Ma;Vn.prototype.InterpolantFactoryMethodSmooth=void 0;var xn=class extends Zt{};xn.prototype.ValueTypeName="string";xn.prototype.ValueBufferType=Array;xn.prototype.DefaultInterpolation=Sa;xn.prototype.InterpolantFactoryMethodLinear=void 0;xn.prototype.InterpolantFactoryMethodSmooth=void 0;var qs=class extends Zt{};qs.prototype.ValueTypeName="vector";var Xa=class{constructor(e,t=-1,i,n=ph){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=ri(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(t_(i[o]).scale(n));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Zt.toJSON(i[s]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=n[h];d||(n[h]=d=[]),d.push(c)}}let o=[];for(let a in n)o.push(this.CreateFromMorphTargetSequence(a,n[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(h,d,p,m,y){if(p.length!==0){let x=[],g=[];tt.flattenJSON(p,x,g,m),x.length!==0&&y.push(new h(d,x,g))}},n=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Oi[e]!==void 0){Oi[e].push({onLoad:t,onProgress:i,onError:n});return}Oi[e]=[],Oi[e].push({onLoad:t,onProgress:i,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body.getReader===void 0)return c;let u=Oi[e],h=c.body.getReader(),d=c.headers.get("Content-Length"),p=d?parseInt(d):0,m=p!==0,y=0,x=new ReadableStream({start(g){f();function f(){h.read().then(({done:E,value:w})=>{if(E)g.close();else{y+=w.byteLength;let _=new ProgressEvent("progress",{lengthComputable:m,loaded:y,total:p});for(let D=0,T=u.length;D{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{let h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,p=new TextDecoder(d);return c.arrayBuffer().then(m=>p.decode(m))}}}).then(c=>{Ws.add(e,c);let u=Oi[e];delete Oi[e];for(let h=0,d=u.length;h{let u=Oi[e];if(u===void 0)throw this.manager.itemError(e),c;delete Oi[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Ya=class extends bi{constructor(e){super(e)}load(e,t,i,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=Ws.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a=Lr("img");function l(){u(),Ws.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(h){u(),n&&n(h),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}},Ou=class extends bi{constructor(e){super(e)}load(e,t,i,n){let s=new Is,o=new Ya(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(u){s.images[c]=u,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,n)}for(let c=0;c"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=Ws.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){Ws.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){n&&n(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};ju.prototype.isImageBitmapLoader=!0;var ba,n_={getContext:function(){return ba===void 0&&(ba=new(window.AudioContext||window.webkitAudioContext)),ba},setContext:function(r){ba=r}},Xu=class extends bi{constructor(e){super(e)}load(e,t,i,n){let s=this,o=new zu(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{let l=a.slice(0);n_.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},i,n)}},Yu=class extends no{constructor(e,t,i=1){super(void 0,i);let n=new ye().set(e),s=new ye().set(t),o=new P(n.r,n.g,n.b),a=new P(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}};Yu.prototype.isHemisphereLightProbe=!0;var Zu=class extends no{constructor(e,t=1){super(void 0,t);let i=new ye().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}};Zu.prototype.isAmbientLightProbe=!0;var Ju=class extends Ge{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let s=i,o=n;s!==o;++s)t[s]=t[n+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,n){Tt.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,s){let o=this._workIndex*s;Tt.multiplyQuaternionsFlat(e,o,e,t,e,i),Tt.slerpFlat(e,t,e,t,e,o,n)}_lerp(e,t,i,n,s){let o=1-n;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[i+a]*n}}_lerpAdditive(e,t,i,n,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[i+o]*n}}},gh="\\[\\]\\.:\\/",s_=new RegExp("["+gh+"]","g"),yh="[^"+gh+"]",r_="[^"+gh.replace("\\.","")+"]",o_=/((?:WC+[\/:])*)/.source.replace("WC",yh),a_=/(WCOD+)?/.source.replace("WCOD",r_),l_=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",yh),c_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",yh),u_=new RegExp("^"+o_+a_+l_+c_+"$"),h_=["material","materials","bones"],eh=class{constructor(e,t,i){let n=i||Xe.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];n!==void 0&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},Xe=class r{constructor(e,t,i){this.path=t,this.parsedPath=i||r.parseTrackName(t),this.node=r.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new r.Composite(e,t,i):new r(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(s_,"")}static parseTrackName(e){let t=u_.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=i.nodeName.substring(n+1);h_.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){let i=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let p=0,m=n;p!==m;++p){let y=i[p],x=y[h],g=y[u];y[u]=x,y[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[p.uuid]=h),e[h]=p,e.pop();for(let m=0,y=n;m!==y;++m){let x=i[m];x[h]=x[d],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let i=this._bindingsIndicesByPath,n=i[e],s=this._bindings;if(n!==void 0)return s[n];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);n=s.length,i[e]=n,o.push(e),a.push(t),s.push(h);for(let d=u,p=l.length;d!==p;++d){let m=l[d];h[d]=new Xe(m,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){let n=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),n[i]=n[a],n.pop()}}};th.prototype.isAnimationObjectGroup=!0;var ih=class{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:As,endingEnd:As};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Vx,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){let n=this._clip.duration,s=e._clip.duration,o=s/n,a=n/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){let n=this._mixer,s=n.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,n){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*i;if(l<0||i===0)return;this._startTime=null,t=i*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Vf:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case ph:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(n,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(i!==null){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),n===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;if(i!==null){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,n=this.time+e,s=this._loopCount,o=i===Ux;if(e===0)return s===-1?n:o&&(s&1)===1?t-n:n;if(i===Ox){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else if(n<0)n=0;else{this.time=n;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),n>=t||n<0){let a=Math.floor(n/t);n-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&(s&1)===1)return t-n}return n}_setEndings(e,t,i){let n=this._interpolantSettings;i?(n.endingStart=Ss,n.endingEnd=Ss):(e?n.endingStart=this.zeroSlopeAtStart?Ss:As:n.endingStart=Da,t?n.endingEnd=this.zeroSlopeAtEnd?Ss:As:n.endingEnd=Da)}_scheduleFading(e,t,i){let n=this._mixer,s=n.time,o=this._weightInterpolant;o===null&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}},nh=class extends Vi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let i=e._localRoot||this._root,n=e._clip.tracks,s=n.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=n[h],p=d.name,m=u[p];if(m!==void 0)++m.referenceCount,o[h]=m;else{if(m=o[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,l,p));continue}let y=t&&t._propertyBindings[h].binding.parsedPath;m=new Qu(Xe.create(i,p,y),d.ValueTypeName,d.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,p),o[h]=m}a[h].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let i=(e._localRoot||this._root).uuid,n=e._clip.uuid,s=this._actionsByClip[n];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,n,i)}let t=e._propertyBindings;for(let i=0,n=t.length;i!==n;++i){let s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let i=0,n=t.length;i!==n;++i){let s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,n=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(n,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Bf.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};Un.prototype.isBox2=!0;var Pf=new P,_a=new P,ah=class{constructor(e=new P,t=new P){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Pf.subVectors(e,this.start),_a.subVectors(this.end,this.start);let i=_a.dot(_a),s=_a.dot(Pf)/i;return t&&(s=kt(s,0,1)),s}closestPointToPoint(e,t,i){let n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};var an=new P,Ea=new Ee,Yc=new Ee,lh=class extends Wr{constructor(e){let t=rm(e),i=new Ke,n=[],s=[],o=new ye(0,0,1),a=new ye(0,1,0);for(let c=0;c=0&&u=0&&c!==l+1?a.unshift([s,c],[o,u]):a.push([s,c],[o,u]),l=c)}a.length===4&&i.push([i[a[0][0]][a[0][1]],i[a[1][0]][a[1][1]],i[a[3][0]][a[3][1]],i[a[2][0]][a[2][1]],-1])}for(let s=0;s=0&&u<4){--u===-1&&(u=3);let h=i[c][u];if(o.indexOf(h)>=0){a.push(h);break}}}--l}a.push(-1),i.push(a)}return{vectors:t,faces:i}}makeGeometry(e,t){let i=new Ke;for(let h=0;h1&&(a=a/c.length,o.font=`${a}pt '${this.fontFace}'`,l=o.measureText("M").width*1.2,n-=l*c.length/2);for(let h=0,d=c.length;hu||n.y>u)&&(n.x>u&&(s.x=Math.floor(u/L.x),n.x=s.x*L.x,B.mapSize.x=s.x),n.y>u&&(s.y=Math.floor(u/L.y),n.y=s.y*L.y,B.mapSize.y=s.y)),B.map===null&&!B.isPointLightShadow&&this.type===Tr){let N={minFilter:Ft,magFilter:Ft,format:Nt};B.map=new Ht(n.x,n.y,N),B.map.texture.name=S.name+".shadowMap",B.mapPass=new Ht(n.x,n.y,N),B.camera.updateProjectionMatrix()}if(B.map===null){let N={minFilter:vt,magFilter:vt,format:Nt};B.map=new Ht(n.x,n.y,N),B.map.texture.name=S.name+".shadowMap",B.camera.updateProjectionMatrix()}r.setRenderTarget(B.map),r.clear();let C=B.getViewportCount();for(let N=0;N0){let S=v.uuid,B=M.uuid,L=c[S];L===void 0&&(L={},c[S]=L);let C=L[B];C===void 0&&(C=v.clone(),L[B]=C),v=C}return v.visible=M.visible,v.wireframe=M.wireframe,A===Tr?v.side=M.shadowSide!==null?M.shadowSide:M.side:v.side=M.shadowSide!==null?M.shadowSide:h[M.side],v.alphaMap=M.alphaMap,v.alphaTest=M.alphaTest,v.clipShadows=M.clipShadows,v.clippingPlanes=M.clippingPlanes,v.clipIntersection=M.clipIntersection,v.displacementMap=M.displacementMap,v.displacementScale=M.displacementScale,v.displacementBias=M.displacementBias,v.wireframeLinewidth=M.wireframeLinewidth,v.linewidth=M.linewidth,T.isPointLight===!0&&v.isMeshDistanceMaterial===!0&&(v.referencePosition.setFromMatrixPosition(T.matrixWorld),v.nearDistance=z,v.farDistance=W),v}function E(w,_,M,T,z){if(w.visible===!1)return;if(w.layers.test(_.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&z===Tr)&&(!w.frustumCulled||i.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,w.matrixWorld);let v=e.update(w),R=w.material;if(Array.isArray(R)){let S=v.groups;for(let B=0,L=S.length;B=1):C.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(C)[1]),B=L>=2);let N=null,k={},V=r.getParameter(3088),U=r.getParameter(2978),q=new $e().fromArray(V),j=new $e().fromArray(U);function ne(O,ge,pe){let Me=new Uint8Array(4),K=r.createTexture();r.bindTexture(O,K),r.texParameteri(O,10241,9728),r.texParameteri(O,10240,9728);for(let _e=0;_ese||I.height>se)&&(xe=se/Math.max(I.width,I.height)),xe<1||D===!0)if(typeof HTMLImageElement<"u"&&I instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&I instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&I instanceof ImageBitmap){let Y=D?bv:Math.floor,be=Y(xe*I.width),ve=Y(xe*I.height);y===void 0&&(y=g(be,ve));let he=J?g(be,ve):y;return he.width=be,he.height=ve,he.getContext("2d").drawImage(I,0,0,be,ve),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+I.width+"x"+I.height+") to ("+be+"x"+ve+")."),he}else return"data"in I&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+I.width+"x"+I.height+")."),I;return I}function E(I){return Qp(I.width)&&Qp(I.height)}function w(I){return a?!1:I.wrapS!==Kt||I.wrapT!==Kt||I.minFilter!==vt&&I.minFilter!==Ft}function _(I,D){return I.generateMipmaps&&D&&I.minFilter!==vt&&I.minFilter!==Ft}function M(I){r.generateMipmap(I)}function T(I,D,J,se,xe=!1){if(a===!1)return D;if(I!==null){if(r[I]!==void 0)return r[I];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+I+"'")}let Y=D;return D===6403&&(J===5126&&(Y=33326),J===5131&&(Y=33325),J===5121&&(Y=33321)),D===33319&&(J===5126&&(Y=33328),J===5131&&(Y=33327),J===5121&&(Y=33323)),D===6408&&(J===5126&&(Y=34836),J===5131&&(Y=34842),J===5121&&(Y=se===tt&&xe===!1?35907:32856),J===32819&&(Y=32854),J===32820&&(Y=32855)),(Y===33325||Y===33326||Y===33327||Y===33328||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function z(I,D,J){return _(I,J)===!0||I.isFramebufferTexture&&I.minFilter!==vt&&I.minFilter!==Ft?Math.log2(Math.max(D.width,D.height))+1:I.mipmaps!==void 0&&I.mipmaps.length>0?I.mipmaps.length:I.isCompressedTexture&&Array.isArray(I.image)?D.mipmaps.length:1}function W(I){return I===vt||I===Cp||I===Rp?9728:9729}function A(I){let D=I.target;D.removeEventListener("dispose",A),R(D),D.isVideoTexture&&m.delete(D),o.memory.textures--}function v(I){let D=I.target;D.removeEventListener("dispose",v),S(D)}function R(I){let D=i.get(I);D.__webglInit!==void 0&&(r.deleteTexture(D.__webglTexture),i.remove(I))}function S(I){let D=I.texture,J=i.get(I),se=i.get(D);if(I){if(se.__webglTexture!==void 0&&(r.deleteTexture(se.__webglTexture),o.memory.textures--),I.depthTexture&&I.depthTexture.dispose(),I.isWebGLCubeRenderTarget)for(let xe=0;xe<6;xe++)r.deleteFramebuffer(J.__webglFramebuffer[xe]),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer[xe]);else r.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&r.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&r.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer&&r.deleteRenderbuffer(J.__webglColorRenderbuffer),J.__webglDepthRenderbuffer&&r.deleteRenderbuffer(J.__webglDepthRenderbuffer);if(I.isWebGLMultipleRenderTargets)for(let xe=0,Y=D.length;xe=l&&console.warn("THREE.WebGLTextures: Trying to use "+I+" texture units while this GPU supports only "+l),B+=1,I}function N(I,D){let J=i.get(I);if(I.isVideoTexture&&de(I),I.version>0&&J.__version!==I.version){let se=I.image;if(se===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{H(J,I,D);return}}t.activeTexture(33984+D),t.bindTexture(3553,J.__webglTexture)}function k(I,D){let J=i.get(I);if(I.version>0&&J.__version!==I.version){H(J,I,D);return}t.activeTexture(33984+D),t.bindTexture(35866,J.__webglTexture)}function V(I,D){let J=i.get(I);if(I.version>0&&J.__version!==I.version){H(J,I,D);return}t.activeTexture(33984+D),t.bindTexture(32879,J.__webglTexture)}function U(I,D){let J=i.get(I);if(I.version>0&&J.__version!==I.version){Te(J,I,D);return}t.activeTexture(33984+D),t.bindTexture(34067,J.__webglTexture)}let q={[bu]:10497,[Kt]:33071,[_u]:33648},j={[vt]:9728,[Cp]:9984,[Rp]:9986,[Ft]:9729,[Zx]:9985,[sl]:9987};function ne(I,D,J){if(J?(r.texParameteri(I,10242,q[D.wrapS]),r.texParameteri(I,10243,q[D.wrapT]),(I===32879||I===35866)&&r.texParameteri(I,32882,q[D.wrapR]),r.texParameteri(I,10240,j[D.magFilter]),r.texParameteri(I,10241,j[D.minFilter])):(r.texParameteri(I,10242,33071),r.texParameteri(I,10243,33071),(I===32879||I===35866)&&r.texParameteri(I,32882,33071),(D.wrapS!==Kt||D.wrapT!==Kt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(I,10240,W(D.magFilter)),r.texParameteri(I,10241,W(D.minFilter)),D.minFilter!==vt&&D.minFilter!==Ft&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){let se=e.get("EXT_texture_filter_anisotropic");if(D.type===Vn&&e.has("OES_texture_float_linear")===!1||a===!1&&D.type===Cs&&e.has("OES_texture_half_float_linear")===!1)return;(D.anisotropy>1||i.get(D).__currentAnisotropy)&&(r.texParameterf(I,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(D.anisotropy,n.getMaxAnisotropy())),i.get(D).__currentAnisotropy=D.anisotropy)}}function ae(I,D){I.__webglInit===void 0&&(I.__webglInit=!0,D.addEventListener("dispose",A),I.__webglTexture=r.createTexture(),o.memory.textures++)}function H(I,D,J){let se=3553;D.isDataTexture2DArray&&(se=35866),D.isDataTexture3D&&(se=32879),ae(I,D),t.activeTexture(33984+J),t.bindTexture(se,I.__webglTexture),r.pixelStorei(37440,D.flipY),r.pixelStorei(37441,D.premultiplyAlpha),r.pixelStorei(3317,D.unpackAlignment),r.pixelStorei(37443,0);let xe=w(D)&&E(D.image)===!1,Y=f(D.image,xe,!1,u);Y=Se(D,Y);let be=E(Y)||a,ve=s.convert(D.format,D.encoding),he=s.convert(D.type),le=T(D.internalFormat,ve,he,D.encoding,D.isVideoTexture);ne(se,D,be);let Le,O=D.mipmaps,ge=a&&D.isVideoTexture!==!0,pe=I.__version===void 0,Me=z(D,Y,be);if(D.isDepthTexture)le=6402,a?D.type===Vn?le=36012:D.type===Ma?le=33190:D.type===Rs?le=35056:le=33189:D.type===Vn&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),D.format===Hn&&le===6402&&D.type!==Ir&&D.type!==Ma&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),D.type=Ir,he=s.convert(D.type)),D.format===Ps&&le===6402&&(le=34041,D.type!==Rs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),D.type=Rs,he=s.convert(D.type))),ge&&pe?t.texStorage2D(3553,1,le,Y.width,Y.height):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,null);else if(D.isDataTexture)if(O.length>0&&be){ge&&pe&&t.texStorage2D(3553,Me,le,O[0].width,O[0].height);for(let K=0,_e=O.length;K<_e;K++)Le=O[K],ge?t.texSubImage2D(3553,0,0,0,Le.width,Le.height,ve,he,Le.data):t.texImage2D(3553,K,le,Le.width,Le.height,0,ve,he,Le.data);D.generateMipmaps=!1}else ge?(pe&&t.texStorage2D(3553,Me,le,Y.width,Y.height),t.texSubImage2D(3553,0,0,0,Y.width,Y.height,ve,he,Y.data)):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,Y.data);else if(D.isCompressedTexture){ge&&pe&&t.texStorage2D(3553,Me,le,O[0].width,O[0].height);for(let K=0,_e=O.length;K<_e;K++)Le=O[K],D.format!==Nt?ve!==null?ge?t.compressedTexSubImage2D(3553,K,0,0,Le.width,Le.height,ve,Le.data):t.compressedTexImage2D(3553,K,le,Le.width,Le.height,0,Le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ge?t.texSubImage2D(3553,K,0,0,Le.width,Le.height,ve,he,Le.data):t.texImage2D(3553,K,le,Le.width,Le.height,0,ve,he,Le.data)}else if(D.isDataTexture2DArray)ge?(pe&&t.texStorage3D(35866,Me,le,Y.width,Y.height,Y.depth),t.texSubImage3D(35866,0,0,0,0,Y.width,Y.height,Y.depth,ve,he,Y.data)):t.texImage3D(35866,0,le,Y.width,Y.height,Y.depth,0,ve,he,Y.data);else if(D.isDataTexture3D)ge?(pe&&t.texStorage3D(32879,Me,le,Y.width,Y.height,Y.depth),t.texSubImage3D(32879,0,0,0,0,Y.width,Y.height,Y.depth,ve,he,Y.data)):t.texImage3D(32879,0,le,Y.width,Y.height,Y.depth,0,ve,he,Y.data);else if(D.isFramebufferTexture)ge&&pe?t.texStorage2D(3553,Me,le,Y.width,Y.height):t.texImage2D(3553,0,le,Y.width,Y.height,0,ve,he,null);else if(O.length>0&&be){ge&&pe&&t.texStorage2D(3553,Me,le,O[0].width,O[0].height);for(let K=0,_e=O.length;K<_e;K++)Le=O[K],ge?t.texSubImage2D(3553,K,0,0,ve,he,Le):t.texImage2D(3553,K,le,ve,he,Le);D.generateMipmaps=!1}else ge?(pe&&t.texStorage2D(3553,Me,le,Y.width,Y.height),t.texSubImage2D(3553,0,0,0,ve,he,Y)):t.texImage2D(3553,0,le,ve,he,Y);_(D,be)&&M(se),I.__version=D.version,D.onUpdate&&D.onUpdate(D)}function Te(I,D,J){if(D.image.length!==6)return;ae(I,D),t.activeTexture(33984+J),t.bindTexture(34067,I.__webglTexture),r.pixelStorei(37440,D.flipY),r.pixelStorei(37441,D.premultiplyAlpha),r.pixelStorei(3317,D.unpackAlignment),r.pixelStorei(37443,0);let se=D&&(D.isCompressedTexture||D.image[0].isCompressedTexture),xe=D.image[0]&&D.image[0].isDataTexture,Y=[];for(let K=0;K<6;K++)!se&&!xe?Y[K]=f(D.image[K],!1,!0,c):Y[K]=xe?D.image[K].image:D.image[K],Y[K]=Se(D,Y[K]);let be=Y[0],ve=E(be)||a,he=s.convert(D.format,D.encoding),le=s.convert(D.type),Le=T(D.internalFormat,he,le,D.encoding),O=a&&D.isVideoTexture!==!0,ge=I.__version===void 0,pe=z(D,be,ve);ne(34067,D,ve);let Me;if(se){O&&ge&&t.texStorage2D(34067,pe,Le,be.width,be.height);for(let K=0;K<6;K++){Me=Y[K].mipmaps;for(let _e=0;_e0&&pe++,t.texStorage2D(34067,pe,Le,Y[0].width,Y[0].height));for(let K=0;K<6;K++)if(xe){O?t.texSubImage2D(34069+K,0,0,0,Y[K].width,Y[K].height,he,le,Y[K].data):t.texImage2D(34069+K,0,Le,Y[K].width,Y[K].height,0,he,le,Y[K].data);for(let _e=0;_ep+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=p-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));return a!==null&&(a.visible=n!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}},$r=class extends lt{constructor(e,t,i,n,s,o,a,l,c,u){if(u=u!==void 0?u:Hn,u!==Hn&&u!==Ps)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&u===Hn&&(i=Ir),i===void 0&&u===Ps&&(i=Rs),super(null,n,s,o,a,l,u,i,c),this.image={width:e,height:t},this.magFilter=a!==void 0?a:vt,this.minFilter=l!==void 0?l:vt,this.flipY=!1,this.generateMipmaps=!1}};$r.prototype.isDepthTexture=!0;var Ru=class extends Xi{constructor(e,t){super();let i=this,n=null,s=1,o=null,a="local-floor",l=e.extensions.has("WEBGL_multisampled_render_to_texture"),c=null,u=null,h=null,d=null,p=!1,m=null,y=t.getContextAttributes(),x=null,g=null,f=[],E=new Map,w=new Et;w.layers.enable(1),w.viewport=new $e;let _=new Et;_.layers.enable(2),_.viewport=new $e;let M=[w,_],T=new za;T.layers.enable(1),T.layers.enable(2);let z=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(U){let q=f[U];return q===void 0&&(q=new Fr,f[U]=q),q.getTargetRaySpace()},this.getControllerGrip=function(U){let q=f[U];return q===void 0&&(q=new Fr,f[U]=q),q.getGripSpace()},this.getHand=function(U){let q=f[U];return q===void 0&&(q=new Fr,f[U]=q),q.getHandSpace()};function A(U){let q=E.get(U.inputSource);q&&q.dispatchEvent({type:U.type,data:U.inputSource})}function v(){E.forEach(function(U,q){U.disconnect(q)}),E.clear(),z=null,W=null,e.setRenderTarget(x),d=null,h=null,u=null,n=null,g=null,V.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(U){s=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(U){a=U,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getBaseLayer=function(){return h!==null?h:d},this.getBinding=function(){return u},this.getFrame=function(){return m},this.getSession=function(){return n},this.setSession=async function(U){if(n=U,n!==null){if(x=e.getRenderTarget(),n.addEventListener("select",A),n.addEventListener("selectstart",A),n.addEventListener("selectend",A),n.addEventListener("squeeze",A),n.addEventListener("squeezestart",A),n.addEventListener("squeezeend",A),n.addEventListener("end",v),n.addEventListener("inputsourceschange",R),y.xrCompatible!==!0&&await t.makeXRCompatible(),n.renderState.layers===void 0||e.capabilities.isWebGL2===!1){let q={antialias:n.renderState.layers===void 0?y.antialias:!0,alpha:y.alpha,depth:y.depth,stencil:y.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(n,t,q),n.updateRenderState({baseLayer:d}),g=new Ht(d.framebufferWidth,d.framebufferHeight,{format:Nt,type:yn,encoding:e.outputEncoding})}else{p=y.antialias;let q=null,j=null,ne=null;y.depth&&(ne=y.stencil?35056:33190,q=y.stencil?Ps:Hn,j=y.stencil?Rs:Ir);let ae={colorFormat:e.outputEncoding===tt?35907:32856,depthFormat:ne,scaleFactor:s};u=new XRWebGLBinding(n,t),h=u.createProjectionLayer(ae),n.updateRenderState({layers:[h]}),p?g=new Or(h.textureWidth,h.textureHeight,{format:Nt,type:yn,depthTexture:new $r(h.textureWidth,h.textureHeight,j,void 0,void 0,void 0,void 0,void 0,void 0,q),stencilBuffer:y.stencil,ignoreDepth:h.ignoreDepthValues,useRenderToTexture:l,encoding:e.outputEncoding}):g=new Ht(h.textureWidth,h.textureHeight,{format:Nt,type:yn,depthTexture:new $r(h.textureWidth,h.textureHeight,j,void 0,void 0,void 0,void 0,void 0,void 0,q),stencilBuffer:y.stencil,ignoreDepth:h.ignoreDepthValues,encoding:e.outputEncoding})}g.isXRRenderTarget=!0,this.setFoveation(1),o=await n.requestReferenceSpace(a),V.setContext(n),V.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function R(U){let q=n.inputSources;for(let j=0;j0&&(g.alphaTest.value=f.alphaTest);let E=r.get(f).envMap;E&&(g.envMap.value=E,g.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=f.reflectivity,g.ior.value=f.ior,g.refractionRatio.value=f.refractionRatio),f.lightMap&&(g.lightMap.value=f.lightMap,g.lightMapIntensity.value=f.lightMapIntensity),f.aoMap&&(g.aoMap.value=f.aoMap,g.aoMapIntensity.value=f.aoMapIntensity);let w;f.map?w=f.map:f.specularMap?w=f.specularMap:f.displacementMap?w=f.displacementMap:f.normalMap?w=f.normalMap:f.bumpMap?w=f.bumpMap:f.roughnessMap?w=f.roughnessMap:f.metalnessMap?w=f.metalnessMap:f.alphaMap?w=f.alphaMap:f.emissiveMap?w=f.emissiveMap:f.clearcoatMap?w=f.clearcoatMap:f.clearcoatNormalMap?w=f.clearcoatNormalMap:f.clearcoatRoughnessMap?w=f.clearcoatRoughnessMap:f.specularIntensityMap?w=f.specularIntensityMap:f.specularColorMap?w=f.specularColorMap:f.transmissionMap?w=f.transmissionMap:f.thicknessMap?w=f.thicknessMap:f.sheenColorMap?w=f.sheenColorMap:f.sheenRoughnessMap&&(w=f.sheenRoughnessMap),w!==void 0&&(w.isWebGLRenderTarget&&(w=w.texture),w.matrixAutoUpdate===!0&&w.updateMatrix(),g.uvTransform.value.copy(w.matrix));let _;f.aoMap?_=f.aoMap:f.lightMap&&(_=f.lightMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),g.uv2Transform.value.copy(_.matrix))}function n(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity}function s(g,f){g.dashSize.value=f.dashSize,g.totalSize.value=f.dashSize+f.gapSize,g.scale.value=f.scale}function o(g,f,E,w){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.size.value=f.size*E,g.scale.value=w*.5,f.map&&(g.map.value=f.map),f.alphaMap&&(g.alphaMap.value=f.alphaMap),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);let _;f.map?_=f.map:f.alphaMap&&(_=f.alphaMap),_!==void 0&&(_.matrixAutoUpdate===!0&&_.updateMatrix(),g.uvTransform.value.copy(_.matrix))}function a(g,f){g.diffuse.value.copy(f.color),g.opacity.value=f.opacity,g.rotation.value=f.rotation,f.map&&(g.map.value=f.map),f.alphaMap&&(g.alphaMap.value=f.alphaMap),f.alphaTest>0&&(g.alphaTest.value=f.alphaTest);let E;f.map?E=f.map:f.alphaMap&&(E=f.alphaMap),E!==void 0&&(E.matrixAutoUpdate===!0&&E.updateMatrix(),g.uvTransform.value.copy(E.matrix))}function l(g,f){f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap)}function c(g,f){g.specular.value.copy(f.specular),g.shininess.value=Math.max(f.shininess,1e-4),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===xt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===xt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function u(g,f){f.gradientMap&&(g.gradientMap.value=f.gradientMap),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===xt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===xt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function h(g,f){g.roughness.value=f.roughness,g.metalness.value=f.metalness,f.roughnessMap&&(g.roughnessMap.value=f.roughnessMap),f.metalnessMap&&(g.metalnessMap.value=f.metalnessMap),f.emissiveMap&&(g.emissiveMap.value=f.emissiveMap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===xt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===xt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),r.get(f).envMap&&(g.envMapIntensity.value=f.envMapIntensity)}function d(g,f,E){h(g,f),g.ior.value=f.ior,f.sheen>0&&(g.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen),g.sheenRoughness.value=f.sheenRoughness,f.sheenColorMap&&(g.sheenColorMap.value=f.sheenColorMap),f.sheenRoughnessMap&&(g.sheenRoughnessMap.value=f.sheenRoughnessMap)),f.clearcoat>0&&(g.clearcoat.value=f.clearcoat,g.clearcoatRoughness.value=f.clearcoatRoughness,f.clearcoatMap&&(g.clearcoatMap.value=f.clearcoatMap),f.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=f.clearcoatRoughnessMap),f.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(f.clearcoatNormalScale),g.clearcoatNormalMap.value=f.clearcoatNormalMap,f.side===xt&&g.clearcoatNormalScale.value.negate())),f.transmission>0&&(g.transmission.value=f.transmission,g.transmissionSamplerMap.value=E.texture,g.transmissionSamplerSize.value.set(E.width,E.height),f.transmissionMap&&(g.transmissionMap.value=f.transmissionMap),g.thickness.value=f.thickness,f.thicknessMap&&(g.thicknessMap.value=f.thicknessMap),g.attenuationDistance.value=f.attenuationDistance,g.attenuationColor.value.copy(f.attenuationColor)),g.specularIntensity.value=f.specularIntensity,g.specularColor.value.copy(f.specularColor),f.specularIntensityMap&&(g.specularIntensityMap.value=f.specularIntensityMap),f.specularColorMap&&(g.specularColorMap.value=f.specularColorMap)}function p(g,f){f.matcap&&(g.matcap.value=f.matcap),f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===xt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===xt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function m(g,f){f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}function y(g,f){f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias),g.referencePosition.value.copy(f.referencePosition),g.nearDistance.value=f.nearDistance,g.farDistance.value=f.farDistance}function x(g,f){f.bumpMap&&(g.bumpMap.value=f.bumpMap,g.bumpScale.value=f.bumpScale,f.side===xt&&(g.bumpScale.value*=-1)),f.normalMap&&(g.normalMap.value=f.normalMap,g.normalScale.value.copy(f.normalScale),f.side===xt&&g.normalScale.value.negate()),f.displacementMap&&(g.displacementMap.value=f.displacementMap,g.displacementScale.value=f.displacementScale,g.displacementBias.value=f.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function K1(){let r=kr("canvas");return r.style.display="block",r}function qe(r={}){let e=r.canvas!==void 0?r.canvas:K1(),t=r.context!==void 0?r.context:null,i=r.alpha!==void 0?r.alpha:!1,n=r.depth!==void 0?r.depth:!0,s=r.stencil!==void 0?r.stencil:!0,o=r.antialias!==void 0?r.antialias:!1,a=r.premultipliedAlpha!==void 0?r.premultipliedAlpha:!0,l=r.preserveDrawingBuffer!==void 0?r.preserveDrawingBuffer:!1,c=r.powerPreference!==void 0?r.powerPreference:"default",u=r.failIfMajorPerformanceCaveat!==void 0?r.failIfMajorPerformanceCaveat:!1,h=null,d=null,p=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=bn,this.physicallyCorrectLights=!1,this.toneMapping=gn,this.toneMappingExposure=1;let y=this,x=!1,g=0,f=0,E=null,w=-1,_=null,M=new $e,T=new $e,z=null,W=e.width,A=e.height,v=1,R=null,S=null,B=new $e(0,0,W,A),L=new $e(0,0,W,A),C=!1,N=new Os,k=!1,V=!1,U=null,q=new Ee,j=new P,ne={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return E===null?v:1}let H=t;function Te(F,G){for(let X=0;X0?d=m[m.length-1]:d=null,p.pop(),p.length>0?h=p[p.length-1]:h=null};function ot(F,G,X,$){if(F.visible===!1)return;if(F.layers.test(G.layers)){if(F.isGroup)X=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(G);else if(F.isLight)d.pushLight(F),F.castShadow&&d.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||N.intersectsSprite(F)){$&&j.setFromMatrixPosition(F.matrixWorld).applyMatrix4(q);let Be=Se.update(F),Ie=F.material;Ie.visible&&h.push(F,Be,Ie,X,j.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(F.isSkinnedMesh&&F.skeleton.frame!==Ce.render.frame&&(F.skeleton.update(),F.skeleton.frame=Ce.render.frame),!F.frustumCulled||N.intersectsObject(F))){$&&j.setFromMatrixPosition(F.matrixWorld).applyMatrix4(q);let Be=Se.update(F),Ie=F.material;if(Array.isArray(Ie)){let Pe=Be.groups;for(let We=0,ze=Pe.length;We0&&Pi(Q,G,X),$&&oe.viewport(M.copy($)),Q.length>0&&Fo(Q,G,X),Fe.length>0&&Fo(Fe,G,X),Be.length>0&&Fo(Be,G,X)}function Pi(F,G,X){if(U===null){let Be=o===!0&&we.isWebGL2===!0?Or:Ht;U=new Be(1024,1024,{generateMipmaps:!0,type:be.convert(Cs)!==null?Cs:yn,minFilter:sl,magFilter:vt,wrapS:Kt,wrapT:Kt,useRenderToTexture:ue.has("WEBGL_multisampled_render_to_texture")})}let $=y.getRenderTarget();y.setRenderTarget(U),y.clear();let Q=y.toneMapping;y.toneMapping=gn,Fo(F,G,X),y.toneMapping=Q,Z.updateMultisampleRenderTarget(U),Z.updateRenderTargetMipmap(U),y.setRenderTarget($)}function Fo(F,G,X){let $=G.isScene===!0?G.overrideMaterial:null;for(let Q=0,Fe=F.length;Q=0&&G<=F.width-$&&X>=0&&X<=F.height-Q&&H.readPixels(G,X,$,Q,be.convert(We),be.convert(ze),Fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let Pe=E!==null?Ae.get(E).__webglFramebuffer:null;oe.bindFramebuffer(36160,Pe)}}},this.copyFramebufferToTexture=function(F,G,X=0){if(G.isFramebufferTexture!==!0){console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");return}let $=Math.pow(2,-X),Q=Math.floor(G.image.width*$),Fe=Math.floor(G.image.height*$);Z.setTexture2D(G,0),H.copyTexSubImage2D(3553,X,0,0,F.x,F.y,Q,Fe),oe.unbindTexture()},this.copyTextureToTexture=function(F,G,X,$=0){let Q=G.image.width,Fe=G.image.height,Be=be.convert(X.format),Ie=be.convert(X.type);Z.setTexture2D(X,0),H.pixelStorei(37440,X.flipY),H.pixelStorei(37441,X.premultiplyAlpha),H.pixelStorei(3317,X.unpackAlignment),G.isDataTexture?H.texSubImage2D(3553,$,F.x,F.y,Q,Fe,Be,Ie,G.image.data):G.isCompressedTexture?H.compressedTexSubImage2D(3553,$,F.x,F.y,G.mipmaps[0].width,G.mipmaps[0].height,Be,G.mipmaps[0].data):H.texSubImage2D(3553,$,F.x,F.y,Be,Ie,G.image),$===0&&X.generateMipmaps&&H.generateMipmap(3553),oe.unbindTexture()},this.copyTextureToTexture3D=function(F,G,X,$,Q=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let Fe=F.max.x-F.min.x+1,Be=F.max.y-F.min.y+1,Ie=F.max.z-F.min.z+1,Pe=be.convert($.format),We=be.convert($.type),ze;if($.isDataTexture3D)Z.setTexture3D($,0),ze=32879;else if($.isDataTexture2DArray)Z.setTexture2DArray($,0),ze=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(37440,$.flipY),H.pixelStorei(37441,$.premultiplyAlpha),H.pixelStorei(3317,$.unpackAlignment);let Ve=H.getParameter(3314),at=H.getParameter(32878),Bn=H.getParameter(3316),ns=H.getParameter(3315),Ue=H.getParameter(32877),vi=X.isCompressedTexture?X.mipmaps[0]:X.image;H.pixelStorei(3314,vi.width),H.pixelStorei(32878,vi.height),H.pixelStorei(3316,F.min.x),H.pixelStorei(3315,F.min.y),H.pixelStorei(32877,F.min.z),X.isDataTexture||X.isDataTexture3D?H.texSubImage3D(ze,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,We,vi.data):X.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),H.compressedTexSubImage3D(ze,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,vi.data)):H.texSubImage3D(ze,Q,G.x,G.y,G.z,Fe,Be,Ie,Pe,We,vi),H.pixelStorei(3314,Ve),H.pixelStorei(32878,at),H.pixelStorei(3316,Bn),H.pixelStorei(3315,ns),H.pixelStorei(32877,Ue),Q===0&&$.generateMipmaps&&H.generateMipmap(ze),oe.unbindTexture()},this.initTexture=function(F){Z.setTexture2D(F,0),oe.unbindTexture()},this.resetState=function(){g=0,f=0,E=null,oe.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}qe.prototype.isWebGLRenderer=!0;var Fu=class extends qe{};Fu.prototype.isWebGL1Renderer=!0;var Lu=class r{constructor(e,t=25e-5){this.name="",this.color=new ye(e),this.density=t}clone(){return new r(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};Lu.prototype.isFogExp2=!0;var Bu=class r{constructor(e,t=1,i=1e3){this.name="",this.color=new ye(e),this.near=t,this.far=i}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};Bu.prototype.isFog=!0;var Vs=class extends Ge{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}};Vs.prototype.isScene=!0;var Gn=class{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Nr,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=pi()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,s=this.stride;ne.far||t.push({distance:l,point:Er.clone(),uv:Bt.getUV(Er,pa,Sr,fa,Pf,hu,If,new ee),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};Pu.prototype.isSprite=!0;function ma(r,e,t,i,n,s){As.subVectors(r,t).addScalar(.5).multiply(i),n!==void 0?(Ar.x=s*As.x-n*As.y,Ar.y=n*As.x+s*As.y):Ar.copy(As),r.copy(e),r.x+=Ar.x,r.y+=Ar.y,r.applyMatrix4(Am)}var Nf=new P,kf=new $e,Of=new $e,Q1=new P,zf=new Ee,Ua=class extends pt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ee,this.bindMatrixInverse=new Ee}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new $e,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;il)continue;d.applyMatrix4(this.matrixWorld);let z=e.ray.origin.distanceTo(d);ze.far||t.push({distance:z,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,o.start),f=Math.min(x.count,o.start+o.count);for(let E=g,w=f-1;El)continue;d.applyMatrix4(this.matrixWorld);let M=e.ray.origin.distanceTo(d);Me.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:E,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let e=this.geometry;if(e.isBufferGeometry){let t=e.morphAttributes,i=Object.keys(t);if(i.length>0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Yr.prototype.isLine=!0;var Wf=new P,$f=new P,Zr=class extends Yr{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.isBufferGeometry)if(e.index===null){let t=e.attributes.position,i=[];for(let n=0,s=t.count;n0){let n=t[i[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=n.length;s0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};Vu.prototype.isPoints=!0;function Xf(r,e,t,i,n,s,o){let a=zu.distanceSqToPoint(r);if(an.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}var Uu=class extends lt{constructor(e,t,i,n,s,o,a,l,c){super(e,t,i,n,s,o,a,l,c),this.minFilter=o!==void 0?o:Ft,this.magFilter=s!==void 0?s:Ft,this.generateMipmaps=!1;let u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};Uu.prototype.isVideoTexture=!0;var Hu=class extends lt{constructor(e,t,i){super({width:e,height:t}),this.format=i,this.magFilter=vt,this.minFilter=vt,this.generateMipmaps=!1,this.needsUpdate=!0}};Hu.prototype.isFramebufferTexture=!0;var Gu=class extends lt{constructor(e,t,i,n,s,o,a,l,c,u,h,d){super(null,o,a,l,c,u,n,s,h,d),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}};Gu.prototype.isCompressedTexture=!0;var qu=class extends lt{constructor(e,t,i,n,s,o,a,l,c){super(e,t,i,n,s,o,a,l,c),this.needsUpdate=!0}};qu.prototype.isCanvasTexture=!0;var oM=new P,aM=new P,lM=new P,cM=new Bt;var Gt=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){let t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],i,n=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(n),t.push(s),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let i=this.getLengths(),n=0,s=i.length,o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(n=Math.floor(a+(l-a)/2),c=i[n]-o,c<0)a=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,i[n]===o)return n/(s-1);let u=i[n],d=i[n+1]-u,p=(o-u)/d;return(n+p)/(s-1)}getTangent(e,t){let n=e-1e-4,s=e+1e-4;n<0&&(n=0),s>1&&(s=1);let o=this.getPoint(n),a=this.getPoint(s),l=t||(o.isVector2?new ee:new P);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){let i=new P,n=[],s=[],o=[],a=new P,l=new Ee;for(let p=0;p<=e;p++){let m=p/e;n[p]=this.getTangentAt(m,new P)}s[0]=new P,o[0]=new P;let c=Number.MAX_VALUE,u=Math.abs(n[0].x),h=Math.abs(n[0].y),d=Math.abs(n[0].z);u<=c&&(c=u,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),s[0].crossVectors(n[0],a),o[0].crossVectors(n[0],s[0]);for(let p=1;p<=e;p++){if(s[p]=s[p-1].clone(),o[p]=o[p-1].clone(),a.crossVectors(n[p-1],n[p]),a.length()>Number.EPSILON){a.normalize();let m=Math.acos(Ut(n[p-1].dot(n[p]),-1,1));s[p].applyMatrix4(l.makeRotationAxis(a,m))}o[p].crossVectors(n[p],s[p])}if(t===!0){let p=Math.acos(Ut(s[0].dot(s[e]),-1,1));p/=e,n[0].dot(a.crossVectors(s[0],s[e]))>0&&(p=-p);for(let m=1;m<=e;m++)s[m].applyMatrix4(l.makeRotationAxis(n[m],p*m)),o[m].crossVectors(n[m],s[m])}return{tangents:n,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Us=class extends Gt{constructor(e=0,t=0,i=1,n=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){let i=t||new ee,n=Math.PI*2,s=this.aEndAngle-this.aStartAngle,o=Math.abs(s)n;)s-=n;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=n[(a-1)%s]:(wa.subVectors(n[0],n[1]).add(n[0]),c=wa);let h=n[a%s],d=n[(a+1)%s];if(this.closed||a+2n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(Yf(a,l.x,c.x,u.x,h.x),Yf(a,l.y,c.y,u.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){let o=n[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,n=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){let h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);let u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},Wn=class extends eo{constructor(e){super(e),this.uuid=pi(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let i=0,n=this.holes.length;i80*t){a=c=r[0],l=u=r[1];for(let m=t;mc&&(c=h),d>u&&(u=d);p=Math.max(c-a,u-l),p=p!==0?1/p:0}return to(s,o,t,a,l,p),o}};function Mm(r,e,t,i,n){let s,o;if(n===E_(r,e,t,i)>0)for(s=e;s=e;s-=i)o=Zf(s,r[s],r[s+1],o);return o&&ol(o,o.next)&&(no(o),o=o.next),o}function En(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=!1,!t.steiner&&(ol(t,t.next)||rt(t.prev,t,t.next)===0)){if(no(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function to(r,e,t,i,n,s,o){if(!r)return;!o&&s&&y_(r,i,n,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?c_(r,i,n,s):l_(r)){e.push(l.i/t),e.push(r.i/t),e.push(c.i/t),no(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=u_(En(r),e,t),to(r,e,t,i,n,s,2)):o===2&&h_(r,e,t,i,n,s):to(En(r),e,t,i,n,s,1);break}}}function l_(r){let e=r.prev,t=r,i=r.next;if(rt(e,t,i)>=0)return!1;let n=r.next.next;for(;n!==r.prev;){if(Ts(e.x,e.y,t.x,t.y,i.x,i.y,n.x,n.y)&&rt(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function c_(r,e,t,i){let n=r.prev,s=r,o=r.next;if(rt(n,s,o)>=0)return!1;let a=n.xs.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,u=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=ju(a,l,e,t,i),d=ju(c,u,e,t,i),p=r.prevZ,m=r.nextZ;for(;p&&p.z>=h&&m&&m.z<=d;){if(p!==r.prev&&p!==r.next&&Ts(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&rt(p.prev,p,p.next)>=0||(p=p.prevZ,m!==r.prev&&m!==r.next&&Ts(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&rt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=h;){if(p!==r.prev&&p!==r.next&&Ts(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&rt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==r.prev&&m!==r.next&&Ts(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&rt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function u_(r,e,t){let i=r;do{let n=i.prev,s=i.next.next;!ol(n,s)&&Dm(n,i,i.next,s)&&io(n,s)&&io(s,n)&&(e.push(n.i/t),e.push(i.i/t),e.push(s.i/t),no(i),no(i.next),i=r=s),i=i.next}while(i!==r);return En(i)}function h_(r,e,t,i,n,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&w_(o,a)){let l=Tm(o,a);o=En(o,o.next),l=En(l,l.next),to(o,e,t,i,n,s),to(l,e,t,i,n,s);return}a=a.next}o=o.next}while(o!==r)}function d_(r,e,t,i){let n=[],s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){let d=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(d<=i&&d>s){if(s=d,d===i){if(n===t.y)return t;if(n===t.next.y)return t.next}o=t.x=t.x&&t.x>=l&&i!==t.x&&Ts(no.x||t.x===o.x&&g_(o,t)))&&(o=t,u=h)),t=t.next;while(t!==a);return o}function g_(r,e){return rt(r.prev,r,e.prev)<0&&rt(e.next,r,r.next)<0}function y_(r,e,t,i){let n=r;do n.z===null&&(n.z=ju(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,x_(n)}function x_(r){let e,t,i,n,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;t=i}s.nextZ=null,c*=2}while(o>1);return r}function ju(r,e,t,i,n){return r=32767*(r-t)*n,e=32767*(e-i)*n,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function v_(r){let e=r,t=r;do(e.x=0&&(r-o)*(i-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(i-a)>=0}function w_(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!b_(r,e)&&(io(r,e)&&io(e,r)&&__(r,e)&&(rt(r.prev,r,e.prev)||rt(r,e.prev,e))||ol(r,e)&&rt(r.prev,r,r.next)>0&&rt(e.prev,e,e.next)>0)}function rt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function ol(r,e){return r.x===e.x&&r.y===e.y}function Dm(r,e,t,i){let n=_a(rt(r,e,t)),s=_a(rt(r,e,i)),o=_a(rt(t,i,r)),a=_a(rt(t,i,e));return!!(n!==s&&o!==a||n===0&&ba(r,t,e)||s===0&&ba(r,i,e)||o===0&&ba(t,r,i)||a===0&&ba(t,e,i))}function ba(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function _a(r){return r>0?1:r<0?-1:0}function b_(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Dm(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function io(r,e){return rt(r.prev,r,r.next)<0?rt(r,e,r.next)>=0&&rt(r,r.prev,e)>=0:rt(r,e,r.prev)<0||rt(r,r.next,e)<0}function __(r,e){let t=r,i=!1,n=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function Tm(r,e){let t=new Xu(r.i,r.x,r.y),i=new Xu(e.i,e.x,e.y),n=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Zf(r,e,t,i){let n=new Xu(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function no(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Xu(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E_(r,e,t,i){let n=0;for(let s=e,o=t-i;s2&&r[e-1].equals(r[0])&&r.pop()}function Kf(r,e){for(let t=0;tNumber.EPSILON){let J=Math.sqrt(I),se=Math.sqrt(Ze*Ze+je*je),xe=ie.x-Oe/J,Y=ie.y+Re/J,be=te.x-je/se,ve=te.y+Ze/se,he=((be-xe)*je-(ve-Y)*Ze)/(Re*je-Oe*Ze);fe=xe+Re*he-Z.x,de=Y+Oe*he-Z.y;let le=fe*fe+de*de;if(le<=2)return new ee(fe,de);Se=Math.sqrt(le/2)}else{let J=!1;Re>Number.EPSILON?Ze>Number.EPSILON&&(J=!0):Re<-Number.EPSILON?Ze<-Number.EPSILON&&(J=!0):Math.sign(Oe)===Math.sign(je)&&(J=!0),J?(fe=-Oe,de=Re,Se=Math.sqrt(I)):(fe=Re,de=Oe,Se=Math.sqrt(I/2))}return new ee(fe/Se,de/Se)}let V=[];for(let Z=0,ie=B.length,te=ie-1,fe=Z+1;Z=0;Z--){let ie=Z/x,te=p*Math.cos(ie*Math.PI/2),fe=m*Math.sin(ie*Math.PI/2)+y;for(let de=0,Se=B.length;de=0;){let fe=te,de=te-1;de<0&&(de=Z.length-1);for(let Se=0,Re=u+x*2;Se0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};Zu.prototype.isMeshPhysicalMaterial=!0;var qs=class extends ft{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new ye(16777215),this.specular=new ye(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xs,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=il,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}};qs.prototype.isMeshPhongMaterial=!0;var Ju=class extends ft{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ye(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xs,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Ju.prototype.isMeshToonMaterial=!0;var Ku=class extends ft{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xs,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};Ku.prototype.isMeshNormalMaterial=!0;var Qu=class extends ft{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new ye(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ye(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=il,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}};Qu.prototype.isMeshLambertMaterial=!0;var eh=class extends ft{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ye(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xs,this.normalScale=new ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}};eh.prototype.isMeshMatcapMaterial=!0;var th=class extends qn{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};th.prototype.isLineDashedMaterial=!0;var it={arraySlice:function(r,e,t){return it.isTypedArray(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)},convertArray:function(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)},isTypedArray:function(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)},getKeyframeOrder:function(r){function e(n,s){return r[n]-r[s]}let t=r.length,i=new Array(t);for(let n=0;n!==t;++n)i[n]=n;return i.sort(e),i},sortedArray:function(r,e,t){let i=r.length,n=new r.constructor(i);for(let s=0,o=0;o!==i;++s){let a=t[s]*e;for(let l=0;l!==e;++l)n[o++]=r[a+l]}return n},flattenJSON:function(r,e,t,i){let n=1,s=r[0];for(;s!==void 0&&s[i]===void 0;)s=r[n++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[n++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[n++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=r[n++];while(s!==void 0)},subclip:function(r,e,t,i,n=30){let s=r.clone();s.name=e;let o=[];for(let l=0;l=i)){h.push(c.times[p]);for(let y=0;ys.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[m]){let g=m*h+u,f=g+h-u;y=it.arraySlice(a.values,g,f)}else{let g=a.createInterpolant(),f=u,E=h-u;g.evaluate(s),y=it.arraySlice(g.resultBuffer,f,E)}l==="quaternion"&&new Lt().fromArray(y).normalize().conjugate().toArray(y);let x=c.times.length;for(let g=0;g=s)){let a=t[1];e=s)break t}o=i,i=0;break i}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==n){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=it.arraySlice(i,s,o),this.values=it.arraySlice(this.values,s*a,o*a)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,n=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){let l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(n!==void 0&&it.isTypedArray(n))for(let a=0,l=n.length;a!==l;++a){let c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){let e=it.arraySlice(this.times),t=it.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===kc,s=e.length-1,o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=it.arraySlice(e,0,o),this.values=it.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){let e=it.arraySlice(this.times,0),t=it.arraySlice(this.values,0),i=this.constructor,n=new i(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}};ni.prototype.TimeBufferType=Float32Array;ni.prototype.ValueBufferType=Float32Array;ni.prototype.DefaultInterpolation=Ta;var An=class extends ni{};An.prototype.ValueTypeName="bool";An.prototype.ValueBufferType=Array;An.prototype.DefaultInterpolation=Da;An.prototype.InterpolantFactoryMethodLinear=void 0;An.prototype.InterpolantFactoryMethodSmooth=void 0;var Ya=class extends ni{};Ya.prototype.ValueTypeName="color";var Ws=class extends ni{};Ws.prototype.ValueTypeName="number";var sh=class extends Ri{constructor(e,t,i,n){super(e,t,i,n)}interpolate_(e,t,i,n){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(n-t),c=e*a;for(let u=c+a;c!==u;c+=4)Lt.slerpFlat(s,0,o,c-a,o,c,l);return s}},$n=class extends ni{InterpolantFactoryMethodLinear(e){return new sh(this.times,this.values,this.getValueSize(),e)}};$n.prototype.ValueTypeName="quaternion";$n.prototype.DefaultInterpolation=Ta;$n.prototype.InterpolantFactoryMethodSmooth=void 0;var Sn=class extends ni{};Sn.prototype.ValueTypeName="string";Sn.prototype.ValueBufferType=Array;Sn.prototype.DefaultInterpolation=Da;Sn.prototype.InterpolantFactoryMethodLinear=void 0;Sn.prototype.InterpolantFactoryMethodSmooth=void 0;var $s=class extends ni{};$s.prototype.ValueTypeName="vector";var Za=class{constructor(e,t=-1,i,n=Ih){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=pi(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(T_(i[o]).scale(n));let s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(ni.toJSON(i[s]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let s=t.length,o=[];for(let a=0;a1){let h=u[1],d=n[h];d||(n[h]=d=[]),d.push(c)}}let o=[];for(let a in n)o.push(this.CreateFromMorphTargetSequence(a,n[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(h,d,p,m,y){if(p.length!==0){let x=[],g=[];it.flattenJSON(p,x,g,m),x.length!==0&&y.push(new h(d,x,g))}},n=[],s=e.name||"default",o=e.fps||30,a=e.blendMode,l=e.length||-1,c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(ji[e]!==void 0){ji[e].push({onLoad:t,onProgress:i,onError:n});return}ji[e]=[],ji[e].push({onLoad:t,onProgress:i,onError:n});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body.getReader===void 0)return c;let u=ji[e],h=c.body.getReader(),d=c.headers.get("Content-Length"),p=d?parseInt(d):0,m=p!==0,y=0,x=new ReadableStream({start(g){f();function f(){h.read().then(({done:E,value:w})=>{if(E)g.close();else{y+=w.byteLength;let _=new ProgressEvent("progress",{lengthComputable:m,loaded:y,total:p});for(let M=0,T=u.length;M{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{let h=/charset="?([^;"\s]*)"?/i.exec(a),d=h&&h[1]?h[1].toLowerCase():void 0,p=new TextDecoder(d);return c.arrayBuffer().then(m=>p.decode(m))}}}).then(c=>{js.add(e,c);let u=ji[e];delete ji[e];for(let h=0,d=u.length;h{let u=ji[e];if(u===void 0)throw this.manager.itemError(e),c;delete ji[e];for(let h=0,d=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}};var Ja=class extends Fi{constructor(e){super(e)}load(e,t,i,n){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=js.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a=kr("img");function l(){u(),js.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(h){u(),n&&n(h),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}},ah=class extends Fi{constructor(e){super(e)}load(e,t,i,n){let s=new ks,o=new Ja(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function l(c){o.load(e[c],function(u){s.images[c]=u,a++,a===6&&(s.needsUpdate=!0,t&&t(s))},void 0,n)}for(let c=0;c"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,n){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let s=this,o=js.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;let a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){js.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){n&&n(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}};mh.prototype.isImageBitmapLoader=!0;var Ea,R_={getContext:function(){return Ea===void 0&&(Ea=new(window.AudioContext||window.webkitAudioContext)),Ea},setContext:function(r){Ea=r}},gh=class extends Fi{constructor(e){super(e)}load(e,t,i,n){let s=this,o=new oh(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{let l=a.slice(0);R_.getContext().decodeAudioData(l,function(u){t(u)})}catch(l){n?n(l):console.error(l),s.manager.itemError(e)}},i,n)}},yh=class extends lo{constructor(e,t,i=1){super(void 0,i);let n=new ye().set(e),s=new ye().set(t),o=new P(n.r,n.g,n.b),a=new P(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}};yh.prototype.isHemisphereLightProbe=!0;var xh=class extends lo{constructor(e,t=1){super(void 0,t);let i=new ye().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}};xh.prototype.isAmbientLightProbe=!0;var vh=class extends Ge{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let s=i,o=n;s!==o;++s)t[s]=t[n+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,n){Lt.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,s){let o=this._workIndex*s;Lt.multiplyQuaternionsFlat(e,o,e,t,e,i),Lt.slerpFlat(e,t,e,t,e,o,n)}_lerp(e,t,i,n,s){let o=1-n;for(let a=0;a!==s;++a){let l=t+a;e[l]=e[l]*o+e[i+a]*n}}_lerpAdditive(e,t,i,n,s){for(let o=0;o!==s;++o){let a=t+o;e[a]=e[a]+e[i+o]*n}}},Oh="\\[\\]\\.:\\/",F_=new RegExp("["+Oh+"]","g"),zh="[^"+Oh+"]",L_="[^"+Oh.replace("\\.","")+"]",B_=/((?:WC+[\/:])*)/.source.replace("WC",zh),P_=/(WCOD+)?/.source.replace("WCOD",L_),I_=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",zh),N_=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",zh),k_=new RegExp("^"+B_+P_+I_+N_+"$"),O_=["material","materials","bones"],_h=class{constructor(e,t,i){let n=i||Xe.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];n!==void 0&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=i.length;n!==s;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},Xe=class r{constructor(e,t,i){this.path=t,this.parsedPath=i||r.parseTrackName(t),this.node=r.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new r.Composite(e,t,i):new r(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(F_,"")}static parseTrackName(e){let t=k_.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let s=i.nodeName.substring(n+1);O_.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(!t||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){let i=function(s){for(let o=0;o=s){let h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let p=0,m=n;p!==m;++p){let y=i[p],x=y[h],g=y[u];y[u]=x,y[h]=g}}}this.nCachedObjects_=s}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){let c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[p.uuid]=h),e[h]=p,e.pop();for(let m=0,y=n;m!==y;++m){let x=i[m];x[h]=x[d],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){let i=this._bindingsIndicesByPath,n=i[e],s=this._bindings;if(n!==void 0)return s[n];let o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);n=s.length,i[e]=n,o.push(e),a.push(t),s.push(h);for(let d=u,p=l.length;d!==p;++d){let m=l[d];h[d]=new Xe(m,e,t)}return h}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){let n=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),n[i]=n[a],n.pop()}}};Eh.prototype.isAnimationObjectGroup=!0;var Ah=class{constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;let s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Ms,endingEnd:Ms};for(let c=0;c!==o;++c){let u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=pv,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){let n=this._clip.duration,s=e._clip.duration,o=s/n,a=n/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){let n=this._mixer,s=n.time,o=this.timeScale,a=this._timeScaleInterpolant;a===null&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,n){if(!this.enabled){this._updateWeight(e);return}let s=this._startTime;if(s!==null){let l=(e-s)*i;if(l<0||i===0)return;this._startTime=null,t=i*l}t*=this._updateTimeScale(e);let o=this._updateTime(t),a=this._updateWeight(e);if(a>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case um:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case Ih:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(n,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(i!==null){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),n===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;if(i!==null){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,n=this.time+e,s=this._loopCount,o=i===fv;if(e===0)return s===-1?n:o&&(s&1)===1?t-n:n;if(i===dv){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=t)n=t;else if(n<0)n=0;else{this.time=n;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),n>=t||n<0){let a=Math.floor(n/t);n-=t*a,s+=Math.abs(a);let l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){let c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=n;if(o&&(s&1)===1)return t-n}return n}_setEndings(e,t,i){let n=this._interpolantSettings;i?(n.endingStart=Ds,n.endingEnd=Ds):(e?n.endingStart=this.zeroSlopeAtStart?Ds:Ms:n.endingStart=Ca,t?n.endingEnd=this.zeroSlopeAtEnd?Ds:Ms:n.endingEnd=Ca)}_scheduleFading(e,t,i){let n=this._mixer,s=n.time,o=this._weightInterpolant;o===null&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);let a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}},Sh=class extends Xi{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){let i=e._localRoot||this._root,n=e._clip.tracks,s=n.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName,u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){let d=n[h],p=d.name,m=u[p];if(m!==void 0)++m.referenceCount,o[h]=m;else{if(m=o[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,l,p));continue}let y=t&&t._propertyBindings[h].binding.parsedPath;m=new bh(Xe.create(i,p,y),d.ValueTypeName,d.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,p),o[h]=m}a[h].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let i=(e._localRoot||this._root).uuid,n=e._clip.uuid,s=this._actionsByClip[n];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,n,i)}let t=e._propertyBindings;for(let i=0,n=t.length;i!==n;++i){let s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let i=0,n=t.length;i!==n;++i){let s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,n=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(n,e,s,o);let a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return nm.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};jn.prototype.isBox2=!0;var sm=new P,Aa=new P,Ch=class{constructor(e=new P,t=new P){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){sm.subVectors(e,this.start),Aa.subVectors(this.end,this.start);let i=Aa.dot(Aa),s=Aa.dot(sm)/i;return t&&(s=Ut(s,0,1)),s}closestPointToPoint(e,t,i){let n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}};var fn=new P,Sa=new Ee,yu=new Ee,Rh=class extends Zr{constructor(e){let t=Cm(e),i=new Ke,n=[],s=[],o=new ye(0,0,1),a=new ye(0,1,0);for(let c=0;c0?-1:1)*.9,y:this.h*(s.y>0?-1:1)*.9,z:Math.random()*200+200},a=Math.abs(s.x/s.y);a>1?o.y/=a:o.x*=a;let l=this.makeRandomVector(n),c={x:l.x*i,y:l.y*i,z:-10},u={x:-(Math.random()*s.y*5+this.inertia*s.y),y:Math.random()*s.x*5+this.inertia*s.x,z:0},h={x:Math.random(),y:Math.random(),z:Math.random(),w:Math.random()};return{pos:o,velocity:c,angular:u,axis:h}}makeRandomVector(e){let t=Math.random()*Math.PI/5-Math.PI/5/2,i={x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)};return i.x==0&&(i.x=.01),i.y==0&&(i.y=.01),i}get buffer(){return this.geometry.geometry}get result(){return this.getUpsideValue()}getUpsideValue(){let e=new P(0,0,this.sides==4?-1:1),t,i=Math.PI*2,n=this.buffer.getAttribute("normal").array;for(let o=0,a=this.buffer.groups.length;othis.sides;)o-=this.sides;for(;o<1;)o+=this.sides;t.groups[n].materialIndex=o+1}}this.updateMaterialsForValue(e-i),this.geometry.geometry=t}resetBody(){return this.body.vlambda=new b,this.body.position=new b,this.body.previousPosition=new b,this.body.initPosition=new b,this.body.velocity=new b,this.body.initVelocity=new b,this.body.force=new b,this.body.torque=new b,this.body.quaternion=new yt,this.body.initQuaternion=new yt,this.body.angularVelocity=new b,this.body.initAngularVelocity=new b,this.body.interpolatedPosition=new b,this.body.interpolatedQuaternion=new yt,this.body.inertia=new b,this.body.invInertia=new b,this.body.invInertiaWorld=new Mi,this.body.invInertiaSolve=new b,this.body.invInertiaWorldSolve=new Mi,this.body.wlambda=new b,this.body.updateMassProperties(),this}updateMaterialsForValue(e){}set(){this.geometry.position.set(this.body.position.x,this.body.position.y,this.body.position.z),this.geometry.quaternion.set(this.body.quaternion.x,this.body.quaternion.y,this.body.quaternion.z,this.body.quaternion.w)}recreate(e,t,i){this.w=t,this.h=i,this.vector=this.generateVector(e),this.stopped=!1,this.iterations=0,this.create()}create(){return this.body.position.set(this.vector.pos.x,this.vector.pos.y,this.vector.pos.z),this.body.quaternion.setFromAxisAngle(new b(this.vector.axis.x,this.vector.axis.y,this.vector.axis.z),this.vector.axis.w*Math.PI*2),this.body.angularVelocity.set(this.vector.angular.x,this.vector.angular.y,this.vector.angular.z),this.body.velocity.set(this.vector.velocity.x,this.vector.velocity.y,this.vector.velocity.z),this.body.linearDamping=.1,this.body.angularDamping=.1,this}},al=class extends Mn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=20;this.inertia=6;s&&(this.vector=this.generateVector(s)),this.create()}},ll=class extends Mn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=12;this.inertia=8;s&&(this.vector=this.generateVector(s)),this.create()}},Zs=class extends Mn{constructor(t,i,n,s,o=!1){super(t,i,n);this.w=t;this.h=i;this.data=n;this.isPercentile=o;this.sides=10;this.inertia=9;s&&(this.vector=this.generateVector(s)),this.create()}},cl=class extends Mn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=8;this.inertia=10;s&&(this.vector=this.generateVector(s)),this.create()}},Js=class extends Mn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=6;this.inertia=13;s&&(this.vector=this.generateVector(s)),this.create()}},ul=class extends Mn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=4;this.inertia=5;s&&(this.vector=this.generateVector(s)),this.create()}};var At=class{constructor(e,t={value:`${e}`,conditions:[],type:"dice"}){this.lexeme=t;this.modifiers=new Map;this.possibilities=[];this.results=new Map;this.shapes=new Map;this.modifiersAllowed=!0;this.static=!1;this.conditions=[];this.fudge=!1;this.shouldRender=!1;if(!/(\-?\d+)[dD]?(\d+|%|\[\d+,\s?\d+\])?/.test(`${e}`))throw new Error("Non parseable dice string passed to DiceRoll.");this.dice=`${e}`.split(" ").join(""),/^-?\d+(?:\.\d+)?$/.test(this.dice)&&(this.static=!0,this.modifiersAllowed=!1);let[,i,n="1"]=this.dice.match(/(\-?\d+)[dD](%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\])/)||[,1,"1"];i=Number(i),this.multiplier=i<0?-1:1;let s=1,o=isNaN(Number(n))?1:Number(n);this.rolls=Math.abs(Number(i))||1,/\[\d+(?:[ \t]*,[ \t]*\d+)+\]/.test(n)?this.possibilities=n.replace(/[\[\]\s]/g,"").split(",").map(a=>Number(a)):/\[\d+(?:[ \t]*-[ \t]*\d+)+\]/.test(n)?([s,o]=n.replace(/[\[\]\s]/g,"").split("-").map(a=>Number(a)),this.possibilities=Array.from({length:o-s},(a,l)=>l+s)):(n==="%"?o=100:o=Number(n),Number(o)<0&&!s&&(s=-1),Number(o)a+s)),this.conditions=this.lexeme.conditions??[]}getType(){return`${this.faces.max}`}get faces(){return{max:this.possibilities[this.possibilities.length-1],min:this.possibilities[0]}}getShapes(e){if(this.shapes.has(e))return this.shapes.get(e);let t=Mt.getDiceForRoller(this);return e!=null&&this.shapes.set(e,t),t}get text(){return`${this.result}`}get result(){if(this.static)return this.multiplier*Number(this.dice);let e=[...this.results].map(([,{usable:t,value:i}])=>t?i:0);return this.multiplier*e.reduce((t,i)=>t+i,0)}get display(){if(this.static)return`${this.result}`;let e=[`[${[...this.results].map(([,{modifiers:t,display:i}])=>`${i}${[...t].join("")}`).join(", ")}]`];return this.conditions.length&&e.push(this.conditions.map(({result:t,operator:i})=>`${i}${t}`).join("")),e.join("")}get modifierText(){let e=this.conditions.map(({value:i})=>i).join(""),t=[...this.modifiers].map(([i,{conditionals:n,value:s}])=>{let o=n.map(a=>a.value);return`${s}${o.join("")}`}).join("");return`${e}${t}`}keepLow(e=1){if(!this.modifiersAllowed){new ho.Notice("Modifiers are only allowed on dice rolls.");return}this.results.size!==1&&[...this.results].sort((t,i)=>t[1].value-i[1].value).slice(e>this.results.size?this.results.size:e-this.results.size).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}keepHigh(e=1){if(!this.modifiersAllowed){new ho.Notice("Modifiers are only allowed on dice rolls.");return}this.results.size!==1&&[...this.results].sort((t,i)=>i[1].value-t[1].value).slice(e).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}async reroll(e,t){if(!this.modifiersAllowed){new ho.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.min,lexemes:[{value:`${this.faces.min}`,text:`${this.faces.min}`,type:"dice"}],value:""});let i=0,n=[...this.results].filter(([,{value:s}])=>this.checkCondition(s,t));for(;i0;){let s=[];for(let[o,a]of n)s.push(new Promise(async l=>{a.modifiers.add("r");let c=this.getShapes(o),u=await this.getValue(c);a.value=u,a.display=`${u}`,l()}));await Promise.all(s),n=n.filter(([,{value:o}])=>this.checkCondition(o,t)),i++}n.forEach(([s,o])=>{this.results.set(s,o)})}async explode(e,t,i=!1){if(!this.modifiersAllowed){new ho.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.max,lexemes:[{value:`${this.faces.max}`,text:`${this.faces.max}`,type:"dice"}],value:""});let n=[...this.results].filter(([,{value:o}])=>this.checkCondition(o,t)),s=0;await Promise.all(n.map(async([o,a])=>{if(i){let l=await this.getValue(),c=0;for(a.modifiers.add("!"),a.value+=l,a.display=`${a.value}`,this.results.set(o,a);cthis.faces.min+t).every(t=>this.possibilities.includes(t))}async getValue(e){let t;if(this.shouldRender&&this.canRender()){let i=e??Mt.getDiceForRoller(this)??[];await Mt.addDice(i),t=this.#e(i)}else t=this.getValueSync();return t}getValueSync(){return this.getRandomValue()}getMaxPossible(){if(this.static)return Number(this.dice);let e=this.rolls;return this.modifiers.has("kl")&&(e=e-this.modifiers.get("kl").data),this.modifiers.has("kh")&&(e=e-this.modifiers.get("kh").data),e<1&&(e=0),this.multiplier===-1?this.multiplier*Math.min(...this.possibilities)*e:Math.max(...this.possibilities)*e}getMinPossible(){if(this.static)return Number(this.dice);let e=this.rolls;return this.modifiers.has("kl")&&(e=e-this.modifiers.get("kl").data),this.modifiers.has("kh")&&(e=e-this.modifiers.get("kh").data),e<1&&(e=0),this.multiplier===-1?this.multiplier*Math.max(...this.possibilities)*e:Math.min(...this.possibilities)*e}#e(e=[]){if(!e.length)return this.getValueSync();let t=e.map(i=>i.getUpsideValue());if(this.faces.max===100){let[i,n]=t;return i===10&&n==10?100:(n==10&&(n=0),i==10&&(i=0),i*10+n)}return t.reduce((i,n)=>i+n)}#t(e=0){return{usable:!0,value:e,display:`${e}`,modifiers:new Set}}async applyModifiers(){for(let[e,t]of this.modifiers)e=="kh"||e=="kl"||await this.applyModifier(e,t);this.modifiers.has("kh")&&await this.applyModifier("kh",this.modifiers.get("kh")),this.modifiers.has("kl")&&await this.applyModifier("kl",this.modifiers.get("kl"))}setResults(e){this.results=new Map([...e].map(([t,i])=>[t,this.#t(i)])),this.updateResultArray()}rollSync(){let e=new Map;for(let t=0;t{let s=await this.getValue(this.getShapes(i));e.set(i,s),n()}));await Promise.all(t)}return e}applyConditions(){for(let e of this.results.values()){let t=this.conditions.find(({operator:n})=>n==="-="||n==="=-");if(t&&e.value===t.comparer){e.value=-1,e.modifiers.add("-");continue}this.checkCondition(e.value,this.conditions)?(e.modifiers.add("*"),e.value=1):e.usable=!1}}updateResultArray(){this.resultArray=[...this.results.values()].map(e=>e.value)}async applyModifier(e,t){switch(e){case"sort":{let i;t.value=="sa"?i=[...this.results.values()].sort((n,s)=>n.value-s.value):i=[...this.results.values()].sort((n,s)=>s.value-n.value),this.results=new Map([...this.results.keys()].map(n=>[n,i[n]])),this.updateResultArray();break}case"kh":{this.keepHigh(t.data);break}case"kl":{this.keepLow(t.data);break}case"!":{await this.explode(t.data,t.conditionals);break}case"!!":{await this.explode(t.data,t.conditionals,!0);break}case"r":{await this.reroll(t.data,t.conditionals);break}case"u":{await this.makeUnique();break}case"condition":}}async makeUnique(){let e=[...this.results.values()];if(new Set(this.possibilities).sizei.value)).size==this.results.size)return;let t=0;for(;new Set(e.map(i=>i.value)).size!=this.results.size&&t<100;){let i=[];for(let[n,s]of this.results)i.push(new Promise(async o=>{let a=e.find(l=>l.value==s.value&&l!=s);a&&(a.value=await this.getValue(this.getShapes(n)),a.display=`${a.value}`,a.modifiers.add("u")),o()}));await Promise.all(i),e=[...this.results.values()],t++}}checkCondition(e,t){if(!t||!t.length)return e;let i=!1;for(let n of t){let{operator:s,comparer:o,lexemes:a}=n;if(Number.isNaN(e)||!s?.length||!o)continue;let l=new hl(o,a);if(l.rollSync(),n.result=l.result,!Number.isNaN(n.result)){switch(s){case"=":i=e===n.result;break;case"!=":case"=!":i=e!==n.result;break;case"<":i=e":i=e>n.result;break;case">=":i=e>=n.result;break}if(i)return i}}return i}allowAverage(){return!0}average(){return this.possibilities.reduce((e,t)=>e+t)/this.possibilities.length}getRandomValue(){let e=Math.floor(Math.random()*this.possibilities.length);return this.possibilities[e]}getGeometries(){return[...this.shapes.values()].flat()}async render(){this.shouldRender=!0,await this.roll(),this.shouldRender=!1}};var Rm={specular:1515554,color:15790320,shininess:60,flatShading:!0},Dn={diceColor:"#202020",textColor:"#ffffff",textFont:"Arial"},fi=class{constructor(e,t,i={diceColor:"#202020",textColor:"#aaaaaa"},n){this.w=e;this.h=t;this.options=i;this.scaler=n;this.scale=50;this.labels=[" ","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];this.fontFace="Arial";this.options={...Dn,...i},this.fontFace=this.options.textFont}setColor({diceColor:e,textColor:t}){e&&(this.options.diceColor=e),t&&(this.options.textColor=t)}get radius(){return this.scale*this.scaleFactor*(this.scaler??1)}get diceColor(){return this.options.diceColor}get textColor(){return this.options.textColor}get buffer(){return this.geometry.geometry}create(){this.textureSize=this.calculateTextureSize(this.scale/2+this.scale*this.margin)*2;let e=this.getGeometry(),t=this.getMaterials();return this.geometry=new pt(e,t),this.geometry.receiveShadow=!0,this.geometry.castShadow=!0,this.body.position.set(0+this.radius*2*Math.random(),0+this.radius*2*Math.random(),0+this.radius*4),this.body.velocity.x=500*Math.random()*2-1,this.body.velocity.y=500*Math.random()*2-1,this.body.angularVelocity.x=100*Math.random(),this.body.angularVelocity.y=100*Math.random(),this}getGeometry(){let e=new Array(this.vertices.length);for(let i=0;i=0&&u=0&&c!==l+1?a.unshift([s,c],[o,u]):a.push([s,c],[o,u]),l=c)}a.length===4&&i.push([i[a[0][0]][a[0][1]],i[a[1][0]][a[1][1]],i[a[3][0]][a[3][1]],i[a[2][0]][a[2][1]],-1])}for(let s=0;s=0&&u<4){--u===-1&&(u=3);let h=i[c][u];if(o.indexOf(h)>=0){a.push(h);break}}}--l}a.push(-1),i.push(a)}return{vectors:t,faces:i}}makeGeometry(e,t){let i=new Ke;for(let h=0;h1&&(a=a/c.length,o.font=`${a}pt '${this.fontFace}'`,l=o.measureText("M").width*1.2,n-=l*c.length/2);for(let h=0,d=c.length;h0?-1:1)*.9,y:this.h*(s.y>0?-1:1)*.9,z:Math.random()*200+200},a=Math.abs(s.x/s.y);a>1?o.y/=a:o.x*=a;let l=this.makeRandomVector(n),c={x:l.x*i,y:l.y*i,z:-10},u={x:-(Math.random()*s.y*5+this.inertia*s.y),y:Math.random()*s.x*5+this.inertia*s.x,z:0},h={x:Math.random(),y:Math.random(),z:Math.random(),w:Math.random()};return{pos:o,velocity:c,angular:u,axis:h}}makeRandomVector(e){let t=Math.random()*Math.PI/5-Math.PI/5/2,i={x:e.x*Math.cos(t)-e.y*Math.sin(t),y:e.x*Math.sin(t)+e.y*Math.cos(t)};return i.x==0&&(i.x=.01),i.y==0&&(i.y=.01),i}get buffer(){return this.geometry.geometry}get result(){return this.getUpsideValue()}getUpsideValue(){let e=new P(0,0,this.sides==4?-1:1),t,i=Math.PI*2,n=this.buffer.getAttribute("normal").array;for(let o=0,a=this.buffer.groups.length;othis.sides;)o-=this.sides;for(;o<1;)o+=this.sides;t.groups[n].materialIndex=o+1}}this.updateMaterialsForValue(e-i),this.geometry.geometry=t}resetBody(){return this.body.vlambda=new b,this.body.position=new b,this.body.previousPosition=new b,this.body.initPosition=new b,this.body.velocity=new b,this.body.initVelocity=new b,this.body.force=new b,this.body.torque=new b,this.body.quaternion=new mt,this.body.initQuaternion=new mt,this.body.angularVelocity=new b,this.body.initAngularVelocity=new b,this.body.interpolatedPosition=new b,this.body.interpolatedQuaternion=new mt,this.body.inertia=new b,this.body.invInertia=new b,this.body.invInertiaWorld=new gi,this.body.invInertiaSolve=new b,this.body.invInertiaWorldSolve=new gi,this.body.wlambda=new b,this.body.updateMassProperties(),this}updateMaterialsForValue(e){}set(){this.geometry.position.set(this.body.position.x,this.body.position.y,this.body.position.z),this.geometry.quaternion.set(this.body.quaternion.x,this.body.quaternion.y,this.body.quaternion.z,this.body.quaternion.w)}recreate(e,t,i){this.w=t,this.h=i,this.vector=this.generateVector(e),this.stopped=!1,this.iterations=0,this.create()}create(){return this.body.position.set(this.vector.pos.x,this.vector.pos.y,this.vector.pos.z),this.body.quaternion.setFromAxisAngle(new b(this.vector.axis.x,this.vector.axis.y,this.vector.axis.z),this.vector.axis.w*Math.PI*2),this.body.angularVelocity.set(this.vector.angular.x,this.vector.angular.y,this.vector.angular.z),this.body.velocity.set(this.vector.velocity.x,this.vector.velocity.y,this.vector.velocity.z),this.body.linearDamping=.1,this.body.angularDamping=.1,this}},ao=class extends wn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=20;this.inertia=6;s&&(this.vector=this.generateVector(s)),this.create()}},lo=class extends wn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=12;this.inertia=8;s&&(this.vector=this.generateVector(s)),this.create()}},Gi=class extends wn{constructor(t,i,n,s,o=!1){super(t,i,n);this.w=t;this.h=i;this.data=n;this.isPercentile=o;this.sides=10;this.inertia=9;s&&(this.vector=this.generateVector(s)),this.create()}},co=class extends wn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=8;this.inertia=10;s&&(this.vector=this.generateVector(s)),this.create()}},Xs=class extends wn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=6;this.inertia=13;s&&(this.vector=this.generateVector(s)),this.create()}},uo=class extends wn{constructor(t,i,n,s){super(t,i,n);this.w=t;this.h=i;this.data=n;this.sides=4;this.inertia=5;s&&(this.vector=this.generateVector(s)),this.create()}};var _l=class{constructor(){this.resources=new Map}isTracking(e){return this.resources.has(e)}#e(e,t){if(Array.isArray(e))e.forEach(i=>{(this.resources.get(t)??[]).push(i),this.#e(i,t)});else{let i=this.resources.get(t??e)??[];this.resources.set(t??e,i)}}track(e){if("dispose"in e&&this.#e(e),e instanceof Ge&&this.#e(e),"geometry"in e&&this.#e(e.geometry,e),"material"in e&&this.#e(e.material,e),"children"in e&&this.#e(e.children,e),e instanceof dt)for(let t of Object.values(e))t instanceof at&&this.#e(t);return e}untrack(e){this.resources.delete(e)}dispose(){for(let[e]of this.resources)this.disposeResource(e);this.resources.clear()}disposeResource(e){"parent"in e&&e.parent&&e.parent.remove(e),"dispose"in e&&e.dispose();for(let t of this.resources.get(e)??[])this.disposeResource(t);this.resources.delete(e)}};var ho=class r extends Hn.Component{constructor(t){super();this.data=t;this.event=new Hn.Events;this.tracker=new _l;this.container=createDiv("renderer-container");this.#e=new Set;this.shadows=!0;this.iterations=0;this.frame_rate=1/60;this.loaded=!1;this.#t=!1;this.#i=new WeakMap;this.colors={ambient:16777215,spotlight:16777215};this.display={currentWidth:null,currentHeight:null,containerWidth:null,containerHeight:null,aspect:null,scale:null};this.cameraHeight={max:null,close:null,medium:null,far:null};this.#n=new WeakMap;this.extraFrames=r.DEFAULT_EXTRA_FRAMES;this.renderer=new qe({alpha:!0,antialias:!0}),this.factory=new vh(this.WIDTH,this.HEIGHT,{diceColor:this.data.diceColor,textColor:this.data.textColor,colorfulDice:this.data.colorfulDice,scaler:this.data.scaler,textFont:this.data.textFont})}#e;get WIDTH(){return this.container.clientWidth/2}get HEIGHT(){return this.container.clientHeight/2}get ASPECT(){return this.WIDTH/this.HEIGHT}get scale(){return(this.WIDTH*this.WIDTH+this.HEIGHT*this.HEIGHT)/13}get canvasEl(){return this.renderer?this.renderer.domElement:null}#t;setData(t){this.data=t,this.factory.width=this.WIDTH,this.factory.height=this.HEIGHT,this.factory.updateDice(this.data)}getDiceForRoller(t){return this.factory.getDiceForRoller(t,this.getVector())}#i;async addDice(t){return new Promise(i=>{this.#t||this.start();for(let n of t)n.recreate(this.getVector(),this.WIDTH,this.HEIGHT),this.scene.add(this.tracker.track(n.geometry)),this.world.add(n);this.#e.add(t),this.#i.set(t,()=>{i()})})}onload(){this.loaded=!0,this.addChild(this.factory),this.container.empty(),this.container.style.opacity="1",this.renderer.shadowMap.enabled=this.shadows,this.renderer.shadowMap.type=hh,this.container.appendChild(this.renderer.domElement),document.body.appendChild(this.container),this.renderer.setClearColor(0,0),this.scene=new zs,this.initScene(),this.initWorld(),this.registerDomEvent(window,"resize",()=>{this.initScene()})}onunload(){this.stop(),this.loaded=!1,cancelAnimationFrame(this.animation),this.container.detach(),this.container.empty(),this.renderer.domElement.detach(),this.factory.dispose(),this.renderer.renderLists.dispose(),this.renderer.dispose(),this.tracker.dispose(),[...this.#e.values()].flat().forEach(t=>{this.world.world.removeBody(t.body)}),this.#e=new Set}start(){this.#t&&this.unload(),this.loaded||this.load(),this.#t=!0,this.extraFrames=r.DEFAULT_EXTRA_FRAMES,this.render()}static{this.DEFAULT_EXTRA_FRAMES=30}enableShadows(){this.shadows=!0,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}disableShadows(){this.shadows=!1,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}get mw(){return Math.max(this.WIDTH,this.HEIGHT)}setDimensions(t){this.display.currentWidth=this.container.clientWidth/2,this.display.currentHeight=this.container.clientHeight/2,t?(this.display.containerWidth=t.w,this.display.containerHeight=t.h):(this.display.containerWidth=this.display.currentWidth,this.display.containerHeight=this.display.currentHeight),this.display.aspect=Math.min(this.display.currentWidth/this.display.containerWidth,this.display.currentHeight/this.display.containerHeight),this.display.scale=Math.sqrt(this.display.containerWidth*this.display.containerWidth+this.display.containerHeight*this.display.containerHeight)/13,this.renderer.setSize(this.display.currentWidth*2,this.display.currentHeight*2),this.cameraHeight.max=this.display.currentHeight/this.display.aspect/Math.tan(10*Math.PI/180),this.factory.width=this.display.currentWidth,this.factory.height=this.display.currentHeight,this.factory.updateDice(this.data),this.cameraHeight.medium=this.cameraHeight.max/1.5,this.cameraHeight.far=this.cameraHeight.max,this.cameraHeight.close=this.cameraHeight.max/2}initCamera(){this.camera&&this.scene.remove(this.camera),this.camera=new _t(20,this.display.currentWidth/this.display.currentHeight,1,this.cameraHeight.max*1.3),this.camera.position.z=this.cameraHeight.far,this.camera.lookAt(new P(0,0,0))}initLighting(){let t=Math.max(this.display.containerWidth,this.display.containerHeight);this.light&&this.scene.remove(this.light),this.ambientLight&&this.scene.remove(this.ambientLight),this.light=new to(this.colors.spotlight,.25),this.light.position.set(-t/2,t/2,t*3),this.light.target.position.set(0,0,0),this.light.distance=t*5,this.light.angle=Math.PI/4,this.light.castShadow=this.shadows,this.light.shadow.camera.near=t/10,this.light.shadow.camera.far=t*5,this.light.shadow.camera.fov=50,this.light.shadow.bias=.001,this.light.shadow.mapSize.width=1024,this.light.shadow.mapSize.height=1024,this.scene.add(this.tracker.track(this.light)),this.ambientLight=new io(16777215,.9),this.scene.add(this.tracker.track(this.ambientLight))}initDesk(){this.desk&&this.scene.remove(this.desk);let t=new Qr;t.opacity=.5,this.desk=new ht(new zr(this.display.containerWidth*6,this.display.containerHeight*6,1,1),t),this.desk.receiveShadow=this.shadows,this.scene.add(this.tracker.track(this.desk))}initScene(){this.setDimensions(),this.initCamera(),this.initLighting(),this.initDesk(),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)}initWorld(){this.world=new xh(this.WIDTH,this.HEIGHT),this.iterations=0}finishRender(){this.event.trigger("throw-finished")}#n;static{this.Threshold=5}throwFinished(){let t=!0;for(let i of this.#e){let n=!0;for(let s of i){if(s.iterations>10/this.frame_rate&&(s.stopped=!0),s.stopped===!0)continue;let o=s.body.angularVelocity,a=s.body.velocity;if(Math.abs(o.length())5){s.stopped=!0;continue}n=!1,t=!1}else s.iterations++,s.stopped=!1,n=!1,t=!1}n&&this.#i.has(i)&&(this.#i.get(i)(),this.#i.delete(i))}return t}unrender(){this.container.style.opacity="0",cancelAnimationFrame(this.animation),this.registerInterval(window.setTimeout(()=>{this.stop()},1e3))}stop(){if(this.#t)for(let t of[...this.#e]){this.#i.has(t)&&(this.#i.get(t)(),this.#i.delete(t));for(let i of t)i.stopped=!0}this.#t=!1,this.unload()}resizeRendererToDisplaySize(){let t=this.renderer.domElement,i=window.devicePixelRatio,n=t.clientWidth*i|0,s=t.clientHeight*i|0,o=t.width!==n||t.height!==s;return o&&this.renderer.setSize(n,s,!1),o}render(){if(this.throwFinished())if(this.extraFrames>10)this.extraFrames--;else{try{if(this.data.renderTime)this.registerInterval(window.setTimeout(()=>this.unrender(),this.data.renderTime));else{let i=function(){t.unload(),document.body.removeEventListener("click",i)},t=this;this.registerDomEvent(document.body,"click",i)}}catch(t){this.event.trigger("error",t)}return}this.animation=requestAnimationFrame(()=>this.render()),this.resizeRendererToDisplaySize()&&(this.camera.aspect=this.canvasEl.clientWidth/this.canvasEl.clientHeight,this.camera.updateProjectionMatrix()),this.world.step(this.frame_rate),this.iterations++,[...this.#e.values()].forEach(t=>t.forEach(i=>i.set())),this.renderer.render(this.scene,this.camera)}getVector(){return{x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT}}dispose(...t){t.forEach(i=>{i.children&&this.dispose(...i.children),i.clear()})}},xh=class{constructor(e,t){this.WIDTH=e;this.HEIGHT=t;this.world=new qo({gravity:new b(0,0,-9.82*200)});this.ground=this.getPlane();this.diceMaterial=new Ki;this.deskMaterial=new Ki;this.barrierMaterial=new Ki;this.world.broadphase=new hr,this.world.allowSleep=!0,this.ground.position.set(0,0,0),this.world.addBody(this.ground),this.buildWalls()}add(...e){e.forEach(t=>{this.world.addBody(t.body)})}remove(...e){e.forEach(t=>this.world.removeBody(t.body))}step(e=1/60){let t=performance.now()/1e3;if(!this.lastCallTime)this.world.step(e);else{let i=t-this.lastCallTime;this.world.step(e,i)}this.lastCallTime=t}buildWalls(){this.world.addContactMaterial(new Ji(this.deskMaterial,this.diceMaterial,{friction:.01,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new Ji(this.barrierMaterial,this.diceMaterial,{friction:.01,restitution:1,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new Ji(this.diceMaterial,this.diceMaterial,{friction:.1,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addBody(new De({allowSleep:!1,mass:0,shape:new Bi,material:this.deskMaterial}));let e=new De({allowSleep:!1,mass:0,shape:new Bi,material:this.barrierMaterial});e.quaternion.setFromAxisAngle(new b(1,0,0),Math.PI/2),e.position.set(0,this.HEIGHT*.93,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Bi,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(1,0,0),-Math.PI/2),e.position.set(0,-this.HEIGHT*.93,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Bi,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(0,1,0),-Math.PI/2),e.position.set(this.WIDTH*.93,0,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Bi,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(0,1,0),Math.PI/2),e.position.set(-this.WIDTH*.93,0,0),this.world.addBody(e)}getPlane(){return new De({type:De.STATIC,shape:new Bi})}},vh=class extends Hn.Component{constructor(t,i,n){super();this.width=t;this.height=i;this.options=n;this.dice={};this.updateDice=(0,Hn.debounce)(t=>{this.options={...t},this.dispose(),this.buildDice()},200);this.buildDice()}get colors(){let t=this.options.diceColor,i=this.options.textColor,n=this.options.textFont;if(!this.options.colorfulDice)return{diceColor:t,textFont:n}}onunload(){this.dispose()}disposeChildren(...t){t.forEach(i=>{"dispose"in i&&i.dispose(),i.children&&this.disposeChildren(...i.children)})}dispose(){for(let t of Object.values(this.dice))this.disposeChildren(t.geometry.children)}getDiceForRoller(t,i){let n=[];switch(t.faces.max){case 4:{n.push(new uo(this.width,this.height,this.clone("d4"),i));break}case 1:case 6:{n.push(new Xs(this.width,this.height,t.fudge?this.clone("fudge"):this.clone("d6"),i));break}case 8:{n.push(new co(this.width,this.height,this.clone("d8"),i));break}case 10:{n.push(new Gi(this.width,this.height,this.clone("d10"),i));break}case 12:{n.push(new lo(this.width,this.height,this.clone("d12"),i));break}case 20:{n.push(new ao(this.width,this.height,this.clone("d20"),i));break}case 100:{n.push(new Gi(this.width,this.height,this.clone("d100"),i,!0),new Gi(this.width,this.height,this.clone("d10"),i,!0));break}}return n}cloneDice(t,i){switch(t.sides){case 4:return[new uo(this.width,this.height,this.clone("d4"),i)];case 1:return[new Xs(this.width,this.height,this.clone("fudge"),i)];case 6:return[new Xs(this.width,this.height,this.clone("d6"),i)];case 8:return[new co(this.width,this.height,this.clone("d8"),i)];case 10:return[new Gi(this.width,this.height,this.clone("d10"),i)];case 12:return[new lo(this.width,this.height,this.clone("d12"),i)];case 20:return[new ao(this.width,this.height,this.clone("d20"),i)];case 100:return[new Gi(this.width,this.height,this.clone("d100"),i,!0),new Gi(this.width,this.height,this.clone("d10"),i,!0)]}}getDice(t,i){let n=new Map;for(let s of t.dynamic){let o=this.getDiceForRoller(s,i);o.length&&n.set(s,o)}return n}clone(t){if(!(t in this.dice))throw new Error("That dice type does not exist!");return this.dice[t].clone()}buildDice(){this.dice.d100=new ll(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d20=new rl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d12=new ol(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d10=new al(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d8=new cl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d6=new ul(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d4=new dl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.fudge=new hl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.boost=new wl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.ability=new yl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.difficulty=new xl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.challenge=new ml(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.proficiency=new fl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.setback=new bl(this.width,this.height,this.colors,this.options.scaler).create()}};var Ys=(n=>(n.None="None",n.Normal="Normal",n.Up="Up",n.Down="Down",n))(Ys||{});var oi=class{constructor(e,t,i={value:`${e}`,conditions:[],type:"dice"}){this.renderer=t;this.lexeme=i;this.modifiers=new Map;this.possibilities=[];this.results=new Map;this.shapes=new Map;this.modifiersAllowed=!0;this.static=!1;this.conditions=[];this.fudge=!1;this.shouldRender=!1;if(!/(\-?\d+)[dD]?(\d+|%|\[\d+,\s?\d+\])?/.test(`${e}`))throw new Error("Non parseable dice string passed to DiceRoll.");this.dice=`${e}`.split(" ").join(""),/^-?\d+(?:\.\d+)?$/.test(this.dice)&&(this.static=!0,this.modifiersAllowed=!1);let[,n,s="1"]=this.dice.match(/(\-?\d+)[dD](%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\])/)||[,1,"1"];n=Number(n),this.multiplier=n<0?-1:1;let o=1,a=isNaN(Number(s))?1:Number(s);this.rolls=Math.abs(Number(n))||1,/\[\d+(?:[ \t]*,[ \t]*\d+)+\]/.test(s)?this.possibilities=s.replace(/[\[\]\s]/g,"").split(",").map(l=>Number(l)):/\[\d+(?:[ \t]*-[ \t]*\d+)+\]/.test(s)?([o,a]=s.replace(/[\[\]\s]/g,"").split("-").map(l=>Number(l)),this.possibilities=Array.from({length:a-o},(l,c)=>c+o)):s==="F"?(this.possibilities=[-1,0,1],this.fudge=!0):(s==="%"?a=100:a=Number(s),Number(a)<0&&!o&&(o=-1),Number(a)l+o)),this.conditions=this.lexeme.conditions??[]}get faces(){return{max:this.possibilities[this.possibilities.length-1],min:this.possibilities[0]}}getShapes(e){if(this.shapes.has(e))return this.shapes.get(e);let t=this.renderer.getDiceForRoller(this);return e!=null&&this.shapes.set(e,t),t}get text(){return`${this.result}`}get result(){if(this.static)return this.multiplier*Number(this.dice);let e=[...this.results].map(([,{usable:t,value:i}])=>t?i:0);return this.multiplier*e.reduce((t,i)=>t+i,0)}get display(){if(this.static)return`${this.result}`;let e=[`[${[...this.results].map(([,{modifiers:t,display:i}])=>`${i}${[...t].join("")}`).join(", ")}]`];return this.conditions.length&&e.push(this.conditions.map(({result:t,operator:i})=>`${i}${t}`).join("")),e.join("")}get modifierText(){let e=this.conditions.map(({value:i})=>i).join(""),t=[...this.modifiers].map(([i,{conditionals:n,value:s}])=>{let o=n.map(a=>a.value);return`${s}${o.join("")}`}).join("");return`${e}${t}`}keepLow(e=1){if(!this.modifiersAllowed){new bn.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>t[1].value-i[1].value).slice(e-this.results.size).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}keepHigh(e=1){if(!this.modifiersAllowed){new bn.Notice("Modifiers are only allowed on dice rolls.");return}[...this.results].sort((t,i)=>i[1].value-t[1].value).slice(e).forEach(([t])=>{let i=this.results.get(t);i.usable=!1,i.modifiers.add("d"),this.results.set(t,{...i})})}async reroll(e,t){if(!this.modifiersAllowed){new bn.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.min,lexemes:[{value:`${this.faces.min}`,text:`${this.faces.min}`,type:"dice"}],value:""});let i=0,n=[...this.results].filter(([,{value:s}])=>this.checkCondition(s,t));for(;i0;){let s=[];for(let[o,a]of n)s.push(new Promise(async l=>{a.modifiers.add("r");let c=this.getShapes(o),u=await this.getValue(c);a.value=u,a.display=`${u}`,l()}));await Promise.all(s),n=n.filter(([,{value:o}])=>this.checkCondition(o,t)),i++}n.forEach(([s,o])=>{this.results.set(s,o)})}async explode(e,t,i=!1){if(!this.modifiersAllowed){new bn.Notice("Modifiers are only allowed on dice rolls.");return}t.length||t.push({operator:"=",comparer:this.faces.max,lexemes:[{value:`${this.faces.max}`,text:`${this.faces.max}`,type:"dice"}],value:""});let n=[...this.results].filter(([,{value:o}])=>this.checkCondition(o,t)),s=0;await Promise.all(n.map(async([o,a])=>{if(i){let l=await this.getValue(),c=0;for(a.modifiers.add("!"),a.value+=l,a.display=`${a.value}`,this.results.set(o,a);cthis.faces.min+t).every(t=>this.possibilities.includes(t))}async getValue(e){let t;if(this.shouldRender&&this.canRender()){let i=e??this.renderer.getDiceForRoller(this)??[];await this.renderer.addDice(i),t=this.#e(i)}else t=this.getValueSync();return t}getValueSync(){return this.getRandomValue()}getMaxPossible(){return this.static?Number(this.dice):this.multiplier===-1?this.multiplier*Math.min(...this.possibilities)*this.rolls:Math.max(...this.possibilities)*this.rolls}getMinPossible(){return this.static?Number(this.dice):this.multiplier===-1?this.multiplier*Math.max(...this.possibilities)*this.rolls:Math.min(...this.possibilities)*this.rolls}#e(e=[]){if(!e.length)return this.getValueSync();let t=e.map(i=>i.getUpsideValue());if(this.faces.max===100){let[i,n]=t;return i===10&&n==10?100:(n==10&&(n=0),i==10&&(i=0),i*10+n)}return t.reduce((i,n)=>i+n)}#t(e=0){return{usable:!0,value:e,display:`${e}`,modifiers:new Set}}async applyModifiers(){for(let[e,t]of this.modifiers)e=="kh"||e=="kl"||await this.applyModifier(e,t);this.modifiers.has("kh")&&await this.applyModifier("kh",this.modifiers.get("kh")),this.modifiers.has("kl")&&await this.applyModifier("kl",this.modifiers.get("kl"))}setResults(e){this.results=new Map([...e].map(([t,i])=>[t,this.#t(i)])),this.updateResultArray()}rollSync(){let e=new Map;for(let t=0;t{let s=await this.getValue(this.getShapes(i));e.set(i,s),n()}));await Promise.all(t)}return e}applyConditions(){for(let e of this.results.values()){let t=this.conditions.find(({operator:n})=>n==="-="||n==="=-");if(t&&e.value===t.comparer){e.value=-1,e.modifiers.add("-");continue}this.checkCondition(e.value,this.conditions)?(e.modifiers.add("*"),e.value=1):e.usable=!1}}updateResultArray(){this.resultArray=[...this.results.values()].map(e=>e.value)}async applyModifier(e,t){switch(e){case"sort":{let i;t.value=="sa"?i=[...this.results.values()].sort((n,s)=>n.value-s.value):i=[...this.results.values()].sort((n,s)=>s.value-n.value),this.results=new Map([...this.results.keys()].map(n=>[n,i[n]])),this.updateResultArray();break}case"kh":{this.keepHigh(t.data);break}case"kl":{this.keepLow(t.data);break}case"!":{await this.explode(t.data,t.conditionals);break}case"!!":{await this.explode(t.data,t.conditionals,!0);break}case"r":{await this.reroll(t.data,t.conditionals);break}case"u":{await this.makeUnique();break}case"condition":}}async makeUnique(){let e=[...this.results.values()];if(new Set(this.possibilities).sizei.value)).size==this.results.size)return;let t=0;for(;new Set(e.map(i=>i.value)).size!=this.results.size&&t<100;){let i=[];for(let[n,s]of this.results)i.push(new Promise(async o=>{let a=e.find(l=>l.value==s.value&&l!=s);a&&(a.value=await this.getValue(this.getShapes(n)),a.display=`${a.value}`,a.modifiers.add("u")),o()}));await Promise.all(i),e=[...this.results.values()],t++}}checkCondition(e,t){if(!t||!t.length)return e;let i=!1;for(let n of t){let{operator:s,comparer:o,lexemes:a}=n;if(Number.isNaN(e)||!s?.length||!o)continue;let l=new wh(o,a);if(l.rollSync(),n.result=l.result,!Number.isNaN(n.result)){switch(s){case"=":i=e===n.result;break;case"!=":case"=!":i=e!==n.result;break;case"<":i=e":i=e>n.result;break;case">=":i=e>=n.result;break}if(i)return i}}return i}allowAverage(){return!0}average(){return this.possibilities.reduce((e,t)=>e+t)/this.possibilities.length}getRandomValue(){let e=Math.floor(Math.random()*this.possibilities.length);return this.possibilities[e]}getGeometries(){return[...this.shapes.values()].flat()}async render(){this.shouldRender=!0,await this.roll(),this.shouldRender=!1}},_i=class extends oi{constructor(t,i,n){super("3d6",i,n);this.dice=t}get doubles(){return new Set([...this.results].map(([,{usable:t,value:i}])=>t?i:0)).size<3}get result(){return this.static?Number(this.dice):[...this.results].map(([,{usable:i,value:n}])=>i?n:0).reduce((i,n)=>i+n,0)}get display(){let t=[];for(let i of this.results){if(i[0]==0&&this.doubles){t.push(`${i[1].value}S`);continue}t.push(`${i[1].value}`)}return`[${t.join(", ")}]`}allowAverage(){return!1}},El=class extends oi{constructor(t,i,n){super(t,i,n);this.dice=t;this.stack=[];let s=`${this.faces.max}`.split("");for(let o=0;ot.map(i=>i.result).join(",")).join("|")}async roll(){return!this.stack||!this.stack.length?super.roll():(this.stack.forEach(t=>t.map(i=>i.roll())),[...this.stack.map(t=>t.map(i=>i.result)).flat()])}allowAverage(){return!1}},wh=class extends sr{constructor(t,i){super();this.original=t;this.lexemes=i;this.operators={"+":(t,i)=>t+i,"-":(t,i)=>t-i,"*":(t,i)=>t*i,"/":(t,i)=>t/i,"^":(t,i)=>Math.pow(t,i)};this.stack=[];this.stackCopy=[];this.stunted="";this.dice=[]}async roll(){return this.rollSync()}rollSync(){this.stunted="",this.parseLexemes();let t=this.stack.pop();return t.rollSync(),t instanceof _i&&t.doubles&&(this.stunted=` - ${t.results.get(0).value} Stunt Points`),this.result=t.result,this.result}parseLexemes(){let t=0;for(let i of this.lexemes)switch(i.type){case"+":case"-":case"*":case"/":case"^":case"math":let n=this.stack.pop(),s=this.stack.pop();n.rollSync(),n instanceof _i&&n.doubles&&(this.stunted=` - ${n.results.get(0).value} Stunt Points`),s.rollSync(),s instanceof _i&&s.doubles&&(this.stunted=` - ${s.results.get(0).value} Stunt Points`);let o=this.operators[i.value](s.result,n.result);this.stackCopy.push(i.value),this.stack.push(new oi(`${o}`,null,i));break;case"u":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("u",{data:l,conditionals:[],value:i.text});break}case"kh":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("kh",{data:l,conditionals:[],value:i.text});break}case"dl":{let a=this.dice[t-1],l=i.value?Number(i.value):1;l=a.rolls-l,a.modifiers.set("kh",{data:l,conditionals:[],value:i.text});break}case"kl":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("kl",{data:l,conditionals:[],value:i.text});break}case"dh":{let a=this.dice[t-1],l=i.value?Number(i.value):1;l=a.rolls-l,a.modifiers.set("kl",{data:l,conditionals:[],value:i.text});break}case"!":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("!",{data:l,conditionals:i.conditions??[],value:i.text});break}case"!!":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("!!",{data:l,conditionals:i.conditions??[],value:i.text});break}case"r":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("r",{data:l,conditionals:i.conditions??[],value:i.text});break}case"sort":{let a=this.dice[t-1],l=Number(i.value);a.modifiers.set("sort",{data:l,conditionals:i.conditions??[],value:i.value});break}case"dice":{if(i.parenedDice&&/^d/.test(i.value)&&this.stack.length){let a=this.stack.pop();i.value=`${a.result}${i.value}`,this.dice[t]=new oi(i.value,null,i)}this.dice[t]||(this.dice[t]=new oi(i.value,null,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}case"stunt":{this.dice[t]||(this.dice[t]=new _i(i.value,null,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}case"%":{this.dice[t]||(this.dice[t]=new El(i.value,null,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}}}},Pt=class extends Dn{constructor(t,i,n,s,o,a=t.showDice,l,c=t.initialDisplay,u=t.displayFormulaAfter,h=t.round,d=t.signed){super(t,i,n,a);this.data=t;this.original=i;this.lexemes=n;this.renderer=s;this.app=o;this.displayFixedText=!1;this.stunted="";this.shouldRender=!1;this.isRendering=!1;this.showFormula=!1;this.operators={"+":(t,i)=>t+i,"-":(t,i)=>t-i,"*":(t,i)=>t*i,"/":(t,i)=>t/i,"^":(t,i)=>Math.pow(t,i)};this.stack=[];this.maxStack=[];this.minStack=[];this.stackCopy=[];this.dice=[];this.hasRunOnce=!1;this.max=Number.MIN_VALUE;this.min=Number.MAX_VALUE;u&&this.containerEl.createSpan({cls:"dice-roller-formula",text:`(${i})`}),this.fixedText=l,this.expectedValue=c,this.displayFixedText=this.fixedText!=="",this.round=h,this.signed=d,this.loaded=!0,this.trigger("loaded")}async getReplacer(){return`${this.showFormula?`${this.inlineText} `:""}${this.result}`}get resultText(){let t=[],i=0;return this.dice.forEach(n=>{let s=this.original.slice(i);t.push(s.slice(0,s.indexOf(n.lexeme.text)),n.display),i+=s.indexOf(n.lexeme.text)+n.lexeme.text.length+n.modifierText.length}),t.push(this.original.slice(i)),t.join("")}get tooltip(){return this.isRendering?this.original:this._tooltip?this._tooltip:this.expectedValue==="Roll"||this.shouldRender?this.displayFixedText?`${this.original} + a`,"a","",""];this.setColor({diceColor:"#76CDDB",textColor:"#000000"})}},Tl=class extends Ml{constructor(t,i,n=Dn,s){super(t,i,n,s);this.labels=["","","","t","f","",""];this.setColor({diceColor:"#000000",textColor:"#FFFFFF"})}};var Cl=class{constructor(){this.resources=new Map}isTracking(e){return this.resources.has(e)}#e(e,t){if(Array.isArray(e))e.forEach(i=>{(this.resources.get(t)??[]).push(i),this.#e(i,t)});else{let i=this.resources.get(t??e)??[];this.resources.set(t??e,i)}}track(e){if("dispose"in e&&this.#e(e),e instanceof Ge&&this.#e(e),"geometry"in e&&this.#e(e.geometry,e),"material"in e&&this.#e(e.material,e),"children"in e&&this.#e(e.children,e),e instanceof ft)for(let t of Object.values(e))t instanceof lt&&this.#e(t);return e}untrack(e){this.resources.delete(e)}dispose(){for(let[e]of this.resources)this.disposeResource(e);this.resources.clear()}disposeResource(e){"parent"in e&&e.parent&&e.parent.remove(e),"dispose"in e&&e.dispose();for(let t of this.resources.get(e)??[])this.disposeResource(t);this.resources.delete(e)}};var Dt={D4:"4",D6:"6",D8:"8",D10:"10",D12:"12",D20:"20",D100:"100",FUDGE:"fudge",STUNT:"stunt",NONE:"none"};var Vh=class r extends Xn.Component{constructor(){super();this.event=new Xn.Events;this.tracker=new Cl;this.container=createDiv("renderer-container");this.#e=new Set;this.shadows=!0;this.iterations=0;this.frame_rate=1/60;this.loaded=!1;this.#t=!1;this.#i=new WeakMap;this.colors={ambient:16777215,spotlight:16777215};this.display={currentWidth:null,currentHeight:null,containerWidth:null,containerHeight:null,aspect:null,scale:null};this.cameraHeight={max:null,close:null,medium:null,far:null};this.#n=new WeakMap;this.extraFrames=r.DEFAULT_EXTRA_FRAMES;this.renderer=new qe({alpha:!0,antialias:!0})}#e;get WIDTH(){return this.container.clientWidth/2}get HEIGHT(){return this.container.clientHeight/2}get ASPECT(){return this.WIDTH/this.HEIGHT}get scale(){return(this.WIDTH*this.WIDTH+this.HEIGHT*this.HEIGHT)/13}get canvasEl(){return this.renderer?this.renderer.domElement:null}#t;setData(t){this.data=t,this.factory?(this.factory.width=this.WIDTH,this.factory.height=this.HEIGHT,this.factory.updateDice(this.data)):this.factory=new Hh(this.WIDTH,this.HEIGHT,{diceColor:this.data.diceColor,textColor:this.data.textColor,colorfulDice:this.data.colorfulDice,scaler:this.data.scaler,textFont:this.data.textFont})}getDiceForRoller(t){return this.factory.getDiceForRoller(t,this.getVector())}#i;async addDice(t){return new Promise(i=>{this.#t||this.start();for(let n of t)n.recreate(this.getVector(),this.WIDTH,this.HEIGHT),this.scene.add(this.tracker.track(n.geometry)),this.world.add(n);this.#e.add(t),this.#i.set(t,()=>{i()})})}onload(){this.loaded=!0,this.addChild(this.factory),this.container.empty(),this.container.style.opacity="1",this.renderer.shadowMap.enabled=this.shadows,this.renderer.shadowMap.type=Bh,this.container.appendChild(this.renderer.domElement),document.body.appendChild(this.container),this.renderer.setClearColor(0,0),this.scene=new Vs,this.initScene(),this.initWorld(),this.registerDomEvent(window,"resize",()=>{this.initScene()})}onunload(){this.stop(),this.loaded=!1,cancelAnimationFrame(this.animation),this.container.detach(),this.container.empty(),this.renderer.domElement.detach(),this.factory.dispose(),this.renderer.renderLists.dispose(),this.renderer.dispose(),this.tracker.dispose(),[...this.#e.values()].flat().forEach(t=>{this.world.world.removeBody(t.body)}),this.#e=new Set}start(){this.#t&&this.unload(),this.loaded||this.load(),this.#t=!0,this.extraFrames=r.DEFAULT_EXTRA_FRAMES,this.render()}static{this.DEFAULT_EXTRA_FRAMES=30}enableShadows(){this.shadows=!0,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}disableShadows(){this.shadows=!1,this.renderer&&(this.renderer.shadowMap.enabled=this.shadows),this.light&&(this.light.castShadow=this.shadows),this.desk&&(this.desk.receiveShadow=this.shadows)}get mw(){return Math.max(this.WIDTH,this.HEIGHT)}setDimensions(t){this.display.currentWidth=this.container.clientWidth/2,this.display.currentHeight=this.container.clientHeight/2,t?(this.display.containerWidth=t.w,this.display.containerHeight=t.h):(this.display.containerWidth=this.display.currentWidth,this.display.containerHeight=this.display.currentHeight),this.display.aspect=Math.min(this.display.currentWidth/this.display.containerWidth,this.display.currentHeight/this.display.containerHeight),this.display.scale=Math.sqrt(this.display.containerWidth*this.display.containerWidth+this.display.containerHeight*this.display.containerHeight)/13,this.renderer.setSize(this.display.currentWidth*2,this.display.currentHeight*2),this.cameraHeight.max=this.display.currentHeight/this.display.aspect/Math.tan(10*Math.PI/180),this.factory.width=this.display.currentWidth,this.factory.height=this.display.currentHeight,this.factory.updateDice(this.data),this.cameraHeight.medium=this.cameraHeight.max/1.5,this.cameraHeight.far=this.cameraHeight.max,this.cameraHeight.close=this.cameraHeight.max/2}initCamera(){this.camera&&this.scene.remove(this.camera),this.camera=new Et(20,this.display.currentWidth/this.display.currentHeight,1,this.cameraHeight.max*1.3),this.camera.position.z=this.cameraHeight.far,this.camera.lookAt(new P(0,0,0))}initLighting(){let t=Math.max(this.display.containerWidth,this.display.containerHeight);this.light&&this.scene.remove(this.light),this.ambientLight&&this.scene.remove(this.ambientLight),this.light=new oo(this.colors.spotlight,.25),this.light.position.set(-t/2,t/2,t*3),this.light.target.position.set(0,0,0),this.light.distance=t*5,this.light.angle=Math.PI/4,this.light.castShadow=this.shadows,this.light.shadow.camera.near=t/10,this.light.shadow.camera.far=t*5,this.light.shadow.camera.fov=50,this.light.shadow.bias=.001,this.light.shadow.mapSize.width=1024,this.light.shadow.mapSize.height=1024,this.scene.add(this.tracker.track(this.light)),this.ambientLight=new ao(16777215,.9),this.scene.add(this.tracker.track(this.ambientLight))}initDesk(){this.desk&&this.scene.remove(this.desk);let t=new so;t.opacity=.5,this.desk=new pt(new Gr(this.display.containerWidth*6,this.display.containerHeight*6,1,1),t),this.desk.receiveShadow=this.shadows,this.scene.add(this.tracker.track(this.desk))}initScene(){this.setDimensions(),this.initCamera(),this.initLighting(),this.initDesk(),this.camera.updateProjectionMatrix(),this.renderer.render(this.scene,this.camera)}initWorld(){this.world=new Uh(this.WIDTH,this.HEIGHT),this.iterations=0}finishRender(){this.event.trigger("throw-finished")}#n;static{this.Threshold=5}throwFinished(){let t=!0;for(let i of this.#e){let n=!0;for(let s of i){if(s.iterations>10/this.frame_rate&&(s.stopped=!0),s.stopped===!0)continue;let o=s.body.angularVelocity,a=s.body.velocity;if(Math.abs(o.length())5){s.stopped=!0;continue}n=!1,t=!1}else s.iterations++,s.stopped=!1,n=!1,t=!1}n&&this.#i.has(i)&&(this.#i.get(i)(),this.#i.delete(i))}return t}unrender(){this.container.style.opacity="0",cancelAnimationFrame(this.animation),this.registerInterval(window.setTimeout(()=>{this.stop()},1e3))}stop(){if(this.#t)for(let t of[...this.#e]){this.#i.has(t)&&(this.#i.get(t)(),this.#i.delete(t));for(let i of t)i.stopped=!0}this.#t=!1,this.unload()}resizeRendererToDisplaySize(){let t=this.renderer.domElement,i=window.devicePixelRatio,n=t.clientWidth*i|0,s=t.clientHeight*i|0,o=t.width!==n||t.height!==s;return o&&this.renderer.setSize(n,s,!1),o}render(){if(this.throwFinished())if(this.extraFrames>10)this.extraFrames--;else{try{if(this.data.renderTime)this.registerInterval(window.setTimeout(()=>this.unrender(),this.data.renderTime));else{let i=function(){t.unload(),document.body.removeEventListener("click",i)},t=this;this.registerDomEvent(document.body,"click",i)}}catch(t){this.event.trigger("error",t)}return}this.animation=requestAnimationFrame(()=>this.render()),this.resizeRendererToDisplaySize()&&(this.camera.aspect=this.canvasEl.clientWidth/this.canvasEl.clientHeight,this.camera.updateProjectionMatrix()),this.world.step(this.frame_rate),this.iterations++,[...this.#e.values()].forEach(t=>t.forEach(i=>i.set())),this.renderer.render(this.scene,this.camera)}getVector(){return{x:(Math.random()*2-1)*this.WIDTH,y:-(Math.random()*2-1)*this.HEIGHT}}dispose(...t){t.forEach(i=>{i.children&&this.dispose(...i.children),i.clear()})}},Mt=new Vh,Uh=class{constructor(e,t){this.WIDTH=e;this.HEIGHT=t;this.world=new $o({gravity:new b(0,0,-9.82*200)});this.ground=this.getPlane();this.diceMaterial=new on;this.deskMaterial=new on;this.barrierMaterial=new on;this.world.broadphase=new gr,this.world.allowSleep=!0,this.ground.position.set(0,0,0),this.world.addBody(this.ground),this.buildWalls()}add(...e){e.forEach(t=>{this.world.addBody(t.body)})}remove(...e){e.forEach(t=>this.world.removeBody(t.body))}step(e=1/60){let t=performance.now()/1e3;if(!this.lastCallTime)this.world.step(e);else{let i=t-this.lastCallTime;this.world.step(e,i)}this.lastCallTime=t}buildWalls(){this.world.addContactMaterial(new rn(this.deskMaterial,this.diceMaterial,{friction:.01,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new rn(this.barrierMaterial,this.diceMaterial,{friction:.01,restitution:1,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addContactMaterial(new rn(this.diceMaterial,this.diceMaterial,{friction:.1,restitution:.5,contactEquationRelaxation:3,contactEquationStiffness:1e8})),this.world.addBody(new De({allowSleep:!1,mass:0,shape:new Ui,material:this.deskMaterial}));let e=new De({allowSleep:!1,mass:0,shape:new Ui,material:this.barrierMaterial});e.quaternion.setFromAxisAngle(new b(1,0,0),Math.PI/2),e.position.set(0,this.HEIGHT*.93,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Ui,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(1,0,0),-Math.PI/2),e.position.set(0,-this.HEIGHT*.93,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Ui,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(0,1,0),-Math.PI/2),e.position.set(this.WIDTH*.93,0,0),this.world.addBody(e),e=new De({allowSleep:!1,mass:0,shape:new Ui,material:this.barrierMaterial}),e.quaternion.setFromAxisAngle(new b(0,1,0),Math.PI/2),e.position.set(-this.WIDTH*.93,0,0),this.world.addBody(e)}getPlane(){return new De({type:De.STATIC,shape:new Ui})}},Hh=class extends Xn.Component{constructor(t,i,n){super();this.width=t;this.height=i;this.options=n;this.dice={};this.updateDice=(0,Xn.debounce)(t=>{this.options={...t},this.dispose(),this.buildDice()},200);this.buildDice()}get colors(){let t=this.options.diceColor,i=this.options.textColor,n=this.options.textFont;if(!this.options.colorfulDice)return{diceColor:t,textFont:n}}onunload(){this.dispose()}disposeChildren(...t){t.forEach(i=>{"dispose"in i&&i.dispose(),i.children&&this.disposeChildren(...i.children)})}dispose(){for(let t of Object.values(this.dice))this.disposeChildren(t.geometry.children)}getDiceForRoller(t,i){let n=[];switch(t.getType()){case Dt.D4:{n.push(new ul(this.width,this.height,this.clone("d4"),i));break}case Dt.FUDGE:{n.push(new Js(this.width,this.height,this.clone("fudge"),i));break}case Dt.STUNT:{n.push(new Js(this.width,this.height,this.clone("stunt"),i));break}case Dt.D6:{n.push(new Js(this.width,this.height,this.clone("d6"),i));break}case Dt.D8:{n.push(new cl(this.width,this.height,this.clone("d8"),i));break}case Dt.D10:{n.push(new Zs(this.width,this.height,this.clone("d10"),i));break}case Dt.D12:{n.push(new ll(this.width,this.height,this.clone("d12"),i));break}case Dt.D20:{n.push(new al(this.width,this.height,this.clone("d20"),i));break}case Dt.D100:{n.push(new Zs(this.width,this.height,this.clone("d100"),i,!0),new Zs(this.width,this.height,this.clone("d10"),i,!0));break}case Dt.NONE:break}return n}getDice(t,i){let n=new Map;for(let s of t.dynamic){let o=this.getDiceForRoller(s,i);o.length&&n.set(s,o)}return n}clone(t){if(!(t in this.dice))throw new Error("That dice type does not exist!");return this.dice[t].clone()}buildDice(){this.dice.d100=new ml(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d20=new dl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d12=new pl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d10=new fl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d8=new gl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d6=new Ks(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.d4=new vl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.fudge=new yl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.stunt=new xl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.boost=new Dl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.ability=new Al(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.difficulty=new Sl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.challenge=new _l(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.proficiency=new bl(this.width,this.height,this.colors,this.options.scaler).create(),this.dice.setback=new Tl(this.width,this.height,this.colors,this.options.scaler).create()}};var Qs=(n=>(n.None="None",n.Normal="Normal",n.Up="Up",n.Down="Down",n))(Qs||{});var Ot={LEFT:"LEFT",RIGHT:"RIGHT",NONE:"NONE"};var ri=require("obsidian");var fo=class extends ri.Component{constructor(){super(...arguments);this.components=[];this.#e=new ri.Events}on(t,i,n){return this.#e.on(t,i)}once(t,i){let n=this.on(t,(...s)=>{i(...s),this.offref(n)})}off(t,i){return this.#e.off(t,i)}offref(t){return this.#e.offref(t)}trigger(t,...i){return this.#e.trigger(t,...i)}tryTrigger(t,i){return this.#e.tryTrigger(t,i)}onunload(){this.components=[]}addContexts(...t){this.components=t;for(let i of t)i.addChild(this)}#e;getRandomBetween(t,i){let n=new Uint32Array(1);crypto.getRandomValues(n);let s=n[0]/4294967296;return Math.floor(s*(i-t+1))+t}},Rl=class extends fo{constructor(t,i="",n=t.position){super();this.data=t;this.original=i;this.loaded=!1;switch(this.original||(this.original=""),this.containerEl=createSpan({cls:"dice-roller",attr:{"aria-label-position":"top","data-dice":this.original}}),this.resultEl=this.containerEl.createSpan("dice-roller-result"),this.iconEl=createSpan({cls:"dice-roller-button"}),(0,ri.setIcon)(this.iconEl,"dices"),this.iconEl.onclick=this.onClick.bind(this),n){case"LEFT":{this.containerEl.prepend(this.iconEl);break}case"RIGHT":{this.containerEl.append(this.iconEl);break}case"NONE":{this.containerEl.addClass("no-icon");break}}this.containerEl.onclick=this.onClick.bind(this)}onLoad(t){this.loaded?t():this.on("loaded",()=>t())}onunload(){this.containerEl.empty();let t=createEl("pre");t.createEl("code",{text:this.original}),this.containerEl.append(t)}setTooltip(){this.data.displayResultsInline||this.containerEl.setAttrs({"aria-label":this.tooltip})}getRandomBetween(t,i){let n=new Uint32Array(1);crypto.getRandomValues(n);let s=n[0]/4294967296;return Math.floor(s*(i-t+1))+t}async render(){this.setTooltip(),await this.build()}async onClick(t){t.stopPropagation(),t.stopImmediatePropagation(),window.getSelection()?.isCollapsed&&await this.roll()}},Yn=class extends Rl{constructor(t,i,n,s=t.position){super(t,i,s);this.data=t;this.original=i;this.lexemes=n;this.position=s;this.save=!1}setSource(t){this.source=t}getSource(){return this.source}get inlineText(){return`${this.tooltip.split(` +`).join(" -> ")} -> `}},mo=class extends Yn{constructor(t,i,n,s,o,a=t.position){super(t,i,[n],a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.app=o;this.dirtyEl=this.containerEl.createDiv({cls:"dice-roller-dirty dice-roller-button",attr:{"aria-label":"The underlying data source for this roller was modified"}});this.#t=!1;this.getPath()}async getFile(){if(this.file=this.app.metadataCache.getFirstLinkpathDest(this.path,this.source),!this.file||!(this.file instanceof ri.TFile))throw new Error("Could not load file.")}#e;async render(){super.render(),this.dirtyEl.empty()}async checkForDirtiness(t){let i=await this.hash(t);return i===this.#e?(this.dirtyEl.empty(),!1):(this.#e&&(0,ri.setIcon)(this.dirtyEl,"alert-triangle"),this.#e=i,!0)}async hash(t){return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t))),i=>i.toString(16).padStart(2,"0")).join("")}#t;async onload(){if(this.#t)return;this.#t=!0,await this.getFile();let t=this.app.metadataCache.getFileCache(this.file),i=await this.app.vault.cachedRead(this.file);await this.getOptions(t,i),this.loaded=!0,this.trigger("loaded"),this.registerEvent(this.app.metadataCache.on("changed",async(n,s,o)=>{n===this.file&&await this.getOptions(o,s)}))}},er=class extends mo{constructor(t,i,n,s,o,a=t.position,l=!0){super(t,i,n,s,o,a);this.data=t;this.original=i;this.lexeme=n;this.app=o;this.inline=l;this.data.displayAsEmbed&&(this.containerEl.addClasses(["has-embed","markdown-embed"]),this.resultEl.addClass("internal-embed")),this.resultEl.setAttrs({src:s}),this.copy=this.containerEl.createDiv({cls:"dice-content-copy dice-roller-button no-show",attr:{"aria-label":"Copy Contents"}}),this.copy.addEventListener("click",c=>{c.stopPropagation(),navigator.clipboard.writeText(this.transformResultsToString()).then(async()=>{new ri.Notice("Result copied to clipboard.")})}),(0,ri.setIcon)(this.copy,"copy")}getEmbedClass(){return this.data.displayAsEmbed?"markdown-embed":""}},Fl=class extends Rl{constructor(t,i,n){super(t,"");this.options=i;this.rolls=n}get tooltip(){return`${this.options.toString()} + +${this.results.toString()}`}async roll(){let t=[...this.options];return this.results=[...Array(this.rolls)].map(()=>{let i=t[this.getRandomBetween(0,t.length-1)];return t.splice(t.indexOf(i),1),i}).filter(i=>i),this.render(),this.trigger("new-result"),this.result=this.results[0],this.results[0]}async build(){this.resultEl.empty(),this.resultEl.setText(this.results.toString())}};var go=class extends At{constructor(t,i){super(t,i);this.dice=t;this.stack=[];let n=`${this.faces.max}`.split("");for(let s=0;st.map(i=>i.result).join(",")).join("|")}async roll(){if(!this.stack||!this.stack.length)return super.roll();this.stack.forEach(t=>t.map(i=>i.roll()))}allowAverage(){return!1}};var Gh=class extends At{getType(){return Dt.STUNT}canRender(){return!0}constructor(){super("1d6")}allowAverage(){return!1}},mi=class extends At{constructor(t,i){super(t,i);this.dice=t;this.pair=new At("2d6");this.stunt=new Gh}async roll(){await Promise.all([new Promise(async t=>{this.pair.shouldRender=this.shouldRender,await this.pair.roll(),t()}),new Promise(async t=>{this.stunt.shouldRender=this.shouldRender,await this.stunt.roll(),t()})])}get doubles(){return new Set([...this.pair.resultArray,this.stunt.result]).size<3}get result(){return this.pair.result+this.stunt.result}get display(){return`${[this.pair.display,`${this.stunt.display}${this.doubles?"S":""}`].join(", ")}`}};var yo=class extends At{constructor(){super(...arguments);this.possibilities=[-1,0,1]}getType(){return Dt.FUDGE}canRender(){return!0}};var hl=class extends fo{constructor(t,i){super();this.original=t;this.lexemes=i;this.operators={"+":(t,i)=>t+i,"-":(t,i)=>t-i,"*":(t,i)=>t*i,"/":(t,i)=>t/i,"^":(t,i)=>Math.pow(t,i)};this.stack=[];this.stackCopy=[];this.stunted="";this.dice=[]}async roll(){return this.rollSync()}rollSync(){this.stunted="",this.parseLexemes();let t=this.stack.pop();return t.rollSync(),t instanceof mi&&t.doubles&&(this.stunted=` - ${t.results.get(0).value} Stunt Points`),this.result=t.result,this.result}parseLexemes(){let t=0;for(let i of this.lexemes)switch(i.type){case"+":case"-":case"*":case"/":case"^":case"math":let n=this.stack.pop(),s=this.stack.pop();n.rollSync(),n instanceof mi&&n.doubles&&(this.stunted=` - ${n.results.get(0).value} Stunt Points`),s.rollSync(),s instanceof mi&&s.doubles&&(this.stunted=` - ${s.results.get(0).value} Stunt Points`);let o=this.operators[i.value](s.result,n.result);this.stackCopy.push(i.value),this.stack.push(new At(`${o}`,i));break;case"u":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("u",{data:l,conditionals:[],value:i.text});break}case"kh":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("kh",{data:l,conditionals:[],value:i.text});break}case"dl":{let a=this.dice[t-1],l=i.value?Number(i.value):1;l=a.rolls-l,a.modifiers.set("kh",{data:l,conditionals:[],value:i.text});break}case"kl":{let a=this.dice[t-1],l=i.value?Number(i.value):1;a.modifiers.set("kl",{data:l,conditionals:[],value:i.text});break}case"dh":{let a=this.dice[t-1],l=i.value?Number(i.value):1;l=a.rolls-l,a.modifiers.set("kl",{data:l,conditionals:[],value:i.text});break}case"!":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("!",{data:l,conditionals:i.conditions??[],value:i.text});break}case"!!":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("!!",{data:l,conditionals:i.conditions??[],value:i.text});break}case"r":{let a=this.dice[t-1],l=Number(i.value)||1;a.modifiers.set("r",{data:l,conditionals:i.conditions??[],value:i.text});break}case"sort":{let a=this.dice[t-1],l=Number(i.value);a.modifiers.set("sort",{data:l,conditionals:i.conditions??[],value:i.value});break}case"dice":{if(i.parenedDice&&/^d/.test(i.value)&&this.stack.length){let a=this.stack.pop();i.value=`${a.result}${i.value}`,this.dice[t]=new At(i.value,i)}this.dice[t]||(this.dice[t]=new At(i.value,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}case"fudge":{this.dice[t]||(this.dice[t]=new yo(i.value,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}case"stunt":{this.dice[t]||(this.dice[t]=new mi(i.value,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}case"%":{this.dice[t]||(this.dice[t]=new go(i.value,i)),this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),t++;break}}}},qt=class extends Yn{constructor(t,i,n,s,o=t.position,a,l=t.initialDisplay,c=t.displayFormulaAfter,u=t.round,h=t.signed){super(t,i,n,o);this.data=t;this.original=i;this.lexemes=n;this.app=s;this.displayFixedText=!1;this.stunted="";this.shouldRender=!1;this.isRendering=!1;this.showFormula=!1;this.operators={"+":(t,i)=>t+i,"-":(t,i)=>t-i,"*":(t,i)=>t*i,"/":(t,i)=>t/i,"^":(t,i)=>Math.pow(t,i)};this.stack=[];this.maxStack=[];this.minStack=[];this.stackCopy=[];this.dice=[];this.hasRunOnce=!1;this.max=Number.MIN_VALUE;this.min=Number.MAX_VALUE;c&&this.containerEl.createSpan({cls:"dice-roller-formula",text:`(${i})`}),this.fixedText=a,this.expectedValue=l,this.displayFixedText=this.fixedText!=="",this.round=u,this.signed=h,this.loaded=!0,this.trigger("loaded")}onunload(){this.isRendering&&Mt.unrender(),super.onunload()}async getReplacer(){return`${this.showFormula?`${this.inlineText} `:""}${this.result}`}get resultText(){let t=[],i=0;return this.dice.forEach(n=>{let s=this.original.slice(i);t.push(s.slice(0,s.indexOf(n.lexeme.text)),n.display),i+=s.indexOf(n.lexeme.text)+n.lexeme.text.length+n.modifierText.length}),t.push(this.original.slice(i)),t.join("")}get tooltip(){return this.isRendering?this.original:this._tooltip?this._tooltip:this.expectedValue==="Roll"||this.shouldRender?this.displayFixedText?`${this.original} ${this.result} = ${this.resultText}`:`${this.original} ${this.resultText}`:this.expectedValue==="Average"?this.displayFixedText?`${this.original} ${this.result} = average: ${this.resultText}`:`${this.original} average: ${this.resultText}`:`${this.original} -empty`}allowAverage(){return this.dynamic.every(t=>t.allowAverage())}async build(){if(this.resultEl.empty(),this.expectedValue==="Average"&&!this.shouldRender){if(this.allowAverage()){for(let s of this.dynamic){let o=s.average(),a=new Map;for(let l=0;l0?"+":"",n;this.expectedValue==="None"&&!this.shouldRender?(this.showDice?n=[""]:n=["\xA0"],this.showFormula&&n.unshift(this.original+" -> ")):(n=[`${i}${t}`],this.showFormula&&n.unshift(this.inlineText)),this.expectedValue="Roll",this.displayFixedText?this.resultEl.setText(this.fixedText):this.resultEl.setText(n.join("")+this.stunted),this.result===this.max?this.containerEl.addClass("is-max"):this.containerEl.removeClass("is-max"),this.result===this.min?this.containerEl.addClass("is-min"):this.containerEl.removeClass("is-min")}async onClick(t){t.stopPropagation(),t.stopImmediatePropagation(),t.getModifierState("Alt")?this.expectedValue="Average":t.getModifierState("Control")&&(this.expectedValue="None"),t.getModifierState("Shift")?(await this.roll(!0),this.hasRunOnce=!0):window.getSelection()?.isCollapsed&&await this.roll()}get dynamic(){return this.dice.filter(t=>!t.static)}get static(){return this.dice.filter(t=>t.static)}get isStatic(){return this.dice.every(t=>t.static)}rollSync(){this.stunted="",this.buildDiceTree();for(let t of this.dice)t.rollSync();return this.calculate(),this._tooltip=null,this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}setSpinner(){this.resultEl.empty(),(0,bn.setIcon)(this.resultEl.createDiv("should-spin"),"loader-2")}async renderDice(){this.isRendering=!0,this.setTooltip(),this.setSpinner();let t=[];for(let i of this.dice)t.push(new Promise(async n=>{await i.render(),n()}));await Promise.all(t),this.isRendering=!1,this.setTooltip()}buildDiceTree(){let t=0;for(let i of this.lexemes)switch(i.type){case"+":case"*":case"/":case"^":case"-":case"math":continue;case"u":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("u",{data:s,conditionals:[],value:i.text});break}case"kh":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("kh",{data:s,conditionals:[],value:i.text});break}case"dl":{let n=this.dice[t-1],s=i.value?Number(i.value):1;s=n.rolls-s,n.modifiers.set("kh",{data:s,conditionals:[],value:i.text});break}case"kl":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("kl",{data:s,conditionals:[],value:i.text});break}case"dh":{let n=this.dice[t-1],s=i.value?Number(i.value):1;s=n.rolls-s,n.modifiers.set("kl",{data:s,conditionals:[],value:i.text});break}case"!":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("!",{data:s,conditionals:i.conditions??[],value:i.text});break}case"!!":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("!!",{data:s,conditionals:i.conditions??[],value:i.text});break}case"r":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("r",{data:s,conditionals:i.conditions??[],value:i.text});break}case"sort":{let n=this.dice[t-1],s=Number(i.value);n.modifiers.set("sort",{data:s,conditionals:i.conditions??[],value:i.value});break}case"dice":{if(i.parenedDice&&/^d/.test(i.value)&&this.stack.length){let n=this.stack.pop();i.value=`${n.result}${i.value}`,this.dice[t]=new oi(i.value,this.renderer,i)}this.dice[t]||(this.dice[t]=new oi(i.value,this.renderer,i)),t++;break}case"stunt":{this.dice[t]||(this.dice[t]=new _i(i.value,this.renderer,i)),t++;break}case"%":{this.dice[t]||(this.dice[t]=new El(i.value,this.renderer,i)),t++;break}}}async roll(t){if(this.stunted="",this.stackCopy=[],this.dice.length||this.buildDiceTree(),this.renderer.stop(),this.dice.forEach(i=>i.shouldRender=!1),t||this.shouldRender&&this.hasRunOnce)await this.renderDice();else for(let i of this.dice)await i.roll();return this.calculate(),this.render(),this.showRenderNotice&&(t||this.shouldRender&&this.hasRunOnce)&&new bn.Notice(`${this.tooltip} +empty`}allowAverage(){return this.dynamic.every(t=>t.allowAverage())}async build(){if(this.resultEl.empty(),this.expectedValue==="Average"&&!this.shouldRender){if(this.allowAverage()){for(let s of this.dynamic){let o=s.average(),a=new Map;for(let l=0;l0?"+":"",n;this.expectedValue==="None"&&!this.shouldRender?(this.position!=Ot.NONE?n=[""]:n=["\xA0"],this.showFormula&&n.unshift(this.original+" -> ")):(n=[`${i}${t}`],this.showFormula&&n.unshift(this.inlineText)),this.expectedValue="Roll",this.displayFixedText?this.resultEl.setText(this.fixedText):this.resultEl.setText(n.join("")+this.stunted),this.result===this.max?this.containerEl.addClass("is-max"):this.containerEl.removeClass("is-max"),this.result===this.min?this.containerEl.addClass("is-min"):this.containerEl.removeClass("is-min")}async onClick(t){t.stopPropagation(),t.stopImmediatePropagation(),t.getModifierState("Alt")?this.expectedValue="Average":t.getModifierState("Control")&&(this.expectedValue="None"),t.getModifierState("Shift")?(await this.roll(!0),this.hasRunOnce=!0):window.getSelection()?.isCollapsed&&await this.roll()}get dynamic(){return this.dice.filter(t=>!t.static)}get static(){return this.dice.filter(t=>t.static)}get isStatic(){return this.dice.every(t=>t.static)}rollSync(){this.stunted="",this.buildDiceTree();for(let t of this.dice)t.rollSync();return this.calculate(),this._tooltip=null,this.render(),this.trigger("new-result"),this.hasRunOnce=!0,this.result}setSpinner(){this.resultEl.empty(),(0,Bl.setIcon)(this.resultEl.createDiv("should-spin"),"loader-2")}async renderDice(){this.isRendering=!0,this.setTooltip(),this.setSpinner();let t=[];for(let i of this.dice)t.push(new Promise(async n=>{await i.render(),n()}));await Promise.all(t),this.isRendering=!1,this.setTooltip()}buildDiceTree(){let t=0;for(let i of this.lexemes)switch(i.type){case"+":case"*":case"/":case"^":case"-":case"math":continue;case"u":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("u",{data:s,conditionals:[],value:i.text});break}case"kh":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("kh",{data:s,conditionals:[],value:i.text});break}case"dl":{let n=this.dice[t-1],s=i.value?Number(i.value):1;s=n.rolls-s,n.modifiers.set("kh",{data:s,conditionals:[],value:i.text});break}case"kl":{let n=this.dice[t-1],s=i.value?Number(i.value):1;n.modifiers.set("kl",{data:s,conditionals:[],value:i.text});break}case"dh":{let n=this.dice[t-1],s=i.value?Number(i.value):1;s=n.rolls-s,n.modifiers.set("kl",{data:s,conditionals:[],value:i.text});break}case"!":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("!",{data:s,conditionals:i.conditions??[],value:i.text});break}case"!!":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("!!",{data:s,conditionals:i.conditions??[],value:i.text});break}case"r":{let n=this.dice[t-1],s=Number(i.value)||1;n.modifiers.set("r",{data:s,conditionals:i.conditions??[],value:i.text});break}case"sort":{let n=this.dice[t-1],s=Number(i.value);n.modifiers.set("sort",{data:s,conditionals:i.conditions??[],value:i.value});break}case"dice":{if(i.parenedDice&&/^d/.test(i.value)&&this.stack.length){let n=this.stack.pop();i.value=`${n.result}${i.value}`,this.dice[t]=new At(i.value,i)}this.dice[t]||(this.dice[t]=new At(i.value,i)),t++;break}case"fudge":{this.dice[t]||(this.dice[t]=new yo(i.value,i)),t++;break}case"stunt":{this.dice[t]||(this.dice[t]=new mi(i.value,i)),t++;break}case"%":{this.dice[t]||(this.dice[t]=new go(i.value,i)),t++;break}}}async roll(t){if(this.stunted="",this.stackCopy=[],this.dice.length||this.buildDiceTree(),Mt.stop(),this.dice.forEach(i=>i.shouldRender=!1),t||this.shouldRender&&this.hasRunOnce)await this.renderDice();else for(let i of this.dice)await i.roll();return this.calculate(),this.render(),this.showRenderNotice&&(t||this.shouldRender&&this.hasRunOnce)&&new Bl.Notice(`${this.tooltip} -Result: ${this.result}`),this.trigger("new-result"),this.app.workspace.trigger("dice-roller:new-result",this),this.hasRunOnce=!0,this.result}calculate(){let t=0;for(let n of this.lexemes)switch(n.type){case"+":case"-":case"*":case"/":case"^":case"math":{let s=this.stack.pop(),o=this.stack.pop();s instanceof _i&&s.doubles&&(this.stunted=` - ${s.results.get(0).value} Stunt Points`),o instanceof _i&&o.doubles&&(this.stunted=` - ${o.results.get(0).value} Stunt Points`);let a=this.operators[n.value](o.result,s.result),l=this.operators[n.value](this.minStack.pop(),this.minStack.pop()),c=this.operators[n.value](this.maxStack.pop(),this.maxStack.pop());this.stackCopy.push(n.value),this.stack.push(new oi(`${a}`,this.renderer,n)),this.minStack.push(l),this.maxStack.push(c);break}case"stunt":case"%":case"dice":this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),this.minStack.push(this.dice[t].getMinPossible()),this.maxStack.push(this.dice[t].getMaxPossible()),t++;default:continue}let i=this.stack.pop();this.min=this.minStack.pop(),this.max=this.maxStack.pop(),i instanceof _i&&i.doubles&&(this.stunted=` - ${i.results.get(0).value} Stunt Points`),this.result=i.result}};var _n=require("obsidian");var am=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,lm=/(?:(?\d+)[Dd]?)?dv\((?.+)\)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,cm=/(?.*)?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?
.+))?/,Sl=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;function f_(r){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",i=t.length;for(let n=0;n{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!this.data.displayResultsInline){let i="type"in e?e.type:"List Item";t.setAttrs({"aria-label":`${this.file.basename}: ${i}`})}if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(_n.MarkdownRenderer.render(app,this.displayFromCache(e),t.createDiv(),this.source,new _n.Component),this.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",n=>{n.stopPropagation(),navigator.clipboard.writeText(this.displayFromCache(e).trim()).then(async()=>{new _n.Notice("Result copied to clipboard.")})}),(0,_n.setIcon)(i,"copy")}}}async load(){await this.getOptions()}displayFromCache(...e){let t=[];for(let i of e)t.push(this.content.slice(i.position.start.offset,i.position.end.offset));return t.join(` - -`)}transformResultsToString(){return this.displayFromCache(...this.results)}async getBlockId(){this.result||await this.roll();let e=this.cache.blocks??{},t=Object.entries(e).find(([i,n])=>um(n.position,this.result.position));if(!t){let i=`${m_(4)}`,n=`${this.content.slice(0,this.result.position.end.offset+1)}^${i}${this.content.slice(this.result.position.end.offset)}`;return this.watch=!1,this.app.vault.modify(this.file,n),i}return t[0]}getPath(){let{groups:e}=this.lexeme.value.match(Sl)??{},{roll:t=1,link:i,types:n}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.types=n?.split(","),this.levels=n?.split(",").map(s=>/heading\-\d+/.test(s)?s.split("-").pop():null).filter(s=>s),this.types=n?.split(",").map(s=>/heading\-\d+/.test(s)?s.split("-").shift():s)}async getOptions(){if(this.cache=this.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.sections)throw new Error("Could not read file cache.");this.content=await this.app.vault.cachedRead(this.file),this.options=this.cache.sections.filter(({type:e,position:t})=>this.types?e=="heading"&&this.types.includes(e)&&this.levels.length?(this.cache.headings??[]).filter(({level:n})=>this.levels.includes(`${n}`)).some(({position:n})=>um(n,t)):this.types.includes(e):!["yaml","thematicBreak"].includes(e)),this.types&&this.types.includes("listItem")&&this.options.push(...this.cache.listItems),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])}})}},um=(r,e)=>r.start.col==e.start.col&&r.start.line==e.start.line&&r.start.offset==e.start.offset;var qi=require("obsidian");var ym=Qn(hm());var gm=Qn(pm());var mm=require("obsidian"),bh=Qn(fm());var _h=class extends mm.Component{constructor(){super(...arguments);this.inline=new Map;this.ready=!1}initialize(t){return this.app=t,this.api=(0,bh.getAPI)(),this.dataviewReady().then(()=>this.ready=!0),this}getFieldValueFromActiveFile(t){let i=this.app.workspace.getActiveFile();return!i||!this.canUseDataview||!this.ready?null:this.api.index.pages.get(i.path)?.fields.get(t)??null}get canUseDataview(){return this.app.plugins.getPlugin("dataview")!=null}async dataviewReady(){return new Promise(t=>{this.canUseDataview||t(!1),this.api&&t(!0),this.registerEvent(this.app.metadataCache.on("dataview:api-ready",()=>{this.api=(0,bh.getAPI)(),t(!0)}))})}},Vt=new _h;var x_=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,v_=/(?:\d+[Dd]?)?dv\((?:.+)\)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,w_=/(?:.*)?(?:\[.*\]\(|\[\[)(?:.+?)#?\^(?:.+?)(?:\)|\]\])\|?(?:.+)?/u,b_=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|?(?:.+)?/u,__=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|line/u,E_=/[\(\^\+\-\*\/\)]/u,A_=/(?:\d+|\b)[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b)/u,S_=/(?:=|=!|<|>|<=|>=|=<|=>|-=|=-)(?:\d+(?:[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b))?)/u,Eh=class{constructor(e){this.table=e}parse(e){let t=e.length,i=this.table,n=[],s=[],o=0;for(;oh||u===h&&c.associativity==="right")break;n.push(s.shift())}s.unshift(a)}else n.push(a)}}for(;s.length;){let a=s.shift();if(a.value!=="(")n.push(a);else throw new Error("Mismatched parentheses.")}return n}},Ah=class{constructor(){this.lexer=gm.compile({WS:[{match:/[ \t]+/u},{match:/[{}]+/u}],table:w_,line:__,section:b_,tag:x_,dataview:v_,condition:S_,kl:{match:/kl\d*/u,value:this.clampInfinite},kh:[{match:/kh\d*/u,value:this.clampInfinite},{match:/k\d*/u,value:this.clampInfinite}],dh:{match:/dh\d*/u,value:this.clampInfinite},dl:[{match:/dl\d*/u,value:this.clampInfinite}],"!!":{match:/!!(?:i|\d+)?/u,value:this.clampInfinite},"!":{match:/!(?:i|\d+)?/u,value:this.clampInfinite},r:{match:/r(?:i|\d+)?/u,value:this.clampInfinite},u:/u/u,stunt:/1[Dd]S/u,"%":/\d+[Dd]\d+%/u,dice:[{match:A_,value:e=>{let{roll:t=this.defaultRoll,faces:i=this.defaultFace}=e.match(/(?\d+)?[Dd](?%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\])?/).groups;return`${t}d${i}`}},{match:/\d+/u},{match:/\b[A-Za-z][A-Za-z0-9_]+\b/u,value:e=>Vt.getFieldValueFromActiveFile(e)??e}],sort:[{match:/s(?:a|d)*/u,value:e=>e=="s"||e=="sa"?"sa":"sd"}],math:E_});this.inline=new Map;this.parser=new Eh({"+":{precedence:1,associativity:"left"},"-":{precedence:1,associativity:"left"},"*":{precedence:2,associativity:"left"},"/":{precedence:2,associativity:"left"},"^":{precedence:3,associativity:"right"}})}clampInfinite(e){return/i$/.test(e)?"100":e.replace(/^\D+/g,"")}setInlineFields(e){this.inline=e}setDefaults(e,t){this.defaultRoll=e,this.defaultFace=t}setDefaultRoll(e){this.defaultRoll=e}setDefaultFace(e){this.defaultFace=e}parse(e){let t=Array.from(this.lexer.reset(e));return this.lexer.reset(),this.parser.parse(this.transform(t))}transform(e){e=e.filter(l=>l.type!="WS");let t=l=>l.type==="+"||l.type==="math"&&l.value==="+",i=l=>l.type==="-"||l.type==="math"&&l.value==="-",n=l=>t(l)||i(l),s=l=>l[l.length-1],o=(l,c)=>l.splice(l.length-1,1,c);e=e.reduce((l,c)=>{if(l.length==0)l.push(c);else{let u=s(l);n(u)&&n(c)?i(u)!=i(c)?i(u)||o(l,c):i(u)&&(u.type=u.type==="math"?u.type:"+",u.value="+"):l.push(c)}return l},[]);let a=[];for(let l of e)if(l.type=="condition"&&a.length>0){let c=a[a.length-1];c.conditions||(c.conditions=[]);let[u,h,d]=l.value.match(/(?=|=!|<|>|<=|>=|=<|=>|-=|=-)(?\d+(?:[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b))?)/)??[],p=this.parse(d);c.conditions.push({operator:h,comparer:d,lexemes:p,value:l.value})}else a.push(l);return a}},qn=new Ah;var Sh=class{constructor(){this.sources=new Map}initialize(e,t,i){this.data=e,this.app=t,this.renderer=i}#e(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="dataview")?"dataview":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}getParametersForRoller(e,t){e=e.replace(/\\\|/g,"|");let i=t?.showDice??!0,n=t?.shouldRender??this.data.renderAllDice,s=t?.showFormula??this.data.displayResultsInline,o=t?.showParens??this.data.displayFormulaAfter,a=t?.expectedValue??this.data.initialDisplay,l=t?.text??"",c=t?.round??this.data.round,u=t?.signed??this.data.signed,h=/\|text\((.*)\)/;if(e.includes("|nodice")&&(i=!1),e.includes("|render")&&(n=!0),e.includes("|norender")&&(n=!1),e.includes("|form")&&(s=!0),e.includes("|noform")&&(s=!1),e.includes("|avg")&&(a="Average"),e.includes("|none")&&(a="None"),e.includes("|text(")){let[,d]=e.match(h)??[null,""];l=d}return e.includes("|paren")&&(o=!0),e.includes("|noparen")&&(o=!1),e.includes("|round")&&(c="Normal"),e.includes("|noround")&&(c="None"),e.includes("|ceil")&&(c="Up"),e.includes("|floor")&&(c="Down"),e.includes("|signed")&&(u=!0),e=(0,ym.decode)(e.replace(/\|(no)?(dice|render|form|paren|avg|none|round|floor|ceil|signed)/g,"").replace(h,"")),e in this.data.formulas&&(e=this.data.formulas[e]),{content:e,showDice:i,showParens:o,showFormula:s,expectedValue:a,shouldRender:n,text:l,round:c,signed:u}}registerSource(e,t){this.sources.set(e,t)}getRollerSync(e,t,i=this.getRollerOptions(this.data)){let{content:n,showDice:s,showParens:o,showFormula:a,expectedValue:l,shouldRender:c,text:u,round:h,signed:d}=this.getParametersForRoller(e,i),p=qn.parse(n);switch(this.#e(p)){case"dice":{let y=new Pt(this.data,n,p,this.renderer,this.app,s,u,l,o,h,d);return y.shouldRender=c,y.showFormula=a,y.showRenderNotice=this.data.showRenderNotice,y.setSource(t),y}case"table":{let y=new fo(this.data,n,p[0],t,this.app,s);return y.init,y}case"section":return new Gn(this.data,n,p[0],t,this.app,s);case"dataview":{if(!Vt.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new go(this.data,n,p[0],t,this.app,s)}case"tag":{if(!Vt.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new yo(this.data,n,p[0],t,this.app,s)}case"line":return new mo(this.data,n,p[0],t,this.app,s)}}async getRoller(e,t="",i=this.getRollerOptions(this.data)){let{content:n,showDice:s,showParens:o,showFormula:a,expectedValue:l,round:c,shouldRender:u,text:h,signed:d}=this.getParametersForRoller(e,i),p=qn.parse(n);switch(this.#e(p)){case"dice":{let y=new Pt(this.data,n,p,this.renderer,this.app,s,h,l,o,c,d);return y.showFormula=a,y.shouldRender=u,y.showRenderNotice=this.data.showRenderNotice,y.setSource(t),y}case"table":{let y=new fo(this.data,n,p[0],t,this.app,s);return await y.init,y}case"section":return new Gn(this.data,n,p[0],t,this.app,s);case"dataview":{if(!Vt.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new go(this.data,n,p[0],t,this.app,s)}case"tag":{if(!Vt.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new yo(this.data,n,p[0],t,this.app,s)}case"line":return new mo(this.data,n,p[0],t,this.app,s)}}getRollerString(e,t){if(!t)return e;let i=this.sources.get(t)??this.getRollerOptions(this.data);if("showDice"in i&&(e+=i.showDice?"":"|nodice"),"shouldRender"in i&&(e+=i.shouldRender?"|render":"|norender"),"showFormula"in i&&(e+=i.showFormula?"|form":"|noform"),"expectedValue"in i&&(i.expectedValue=="Average"&&(e+="|avg"),i.expectedValue=="None"&&(e+="|none")),"text"in i&&i.text&&(e+="|text("+i.text+")"),"showParens"in i&&(e+=i.showParens?"|paren":"|noparen"),"round"in i)switch(i.round){case"Down":{e+="|floor";break}case"Up":{e+="|ceil";break}case"Normal":{e+="|round";break}case"None":e+="|noround"}return i.signed&&(e+="|signed"),e}async getArrayRoller(e,t=1){let i=new Lo(this.data,e,t);return await i.roll(),i}async parseDice(e,t=""){let i=await this.getRoller(e,t);return{result:await i.roll(),roller:i}}getRollerOptions(e){return{showDice:e.showDice,shouldRender:e.renderAllDice,showFormula:e.displayResultsInline,showParens:e.displayFormulaAfter,expectedValue:e.initialDisplay,round:e.round,text:null,signed:e.signed}}},At=new Sh;var Mh=class{constructor(){this.result="";this.combinedTooltip=""}},fo=class r extends rr{constructor(){super(...arguments);this.combinedTooltip="";this.prettyTooltip=""}getPath(){let{groups:t}=this.lexeme.value.match(cm)??{},{diceRoll:i="1",link:n,block:s,header:o}=t??{};if(!n||!s)throw new Error("Could not parse link.");let a=i.match(/(\d*?)[Dd]$/);if(a){let[,l="1"]=a;this.rollsFormula=l}else this.rollsFormula=i;this.rolls=1,this.path=decodeURIComponent(n.replace(/(\[|\]|\(|\))/g,"")),this.block=s.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=o}get tooltip(){return this.prettyTooltip}async getReplacer(){return this.result}async build(){this.resultEl.empty();let t=[this.result];this.data.displayResultsInline&&t.unshift(this.inlineText);let i=createSpan();await qi.MarkdownRenderer.renderMarkdown(t.join(""),i,this.source,new qi.Component);let n=this.resultEl.createSpan("embedded-table-result");i.childElementCount==1&&i.firstElementChild instanceof HTMLParagraphElement?n.append(...Array.from(i.firstElementChild.childNodes)):n.append(...Array.from(i.childNodes))}prettify(t){let i=/(.*?)(\(|\)|;|\|\|)(.*)/,n=" ",s=0,o="",a=t,l;for(;l=a.match(i);){let[,c,u,h]=l;o+=c,u==")"?(s--,o+=` +Result: ${this.result}`),this.trigger("new-result"),this.app.workspace.trigger("dice-roller:new-result",this),this.hasRunOnce=!0,this.result}calculate(){let t=0;for(let n of this.lexemes)switch(n.type){case"+":case"-":case"*":case"/":case"^":case"math":{let s=this.stack.pop(),o=this.stack.pop();s instanceof mi&&s.doubles&&(this.stunted=` - ${s.results.get(0).value} Stunt Points`),o instanceof mi&&o.doubles&&(this.stunted=` - ${o.results.get(0).value} Stunt Points`);let a=this.operators[n.value](o.result,s.result),l=this.operators[n.value](this.minStack.pop(),this.minStack.pop()),c=this.operators[n.value](this.maxStack.pop(),this.maxStack.pop());this.stackCopy.push(n.value),this.stack.push(new At(`${a}`,n)),this.minStack.push(l),this.maxStack.push(c);break}case"stunt":case"fudge":case"%":case"dice":this.stack.push(this.dice[t]),this.stackCopy.push(this.dice[t]),this.minStack.push(this.dice[t].getMinPossible()),this.maxStack.push(this.dice[t].getMaxPossible()),t++;default:continue}let i=this.stack.pop();this.min=this.minStack.pop(),this.max=this.maxStack.pop(),i instanceof mi&&i.doubles&&(this.stunted=` - ${i.stunt.result} Stunt Points`),this.result=i.result}};var ce=require("obsidian");var ir=require("obsidian"),U_=createSvg("svg",{attr:{viewBox:"0 0 500 500"}}),H_=createSvg("text",{attr:{class:"font",fill:"currentColor",x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central"}}),Pl=(a=>(a.NONE="None",a.TRIANGLE="Triangle",a.SQUARE="Square",a.DIAMOND="Diamond",a.DODECAHEDRON="Dodecahedron",a.ICOSAHEDRON="Icosahedron",a.CIRCLE="Circle",a))(Pl||{}),Fm=[{id:"dice-roller-d4",shape:"Triangle",formula:"d4",text:"4"},{id:"dice-roller-d6",shape:"Square",formula:"d6",text:"6"},{id:"dice-roller-d8",shape:"Diamond",formula:"d8",text:"8"},{id:"dice-roller-d10",shape:"Diamond",formula:"d10",text:"10"},{id:"dice-roller-d12",shape:"Dodecahedron",formula:"d12",text:"12"},{id:"dice-roller-d20",shape:"Icosahedron",formula:"d20",text:"20"},{id:"dice-roller-d100",shape:"Circle",formula:"d%",text:"%"}],qh=class extends ir.Component{#e(){return U_.cloneNode(!0)}#t(){return H_.cloneNode()}#i=new Set;registerIcon(e,t,i){this.#i.add(e);let n=this.#e(),s=this.#t();s.textContent=i,n.appendChild(s);let o;switch(t){case"Triangle":o=this.getTriangle();break;case"Square":{o=this.getSquare();break}case"Diamond":{o=this.getDiamond();break}case"Dodecahedron":{o=this.getDodecahedron();break}case"Icosahedron":{o=this.getIcosahedron();break}case"Circle":{o=this.getCircle();break}case"None":o=createSvg("defs")}n.appendChild(o),(0,ir.addIcon)(e,n.outerHTML),this.register(()=>(0,ir.removeIcon)(e))}getTriangle(){return this.#n("path",{d:"M244.6,49.3L40.3,403.2c-1.7,3-0.7,6.8,2.3,8.5c0.9,0.5,2,0.8,3.1,0.8h408.6c3.4,0,6.2-2.8,6.2-6.2 c0-1.1-0.3-2.2-0.8-3.1L255.4,49.3c-1.7-3-5.5-4-8.5-2.3C246,47.6,245.2,48.4,244.6,49.3z"})}getSquare(){return this.#n("rect",{x:"87.5",y:"87.5",width:"325",height:"325",rx:"10"})}getDiamond(){return this.#n("rect",{x:"102.75",y:"102.75",width:"294.51",height:"294.51",rx:"9.8",transform:"translate(-103.55 250) rotate(-45)"})}getDodecahedron(){return this.#n("path",{d:"M244.31,29.14,52,168.87a9.72,9.72,0,0,0-3.52,10.84l73.47,226.1a9.69,9.69,0,0,0,9.21,6.69H368.87a9.69,9.69,0,0,0,9.21-6.69l73.47-226.1A9.72,9.72,0,0,0,448,168.87L255.69,29.14A9.66,9.66,0,0,0,244.31,29.14Z"})}getIcosahedron(){return this.#n("path",{d:"M55.14,143.27V356.73a10,10,0,0,0,5,8.66L245,472.11a10,10,0,0,0,10,0L439.86,365.39a10,10,0,0,0,5-8.66V143.27a10,10,0,0,0-5-8.66L255,27.89a10,10,0,0,0-10,0L60.14,134.61A10,10,0,0,0,55.14,143.27Z"})}getCircle(){return this.#n("circle",{cx:"250",cy:"250",r:"190"})}#n(e,t){return createSvg(e,{cls:"shape",attr:{...t,stroke:"currentColor"}})}onunload(){}},Il=new qh;var G_=Function.prototype.toString,Wh=Object.create,q_=Object.prototype.toString,W_=function(){function r(){this._keys=[],this._values=[]}return r.prototype.has=function(e){return!!~this._keys.indexOf(e)},r.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},r.prototype.set=function(e,t){this._keys.push(e),this._values.push(t)},r}();function $_(){return new W_}function j_(){return new WeakMap}var X_=typeof WeakMap<"u"?j_:$_;function jh(r){if(!r)return Wh(null);var e=r.constructor;if(e===Object)return r===Object.prototype?{}:Wh(r);if(e&&~G_.call(e).indexOf("[native code]"))try{return new e}catch{}return Wh(r)}function Y_(r){var e="";return r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.unicode&&(e+="u"),r.sticky&&(e+="y"),e}function Z_(r){return r.flags}var J_=/test/g.flags==="g"?Z_:Y_;function Lm(r){var e=q_.call(r);return e.substring(8,e.length-1)}function K_(r){return r[Symbol.toStringTag]||Lm(r)}var Q_=typeof Symbol<"u"?K_:Lm,eE=Object.defineProperty,tE=Object.getOwnPropertyDescriptor,Bm=Object.getOwnPropertyNames,Xh=Object.getOwnPropertySymbols,Pm=Object.prototype,Im=Pm.hasOwnProperty,iE=Pm.propertyIsEnumerable,Nm=typeof Xh=="function";function nE(r){return Bm(r).concat(Xh(r))}var sE=Nm?nE:Bm;function kl(r,e,t){for(var i=sE(r),n=0,s=i.length,o=void 0,a=void 0;nthis.ready=!0),this}getFieldValueFromActiveFile(t){let i=this.app.workspace.getActiveFile();return!i||!this.canUseDataview||!this.ready?null:this.api.index.pages.get(i.path)?.fields.get(t)??null}get canUseDataview(){return this.app.plugins.getPlugin("dataview")!=null}async dataviewReady(){return new Promise(t=>{this.canUseDataview||t(!1),this.api&&t(!0),this.registerEvent(this.app.metadataCache.on("dataview:api-ready",()=>{this.api=(0,id.getAPI)(),t(!0)}))})}},oi=new nd;var jE=/(?:\d+[Dd])?#(?:[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,XE=/(?:\d+[Dd]?)?dv\((?:.+)\)(?:\|(?:[+-]))?(?:\|(?:[^+-]+))?/u,YE=/(?:.*)?(?:\[.*\]\(|\[\[)(?:.+?)#?\^(?:.+?)(?:\)|\]\])\|?(?:.+)?/u,ZE=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|?(?:.+)?/u,JE=/(?:\d+[Dd])?(?:\[.*\]\(|\[\[)(?:.+)(?:\)|\]\])\|line/u,KE=/[\(\^\+\-\*\/\)]/u,QE=/(?:\d+|\b)[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b)/u,eA=/(?:=|=!|<|>|<=|>=|=<|=>|-=|=-)(?:\d+(?:[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b))?)/u,sd=class{constructor(e){this.table=e}parse(e){let t=e.length,i=this.table,n=[],s=[],o=0;for(;oh||u===h&&c.associativity==="right")break;n.push(s.shift())}s.unshift(a)}else n.push(a)}}for(;s.length;){let a=s.shift();if(a.value!=="(")n.push(a);else throw new Error("Mismatched parentheses.")}return n}},rd=class{constructor(){this.lexer=rg.compile({WS:[{match:/[ \t]+/u},{match:/[{}]+/u}],table:YE,line:JE,section:ZE,tag:jE,dataview:XE,condition:eA,kl:{match:/kl\d*/u,value:this.clampInfinite},kh:[{match:/kh\d*/u,value:this.clampInfinite},{match:/k\d*/u,value:this.clampInfinite}],dh:{match:/dh\d*/u,value:this.clampInfinite},dl:[{match:/dl\d*/u,value:this.clampInfinite}],"!!":{match:/!!(?:i|\d+)?/u,value:this.clampInfinite},"!":{match:/!(?:i|\d+)?/u,value:this.clampInfinite},r:{match:/r(?:i|\d+)?/u,value:this.clampInfinite},u:/u/u,stunt:/1[Dd]S/u,"%":/\d+[Dd]\d+%/u,fudge:{match:/(?:\d*[Dd])?[Dd]?F/u,value:e=>{let{roll:t=this.defaultRoll}=e.match(/(?:(?\d*)[Dd])?F/).groups;return`${t}dF`}},dice:[{match:QE,value:e=>{let{roll:t=this.defaultRoll,faces:i=this.defaultFace}=e.match(/(?\d+)?[Dd](?%|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\])?/).groups;return`${t}d${i}`}},{match:/\d+/u},{match:/\b[A-Za-z][A-Za-z0-9_]+\b/u,value:e=>oi.getFieldValueFromActiveFile(e)??e}],sort:[{match:/s(?:a|d)*/u,value:e=>e=="s"||e=="sa"?"sa":"sd"}],math:KE});this.inline=new Map;this.parser=new sd({"+":{precedence:1,associativity:"left"},"-":{precedence:1,associativity:"left"},"*":{precedence:2,associativity:"left"},"/":{precedence:2,associativity:"left"},"^":{precedence:3,associativity:"right"}})}clampInfinite(e){return/i$/.test(e)?"100":e.replace(/^\D+/g,"")}setInlineFields(e){this.inline=e}setDefaults(e,t){this.defaultRoll=e,this.defaultFace=t}setDefaultRoll(e){this.defaultRoll=e}setDefaultFace(e){this.defaultFace=e}parse(e){try{let t=Array.from(this.lexer.reset(e));return this.lexer.reset(),(0,Kl.Ok)(this.parser.parse(this.transform(t)))}catch(t){return console.error(t),(0,Kl.Err)("Could not parse")}}transform(e){e=e.filter(l=>l.type!="WS");let t=l=>l.type==="+"||l.type==="math"&&l.value==="+",i=l=>l.type==="-"||l.type==="math"&&l.value==="-",n=l=>t(l)||i(l),s=l=>l[l.length-1],o=(l,c)=>l.splice(l.length-1,1,c);e=e.reduce((l,c)=>{if(l.length==0)l.push(c);else{let u=s(l);n(u)&&n(c)?i(u)!=i(c)?i(u)||o(l,c):i(u)&&(u.type=u.type==="math"?u.type:"+",u.value="+"):l.push(c)}return l},[]);let a=[];for(let l of e)if(l.type=="condition"&&a.length>0){let c=a[a.length-1];c.conditions||(c.conditions=[]);let[u,h,d]=l.value.match(/(?=|=!|<|>|<=|>=|=<|=>|-=|=-)(?\d+(?:[Dd](?:%|F|-?\d+|\[\d+(?:[ \t]*[,-][ \t]*\d+)+\]|\b))?)/)??[],p=this.parse(d);p.isOk()&&c.conditions.push({operator:h,comparer:d,lexemes:p.unwrap(),value:l.value})}else a.push(l);return a}},nr=new rd;var bo=class extends ce.PluginSettingTab{constructor(t,i){super(t,i);this.plugin=i;this.#t=!0;this.allFolders=this.app.vault.getAllLoadedFiles().filter(t=>t instanceof ce.TFolder);this.folders=[];this.plugin=i}async getFonts(){let t=[];try{ce.Platform.isMobile&&window?.Capacitor?.isPluginAvailable("App")?t=await window?.Capacitor?.Plugins.App?.getFonts()?.catch(n=>[]):t=await require("get-fonts").getFonts().catch(n=>[])}catch{}let i=new Set;for(let n of t)i.add(n);return[...i].sort()}async display(){let{containerEl:t}=this;t.empty(),t.addClass("dice-roller-settings"),this.contentEl=this.containerEl.createDiv("dice-roller-settings-content"),this.buildGenerics(this.contentEl.createDiv()),this.buildDisplay(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildDice(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildView(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildRender(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildFormulaSettings(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildTables(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildSections(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildTags(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildDiceModTemplateFoldersSettings(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),t.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}buildGenerics(t){t.empty()}#e(t,i){let n=t.createEl("summary");new ce.Setting(n).setHeading().setName(i),(0,ce.setIcon)(n.createDiv("collapser").createDiv("handle"),"chevron-right")}buildDisplay(t){t.empty(),this.#e(t,"Dice Display"),new ce.Setting(t).setName("Display Formula With Results").setDesc("Both the formula and the results will both be displayed in preview mode.").addToggle(i=>{i.setValue(this.plugin.data.displayResultsInline),i.onChange(async n=>{this.plugin.data.displayResultsInline=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Re-roll button position").setDesc("Controls position of the re-roll button").addDropdown(i=>{i.addOption(Ot.LEFT,"Left"),i.addOption(Ot.RIGHT,"Right"),i.addOption(Ot.NONE,"None"),i.setValue(this.plugin.data.position),i.onChange(async n=>{this.plugin.data.position=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display Formula in Parentheses After").setDesc(createFragment(i=>{i.createSpan({text:"For example, "}),i.createEl("code",{text:"`dice: 1d6`"}),i.createSpan({text:" will become "});let n=i.createSpan("dice-roller");n.createSpan({cls:"dice-roller-result",text:"3"}),(0,ce.setIcon)(n.createSpan("dice-roller-button"),"dices"),i.createSpan({text:" (1d6). This only affects Dice Rollers."})})).addToggle(i=>{i.setValue(this.plugin.data.displayFormulaAfter),i.onChange(async n=>{this.plugin.data.displayFormulaAfter=n,await this.plugin.saveSettings()})})}buildDice(t){t.empty(),this.#e(t,"Dice Rollers"),new ce.Setting(t).setName("Default Face").setDesc("Use this as the number of faces when it is omitted.").addText(i=>{i.setValue(`${this.plugin.data.defaultFace}`),i.inputEl.onblur=async()=>{isNaN(Number(i.inputEl.value))&&new ce.Notice("The default face must be a number."),this.plugin.data.defaultFace=Number(i.inputEl.value),nr.setDefaultFace(this.plugin.data.defaultFace),await this.plugin.saveSettings()}}),new ce.Setting(t).setName("Round Results").setDesc("Determine the rounding behavior for dice results.").addDropdown(i=>{i.addOptions(Qs).setValue(this.plugin.data.round).onChange(n=>{this.plugin.data.round=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Auto Roll dice").setDesc("On initial display, should dice be rolled or displayed empty.").addDropdown(i=>{i.addOption("None","Empty").addOption("Roll","Rolled").setValue(this.plugin.data.initialDisplay).onChange(n=>{this.plugin.data.initialDisplay=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Show Signed Results").setDesc("Positive results will show a '+'. This setting has no effect on negative results.").addToggle(i=>{i.setValue(this.plugin.data.signed).onChange(n=>{this.plugin.data.signed=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Always Render Dice").setDesc(createFragment(i=>{i.createSpan({text:"Dice rolled in notes will always be rendered. Use the "}),i.createEl("code",{text:"|norender"}),i.createSpan({text:" flag to prevent it."})})).addToggle(i=>{i.setValue(this.plugin.data.renderAllDice).onChange(n=>{this.plugin.data.renderAllDice=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Log All Rolls to Dice Tray").setDesc(createFragment(i=>{i.createSpan({text:"Dice rolled in notes will be added to the Dice Tray's Results section."})})).addToggle(i=>{i.setValue(this.plugin.data.addToView).onChange(n=>{this.plugin.data.addToView=n,this.plugin.saveSettings()})})}buildTables(t){t.empty(),this.#e(t,"Table Rollers"),new ce.Setting(t).setName("Display Lookup Table Roll").setDesc("Lookup table rolls will display the rolled number along with the result.").addToggle(i=>{i.setValue(this.plugin.data.displayLookupRoll),i.onChange(async n=>{this.plugin.data.displayLookupRoll=n,await this.plugin.saveSettings()})})}buildSections(t){t.empty(),this.#e(t,"Section Rollers"),new ce.Setting(t).setName("Add Copy Button to Section Results").setDesc("Randomly rolled sections will have a copy-content button to easy add result to clipboard.").addToggle(i=>{i.setValue(this.plugin.data.copyContentButton),i.onChange(async n=>{this.plugin.data.copyContentButton=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display As Embeds").setDesc("Sections returned from Section & Tag Rollers will display as embedded fields.").addToggle(i=>{i.setValue(this.plugin.data.displayAsEmbed),i.onChange(async n=>{this.plugin.data.displayAsEmbed=n,await this.plugin.saveSettings()})})}buildTags(t){t.empty(),this.#e(t,"Tag Rollers"),new ce.Setting(t).setName("Always Return Links for Tags").setDesc("Enables random link rolling with the link parameter. Override by specifying a section type.").addToggle(i=>{i.setValue(this.plugin.data.rollLinksForTags),i.onChange(async n=>{this.plugin.data.rollLinksForTags=n,await this.plugin.saveSettings()})})}buildView(t){t.empty(),this.#e(t,"Dice Tray"),new ce.Setting(t).setName("Open Dice Tray on Startup").setDesc("The dice view can always be opened using the command from the command palette.").addToggle(i=>{i.setValue(this.plugin.data.showLeafOnStartup),i.onChange(async n=>{this.plugin.data.showLeafOnStartup=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Dice Tray Buttons").setDesc("Add and remove the buttons available in the Dice Tray here, to customize what quick-actions are available to roll."),this.iconsEl=t.createDiv("dice-icons"),this.buildIcons()}buildIcons(){if(this.iconsEl.empty(),!this.plugin.data.icons){this.iconsEl.createSpan({cls:"no-icons",text:"No dice buttons created! Create a button to use this functionality."});return}let i=this.iconsEl.createDiv("existing-buttons has-table").createDiv("buttons-table");for(let u=0;u{s.formula=u,l.setDisabled(s.text?.length===0||s.formula?.length===0)}),new ce.TextComponent(a).setPlaceholder("Display").onChange(u=>{s.text=u,l.setDisabled(s.text?.length===0||s.formula?.length===0)});let l=new ce.ExtraButtonComponent(n.createDiv("actions")).setIcon("save").setDisabled(!0).onClick(async()=>{!s.text||!s.formula||(this.plugin.data.icons.push({...s}),this.buildIcons(),await this.plugin.view.buildButtons(),await this.plugin.saveSettings())}),c=new ce.DropdownComponent(o);for(let[u,h]of Object.entries(Pl))c.addOption(h,h);c.setValue(s.shape).onChange(u=>{s.shape=c.getValue()}),s.shape=c.getValue()}buildStaticIcon(t,i){t.empty(),t.removeClass("add-new");let n=this.plugin.data.icons[i],s=t.createDiv("shape dice-button");Il.registerIcon(n.id,n.shape,n.text),(0,ce.setIcon)(s,n.id),t.createDiv({cls:"formula",text:n.formula});let o=t.createDiv("actions");new ce.ExtraButtonComponent(o).setIcon("edit").onClick(()=>{this.buildEditIcon(t,i,n)}),new ce.ExtraButtonComponent(o).setIcon("trash").onClick(async()=>{this.plugin.data.icons.splice(i,1),await this.plugin.view.buildButtons(),this.buildIcons()})}buildEditIcon(t,i,n){t.empty(),t.addClass("add-new");let s={text:n.text,formula:n.formula,shape:n.shape,id:n.id},o=t.createDiv("shape"),a=t.createDiv("formula");new ce.TextComponent(a).setPlaceholder("Formula").setValue(s.formula).onChange(h=>{s.formula=h,c.setDisabled(s.text.length===0||s.formula.length===0)}),new ce.TextComponent(a).setPlaceholder("Display").setValue(s.text).onChange(h=>{s.text=h,c.setDisabled(s.text.length===0||s.formula.length===0)});let l=t.createDiv("actions"),c=new ce.ExtraButtonComponent(l).setIcon("checkmark").setDisabled(s.text.length===0||s.formula.length===0).onClick(async()=>{!s.text||!s.formula||(this.plugin.data.icons.splice(i,1,{...s}),await this.plugin.saveSettings(),this.buildStaticIcon(t,i),await this.plugin.view.buildButtons())});new ce.ExtraButtonComponent(l).setIcon("cross").onClick(()=>{this.buildStaticIcon(t,i)});let u=new ce.DropdownComponent(o);for(let[h,d]of Object.entries(Pl))u.addOption(d,d);u.setValue(s.shape).onChange(h=>{s.shape=h})}buildRender(t){t.empty(),this.#e(t,"Graphical Dice"),new ce.Setting(t).setName("Display graphics for Dice Tray Rolls").setDesc("Dice rolls from dice view will be displayed on screen.").addToggle(s=>{s.setValue(this.plugin.data.renderer),s.onChange(async o=>{this.plugin.data.renderer=o,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display Time for Dice Graphics").setDesc("Rendered dice will stay on screen for this number of milliseconds. Leave blank to require a click to clear dice.").addText(s=>{s.inputEl.setAttr("type","number"),s.inputEl.onblur=o=>{Number(s.getValue())<0&&(new ce.Notice("Render time cannot be less than 0."),s.setValue("0"))},s.setValue(`${this.plugin.data.renderTime}`),s.onChange(async o=>{o&&Number(o)<0||isNaN(Number(o))||(this.plugin.data.renderTime=Number(o),Mt.setData(this.plugin.getRendererData()),await this.plugin.saveSettings())})}).addExtraButton(s=>{s.setIcon("reset").setTooltip("Reset to Default").onClick(async()=>{this.plugin.data.renderTime=zl.renderTime,await this.plugin.saveSettings(),this.buildRender(t)})}),new ce.Setting(t).setName("Use Colorful Dice").setDesc("Rendered dice will be varied colors based on the dice type. This will override manually set dice and text colors.").addToggle(s=>{s.setValue(this.plugin.data.colorfulDice),s.onChange(async o=>{this.plugin.data.colorfulDice=o,Mt.setData(this.plugin.getRendererData()),await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Adjust Dice Scale").setDesc("Control the size of rendered dice.").addSlider(s=>{s.setLimits(.5,1.5,.1).setValue(this.plugin.data.scaler).onChange(o=>{this.plugin.data.scaler=o,Mt.setData(this.plugin.getRendererData()),this.plugin.saveSettings()})}),new ce.Setting(t).setName("Font for dice").setDesc("Select the font to use for the dice").addText(async s=>{let o=async()=>{this.plugin.data.textFont=s.getValue(),await this.plugin.saveSettings(),Mt.setData(this.plugin.getRendererData())};new Ul(this.app,s,await this.getFonts()).onSelect(({item:l})=>{s.setValue(l),o()}),s.setValue(this.plugin.data.textFont),s.inputEl.onblur=async()=>{o()}}),new ce.Setting(t).setName("Dice Base Color").setDesc("Rendered dice will be this color.").controlEl.createEl("input",{type:"color",value:this.plugin.data.diceColor},s=>{s.value=this.plugin.data.diceColor,s.onchange=async({target:o})=>{let a=o.value;this.plugin.data.diceColor=a,Mt.setData(this.plugin.getRendererData()),await this.plugin.saveSettings()}}),new ce.Setting(t).setName("Dice Text Color").setDesc("Rendered dice will use this color for their numbers.").controlEl.createEl("input",{type:"color",value:this.plugin.data.textColor},s=>{s.value=this.plugin.data.textColor,s.onchange=async({target:o})=>{let a=o.value;a&&(this.plugin.data.textColor=a,Mt.setData(this.plugin.getRendererData()),await this.plugin.saveSettings())}}),new ce.Setting(t).setName("Show Notice for Results").setDesc(createFragment(s=>{s.createSpan({text:"A notice will be displayed for each rendered dice roll."}),s.createEl("br"),s.createSpan({text:"Changing this setting will not effect any existing dice rollers in opened notes."})})).addToggle(s=>{s.setValue(this.plugin.data.showRenderNotice).onChange(async o=>{this.plugin.data.showRenderNotice=o,await this.plugin.saveSettings()})})}buildFormulaSettings(t){t.empty(),this.#e(t,"Saved Formulas");let i=t.createDiv("dice-roller-setting-additional-container"),n=i.createDiv();new ce.Setting(n).setName("Add Formula").setDesc("Add a new formula shortcut.").addButton(a=>a.setTooltip("Add Formula").setButtonText("+").onClick(async()=>{let c=await this.buildFormulaForm(n);c&&(this.plugin.data.formulas[c.alias]=c.formula,this.buildFormulaSettings(t),await this.plugin.saveSettings())}));let s=i.createDiv("additional"),o=this.plugin.data.formulas;for(let[a,l]of Object.entries(o)){let c=new ce.Setting(s).setName(a);c.controlEl.createSpan({text:l}),c.addExtraButton(u=>u.setIcon("edit").setTooltip("Edit").onClick(async()=>{let h=await this.buildFormulaForm(n,{alias:a,formula:l});h&&(delete this.plugin.data.formulas[a],this.plugin.data.formulas[h.alias]=h.formula,this.buildFormulaSettings(t),await this.plugin.saveSettings())})).addExtraButton(u=>u.setIcon("trash").setTooltip("Delete").onClick(async()=>{delete this.plugin.data.formulas[a],await this.plugin.saveSettings(),this.buildFormulaSettings(t)}))}Object.values(o).length||s.createSpan({text:"Create a formula to see it here!",cls:"no-formulas"})}async buildFormulaForm(t,i={alias:null,formula:null}){return new Promise(n=>{let s=t.createDiv("add-new-formula"),o=s.createDiv("formula-data");new ce.Setting(o).setName("Alias").addText(l=>{l.setValue(i.alias).onChange(c=>i.alias=c)}),new ce.Setting(o).setName("Formula").addText(l=>{l.setValue(i.formula).onChange(c=>i.formula=c)});let a=s.createDiv("formula-buttons");new ce.Setting(a).addButton(l=>l.setCta().setButtonText("Save").onClick(async()=>{s.detach(),n(i)})).addExtraButton(l=>l.setIcon("cross").setTooltip("Cancel").onClick(()=>{s.detach(),n(null)}))})}#t;buildDiceModTemplateFoldersSettings(t){t.empty(),this.#e(t,"Modify Dice"),new ce.Setting(t).setName(createFragment(i=>{i.createSpan({text:"Apply "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" in live-preview"})})).setDesc(createFragment(i=>{i.createSpan({text:"If not enabled "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" will only be applied/replaced in read mode."})})).addToggle(i=>{i.setValue(this.plugin.data.replaceDiceModInLivePreview),i.onChange(async n=>{this.plugin.data.replaceDiceModInLivePreview=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Escape Markdown When Modifying").setDesc(createFragment(i=>{i.createSpan({text:"Markdown characters will be escaped when using "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:"."})})).addToggle(i=>{i.setValue(this.plugin.data.escapeDiceMod),i.onChange(async n=>{this.plugin.data.escapeDiceMod=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Add Formula When Using Modify Dice").setDesc(createFragment(i=>{i.createSpan({text:"Both the formula and the results will both be added to the note when using "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:"."})})).addToggle(i=>{i.setValue(this.plugin.data.displayFormulaForMod),i.onChange(async n=>{this.plugin.data.displayFormulaForMod=n,await this.plugin.saveSettings()})}),this.pathsEl=t.createDiv("template-paths dice-roller-setting-additional-container"),this.buildPaths()}buildPaths(){if(this.#t){this.folders=this.allFolders.filter(n=>!(n.path in this.plugin.data.diceModTemplateFolders));let i=Object.entries(this.plugin.data.diceModTemplateFolders);i.sort((n,s)=>n[0].localeCompare(s[0])),this.plugin.data.diceModTemplateFolders=Object.fromEntries(i),this.#t=!1}this.pathsEl.empty(),new ce.Setting(this.pathsEl).setName("Template Folders").setDesc(createFragment(i=>{i.createSpan({text:"Define folders where "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" is not applied/replaced and can be used in templates."})})).setHeading();let t=this.pathsEl.createDiv("additional");for(let i in this.plugin.data.diceModTemplateFolders)this.buildStaticPath(t.createDiv(),i);this.buildEditPath(t.createDiv())}buildStaticPath(t,i){t.empty();let n=this.plugin.data.diceModTemplateFolders[i],s=new ce.Setting(t).setName(i);s.setDesc(createFragment(o=>{let a=o.createDiv({attr:{style:"display: flex;align-items: center;gap: 0.5rem;"}});n?((0,ce.setIcon)(a,"folder-tree"),a.createSpan({text:"Includes Subfolders"})):((0,ce.setIcon)(a,"folder-closed"),a.createSpan({text:"Root Only"}))})),s.addExtraButton(o=>o.setIcon("edit").onClick(()=>{this.buildEditPath(t,i)})).addExtraButton(o=>o.setIcon("trash").onClick(async()=>{delete this.plugin.data.diceModTemplateFolders[i],await this.plugin.saveSettings(),this.#t=!0,this.buildPaths()}))}buildEditPath(t,i){t.empty();let n={folder:i,useSubfolders:this.plugin.data.diceModTemplateFolders[i]??!0},s=t.createDiv("template-edit setting-item"),o=s.createDiv("template-input"),a=o.createDiv("folder-input"),l=new ce.ExtraButtonComponent(o).onClick(()=>{n.useSubfolders=!n.useSubfolders,n.useSubfolders?l.setIcon("folder-tree").setTooltip("Including Subfolders"):l.setIcon("folder-closed").setTooltip("Not Including Subfolders")});this.plugin.data.diceModTemplateFolders[i]??!0?l.setIcon("folder-tree").setTooltip("Including Subfolders"):l.setIcon("folder-closed").setTooltip("Not Including Subfolders");let c=s.createDiv("actions");i||new ce.ExtraButtonComponent(c).extraSettingsEl.setAttr("style","visibility: hidden;");let u=new ce.ExtraButtonComponent(c).setIcon(i?"checkmark":"save").setDisabled(!i).onClick(async()=>{this.plugin.data.diceModTemplateFolders[n.folder]=n.useSubfolders,await this.plugin.saveSettings(),n.folder!=i?(this.#t=!0,this.buildPaths()):this.buildStaticPath(t,i)});i&&new ce.ExtraButtonComponent(c).setIcon("cross").onClick(()=>this.buildStaticPath(t,i)),this.buildPathInput(a,u,h=>{n.folder=h},i)}buildPathInput(t,i,n,s="Folder"){let o=c=>{if(!c||!c.length||c in this.plugin.data.diceModTemplateFolders)return i.setDisabled(!0),!1;i.setDisabled(!1),n((0,ce.normalizePath)(c))},a=new ce.TextComponent(t).setPlaceholder(s).onChange(c=>{o(c)}),l=new ag.FolderInputSuggest(this.app,a,this.folders);l.onSelect(async c=>{l.close(),l.setValue(c.item.path),o(c.item.path)})}};var dt=require("obsidian");var fg=nn(lg());var PT=nn(td());var Ki=require("obsidian");var cg=/(?:(?\d+)[Dd])?#(?[\p{Letter}\p{Emoji_Presentation}\w/-]+)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,ug=/(?:(?\d+)[Dd]?)?dv\((?.+)\)(?:\|(?[\+-]))?(?:\|(?[^\+-]+))?/u,hg=/(?.*)?(?:\[.*\]\(|\[\[)(?.+?)#?\^(?.+?)(?:\]\]|\))(?:\|(?
.+))?/,ec=/(?:(?\d+)[Dd])?(?:\[.*\]\(|\[\[)(?.+)(?:\]\]|\))\|?(?.+)?/;var od=class{constructor(){this.result="";this.combinedTooltip=""}},tc=class r extends mo{constructor(t,i,n,s,o,a=t.position,l){super(t,i,n,s,o,a);this.lookup=l;this.isLookup=!1;this.combinedTooltip="";this.prettyTooltip="";this.getPath()}getPath(){let{groups:t}=this.lexeme.value.match(hg)??{},{diceRoll:i="1",link:n,block:s,header:o}=t??{};if(!n||!s)throw new Error("Could not parse link.");let a=i.match(/(\d*?)[Dd]$/);if(a){let[,l="1"]=a;this.rollsFormula=l}else this.rollsFormula=i;this.rolls=1,this.path=decodeURIComponent(n.replace(/(\[|\]|\(|\))/g,"")),this.block=s.replace(/(\^|#)/g,"").trim().toLowerCase(),this.header=o}get tooltip(){return this.prettyTooltip}async getReplacer(){return this.result}async build(){this.resultEl.empty();let t=[this.result];this.data.displayResultsInline&&t.unshift(this.inlineText);let i=createSpan();Ki.MarkdownRenderer.render(this.app,t.join(""),i,this.source,new Ki.Component);let n=this.resultEl.createSpan("embedded-table-result");i.childElementCount==1&&i.firstElementChild instanceof HTMLParagraphElement?n.append(...Array.from(i.firstElementChild.childNodes)):n.append(...Array.from(i.childNodes))}prettify(t){let i=/(.*?)(\(|\)|;|\|\|)(.*)/,n=" ",s=0,o="",a=t,l;for(;l=a.match(i);){let[,c,u,h]=l;o+=c,u==")"?(s--,o+=` `,o+=n.repeat(s),o+=")"):(u=="("?(s++,o+="("):u==";"?o+=",":u=="||"&&(o+="|"),o+=` -`,o+=n.repeat(s)),a=h}return o+=a,o}async getSubResult(t){let i=new Mh;typeof t=="number"?i.result=t.toString():i.result=t;let n=[];if(typeof t=="string"){let s=/(?:\`dice:)(.*?)(?:\`)/g,o=t.matchAll(s);for(let a of o){let l=a[1].trim(),c=await At.getRoller(l,this.source);await c.roll();let u=await this.getSubResult(c.result),h;if(u.result instanceof qi.TFile?h=u.result.basename:h=u.result,i.result=i.result.replace(a[0],h),c instanceof r)n.push(c.combinedTooltip);else{let[d,p]=c.tooltip.split(` -`);n.push(d+" --> "+p)}}}return i.combinedTooltip=n.join(";"),i}async getResult(){let t=[],i=[],n=this.original;if(this.rollsFormula)try{let s=await At.getRoller(this.rollsFormula,this.source);if(!(s instanceof Pt))return this.prettyTooltip="TableRoller only supports dice rolls to select multiple elements.",new qi.Notice(this.prettyTooltip),"ERROR";let o=s;await o.roll(),this.rolls=o.result,o.isStatic||(n=n.replace(this.rollsFormula,`${this.rollsFormula.trim()} --> ${o.resultText} > `))}catch{return this.prettyTooltip=`TableRoller: '${this.rollsFormula}' is not a valid dice roll.`,new qi.Notice(this.prettyTooltip),"ERROR"}for(let s=0;sh[1]===void 0&&c===h[0]||c>=h[0]&&h[1]>=c);u&&(o=this.lookupRoller.original.trim()+" --> "+`${this.lookupRoller.resultText}${this.header?" | "+this.header:""}`.trim(),l=u[1])}else{let c=[...this.options],u=this.getRandomBetween(0,c.length-1);o=c.length+" rows --> [row "+(u+1)+"]",l=c[u]}a=await this.getSubResult(l),t.push(a.result),a.combinedTooltip&&(o+=" > ("+a.combinedTooltip+")"),i.push(o)}return i.length==0?this.combinedTooltip=n:i.length==1?this.combinedTooltip=n+" "+i.join(""):this.combinedTooltip=n+" ==> ("+i.join(" ||")+")",this.prettyTooltip=this.prettify(this.combinedTooltip),t.join("||")}async roll(){return new Promise(async t=>{this.loaded?(this.result=await this.getResult(),this.render(),this.trigger("new-result"),t(this.result)):this.on("loaded",async()=>{this.result=await this.getResult(),this.render(),this.trigger("new-result"),t(this.result)})})}async load(){await this.getOptions()}async getOptions(){if(this.cache=this.app.metadataCache.getFileCache(this.file),!this.cache||!this.cache.blocks||!(this.block in this.cache.blocks))throw new Error(`Could not read file cache. Does the block reference exist? +`,o+=n.repeat(s)),a=h}return o+=a,o}async getSubResult(t){let i=new od;typeof t=="number"?i.result=t.toString():i.result=t;let n=[];if(typeof t=="string"){let s=/(?:\`dice:)(.*?)(?:\`)/g,o=t.matchAll(s);for(let a of o){let l=a[1].trim(),c=await Tt.getRoller(l,this.source);if(c==null)continue;c.addContexts(...this.components),await c.roll();let u=await this.getSubResult(c.result),h;if(u.result instanceof Ki.TFile?h=u.result.basename:h=u.result,i.result=i.result.replace(a[0],h),c instanceof r)n.push(c.combinedTooltip);else{let[d,p]=c.tooltip.split(` +`);n.push(d+" --> "+p)}}}return i.combinedTooltip=n.join(";"),i}async getResult(){let t=[],i=[],n=this.original;if(this.rollsFormula)try{let s=await Tt.getRoller(this.rollsFormula,this.source);if(s){if(!(s instanceof qt))return this.prettyTooltip="TableRoller only supports dice rolls to select multiple elements.",new Ki.Notice(this.prettyTooltip),"ERROR";let o=s;o.addContexts(...this.components),await o.roll(),this.rolls=o.result,o.isStatic||(n=n.replace(this.rollsFormula,`${this.rollsFormula.trim()} --> ${o.resultText} > `))}}catch{return this.prettyTooltip=`TableRoller: '${this.rollsFormula}' is not a valid dice roll.`,new Ki.Notice(this.prettyTooltip),"ERROR"}for(let s=0;sh[1]===void 0&&c===h[0]||c>=h[0]&&h[1]>=c);u&&(o=this.lookupRoller.original.trim()+" --> "+`${this.lookupRoller.resultText}${this.header?" | "+this.header:""}`.trim(),l=u[1])}else{let c=[...this.options],u=this.getRandomBetween(0,c.length-1);o=c.length+" rows --> [row "+(u+1)+"]",l=c[u]}a=await this.getSubResult(l),t.push(a.result),a.combinedTooltip&&(o+=" > ("+a.combinedTooltip+")"),i.push(o)}return i.length==0?this.combinedTooltip=n:i.length==1?this.combinedTooltip=n+" "+i.join(""):this.combinedTooltip=n+" ==> ("+i.join(" ||")+")",this.prettyTooltip=this.prettify(this.combinedTooltip),t.join("||")}async roll(){return new Promise(async t=>{this.loaded?(this.result=await this.getResult(),this.render(),this.trigger("new-result"),t(this.result)):this.once("loaded",async()=>{this.result=await this.getResult(),this.render(),this.trigger("new-result"),t(this.result)})})}async getOptions(t,i){if(this.cache=t,!this.cache||!this.cache.blocks||!(this.block in this.cache.blocks))throw new Error(`Could not read file cache. Does the block reference exist? -${this.path} > ${this.block}`);let t=this.cache.sections?.find(s=>s.position==this.cache.blocks[this.block].position),i=this.cache.blocks[this.block].position,n=await this.app.vault.cachedRead(this.file);if(this.content=n.slice(i.start.offset,i.end.offset),t&&t.type==="list")this.options=this.content.split(` -`);else{let s=D_(this.content);if(s.columns.size===2&&/dice:\s*([\s\S]+)\s*?/.test(Array.from(s.columns.keys())[0])){let o=await At.getRoller(Array.from(s.columns.keys())[0].split(":").pop().replace(/\`/g,""),this.source);o instanceof Pt&&(this.lookupRoller=o,this.lookupRanges=s.rows.map(a=>{let[l,c]=a.replace(/\\\|/g,"{ESCAPED_PIPE}").split("|").map(d=>d.replace(/{ESCAPED_PIPE}/g,"\\|")).map(d=>d.trim()),[,u,h]=l.match(/(\d+)(?:[^\d]+?(\d+))?/)??[];if(!(!u&&!h))return[[Number(u),h?Number(h):void 0],c]}),this.isLookup=!0)}if(this.header==="xy"&&!s.columns.has("xy")){this.options=[];for(let o of Array.from(s.columns.values()).slice(1))this.options.push(...o)}else if(this.header&&s.columns.has(this.header))this.options=s.columns.get(this.header);else{if(this.header)throw new Error(`Header ${this.header} was not found in table ${this.path} > ${this.block}.`);this.options=s.rows}}this.loaded=!0,this.trigger("loaded")}},M_=/^\|?([\s\S]+?)\|?$/,xm=/\|/g;function D_(r){let e=r.split(` -`),i=e.map(o=>(o.trim().match(M_)??[,o.trim()])[1])[0].replace("\\|","{ESCAPED_PIPE}").split(xm),n=[],s=[];for(let o in i){let a=i[o];a.trim().length||(a=o),s.push([a.trim(),[]])}for(let o of e.slice(2)){let a=o.trim().replace(/\\\|/g,"{ESCAPED_PIPE}").split(xm).map(l=>l.replace(/{ESCAPED_PIPE}/g,"\\|")).map(l=>l.trim()).filter(l=>l.length);n.push(a.join(" | "));for(let l in a){let c=a[l].trim();!c.length||!s[l]||s[l][1].push(c)}}return{columns:new Map(s),rows:n}}var En=require("obsidian");var mo=class extends es{async getReplacer(){return this.result}get tooltip(){return`${this.original} -${this.path}`}async build(){if(this.resultEl.empty(),this.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(En.MarkdownRenderer.renderMarkdown(e,t.createDiv(),this.source,new En.Component),this.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",n=>{n.stopPropagation(),navigator.clipboard.writeText(e).then(async()=>{new En.Notice("Result copied to clipboard.")})}),(0,En.setIcon)(i,"copy")}}}transformResultsToString(){return this.results.join(` +${this.path} > ${this.block}`);let n=this.cache.sections?.find(a=>a.position==this.cache.blocks[this.block].position),s=this.cache.blocks[this.block].position,o=i.slice(s.start.offset,s.end.offset);if(await this.checkForDirtiness(o))if(this.content=o,n&&n.type==="list")this.options=this.content.split(` +`);else{let a=iA(this.content);if(/dice:\s*([\s\S]+)\s*?/.test(Array.from(a.columns.keys())[0])||this.lookup){let l=await Tt.getRoller(this.lookup??Array.from(a.columns.keys())[0].split(":").pop().replace(/\`/g,""),this.source);l&&(l.addContexts(...this.components),l instanceof qt&&(this.lookupRoller=l,this.lookupRanges=a.rows.map(c=>{let[u,h]=c.replace(/\\\|/g,"{ESCAPED_PIPE}").split("|").map(m=>m.replace(/{ESCAPED_PIPE}/g,"\\|")).map(m=>m.trim()),[,d,p]=u.match(/(\d+)(?:[^\d]+?(\d+))?/)??[];if(!(!d&&!p))return[[Number(d),p?Number(p):void 0],h]}),this.isLookup=!0))}if(this.header==="xy"&&!a.columns.has("xy")){this.options=[];for(let l of Array.from(a.columns.values()).slice(1))this.options.push(...l)}else if(this.header&&a.columns.has(this.header))this.options=a.columns.get(this.header);else{if(this.header)throw new Error(`Header ${this.header} was not found in table ${this.path} > ${this.block}.`);this.options=a.rows}}}},tA=/^\|?([\s\S]+?)\|?$/,dg=/\|/g;function iA(r){let e=r.split(` +`),i=e.map(o=>(o.trim().match(tA)??[,o.trim()])[1])[0].replace("\\|","{ESCAPED_PIPE}").split(dg),n=[],s=[];for(let o in i){let a=i[o];a.trim().length||(a=o),s.push([a.trim(),[]])}for(let o of e.slice(2)){let a=o.trim().replace(/\\\|/g,"{ESCAPED_PIPE}").split(dg).map(l=>l.replace(/{ESCAPED_PIPE}/g,"\\|")).map(l=>l.trim()).filter(l=>l.length);n.push(a.join(" | "));for(let l in a){let c=a[l].trim();!c.length||!s[l]||s[l][1].push(c)}}return{columns:new Map(s),rows:n}}var Cn=require("obsidian");function nA(r){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",i=t.length;for(let n=0;n{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!this.data.displayResultsInline){let i="type"in e?e.type:"List Item";t.setAttrs({"aria-label":`${this.file.basename}: ${i}`})}if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(Cn.MarkdownRenderer.render(this.app,this.displayFromCache(e),t.createDiv(),this.source,new Cn.Component),this.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",n=>{n.stopPropagation(),navigator.clipboard.writeText(this.displayFromCache(e).trim()).then(async()=>{new Cn.Notice("Result copied to clipboard.")})}),(0,Cn.setIcon)(i,"copy")}}}displayFromCache(...e){let t=[];for(let i of e)t.push(this.content.slice(i.position.start.offset,i.position.end.offset));return t.join(` -`)}async load(){await this.getOptions()}getPath(){let{groups:e}=this.lexeme.value.match(Sl)??{},{roll:t=1,link:i,types:n}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=i.replace(/(\[|\])/g,""),this.types=n?.split(",")}async getOptions(){if(this.content=await this.app.vault.cachedRead(this.file),!this.content)throw new Error("Could not read file cache.");this.options=this.content.trim().split(` -`).map(e=>e.trim()).filter(e=>e&&e.length),this.loaded=!0,this.trigger("loaded")}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.on("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),e(this.results[0])}})}};var Wn=require("obsidian");var Cl=class extends Dn{constructor(t,i,n,s,o,a=t.showDice){super(t,i,[n],a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.app=o;this.isLink=!1;this.loaded=!1}async getReplacer(){return this.isLink?`[[${this.result.file.basename}]]`:await this.result.getReplacer()}guardDataview(){if(!Vt.canUseDataview)throw new Wn.Notice("A query can only be rolled with the Dataview plugin enabled."),new Error("A query can only be rolled with the Dataview plugin enabled.")}initialize(){this.guardDataview();let{roll:t=1,query:i,types:n}=this.lexeme.value.match(this.regex).groups;this.base=i,this.rolls=Number(t),this.types=n,this.types&&(this.isLink=this.types.includes("link"),this.types=this.types.replace("link","")),!this.isLink&&this.data.displayAsEmbed&&this.containerEl.addClasses(["has-embed","markdown-embed"]),this.getFiles()}get typeText(){return this.types?.length?`|${this.types}`:""}async getFiles(){if(!Vt.canUseDataview){new Wn.Notice("Dice Roller: Dataview must be installed and enabled to use query rollers.");return}await Vt.dataviewReady();let t=await Vt.api.query(this.query);if(!t.successful)throw new Error(`No files found with that query. Is the query correct? +`)}transformResultsToString(){return this.displayFromCache(...this.results)}async getBlockId(){this.result||await this.roll();let e=this.cache.blocks??{},t=Object.entries(e).find(([i,n])=>pg(n.position,this.result.position));if(!t){let i=`${sA(4)}`,n=`${this.content.slice(0,this.result.position.end.offset+1)}^${i}${this.content.slice(this.result.position.end.offset)}`;return this.app.vault.modify(this.file,n),i}return t[0]}getPath(){let{groups:e}=this.lexeme.value.match(ec)??{},{roll:t=1,link:i,types:n}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=decodeURIComponent(i.replace(/(\[|\]|\(|\))/g,"")),this.types=n?.split(","),this.levels=n?.split(",").map(s=>/heading\-\d+/.test(s)?s.split("-").pop():null).filter(s=>s),this.types=n?.split(",").map(s=>/heading\-\d+/.test(s)?s.split("-").shift():s)}async getOptions(e,t){if(this.cache=e,!this.cache||!this.cache.sections)throw new Error("Could not read file cache.");let i=t;await this.checkForDirtiness(i)&&(this.content=i,this.content=t,this.options=this.cache.sections.filter(({type:n,position:s})=>this.types?n=="heading"&&this.types.includes(n)&&this.levels.length?(this.cache.headings??[]).filter(({level:a})=>this.levels.includes(`${a}`)).some(({position:a})=>pg(a,s)):this.types.includes(n):!["yaml","thematicBreak"].includes(n)),this.types&&this.types.includes("listItem")&&this.options.push(...this.cache.listItems))}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.once("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),this.result=this.results[0],e(this.results[0])}})}},pg=(r,e)=>r.start.col==e.start.col&&r.start.line==e.start.line&&r.start.offset==e.start.offset;var Zn=require("obsidian");var ic=class extends Yn{constructor(t,i,n,s,o,a=t.position){super(t,i,[n],a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.app=o;this.isLink=!1;this.loaded=!1}async getReplacer(){return this.isLink?`[[${this.result.file.basename}]]`:await this.result.getReplacer()}guardDataview(){if(!oi.canUseDataview)throw new Zn.Notice("A query can only be rolled with the Dataview plugin enabled."),new Error("A query can only be rolled with the Dataview plugin enabled.")}initialize(){this.guardDataview();let{roll:t=1,query:i,types:n}=this.lexeme.value.match(this.regex).groups;this.base=i,this.rolls=Number(t),this.types=n,this.types&&(this.isLink=this.types.includes("link"),this.types=this.types.replace("link","")),!this.isLink&&this.data.displayAsEmbed&&this.containerEl.addClasses(["has-embed","markdown-embed"]),this.getFiles()}get typeText(){return this.types?.length?`|${this.types}`:""}async getFiles(){if(!oi.canUseDataview){new Zn.Notice("Dice Roller: Dataview must be installed and enabled to use query rollers.");return}await oi.dataviewReady();let t=await oi.api.query(this.query);if(!t.successful)throw new Error(`No files found with that query. Is the query correct? `+this.query);let i=new Set(t.value.values.reduce((o,a)=>(a.type=="file"&&o.push(a.path),o),[]));if(i&&i.delete(this.source),!i||!i.size)throw new Error(`No files found with that query. Is the query correct? -`+this.query);let n=Array.from(i).map(o=>`[[${o}]]${this.typeText}`);this.results=[];let s=[];for(let o of n)s.push(new Promise(async a=>{let l=new Gn(this.data,o,{...this.lexeme,value:o,type:"section"},this.source,this.app,!1);this.results.push(l),a()}));await Promise.all(s),this.loaded=!0,this.trigger("loaded")}async build(){this.resultEl.empty(),this.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText});let t=[],i=new Map(this.results.map((n,s)=>[s,n]));for(let n=0;n(s.push(`[[${o.file.basename}]]`),l.length>1&&a!=l.length-1&&s.push(","),s),[]);Wn.MarkdownRenderer.render(this.app,n.join(" "),this.resultEl,this.app.workspace.getActiveFile()?.path,new Wn.Component)}else for(let n of t){let s=this.resultEl.createDiv();s.createEl("h5",{cls:"dice-file-name",text:n.file.basename}),s.appendChild(n.containerEl)}}async roll(){return new Promise((t,i)=>{this.loaded?(this.result=this.results[0],this.render(),this.trigger("new-result"),t(this.result)):this.on("loaded",()=>{this.result=this.results[0],this.render(),this.trigger("new-result"),t(this.result)})})}get tooltip(){return this.original}},go=class extends Cl{constructor(t,i,n,s,o,a=t.showDice){super(t,i,n,s,o,a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.regex=lm;this.initialize()}get query(){return this.base}},yo=class extends Cl{constructor(t,i,n,s,o,a=t.showDice){super(t,i,n,s,o,a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.regex=am;this.initialize()}get query(){return`list from #${this.base}`}};var ce=require("obsidian");var Zs=require("obsidian"),T_=createSvg("svg",{attr:{viewBox:"0 0 500 500"}}),C_=createSvg("text",{attr:{class:"font",fill:"currentColor",x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central"}}),Rl=(a=>(a.NONE="None",a.TRIANGLE="Triangle",a.SQUARE="Square",a.DIAMOND="Diamond",a.DODECAHEDRON="Dodecahedron",a.ICOSAHEDRON="Icosahedron",a.CIRCLE="Circle",a))(Rl||{}),vm=[{id:"dice-roller-d4",shape:"Triangle",formula:"d4",text:"4"},{id:"dice-roller-d6",shape:"Square",formula:"d6",text:"6"},{id:"dice-roller-d8",shape:"Diamond",formula:"d8",text:"8"},{id:"dice-roller-d10",shape:"Diamond",formula:"d10",text:"10"},{id:"dice-roller-d12",shape:"Dodecahedron",formula:"d12",text:"12"},{id:"dice-roller-d20",shape:"Icosahedron",formula:"d20",text:"20"},{id:"dice-roller-d100",shape:"Circle",formula:"d%",text:"%"}],Dh=class extends Zs.Component{#e(){return T_.cloneNode(!0)}#t(){return C_.cloneNode()}#i=new Set;registerIcon(e,t,i){this.#i.add(e);let n=this.#e(),s=this.#t();s.textContent=i,n.appendChild(s);let o;switch(t){case"Triangle":o=this.getTriangle();break;case"Square":{o=this.getSquare();break}case"Diamond":{o=this.getDiamond();break}case"Dodecahedron":{o=this.getDodecahedron();break}case"Icosahedron":{o=this.getIcosahedron();break}case"Circle":{o=this.getCircle();break}case"None":o=createSvg("defs")}n.appendChild(o),(0,Zs.addIcon)(e,n.outerHTML),this.register(()=>(0,Zs.removeIcon)(e))}getTriangle(){return this.#n("path",{d:"M244.6,49.3L40.3,403.2c-1.7,3-0.7,6.8,2.3,8.5c0.9,0.5,2,0.8,3.1,0.8h408.6c3.4,0,6.2-2.8,6.2-6.2 c0-1.1-0.3-2.2-0.8-3.1L255.4,49.3c-1.7-3-5.5-4-8.5-2.3C246,47.6,245.2,48.4,244.6,49.3z"})}getSquare(){return this.#n("rect",{x:"87.5",y:"87.5",width:"325",height:"325",rx:"10"})}getDiamond(){return this.#n("rect",{x:"102.75",y:"102.75",width:"294.51",height:"294.51",rx:"9.8",transform:"translate(-103.55 250) rotate(-45)"})}getDodecahedron(){return this.#n("path",{d:"M244.31,29.14,52,168.87a9.72,9.72,0,0,0-3.52,10.84l73.47,226.1a9.69,9.69,0,0,0,9.21,6.69H368.87a9.69,9.69,0,0,0,9.21-6.69l73.47-226.1A9.72,9.72,0,0,0,448,168.87L255.69,29.14A9.66,9.66,0,0,0,244.31,29.14Z"})}getIcosahedron(){return this.#n("path",{d:"M55.14,143.27V356.73a10,10,0,0,0,5,8.66L245,472.11a10,10,0,0,0,10,0L439.86,365.39a10,10,0,0,0,5-8.66V143.27a10,10,0,0,0-5-8.66L255,27.89a10,10,0,0,0-10,0L60.14,134.61A10,10,0,0,0,55.14,143.27Z"})}getCircle(){return this.#n("circle",{cx:"250",cy:"250",r:"190"})}#n(e,t){return createSvg(e,{cls:"shape",attr:{...t,stroke:"currentColor"}})}onunload(){}},Fl=new Dh;var R_=Function.prototype.toString,Th=Object.create,F_=Object.prototype.toString,L_=function(){function r(){this._keys=[],this._values=[]}return r.prototype.has=function(e){return!!~this._keys.indexOf(e)},r.prototype.get=function(e){return this._values[this._keys.indexOf(e)]},r.prototype.set=function(e,t){this._keys.push(e),this._values.push(t)},r}();function B_(){return new L_}function P_(){return new WeakMap}var I_=typeof WeakMap<"u"?P_:B_;function Rh(r){if(!r)return Th(null);var e=r.constructor;if(e===Object)return r===Object.prototype?{}:Th(r);if(e&&~R_.call(e).indexOf("[native code]"))try{return new e}catch{}return Th(r)}function N_(r){var e="";return r.global&&(e+="g"),r.ignoreCase&&(e+="i"),r.multiline&&(e+="m"),r.unicode&&(e+="u"),r.sticky&&(e+="y"),e}function k_(r){return r.flags}var z_=/test/g.flags==="g"?k_:N_;function wm(r){var e=F_.call(r);return e.substring(8,e.length-1)}function O_(r){return r[Symbol.toStringTag]||wm(r)}var V_=typeof Symbol<"u"?O_:wm,U_=Object.defineProperty,H_=Object.getOwnPropertyDescriptor,bm=Object.getOwnPropertyNames,Fh=Object.getOwnPropertySymbols,_m=Object.prototype,Em=_m.hasOwnProperty,G_=_m.propertyIsEnumerable,Am=typeof Fh=="function";function q_(r){return bm(r).concat(Fh(r))}var W_=Am?q_:bm;function Bl(r,e,t){for(var i=W_(r),n=0,s=i.length,o=void 0,a=void 0;nt instanceof ce.TFolder);this.folders=[];this.plugin=i}async getFonts(){let t=[];try{ce.Platform.isMobile&&window?.Capacitor?.isPluginAvailable("App")?t=await window?.Capacitor?.Plugins.App?.getFonts()?.catch(n=>[]):t=await require("get-fonts").getFonts().catch(n=>[])}catch{}let i=new Set;for(let n of t)i.add(n);return[...i].sort()}async display(){let{containerEl:t}=this;t.empty(),t.addClass("dice-roller-settings"),this.contentEl=this.containerEl.createDiv("dice-roller-settings-content"),this.buildGenerics(this.contentEl.createDiv()),this.buildDisplay(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildDice(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildView(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildRender(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildFormulaSettings(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildTables(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildSections(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildTags(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),this.buildDiceModTemplateFoldersSettings(this.contentEl.createEl("details",{cls:"dice-roller-nested-settings"})),t.createDiv("coffee").createEl("a",{href:"https://www.buymeacoffee.com/valentine195"}).createEl("img",{attr:{src:"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=\u2615&slug=valentine195&button_colour=e3e7ef&font_colour=262626&font_family=Inter&outline_colour=262626&coffee_colour=ff0000"}})}buildGenerics(t){t.empty()}#e(t,i){let n=t.createEl("summary");new ce.Setting(n).setHeading().setName(i),(0,ce.setIcon)(n.createDiv("collapser").createDiv("handle"),"chevron-right")}buildDisplay(t){t.empty(),this.#e(t,"Dice Display"),new ce.Setting(t).setName("Display Formula With Results").setDesc("Both the formula and the results will both be displayed in preview mode.").addToggle(i=>{i.setValue(this.plugin.data.displayResultsInline),i.onChange(async n=>{this.plugin.data.displayResultsInline=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display Dice Button With Results").setDesc("A dice button will appear next to results.").addToggle(i=>{i.setValue(this.plugin.data.showDice),i.onChange(async n=>{this.plugin.data.showDice=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display Formula in Parentheses After").setDesc(createFragment(i=>{i.createSpan({text:"For example, "}),i.createEl("code",{text:"`dice: 1d6`"}),i.createSpan({text:" will become "});let n=i.createSpan("dice-roller");n.createSpan({cls:"dice-roller-result",text:"3"}),(0,ce.setIcon)(n.createSpan("dice-roller-button"),"dices"),i.createSpan({text:" (1d6). This only affects Dice Rollers."})})).addToggle(i=>{i.setValue(this.plugin.data.displayFormulaAfter),i.onChange(async n=>{this.plugin.data.displayFormulaAfter=n,await this.plugin.saveSettings()})})}buildDice(t){t.empty(),this.#e(t,"Dice Rollers"),new ce.Setting(t).setName("Default Face").setDesc("Use this as the number of faces when it is omitted.").addText(i=>{i.setValue(`${this.plugin.data.defaultFace}`),i.inputEl.onblur=async()=>{isNaN(Number(i.inputEl.value))&&new ce.Notice("The default face must be a number."),this.plugin.data.defaultFace=Number(i.inputEl.value),qn.setDefaultFace(this.plugin.data.defaultFace),await this.plugin.saveSettings()}}),new ce.Setting(t).setName("Round Results").setDesc("Determine the rounding behavior for dice results.").addDropdown(i=>{i.addOptions(Ys).setValue(this.plugin.data.round).onChange(n=>{this.plugin.data.round=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Auto Roll dice").setDesc("On initial display, should dice be rolled or displayed empty.").addDropdown(i=>{i.addOption("None","Empty").addOption("Roll","Rolled").setValue(this.plugin.data.initialDisplay).onChange(n=>{this.plugin.data.initialDisplay=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Show Signed Results").setDesc("Positive results will show a '+'. This setting has no effect on negative results.").addToggle(i=>{i.setValue(this.plugin.data.signed).onChange(n=>{this.plugin.data.signed=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Always Render Dice").setDesc(createFragment(i=>{i.createSpan({text:"Dice rolled in notes will always be rendered. Use the "}),i.createEl("code",{text:"|norender"}),i.createSpan({text:" flag to prevent it."})})).addToggle(i=>{i.setValue(this.plugin.data.renderAllDice).onChange(n=>{this.plugin.data.renderAllDice=n,this.plugin.saveSettings()})}),new ce.Setting(t).setName("Log All Rolls to Dice Tray").setDesc(createFragment(i=>{i.createSpan({text:"Dice rolled in notes will be added to the Dice Tray's Results section."})})).addToggle(i=>{i.setValue(this.plugin.data.addToView).onChange(n=>{this.plugin.data.addToView=n,this.plugin.saveSettings()})})}buildTables(t){t.empty(),this.#e(t,"Table Rollers"),new ce.Setting(t).setName("Display Lookup Table Roll").setDesc("Lookup table rolls will display the rolled number along with the result.").addToggle(i=>{i.setValue(this.plugin.data.displayLookupRoll),i.onChange(async n=>{this.plugin.data.displayLookupRoll=n,await this.plugin.saveSettings()})})}buildSections(t){t.empty(),this.#e(t,"Section Rollers"),new ce.Setting(t).setName("Add Copy Button to Section Results").setDesc("Randomly rolled sections will have a copy-content button to easy add result to clipboard.").addToggle(i=>{i.setValue(this.plugin.data.copyContentButton),i.onChange(async n=>{this.plugin.data.copyContentButton=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display As Embeds").setDesc("Sections returned from Section & Tag Rollers will display as embedded fields.").addToggle(i=>{i.setValue(this.plugin.data.displayAsEmbed),i.onChange(async n=>{this.plugin.data.displayAsEmbed=n,await this.plugin.saveSettings()})})}buildTags(t){t.empty(),this.#e(t,"Tag Rollers"),new ce.Setting(t).setName("Always Return Links for Tags").setDesc("Enables random link rolling with the link parameter. Override by specifying a section type.").addToggle(i=>{i.setValue(this.plugin.data.rollLinksForTags),i.onChange(async n=>{this.plugin.data.rollLinksForTags=n,await this.plugin.saveSettings()})})}buildView(t){t.empty(),this.#e(t,"Dice Tray"),new ce.Setting(t).setName("Open Dice Tray on Startup").setDesc("The dice view can always be opened using the command from the command palette.").addToggle(i=>{i.setValue(this.plugin.data.showLeafOnStartup),i.onChange(async n=>{this.plugin.data.showLeafOnStartup=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Dice Tray Buttons").setDesc("Add and remove the buttons available in the Dice Tray here, to customize what quick-actions are available to roll."),this.iconsEl=t.createDiv("dice-icons"),this.buildIcons()}buildIcons(){if(this.iconsEl.empty(),!this.plugin.data.icons){this.iconsEl.createSpan({cls:"no-icons",text:"No dice buttons created! Create a button to use this functionality."});return}let i=this.iconsEl.createDiv("existing-buttons has-table").createDiv("buttons-table");for(let u=0;u{s.formula=u,l.setDisabled(s.text?.length===0||s.formula?.length===0)}),new ce.TextComponent(a).setPlaceholder("Display").onChange(u=>{s.text=u,l.setDisabled(s.text?.length===0||s.formula?.length===0)});let l=new ce.ExtraButtonComponent(n.createDiv("actions")).setIcon("save").setDisabled(!0).onClick(async()=>{!s.text||!s.formula||(this.plugin.data.icons.push({...s}),this.buildIcons(),await this.plugin.view.buildButtons(),await this.plugin.saveSettings())}),c=new ce.DropdownComponent(o);for(let[u,h]of Object.entries(Rl))c.addOption(h,h);c.setValue(s.shape).onChange(u=>{s.shape=c.getValue()}),s.shape=c.getValue()}buildStaticIcon(t,i){t.empty(),t.removeClass("add-new");let n=this.plugin.data.icons[i],s=t.createDiv("shape dice-button");Fl.registerIcon(n.id,n.shape,n.text),(0,ce.setIcon)(s,n.id),t.createDiv({cls:"formula",text:n.formula});let o=t.createDiv("actions");new ce.ExtraButtonComponent(o).setIcon("edit").onClick(()=>{this.buildEditIcon(t,i,n)}),new ce.ExtraButtonComponent(o).setIcon("trash").onClick(async()=>{this.plugin.data.icons.splice(i,1),await this.plugin.view.buildButtons(),this.buildIcons()})}buildEditIcon(t,i,n){t.empty(),t.addClass("add-new");let s={text:n.text,formula:n.formula,shape:n.shape,id:n.id},o=t.createDiv("shape"),a=t.createDiv("formula");new ce.TextComponent(a).setPlaceholder("Formula").setValue(s.formula).onChange(h=>{s.formula=h,c.setDisabled(s.text.length===0||s.formula.length===0)}),new ce.TextComponent(a).setPlaceholder("Display").setValue(s.text).onChange(h=>{s.text=h,c.setDisabled(s.text.length===0||s.formula.length===0)});let l=t.createDiv("actions"),c=new ce.ExtraButtonComponent(l).setIcon("checkmark").setDisabled(s.text.length===0||s.formula.length===0).onClick(async()=>{!s.text||!s.formula||(this.plugin.data.icons.splice(i,1,{...s}),await this.plugin.saveSettings(),this.buildStaticIcon(t,i),await this.plugin.view.buildButtons())});new ce.ExtraButtonComponent(l).setIcon("cross").onClick(()=>{this.buildStaticIcon(t,i)});let u=new ce.DropdownComponent(o);for(let[h,d]of Object.entries(Rl))u.addOption(d,d);u.setValue(s.shape).onChange(h=>{s.shape=h})}buildRender(t){t.empty(),this.#e(t,"Graphical Dice"),new ce.Setting(t).setName("Display graphics for Dice Tray Rolls").setDesc("Dice rolls from dice view will be displayed on screen.").addToggle(s=>{s.setValue(this.plugin.data.renderer),s.onChange(async o=>{this.plugin.data.renderer=o,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Display Time for Dice Graphics").setDesc("Rendered dice will stay on screen for this number of milliseconds. Leave blank to require a click to clear dice.").addText(s=>{s.inputEl.setAttr("type","number"),s.inputEl.onblur=o=>{Number(s.getValue())<0&&(new ce.Notice("Render time cannot be less than 0."),s.setValue("0"))},s.setValue(`${this.plugin.data.renderTime}`),s.onChange(async o=>{o&&Number(o)<0||isNaN(Number(o))||(this.plugin.data.renderTime=Number(o),this.plugin.renderer.setData(this.plugin.getRendererData()),await this.plugin.saveSettings())})}).addExtraButton(s=>{s.setIcon("reset").setTooltip("Reset to Default").onClick(async()=>{this.plugin.data.renderTime=Il.renderTime,await this.plugin.saveSettings(),this.buildRender(t)})}),new ce.Setting(t).setName("Use Colorful Dice").setDesc("Rendered dice will be varied colors based on the dice type. This will override manually set dice and text colors.").addToggle(s=>{s.setValue(this.plugin.data.colorfulDice),s.onChange(async o=>{this.plugin.data.colorfulDice=o,this.plugin.renderer.setData(this.plugin.getRendererData()),await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Adjust Dice Scale").setDesc("Control the size of rendered dice.").addSlider(s=>{s.setLimits(.5,1.5,.1).setValue(this.plugin.data.scaler).onChange(o=>{this.plugin.data.scaler=o,this.plugin.renderer.setData(this.plugin.getRendererData()),this.plugin.saveSettings()})}),new ce.Setting(t).setName("Font for dice").setDesc("Select the font to use for the dice").addText(async s=>{let o=async()=>{this.plugin.data.textFont=s.getValue(),await this.plugin.saveSettings(),this.plugin.renderer.setData(this.plugin.getRendererData())};new kl(this.app,s,await this.getFonts()).onSelect(({item:l})=>{s.setValue(l),o()}),s.setValue(this.plugin.data.textFont),s.inputEl.onblur=async()=>{o()}}),new ce.Setting(t).setName("Dice Base Color").setDesc("Rendered dice will be this color.").controlEl.createEl("input",{type:"color",value:this.plugin.data.diceColor},s=>{s.value=this.plugin.data.diceColor,s.onchange=async({target:o})=>{let a=o.value;this.plugin.data.diceColor=a,this.plugin.renderer.setData(this.plugin.getRendererData()),await this.plugin.saveSettings()}}),new ce.Setting(t).setName("Dice Text Color").setDesc("Rendered dice will use this color for their numbers.").controlEl.createEl("input",{type:"color",value:this.plugin.data.textColor},s=>{s.value=this.plugin.data.textColor,s.onchange=async({target:o})=>{let a=o.value;a&&(this.plugin.data.textColor=a,this.plugin.renderer.setData(this.plugin.getRendererData()),await this.plugin.saveSettings())}}),new ce.Setting(t).setName("Show Notice for Results").setDesc(createFragment(s=>{s.createSpan({text:"A notice will be displayed for each rendered dice roll."}),s.createEl("br"),s.createSpan({text:"Changing this setting will not effect any existing dice rollers in opened notes."})})).addToggle(s=>{s.setValue(this.plugin.data.showRenderNotice).onChange(async o=>{this.plugin.data.showRenderNotice=o,await this.plugin.saveSettings()})})}buildFormulaSettings(t){t.empty(),this.#e(t,"Saved Formulas");let i=t.createDiv("dice-roller-setting-additional-container"),n=i.createDiv();new ce.Setting(n).setName("Add Formula").setDesc("Add a new formula shortcut.").addButton(a=>a.setTooltip("Add Formula").setButtonText("+").onClick(async()=>{let c=await this.buildFormulaForm(n);c&&(this.plugin.data.formulas[c.alias]=c.formula,this.buildFormulaSettings(t),await this.plugin.saveSettings())}));let s=i.createDiv("additional"),o=this.plugin.data.formulas;for(let[a,l]of Object.entries(o)){let c=new ce.Setting(s).setName(a);c.controlEl.createSpan({text:l}),c.addExtraButton(u=>u.setIcon("edit").setTooltip("Edit").onClick(async()=>{let h=await this.buildFormulaForm(n,{alias:a,formula:l});h&&(delete this.plugin.data.formulas[a],this.plugin.data.formulas[h.alias]=h.formula,this.buildFormulaSettings(t),await this.plugin.saveSettings())})).addExtraButton(u=>u.setIcon("trash").setTooltip("Delete").onClick(async()=>{delete this.plugin.data.formulas[a],await this.plugin.saveSettings(),this.buildFormulaSettings(t)}))}Object.values(o).length||s.createSpan({text:"Create a formula to see it here!",cls:"no-formulas"})}async buildFormulaForm(t,i={alias:null,formula:null}){return new Promise(n=>{let s=t.createDiv("add-new-formula"),o=s.createDiv("formula-data");new ce.Setting(o).setName("Alias").addText(l=>{l.setValue(i.alias).onChange(c=>i.alias=c)}),new ce.Setting(o).setName("Formula").addText(l=>{l.setValue(i.formula).onChange(c=>i.formula=c)});let a=s.createDiv("formula-buttons");new ce.Setting(a).addButton(l=>l.setCta().setButtonText("Save").onClick(async()=>{s.detach(),n(i)})).addExtraButton(l=>l.setIcon("cross").setTooltip("Cancel").onClick(()=>{s.detach(),n(null)}))})}#t;buildDiceModTemplateFoldersSettings(t){t.empty(),this.#e(t,"Modify Dice"),new ce.Setting(t).setName(createFragment(i=>{i.createSpan({text:"Apply "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" in live-preview"})})).setDesc(createFragment(i=>{i.createSpan({text:"If not enabled "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" will only be applied/replaced in read mode."})})).addToggle(i=>{i.setValue(this.plugin.data.replaceDiceModInLivePreview),i.onChange(async n=>{this.plugin.data.replaceDiceModInLivePreview=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Escape Markdown When Modifying").setDesc(createFragment(i=>{i.createSpan({text:"Markdown characters will be escaped when using "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:"."})})).addToggle(i=>{i.setValue(this.plugin.data.escapeDiceMod),i.onChange(async n=>{this.plugin.data.escapeDiceMod=n,await this.plugin.saveSettings()})}),new ce.Setting(t).setName("Add Formula When Using Modify Dice").setDesc(createFragment(i=>{i.createSpan({text:"Both the formula and the results will both be added to the note when using "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:"."})})).addToggle(i=>{i.setValue(this.plugin.data.displayFormulaForMod),i.onChange(async n=>{this.plugin.data.displayFormulaForMod=n,await this.plugin.saveSettings()})}),this.pathsEl=t.createDiv("template-paths dice-roller-setting-additional-container"),this.buildPaths()}buildPaths(){if(this.#t){this.folders=this.allFolders.filter(n=>!(n.path in this.plugin.data.diceModTemplateFolders));let i=Object.entries(this.plugin.data.diceModTemplateFolders);i.sort((n,s)=>n[0].localeCompare(s[0])),this.plugin.data.diceModTemplateFolders=Object.fromEntries(i),this.#t=!1}this.pathsEl.empty(),new ce.Setting(this.pathsEl).setName("Template Folders").setDesc(createFragment(i=>{i.createSpan({text:"Define folders where "}),i.createEl("code",{text:"dice-mod"}),i.createSpan({text:" is not applied/replaced and can be used in templates."})})).setHeading();let t=this.pathsEl.createDiv("additional");for(let i in this.plugin.data.diceModTemplateFolders)this.buildStaticPath(t.createDiv(),i);this.buildEditPath(t.createDiv())}buildStaticPath(t,i){t.empty();let n=this.plugin.data.diceModTemplateFolders[i],s=new ce.Setting(t).setName(i);s.setDesc(createFragment(o=>{let a=o.createDiv({attr:{style:"display: flex;align-items: center;gap: 0.5rem;"}});n?((0,ce.setIcon)(a,"folder-tree"),a.createSpan({text:"Includes Subfolders"})):((0,ce.setIcon)(a,"folder-closed"),a.createSpan({text:"Root Only"}))})),s.addExtraButton(o=>o.setIcon("edit").onClick(()=>{this.buildEditPath(t,i)})).addExtraButton(o=>o.setIcon("trash").onClick(async()=>{delete this.plugin.data.diceModTemplateFolders[i],await this.plugin.saveSettings(),this.#t=!0,this.buildPaths()}))}buildEditPath(t,i){t.empty();let n={folder:i,useSubfolders:this.plugin.data.diceModTemplateFolders[i]??!0},s=t.createDiv("template-edit setting-item"),o=s.createDiv("template-input"),a=o.createDiv("folder-input"),l=new ce.ExtraButtonComponent(o).onClick(()=>{n.useSubfolders=!n.useSubfolders,n.useSubfolders?l.setIcon("folder-tree").setTooltip("Including Subfolders"):l.setIcon("folder-closed").setTooltip("Not Including Subfolders")});this.plugin.data.diceModTemplateFolders[i]??!0?l.setIcon("folder-tree").setTooltip("Including Subfolders"):l.setIcon("folder-closed").setTooltip("Not Including Subfolders");let c=s.createDiv("actions");i||new ce.ExtraButtonComponent(c).extraSettingsEl.setAttr("style","visibility: hidden;");let u=new ce.ExtraButtonComponent(c).setIcon(i?"checkmark":"save").setDisabled(!i).onClick(async()=>{this.plugin.data.diceModTemplateFolders[n.folder]=n.useSubfolders,await this.plugin.saveSettings(),n.folder!=i?(this.#t=!0,this.buildPaths()):this.buildStaticPath(t,i)});i&&new ce.ExtraButtonComponent(c).setIcon("cross").onClick(()=>this.buildStaticPath(t,i)),this.buildPathInput(a,u,h=>{n.folder=h},i)}buildPathInput(t,i,n,s="Folder"){let o=c=>{if(!c||!c.length||c in this.plugin.data.diceModTemplateFolders)return i.setDisabled(!0),!1;i.setDisabled(!1),n((0,ce.normalizePath)(c))},a=new ce.TextComponent(t).setPlaceholder(s).onChange(c=>{o(c)}),l=new Um.FolderInputSuggest(this.app,a,this.folders);l.onSelect(async c=>{l.close(),l.setValue(c.item.path),o(c.item.path)})}};var vt=require("obsidian");var Hm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Gm=(r=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(r));for(;r--;)e+=Hm[t[r]&63];return e};function Sn(){}function SE(r,e){for(let t in e)r[t]=e[t];return r}function zh(r){return r()}function zl(){return Object.create(null)}function It(r){r.forEach(zh)}function vo(r){return typeof r=="function"}function Ol(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function qm(r){return Object.keys(r).length===0}function Oh(r,e,t,i){if(r){let n=Wm(r,e,t,i);return r[0](n)}}function Wm(r,e,t,i){return r[1]&&i?SE(t.ctx.slice(),r[1](i(e))):t.ctx}function Vh(r,e,t,i){if(r[2]&&i){let n=r[2](i(t));if(e.dirty===void 0)return n;if(typeof n=="object"){let s=[],o=Math.max(e.dirty.length,n.length);for(let a=0;a32){let e=[],t=r.ctx.length/32;for(let i=0;i{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(e=>{for(let t of e)r.entries.set(t.target,t),this._listeners.get(t.target)?.(t)}))}};Vl.entries="WeakMap"in Gh?new WeakMap:void 0;var $m=!1;function jm(){$m=!0}function Xm(){$m=!1}function Ye(r,e){r.appendChild(e)}function Ul(r,e,t){let i=Ym(r);if(!i.getElementById(e)){let n=lt("style");n.id=e,n.textContent=t,TE(i,n)}}function Ym(r){if(!r)return document;let e=r.getRootNode?r.getRootNode():r.ownerDocument;return e&&e.host?e:r.ownerDocument}function TE(r,e){return Ye(r.head||r,e),e.sheet}function $i(r,e,t){r.insertBefore(e,t||null)}function ai(r){r.parentNode&&r.parentNode.removeChild(r)}function lt(r){return document.createElement(r)}function $n(r){return document.createTextNode(r)}function ji(){return $n(" ")}function Zm(){return $n("")}function jn(r,e,t,i){return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}function pt(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Jm(r){return Array.from(r.childNodes)}function wo(r,e){e=""+e,r.data!==e&&(r.data=e)}function qh(r,e,t){r.classList.toggle(e,!!t)}function Km(r){let e={};return r.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var Ks;function Xi(r){Ks=r}var Xn=[];var eg=[],er=[],tg=[],PE=Promise.resolve(),$h=!1;function ig(){$h||($h=!0,PE.then(Hl))}function bo(r){er.push(r)}var Wh=new Set,Qs=0;function Hl(){if(Qs!==0)return;let r=Ks;do{try{for(;Qsr.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),er=e}var Gl=new Set,Yn;function _o(){Yn={r:0,c:[],p:Yn}}function Eo(){Yn.r||It(Yn.c),Yn=Yn.p}function Ft(r,e){r&&r.i&&(Gl.delete(r),r.i(e))}function li(r,e,t,i){if(r&&r.o){if(Gl.has(r))return;Gl.add(r),Yn.c.push(()=>{Gl.delete(r),i&&(t&&r.d(1),i())}),r.o(e)}else i&&i()}function Ao(r){return r?.length!==void 0?r:Array.from(r)}function sg(r,e){r.d(1),e.delete(r.key)}function rg(r,e,t,i,n,s,o,a,l,c,u,h){let d=r.length,p=s.length,m=d,y={};for(;m--;)y[r[m].key]=m;let x=[],g=new Map,f=new Map,E=[];for(m=p;m--;){let T=h(n,s,m),O=t(T),W=o.get(O);W?i&&E.push(()=>W.p(T,e)):(W=c(O,T),W.c()),g.set(O,x[m]=W),O in y&&f.set(O,Math.abs(m-y[O]))}let w=new Set,_=new Set;function D(T){Ft(T,1),T.m(a,u),o.set(T.key,T),u=T.first,p--}for(;d&&p;){let T=x[p-1],O=r[d-1],W=T.key,A=O.key;T===O?(u=T.first,d--,p--):g.has(A)?!o.has(W)||w.has(W)?D(T):_.has(A)?d--:f.get(W)>f.get(A)?(_.add(W),D(T)):(w.add(A),d--):(l(O,o),d--)}for(;d--;){let T=r[d];g.has(T.key)||l(T,o)}for(;p;)D(x[p-1]);return It(E),x}var NE=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],kE=new Set([...NE]);function og(r){r&&r.c()}function Xh(r,e,t){let{fragment:i,after_update:n}=r.$$;i&&i.m(e,t),bo(()=>{let s=r.$$.on_mount.map(zh).filter(vo);r.$$.on_destroy?r.$$.on_destroy.push(...s):It(s),r.$$.on_mount=[]}),n.forEach(bo)}function Yh(r,e){let t=r.$$;t.fragment!==null&&(ng(t.after_update),It(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function OE(r,e){r.$$.dirty[0]===-1&&(Xn.push(r),ig(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let m=p.length?p[0]:d;return c.ctx&&n(c.ctx[h],c.ctx[h]=m)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](m),u&&OE(r,h)),d}):[],c.update(),u=!0,It(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){jm();let h=Jm(e.target);c.fragment&&c.fragment.l(h),h.forEach(ai)}else c.fragment&&c.fragment.c();e.intro&&Ft(r.$$.fragment),Xh(r,e.target,e.anchor),Xm(),Hl()}Xi(l)}var VE;typeof HTMLElement=="function"&&(VE=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(r,e,t){super(),this.$$ctor=r,this.$$s=e,t&&this.attachShadow({mode:"open"})}addEventListener(r,e,t){if(this.$$l[r]=this.$$l[r]||[],this.$$l[r].push(e),this.$$c){let i=this.$$c.$on(r,e);this.$$l_u.set(e,i)}super.addEventListener(r,e,t)}removeEventListener(r,e,t){if(super.removeEventListener(r,e,t),this.$$c){let i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let r=function(n){return()=>{let s;return{c:function(){s=lt("slot"),n!=="default"&&pt(s,"name",n)},m:function(l,c){$i(l,s,c)},d:function(l){l&&ai(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let e={},t=Km(this);for(let n of this.$$s)n in t&&(e[n]=[r(n)]);for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=jh(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});let i=()=>{this.$$r=!0;for(let n in this.$$p_d)if(this.$$d[n]=this.$$c.$$.ctx[this.$$c.$$.props[n]],this.$$p_d[n].reflect){let s=jh(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(let n in this.$$l)for(let s of this.$$l[n]){let o=this.$$c.$on(n,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(r,e,t){this.$$r||(r=this.$$g_p(r),this.$$d[r]=jh(r,t,this.$$p_d,"toProp"),this.$$c?.$set({[r]:this.$$d[r]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(r){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===r||!this.$$p_d[e].attribute&&e.toLowerCase()===r)||r}});function jh(r,e,t,i){let n=t[r]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!t[r])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var Zn=class{$$=void 0;$$set=void 0;$destroy(){Yh(this,1),this.$destroy=Sn}$on(e,t){if(!vo(t))return Sn;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}$set(e){this.$$set&&!qm(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var ag="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(ag);var ug=require("obsidian");function UE(r){Ul(r,"svelte-1my4lf",'.always-open.svelte-1my4lf.svelte-1my4lf{pointer-events:none}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{pointer-events:initial}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{position:relative}.calendarium-nested-summary.svelte-1my4lf.svelte-1my4lf{outline:none;list-style:none !important;list-style-type:none !important;min-height:1rem;border-top-left-radius:0.1rem;border-top-right-radius:0.1rem;cursor:pointer;background-color:var(--creator-background-color);margin-right:0;display:flex;justify-content:space-between}.right-side.svelte-1my4lf.svelte-1my4lf{display:flex;align-items:center;gap:1rem}summary.svelte-1my4lf.svelte-1my4lf::-webkit-details-marker,summary.svelte-1my4lf.svelte-1my4lf::marker{display:none !important}.always-open.svelte-1my4lf .handle.svelte-1my4lf{display:none}.collapser.svelte-1my4lf.svelte-1my4lf{display:flex;flex-flow:column;justify-content:flex-start;align-items:flex-end;content:""}.handle.svelte-1my4lf.svelte-1my4lf{transform:rotate(0deg);transition:transform 0.25s;display:flex}details[open].svelte-1my4lf .handle.svelte-1my4lf{transform:rotate(90deg)}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{padding:0.75em var(--size-4-3)}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{border-top:0px}')}var HE=r=>({}),lg=r=>({class:"context"});function cg(r){let e,t=r[8].context,i=Oh(t,r,r[7],lg);return{c(){i&&i.c()},m(n,s){i&&i.m(n,s),e=!0},p(n,s){i&&i.p&&(!e||s&128)&&Uh(i,t,n,n[7],e?Vh(t,n[7],s,HE):Hh(n[7]),lg)},i(n){e||(Ft(i,n),e=!0)},o(n){li(i,n),e=!1},d(n){i&&i.d(n)}}}function GE(r){let e,t,i,n,s,o,a,l,c,u,h,d,p,m,y,x,g,f,E,w,_,D,T=r[0]&&cg(r),O=r[8].default,W=Oh(O,r,r[7],null);return{c(){e=lt("details"),t=lt("summary"),i=lt("div"),n=lt("div"),s=lt("div"),o=$n(r[1]),a=ji(),l=lt("div"),c=$n(r[2]),u=ji(),h=lt("div"),T&&T.c(),d=ji(),p=lt("div"),m=lt("div"),y=lt("div"),g=ji(),f=lt("div"),W&&W.c(),pt(s,"class","setting-item-name"),pt(l,"class","setting-item-description"),pt(n,"class","setting-item-info"),pt(i,"class","setting-item setting-item-heading"),pt(y,"class","handle svelte-1my4lf"),pt(m,"class","warning-container"),pt(p,"class","collapser svelte-1my4lf"),pt(h,"class","right-side svelte-1my4lf"),pt(t,"class","calendarium-nested-summary svelte-1my4lf"),pt(f,"class","creator-settings-container svelte-1my4lf"),pt(e,"class","creator calendarium-nested-settings setting-item svelte-1my4lf"),qh(e,"always-open",r[3])},m(A,v){$i(A,e,v),Ye(e,t),Ye(t,i),Ye(i,n),Ye(n,s),Ye(s,o),Ye(n,a),Ye(n,l),Ye(l,c),Ye(t,u),Ye(t,h),T&&T.m(h,null),Ye(h,d),Ye(h,p),Ye(p,m),Ye(m,y),Ye(e,g),Ye(e,f),W&&W.m(f,null),e.open=r[0],w=!0,_||(D=[Js(x=r[5].call(null,y)),jn(t,"keyup",qE),jn(e,"toggle",r[9]),Js(E=r[4].call(null,e))],_=!0)},p(A,[v]){(!w||v&2)&&wo(o,A[1]),(!w||v&4)&&wo(c,A[2]),A[0]?T?(T.p(A,v),v&1&&Ft(T,1)):(T=cg(A),T.c(),Ft(T,1),T.m(h,d)):T&&(_o(),li(T,1,1,()=>{T=null}),Eo()),W&&W.p&&(!w||v&128)&&Uh(W,O,A,A[7],w?Vh(O,A[7],v,null):Hh(A[7]),null),v&1&&(e.open=A[0]),(!w||v&8)&&qh(e,"always-open",A[3])},i(A){w||(Ft(T),Ft(W,A),w=!0)},o(A){li(T),li(W,A),w=!1},d(A){A&&ai(e),T&&T.d(),W&&W.d(A),_=!1,It(D)}}}var qE=r=>r.preventDefault();function WE(r,e,t){let{$$slots:i={},$$scope:n}=e,{collapseIcon:s="chevron-right"}=e,{open:o=!0}=e,{name:a}=e,{desc:l=""}=e,{alwaysOpen:c=!1}=e,u=p=>{o&&p.setAttribute("open","open")},h=p=>{(0,ug.setIcon)(p,s)};function d(){o=this.open,t(0,o)}return r.$$set=p=>{"collapseIcon"in p&&t(6,s=p.collapseIcon),"open"in p&&t(0,o=p.open),"name"in p&&t(1,a=p.name),"desc"in p&&t(2,l=p.desc),"alwaysOpen"in p&&t(3,c=p.alwaysOpen),"$$scope"in p&&t(7,n=p.$$scope)},[o,a,l,c,u,h,s,n,i,d]}var Zh=class extends Zn{constructor(e){super(),ql(this,e,WE,GE,Ol,{collapseIcon:6,open:0,name:1,desc:2,alwaysOpen:3},UE)}},Jh=Zh;var Kh=require("obsidian");function $E(r){Ul(r,"svelte-nmb05s",".saved-formulas.svelte-nmb05s{display:flex;flex-flow:column nowrap;gap:0.5rem}.formula-container.svelte-nmb05s{display:flex;justify-content:space-between;align-items:center}.formula-actions.svelte-nmb05s{display:flex;align-items:center;gap:0.25rem}")}function hg(r,e,t){let i=r.slice();return i[7]=e[t],i}function dg(r){let e,t;return e=new Jh({props:{name:"Saved Formulas",open:!1,$$slots:{default:[jE]},$$scope:{ctx:r}}}),{c(){og(e.$$.fragment)},m(i,n){Xh(e,i,n),t=!0},p(i,n){let s={};n&1031&&(s.$$scope={dirty:n,ctx:i}),e.$set(s)},i(i){t||(Ft(e.$$.fragment,i),t=!0)},o(i){li(e.$$.fragment,i),t=!1},d(i){Yh(e,i)}}}function pg(r,e){let t,i,n,s,o,a,l=e[7]+"",c,u,h,d,p,m,y;function x(){return e[5](e[7])}function g(){return e[6](e[7])}return{key:r,first:null,c(){t=lt("div"),i=lt("div"),n=lt("div"),o=ji(),a=lt("span"),c=$n(l),u=ji(),h=lt("div"),p=ji(),pt(a,"class","formula"),pt(i,"class","formula-actions svelte-nmb05s"),pt(t,"class","formula-container svelte-nmb05s"),this.first=t},m(f,E){$i(f,t,E),Ye(t,i),Ye(i,n),Ye(i,o),Ye(i,a),Ye(a,c),Ye(t,u),Ye(t,h),Ye(t,p),m||(y=[Js(s=e[3].call(null,n)),jn(n,"click",x),Js(d=e[4].call(null,h)),jn(h,"click",g)],m=!0)},p(f,E){e=f,E&1&&l!==(l=e[7]+"")&&wo(c,l)},d(f){f&&ai(t),m=!1,It(y)}}}function jE(r){let e,t=[],i=new Map,n=Ao(r[0].customFormulas),s=o=>o[7];for(let o=0;o{i=null}),Eo())},i(n){t||(Ft(i),t=!0)},o(n){li(i),t=!1},d(n){n&&ai(e),i&&i.d(n)}}}function YE(r,e,t){let{settings:i}=e,{plugin:n}=e,{view:s}=e,o=u=>{new Kh.ExtraButtonComponent(u).setIcon("dices")},a=u=>{new Kh.ExtraButtonComponent(u).setIcon("trash")},l=u=>{s.roll(u)},c=async u=>{t(0,i.customFormulas=i.customFormulas.filter(h=>h!=u),i),n.saveSettings()};return r.$$set=u=>{"settings"in u&&t(0,i=u.settings),"plugin"in u&&t(1,n=u.plugin),"view"in u&&t(2,s=u.view)},[i,n,s,o,a,l,c]}var Qh=class extends Zn{constructor(e){super(),ql(this,e,YE,XE,Ol,{settings:0,plugin:1,view:2},$E)}},fg=Qh;var Ei="DICE_ROLLER_VIEW",tr=class extends vt.ItemView{constructor(t,i){super(i);this.plugin=t;this.leaf=i;this.custom="";this.#e=!1;this.#t=!1;this.#i=0;this.#n=Fl;this.#s=new Map;this.Formatter=new Intl.DateTimeFormat(localStorage.getItem("language")??"en-US",{dateStyle:"medium",timeStyle:"short"});this.contentEl.addClass("dice-roller-view"),this.addChild(this.#n);for(let n of this.plugin.data.icons)this.#n.registerIcon(n.id,n.shape,n.text);this.registerEvent(this.plugin.app.workspace.on("dice-roller:new-result",async n=>{console.log("\u{1F680} ~ file: view.ts:63 ~ roller:",n.getSource()),(this.plugin.data.addToView||n.getSource()==Ei)&&await this.addResult({result:n.result,original:n.original,resultText:n.resultText,timestamp:new Date().valueOf(),id:Gm(12)})}))}get customFormulas(){return this.plugin.data.customFormulas}#e;#t;#i;#n;async onOpen(){this.display()}async display(){this.contentEl.empty(),this.gridEl=this.contentEl.createDiv("dice-roller-grid"),this.formulaEl=this.contentEl.createDiv("dice-roller-formula");let t=this.contentEl.createDiv("results-header-container");t.createEl("h4",{cls:"results-header",text:"Results"}),new vt.ExtraButtonComponent(t.createDiv("clear-all")).setIcon("trash").setTooltip("Clear All").onClick(async()=>{this.resultEl.empty(),this.resultEl.append(this.noResultsEl),this.plugin.data.viewResults=[],await this.plugin.saveSettings()});let i=this.contentEl.createDiv("dice-roller-results-container");this.resultEl=i.createDiv("dice-roller-results"),this.noResultsEl=this.resultEl.createSpan({text:"No results yet! Roll some dice to get started :)"});for(let n of this.plugin.data.viewResults)this.addResult(n,!1);this.buildButtons(),this.buildFormula()}#s;buildButtons(){this.gridEl.empty();let t=this.gridEl.createDiv("dice-buttons");for(let o of this.plugin.data.icons)this.#n.registerIcon(o.id,o.shape,o.text),new vt.ExtraButtonComponent(t.createDiv("dice-button")).setIcon(o.id).extraSettingsEl.onClickEvent(a=>{if(a.type==="auxclick"){this.roll(o.formula);return}this.#s.has(o)||this.#s.set(o,0);let l=this.#s.get(o)??0;l+=a.getModifierState("Shift")?-1:1,this.#s.set(o,l),this.setFormula()});let i=this.gridEl.createDiv("advantage-disadvantage");new vt.ExtraButtonComponent(i).setIcon("minus-square").onClick(()=>{this.#i-=1,this.setFormula()});let n=new vt.ButtonComponent(i).setButtonText("ADV").onClick(()=>{this.#e=!this.#e,this.#t=!1,this.#e?(n.setCta(),s.removeCta()):n.removeCta(),this.setFormula()});this.#e&&n.setCta();let s=new vt.ButtonComponent(i).setButtonText("DIS").onClick(()=>{this.#t=!this.#t,this.#e=!1,this.#t?(s.setCta(),n.removeCta()):s.removeCta(),this.setFormula()});this.#t&&s.setCta(),new vt.ExtraButtonComponent(i).setIcon("plus-square").onClick(()=>{this.#i+=1,this.setFormula()}),new fg({target:this.gridEl,props:{settings:this.plugin.data,plugin:this.plugin,view:this}})}setFormula(){if(!this.#s.size&&!this.#i){this.formulaComponent.inputEl.value="";return}let t=[];for(let[n,s]of this.#s){if(!s)continue;let o=s<0?"-":"+",a=/^(?:1)?d(\d|%|F)+$/.test(n.formula)?`${Math.abs(s)}${n.formula.replace(/^1/,"")}`:`${Math.abs(s)} * (${n.formula})`,l=At.getRollerSync(n.formula,Ei);l instanceof Pt&&(l.buildDiceTree(),l.calculate(),t.push({formula:a,max:l.max,sign:o}))}t.sort((n,s)=>s.max-n.max);let i=[];for(let n=0;n0&&i.push(s.sign);let o="";n===0&&(this.#e?o="kh":this.#t&&(o="kl"),s.formula=s.formula.replace(/(d\d+)/,`$1${o}`)),i.push(`${s.formula}`)}this.#i!==0&&(i.length>0&&i.push(this.#i>0?"+":"-"),i.push(`${Math.abs(this.#i)}`)),this.formulaComponent.inputEl.value=i.join(" ")}async roll(t=this.formulaComponent.inputEl.value){if(!t)return;this.rollButton.setDisabled(!0);let i={...At.getRollerOptions(this.plugin.data)};i.expectedValue=="None"&&(i.expectedValue="Roll");try{let n=await At.getRoller(t,Ei,i).catch(s=>{throw s});if(!(n instanceof Pt))throw new Error("The Dice Tray only supports dice rolls.");if(n.iconEl.detach(),n.containerEl.onclick=null,n.buildDiceTree(),!n.dice.length)throw new Error("No dice.");await n.roll(this.plugin.data.renderer).catch(s=>{throw s})}catch(n){new vt.Notice("Invalid Formula: "+n.message)}finally{this.rollButton.setDisabled(!1),this.buildButtons(),this.#s=new Map,this.#i=0,this.setFormula()}}buildFormula(){this.formulaEl.empty(),this.formulaComponent=new vt.TextAreaComponent(this.formulaEl).setPlaceholder("Dice Formula").onChange(i=>this.#s=new Map);let t=this.formulaEl.createDiv("action-buttons");this.saveButton=new vt.ExtraButtonComponent(t).setIcon("save").setTooltip("Save Formula").onClick(()=>this.save()),this.saveButton.extraSettingsEl.addClass("dice-roller-roll"),this.rollButton=new vt.ButtonComponent(t).setIcon("dices").setCta().setTooltip("Roll").onClick(()=>this.roll()),this.rollButton.buttonEl.addClass("dice-roller-roll")}save(){this.formulaComponent.inputEl.value&&(this.plugin.data.customFormulas.push(this.formulaComponent.inputEl.value),this.buildButtons(),this.plugin.saveSettings())}async addResult(t,i=!0){this.noResultsEl&&this.noResultsEl.detach();let n=createDiv("view-result"),s=n.createDiv("result-actions");new vt.ExtraButtonComponent(s).setIcon("dices").setTooltip("Roll Again").onClick(()=>this.roll(t.original)).extraSettingsEl.addClass("dice-result-reroll"),s.createSpan({text:t.original}),new vt.ExtraButtonComponent(s).setIcon("copy").setTooltip("Copy Result").onClick(async()=>{await navigator.clipboard.writeText(`${t.result}`)}).extraSettingsEl.addClass("dice-content-copy"),n.createEl("strong",{attr:{"aria-label":t.resultText},text:`${t.result}`});let l=n.createDiv("result-context");l.createEl("em",{cls:"result-timestamp",text:this.Formatter.format(t.timestamp)}),new vt.ExtraButtonComponent(l).setIcon("trash").onClick(async()=>{n.detach(),this.resultEl.children.length===0&&this.resultEl.prepend(this.noResultsEl),this.plugin.data.viewResults.splice(this.plugin.data.viewResults.findIndex(c=>c.id===t.id),1),await this.plugin.saveSettings()}),this.resultEl.prepend(n),i&&(console.log("\u{1F680} ~ file: view.ts:372 ~ save:",i),this.plugin.data.viewResults.push(t),this.plugin.data.viewResults=this.plugin.data.viewResults.slice(0,100),await this.plugin.saveSettings())}getDisplayText(){return"Dice Tray"}getViewType(){return Ei}getIcon(){return"dices"}async onClose(){await super.onClose()}};var Ai=require("@codemirror/view"),YT=require("@codemirror/state"),mg=require("@codemirror/language"),ir=require("obsidian");function ZE(r,e,t){for(let i of r.ranges)if(i.from<=t&&i.to>=e)return!0;return!1}function JE(r,e){let t=this.app.workspace.getActiveFile();if(!t)return;let i=[],n=r.state.selection,s=new RegExp(".*?_?inline-code_?.*");for(let{from:o,to:a}of r.visibleRanges)(0,mg.syntaxTree)(r.state).iterate({from:o,to:a,enter:({node:l})=>{let c=l.type;if(c.name.includes("formatting")||!s.test(c.name))return;let u=l.from,h=l.to;if(ZE(n,u,h))return;let d=r.state.doc.sliceString(u,h).trim(),p=Ro(e.data.diceModTemplateFolders,t);if(/^dice\-mod:\s*([\s\S]+)\s*?/.test(d)&&!p&&e.data.replaceDiceModInLivePreview){let[,g]=d.match(/dice\-mod:\s*([\s\S]+)\s*?/),f=app.workspace.getActiveFile(),E=At.getRollerSync(g,f.path);E.roll().then(async()=>{let _=`${await E.getReplacer()}`;e.data.escapeDiceMod&&_.replace(/([\*\[\]])/g,"\\$1");let D={from:u-1,to:h+1,insert:_},T=r.state.update({changes:D});r.dispatch(T)});return}if(!/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/.test(d))return;let[,m]=d.match(/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/),y=At.getRollerSync(m,t.path),x=new ed(d,y,r,e,t);e.processor.trackRoller(t,y),i.push(Ai.Decoration.replace({widget:x,inclusive:!1,block:!1}).range(u-1,h+1))}});return Ai.Decoration.set(i,!0)}var ed=class extends Ai.WidgetType{constructor(t,i,n,s,o){super();this.rawQuery=t;this.roller=i;this.view=n;this.plugin=s;this.file=o}eq(t){return t.rawQuery===this.rawQuery?!0:(this.plugin.processor.fileMap.get(this.file)?.remove(t.roller),!1)}toDOM(t){return this.roller.roll(),this.roller.containerEl}ignoreEvent(t){if(t.type==="mousedown"){let i=this.view.posAtCoords({x:t.x,y:t.y});if(t.shiftKey){if(i){let{editor:n}=this.view.state.field(ir.editorEditorField).state.field(ir.editorInfoField);n.setCursor(n.offsetToPos(i))}return!1}}return!0}};function gg(r){return Ai.ViewPlugin.fromClass(class{constructor(e){this.decorations=Ai.Decoration.none}update(e){if(!e.state.field(ir.editorLivePreviewField)){this.decorations=Ai.Decoration.none;return}(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=JE(e.view,r)??Ai.Decoration.none)}},{decorations:e=>e.decorations})}function yg(r,e){let t=Object.keys(e).map(i=>KE(r,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function KE(r,e,t){let i=r[e],n=r.hasOwnProperty(e),s=t(i);return i&&Object.setPrototypeOf(s,i),Object.setPrototypeOf(o,s),r[e]=o,a;function o(...l){return s===i&&r[e]===o&&a(),s.apply(this,l)}function a(){r[e]===o&&(n?r[e]=i:delete r[e]),s!==i&&(s=i,Object.setPrototypeOf(o,i||Function))}}var jt=require("obsidian");var So=class extends jt.Component{constructor(){super(...arguments);this.fileMap=new WeakMap}initialize(t){this.app=t.app,this.data=t.data,t.addCommand({id:"reroll",name:"Re-roll Dice",checkCallback:i=>{let n=this.app.workspace.getActiveViewOfType(jt.MarkdownView);if(n&&(n.getMode()==="preview"||n.editMode?.sourceMode==!1)&&this.fileMap.has(n.file))return i||this.fileMap.get(n.file).forEach(o=>{o.roll()}),!0}})}trackRoller(t,i){this.fileMap.has(t)||this.fileMap.set(t,[]),this.fileMap.get(t).push(i)}async postprocessor(t,i){let n=t.querySelectorAll("code");if(!n.length)return;let s=i.sourcePath,o=this.app.vault.getAbstractFileByPath(i.sourcePath),a=i.getSectionInfo(t),l=i.getSectionInfo(t)?.lineStart;if((!o||!(o instanceof jt.TFile))&&s!="STATBLOCK_RENDERER")return;let c={};for(let u=0;u{let g=x.split(` -`),f=g.slice(a.lineStart,a.lineEnd+1);return this.data.escapeDiceMod?f=f.join(` -`).replace(`\`${d}\``,y.replace(/([\*\[\]])/g,"\\$1")).split(` -`):f=f.join(` -`).replace(`\`${d}\``,y).split(` -`),g.splice(a.lineStart,a.lineEnd-a.lineStart+1,...f),g.join(` -`)});continue}try{let m=await At.getRoller(p,i.sourcePath);if(m.onLoad(async()=>{await m.roll(),h.replaceWith(m.containerEl)}),!o||!(o instanceof jt.TFile))continue;this.trackRoller(o,m);let y=this.app.workspace.getActiveViewOfType(jt.MarkdownView);if(y&&this.fileMap.has(o)&&this.fileMap.get(o).length===1){let x=this,g=yg(y,{onUnloadFile:function(f){return async function(E){return E==o&&(x.fileMap.delete(o),g()),await f.call(this,E)}}});y.register(g),y.register(()=>this.fileMap.delete(o))}}catch(m){console.error(m),new jt.Notice(`There was an error parsing the dice string: ${h.innerText}. +`+this.query);let n=Array.from(i).map(o=>`[[${o}]]${this.typeText}`);this.results=[];let s=[];for(let o of n)s.push(new Promise(async a=>{let l=new sr(this.data,o,{...this.lexeme,value:o,type:"section"},this.source,this.app,this.position,!1);this.results.push(l),l.addContexts(...this.components),a()}));await Promise.all(s),this.loaded=!0,this.trigger("loaded")}async build(){this.resultEl.empty(),this.data.displayResultsInline&&this.resultEl.createSpan({text:this.inlineText});let t=[],i=new Map(this.results.map((n,s)=>[s,n]));for(let n=0;n(s.push(`[[${o.file.basename}]]`),l.length>1&&a!=l.length-1&&s.push(","),s),[]);Zn.MarkdownRenderer.render(this.app,n.join(" "),this.resultEl,this.app.workspace.getActiveFile()?.path,new Zn.Component)}else for(let n of t){let s=this.resultEl.createDiv();s.createEl("h5",{cls:"dice-file-name",text:n.file.basename}),s.appendChild(n.containerEl)}}async roll(){return new Promise((t,i)=>{this.loaded?(this.result=this.results[0],this.render(),this.trigger("new-result"),t(this.result)):this.on("loaded",()=>{this.result=this.results[0],this.render(),this.trigger("new-result"),t(this.result)})})}get tooltip(){return this.original}},nc=class extends ic{constructor(t,i,n,s,o,a=t.position){super(t,i,n,s,o,a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.regex=ug;this.initialize()}get query(){return this.base}},sc=class extends ic{constructor(t,i,n,s,o,a=t.position){super(t,i,n,s,o,a);this.data=t;this.original=i;this.lexeme=n;this.source=s;this.regex=cg;this.initialize()}get query(){return`list from #${this.base}`}};var Rn=require("obsidian");var rc=class extends er{async getReplacer(){return this.result}get tooltip(){return`${this.original} +${this.path}`}async build(){if(this.resultEl.empty(),this.data.displayResultsInline&&this.inline&&this.resultEl.createSpan({text:this.inlineText}),!this.results||!this.results.length){this.resultEl.createDiv({cls:"dice-no-results",text:"No results."});return}this.data.copyContentButton&&this.copy.removeClass("no-show");for(let e of this.results){this.resultEl.onclick=async i=>{if(i&&i.getModifierState("Control")||i.getModifierState("Meta")){i.stopPropagation();return}};let t=this.resultEl.createDiv({cls:this.getEmbedClass()});if(!e){t.createDiv({cls:"dice-no-results",text:"No results."});continue}if(Rn.MarkdownRenderer.render(this.app,e,t.createDiv(),this.source,new Rn.Component),this.data.copyContentButton&&this.results.length>1){let i=t.createDiv({cls:"dice-content-copy dice-roller-button",attr:{"aria-label":"Copy Contents"}});i.addEventListener("click",n=>{n.stopPropagation(),navigator.clipboard.writeText(e).then(async()=>{new Rn.Notice("Result copied to clipboard.")})}),(0,Rn.setIcon)(i,"copy")}}}transformResultsToString(){return this.results.join(` + +`)}getPath(){let{groups:e}=this.lexeme.value.match(ec)??{},{roll:t=1,link:i,types:n}=e??{};if(!i)throw new Error("Could not parse link.");this.rolls=(t&&!isNaN(Number(t))&&Number(t))??1,this.path=i.replace(/(\[|\])/g,""),this.types=n?.split(",")}async getOptions(e,t){if(await this.checkForDirtiness(t)){if(this.content=t,!this.content)throw new Error("Could not read file cache.");this.options=this.content.trim().split(` +`).map(i=>i.trim()).filter(i=>i&&i.length)}}async roll(){return new Promise((e,t)=>{if(!this.loaded)this.once("loaded",()=>{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),e(this.results[0])});else{let i=[...this.options];this.results=[...Array(this.rolls)].map(()=>{let n=i[this.getRandomBetween(0,i.length-1)];return i.splice(i.indexOf(n),1),n}).filter(n=>n),this.render(),this.trigger("new-result"),e(this.results[0])}})}};var ad=class{constructor(){this.sources=new Map}initialize(e,t){this.data=e,this.app=t}#e(e){return e.some(({type:t})=>t==="table")?"table":e.some(({type:t})=>t==="section")?"section":e.some(({type:t})=>t==="dataview")?"dataview":e.some(({type:t})=>t==="tag")?"tag":e.some(({type:t})=>t==="link")?"link":e.some(({type:t})=>t==="line")?"line":"dice"}getParametersForRoller(e,t){e=e.replace(/\\\|/g,"|");let i=t?.position??Ot.LEFT,n=t?.shouldRender??this.data.renderAllDice,s=t?.showFormula??this.data.displayResultsInline,o=t?.showParens??this.data.displayFormulaAfter,a=t?.expectedValue??this.data.initialDisplay,l=t?.text??"",c=t?.round??this.data.round,u=t?.signed??this.data.signed,h=t?.lookup,d=/\|text\((.*)\)/;if(e.includes("|nodice")&&(i=Ot.NONE),e.includes("|render")&&(n=!0),e.includes("|norender")&&(n=!1),e.includes("|form")&&(s=!0),e.includes("|noform")&&(s=!1),e.includes("|avg")&&(a="Average"),e.includes("|none")&&(a="None"),e.includes("|text(")){let[,p]=e.match(d)??[null,""];l=p}return e.includes("|paren")&&(o=!0),e.includes("|noparen")&&(o=!1),e.includes("|round")&&(c="Normal"),e.includes("|noround")&&(c="None"),e.includes("|ceil")&&(c="Up"),e.includes("|floor")&&(c="Down"),e.includes("|signed")&&(u=!0),e.includes("|lookup=")&&([,h]=e.match(/\|lookup=(.+?)(?:\||$)/)??[]),e=(0,fg.decode)(e.replace(/\|(no)?(dice|render|form|paren|avg|none|round|floor|ceil|signed)/g,"").replace(/\|lookup=.+?(\||$)/,"").replace(d,"")),e in this.data.formulas&&(e=this.data.formulas[e]),{content:e,position:i,showParens:o,showFormula:s,expectedValue:a,shouldRender:n,text:l,round:c,signed:u,lookup:h}}registerSource(e,t){this.sources.set(e,t)}getRoller(e,t="",i=this.getRollerOptions(this.data)){let{content:n,position:s,showParens:o,showFormula:a,expectedValue:l,round:c,shouldRender:u,text:h,signed:d,lookup:p}=this.getParametersForRoller(e,i),m=nr.parse(n);if(m.isErr())return console.error(m.unwrapErr()),null;let y=m.unwrap();switch(this.#e(y)){case"dice":{let g=new qt(this.data,n,y,this.app,s,h,l,o,c,d);return g.showFormula=a,g.shouldRender=u,g.showRenderNotice=this.data.showRenderNotice,g.setSource(t),g}case"table":return new tc(this.data,n,y[0],t,this.app,s,p);case"section":return new sr(this.data,n,y[0],t,this.app,s);case"dataview":{if(!oi.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new nc(this.data,n,y[0],t,this.app,s)}case"tag":{if(!oi.canUseDataview)throw new Error("Tags are only supported with the Dataview plugin installed.");return new sc(this.data,n,y[0],t,this.app,s)}case"line":return new rc(this.data,n,y[0],t,this.app,s)}}getRollerString(e,t){if(!t)return e;let i=this.sources.get(t)??this.getRollerOptions(this.data);if("position"in i&&(e+=i.position!==Ot.NONE?"":"|nodice"),"shouldRender"in i&&(e+=i.shouldRender?"|render":"|norender"),"showFormula"in i&&(e+=i.showFormula?"|form":"|noform"),"expectedValue"in i&&(i.expectedValue=="Average"&&(e+="|avg"),i.expectedValue=="None"&&(e+="|none")),"text"in i&&i.text&&(e+="|text("+i.text+")"),"showParens"in i&&(e+=i.showParens?"|paren":"|noparen"),"round"in i)switch(i.round){case"Down":{e+="|floor";break}case"Up":{e+="|ceil";break}case"Normal":{e+="|round";break}case"None":e+="|noround"}return i.signed&&(e+="|signed"),e}async getArrayRoller(e,t=1){let i=new Fl(this.data,e,t);return await i.roll(),i}async parseDice(e,t=""){let i=await this.getRoller(e,t);return{result:await i?.roll(),roller:i}}getRollerOptions(e){return{position:e.position,shouldRender:e.renderAllDice,showFormula:e.displayResultsInline,showParens:e.displayFormulaAfter,expectedValue:e.initialDisplay,round:e.round,text:null,signed:e.signed}}},Tt=new ad;var mg="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var gg=(r=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(r));for(;r--;)e+=mg[t[r]&63];return e};function Fn(){}function rA(r,e){for(let t in e)r[t]=e[t];return r}function ld(r){return r()}function oc(){return Object.create(null)}function zt(r){r.forEach(ld)}function Eo(r){return typeof r=="function"}function ac(r,e){return r!=r?e==e:r!==e||r&&typeof r=="object"||typeof r=="function"}function yg(r){return Object.keys(r).length===0}function cd(r,e,t,i){if(r){let n=xg(r,e,t,i);return r[0](n)}}function xg(r,e,t,i){return r[1]&&i?rA(t.ctx.slice(),r[1](i(e))):t.ctx}function ud(r,e,t,i){if(r[2]&&i){let n=r[2](i(t));if(e.dirty===void 0)return n;if(typeof n=="object"){let s=[],o=Math.max(e.dirty.length,n.length);for(let a=0;a32){let e=[],t=r.ctx.length/32;for(let i=0;i{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(e=>{for(let t of e)r.entries.set(t.target,t),this._listeners.get(t.target)?.(t)}))}};lc.entries="WeakMap"in pd?new WeakMap:void 0;var vg=!1;function wg(){vg=!0}function bg(){vg=!1}function Ye(r,e){r.appendChild(e)}function cc(r,e,t){let i=_g(r);if(!i.getElementById(e)){let n=ct("style");n.id=e,n.textContent=t,lA(i,n)}}function _g(r){if(!r)return document;let e=r.getRootNode?r.getRootNode():r.ownerDocument;return e&&e.host?e:r.ownerDocument}function lA(r,e){return Ye(r.head||r,e),e.sheet}function Qi(r,e,t){r.insertBefore(e,t||null)}function gi(r){r.parentNode&&r.parentNode.removeChild(r)}function ct(r){return document.createElement(r)}function Jn(r){return document.createTextNode(r)}function en(){return Jn(" ")}function Eg(){return Jn("")}function Kn(r,e,t,i){return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}function mt(r,e,t){t==null?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t)}function Ag(r){return Array.from(r.childNodes)}function Ao(r,e){e=""+e,r.data!==e&&(r.data=e)}function fd(r,e,t){r.classList.toggle(e,!!t)}function Sg(r){let e={};return r.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}var or;function tn(r){or=r}var Qn=[];var Dg=[],lr=[],Tg=[],fA=Promise.resolve(),gd=!1;function Cg(){gd||(gd=!0,fA.then(uc))}function So(r){lr.push(r)}var md=new Set,ar=0;function uc(){if(ar!==0)return;let r=or;do{try{for(;arr.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),lr=e}var hc=new Set,es;function Mo(){es={r:0,c:[],p:es}}function Do(){es.r||zt(es.c),es=es.p}function It(r,e){r&&r.i&&(hc.delete(r),r.i(e))}function yi(r,e,t,i){if(r&&r.o){if(hc.has(r))return;hc.add(r),es.c.push(()=>{hc.delete(r),i&&(t&&r.d(1),i())}),r.o(e)}else i&&i()}function To(r){return r?.length!==void 0?r:Array.from(r)}function Fg(r,e){r.d(1),e.delete(r.key)}function Lg(r,e,t,i,n,s,o,a,l,c,u,h){let d=r.length,p=s.length,m=d,y={};for(;m--;)y[r[m].key]=m;let x=[],g=new Map,f=new Map,E=[];for(m=p;m--;){let T=h(n,s,m),z=t(T),W=o.get(z);W?i&&E.push(()=>W.p(T,e)):(W=c(z,T),W.c()),g.set(z,x[m]=W),z in y&&f.set(z,Math.abs(m-y[z]))}let w=new Set,_=new Set;function M(T){It(T,1),T.m(a,u),o.set(T.key,T),u=T.first,p--}for(;d&&p;){let T=x[p-1],z=r[d-1],W=T.key,A=z.key;T===z?(u=T.first,d--,p--):g.has(A)?!o.has(W)||w.has(W)?M(T):_.has(A)?d--:f.get(W)>f.get(A)?(_.add(W),M(T)):(w.add(A),d--):(l(z,o),d--)}for(;d--;){let T=r[d];g.has(T.key)||l(T,o)}for(;p;)M(x[p-1]);return zt(E),x}var gA=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],yA=new Set([...gA]);function Bg(r){r&&r.c()}function xd(r,e,t){let{fragment:i,after_update:n}=r.$$;i&&i.m(e,t),So(()=>{let s=r.$$.on_mount.map(ld).filter(Eo);r.$$.on_destroy?r.$$.on_destroy.push(...s):zt(s),r.$$.on_mount=[]}),n.forEach(So)}function vd(r,e){let t=r.$$;t.fragment!==null&&(Rg(t.after_update),zt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function vA(r,e){r.$$.dirty[0]===-1&&(Qn.push(r),Cg(),r.$$.dirty.fill(0)),r.$$.dirty[e/31|0]|=1<{let m=p.length?p[0]:d;return c.ctx&&n(c.ctx[h],c.ctx[h]=m)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](m),u&&vA(r,h)),d}):[],c.update(),u=!0,zt(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){wg();let h=Ag(e.target);c.fragment&&c.fragment.l(h),h.forEach(gi)}else c.fragment&&c.fragment.c();e.intro&&It(r.$$.fragment),xd(r,e.target,e.anchor),bg(),uc()}tn(l)}var wA;typeof HTMLElement=="function"&&(wA=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(r,e,t){super(),this.$$ctor=r,this.$$s=e,t&&this.attachShadow({mode:"open"})}addEventListener(r,e,t){if(this.$$l[r]=this.$$l[r]||[],this.$$l[r].push(e),this.$$c){let i=this.$$c.$on(r,e);this.$$l_u.set(e,i)}super.addEventListener(r,e,t)}removeEventListener(r,e,t){if(super.removeEventListener(r,e,t),this.$$c){let i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let r=function(n){return()=>{let s;return{c:function(){s=ct("slot"),n!=="default"&&mt(s,"name",n)},m:function(l,c){Qi(l,s,c)},d:function(l){l&&gi(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let e={},t=Sg(this);for(let n of this.$$s)n in t&&(e[n]=[r(n)]);for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=yd(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});let i=()=>{this.$$r=!0;for(let n in this.$$p_d)if(this.$$d[n]=this.$$c.$$.ctx[this.$$c.$$.props[n]],this.$$p_d[n].reflect){let s=yd(n,this.$$d[n],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,s)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(let n in this.$$l)for(let s of this.$$l[n]){let o=this.$$c.$on(n,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(r,e,t){this.$$r||(r=this.$$g_p(r),this.$$d[r]=yd(r,t,this.$$p_d,"toProp"),this.$$c?.$set({[r]:this.$$d[r]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(r){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===r||!this.$$p_d[e].attribute&&e.toLowerCase()===r)||r}});function yd(r,e,t,i){let n=t[r]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!t[r])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var ts=class{$$=void 0;$$set=void 0;$destroy(){vd(this,1),this.$destroy=Fn}$on(e,t){if(!Eo(t))return Fn;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}$set(e){this.$$set&&!yg(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};var Pg="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Pg);var kg=require("obsidian");function bA(r){cc(r,"svelte-1my4lf",'.always-open.svelte-1my4lf.svelte-1my4lf{pointer-events:none}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{pointer-events:initial}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{position:relative}.calendarium-nested-summary.svelte-1my4lf.svelte-1my4lf{outline:none;list-style:none !important;list-style-type:none !important;min-height:1rem;border-top-left-radius:0.1rem;border-top-right-radius:0.1rem;cursor:pointer;background-color:var(--creator-background-color);margin-right:0;display:flex;justify-content:space-between}.right-side.svelte-1my4lf.svelte-1my4lf{display:flex;align-items:center;gap:1rem}summary.svelte-1my4lf.svelte-1my4lf::-webkit-details-marker,summary.svelte-1my4lf.svelte-1my4lf::marker{display:none !important}.always-open.svelte-1my4lf .handle.svelte-1my4lf{display:none}.collapser.svelte-1my4lf.svelte-1my4lf{display:flex;flex-flow:column;justify-content:flex-start;align-items:flex-end;content:""}.handle.svelte-1my4lf.svelte-1my4lf{transform:rotate(0deg);transition:transform 0.25s;display:flex}details[open].svelte-1my4lf .handle.svelte-1my4lf{transform:rotate(90deg)}.creator-settings-container.svelte-1my4lf.svelte-1my4lf{padding:0.75em var(--size-4-3)}.calendarium-nested-settings.svelte-1my4lf.svelte-1my4lf{border-top:0px}')}var _A=r=>({}),Ig=r=>({class:"context"});function Ng(r){let e,t=r[8].context,i=cd(t,r,r[7],Ig);return{c(){i&&i.c()},m(n,s){i&&i.m(n,s),e=!0},p(n,s){i&&i.p&&(!e||s&128)&&hd(i,t,n,n[7],e?ud(t,n[7],s,_A):dd(n[7]),Ig)},i(n){e||(It(i,n),e=!0)},o(n){yi(i,n),e=!1},d(n){i&&i.d(n)}}}function EA(r){let e,t,i,n,s,o,a,l,c,u,h,d,p,m,y,x,g,f,E,w,_,M,T=r[0]&&Ng(r),z=r[8].default,W=cd(z,r,r[7],null);return{c(){e=ct("details"),t=ct("summary"),i=ct("div"),n=ct("div"),s=ct("div"),o=Jn(r[1]),a=en(),l=ct("div"),c=Jn(r[2]),u=en(),h=ct("div"),T&&T.c(),d=en(),p=ct("div"),m=ct("div"),y=ct("div"),g=en(),f=ct("div"),W&&W.c(),mt(s,"class","setting-item-name"),mt(l,"class","setting-item-description"),mt(n,"class","setting-item-info"),mt(i,"class","setting-item setting-item-heading"),mt(y,"class","handle svelte-1my4lf"),mt(m,"class","warning-container"),mt(p,"class","collapser svelte-1my4lf"),mt(h,"class","right-side svelte-1my4lf"),mt(t,"class","calendarium-nested-summary svelte-1my4lf"),mt(f,"class","creator-settings-container svelte-1my4lf"),mt(e,"class","creator calendarium-nested-settings setting-item svelte-1my4lf"),fd(e,"always-open",r[3])},m(A,v){Qi(A,e,v),Ye(e,t),Ye(t,i),Ye(i,n),Ye(n,s),Ye(s,o),Ye(n,a),Ye(n,l),Ye(l,c),Ye(t,u),Ye(t,h),T&&T.m(h,null),Ye(h,d),Ye(h,p),Ye(p,m),Ye(m,y),Ye(e,g),Ye(e,f),W&&W.m(f,null),e.open=r[0],w=!0,_||(M=[rr(x=r[5].call(null,y)),Kn(t,"keyup",AA),Kn(e,"toggle",r[9]),rr(E=r[4].call(null,e))],_=!0)},p(A,[v]){(!w||v&2)&&Ao(o,A[1]),(!w||v&4)&&Ao(c,A[2]),A[0]?T?(T.p(A,v),v&1&&It(T,1)):(T=Ng(A),T.c(),It(T,1),T.m(h,d)):T&&(Mo(),yi(T,1,1,()=>{T=null}),Do()),W&&W.p&&(!w||v&128)&&hd(W,z,A,A[7],w?ud(z,A[7],v,null):dd(A[7]),null),v&1&&(e.open=A[0]),(!w||v&8)&&fd(e,"always-open",A[3])},i(A){w||(It(T),It(W,A),w=!0)},o(A){yi(T),yi(W,A),w=!1},d(A){A&&gi(e),T&&T.d(),W&&W.d(A),_=!1,zt(M)}}}var AA=r=>r.preventDefault();function SA(r,e,t){let{$$slots:i={},$$scope:n}=e,{collapseIcon:s="chevron-right"}=e,{open:o=!0}=e,{name:a}=e,{desc:l=""}=e,{alwaysOpen:c=!1}=e,u=p=>{o&&p.setAttribute("open","open")},h=p=>{(0,kg.setIcon)(p,s)};function d(){o=this.open,t(0,o)}return r.$$set=p=>{"collapseIcon"in p&&t(6,s=p.collapseIcon),"open"in p&&t(0,o=p.open),"name"in p&&t(1,a=p.name),"desc"in p&&t(2,l=p.desc),"alwaysOpen"in p&&t(3,c=p.alwaysOpen),"$$scope"in p&&t(7,n=p.$$scope)},[o,a,l,c,u,h,s,n,i,d]}var wd=class extends ts{constructor(e){super(),dc(this,e,SA,EA,ac,{collapseIcon:6,open:0,name:1,desc:2,alwaysOpen:3},bA)}},bd=wd;var _d=require("obsidian");function MA(r){cc(r,"svelte-nmb05s",".saved-formulas.svelte-nmb05s{display:flex;flex-flow:column nowrap;gap:0.5rem}.formula-container.svelte-nmb05s{display:flex;justify-content:space-between;align-items:center}.formula-actions.svelte-nmb05s{display:flex;align-items:center;gap:0.25rem}")}function Og(r,e,t){let i=r.slice();return i[7]=e[t],i}function zg(r){let e,t;return e=new bd({props:{name:"Saved Formulas",open:!1,$$slots:{default:[DA]},$$scope:{ctx:r}}}),{c(){Bg(e.$$.fragment)},m(i,n){xd(e,i,n),t=!0},p(i,n){let s={};n&1031&&(s.$$scope={dirty:n,ctx:i}),e.$set(s)},i(i){t||(It(e.$$.fragment,i),t=!0)},o(i){yi(e.$$.fragment,i),t=!1},d(i){vd(e,i)}}}function Vg(r,e){let t,i,n,s,o,a,l=e[7]+"",c,u,h,d,p,m,y;function x(){return e[5](e[7])}function g(){return e[6](e[7])}return{key:r,first:null,c(){t=ct("div"),i=ct("div"),n=ct("div"),o=en(),a=ct("span"),c=Jn(l),u=en(),h=ct("div"),p=en(),mt(a,"class","formula"),mt(i,"class","formula-actions svelte-nmb05s"),mt(t,"class","formula-container svelte-nmb05s"),this.first=t},m(f,E){Qi(f,t,E),Ye(t,i),Ye(i,n),Ye(i,o),Ye(i,a),Ye(a,c),Ye(t,u),Ye(t,h),Ye(t,p),m||(y=[rr(s=e[3].call(null,n)),Kn(n,"click",x),rr(d=e[4].call(null,h)),Kn(h,"click",g)],m=!0)},p(f,E){e=f,E&1&&l!==(l=e[7]+"")&&Ao(c,l)},d(f){f&&gi(t),m=!1,zt(y)}}}function DA(r){let e,t=[],i=new Map,n=To(r[0].customFormulas),s=o=>o[7];for(let o=0;o{i=null}),Do())},i(n){t||(It(i),t=!0)},o(n){yi(i),t=!1},d(n){n&&gi(e),i&&i.d(n)}}}function CA(r,e,t){let{settings:i}=e,{plugin:n}=e,{view:s}=e,o=u=>{new _d.ExtraButtonComponent(u).setIcon("dices")},a=u=>{new _d.ExtraButtonComponent(u).setIcon("trash")},l=u=>{s.roll(u)},c=async u=>{t(0,i.customFormulas=i.customFormulas.filter(h=>h!=u),i),n.saveSettings()};return r.$$set=u=>{"settings"in u&&t(0,i=u.settings),"plugin"in u&&t(1,n=u.plugin),"view"in u&&t(2,s=u.view)},[i,n,s,o,a,l,c]}var Ed=class extends ts{constructor(e){super(),dc(this,e,CA,TA,ac,{settings:0,plugin:1,view:2},MA)}},Ug=Ed;var Li="DICE_ROLLER_VIEW",cr=class extends dt.ItemView{constructor(t,i){super(i);this.plugin=t;this.leaf=i;this.custom="";this.#e=!1;this.#t=!1;this.#i=0;this.#n=Il;this.#s=new Map;this.Formatter=new Intl.DateTimeFormat(localStorage.getItem("language")??"en-US",{dateStyle:"medium",timeStyle:"short"});this.contentEl.addClass("dice-roller-view"),this.addChild(this.#n);for(let n of this.plugin.data.icons)this.#n.registerIcon(n.id,n.shape,n.text);this.registerEvent(this.plugin.app.workspace.on("dice-roller:new-result",async n=>{(this.plugin.data.addToView||n.getSource()==Li)&&await this.addResult({result:n.result,original:n.original,resultText:n.resultText,timestamp:new Date().valueOf(),id:gg(12)})}))}get customFormulas(){return this.plugin.data.customFormulas}#e;#t;#i;#n;async onOpen(){this.display()}async display(){this.contentEl.empty(),this.gridEl=this.contentEl.createDiv("dice-roller-grid"),this.formulaEl=this.contentEl.createDiv("dice-roller-formula");let t=this.contentEl.createDiv("results-header-container");t.createEl("h4",{cls:"results-header",text:"Results"}),new dt.ExtraButtonComponent(t.createDiv("clear-all")).setIcon("trash").setTooltip("Clear All").onClick(async()=>{this.resultEl.empty(),this.resultEl.append(this.noResultsEl),this.plugin.data.viewResults=[],await this.plugin.saveSettings()});let i=this.contentEl.createDiv("dice-roller-results-container");this.resultEl=i.createDiv("dice-roller-results"),this.noResultsEl=this.resultEl.createSpan({text:"No results yet! Roll some dice to get started :)"});for(let n of this.plugin.data.viewResults)this.addResult(n,!1);this.buildButtons(),this.buildFormula()}#s;buildButtons(){this.gridEl.empty();let t=this.gridEl.createDiv("dice-buttons");for(let o of this.plugin.data.icons)this.#n.registerIcon(o.id,o.shape,o.text),new dt.ExtraButtonComponent(t.createDiv("dice-button")).setIcon(o.id).extraSettingsEl.onClickEvent(a=>{if(a.type==="auxclick"){this.roll(o.formula);return}this.#s.has(o)||this.#s.set(o,0);let l=this.#s.get(o)??0;l+=a.getModifierState("Shift")?-1:1,this.#s.set(o,l),this.setFormula()});let i=this.gridEl.createDiv("advantage-disadvantage");new dt.ExtraButtonComponent(i).setIcon("minus-square").onClick(()=>{this.#i-=1,this.setFormula()});let n=new dt.ButtonComponent(i).setButtonText("ADV").onClick(()=>{this.#e=!this.#e,this.#t=!1,this.#e?(n.setCta(),s.removeCta()):n.removeCta(),this.setFormula()});this.#e&&n.setCta();let s=new dt.ButtonComponent(i).setButtonText("DIS").onClick(()=>{this.#t=!this.#t,this.#e=!1,this.#t?(s.setCta(),n.removeCta()):s.removeCta(),this.setFormula()});this.#t&&s.setCta(),new dt.ExtraButtonComponent(i).setIcon("plus-square").onClick(()=>{this.#i+=1,this.setFormula()}),new Ug({target:this.gridEl,props:{settings:this.plugin.data,plugin:this.plugin,view:this}})}setFormula(){if(!this.#s.size&&!this.#i){this.formulaComponent.inputEl.value="";return}let t=[];for(let[n,s]of this.#s){if(!s)continue;let o=s<0?"-":"+",a=/^(?:1)?d(\d|%|F)+$/.test(n.formula)?`${Math.abs(s)}${n.formula.replace(/^1/,"")}`:`${Math.abs(s)} * (${n.formula})`,l=Tt.getRoller(n.formula,Li);l!=null&&l instanceof qt&&(l.buildDiceTree(),l.calculate(),t.push({formula:a,max:l.max,sign:o}))}t.sort((n,s)=>s.max-n.max);let i=[];for(let n=0;n0&&i.push(s.sign);let o="";n===0&&(this.#e?o="kh":this.#t&&(o="kl"),s.formula=s.formula.replace(/(d\d+)/,`$1${o}`)),i.push(`${s.formula}`)}this.#i!==0&&(i.length>0&&i.push(this.#i>0?"+":"-"),i.push(`${Math.abs(this.#i)}`)),this.formulaComponent.inputEl.value=i.join(" ")}async roll(t=this.formulaComponent.inputEl.value){if(!t)return;this.rollButton.setDisabled(!0);let i={...Tt.getRollerOptions(this.plugin.data)};i.expectedValue=="None"&&(i.expectedValue="Roll");try{let n=await Tt.getRoller(t,Li,i);if(n==null)return;if(!(n instanceof qt))throw new Error("The Dice Tray only supports dice rolls.");if(n.iconEl.detach(),n.containerEl.onclick=null,n.buildDiceTree(),!n.dice.length)throw new Error("No dice.");await n.roll(this.plugin.data.renderer).catch(s=>{throw s})}catch(n){new dt.Notice("Invalid Formula: "+n.message)}finally{this.rollButton.setDisabled(!1),this.buildButtons(),this.#s=new Map,this.#i=0,this.setFormula()}}buildFormula(){this.formulaEl.empty(),this.formulaComponent=new dt.TextAreaComponent(this.formulaEl).setPlaceholder("Dice Formula").onChange(i=>this.#s=new Map);let t=this.formulaEl.createDiv("action-buttons");this.saveButton=new dt.ExtraButtonComponent(t).setIcon("save").setTooltip("Save Formula").onClick(()=>this.save()),this.saveButton.extraSettingsEl.addClass("dice-roller-roll"),this.rollButton=new dt.ButtonComponent(t).setIcon("dices").setCta().setTooltip("Roll").onClick(()=>this.roll()),this.rollButton.buttonEl.addClass("dice-roller-roll")}save(){this.formulaComponent.inputEl.value&&(this.plugin.data.customFormulas.push(this.formulaComponent.inputEl.value),this.buildButtons(),this.plugin.saveSettings())}async addResult(t,i=!0){this.noResultsEl&&this.noResultsEl.detach();let n=createDiv("view-result"),s=n.createDiv("result-actions");new dt.ExtraButtonComponent(s).setIcon("dices").setTooltip("Roll Again").onClick(()=>this.roll(t.original)).extraSettingsEl.addClass("dice-result-reroll"),s.createSpan({text:t.original}),new dt.ExtraButtonComponent(s).setIcon("copy").setTooltip("Copy Result").onClick(async()=>{await navigator.clipboard.writeText(`${t.result}`)}).extraSettingsEl.addClass("dice-content-copy"),dt.Platform.isMobile&&n.createSpan({cls:"dice-content-result",text:`${t.resultText}`}),n.createEl("strong",{attr:{"aria-label":t.resultText},text:`${t.result}`});let l=n.createDiv("result-context");l.createEl("em",{cls:"result-timestamp",text:this.Formatter.format(t.timestamp)}),new dt.ExtraButtonComponent(l).setIcon("trash").onClick(async()=>{n.detach(),this.resultEl.children.length===0&&this.resultEl.prepend(this.noResultsEl),this.plugin.data.viewResults.splice(this.plugin.data.viewResults.findIndex(c=>c.id===t.id),1),await this.plugin.saveSettings()}),this.resultEl.prepend(n),i&&(this.plugin.data.viewResults.push(t),this.plugin.data.viewResults=this.plugin.data.viewResults.slice(0,100),await this.plugin.saveSettings())}getDisplayText(){return"Dice Tray"}getViewType(){return Li}getIcon(){return"dices"}async onClose(){await super.onClose()}};var Bi=require("@codemirror/view"),cR=require("@codemirror/state"),Hg=require("@codemirror/language"),Ln=require("obsidian");function RA(r,e,t){for(let i of r.ranges)if(i.from<=t&&i.to>=e)return!0;return!1}function FA(r,e,t){let i=e.app.workspace.getActiveFile();if(!i)return;let n=[],s=r.state.selection,o=new RegExp(".*?_?inline-code_?.*");for(let{from:a,to:l}of r.visibleRanges)(0,Hg.syntaxTree)(r.state).iterate({from:a,to:l,enter:({node:c})=>{let u=c.type;if(u.name.includes("formatting")||!o.test(u.name))return;let h=c.from,d=c.to;if(RA(s,h,d))return;let p=r.state.doc.sliceString(h,d).trim(),m=Po(e.data.diceModTemplateFolders,i);if(/^dice\-mod:\s*([\s\S]+)\s*?/.test(p)&&!m&&e.data.replaceDiceModInLivePreview){let[,f]=p.match(/dice\-mod:\s*([\s\S]+)\s*?/),E=e.app.workspace.getActiveFile(),w=Tt.getRoller(f,E.path);if(w==null)return;w.roll().then(async()=>{let M=`${await w.getReplacer()}`;e.data.escapeDiceMod&&M.replace(/([\*\[\]])/g,"\\$1");let T={from:h-1,to:d+1,insert:M},z=r.state.update({changes:T});r.dispatch(z)});return}if(!/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/.test(p))return;let[,y]=p.match(/^dice(?:\+|\-|\-mod)?:\s*([\s\S]+)\s*?/),x=Tt.getRoller(y,i.path);if(x==null)return;x.addContexts(t,e);let g=new Ad(p,x,r,e,i);e.processor.trackRoller(i,x),n.push(Bi.Decoration.replace({widget:g,inclusive:!1,block:!1}).range(h-1,d+1))}});return Bi.Decoration.set(n,!0)}var Ad=class extends Bi.WidgetType{constructor(t,i,n,s,o){super();this.rawQuery=t;this.roller=i;this.view=n;this.plugin=s;this.file=o}eq(t){return t.rawQuery===this.rawQuery?!0:(this.plugin.processor.fileMap.get(this.file)?.remove(t.roller),!1)}toDOM(t){return this.roller.roll(),this.roller.containerEl}ignoreEvent(t){if(t.type==="mousedown"){let i=this.view.posAtCoords({x:t.x,y:t.y});if(t.shiftKey){if(i){let{editor:n}=this.view.state.field(Ln.editorEditorField).state.field(Ln.editorInfoField);n.setCursor(n.offsetToPos(i))}return!1}}return!0}};function Gg(r){return Bi.ViewPlugin.fromClass(class{constructor(e){this.component=new Ln.Component;this.component.load(),this.decorations=Bi.Decoration.none}destroy(){this.component.unload()}update(e){if(!e.state.field(Ln.editorLivePreviewField)){this.decorations=Bi.Decoration.none;return}(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=FA(e.view,r,this.component)??Bi.Decoration.none)}},{decorations:e=>e.decorations})}function qg(r,e){let t=Object.keys(e).map(i=>LA(r,i,e[i]));return t.length===1?t[0]:function(){t.forEach(i=>i())}}function LA(r,e,t){let i=r[e],n=r.hasOwnProperty(e),s=t(i);return i&&Object.setPrototypeOf(s,i),Object.setPrototypeOf(o,s),r[e]=o,a;function o(...l){return s===i&&r[e]===o&&a(),s.apply(this,l)}function a(){r[e]===o&&(n?r[e]=i:delete r[e]),s!==i&&(s=i,Object.setPrototypeOf(o,i||Function))}}var ei=require("obsidian");var Co=class extends ei.Component{constructor(){super(...arguments);this.fileMap=new WeakMap}initialize(t){this.app=t.app,this.data=t.data,this.plugin=t,t.addCommand({id:"reroll",name:"Re-roll Dice",checkCallback:i=>{let n=this.app.workspace.getActiveViewOfType(ei.MarkdownView);if(n&&(n.getMode()==="preview"||n.editMode?.sourceMode==!1)&&this.fileMap.has(n.file))return i||this.fileMap.get(n.file).forEach(o=>{o.roll()}),!0}})}trackRoller(t,i){this.fileMap.has(t)||this.fileMap.set(t,[]),this.fileMap.get(t).push(i)}async postprocessor(t,i){let n=t.querySelectorAll("code");if(!n.length)return;let s=i.sourcePath,o=this.app.vault.getAbstractFileByPath(i.sourcePath),a=i.getSectionInfo(t);if(!((!o||!(o instanceof ei.TFile))&&s!="STATBLOCK_RENDERER"))for(let l=0;l{let y=m.split(` +`),x=y.slice(a.lineStart,a.lineEnd+1);return this.data.escapeDiceMod?x=x.join(` +`).replace(`\`${u}\``,p.replace(/([\*\[\]])/g,"\\$1")).split(` +`):x=x.join(` +`).replace(`\`${u}\``,p).split(` +`),y.splice(a.lineStart,a.lineEnd-a.lineStart+1,...x),y.join(` +`)});continue}try{let d=Tt.getRoller(h,i.sourcePath);if(d==null)return;if(d.onLoad(async()=>{await d.roll(),c.replaceWith(d.containerEl)}),d.addContexts(i,this.plugin),!o||!(o instanceof ei.TFile))continue;this.trackRoller(o,d);let p=this.app.workspace.getActiveViewOfType(ei.MarkdownView);if(p&&this.fileMap.has(o)&&this.fileMap.get(o).length===1){let m=this,y=qg(p,{onUnloadFile:function(x){return async function(g){return g==o&&(m.fileMap.delete(o),y()),await x.call(this,g)}}});p.register(y),p.register(()=>this.fileMap.delete(o))}}catch(d){console.error(d),new ei.Notice(`There was an error parsing the dice string: ${c.innerText}. -${m}`,5e3);continue}}}processContent(t){let i=this.data.displayFormulaForMod;return t.includes("|noform")&&(i=!1),t.includes("|form")&&(i=!0),i}};var QE=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,td=r=>{if(typeof r!="string")throw new TypeError("Invalid argument expected string");let e=r.match(QE);if(!e)throw new Error(`Invalid argument not valid semver ('${r}' received)`);return e.shift(),e},xg=r=>r==="*"||r==="x"||r==="X",vg=r=>{let e=parseInt(r,10);return isNaN(e)?r:e},eA=(r,e)=>typeof r!=typeof e?[String(r),String(e)]:[r,e],tA=(r,e)=>{if(xg(r)||xg(e))return 0;let[t,i]=eA(vg(r),vg(e));return t>i?1:t{for(let t=0;t{let t=td(r),i=td(e),n=t.pop(),s=i.pop(),o=id(t,i);return o!==0?o:n&&s?id(n.split("."),s.split(".")):n||s?n?-1:1:0};var Mo=(r,e,t)=>{iA(t);let i=wg(r,e);return _g[t].includes(i)},_g={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},bg=Object.keys(_g),iA=r=>{if(typeof r!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof r}`);if(bg.indexOf(r)===-1)throw new Error(`Invalid operator, expected one of ${bg.join("|")}`)};var Wl=class extends Yi.Plugin{constructor(){super(...arguments);this.api=At}getRendererData(){return{diceColor:this.data.diceColor,textColor:this.data.textColor,colorfulDice:this.data.colorfulDice,scaler:this.data.scaler,renderTime:this.data.renderTime,textFont:this.data.textFont}}async onload(){console.log("DiceRoller plugin loaded"),await this.loadSettings(),this.renderer=new ho(this.getRendererData()),this.api.initialize(this.data,this.app,this.renderer),window.DiceRoller=this.api,this.register(()=>delete window.DiceRoller),this.addChild(Vt.initialize(this.app)),qn.setDefaults(this.data.defaultRoll,this.data.defaultFace),this.addSettingTab(new xo(this.app,this)),this.registerView(Ei,t=>new tr(this,t)),this.registerEvent(this.app.workspace.on("dice-roller:render-dice",async t=>{let i=await At.getRoller(t,"external");if(!(i instanceof Pt)){new Yi.Notice("The Dice View only supports dice rolls.");return}if(await i.roll(),!i.dice.length){new Yi.Notice("Invalid formula.");return}try{await i.roll(!0)}catch(n){new Yi.Notice("There was an error rendering the roll."),console.error(n)}this.app.workspace.trigger("dice-roller:rendered-result",i.result)})),this.addCommand({id:"open-view",name:"Open Dice View",callback:()=>{this.view?this.app.workspace.revealLeaf(this.view.leaf):this.addDiceView()}}),this.processor=new So,this.processor.initialize(this),this.registerMarkdownPostProcessor((t,i)=>this.processor.postprocessor(t,i)),this.registerEditorExtension([gg(this)]),this.app.workspace.onLayoutReady(async()=>{this.addDiceView(!0)}),this.app.workspace.trigger("dice-roller:loaded")}get view(){let t=this.app.workspace.getLeavesOfType(Ei),i=t.length?t[0]:null;if(i&&i.view&&i.view instanceof tr)return i.view}async addDiceView(t=!1){t&&!this.data.showLeafOnStartup||this.app.workspace.getLeavesOfType(Ei).length||await this.app.workspace.getRightLeaf(!1).setViewState({type:Ei})}async loadSettings(){let t=Object.assign({},Il,await this.loadData()),i=!1;console.log(Mo("11.0.0","0.0.0",">")),typeof t.version!="string"&&delete t.version,Mo("11.0.0",t.version??"0.0.0",">")&&(delete t.persistResults,delete t.results,i=!0),Mo(t.version??"0.0.0",this.manifest.version,"!=")&&(t.version=this.manifest.version,i=!0),this.data=Pl(t),i&&await this.saveSettings()}async saveSettings(){await this.saveData(this.data)}async getArrayRoller(t,i=1){return new Yi.Notice("Using the Dice Roller plugin directly will be deprecated in a future version. Please use `window.DiceRoller` instead."),this.api.getArrayRoller(t,i)}async getRoller(t,i="",n){return new Yi.Notice("Using the Dice Roller plugin directly will be deprecated in a future version. Please use `window.DiceRoller` instead."),this.api.getRoller(t,i,n)}getRollerSync(t,i,n){return new Yi.Notice("Using the Dice Roller plugin directly will be deprecated in a future version. Please use `window.DiceRoller` instead."),this.api.getRollerSync(t,i,n)}onunload(){console.log("DiceRoller unloaded"),this.app.workspace.getLeavesOfType(Ei).forEach(t=>t.detach()),"__THREE__"in window&&delete window.__THREE__,this.renderer.unload(),this.app.workspace.trigger("dice-roller:unloaded")}}; +${d}`,5e3);continue}}}processContent(t){let i=this.data.displayFormulaForMod;return t.includes("|noform")&&(i=!1),t.includes("|form")&&(i=!0),i}};var BA=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Sd=r=>{if(typeof r!="string")throw new TypeError("Invalid argument expected string");let e=r.match(BA);if(!e)throw new Error(`Invalid argument not valid semver ('${r}' received)`);return e.shift(),e},Wg=r=>r==="*"||r==="x"||r==="X",$g=r=>{let e=parseInt(r,10);return isNaN(e)?r:e},PA=(r,e)=>typeof r!=typeof e?[String(r),String(e)]:[r,e],IA=(r,e)=>{if(Wg(r)||Wg(e))return 0;let[t,i]=PA($g(r),$g(e));return t>i?1:t{for(let t=0;t{let t=Sd(r),i=Sd(e),n=t.pop(),s=i.pop(),o=Md(t,i);return o!==0?o:n&&s?Md(n.split("."),s.split(".")):n||s?n?-1:1:0};var Ro=(r,e,t)=>{NA(t);let i=jg(r,e);return Yg[t].includes(i)},Yg={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Xg=Object.keys(Yg),NA=r=>{if(typeof r!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof r}`);if(Xg.indexOf(r)===-1)throw new Error(`Invalid operator, expected one of ${Xg.join("|")}`)};var pc=class extends is.Plugin{constructor(){super(...arguments);this.api=Tt}getRendererData(){return{diceColor:this.data.diceColor,textColor:this.data.textColor,colorfulDice:this.data.colorfulDice,scaler:this.data.scaler,renderTime:this.data.renderTime,textFont:this.data.textFont}}async onload(){console.log("DiceRoller plugin loaded"),await this.loadSettings(),Mt.setData(this.getRendererData()),this.addChild(Mt),this.api.initialize(this.data,this.app),window.DiceRoller=this.api,this.register(()=>delete window.DiceRoller),this.addChild(oi.initialize(this.app)),nr.setDefaults(this.data.defaultRoll,this.data.defaultFace),this.addSettingTab(new bo(this.app,this)),this.registerView(Li,t=>new cr(this,t)),this.registerEvent(this.app.workspace.on("dice-roller:render-dice",async t=>{let i=await Tt.getRoller(t,"external");if(i!=null){if(!(i instanceof qt)){new is.Notice("The Dice View only supports dice rolls.");return}if(await i.roll(),!i.dice.length){new is.Notice("Invalid formula.");return}try{await i.roll(!0)}catch(n){new is.Notice("There was an error rendering the roll."),console.error(n)}this.app.workspace.trigger("dice-roller:rendered-result",i.result)}})),this.addCommand({id:"open-view",name:"Open Dice View",callback:()=>{this.view?this.app.workspace.revealLeaf(this.view.leaf):this.addDiceView()}}),this.processor=new Co,this.processor.initialize(this),this.registerMarkdownPostProcessor((t,i)=>this.processor.postprocessor(t,i)),this.registerEditorExtension([Gg(this)]),this.app.workspace.onLayoutReady(async()=>{this.addDiceView(!0)}),this.app.workspace.trigger("dice-roller:loaded")}get view(){let t=this.app.workspace.getLeavesOfType(Li),i=t.length?t[0]:null;if(i&&i.view&&i.view instanceof cr)return i.view}async addDiceView(t=!1){t&&!this.data.showLeafOnStartup||this.app.workspace.getLeavesOfType(Li).length||await this.app.workspace.getRightLeaf(!1).setViewState({type:Li})}async loadSettings(){let t=Object.assign({},zl,await this.loadData()),i=!1;typeof t.version!="string"&&delete t.version,Ro("11.2.0",t.version??"0.0.0",">")&&!("position"in t)&&(t.position=t.showDice?Ot.RIGHT:Ot.NONE,delete t.showDice,i=!0),Ro("11.0.0",t.version??"0.0.0",">")&&(delete t.persistResults,delete t.results,i=!0),Ro(t.version??"0.0.0",this.manifest.version,"!=")&&(t.version=this.manifest.version,i=!0),this.data=Ol(t),i&&await this.saveSettings()}async saveSettings(){await this.saveData(this.data)}async getArrayRoller(t,i=1){return new is.Notice("Using the Dice Roller plugin directly will be deprecated in a future version. Please use `window.DiceRoller` instead."),this.api.getArrayRoller(t,i)}onunload(){console.log("DiceRoller unloaded"),this.app.workspace.getLeavesOfType(Li).forEach(t=>t.detach()),"__THREE__"in window&&delete window.__THREE__,this.app.workspace.trigger("dice-roller:unloaded")}}; /*! Bundled license information: he/he.js: diff --git a/.obsidian/plugins/obsidian-dice-roller/manifest.json b/.obsidian/plugins/obsidian-dice-roller/manifest.json index a1426b98..50e290d3 100644 --- a/.obsidian/plugins/obsidian-dice-roller/manifest.json +++ b/.obsidian/plugins/obsidian-dice-roller/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-dice-roller", "name": "Dice Roller", - "version": "11.0.4", + "version": "11.3.1", "minAppVersion": "0.12.15", "description": "Inline dice rolling for Obsidian.md", "author": "Jeremy Valentine", diff --git a/.obsidian/plugins/obsidian-dice-roller/styles.css b/.obsidian/plugins/obsidian-dice-roller/styles.css index b1d73eba..4fefd9e4 100644 --- a/.obsidian/plugins/obsidian-dice-roller/styles.css +++ b/.obsidian/plugins/obsidian-dice-roller/styles.css @@ -1 +1 @@ -.dice-roller{position:relative;display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;margin:0 .25em 0 0;vertical-align:top}.dice-roller.no-icon{margin:0}.dice-roller>div{display:inline-block}.dice-roller span{font-weight:700}.dice-roller>.dice-roller-button{display:inline-flex;position:relative;font-size:inherit}.dice-roller>.dice-roller-formula{display:inline-flex;position:relative;font-size:inherit}.dice-roller.has-embed .dice-roller-result{width:100%;padding:1rem}.dice-roller.has-embed .dice-roller-result .markdown-embed{display:flex;margin-top:.5rem;padding-right:0}.dice-roller.has-embed .dice-roller-button{padding-top:.5rem}.dice.tooltip{max-width:unset!important}.workspace .markdown-preview-view .dice-roller.has-embed{display:flex;padding-right:.25rem;margin:.25rem 0}.dice-no-results{font-style:italic;text-align:center}.dice-roller.has-embed .internal-embed{width:100%}.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-button,.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-result{display:inline;padding:0}.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-result .embedded-table-result{margin-bottom:0}.dice-roller.has-embed .internal-embed *:last-child:not(svg):not(.dice-content-copy):not(.markdown-embed .dice-roller):not(.dice-roller-result>.embedded-table-result *){margin-bottom:15px}.dice-roller.has-embed .dice-file-name{font-style:italic}.dice-section-result{position:relative}.dice-content-copy{color:var(--text-faint);cursor:pointer;height:fit-content}.dice-content-copy.no-show{display:none}.dice-content-copy:hover{color:var(--text-normal)}.dice-roller.has-embed .dice-section-result .dice-content-copy,.dice-content-copy:hover{opacity:1}.dice-roller-result{position:relative;display:inline-flex;align-items:center}.dice-roller-result .embedded-table-result p{margin:0}.dice-roller-settings .coffee{width:60%;color:var(--text-faint);margin:.5rem auto;text-align:center}.dice-roller-settings .coffee img{height:30px}.dice-roller-setting-additional-container>.setting-item:not(.setting-item-heading){border:0px}.dice-roller-setting-additional-container .additional{padding:0 18px}.dice-roller-setting-additional-container{border-bottom:1px solid var(--background-modifier-border);border-top:1px solid var(--background-modifier-border);padding:18px 0}.dice-roller-setting-additional-container>.setting-item-heading:only-child{padding-bottom:18px}.dice-roller-setting-additional-container>.additional .no-formulas{width:auto;display:block;text-align:center}.dice-roller-setting-additional-container>.additional>.setting-item{border-top:0;padding-top:9px}.dice-roller-setting-additional-container>.additional>.setting-item>.setting-item-control>*:first-child{margin:0 6px}.dice-roller-setting-additional-container>.additional>.setting-item>.setting-item-control>.dice-mod-template-use-subfolders{margin:0 px;font-style:italic;font-size:small}.dice-roller-setting-additional-container .add-new-formula{margin:0 1rem;padding:1rem 1rem 0;border-radius:.5rem;box-shadow:0 0 .25rem var(--background-modifier-box-shadow)}.dice-roller-setting-additional-container .add-new-formula .formula-data .setting-item{border:0}.should-spin{border-bottom-color:transparent;border-radius:50%;display:inline-flex;align-items:center;box-sizing:border-box;animation:rotation 1s ease infinite}@keyframes rotation{0%{transform:scale(1) rotate(-60deg)}20%{transform:rotate(-90deg)}50%{transform:rotate(690deg)}to{transform:rotate(660deg)}}.renderer-container{position:absolute;top:0;left:0;width:100vw;height:100vh;pointer-events:none;z-index:9999999;transition:opacity 1s ease-out}.dice-roller-view .dice-roller-roll:disabled{cursor:not-allowed;opacity:.75}.workspace-split.mod-right-split .view-content.dice-roller-view{padding:.5rem;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:12px}.dice-roller-view .dice-roller-grid{display:grid;grid-template-rows:auto auto;justify-content:center;gap:6px}.dice-roller-view .dice-roller-grid .dice-buttons{display:flex;flex-flow:row wrap;align-items:center;justify-content:center;width:fit-content}.dice-roller-view .dice-roller-grid .dice-custom-formula-container{display:flex;justify-content:space-between;align-items:center}.dice-roller-view .dice-roller-grid .dice-custom-formula{display:flex;justify-content:flex-start;align-items:center}.dice-roller-view .setting-editor-extra-setting-button{width:fit-content}.dice-button svg{width:36px;height:36px}.dice-roller-view .dice-context{display:grid;grid-template-columns:1fr auto}.dice-roller-view .dice-context .add-subtract{display:flex;align-items:center}.dice-roller-view input,.dice-roller-view textarea{width:100%}.dice-roller-view .dice-roller-grid .advantage-disadvantage{display:flex;justify-content:center;align-items:center;gap:.5rem}.dice-roller-view .dice-roller-grid .advantage-disadvantage button{margin:0;min-width:66px}.dice-roller-view .dice-roller-formula{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:flex-end;gap:12px}.dice-roller-view .dice-roller-formula .action-buttons{display:flex;justify-content:flex-end}.dice-roller-view .dice-roller-formula button{margin-right:0;margin-left:12px}.dice-roller-view hr{margin-bottom:0}.dice-roller-view .dice-roller-results-container .dice-roller-results-header{display:flex;justify-content:space-between;align-items:center;margin:6px 0;width:100%;border-bottom:1px solid var(--background-modifier-border)}.dice-roller-view .dice-roller-results-container .dice-roller-results-header h4{margin:0}.dice-roller-view .dice-roller-results{display:flex;flex-flow:column nowrap;gap:6px}.dice-roller-view .dice-roller-results .view-result{display:flex;flex-flow:column nowrap;justify-content:center;align-items:center;border:1px solid var(--background-modifier-border);border-radius:.25rem;position:relative}.dice-roller-view .dice-roller-results .view-result .dice-content-copy{position:absolute;top:0;right:0;padding:.25rem}.dice-roller-view .dice-roller-results .view-result .dice-result-reroll{position:absolute;top:0;left:0;padding:.25rem;margin:0}.dice-roller-view .dice-roller-results .view-result strong{font-size:x-large}.dice-roller-view .dice-roller-results .view-result .result-context{align-self:flex-end;width:100%;display:flex;align-items:center;justify-content:space-between;padding:.25rem;font-size:x-small}.dice-roller-view .dice-roller-results .view-result .result-context .clickable-icon{margin-right:0}.dice-roller-view .dice-roller-results>span{color:var(--text-muted);margin:0 auto}.dice-renderer{position:absolute;top:0;left:0}.dice-button svg .font{font-family:ArialMT;font-size:200px;fill:currentColor}.dice-button svg .shape{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:15px!important}.dice-roller-settings .dice-icons>span{display:block;text-align:center;color:var(--text-muted)}.dice-roller-settings .dice-icons.has-table{padding-left:0;padding-right:0}.dice-roller-settings .buttons-table{width:100%;display:grid;grid-template-columns:auto 1fr auto;grid-auto-rows:1fr;gap:.5rem;align-items:center;justify-content:flex-start;text-align:left}.dice-roller-settings .icons-table-row{display:contents}.dice-roller-settings .icons-table-row .actions{display:flex;align-items:center}.dice-roller-settings .icons-table-row .shape{display:flex;align-items:center;justify-content:center}.dice-roller-settings .add-new .shape{padding:0 .5rem}.dice-roller-settings .add-new .formula{display:flex;gap:.5rem}details.dice-roller-nested-settings>summary{outline:none;display:block!important;list-style:none!important;list-style-type:none!important;min-height:1rem;border-top-left-radius:.1rem;border-top-right-radius:.1rem;cursor:pointer;position:relative}details.dice-roller-nested-settings>summary::-webkit-details-marker,details.dice-roller-nested-settings>summary::marker{display:none!important}details.dice-roller-nested-settings>summary>.collapser{position:absolute;top:50%;right:8px;transform:translateY(-50%);content:""}details.dice-roller-nested-settings>summary>.collapser>.handle{transform:rotate(0);transition:transform .25s}details.dice-roller-nested-settings[open]>summary>.collapser>.handle{transform:rotate(90deg)}.template-edit{display:grid;grid-template-columns:1fr auto}.template-edit .actions{display:flex;align-items:center}.template-input{margin-right:1rem;display:flex;align-items:center;gap:1rem}.template-input .setting-item{border:0}.template-input .folder-input,.template-input input{width:100%} +.dice-roller{position:relative;display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;margin:0 .25em 0 0;vertical-align:top}.dice-roller.no-icon{margin:0}.dice-roller>div{display:inline-block}.dice-roller:not(.has-embed) span{font-weight:700}.dice-roller>.dice-roller-button{display:inline-flex;position:relative;font-size:inherit}.dice-roller>.dice-roller-formula{display:inline-flex;position:relative;font-size:inherit}.dice-roller.has-embed .dice-roller-result{width:100%;padding:1rem}.dice-roller.has-embed .dice-roller-result .markdown-embed{display:flex;margin-top:.5rem;padding-right:0}.dice-roller.has-embed .dice-roller-button{padding-top:.5rem}.dice.tooltip{max-width:unset!important}.workspace .markdown-preview-view .dice-roller.has-embed{display:flex;padding-right:.25rem;margin:.25rem 0}.dice-no-results{font-style:italic;text-align:center}.dice-roller.has-embed .internal-embed{width:100%}.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-button,.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-result{display:inline;padding:0}.dice-roller.has-embed .internal-embed .dice-roller>.dice-roller-result .embedded-table-result{margin-bottom:0}.dice-roller.has-embed .internal-embed *:last-child:not(svg):not(.dice-content-copy):not(.markdown-embed .dice-roller):not(.dice-roller-result>.embedded-table-result *){margin-bottom:15px}.dice-roller.has-embed .dice-file-name{font-style:italic}.dice-section-result{position:relative}.dice-content-copy{color:var(--text-faint);cursor:pointer;height:fit-content}.dice-content-copy.no-show{display:none}.dice-content-copy:hover{color:var(--text-normal)}.dice-roller.has-embed .dice-section-result .dice-content-copy,.dice-content-copy:hover{opacity:1}.dice-roller-result{position:relative;display:inline-flex;align-items:center}.dice-roller-result .embedded-table-result p{margin:0}.dice-roller-settings .coffee{width:60%;color:var(--text-faint);margin:.5rem auto;text-align:center}.dice-roller-settings .coffee img{height:30px}.dice-roller-setting-additional-container>.setting-item:not(.setting-item-heading){border:0px}.dice-roller-setting-additional-container .additional{padding:0 18px}.dice-roller-setting-additional-container{border-bottom:1px solid var(--background-modifier-border);border-top:1px solid var(--background-modifier-border);padding:18px 0}.dice-roller-setting-additional-container>.setting-item-heading:only-child{padding-bottom:18px}.dice-roller-setting-additional-container>.additional .no-formulas{width:auto;display:block;text-align:center}.dice-roller-setting-additional-container>.additional>.setting-item{border-top:0;padding-top:9px}.dice-roller-setting-additional-container>.additional>.setting-item>.setting-item-control>*:first-child{margin:0 6px}.dice-roller-setting-additional-container>.additional>.setting-item>.setting-item-control>.dice-mod-template-use-subfolders{margin:0 px;font-style:italic;font-size:small}.dice-roller-setting-additional-container .add-new-formula{margin:0 1rem;padding:1rem 1rem 0;border-radius:.5rem;box-shadow:0 0 .25rem var(--background-modifier-box-shadow)}.dice-roller-setting-additional-container .add-new-formula .formula-data .setting-item{border:0}.should-spin{border-bottom-color:transparent;border-radius:50%;display:inline-flex;align-items:center;box-sizing:border-box;animation:rotation 1s ease infinite}@keyframes rotation{0%{transform:scale(1) rotate(-60deg)}20%{transform:rotate(-90deg)}50%{transform:rotate(690deg)}to{transform:rotate(660deg)}}.renderer-container{position:absolute;top:0;left:0;width:100vw;height:100vh;pointer-events:none;z-index:9999999;transition:opacity 1s ease-out}.dice-roller-view .dice-roller-roll:disabled{cursor:not-allowed;opacity:.75}.workspace-split.mod-right-split .view-content.dice-roller-view{padding:.5rem;display:flex;flex-flow:column nowrap;justify-content:flex-start;gap:12px}.dice-roller-view .dice-roller-grid{display:grid;grid-template-rows:auto auto;justify-content:center;gap:6px}.dice-roller-view .dice-roller-grid .dice-buttons{display:flex;flex-flow:row wrap;align-items:center;justify-content:center;width:fit-content}.dice-roller-view .dice-roller-grid .dice-custom-formula-container{display:flex;justify-content:space-between;align-items:center}.dice-roller-view .dice-roller-grid .dice-custom-formula{display:flex;justify-content:flex-start;align-items:center}.dice-roller-view .setting-editor-extra-setting-button{width:fit-content}.dice-button svg{width:36px;height:36px}.dice-roller-view .dice-context{display:grid;grid-template-columns:1fr auto}.dice-roller-view .dice-context .add-subtract{display:flex;align-items:center}.dice-roller-view input,.dice-roller-view textarea{width:100%}.dice-roller-view .dice-roller-grid .advantage-disadvantage{display:flex;justify-content:center;align-items:center;gap:.5rem}.dice-roller-view .dice-roller-grid .advantage-disadvantage button{margin:0;min-width:66px}.dice-roller-view .dice-roller-formula{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:flex-end;gap:12px}.dice-roller-view .dice-roller-formula .action-buttons{display:flex;justify-content:flex-end}.dice-roller-view .dice-roller-formula button{margin-right:0;margin-left:12px}.dice-roller-view hr{margin-bottom:0}.dice-roller-view .dice-roller-results-container .dice-roller-results-header{display:flex;justify-content:space-between;align-items:center;margin:6px 0;width:100%;border-bottom:1px solid var(--background-modifier-border)}.dice-roller-view .dice-roller-results-container .dice-roller-results-header h4{margin:0}.dice-roller-view .dice-roller-results{display:flex;flex-flow:column nowrap;gap:6px}.dice-roller-view .dice-roller-results .view-result{display:flex;flex-flow:column nowrap;justify-content:center;align-items:center;border:1px solid var(--background-modifier-border);border-radius:.25rem;position:relative}.dice-roller-view .dice-roller-results .view-result .dice-content-copy{position:absolute;top:0;right:0;padding:.25rem}.dice-roller-view .dice-roller-results .view-result .dice-result-reroll{position:absolute;top:0;left:0;padding:.25rem;margin:0}.dice-roller-view .dice-roller-results .view-result strong{font-size:x-large}.dice-roller-view .dice-roller-results .view-result .result-context{align-self:flex-end;width:100%;display:flex;align-items:center;justify-content:space-between;padding:.25rem;font-size:x-small}.dice-roller-view .dice-roller-results .view-result .result-context .clickable-icon{margin-right:0}.dice-roller-view .dice-roller-results>span{color:var(--text-muted);margin:0 auto}.dice-renderer{position:absolute;top:0;left:0}.dice-button svg .font{font-family:ArialMT;font-size:200px;fill:currentColor}.dice-button svg .shape{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:15px!important}.dice-roller-settings .dice-icons>span{display:block;text-align:center;color:var(--text-muted)}.dice-roller-settings .dice-icons.has-table{padding-left:0;padding-right:0}.dice-roller-settings .buttons-table{width:100%;display:grid;grid-template-columns:auto 1fr auto;grid-auto-rows:1fr;gap:.5rem;align-items:center;justify-content:flex-start;text-align:left}.dice-roller-settings .icons-table-row{display:contents}.dice-roller-settings .icons-table-row .actions{display:flex;align-items:center}.dice-roller-settings .icons-table-row .shape{display:flex;align-items:center;justify-content:center}.dice-roller-settings .add-new .shape{padding:0 .5rem}.dice-roller-settings .add-new .formula{display:flex;gap:.5rem}details.dice-roller-nested-settings>summary{outline:none;display:block!important;list-style:none!important;list-style-type:none!important;min-height:1rem;border-top-left-radius:.1rem;border-top-right-radius:.1rem;cursor:pointer;position:relative}details.dice-roller-nested-settings>summary::-webkit-details-marker,details.dice-roller-nested-settings>summary::marker{display:none!important}details.dice-roller-nested-settings>summary>.collapser{position:absolute;top:50%;right:8px;transform:translateY(-50%);content:""}details.dice-roller-nested-settings>summary>.collapser>.handle{transform:rotate(0);transition:transform .25s}details.dice-roller-nested-settings[open]>summary>.collapser>.handle{transform:rotate(90deg)}.template-edit{display:grid;grid-template-columns:1fr auto}.template-edit .actions{display:flex;align-items:center}.template-input{margin-right:1rem;display:flex;align-items:center;gap:1rem}.template-input .setting-item{border:0}.template-input .folder-input,.template-input input{width:100%} diff --git a/.obsidian/plugins/obsidian-memos/data.json b/.obsidian/plugins/obsidian-memos/data.json index 4781f13e..385b56da 100644 --- a/.obsidian/plugins/obsidian-memos/data.json +++ b/.obsidian/plugins/obsidian-memos/data.json @@ -86,7 +86,7 @@ "MomentsIcon": "https://images.pexels.com/photos/256514/pexels-photo-256514.jpeg", "MomentsQuote": "Share your thino with the world", "DefaultThemeForThino": "classic", - "LastUpdatedVersion": "2.4.51", + "LastUpdatedVersion": "2.4.56", "ShareToThinoWithText": false, "ShareToThinoWithTextAppend": "", "ShareToThinoWithTextPrepend": "", diff --git a/.obsidian/plugins/obsidian-memos/main.js b/.obsidian/plugins/obsidian-memos/main.js index b671691d..f400a6da 100644 --- a/.obsidian/plugins/obsidian-memos/main.js +++ b/.obsidian/plugins/obsidian-memos/main.js @@ -1,7 +1,7 @@ -"use strict";var qL=Object.defineProperty;var GL=(e,t,n)=>t in e?qL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>(GL(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("obsidian"),wS=require("@codemirror/language"),Jg=require("@codemirror/state"),$l=require("@codemirror/view");function JL(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $N={exports:{}},gg={},ZN={exports:{}},gn={},xC;function KL(){if(xC)return gn;xC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.iterator;function y(X){return X===null||typeof X!="object"?null:(X=g&&X[g]||X["@@iterator"],typeof X=="function"?X:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,D={};function I(X,ae,De){this.props=X,this.context=ae,this.refs=D,this.updater=De||w}I.prototype.isReactComponent={},I.prototype.setState=function(X,ae){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,ae,"setState")},I.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function M(){}M.prototype=I.prototype;function N(X,ae,De){this.props=X,this.context=ae,this.refs=D,this.updater=De||w}var _=N.prototype=new M;_.constructor=N,S(_,I.prototype),_.isPureReactComponent=!0;var k=Array.isArray,B=Object.prototype.hasOwnProperty,L={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function V(X,ae,De){var je,Re={},Fe=null,Be=null;if(ae!=null)for(je in ae.ref!==void 0&&(Be=ae.ref),ae.key!==void 0&&(Fe=""+ae.key),ae)B.call(ae,je)&&!R.hasOwnProperty(je)&&(Re[je]=ae[je]);var Xe=arguments.length-2;if(Xe===1)Re.children=De;else if(1{const{children:t,store:n,context:r}=e,[a,o]=P.useState(n.getState());return P.useEffect(()=>{const i=n.subscribe(l=>{o(l)});return()=>{i()}},[]),v.jsx(r.Provider,{value:a,children:t})};function e7(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},a)=>{let o=!1;const i={};for(const l of t){const c=r[l],f=n[l](c,a);i[l]=f,o=o||f!==c}return o?i:r}}function t7(e,t){const n=[];let r=e;return{dispatch:l=>{const c=t(r,l),f=r;r=c;for(const h of n)h(r,f)},getState:()=>r,subscribe:l=>{let c=!0;return n.push(l),()=>{if(!c)return;const f=n.indexOf(l);n.splice(f,1),c=!1}}}}function n7(e,t){switch(t.type){case"SET_MARK_MEMO_ID":return t.payload.markMemoId===e.markMemoId?e:{...e,markMemoId:t.payload.markMemoId};case"SET_EDIT_MEMO_ID":return t.payload.editMemoId===e.editMemoId?e:{...e,editMemoId:t.payload.editMemoId};case"SET_GLOBAL_EDITOR_SHOWN":return t.payload.globalEditorShown===e.globalEditorShown?e:{...e,globalEditorShown:t.payload.globalEditorShown};case"SET_COMMENT_MEMO_ID":return t.payload.commentMemoId===e.commentMemoId?e:{...e,commentMemoId:t.payload.commentMemoId};case"SET_MOBILE_VIEW":return t.payload.isMobileView===e.isMobileView?e:{...e,isMobileView:t.payload.isMobileView};case"SET_CHANGED_BY_MEMOS":return t.payload.changedByMemos===e.changedByMemos?e:{...e,changedByMemos:t.payload.changedByMemos};case"SET_REFRESH":return t.payload.refresh===e.refresh?e:{...e,refresh:t.payload.refresh};case"SET_INSTANCE":return{...e,instanceList:e.instanceList.set(t.payload.id,t.payload.instance)};case"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW":return t.payload.showSiderbarInMobileView===e.showSiderbarInMobileView?e:{...e,showSiderbarInMobileView:t.payload.showSiderbarInMobileView};case"SET_MEMO_LIST_VIEW":return t.payload.memoListView===e.memoListView?e:{...e,memoListView:t.payload.memoListView};case"SET_MEMO_PLUGIN_MANIFEST":return{...e,manifest:t.payload.manifest};case"SET_LOADED":return{...e,loaded:t.payload.loaded};case"SET_EXIT_STEPS":return{...e,exited:t.payload.exited};case"SET_LOCKED":return{...e,locked:t.payload.locked};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const r7={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:null,manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map,locked:!1,exited:!1};function a7(e,t){switch(t.type){case"RELOAD":return qN;case"SET_LOCATION":return t.payload;case"SET_PATHNAME":return t.payload.pathname===e.pathname?e:{...e,pathname:t.payload.pathname};case"SET_HASH":return t.payload.hash===e.hash?e:{...e,hash:t.payload.hash};case"SET_QUERY":return{...e,query:{...t.payload}};case"SET_TAG_QUERY":return t.payload.tag===e.query.tag?e:{...e,query:{...e.query,tag:t.payload.tag}};case"SET_DURATION_QUERY":return t.payload.duration===e.query.duration?e:{...e,query:{...e.query,duration:{...e.query.duration,...t.payload.duration}}};case"SET_PATH_QUERY":return t.payload.path===e.query.path?e:{...e,query:{...e.query,path:t.payload.path}};case"SET_TYPE":return t.payload.type===e.query.type?e:{...e,query:{...e.query,type:t.payload.type}};case"SET_TEXT":return t.payload.text===e.query.text?e:{...e,query:{...e.query,text:t.payload.text}};case"SET_QUERY_FILTER":return t.payload===e.query.filter?e:{...e,query:{...e.query,filter:t.payload}};default:return e}}const qN={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",path:"",metadata:{},text:"",filter:""}};var vn={};Object.defineProperty(vn,"__esModule",{value:!0});var Tr=x;const sT="YYYY-MM-DD",lT="gggg-[W]ww",GN="YYYY-MM",JN="YYYY-[Q]Q",KN="YYYY";function Iv(e){var n,r;const t=window.app.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n[e])==null?void 0:r.enabled)}function Ev(){var e,t,n,r;try{const{internalPlugins:a,plugins:o}=window.app;if(Iv("daily")){const{format:f,folder:h,template:g}=((t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:f||sT,folder:(h==null?void 0:h.trim())||"",template:(g==null?void 0:g.trim())||""}}const{folder:i,format:l,template:c}=((r=(n=a.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:l||sT,folder:(i==null?void 0:i.trim())||"",template:(c==null?void 0:c.trim())||""}}catch{}}function Cv(){var e,t,n,r,a,o,i;try{const l=window.app.plugins,c=(e=l.getPlugin("calendar"))==null?void 0:e.options,f=(n=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(Iv("weekly"))return{format:f.format||lT,folder:((r=f.folder)==null?void 0:r.trim())||"",template:((a=f.template)==null?void 0:a.trim())||""};const h=c||{};return{format:h.weeklyNoteFormat||lT,folder:((o=h.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((i=h.weeklyNoteTemplate)==null?void 0:i.trim())||""}}catch{}}function xv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:o.format||GN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function Mv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:o.format||JN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function kv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:o.format||KN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function QN(...e){let t=[];for(let r=0,a=e.length;r{const N=r(),_=e.clone().set({hour:N.get("hour"),minute:N.get("minute"),second:N.get("second")});return S&&_.add(parseInt(D,10),I),M?_.format(M.substring(1).trim()):_.format(o)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(o)));return t.foldManager.save(g,c),g}catch(g){console.error(`Failed to create file: '${h}'`,g),new Tr.Notice("Unable to create new file.")}}function c7(e,t){return t[Ws(e,"day")]??null}function d7(){const{vault:e}=window.app,{folder:t}=Ev(),n=e.getAbstractFileByPath(Tr.normalizePath(t));if(!n)throw new u7("Failed to find daily notes folder");const r={};return Tr.Vault.recurseChildren(n,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"day");if(o){const i=Ws(o,"day");r[i]=a}}}),r}class f7 extends Error{}function h7(){const{moment:e}=window;let t=e.localeData()._week.dow;const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)n.push(n.shift()),t--;return n}function p7(e){return h7().indexOf(e.toLowerCase())}async function nA(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Cv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(h,g,y)=>{const w=p7(g);return e.weekday(w).format(y.trim())}));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function m7(e,t){return t[Ws(e,"week")]??null}function g7(){const e={};if(!aA())return e;const{vault:t}=window.app,{folder:n}=Cv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new f7("Failed to find weekly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"week");if(o){const i=Ws(o,"week");e[i]=a}}}),e}class v7 extends Error{}async function rA(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=xv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function y7(e,t){return t[Ws(e,"month")]??null}function w7(){const e={};if(!oA())return e;const{vault:t}=window.app,{folder:n}=xv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new v7("Failed to find monthly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"month");if(o){const i=Ws(o,"month");e[i]=a}}}),e}class b7 extends Error{}async function S7(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Mv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function D7(e,t){return t[Ws(e,"quarter")]??null}function T7(){const e={};if(!iA())return e;const{vault:t}=window.app,{folder:n}=Mv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new b7("Failed to find quarterly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"quarter");if(o){const i=Ws(o,"quarter");e[i]=a}}}),e}class I7 extends Error{}async function E7(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=kv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function C7(e,t){return t[Ws(e,"year")]??null}function x7(){const e={};if(!sA())return e;const{vault:t}=window.app,{folder:n}=kv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new I7("Failed to find yearly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"year");if(o){const i=Ws(o,"year");e[i]=a}}}),e}function M7(){var r,a;const{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;const n=e.plugins.getPlugin("periodic-notes");return n&&((a=(r=n.settings)==null?void 0:r.daily)==null?void 0:a.enabled)}function aA(){var n,r;const{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;const t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function oA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function iA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function sA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function k7(e){const t={day:Ev,week:Cv,month:xv,quarter:Mv,year:kv}[e];return t()}function N7(e,t){return{day:tA,month:rA,week:nA}[e](t)}vn.DEFAULT_DAILY_NOTE_FORMAT=sT;vn.DEFAULT_MONTHLY_NOTE_FORMAT=GN;vn.DEFAULT_QUARTERLY_NOTE_FORMAT=JN;vn.DEFAULT_WEEKLY_NOTE_FORMAT=lT;vn.DEFAULT_YEARLY_NOTE_FORMAT=KN;var Kg=vn.appHasDailyNotesPluginLoaded=M7;vn.appHasMonthlyNotesPluginLoaded=oA;vn.appHasQuarterlyNotesPluginLoaded=iA;vn.appHasWeeklyNotesPluginLoaded=aA;vn.appHasYearlyNotesPluginLoaded=sA;var lA=vn.createDailyNote=tA;vn.createMonthlyNote=rA;vn.createPeriodicNote=N7;vn.createQuarterlyNote=S7;vn.createWeeklyNote=nA;vn.createYearlyNote=E7;var Ju=vn.getAllDailyNotes=d7;vn.getAllMonthlyNotes=w7;vn.getAllQuarterlyNotes=T7;vn.getAllWeeklyNotes=g7;vn.getAllYearlyNotes=x7;var pb=vn.getDailyNote=c7,Jc=vn.getDailyNoteSettings=Ev,hp=vn.getDateFromFile=Lp;vn.getDateFromPath=l7;vn.getDateUID=Ws;vn.getMonthlyNote=y7;vn.getMonthlyNoteSettings=xv;vn.getPeriodicNoteSettings=k7;vn.getQuarterlyNote=D7;vn.getQuarterlyNoteSettings=Mv;vn.getTemplateInfo=jp;vn.getWeeklyNote=m7;vn.getWeeklyNoteSettings=Cv;vn.getYearlyNote=C7;vn.getYearlyNoteSettings=kv;const A7={},F7={},O7={},P7={},uA={welcome:"Welcome to Thino",ribbonIconTitle:"Thino",to:"to",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekDaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],year:null,month:null,"Basic Options":"Basic options","User name":"User name","Set your user name here. 'Memos 😏' By default":"Set your user name here. 'Thino 😏' By default",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"Insert after heading","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"You should set the same heading below if you want to insert and process thino below the same heading.","Allows admonitions to be created using ":"Allows admonitions to be created using ","Process Memos below":"Process thino below","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.","Save Memo button label":"Save thino button label","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"The text shown on the save Thino button in the UI. 'NOTEIT' by default.","Focus on editor when open memos":"Focus on editor when open thino","Focus on editor when open memos. Focus by default.":"Focus on editor when open thino. Focus by default.","Open daily memos with open memos":"Open daily thino with open thino","Open daily memos with open memos. Open by default.":"Open daily thino with open thino. Open by default.","Open Memos when obsidian opens":"Open Thino when obsidian opens","When enable this, Memos will open when Obsidian opens. False by default.":"When enable this, Thino will open when Obsidian opens. False by default.","Hide done tasks in Memo list":"Hide done tasks in Thino list","Hide all done tasks in Memo list. Show done tasks by default.":"Hide all done tasks in Thino list. Show done tasks by default.","Advanced Options":"Advanced Options","UI language for date":"UI language for date","Translates the date UI language. Only 'en' and 'zh' are available.":"Translates the date UI language. Only 'en' and 'zh' are available.","Default prefix when save thino":"Default prefix when save thino","Set the default prefix when create memo, 'List' by default.":"Set the default prefix when create thino, 'List' by default.","Default insert date format":"Default insert date format","Set the default date format when insert date by @, 'Tasks' by default.":"Set the default date format when insert date by @, 'Tasks' by default.","Default editor position on mobile":"Default editor position on mobile","Set the default editor position on Mobile, 'Top' by default.":"Set the default editor position on Mobile, 'Top' by default.","Use button to show editor on mobile":"Use button to show editor on mobile","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Set a float button to call editor on mobile. Only when editor located at the bottom works.","Show Time When Copy Results":"Show Time When Copy Results","Show time when you copy results, like 12:00. Copy time by default.":"Show time when you copy results, like 12:00. Copy time by default.","Show Date When Copy Results":"Show Date When Copy Results","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Show date when you copy results, like [[2022-01-01]]. Copy date by default.","Add Blank Line Between Different Date":"Add Blank Line Between Different Date","Add blank line when copy result with date. No blank line by default.":"Add blank line when copy result with date. No blank line by default.","Share Options":"Share Options","Share Memos Image Footer Start":"Share Thino Image Footer Start","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default","Share Memos Image Footer End":"Share Thino Image Footer End","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default","Save Shared Image To Folder For Mobile":"Save Shared Image To Folder For Mobile","Save image to folder for mobile. False by Default":"Save image to folder for mobile. False by Default","Say Thank You":"Say Thank You",Donate:"Donate","If you like this plugin, consider donating to support continued development:":"If you like this plugin, consider donating to support continued development:","File Name of Recycle Bin":"File Name of Recycle Bin","Set the filename for recycle bin. 'delete' By default":"Set the filename for recycle bin. 'delete' By default","File Name of Query File":"File Name of Query File","Set the filename for query file. 'query' By default":"Set the filename for query file. 'query' By default","Use Tags In Vault":"Use Tags In Vault","Use tags in vault rather than only in Memos. False by default.":"Use tags in vault rather than only in Thino. False by default.","Ready to convert image into background":"Ready to convert image into background",List:"List",Task:"Task",Top:"Top",Bottom:"Bottom",TAG:"TAG",DAY:"DAY",QUERY:"Query",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE","CONFIRM!":"CONFIRM!","CREATE FILTER":"CREATE FILTER","Comment it...":"Comment it...",Settings:"Settings","Recycle bin":"Recycle bin","About Me":"About Me","Fetching data...":"Fetching data...","Here is No Memos.":"Here is No Thino.","Frequently Used Tags":"Frequently Used Tags","What do you think now...":"What do you think now...",READ:"READ",MARK:"MARK",SHARE:"SHARE",SOURCE:"SOURCE",RESTORE:"RESTORE",ARCHIVE:"Archive","DELETE AT":"DELETE AT","Noooop!":"Noooop!","All Data is Loaded 🎉":"All Data is Loaded 🎉","Quick filter":"Quick filter",TYPE:"TYPE",LINKED:"LINKED","NO TAGS":"NO TAGS","HAS LINKS":"HAS LINKS","HAS IMAGES":"HAS IMAGES",INCLUDE:"INCLUDE",EXCLUDE:"EXCLUDE",TEXT:"TEXT",IS:"IS",AND:"AND",OR:"OR",LIST:"LIST",ISNOT:"ISNOT",PATH:"PATH",METADATA:"METADATA",SELECT:"SELECT","ADD FILTER TERMS":"ADD FILTER TERMS",FILTER:"FILTER",Filter:"Filter",TITLE:"TITLE","CREATE QUERY":"CREATE QUERY","EDIT QUERY":"EDIT QUERY",MATCH:"MATCH",TIMES:"TIMES","Share Memo Image":"Share Thino Image","↗Click the button to save":"↗Click the button to save","Image is generating...":"Image is generating...","Image is loading...":"Image is loading...","Loading...":"Loading...","😟 Cannot load image, image link maybe broken":"😟 Cannot load image, image link maybe broken","Daily Memos":"Daily Thino","CANCEL EDIT":"CANCEL EDIT","LINK TO THE":"LINK TO THE","Mobile Options":"Mobile Options","Experimental Options":"Experimental Options","Don't support web image yet, please input image path in vault":"Don't support web image yet, please input image path in vault","Background Image in Dark Theme":"Background Image in Dark Theme","Background Image in Light Theme":"Background Image in Light Theme",'Set background image in dark theme. Set something like "Daily/one.png"':'Set background image in dark theme. Set something like "Daily/one.png"','Set background image in light theme. Set something like "Daily/one.png"':'Set background image in light theme. Set something like "Daily/one.png"','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Set default thino composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default',"Default Memo Composition":"[Deprecated] Default Thino Composition","Show Tasks Label":"Show Tasks Label","Show tasks label near the time text. False by default":"Show tasks label near the time text. False by default","Please Open Memos First":"Please Open Thino First",DATE:"DATE",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"BEFORE",AFTER:"AFTER","Allow Comments On Memos":"Allow Comments On Thino","You can comment on memos. False by default":"You can comment on thino. False by default",Import:"Import","TITLE CANNOT BE NULL!":"TITLE CANNOT BE NULL!","FILTER CANNOT BE NULL!":"FILTER CANNOT BE NULL!","Comments In Original DailyNotes/Notes":"Comments In Original DailyNotes/Notes","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"You should install Dataview Plugin ver 0.5.9 or later to use this feature.","Open Memos Successfully":"Open Thino Successfully","Fetch Memos Error":"😭 Fetch Error","Copied to clipboard Successfully":"Copied to clipboard Successfully","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin","Please finish the last filter setting first":"Please finish the last filter setting first","Close Memos Successfully":"Close Thino Successfully","Insert as Memo":"Insert as Thino","Insert file as memo content":"Insert file as thino content","Image load failed":"Image load failed","Content cannot be empty":"Content cannot be empty","Unable to create new file.":"Unable to create new file.","Failed to fetch deleted memos: ":"Failed to fetch deleted thino: ","RESTORE SUCCEED":"RESTORE SUCCEED","DELETE SUCCEED":"DELETE SUCCEED","Save Memo button icon":"Save Thino button icon","The icon shown on the save Memo button in the UI.":"The icon shown on the save Thino button in the UI.","Fetch Memos From Particular Notes":"Fetch Thino From Particular Notes",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'You can set any Dataview Query for thino to fetch it. All thino in those notes will show on list. "#memo" by default',"Allow Memos to Fetch Memo from Notes":"Allow Thino to Fetch Thino from Notes","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"Use Thino to manage all thino in your notes, not only in daily notes. False by default","Always Show Memo Comments":"Always Show Thino Comments","Always show memo comments on memos. False by default":"Always show thino comments on thino. False by default","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.","Please check your daily note plugin OR periodic notes plugin settings":"Please check your daily note plugin OR periodic notes plugin settings","Use which plugin's default configuration":"Use which plugin's default configuration","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino use the plugin's default configuration to fetch thino from daily, 'Daily' by default.",Daily:"Daily","Always Show Leaf Sidebar on PC":"Always Show Leaf Sidebar on PC","Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.","fetch more":"fetch more","Search all settings":"Search all settings",General:"General",Theme:"Theme",Share:"Share",Advanced:"Advanced",Thino:"Thino","Random Review":"Random Review","ARCHIVED AT":"ARCHIVED AT","Failed to get memos from daily notes":"Failed to get thino from daily notes","Failed to delete memo":"Failed to delete thino","CTRL + ENTER to save":"CTRL + ENTER to save","Started from":"Started from","Custom Background Image":"Custom Background Image","Set custom background image.":"Set custom background image.","Custom Memo Footer":"Custom Thino Footer","Set custom memo footer.":"Set custom thino footer.","Heatmap Color Scheme":"Heatmap Color Scheme","Set different color scheme for heatmap.":"Set different color scheme for heatmap.","Enable Local Http Server":"Enable Local Http Server","Memos Http Server Port":"Thino Http Server Port","Set memos http server port to listen. '43999' by default":"Set thino http server port to listen. '43999' by default","Default Editor Mode":"Default Editor Mode","Live-Preview Mode OR Source Mode.":"Live-Preview Mode/Source Mode.","Save type for Thino":"Save type for Thino",DAILY:"DAILY",MULTI:"MULTI",CANVAS:"CANVAS",ALL:"ALL",FILE:"FILE",TODO:"TODO",DONE:"DONE",JOURNAL:"JOURNAL",OTHER:"OTHER","Failed to create daily note, check if it exists.":"Failed to create daily note, check if it exists.","Failed to create daily note. Please check if you created a folder for daily notes.":"Failed to create daily note. Please check if you created a folder for daily notes.","After you verify your account, please refresh this page.":"After you verify your account, please refresh this page.",Verify:"Verify","Oops! You forget to verify insider account":"Oops! You forget to verify insider account","If you have any questions, please contact us.":"If you have any questions, please contact us.","Delete Thino Directly":"Delete Thino Directly","When delete thino directly, it will not be moved to trash. False by default.":"When delete thino directly, it will not be moved to trash. False by default.","Enable opening thino globally":"Enable opening thino globally","Enable opening thino globally. False by default.":"Enable opening thino globally. False by default.","Key for opening thino globally":"Key for opening thino globally","Set key for opening thino globally. CTRL + SHIFT + T by default.":"Set key for opening thino globally. CTRL + SHIFT + T by default.","Key for showing thino globally":"Key for showing thino globally","Set key for showing thino globally. CTRL + SHIFT + E by default.":"Set key for showing thino globally. CTRL + SHIFT + E by default.","Get activation code":"Get activation code","Input activation code here":"Input activation code here","Copy Thino id":"Copy Thino id","Activate Pro Version":"Activate Pro Version","Please copy Thino id first":"Please copy Thino id first",'You can set folder name with file name like "folder/file"':'You can set folder name with file name like "folder/file"','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'You can set folder name like "folder1/folder2/folder3" to create sub-folder',"Default save type":"Default save location",'Set the default save type for thino. "DAILY" by default':'Set the default save type for thino. "DAILY" by default',"Sync Thino via PKMer":"Sync Thino via PKMer",Unlink:"Unlink",Link:"Link","Connect to PKMer Sync, you can check it in ":"Connect to PKMer Sync, you can check it in ","PKMer Sync":"PKMer Sync","Remove successfully":"Remove successfully",Deactivate:"Deactivate",Remove:"Remove","Confirm?":"Confirm?","Sync Status":"Sync Status","Start or stop sync":"Start or stop sync","Stop sync successfully":"Stop sync successfully","Start sync successfully":"Start sync successfully",Stop:"Stop",Start:"Start","Show thino near mouse":"Show thino near mouse","Query not found":"Query not found","Send to clipboard successfully":"Send to clipboard successfully","Thino - Failed to start HTTP server, please check the port is available.":"Thino - Failed to start HTTP server, please check the port is available.","Thino - Started HTTP server on port":"Thino - Started HTTP server on port","Thino - Terminated HTTP server":"Thino - Terminated HTTP server","File not exist":"File not exist","Thino not found":"Thino not found","File not found for the given thino path, is creating a new file":"File not found for the given thino path, is creating a new file","Saved sync token successfully":"Saved sync token successfully","Failed to find daily notes folder":"Failed to find daily notes folder","Please install obsidian-hover-editor plugin first":"Please install obsidian-hover-editor plugin first","Copied app id successfully":"Copied app id successfully","Please input token first":"Please input token first","Please enable sync first":"Please enable sync first","Init Failed":"Init Failed","Verify successfully":"Verify successfully","Failed to verify":"Failed to verify","Folder not found for the given thino path, is creating a new folder":"Folder not found for the given thino path, is creating a new folder","File not found for the given thino path":"File not found for the given thino path","Failed to read current daily note, check if it exists.":"Failed to read current daily note, check if it exists.","Failed to save":"Failed to save","Failed to login, please login again":"Failed to login, please login again","COPY FAILED":"COPY FAILED","COPY SUCCEED":"COPY SUCCEED","Copy selected text":"Copy selected text","Copy thino":"Copy thino",COPY:"COPY","This is a pro feature, please upgrade to pro version to use it.":"This is a pro feature, please upgrade to pro version to use it.","You can get pro version from: ":"You can get pro version from: ",Save:"Save",Cancel:"Cancel","Thino Daily Target":"Thino Daily Target",Input:"Input","#Tag":"#Tag","to create tag":"to create tag","You have verified your account. Congrats!":"You have verified your account. Congrats!","Pro features":"Pro features","Target Thino Count":"Target Thino Count",on:"on","Switch waterfall view":"Switch waterfall view","Switch view":"Switch view","Switch list view":"Switch list view","Set daily target":"Set daily target","Thino Save To: ":"Thino Save To: ","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",words:"words","Return To Home Page":"Return Home","Open thino in center window":"Open thino in center window","Open thino in float window":"Open thino in float window","Open thino in right sidebar":"Open thino in right sidebar","Open thino in left sidebar":"Open thino in left sidebar","Show thino editor":"Show thino editor","Toggle minimal mode":"Toggle minimal mode","Focus on thino editor":"Focus on thino editor","ReSync web thinos to local":"ReSync web thinos to local","Sync local thinos to web":"Sync local thinos to web","Show daily thino":"Show daily thino","Focus on search bar":"Focus on search bar","Show-thino in popover(Hover editor)":"Show-thino in popover(Hover editor)","Center window":"Center window","Float window":"Float window","Right sidebar":"Right sidebar","Left sidebar":"Left sidebar","Save thino type when sync local":"Save thino type when sync local","Set the default save thino type when sync local, FILE by default.":"Set the default save thino type when sync local, FILE by default.","Sync service":"Sync service","Pro verification status":"Pro verification status","Live-preview":"Live-preview",Source:"Source","Global copy":"Global copy","Set the folder name":"Set the folder name","Set the filename":"Set the filename","Set the filename for current location file":"Set the filename for current location file","Switch calendar type":"Switch calendar type",alphabetical:"alphabetical",alphabeticalReverse:"alphabeticalReverse",byCount:"byCount",byCountReverse:"byCountReverse","Type here":"Type here",Today:"Today",Yesterday:"Yesterday","Last 7 days":"Last 7 days","Last 30 days":"Last 30 days","Last 90 days":"Last 90 days","Last 180 days":"Last 180 days","Last 365 days":"Last 365 days",Found:"Found","Copy filtered thinos":"Copy filtered thinos","Bulk delete":"Bulk delete","Bulk archive":"Bulk archive","Bulk tag operation":"Bulk tag operation","Bulk restore":"Bulk restore","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.",Preview:"Preview","Set and save":"Set and save","Show day mark in thino list":"Show day mark in thino list","Show day mark on the top of daily range thino. False by default.":"Show day mark on the top of daily range thino. False by default.","Click to expand or fold, Cmd+Click to show all thinos of the day":"Click to expand or fold, Cmd+Click to show all thinos of the day","You can buy a license from":"You can buy a license from","No thinos in range":"No thinos in range",Month:"Month",Week:"Week",Day:"Day",Agenda:"Agenda",Tomorrow:"Tomorrow",Previous:"Previous",Next:"Next","Search all columns...":"Search all columns...","Basic Info":"Basic Info","Additional Info":"Additional Info","Created At":"Created At",Content:"Content","Thino Type":"Thino Type","Source Type":"Source Type","Row status":"Row status",Path:"Path","Pinned Status":"Pinned Status",Table:"Table",Chat:"Chat",Moments:"Moments",Waterfall:"Waterfall",Calendar:"Calendar","Go to page":"Go to page",Page:"Page",Show:"Show",rows:"rows","Temp Filter":"Temp Filter","Open link directly in Thino view":"Open link directly in Thino view","Day mark range":"Day mark range","Set the range of day mark. Day by default.":"Set the range of day mark. Day by default.","Thino is locked":"Thino is locked","Please unlock Thino by input password":"Please unlock Thino by input password","Auto Download Image":"Auto Download Image","Auto download image when save to thino. 'false' by default":"Auto download image when save to thino. 'false' by default","Thino Http IP Type":"Thino Http IP Type","Set Thino http server ip to listen. 'localhost' by default":"Set Thino http server ip to listen. 'localhost' by default","Password to lock Thino":"Password to lock Thino",Unlock:"Unlock",Locked:"Locked","Password is incorrect":"Password is incorrect",Lock:"Lock","Need password to unlock Thino":"Need password to unlock Thino","You have not set a password or enable this feature yet":"You have not set a password or enable this feature yet",Password:"Password","Password for Thino":"Password for Thino","Please input your password to change password settings":"Please input your password to change password settings","Please input your password":"Please input your password","Lock thino":"Lock thino",date:"date",time:"time",event:"event","Add tag position":"Add tag position","Set the position of the tag when adding tag automatically":"Set the position of the tag when adding tag automatically","Add tag automatically":"Add tag automatically","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"Add tag to the end or beginning of the thino content when creating a thino and filtering tags","Add tag with new line":"Add tag with new line","Add tag with new line when adding tag automatically":"Add tag with new line when adding tag automatically","Input to select more tags":"Input to select more tags","Tag Bulk Edit":"Tag Bulk Edit","Tag Bulk Select":"Tag Bulk Select","Exist Tags":"Exist Tags","Selected Tags":"Selected Tags","Click to remove exist tag":"Click to remove exist tag","Click to remove selected tag":"Click to remove selected tag","Select tags":"Select tags","Input to select exist tag":"Input to select exist tag",Beginning:"Beginning",End:"End","Set the heading for saving thino":"Set the heading for saving thino","# Heading":"# Heading","Chat view style":"Chat view style","Set the style of chat view":"Set the style of chat view","Background image for moments view":"Background image for moments view","Set the background image for moments view":"Set the background image for moments view","Icon for moments/chat view/share image":"Icon for moments/chat view/share image","Set the icon for moments/chat view/share image":"Set the icon for moments/chat view/share image","Quote for moments view/share image":"Quote for moments view/share image","Set the quote for moments view/share image":"Set the quote for moments view/share image","Theme for Thino":"Theme for Thino","Set the theme for Thino":"Set the theme for Thino","Interface Details":"Interface Details","Task amount":"Task amount","Thino status":"Thino status","Used tags":"Used tags","Used days":"Used days","Most active day":"Most active day","Most active hour":"Most active hour","Thino amount":"Thino amount","No content to generate.":"No content to generate.","Image generated successfully.":"Image generated successfully.","Failed to generate image.":"Failed to generate image.","Share filtered thinos as image":"Share filtered thinos as image","Latest version":"Latest version","Previous version":"Previous version","Thino update info":"Thino update info","Debug info copied to clipboard":"Debug info copied to clipboard","Copy debug info":"Copy debug info","Failed to load changelog":"Failed to load changelog","View online":"View online",ChangeLog:"ChangeLog","Please open thino first":"Please open thino first","Insert editor":"Insert editor","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.","Default time prefix for thino in daily notes":"Default time prefix for thino in daily notes","Set default time prefix for thino in daily notes.":"Set default time prefix for thino in daily notes.","Save image successfully":"Save image successfully","User quote":"User quote","Set user quote for thino":"Set user quote for thino","User icon":"User icon","Set user icon for thino. You can input http/https link or file path in vault.":"Set user icon for thino. You can input http/https link or file path in vault.","User info":"User info","Copy filtered results":"Copy filtered results","Share image":"Share image",Default:"Default",Gray:"Gray",Grass:"Grass",Flame:"Flame",Olive:"Olive",Ice:"Ice",Magenta:"Magenta","Daily notes":"Daily notes",Editor:"Editor","Append/prepend text when share to Thino":"Append/prepend text when share to Thino","Append text when share to Thino":"Append text when share to Thino","Prepend text when share to Thino":"Prepend text when share to Thino","Add newline when append/prepend text":"Add newline when append/prepend text","Input anything here":"Input anything here",Prepend:"Prepend",Append:"Append",Both:"Both",None:"None","Hide pinned group":"Hide pinned group","Hide pinned group in thino list. False by default.":"Hide pinned group in thino list. False by default.","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.","Different insert target for different type":"Different insert target for different type","Toggle this to set different insert target for different type of thino, like task or list type of thino":"Toggle this to set different insert target for different type of thino, like task or list type of thino","You can set whole diary or only part of it":"You can set whole diary or only part of it","Set process target":"Set process target",Custom:"Custom","Whole diary":"Whole Diary","Set thino insert place":"Set thino insert place","Set where to insert thino content":"Set where to insert thino content","End of the diary":"End of the diary","Custom location":"Custom location","Setting guide":"User setting guide","Details settings":"Details settings","Start Thino":"Start Thino","About Thino Pro":"About Thino Pro",Enabled:"Enabled",Enable:"Enable","Daily notes folder":"Daily notes folder","Set daily notes folder":"Set daily notes folder","Daily note name format":"Daily note name format","Set daily note name format":"Set daily note name format","Daily note plugin":"Daily note plugin","Enable daily note plugin":"Enable daily note plugin",Selected:"Selected",Select:"Select","A classic theme for Thino with a two-column layout":"A classic theme for Thino with a two-column layout",Classic:"Classic","A modern theme for Thino with a three-column layout and some unique features.":"A modern theme for Thino with a three-column layout and some unique features.",Modern:"Modern","Go and enjoy Thino":"Go and enjoy Thino","Congrats! All settings done":"Congrats! All settings done","Adjust settings that influence your user experience with Thino.":"Adjust settings that influence your user experience with Thino.","Set preferences for using Thino":"Set preferences for using Thino","If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.","Go with daily note plugin":"Go with daily note plugin","Choose a theme for Thino.":"Choose a theme for Thino.","Set theme for Thino":"Set theme for Thino","Set up your user info for Thino.":"Set up your user info for Thino.","Get started with Thino":"Get started with Thino","Skip and start Thino":"Skip and start Thino","Next step":"Next step","Back to previous step":"Back to previous step","Click to enable =>":"Click to enable =>","This is Thino's sidebar. Navigate to different path or select query filter.":"This is Thino's sidebar. Navigate to different path or select query filter.","Click here and go to settings page.":"Click here and go to settings page.","Click here and go to different path.":"Click here and go to different path.","Select or create query filter here.":"Select or create query filter here.","See the status of Thinos here.":"See the status of Thinos here.","Search your thino quickly here.":"Search your thino quickly here.","Edit or create your thino here.":"Edit or create your thino here.","See your thinos here.":"See your thinos here.","See your time status of thinos here.":"See your time status of thinos here.","See your tags here. Tags will be shown when thino contains tags.":"See your tags here. Tags will be shown when thino contains tags.",Done:"Done","Thino is ready to use. ":"Thino is ready to use. ","You can start using Thino now. If you want to know more about Thino Pro, click the button below.":"You can start using Thino now. If you want to know more about Thino Pro, click the button below.","Default time prefix":"Default time prefix","Append Text Action":"Append Text Action","Prepend Text Action":"Prepend Text Action",Preset:"Preset","Select Tags":"Select Tags","It is not available on small view":"It is not available on small view","Append text":"Append text","Prepend text":"Prepend text","Your daily note folder is not set correctly, please check your settings":"Your daily note folder is not set correctly, please check your settings","Default sharing style":"Default sharing style","Set the default style for sharing thino, 'Modern' by default.":'Set the default style for sharing thino, "Modern" by default.',Clean:"Clean",Minimal:"Minimal",Gradient:"Gradient","Thino share":"Thino share","Copy to clipboard failed":"Copy to clipboard failed","Copy to clipboard successfully":"Copy to clipboard successfully","Your content has been copied to clipboard, and inserted into the editor. Please try it again":"Your content has been copied to clipboard, and inserted into the editor. Please try it again","Share thino":"Share thino","Set file name after create thino":"Set file name after create thino","You can set file name after create thino. A input box will show when you create thino.":"You can set file name after create thino. A input box will show when you create thino.",SPLIT:"SPLIT","Split by Heading 1":"Split by Heading 1","Split by Heading 2":"Split by Heading 2","Split by Heading 3":"Split by Heading 3","Insert task":"Insert task","All settings have been reset to default.":"All settings have been reset to default.","Reset all Thino settings":"Reset all Thino settings","Reset settings":"Reset settings","Reset Thino settings to default settings.":"Reset Thino settings to default settings.","Task Management":"Task Management","Append completed date when task done in thino":"Append completed date when task done in thino","Append completed date when task done in thino. False by default":"Append completed date when task done in thino. False by default","Set tag for single file that Thino indexes":"Set tag for single file that Thino indexes","When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":"Set tag for file type file","Set tag for multi type file":"Set tag for multi type file","Please input the tag":"Please input the tag","Merge thinos in to thino share image":"Merge thinos in to thino share image","Custom height for Thino content":"Custom height for Thino content","Set custom height for Thino content. Like 200px or 20rem":"Set custom height for Thino content. Like 200px or 20rem","Input height":"Input height","Submit issue":"Submit issue","Current version":"Current version","Bug report":"Bug report","Click the button to copy debug info and open the issue page":"Click the button to copy debug info and open the issue page","Copy and go":"Copy and go","Debug info copied":"Debug info copied","Feature request":"Feature request","Submit your feature request to the issue page":"Submit your feature request to the issue page",Go:"Go","Toggle query list visibility":"Toggle query list visibility","Toggle tags visibility":"Toggle tags visibility","Toggle sidebar visibility":"Toggle sidebar visibility",Collapse:"Collapse",Expand:"Expand","Max height for collapse":"Max height for collapse","The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)","Render content":"Render content","Optimize for Callout":"Optimize for Callout","Won't render content contains more than 3 callouts automatically. True by default":"Won't render content contains more than 3 callouts automatically. True by default","The value should be greater than":"The value should be greater than","Append Text":"Append Text","Prepend Text":"Prepend Text","Thino height when collapsed":"Thino height when collapsed","The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":"The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)","This option will allow you use other views when leaf width is not enough. False by default.":"This option will allow you use other views when leaf width is not enough. False by default.","Can select other views when leaf width is not enough":"Can select other views when leaf width is not enough","TRASH BOX":"TRASH BOX","Wait templater to finish parse before insert thino":"Wait templater to finish parse before insert thino","This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.","Get thino capture extension":"Get thino capture extension","You can capture idea/text from chrome now.":"You can capture idea/text from chrome now.","Open File":"Open File","Exported CSV file":"Exported CSV file","Updated At":"Updated At","Export to CSV":"Export to CSV","Quick add button on mobile navbar":"Quick add button on mobile navbar","Always show status text":"Always show status text","Support filter by metadata from file":"Support filter by metadata from file","When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.","Show source near timestamp in thino":"Show source near timestamp in thino","When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.","Show Update Message":"Show Update Message","Show update message when Thino is updated. True by default":"Show update message when Thino is updated. True by default","Sync manually":"Sync manually","Show all scrollbars":"Show all scrollbars","TIME RANGE":"TIME RANGE",WITHIN:"WITHIN","7 days":"7 days","14 days":"14 days","30 days":"30 days","3 months":"3 months","6 months":"6 months","1 year":"1 year","This week":"This week","Last week":"Last week","This month":"This month","Last month":"Last month","This year":"This year","Last year":"Last year"},j7={},L7={},R7={welcome:"Bienvenue dans Mémo !",ribbonIconTitle:"Mémos",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekDaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],to:"à",year:null,month:null,"Basic Options":"Options basique","User name":"Username","Set your user name here. 'Memos 😏' By default":"Définissez votre username ici. Défaut : 'Memo 😏'","Insert after heading":"Insérer après le titre","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Vous devez définir le même titre en-dessous si vous voulez insérer et traiter des mémos sous le même titre.","Allows admonitions to be created using ":"Permet de créer des admonitions en utilisant","Process Memos below":"Insérer Mémo sous","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Seulement les entrée sous cette section/phrase dans vos notes seront considérés. S'il n'existe pas, aucune notes ne sera traité pour ce fichier.","Save Memo button label":"Titre du bouton de sauvegarde","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"Le texte affiché sur le bouton de sauvegarde dans l'UI. Défaut : 'NOTEIT'","Focus on editor when open memos":"Focus sur l'éditeur lors de l'ouverture du mémo.","Focus on editor when open memos. Focus by default.":"Focus sur l'éditeur lors de l'ouverture du mémo. Focus par défaut.","Open daily memos with open memos":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open daily memos with open memos. Open by default.":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open Memos when obsidian opens":"Ouvrir Mémo quand Obsidian est ouvert.","When enable this, Memos will open when Obsidian opens. False by default.":"Quand activé, Memo sera ouvert quand Obsidian à l'ouverture d'Obsidian. Désactivé par défaut.","Hide done tasks in Memo list":"Masquer les tâches accomplies dans la liste des mémos.","Hide all done tasks in Memo list. Show done tasks by default.":"Masquer les tâches accomplies dans les mémos. Affiche les tâches accomplies par défaut.","Advanced Options":"Options avancées","UI language for date":"Langue de l'UI pour la date","Translates the date UI language. Only 'en' and 'zh' are available.":"Traduit la langue des dates dans l'UI. Seuls 'en', 'fr' et 'zh' sont disponibles. ","Default prefix":"Préfix par défaut.","Set the default prefix when create memo, 'List' by default.":"Définit le préfix par défaut lors de la création d'un mémo. Défault : 'Liste'","Default insert date format":"Format de la date insérée par défaut.","Default editor position on mobile":"Position par défaut de l'éditeur sur mobile.","Set the default date format when insert date by @, 'Tasks' by default.":"Définit le format de la date par défaut lors de l'insertion de la date par @. Défaut : 'Tâches'.","Set the default editor position on Mobile, 'Top' by default.":"Position par défaut de l'éditeur sur le mobile. Défaut : 'Haut'.","Use button to show editor on mobile":"Utilisation du bouton pour afficher l'éditeur sur le mobile.","Show Time When Copy Results":"Aficher l'heure quand les résultats sont copiés","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Place un bouton flottant pour appeler l'éditeur sur mobile. Fonctionne uniquement quand l'éditeur est placé en bas.","Show time when you copy results, like 12:00. Copy time by default.":"Affiche l'heure quand les résultats sont copiés, comme '12:00'. Copie l'heure par défaut","Show Date When Copy Results":"Affiche la date quand les résultats sont copiés","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Affiche la date quand les résultats sont copiés, comme [[2022-01-01]]. Par défaut, copie la date.","Add Blank Line Between Different Date":"Ajoute une ligne entre les différentes dates.","Add blank line when copy result with date. No blank line by default.":"Ajoute une ligne lors de la copie du résultat avec la date. Pas de ligne par défaut.","Share Options":"Options de partage","Share Memos Image Footer Start":"Début du pied de page — Partage de mémo de mémos","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Définissez ce que vous voulez ici, utilisez {ThinoNum} pour afficher le nombre de thino, {UsedDay} pour les jours. Par défaut : '{ThinoNum} Thino {UsedDay} Days.","Share Memos Image Footer End":"Fin du pied de page — Partage de mémo","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Définissez ce que vous voulez ici. Utilisez {UserName} comme username. Par défaut : '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"Sauvegarde des images partagés dans un dossier sur mobile.","Save image to folder for mobile. False by Default":"Sauvegarder les images dans un dossier sur mobile. Désactivé par défaut.","Say Thank You":"Dites Merci",Donate:"Faire un don","If you like this plugin, consider donating to support continued development:":"Si vous aimez ce plugin, envisagez de faire un don pour soutenir le développement continu :","File Name of Recycle Bin":"Nom de la corbeille","Set the filename for recycle bin. 'delete' By default":"Définition du nom de la poubelle. Défaut : 'Delete'","Set the filename for query file. 'query' By default":"Définit le nom de fichier pour les requête. Défaut : 'Query'","Use Tags In Vault":"Utiliser des tags dans le Coffre","Use tags in vault rather than only in Memos. False by default.":"Utiliser des tags du coffre plutôt que ceux que seulement dans Mémo. Désactivé par défaut.","Ready to convert image into background":"Prêt pour convertir des image en arrière-plan.",List:"Liste",Task:"Tâche",Top:"Haut",Bottom:"Bas",TAG:"TAG",DAY:"JOUR",QUERY:"RECHERCHE",EDIT:"EDITER",PIN:"PIN",UNPIN:"ÉPINGLER",DELETE:"DESÉPINGLER","CONFIRM!":"CONFIRMER !","CREATE FILTER":"CRÉER FILTRE",Settings:"Paramètres","Recycle bin":"Corbeille","About Me":"À propos de moi","Fetching data...":"Récupération des données...","Here is No Memos.":"Il n'y a pas de Memos.","Frequently Used Tags":"Tags fréquemment utilisés","What do you think now...":"Que pensez-vous maintenant...",READ:"LU",MARK:"MARQUER",SHARE:"PARTAGER",SOURCE:"SOURCE",RESTORE:"RESTAURER","DELETE AT":"SUPPRIMER","Noooop!":"Noooop!","All Data is Loaded 🎉":"Toutes les données sont chargées 🎉","Quick filter":"Filtre rapide",TYPE:"TYPE",LINKED:"LIEN","NO TAGS":"PAS DE TAGS","HAS LINKS":"A DES LIENS","HAS IMAGES":"A DES IMAGES",INCLUDE:"INCLUS",EXCLUDE:"EXCLUS",TEXT:"TEXTE",IS:"EST",ISNOT:"N'EST PAS",SELECT:"SELECTION","ADD FILTER TERMS":"AJOUTER DES TERMES FILTRÉ",FILTER:"FILTRE",TITLE:"TITRE","CREATE QUERY":"CRÉER UNE RECHERCHE","EDIT QUERY":"ÉDITER UNE RECHERCHE",MATCH:"MATCH",TIMES:"HEURE","Share Memo Image":"Partager un mémo image","↗Click the button to save":"↗Clique pour sauvegarder","Image is generating...":"Génération de l'image...","Image is loading...":"Image en chargement...","Loading...":"Chargement...","😟 Cannot load image, image link maybe broken":"😟 Impossible de charger l'image, le lien peut être brisé","Daily Memos":"Mémo quotidien","CANCEL EDIT":"ANNULER L'ÉDITION","LINK TO THE":"LIENS À","Mobile Options":"Options mobile","Don't support web image yet, please input image path in vault":"Ne supporte pas les images webs. Merci d'insérer le chemin de l'image depuis le coffre.","Background Image in Dark Theme":"Image de fond en thème sombre","Background Image in Light Theme":"Image de fond en thème clair",'Set background image in dark theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème sombre. Définir 'Daily/one.png' par exemple.",'Set background image in light theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème clair. Définir 'Daily/one.png' par exemple.",'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Définir la composition par défaut du mémo, vous devez utiliser {TIME} comme "HH:mm" et {CONTENT} comme contenu. "{TIME} {CONTENT}" par défaut',"Default Memo Composition":"Composition par défaut du mémo","Show Tasks Label":"Afficher les étiquettes des tâches","Show tasks label near the time text. False by default":"Afficher les étiquettes des tâches à côté du texte horaire. Désactivé par défaut.","Please Open Memos First":"Merci d'ouvrir les mémos en premier"},_7={},B7={},H7={},Y7={},U7={},z7={},V7={},W7={},$7={welcome:"Bem-vindo ao Thino!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},Z7={welcome:"Bem-vindo ao Memos!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of memos, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},q7={},G7={},J7={},K7={welcome:"欢迎使用 Thino ",ribbonIconTitle:"Thino",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:[null,null,null,null,null,null,null,null,null,null,null,null],weekDays:["周日","周一","周二","周三","周四","周五","周六"],weekDaysShort:["周日","周一","周二","周三","周四","周五","周六"],to:"至",year:"年",month:"月","Basic Options":"基础选项","User name":"用户名","Set your user name here. 'Memos 😏' By default":"在这里设置你喜欢的用户名。 默认为 'Thino 😏'",'You can set target heading like "# Heading" to control data location':'你可以设置目标标题,例如 "# Heading" 来控制数据的位置',"Insert after heading":"在指定标题后插入 Thino","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"若留空,则记录的 thino 内容在日记末尾插入,若填写标题,则记录的 thino 内容统一都记录在该标题下","Process Memos below":"解析指定标题后的 Thino","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"若留空,则在Thino界面会显示所有thino记录内容,若填写标题,则Thino界面只显示该标题下的内容,写入其他位置的内容不显示","Save Memo button label":"保存按钮上的文本","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"在保存按钮上展示的文本。默认为 'NOTEIT'","Focus on editor when open memos":"自动聚焦到 Thino 输入框","Focus on editor when open memos. Focus by default.":"当打开 Thino 的时候自动聚焦到 Thino 输入框。默认开启","Open daily memos with open memos":"打开每日 Thino 的时候打开 Thino 界面","Open daily memos with open memos. Open by default.":"打开每日 Thino 的时候打开 Thino 界面。默认开启","Open Memos when obsidian opens":"当开启 Obsidian 的时候自动打开 Thino","When enable this, Memos will open when Obsidian opens. False by default.":"当开启该选项, Thino 会在 Obsidian 打开时自动打开。默认不开启。","Hide done tasks in Memo list":"在 Thino 列表中隐藏已完成 Thino","Hide all done tasks in Memo list. Show done tasks by default.":"在 Thino 列表中隐藏已完成 Thino。默认不开启","Advanced Options":"进阶选项","UI language for date":"针对日期展示的语言界面","Translates the date UI language. Only 'en' and 'zh' are available.":"对日期的不同翻译。目前只能选择 'en' 和 'zh'(未来会废置)","Default prefix when save thino":"保存 Thino 时的默认前缀","Set the default prefix when create memo, 'List' by default.":"设置默认的前缀样式。默认为列表","Default insert date format":"插入日期附带的样式","Set the default date format when insert date by @, 'Tasks' by default.":"当使用 @ 来快速插入日期时,插入日期附带的样式,默认为 'Tasks' 样式","Default editor position on mobile":"在移动端上的默认编辑器位置","Set the default editor position on Mobile, 'Top' by default.":"设置在移动端上的默认编辑器位置,默认在顶部。","Use button to show editor on mobile":"当编辑器位置在底部时,用按钮来唤出编辑器","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"设置一个浮动按钮来唤出编辑器。当在移动端上启用该选项才会生效","Show Time When Copy Results":"当复制检索结果时附带时间","Show time when you copy results, like 12:00. Copy time by default.":"在复制检索结果时附带其时间,例如 12:00 。默认开启","Show Date When Copy Results":"当复制检索结果时附带日期","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"在复制检索结果时附带其日期,例如 [[2022-01-01]]。默认开启","Add Blank Line Between Different Date":"在复制日期的时候加上空行","Add blank line when copy result with date. No blank line by default.":"在复制日期的时候在相邻的日期之间加上空行。默认无空行","Share Options":"分享选项","Share Memos Image Footer Start":"分享 Thino 图片的左边页脚","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"你可以在这里设置你想要的任意文本,用 {ThinoNum} 来展示你记录的 thino 数量,{UsedDay} 来展示使用日期。默认为'{ThinoNum} Thino {UsedDay} Days'","Share Memos Image Footer End":"分享 Thino 图片的右边页脚","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"你可以在这里设置你想要的任意文本,用 {UserName} 来展示你的用户名。默认为 '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"当在移动端上时保存图片到文件夹","Save image to folder for mobile. False by Default":"当在移动端上时,保存生成的图片到文件夹","Say Thank You":"感谢开发",Donate:"捐赠","If you like this plugin, consider donating to support continued development:":"如果你喜欢这个插件,而且也希望给我买鸡腿,那么可以考虑 Github 页面右边的 Sponsor~","File Name of Recycle Bin":"回收站的文件名","Set the filename for recycle bin. 'delete' By default":"给回收站设置一个文件名。默认为'delete'","File Name of Query File":"检索文件的文件名","Set the filename for query file. 'query' By default":"设置存放检索式的文件的文件名。默认为'query'","Use Tags In Vault":"使用在库内的所有标签","Use tags in vault rather than only in Memos. False by default.":"使用在库内的而不是 Thino 内的标签。默认关闭","Don't support web image yet, please input image path in vault":"暂不支持网络图片,请使用本地图片","Ready to convert image into background":"正在将图片转换为背景图",List:"列表",Task:"任务",Top:"顶部",Bottom:"底部",TAG:"标签",DAY:"天",QUERY:"检索式",EDIT:"编辑",PIN:"置顶",UNPIN:"取消置顶",DELETE:"删除","CONFIRM!":"确定删除","CREATE FILTER":"创建检索式",Filter:"筛选",Settings:"设置","Recycle bin":"回收站","About Me":"关于","Fetching data...":"获取数据中...","Here is No Memos.":"没有找到 Thino","Frequently Used Tags":"常用标签","What do you think now...":"你现在在想什么?",READ:"阅读",MARK:"引用",SHARE:"分享",SOURCE:"来源",RESTORE:"恢复",ARCHIVE:"归档","DELETE AT":"删除于","Noooop!":"啥都没有!","All Data is Loaded 🎉":"所有数据都加载好啦 🎉","Quick filter":"快速筛选",TYPE:"类型",LINKED:"有链接","NO TAGS":"无标签","HAS LINKS":"有超链接","HAS IMAGES":"有图片",INCLUDE:"包括",EXCLUDE:"排除",TEXT:"文本",IS:"是",AND:"和",OR:"或",LIST:"状态",ISNOT:"不是",SELECT:"选择",PATH:"路径",METADATA:"元数据","ADD FILTER TERMS":"添加检索条件",FILTER:"筛选器",TITLE:"标题","CREATE QUERY":"创建检索式","EDIT QUERY":"编辑检索式",MATCH:"匹配",TIMES:"次","Share Memo Image":"分享 Thino 图片","↗Click the button to save":"↗点击右上角的按钮来保存","Image is generating...":"图片正在生成中...","Image is loading...":"图片正在加载中...","😟 Cannot load image, image link maybe broken":"😟 无法加载图片,图片链接也许不存在","Loading...":"努力加载中...","Daily Memos":"每日 Thino","CANCEL EDIT":"取消编辑","LINK TO THE":"链接到","Mobile Options":"移动端选项","Experimental Options":"实验性选项","Background Image in Dark Theme":"深色主题的背景图","Background Image in Light Theme":"浅色主题的背景图",'Set background image in dark theme. Set something like "Daily/one.png"':'设置深色主题的背景图。请设置类似"Daily/one.png"的路径','Set background image in light theme. Set something like "Daily/one.png"':'设置浅色主题的背景图。请设置类似"Daily/one.png"的路径','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'设置默认 Thino 组成,你必须要使用 {TIME} 作为 "HH:mm" 而且要设置 {CONTENT} 作为内容识别。默认情况下, Thino 基于 "{TIME} {CONTENT}" 识别',"Default Memo Composition":"【已弃置】默认 Thino 组成","Show Tasks Label":"展示任务标签","Show tasks label near the time text. False by default":"在 Thino 的时间旁展示任务标签。默认情况下不展示","Please Open Memos First":"请先打开 Thino","Comment it...":"评论...",DATE:"日期",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"Obsidian Natrual DATES language 插件没启动",BEFORE:"在之前",AFTER:"在之后","Allow Comments On Memos":"允许在 Thino 上评论","You can comment on memos. False by default":"你可以在 Thino 点击图标进行评论了。默认不开启",Import:"导入","TITLE CANNOT BE NULL!":"标题不可以为空!","FILTER CANNOT BE NULL!":"筛选器不可以为空!","Comments In Original DailyNotes/Notes":"在原文件中进行评论","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"你需要安装 0.5.9 版本以上的 Dataview 插件来使用该功能","Open Memos Successfully":"成功打开 Thino ","Fetch Memos Error":"😭 Thino 获取失败","Copied to clipboard Successfully":"复制成功","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"请检查你有没有开启日记插件或者 Periodic Notes 插件且启用了日记模式","Please finish the last filter setting first":"先完善上一个过滤器吧","Close Memos Successfully":"成功关闭 Thino ","Insert as Memo":"插入内容为 Thino","Insert file as memo content":"插入文件为 Thino","Image load failed":"有个图片加载失败了😟","Content cannot be empty":"内容不能为空呀","Unable to create new file.":"无法新建文件","Failed to fetch deleted memos: ":"无法获取已删除的 Thino :","RESTORE SUCCEED":"成功恢复 Thino","DELETE SUCCEED":"删除成功","Save Memo button icon":"保存按钮上的图标","The icon shown on the save Memo button in the UI.":"你可以设置保存按钮上的图标","Fetch Memos From Particular Notes":"从指定的文件中获取 Thino",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'你可以给笔记设置指定检索式来让 Memos 可以索引到它。默认为 "#memo" ',"Allow Memos to Fetch Memo from Notes":"允许 Thino 从笔记中获取 Thino","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"使用 Memos 来管理你笔记中的 Memos,不单只 DailyNotes 中的内容。默认为关闭","Always Show Memo Comments":"评论将总是可见","Always show memo comments on memos. False by default":"当开启后评论总是会在 Thino 的下方展示。默认为关闭","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的所在文件夹","Please check your daily note plugin OR periodic notes plugin settings":"请检查你的日记插件和/或 Periodic Notes 插件的设置","Use which plugin's default configuration":"使用哪个插件的默认日记配置","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino 采用指定插件的默认配置来获取 Thino。默认为日记插件。",Daily:"日记插件","Always Show Leaf Sidebar on PC":"在 PC 上总是展示左侧栏","Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":"在 PC 或平板上即使页面宽度小于 875px 时都展示左侧栏。默认为关闭","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的格式","fetch more":"加载更多","Search all settings":"搜索所有设置","Random Review":"随机回顾","ARCHIVED AT":"归档于","Failed to get memos from daily notes":"无法从日记中获取 Thino","Failed to delete memo":"无法删除 Thino","CTRL + ENTER to save":"CTRL + ENTER 保存","Started from":"开始于","Custom Background Image":"自定义背景图","Set custom background image.":"设置自定义背景图","Custom Memo Footer":"自定义 Thino 页脚","Set custom memo footer.":"设置自定义 Thino 页脚","Heatmap Color Scheme":"热力图颜色","Set different color scheme for heatmap.":"设置热力图的颜色","Enable Local Http Server":"启用本地 HTTP 服务器","Memos Http Server Port":"Thino HTTP 服务器端口","Set memos http server port to listen. '43999' by default":"设置 Thino HTTP 服务器端口。默认为 '43999'","Live-Preview Mode OR Source Mode.":"基于 Thino 的所见即所得模式(默认) 或者 源码模式,你可以自己选择适合自己的输入体验。","Default Editor Mode":"默认编辑器模式","Save type for Thino":"Thino 保存类型",DAILY:"日记",MULTI:"多文件",CANVAS:"画布",FILE:"单文件",ALL:"所有","Failed to create daily note, check if it exists.":"无法创建日记,请检查是否存在文件夹","Failed to create daily note. Please check if you created a folder for daily notes.":"无法创建日记,请检查是否存在日记文件夹","After you verify your account, please refresh this page.":"验证成功后,请刷新页面。",Verify:"去验证","Oops! You forget to verify insider account":"内测账户验证失败","If you have any questions, please contact us.":"如果你有任何问题,请联系我们。","Delete Thino Directly":"直接删除 Thino","When delete thino directly, it will not be moved to trash. False by default.":"当直接删除 Thino 时,不会移动到回收站。默认为关闭","Get activation code":"获取激活码","Input activation code here":"在这里输入激活码","Copy Thino id":"获取 Thino id","Activate Pro Version":"激活专业版","Please copy Thino id first":"请先获取 Thino id",'You can set folder name with file name like "folder/file"':'你可以设置例如 "folder/file" 的文件夹名+文件名的搭配来存放在指定文件夹','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'你可以设置例如 "folder1/folder2/folder3" 的文件夹名来创建子文件夹',"Default save type":"默认保存类型",'Set the default save type for thino. "DAILY" by default':'设置 Thino 的默认保存类型。默认为 "日记"',"Enable opening thino globally":"全局唤醒 Thino","Enable opening thino globally. False by default.":"全局唤醒 Thino。默认为关闭","Key for opening thino globally":"全局唤醒 Thino 的快捷键","Set key for opening thino globally. CTRL + SHIFT + T by default.":"设置全局唤醒 Thino 的快捷键。默认为 CTRL + SHIFT + T","Sync Thino via PKMer":"通过 PKMer 同步 Thino",Unlink:"取消链接",Link:"链接","Connect to PKMer Sync, you can check it in ":"连接到 PKMer 同步,你可以在该链接中查看:","PKMer Sync":"PKMer 同步","Remove successfully":"移除成功",Deactivate:"取消激活",Remove:"移除","Confirm?":"确认?","Sync Status":"同步状态","Start or stop sync":"开始或停止同步","Stop sync successfully":"停止同步成功","Start sync successfully":"开始同步成功",Stop:"停止",Start:"开始","Show thino near mouse":"在鼠标附近展示 Thino","Query not found":"检索式未找到","Send to clipboard successfully":"发送到剪贴板成功","Thino - Failed to start HTTP server, please check the port is available.":"Thino - 启动 HTTP 服务器失败,请检查端口是否可用。","Thino - Started HTTP server on port":"Thino - 启动 HTTP 服务器成功,端口为","Thino - Terminated HTTP server":"Thino - 终止 HTTP 服务器","File not exist":"文件不存在","Thino not found":"Thino 未找到","File not found for the given thino path, is creating a new file":"未找到承载指定 Thino 的文件,正在创建新文件","Saved sync token successfully":"保存同步令牌成功","Failed to find daily notes folder":"未找到日记文件夹","Please install obsidian-hover-editor plugin first":"请先安装 obsidian-hover-editor 插件","Copied app id successfully":"复制 app id 成功","Please input token first":"请先输入 token","Please enable sync first":"请先启用同步","Init Failed":"初始化失败","Folder not found for the given thino path, is creating a new folder":"未找到承载指定 Thino 的文件夹,正在创建新文件夹","File not found for the given thino path":"未找到承载指定 Thino 的文件","Failed to read current daily note, check if it exists.":"无法读取日记文件,请检查是否存在","Verify successfully":"验证成功","Failed to verify":"验证失败","Failed to save":"保存失败","Failed to login, please login again":"登录已过期,请重新登录","COPY FAILED":"复制失败","COPY SUCCEED":"复制成功","Copy selected text":"复制选中文本","Copy thino":"复制",COPY:"复制","This is a pro feature, please upgrade to pro version to use it.":"这是专业版功能,请升级到专业版来使用它。","You can get pro version from: ":"你可以从这里获取专业版:",Save:"保存",Cancel:"取消","Thino Daily Target":"Thino 每日目标",Input:"输入","#Tag":"#标签","to create tag":"来创建标签","You have verified your account. Congrats!":"你已经验证了你的账户。恭喜!","Pro features":"专业版功能","Target Thino Count":"目标 Thino 数量",on:"在","Switch waterfall view":"切换瀑布流视图","Switch view":"切换视图","Switch list view":"切换列表视图","Set daily target":"设置每日目标","Thino Save To: ":"Thino 保存到:","Enter fullscreen mode":"进入全屏模式","Exit fullscreen mode":"退出全屏模式",words:"字词","Return To Home Page":"返回首页","Open thino in center window":"在中心窗口打开 thino","Open thino in float window":"在浮动窗口打开 thino","Open thino in right sidebar":"在右侧边栏打开 thino","Open thino in left sidebar":"在左侧边栏打开 thino","Show thino editor":"显示 thino 编辑器","Toggle minimal mode":"切换 Minimal 模式","Focus on thino editor":"聚焦到 thino 编辑器","ReSync web thinos to local":"重新同步 web 上的 thino 到本地","Sync local thinos to web":"同步本地的 thino 到 web","Show daily thino":"显示每日 thino 视图","Focus on search bar":"聚焦到搜索栏","Show-thino in popover(Hover editor)":"在弹出框中显示 thino","Center window":"中心窗口","Float window":"浮动窗口","Right sidebar":"右侧边栏","Left sidebar":"左侧边栏","Save thino type when sync local":"同步本地时保存的 thino 类型","Set the default save thino type when sync local, FILE by default.":"设置同步本地时保存的 thino 类型,默认为单文件。","Sync service":"同步服务","Pro verification status":"专业版激活状态","Live-preview":"所见即所得",Source:"源码",General:"通用",Thino:"Thino",Theme:"主题",Share:"分享",Interface:"界面",Advanced:"进阶","Global copy":"全局复制","Set the folder name":"设置文件夹名","Set the filename":"设置文件名","Set the filename for current location file":"设置当前位置文件的文件名","Switch calendar type":"切换日历类型",alphabetical:"标签名称(A-Z)",alphabeticalReverse:"标签名称(Z-A)",byCount:"按使用次数(从高到低)",byCountReverse:"按使用次数(从低到高)","Type here":"在这里输入",Today:"今天",Yesterday:"昨天","Last 7 days":"最近 7 天","Last 30 days":"最近 30 天","Last 90 days":"最近 90 天","Last 180 days":"最近 180 天","Last 365 days":"最近 365 天",Found:"被找到","Copy filtered thinos":"复制筛选的 thino","Bulk delete":"批量删除","Bulk archive":"批量归档","Bulk tag operation":"标签编辑","Bulk restore":"批量恢复","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"如果你禁用了日记插件,可能会导致 thino 无法被正确删除。请启用插件后再试一次。",Preview:"预览","Set and save":"设置并保存","Show day mark in thino list":"在 Thino 列中展示日期标记","Show day mark on the top of daily range thino. False by default.":"在 Thino 列中展示日期标记。默认为关闭","Click to expand or fold, Cmd+Click to show all thinos of the day":"点击展开或折叠,Cmd+点击展示当天所有 thino","You can buy a license from":"你可以从这里购买许可证","No thinos in range":"该范围内没有 thino",Month:"月视图",Week:"周视图",Day:"日视图",Agenda:"日程视图",Tomorrow:"明天",Previous:"往前",Next:"往后","Search all columns...":"搜索所有的列...","Basic Info":"基础信息","Additional Info":"附加信息","Created At":"创建于",Content:"内容","Thino Type":"Thino 类型","Source Type":"来源类型","Row status":"归档状态",Path:"路径","Pinned Status":"置顶状态",Table:"表格",Chat:"聊天",Moments:"动态",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Set the heading for saving thino":"设置保存 Thino 的标题","# Heading":"# 标题","Open link directly in Thino view":"Thino 视图内直接打开双链","Day mark range":"日期标记范围","Set the range of day mark. Day by default.":"设置日期标记的范围,默认为天","Thino is locked":"Thino 已锁定","Please unlock Thino by input password":"请输入密码来解锁 Thino","Auto Download Image":"自动下载图片","Auto download image when save to thino. 'false' by default":"当保存到 Thino 时自动下载图片。默认为 'false'","Thino Http IP Type":"Thino HTTP 服务器 IP 类型","Set Thino http server ip to listen. 'localhost' by default":"设置 Thino HTTP 服务器 IP。默认为 'localhost'","Password to lock Thino":"锁定 Thino 的密码",Unlock:"解锁",Locked:"已锁定","Password is incorrect":"密码错误",Lock:"锁定","Need password to unlock Thino":"需要密码来解锁 Thino","You have not set a password or enable this feature yet":"你还没有设置密码或者启用该功能",Password:"密码","Password for Thino":"Thino 的密码","Please input your password to change password settings":"请输入原来的密码来修改密码设置","Please input your password":"请输入密码","Lock thino":"锁定 Thino",date:"日期",time:"时间",event:"事件","Add tag position":"添加标签位置","Set the position of the tag when adding tag automatically":"设置自动添加标签的位置","Add tag automatically":"自动添加标签","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"在创建 Thino 和筛选标签时,将标签添加到 Thino 内容的末尾或开头","Add tag with new line":"添加标签时换行","Add tag with new line when adding tag automatically":"自动添加标签时换行","Input to select more tags":"输入来选择更多标签","Tag Bulk Edit":"标签批量编辑","Tag Bulk Select":"标签批量选择","Exist Tags":"已有标签","Selected Tags":"已选标签","Click to remove exist tag":"点击移除已有标签","Click to remove selected tag":"点击移除已选标签","Select tags":"选择标签","Input to select exist tag":"输入来选择已有标签",Beginning:"开头",End:"末尾","Chat view style":"聊天视图样式","Set the style of chat view":"设置聊天视图的样式","Background image for moments view":"动态视图的背景图","Set the background image for moments view":"设置动态视图的背景图","Icon for moments/chat view/share image":"动态/聊天视图/分享图的头像","Set the icon for moments/chat view/share image":"设置动态/聊天视图/分享图的头像","Quote for moments view/share image":"动态视图/分享图的个性签名","Set the quote for moments view/share image":"设置动态视图/分享图的个性签名","Theme for Thino":"Thino 主题","Set the theme for Thino":"设置 Thino 的主题","Interface Details":"界面详情","Task amount":"任务数量","Thino status":"Thino 状态","Used tags":"使用的标签","Used days":"使用的天数","Most active day":"最活跃的一天","Most active hour":"最活跃的一小时","Thino amount":"Thino 数量","No content to generate.":"没有内容可以生成。","Image generated successfully.":"图片生成成功。","Failed to generate image.":"图片生成失败。","Share filtered thinos as image":"分享筛选的 Thino 为图片","Latest version":"最新版本","Previous version":"之前版本","Thino update info":"Thino 更新信息","Debug info copied to clipboard":"调试信息已复制到剪贴板","Copy debug info":"复制调试信息","Failed to load changelog":"无法加载更新日志","View online":"在线查看",ChangeLog:"更新日志","Please open thino first":"请先打开 Thino","Insert editor":"插入编辑器","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"请在 Thino 设置中为多文件设置不同的路径,日记文件夹与多文件保存路径重复,或者存在被重复读取可能","Default time prefix for thino in daily notes":"日记中 Thino 的默认时间前缀","Set default time prefix for thino in daily notes.":"设置日记中 Thino 的默认时间前缀","Save image successfully":"保存图片成功","User quote":"用户签名","Set user quote for thino":"设置用户签名","User icon":"用户头像","Set user icon for thino. You can input http/https link or file path in vault.":"设置用户头像。你可以设置 http/https 链接或者 vault 中的文件路径。","User info":"用户信息","Copy filtered results":"复制筛选结果","Share image":"分享图片",Default:"默认",Gray:"灰色",Grass:"草绿",Flame:"火焰",Olive:"橄榄",Ice:"冰",Magenta:"品红","Daily notes":"日记相关",Editor:"编辑器","Append/prepend text when share to Thino":"分享到 Thino 时添加/前置文本","Append text when share to Thino":"分享到 Thino 时添加文本","Prepend text when share to Thino":"分享到 Thino 时前置文本","Add newline when append/prepend text":"添加换行符",Prepend:"前置",Append:"后置",Both:"两者",None:"无","Hide pinned group":"隐藏置顶分组","Hide pinned group in thino list. False by default.":"隐藏置顶的 Thino 分组。默认为关闭","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"设置 Thino 任务类型的标题,如果提供了标题,所有记录的 Thino 内容将统一归类到该标题下。","Different insert target for different type":"不同类型的 Thino 有不同的插入目标","Toggle this to set different insert target for different type of thino, like task or list type of thino":"切换此选项以为不同类型的 Thino 设置不同的插入目标,例如任务或列表类型的 Thino","Set process target":"设置处理目标","You can set whole diary or only part of it":"你可以设置整个日记或者其中的一部分",Custom:"自定义","Whole diary":"整个日记","Set thino insert place":"设置 Thino 插入位置","Set where to insert thino content":"设置 Thino 内容插入位置","End of the diary":"日记的末尾","Custom location":"自定义位置","Setting guide":"设置流程","Details settings":"详细设置","Start Thino":"开始 Thino","About Thino Pro":"关于 Thino 专业版",Enabled:"已启用",Enable:"启用","Daily notes folder":"日记文件夹","Set daily notes folder":"设置日记文件夹","Daily note name format":"日记文件名格式","Set daily note name format":"设置日记文件名格式","Daily note plugin":"日记插件","Enable daily note plugin":"启用日记插件",Selected:"已选择",Select:"选择","A classic theme for Thino with a two-column layout":"Thino 的经典主题,采用两列布局",Classic:"经典","A modern theme for Thino with a three-column layout and some unique features.":"Thino 的现代主题,采用三列布局和一些独特的功能。",Modern:"现代","Go and enjoy Thino":"去享受 Thino 吧","Congrats! All settings done":"恭喜!所有设置已完成","Adjust settings that influence your user experience with Thino.":"调整影响你使用 Thino 的设置。","Set preferences for using Thino":"设置使用 Thino 的偏好","If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":"如果你使用的是 Thino 基础版,启用日记插件是必须的。配置其设置以有效地使用它。","Go with daily note plugin":"使用日记插件","Choose a theme for Thino.":"选择 Thino 的主题。","Set theme for Thino":"设置 Thino 的主题","Set up your user info for Thino.":"设置你的用户信息。","Get started with Thino":"开始使用 Thino","Skip and start Thino":"跳过并开始 Thino","Next step":"下一步","Back to previous step":"返回上一步","Click to enable =>":"点击启用 =>","This is Thino's sidebar. Navigate to different path or select query filter.":"这是 Thino 的侧边栏。你可以导航到不同的路径或选择查询过滤器。","Click here and go to settings page.":"点击这里并转到设置页面。","Click here and go to different path.":"点击这里并转到不同的路径。","Select or create query filter here.":"在这里选择或创建查询过滤器。","See the status of Thinos here.":"在这里看到 Thino 的状态。","Search your thino quickly here.":"在这里快速搜索你的 Thino。","Edit or create your thino here.":"在这里编辑或创建你的 Thino。","See your thinos here.":"在这里看到你的 Thino。","See your time status of thinos here.":"在这里看到你的 Thino 时间状态。","See your tags here. Tags will be shown when thino contains tags.":"在这里看到你的标签。当 Thino 包含标签时,标签将显示。",Done:"完成","Thino is ready to use. ":"Thino 已准备好使用。","You can start using Thino now. If you want to know more about Thino Pro, click the button below.":"你现在可以开始使用 Thino 了。如果你想了解更多关于 Thino 专业版的信息,请点击下面的按钮。","Default time prefix":"默认时间前缀","Append Text Action":"分享到 Thino 时的后置文本动作","Prepend Text Action":"分享到 Thino 时的前置文本动作",Preset:"预设","Select Tags":"选择标签","It is not available on small view":"在窄的视图中不可用","Append text":"在末尾添加文本","Prepend text":"在开头添加文本","Your daily note folder is not set correctly, please check your settings":"你的日记文件夹设置不正确,请检查你的设置","Default sharing style":"默认分享样式","Set the default style for sharing thino, 'Modern' by default.":"设置 Thino 的默认分享样式,默认为“现代”。",Clean:"清爽",Minimal:"极简",Gradient:"渐变","Thino share":"Thino 分享","Copy to clipboard failed":"复制到剪贴板失败","Copy to clipboard successfully":"复制到剪贴板成功","Your content has been copied to clipboard, and inserted into the editor. Please try it again":"你的内容已经复制到剪贴板,并插入到编辑器中。请再试一次","Share thino":"分享 Thino","Set file name after create thino":"创建 Thino 后设置文件名","You can set file name after create thino. A input box will show when you create thino.":"你可以在创建 Thino 后设置文件名。当你创建 Thino 时,会显示一个输入框。",SPLIT:"分割","Split by Heading 1":"按一级标题分割","Split by Heading 2":"按二级标题分割","Split by Heading 3":"按三级标题分割","Insert task":"插入任务","All settings have been reset to default.":"所有设置已重置为默认值。","Reset all Thino settings":"重置所有 Thino 设置","Reset settings":"重置设置","Reset Thino settings to default settings.":"将 Thino 设置重置为默认设置。","Task Management":"任务管理","Append completed date when task done in thino":"在 Thino 中的任务完成时添加完成日期","Append completed date when task done in thino. False by default":"在 Thino 中的任务完成时添加完成日期。默认为关闭","Set tag for single file that Thino indexes":"Thino 会索引被设置标签的单文件","When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"当你在这里设置一个标签时,Thino 会索引包含这个标签的文件,并在列表中显示。不需要添加 `#`。","Set tag for file type file":"为单文件类型文件设置标签","Set tag for multi type file":"为多文件类型文件设置标签","Please input the tag":"请输入标签","Merge thinos in to thino share image":"合并 Thino 到 Thino 分享图片","Custom height for Thino content":"自定义 Thino 内容高度","Set custom height for Thino content. Like 200px or 20rem":"设置 Thino 内容的自定义高度。如 200px 或 20rem","Input height":"输入高度","Submit issue":"提交问题","Current version":"当前版本","Bug report":"Bug 报告","Click the button to copy debug info and open the issue page":"点击按钮复制调试信息并打开问题页面","Copy and go":"复制并前往","Debug info copied":"调试信息已复制","Feature request":"功能请求","Submit your feature request to the issue page":"提交你的功能请求到问题页面",Go:"前往","Toggle query list visibility":"切换 Query 列表可见性","Toggle tags visibility":"切换标签可见性","Toggle sidebar visibility":"切换侧边栏可见性",Collapse:"收起",Expand:"展开","Max height for collapse":"折叠的最大高度","The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":"Thino 折叠的最大高度,设置为 0 时,Thino 不会折叠。默认为 0。(这不是行数,而是像素高度值)","Render content":"渲染内容","Optimize for Callout":"优化 Callout 渲染性能问题","Won't render content contains more than 3 callouts automatically. True by default":"不会自动渲染包含超过 3 个 Callout 的内容。默认为开启","The value should be greater than":"值应大于","Append Text":"后置文本","Prepend Text":"前置文本","Thino height when collapsed":"Thino 折叠时的高度","The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":"Thino 折叠时的高度,当设置为 0 时,完全折叠。默认为 100。(这不是行数,而是像素高度值)","This option will allow you use other views when leaf width is not enough. False by default.":"当页面宽度不够时,可以选择其他视图。默认为关闭。","Can select other views when leaf width is not enough":"当页面宽度不够时,可以选择其他视图","TRASH BOX":"回收站","Wait templater to finish parse before insert thino":"在插入 Thino 之前等待 Templater 完成解析","This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":"此选项将允许您在插入 Thino 之前等待 Templater 完成解析,这可能会导致您在插入 Thino 之间需要确认两次。默认为关闭。","Get thino capture extension":"获取 Thino 剪裁扩展","You can capture idea/text from chrome now.":"你现在可以从 Chrome 中捕获想法/文本。","Open File":"打开文件","Exported CSV file":"导出的 CSV 文件","Updated At":"更新于","Export to CSV":"导出为 CSV","Quick add button on mobile navbar":"移动端导航栏的快速添加按钮","Always show status text":"始终显示状态文本","Support filter by metadata from file":"支持通过文件中的元数据进行筛选","When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":"启用后,你可以通过文件中的元数据进行筛选,例如文件中的标签。但画布中的 Thino 不支持。默认为关闭。","Show source near timestamp in thino":"在 Thino 时间戳旁显示 Thino 的来源","When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":"启用后,你可以在 Thino 时间戳旁看到 Thino 的来源。你可以在元数据中设置 title 来覆盖文件名。默认为关闭。","Show Update Message":"显示更新消息","Show update message when Thino is updated. True by default":"Thino 更新时显示更新消息。默认为开启","Sync manually":"手动同步","Show all scrollbars":"显示所有滚动条","TIME RANGE":"时间范围",WITHIN:"在内","7 days":"7天","14 days":"14天","30 days":"30天","3 months":"3个月","6 months":"6个月","1 year":"1年","This week":"本周","Last week":"上周","This month":"本月","Last month":"上月","This year":"今年","Last year":"去年"},Q7={},X7={ar:A7,cs:F7,da:O7,de:P7,en:uA,"en-gb":j7,es:L7,fr:R7,hi:_7,id:B7,it:H7,ja:Y7,ko:U7,nl:z7,nn:V7,pl:W7,pt:$7,"pt-br":Z7,ro:q7,ru:G7,tr:J7,"zh-cn":K7,"zh-tw":Q7},kC=X7[x.moment.locale()];function E(e){const t=kC&&kC[e]||uA[e];return t===null?t:t||e}const eR=/```([\s\S]*?)```/g,tR=/\*\*(.+?)\*\*/g,nR=/\*(.+?)\*/g,rR=/\[ \] /g,aR=/\[.{1}\] /g,oR=/^[*-]/g,iR=/(\d+)\. /g,NC=/\[\[([^\]]+)\]\]/g,uT=/\[([^\]]+)\]\((([^\]]+).md)\)/g,sR=(e,t)=>{const n=e.replace(eR,"
$1
").replace(oR,"").replace(iR,"$1.").replace(rR,"").replace(aR,"").replace(tR,"$1").replace(nR,"$1").replace(/<br>/g,"

").replace(/&/g,"&");let r=n;if(t){if(NC.test(n)){const a=n.match(NC);for(let o=0;o{const{metadataCache:n}=Le.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof x.TFile?t?`${t}`:`${e}`:t?`${t}`:`${e}`},lR=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},uR=e=>{var t;return(t=uT.exec(e))==null?void 0:t[1]},cR=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},AC=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},dR=e=>e.replace(/\n/g,"
"),fR=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},FC="mobile-show-sidebar",cA=200,ei=3600*24*1e3,$r=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Wa=/(

|
)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,ua=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Af=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,hR=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Ff=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,ad=/\[@(.+?)\]\((.+?)\)/g,pR=/[#*"\/\\<>:|\[\]\?]/gim,mR=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,Qg=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var cT;(e=>{function t(){return parseInt(x.moment().format("x"))}e.getNowTimeStamp=t;function n(V){const Y=/'’A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Z=/\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/.source,Q=/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source,G=new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${Y}])+`,Z,Q].join("|"),"g");return(V.match(G)||[]).length}e.getWordCount=n;function r(V){Kg()&&(V!=null&&V.EnabledLocationList.some(Y=>Y.value==="DAILY"))&&(V!=null&&V.EnabledLocationList.some(Y=>Y.value==="MULTI"))&&mb().contains(V==null?void 0:V.MemoOtherSaveLocation.MemoDefaultMultiFilePath)&&new x.Notice(E("Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly."),5e3)}e.checkDailyInMulti=r;function a(){const V=navigator.userAgent;let Y="Unknown";return V.indexOf("Win")!=-1?Y="Windows":V.indexOf("Mac")!=-1?Y="MacOS":V.indexOf("Linux")!=-1&&(Y="Linux"),Y}e.getOSVersion=a;function o(V){return typeof V=="string"&&(V=V.replaceAll("-","/")),new Date(V).getTime()}e.getTimeStampByDate=o;function i(V){const Y=new Date(o(V));return new Date(Y.getFullYear(),Y.getMonth(),Y.getDate()).getTime()}e.getDateStampByDate=i;function l(V){const Y=new Date(o(V)),Z=Y.getFullYear(),Q=Y.getMonth()+1,G=Y.getDate();return`${Z}/${Q}/${G}`}e.getDateString=l;function c(V){const Y=new Date(o(V)),Z=Y.getHours(),Q=Y.getMinutes(),G=Z<10?"0"+Z:Z,le=Q<10?"0"+Q:Q;return`${G}:${le}`}e.getTimeString=c;function f(V){const Y=new Date(o(V)),Z=Y.getFullYear(),Q=Y.getMonth()+1,G=Y.getDate(),le=Y.getHours(),se=Y.getMinutes(),fe=Y.getSeconds(),$=Q<10?"0"+Q:Q,he=G<10?"0"+G:G,ie=le<10?"0"+le:le,ce=se<10?"0"+se:se,X=fe<10?"0"+fe:fe;return`${Z}/${$}/${he} ${ie}:${ce}:${X}`}e.getDateTimeString=f;function h(V){return Array.from(new Set(V))}e.dedupe=h;function g(V){const Y=new Set,Z=[];for(const Q of V)Y.has(Q.id)||(Y.add(Q.id),Z.push(Q));return Z}e.dedupeObjectWithId=g;function y(V,Y){let Z=null;return()=>{Z&&clearTimeout(Z),Z=setTimeout(V,Y)}}e.debounce=y;function w(V,Y,Z=!1,Q){let G=null,le=!1;function se(...fe){if(G&&clearTimeout(G),Z&&!le){const $=V.apply(this,fe);Q&&typeof Q=="function"&&Q($),le=!0}else G=setTimeout(()=>{const $=V.apply(this,fe);Q&&typeof Q=="function"&&Q($),le=!1,G=null},Y)}return se.cancel=function(){G&&clearTimeout(G),G=null,le=!1},se}e.debouncePlus=w;function S(V,Y){let Z=!0;return()=>{if(!Z)return!1;Z=!1,setTimeout(()=>{V(),Z=!0},Y)}}e.throttle=S;function D(V){const Y=[],Z=Object.keys(V).sort();for(const Q of Z){const G=V[Q];G&&(typeof G=="object"?Y.push(...D(G).split("&")):Y.push(`${Q}=${G}`))}return Y.join("&")}e.transformObjectToParamsString=D;function I(V){const Y={},Z=V.split("&");for(const Q of Z){const[G,le]=Q.split("=");G&&le&&(Y[G]=le)}return Y}e.transformParamsStringToObject=I;function M(V){if(!V)return{};const Y={},Z=Object.keys(V).sort();for(const Q of Z){const G=V[Q];if(typeof G=="object"){const le=M(JSON.parse(JSON.stringify(G)));le&&Object.keys(le).length>0&&(Y[Q]=le)}else G&&(Y[Q]=G)}return Y}e.filterObjectNullKeys=M;async function N(V){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(V)}catch(Y){console.warn("Copy to clipboard failed.",Y)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=N;function _(V){return new Promise(Y=>{const Z=new Image;Z.onload=()=>{const{width:Q,height:G}=Z;Q>0&&G>0?Y({width:Q,height:G}):Y({width:0,height:0})},Z.onerror=()=>{Y({width:0,height:0})},Z.className="hidden",Z.src=V,document.body.appendChild(Z),Z.remove()})}e.getImageSize=_;async function k(V){var G,le,se,fe;let Y;const Q=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!Q&&((fe=(se=(le=(G=window.app.plugins)==null?void 0:G.getPlugin("periodic-notes"))==null?void 0:le.calendarSetManager)==null?void 0:se.getActiveConfig("day"))!=null&&fe.enabled)?(Y=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",V),Y):(Y=await app.internalPlugins.getPluginById("daily-notes").instance.getDailyNote(V)||await lA(V),Y)}catch($){return console.error($),new x.Notice(E("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=k;function B(V){const Y=[];let Z=0;for(;Z").map(a=>`

${a!==""?a:"
"}

`).join(""),e=sR(e,t),e=e.replace($r,"#$1").replace(Wa,"

#$2").replace(Af,"$1$2").replace(hR,"$1").replace(ad,"$1").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let a=0;a{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;otypeof t[n]=="object"&&t[n]!==null&&typeof e[n]=="object"&&e[n]!==null?dA(e[n],t[n]):Object.prototype.hasOwnProperty.call(e,n)&&e[n]===t[n])}function yR(e,t){switch(t.type){case"SET_MEMOS":{const n=t.payload.memos.sort((a,o)=>{const i=ut.getTimeStampByDate(a.createdAt),l=ut.getTimeStampByDate(o.createdAt);return i===l?o.id.localeCompare(a.id):ut.getTimeStampByDate(o.createdAt)-ut.getTimeStampByDate(a.createdAt)}),r=ut.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=ut.dedupeObjectWithId(t.payload.commentMemos.sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"SET_TAGS":return{...e,tags:t.payload.tags,tagsNum:t.payload.tagsNum};case"INSERT_MEMO":{const n=ut.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=ut.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"DELETE_MEMO_BY_ID":return{...e,memos:[...e.memos].filter(n=>n.id!==t.payload.id)};case"DELETE_MEMO_BY_ID_BATCH":{const n=[...e.memos];return t.payload.ids.forEach(r=>{n.splice(n.findIndex(a=>a.id===r),1)}),{...e,memos:[...n]}}case"REPLACE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?t.payload.memo:r);return{...e,memos:[...n]}}case"REMOVE_PREPARE_UPDATE_THINO":return{...e,preparingUpdateMemo:[]};case"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO":return{...e,preparingUpdateMemo:e.preparingUpdateMemo.filter(n=>n.id!==t.payload.id)};case"SET_WAITING_FOR_TEMPLATER":return{...e,preparingUpdateMemo:[...e.preparingUpdateMemo,{origin:t.payload.origin,date:t.payload.date,isList:t.payload.isList,id:t.payload.id,type:t.payload.type}]};case"CLEAR_MEMOS":return{...fA};case"EDIT_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"EDIT_MEMO_PATH":{const n=e.memos.map(r=>r.path===t.payload.path?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UPDATE_MEMO_BATCH":{const n=e.memos.filter(a=>a.path!==t.payload.path),r=ut.dedupeObjectWithId([...t.payload.memos,...n].sort((a,o)=>ut.getTimeStampByDate(o.createdAt)-ut.getTimeStampByDate(a.createdAt)));return{...e,memos:[...r]}}case"ARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"ARCHIVE_MEMO_BY_ID_BULK":{const n=e.memos.map(r=>t.payload.some(a=>a.id===r.id)?{...r,...t.payload.filter(a=>a.id===r.id)[0]}:r);return{...e,memos:[...n]}}case"UNARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"PIN_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,pinned:t.payload.pinned}:r);return{...e,memos:[...n]}}case"EDIT_COMMENT_MEMO":{const n=e.commentMemos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,commentMemos:[...n]}}default:return e}}const fA={memos:[],commentMemos:[],tags:[],tagsNum:{},preparingUpdateMemo:[]};function wR(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const bR={user:null};function SR(e,t){switch(t.type){case"SET_QUERIES":{const n=ut.dedupeObjectWithId(t.payload.queries.sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)).sort((r,a)=>ut.getTimeStampByDate(a.pinnedAt??0)-ut.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=ut.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,queries:n}}case"DELETE_QUERY_BY_ID":return{...e,queries:[...e.queries].filter(n=>n.id!==t.payload.id)};case"UPDATE_QUERY":{const n=e.queries.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,queries:n}}default:return e}}const DR={queries:[]};function TR(e,t){var n,r,a,o;switch(t.type){case"SET_DAILY_NOTES":return{...e,dailyNotes:t.payload.dailyNotes};case"SET_APP":return e.app?{...e}:{...e,app:t.payload.app};case"SET_PLUGIN":return e.plugin?{...e}:{...e,plugin:t.payload.plugin};case"SET_EDITOR":return e.editor?{...e}:{...e,editor:t.payload.editor};case"SET_SETTINGS":return e.settings&&e.settings===t.payload.settings?{...e}:{...e,settings:t.payload.settings};case"SET_VIEW":return e.view&&((r=(n=e.view)==null?void 0:n.leaf)==null?void 0:r.id)===((o=(a=t.payload.view)==null?void 0:a.leaf)==null?void 0:o.id)?{...e}:{...e,view:t.payload.view};case"CLEAR_VIEW":return e.view&&e.view.unload(),{...e,view:null};case"CLEAR_FILES":return{...e,dailyNotes:null};case"SET_VERIFY_STATE":return{...e,verifyState:t.payload.verifyState};default:return e}}const IR={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},Le=t7({globalState:r7,locationState:qN,memoState:fA,userState:bR,queryState:DR,dailyNotesState:IR},e7({globalState:n7,locationState:a7,memoState:yR,userState:wR,queryState:SR,dailyNotesState:TR})),Lt=P.createContext(Le.getState());String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});class ER{constructor(){Se(this,"initialized",!1)}getState(){return Le.getState().dailyNotesState}setApp(t){return Le.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return Le.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return Le.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return Le.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return Le.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,a=hp(t,"day");return n?delete r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,Le.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return Le.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){try{const t=Ju();return Le.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}catch(t){console.error(t)}}}const ft=new ER;var la;(e=>{function t(o){const i={};for(const l of o)try{const c=localStorage.getItem(l);if(c!==null){const f=JSON.parse(c);i[l]=f}}catch(c){console.error("Get storage failed in ",l,c)}return i}e.get=t;function n(o){for(const i in o)try{const l=JSON.stringify(o[i]);localStorage.setItem(i,l)}catch(l){console.error("Save storage failed in ",i,l)}}e.set=n;function r(o){for(const i of o)try{localStorage.removeItem(i)}catch(l){console.error("Remove storage failed in ",i,l)}}e.remove=r;function a(){var i;const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o),(i=o.contentWindow)==null||i.localStorage.setItem("t",Date.now().toString()),o.remove()}e.emitStorageChangedEvent=a})(la||(la={}));class CR{constructor(){Se(this,"getState",()=>Le.getState().globalState);Se(this,"setEditMemoId",t=>{Le.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});Se(this,"setRefresh",t=>{Le.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});Se(this,"setCommentMemoId",t=>{Le.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});Se(this,"setMarkMemoId",t=>{Le.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});Se(this,"setLoaded",t=>{Le.dispatch({type:"SET_LOADED",payload:{loaded:t}})});Se(this,"setGlobalEditorShown",t=>{Le.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});Se(this,"setIsMobileView",t=>{Le.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});Se(this,"setChangedByMemos",t=>{Le.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});Se(this,"setShowSiderbarInMobileView",t=>{Le.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});Se(this,"setAppSetting",t=>{Le.dispatch({type:"SET_APP_SETTING",payload:t}),la.set(t)});Se(this,"setMemoListView",t=>{Le.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});Se(this,"setInstance",(t,n)=>{Le.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});Se(this,"setLocked",t=>{Le.dispatch({type:"SET_LOCKED",payload:{locked:t}})});Se(this,"setExitSteps",t=>{Le.dispatch({type:"SET_EXIT_STEPS",payload:{exited:t}})});Se(this,"setPluginManifest",t=>{Le.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=la.get(["shouldSplitMemoWord","shouldHideImageUrl","shouldUseMarkdownParser","useTinyUndoHistoryCache"]),n={shouldSplitMemoWord:t.shouldSplitMemoWord||!0,shouldHideImageUrl:t.shouldHideImageUrl||!0,shouldUseMarkdownParser:t.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:t.useTinyUndoHistoryCache||!1};this.setAppSetting(n)}}const dt=new CR;class xR{constructor(){Se(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,a=new URLSearchParams(n),o={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};o.query.tag=a.get("tag")||"",o.query.type=a.get("type")??"",o.query.text=a.get("text")??"",o.query.filter=a.get("filter")??"";const i=parseInt(a.get("from")??"0"),l=parseInt(a.get("to")??"0");l>i&&l!==0&&(o.query.duration={from:i,to:l}),o.hash=r,o.pathname=this.getValidPathname(t),Le.dispatch({type:"SET_LOCATION",payload:o})});Se(this,"getState",()=>Le.getState().locationState);Se(this,"clearQuery",()=>{Le.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});Se(this,"setQuery",t=>{Le.dispatch({type:"SET_QUERY",payload:t})});Se(this,"reloadApp",()=>{Le.dispatch({type:"RELOAD"})});Se(this,"setHash",t=>{Le.dispatch({type:"SET_HASH",payload:{hash:t}})});Se(this,"setPathname",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"pushHistory",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"replaceHistory",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"setMemoTypeQuery",(t="")=>{Le.dispatch({type:"SET_TYPE",payload:{type:t}})});Se(this,"setMemoFilter",t=>{Le.dispatch({type:"SET_QUERY_FILTER",payload:t})});Se(this,"setTextQuery",t=>{Le.dispatch({type:"SET_TEXT",payload:{text:t}})});Se(this,"setTimeQuery",t=>{Le.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});Se(this,"setPathQuery",t=>{Le.dispatch({type:"SET_PATH_QUERY",payload:{path:t}})});Se(this,"setMetadataQuery",(t,n)=>{Le.dispatch({type:"SET_METADATA_QUERY",payload:{name:t,value:n}})});Se(this,"setTagQuery",t=>{Le.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});Se(this,"setFromAndToQuery",(t,n)=>{Le.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});Se(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const at=new xR,ff=e=>`${e.vault.configDir}/query.json`,hA=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},Rp=async e=>(await hA(e,ff(e))||await pA(e),JSON.parse(await e.vault.adapter.read(ff(e))).queries||[]),Av=async(e,t)=>{await e.vault.adapter.write(ff(e),JSON.stringify({queries:t},null,2))},pA=async e=>{const t=dt.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(ff(e),JSON.stringify({queries:[]},null,2));else{const o=(await e.vault.read(r)).split(` -`);o.length===0&&await e.vault.adapter.write(ff(e),JSON.stringify({queries:[]},null,2));const i=[];for(let l=0;l{const{app:e}=Le.getState().dailyNotesState;return await hA(e,ff(e))||await pA(e),await Rp(e)||[]},kR=(e,t)=>({createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:E("Temp Filter"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),NR=async(e,t)=>{const n=await Rp(Le.getState().dailyNotesState.app)||[],r={createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:x.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await Av(Le.getState().dailyNotesState.app,n),r};var Ew={exports:{}};Ew.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",g=1,y=2,w=4,S=1,D=2,I=1,M=2,N=4,_=8,k=16,B=32,L=64,R=128,V=256,Y=512,Z=30,Q="...",G=800,le=16,se=1,fe=2,$=3,he=1/0,ie=9007199254740991,ce=17976931348623157e292,X=NaN,ae=4294967295,De=ae-1,je=ae>>>1,Re=[["ary",R],["bind",I],["bindKey",M],["curry",_],["curryRight",k],["flip",Y],["partial",B],["partialRight",L],["rearg",V]],Fe="[object Arguments]",Be="[object Array]",Xe="[object AsyncFunction]",Ze="[object Boolean]",st="[object Date]",Ct="[object DOMException]",tn="[object Error]",_e="[object Function]",et="[object GeneratorFunction]",nt="[object Map]",ht="[object Number]",St="[object Null]",Tt="[object Object]",Gt="[object Promise]",_t="[object Proxy]",Vt="[object RegExp]",Xt="[object Set]",dn="[object String]",en="[object Symbol]",Zn="[object Undefined]",kn="[object WeakMap]",Er="[object WeakSet]",pt="[object ArrayBuffer]",Mt="[object DataView]",Jt="[object Float32Array]",sn="[object Float64Array]",ln="[object Int8Array]",vr="[object Int16Array]",fr="[object Int32Array]",ha="[object Uint8Array]",jr="[object Uint8ClampedArray]",nr="[object Uint16Array]",Lr="[object Uint32Array]",te=/\b__p \+= '';/g,me=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ye=/&(?:amp|lt|gt|quot|#39);/g,He=/[&<>"']/g,Qe=RegExp(Ye.source),tt=RegExp(He.source),kt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr=/^\w*$/,Jn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/[\\^$.*+?()[\]{}|]/g,ta=RegExp(yr.source),Pi=/^\s+/,Nn=/\s/,Aa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fa=/\{\n\/\* \[wrapped with (.+)\] \*/,Zr=/,? & /,fo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Oa=/[()=,{}\[\]\/\s]/,iu=/\\(\\)?/g,si=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,li=/\w*$/,nc=/^[-+]0x[0-9a-f]+$/i,su=/^0b[01]+$/i,us=/^\[object .+?Constructor\]$/,ji=/^0o[0-7]+$/i,cs=/^(?:0|[1-9]\d*)$/,lu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ds=/($^)/,rc=/['\n\r\u2028\u2029\\]/g,An="\\ud800-\\udfff",na="\\u0300-\\u036f",qs="\\ufe20-\\ufe2f",Gs="\\u20d0-\\u20ff",ui=na+qs+Gs,uu="\\u2700-\\u27bf",Fo="a-z\\xdf-\\xf6\\xf8-\\xff",ho="\\xac\\xb1\\xd7\\xf7",Pa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fs="\\u2000-\\u206f",Rr=" \\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",Js="A-Z\\xc0-\\xd6\\xd8-\\xde",Ks="\\ufe0e\\ufe0f",Qs=ho+Pa+fs+Rr,po="['’]",hs="["+An+"]",ci="["+Qs+"]",mo="["+ui+"]",A="\\d+",U="["+uu+"]",K="["+Fo+"]",oe="[^"+An+Qs+A+uu+Fo+Js+"]",Ne="\\ud83c[\\udffb-\\udfff]",Ie="(?:"+mo+"|"+Ne+")",Ue="[^"+An+"]",it="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Js+"]",$t="\\u200d",Pn="(?:"+K+"|"+oe+")",Ga="(?:"+Ft+"|"+oe+")",ja="(?:"+po+"(?:d|ll|m|re|s|t|ve))?",ra="(?:"+po+"(?:D|LL|M|RE|S|T|VE))?",Oo=Ie+"?",La="["+Ks+"]?",Ja="(?:"+$t+"(?:"+[Ue,it,ct].join("|")+")"+La+Oo+")*",pa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ra=La+Oo+Ja,Li="(?:"+[U,it,ct].join("|")+")"+Ra,Ri="(?:"+[Ue+mo+"?",mo,it,ct,hs].join("|")+")",dm=RegExp(po,"g"),Bf=RegExp(mo,"g"),ps=RegExp(Ne+"(?="+Ne+")|"+Ri+Ra,"g"),fm=RegExp([Ft+"?"+K+"+"+ja+"(?="+[ci,Ft,"$"].join("|")+")",Ga+"+"+ra+"(?="+[ci,Ft+Pn,"$"].join("|")+")",Ft+"?"+Pn+"+"+ja,Ft+"+"+ra,go,pa,A,Li].join("|"),"g"),Po=RegExp("["+$t+An+ui+Ks+"]"),Xs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bn=-1,hn={};hn[Jt]=hn[sn]=hn[ln]=hn[vr]=hn[fr]=hn[ha]=hn[jr]=hn[nr]=hn[Lr]=!0,hn[Fe]=hn[Be]=hn[pt]=hn[Ze]=hn[Mt]=hn[st]=hn[tn]=hn[_e]=hn[nt]=hn[ht]=hn[Tt]=hn[Vt]=hn[Xt]=hn[dn]=hn[kn]=!1;var pn={};pn[Fe]=pn[Be]=pn[pt]=pn[Mt]=pn[Ze]=pn[st]=pn[Jt]=pn[sn]=pn[ln]=pn[vr]=pn[fr]=pn[nt]=pn[ht]=pn[Tt]=pn[Vt]=pn[Xt]=pn[dn]=pn[en]=pn[ha]=pn[jr]=pn[nr]=pn[Lr]=!0,pn[tn]=pn[_e]=pn[kn]=!1;var jo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vo={"&":"&","<":"<",">":">",'"':""","'":"'"},ac={"&":"&","<":"<",">":">",""":'"',"'":"'"},ms={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oc=parseFloat,el=parseInt,tl=typeof dr=="object"&&dr&&dr.Object===Object&&dr,fd=typeof self=="object"&&self&&self.Object===Object&&self,zn=tl||fd||Function("return this")(),nl=t&&!t.nodeType&&t,Lo=nl&&!0&&e&&!e.nodeType&&e,hd=Lo&&Lo.exports===nl,di=hd&&tl.process,qr=function(){try{var be=Lo&&Lo.require&&Lo.require("util").types;return be||di&&di.binding&&di.binding("util")}catch{}}(),rl=qr&&qr.isArrayBuffer,Gr=qr&&qr.isDate,gs=qr&&qr.isMap,_i=qr&&qr.isRegExp,al=qr&&qr.isSet,ic=qr&&qr.isTypedArray;function xr(be,ze,Oe){switch(Oe.length){case 0:return be.call(ze);case 1:return be.call(ze,Oe[0]);case 2:return be.call(ze,Oe[0],Oe[1]);case 3:return be.call(ze,Oe[0],Oe[1],Oe[2])}return be.apply(ze,Oe)}function vs(be,ze,Oe,vt){for(var Qt=-1,Dn=be==null?0:be.length;++Qt-1}function aa(be,ze,Oe){for(var vt=-1,Qt=be==null?0:be.length;++vt-1;);return Oe}function oa(be,ze){for(var Oe=be.length;Oe--&&ys(ze,be[Oe],0)>-1;);return Oe}function Ka(be,ze){for(var Oe=be.length,vt=0;Oe--;)be[Oe]===ze&&++vt;return vt}var Qa=H(jo),pu=H(vo);function vd(be){return"\\"+ms[be]}function Bi(be,ze){return be==null?n:be[ze]}function dc(be){return Po.test(be)}function P1(be){return Xs.test(be)}function j1(be){for(var ze,Oe=[];!(ze=be.next()).done;)Oe.push(ze.value);return Oe}function Uf(be){var ze=-1,Oe=Array(be.size);return be.forEach(function(vt,Qt){Oe[++ze]=[Qt,vt]}),Oe}function hm(be,ze){return function(Oe){return be(ze(Oe))}}function _o(be,ze){for(var Oe=-1,vt=be.length,Qt=0,Dn=[];++Oe-1}function ky(d,p){var T=this.__data__,j=wa(T,d);return j<0?(++this.size,T.push([d,p])):T[j][1]=p,this}_a.prototype.clear=Dc,_a.prototype.delete=to,_a.prototype.get=nh,_a.prototype.has=My,_a.prototype.set=ky;function Ho(d){var p=-1,T=d==null?0:d.length;for(this.clear();++p=p?d:p)),d}function no(d,p,T,j,z,ee){var de,ve=p&g,Te=p&y,We=p&w;if(T&&(de=z?T(d,j,z,ee):T(d)),de!==n)return de;if(!Sr(d))return d;var $e=an(d);if($e){if(de=Qy(d),!ve)return Ha(d,de)}else{var Ke=Ta(d),mt=Ke==_e||Ke==et;if(Hc(d))return Om(d,ve);if(Ke==Tt||Ke==Fe||mt&&!z){if(de=Te||mt?{}:Pc(d),!ve)return Te?z1(d,pi(de,d)):Uy(d,Xn(de,d))}else{if(!pn[Ke])return z?d:{};de=Ia(d,Ke,ve)}}ee||(ee=new ya);var Nt=ee.get(d);if(Nt)return Nt;ee.set(d,de),fC(d)?d.forEach(function(zt){de.add(no(zt,p,T,zt,d,ee))}):cC(d)&&d.forEach(function(zt,mn){de.set(mn,no(zt,p,T,mn,d,ee))});var Ut=We?Te?Ud:Mh:Te?qo:Ca,cn=$e?n:Ut(d);return wr(cn||d,function(zt,mn){cn&&(mn=zt,zt=d[mn]),Du(de,mn,no(zt,p,T,mn,d,ee))}),de}function Oy(d){var p=Ca(d);return function(T){return kd(T,d,p)}}function kd(d,p,T){var j=T.length;if(d==null)return!j;for(d=Yn(d);j--;){var z=T[j],ee=p[z],de=d[z];if(de===n&&!(z in d)||!ee(de))return!1}return!0}function Sm(d,p,T){if(typeof d!="function")throw new Bo(i);return Lc(function(){d.apply(n,T)},p)}function $i(d,p,T,j){var z=-1,ee=ol,de=!0,ve=d.length,Te=[],We=p.length;if(!ve)return Te;T&&(p=jn(p,It(T))),j?(ee=aa,de=!1):p.length>=a&&(ee=Rt,de=!1,p=new wu(p));e:for(;++zz?0:z+T),j=j===n||j>z?z:un(j),j<0&&(j+=z),j=T>j?0:pC(j);T0&&T(ve)?p>1?_r(ve,p-1,T,j,z):Ro(z,ve):j||(z[z.length]=ve)}return z}var Nd=_m(),lh=_m(!0);function zo(d,p){return d&&Nd(d,p,Ca)}function pl(d,p){return d&&lh(d,p,Ca)}function Ba(d,p){return fi(p,function(T){return Fu(d[T])})}function So(d,p){p=Is(p,d);for(var T=0,j=p.length;d!=null&&Tp}function ml(d,p){return d!=null&&Tn.call(d,p)}function Dm(d,p){return d!=null&&p in Yn(d)}function jy(d,p,T){return d>=ma(p,T)&&d=120&&$e.length>=120)?new wu(de&&$e):n}$e=d[0];var Ke=-1,mt=ve[0];e:for(;++Ke-1;)ve!==d&&Gf.call(ve,Te,1),Gf.call(d,Te,1);return d}function Pd(d,p){for(var T=d?p.length:0,j=T-1;T--;){var z=p[T];if(T==j||z!==ee){var ee=z;Vo(z)?Gf.call(d,z,1):Cu(d,z)}}return d}function jd(d,p){return d+ll(Id()*(p-d+1))}function Nm(d,p,T,j){for(var z=-1,ee=kr(vu((p-d)/(T||1)),0),de=Oe(ee);ee--;)de[j?ee:++z]=d,d+=T;return de}function xc(d,p){var T="";if(!d||p<1||p>ie)return T;do p%2&&(T+=d),p=ll(p/2),p&&(d+=d);while(p);return T}function rn(d,p){return Oh(Ah(d,p,Go),d+"")}function Eu(d){return Vi(Xh(d))}function or(d,p){var T=Xh(d);return To(T,Ts(p,0,T.length))}function ir(d,p,T,j){if(!Sr(d))return d;p=Is(p,d);for(var z=-1,ee=p.length,de=ee-1,ve=d;ve!=null&&++zz?0:z+p),T=T>z?z:T,T<0&&(T+=z),z=p>T?0:T-p>>>0,p>>>=0;for(var ee=Oe(z);++j>>1,de=d[ee];de!==null&&!Di(de)&&(T?de<=p:de=a){var We=p?null:Ya(d);if(We)return sl(We);de=!1,z=Rt,Te=new wu}else Te=p?[]:ve;e:for(;++j=j?d:Sa(d,p,T)}var kc=Ey||function(d){return zn.clearTimeout(d)};function Om(d,p){if(p)return d.slice();var T=d.length,j=mm?mm(T):new d.constructor(T);return d.copy(j),j}function Nc(d){var p=new d.constructor(d.byteLength);return new Dd(p).set(new Dd(d)),p}function Dh(d,p){var T=p?Nc(d.buffer):d.buffer;return new d.constructor(T,d.byteOffset,d.byteLength)}function Hy(d){var p=new d.constructor(d.source,li.exec(d));return p.lastIndex=d.lastIndex,p}function Pm(d){return wo?Yn(wo.call(d)):{}}function jm(d,p){var T=p?Nc(d.buffer):d.buffer;return new d.constructor(T,d.byteOffset,d.length)}function Lm(d,p){if(d!==p){var T=d!==n,j=d===null,z=d===d,ee=Di(d),de=p!==n,ve=p===null,Te=p===p,We=Di(p);if(!ve&&!We&&!ee&&d>p||ee&&de&&Te&&!ve&&!We||j&&de&&Te||!T&&Te||!z)return 1;if(!j&&!ee&&!We&&d=ve)return Te;var We=T[j];return Te*(We=="desc"?-1:1)}}return d.index-p.index}function Rm(d,p,T,j){for(var z=-1,ee=d.length,de=T.length,ve=-1,Te=p.length,We=kr(ee-de,0),$e=Oe(Te+We),Ke=!j;++ve1?T[z-1]:n,de=z>2?T[2]:n;for(ee=d.length>3&&typeof ee=="function"?(z--,ee):n,de&&Fn(T[0],T[1],de)&&(ee=z<3?n:ee,z=1),p=Yn(p);++j-1?z[ee?p[de]:de]:n}}function xu(d){return Gi(function(p){var T=p.length,j=T,z=ga.prototype.thru;for(d&&p.reverse();j--;){var ee=p[j];if(typeof ee!="function")throw new Bo(i);if(z&&!de&&Vd(ee)=="wrapper")var de=new ga([],!0)}for(j=de?j:T;++j1&&Sn.reverse(),$e&&Teve))return!1;var We=ee.get(d),$e=ee.get(p);if(We&&$e)return We==p&&$e==d;var Ke=-1,mt=!0,Nt=T&D?new wu:n;for(ee.set(d,p),ee.set(p,d);++Ke1?"& ":"")+p[j],p=p.join(T>2?", ":" "),d.replace(Aa,`{ +"use strict";var GL=Object.defineProperty;var JL=(e,t,n)=>t in e?GL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>(JL(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("obsidian"),wS=require("@codemirror/language"),Jg=require("@codemirror/state"),$l=require("@codemirror/view");function KL(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $N={exports:{}},gg={},ZN={exports:{}},gn={},xC;function QL(){if(xC)return gn;xC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.iterator;function y(X){return X===null||typeof X!="object"?null:(X=g&&X[g]||X["@@iterator"],typeof X=="function"?X:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,D={};function I(X,oe,De){this.props=X,this.context=oe,this.refs=D,this.updater=De||w}I.prototype.isReactComponent={},I.prototype.setState=function(X,oe){if(typeof X!="object"&&typeof X!="function"&&X!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,X,oe,"setState")},I.prototype.forceUpdate=function(X){this.updater.enqueueForceUpdate(this,X,"forceUpdate")};function M(){}M.prototype=I.prototype;function N(X,oe,De){this.props=X,this.context=oe,this.refs=D,this.updater=De||w}var B=N.prototype=new M;B.constructor=N,S(B,I.prototype),B.isPureReactComponent=!0;var k=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function V(X,oe,De){var je,Re={},Fe=null,Be=null;if(oe!=null)for(je in oe.ref!==void 0&&(Be=oe.ref),oe.key!==void 0&&(Fe=""+oe.key),oe)R.call(oe,je)&&!_.hasOwnProperty(je)&&(Re[je]=oe[je]);var Xe=arguments.length-2;if(Xe===1)Re.children=De;else if(1{const{children:t,store:n,context:r}=e,[a,o]=P.useState(n.getState());return P.useEffect(()=>{const i=n.subscribe(l=>{o(l)});return()=>{i()}},[]),v.jsx(r.Provider,{value:a,children:t})};function t7(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},a)=>{let o=!1;const i={};for(const l of t){const c=r[l],f=n[l](c,a);i[l]=f,o=o||f!==c}return o?i:r}}function n7(e,t){const n=[];let r=e;return{dispatch:l=>{const c=t(r,l),f=r;r=c;for(const h of n)h(r,f)},getState:()=>r,subscribe:l=>{let c=!0;return n.push(l),()=>{if(!c)return;const f=n.indexOf(l);n.splice(f,1),c=!1}}}}function r7(e,t){switch(t.type){case"SET_MARK_MEMO_ID":return t.payload.markMemoId===e.markMemoId?e:{...e,markMemoId:t.payload.markMemoId};case"SET_EDIT_MEMO_ID":return t.payload.editMemoId===e.editMemoId?e:{...e,editMemoId:t.payload.editMemoId};case"SET_GLOBAL_EDITOR_SHOWN":return t.payload.globalEditorShown===e.globalEditorShown?e:{...e,globalEditorShown:t.payload.globalEditorShown};case"SET_COMMENT_MEMO_ID":return t.payload.commentMemoId===e.commentMemoId?e:{...e,commentMemoId:t.payload.commentMemoId};case"SET_MOBILE_VIEW":return t.payload.isMobileView===e.isMobileView?e:{...e,isMobileView:t.payload.isMobileView};case"SET_CHANGED_BY_MEMOS":return t.payload.changedByMemos===e.changedByMemos?e:{...e,changedByMemos:t.payload.changedByMemos};case"SET_REFRESH":return t.payload.refresh===e.refresh?e:{...e,refresh:t.payload.refresh};case"SET_INSTANCE":return{...e,instanceList:e.instanceList.set(t.payload.id,t.payload.instance)};case"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW":return t.payload.showSiderbarInMobileView===e.showSiderbarInMobileView?e:{...e,showSiderbarInMobileView:t.payload.showSiderbarInMobileView};case"SET_MEMO_LIST_VIEW":return t.payload.memoListView===e.memoListView?e:{...e,memoListView:t.payload.memoListView};case"SET_MEMO_PLUGIN_MANIFEST":return{...e,manifest:t.payload.manifest};case"SET_LOADED":return{...e,loaded:t.payload.loaded};case"SET_EXIT_STEPS":return{...e,exited:t.payload.exited};case"SET_LOCKED":return{...e,locked:t.payload.locked};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const a7={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:null,manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map,locked:!1,exited:!1};function o7(e,t){switch(t.type){case"RELOAD":return qN;case"SET_LOCATION":return t.payload;case"SET_PATHNAME":return t.payload.pathname===e.pathname?e:{...e,pathname:t.payload.pathname};case"SET_HASH":return t.payload.hash===e.hash?e:{...e,hash:t.payload.hash};case"SET_QUERY":return{...e,query:{...t.payload}};case"SET_TAG_QUERY":return t.payload.tag===e.query.tag?e:{...e,query:{...e.query,tag:t.payload.tag}};case"SET_DURATION_QUERY":return t.payload.duration===e.query.duration?e:{...e,query:{...e.query,duration:{...e.query.duration,...t.payload.duration}}};case"SET_PATH_QUERY":return t.payload.path===e.query.path?e:{...e,query:{...e.query,path:t.payload.path}};case"SET_TYPE":return t.payload.type===e.query.type?e:{...e,query:{...e.query,type:t.payload.type}};case"SET_TEXT":return t.payload.text===e.query.text?e:{...e,query:{...e.query,text:t.payload.text}};case"SET_QUERY_FILTER":return t.payload===e.query.filter?e:{...e,query:{...e.query,filter:t.payload}};default:return e}}const qN={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",path:"",metadata:{},text:"",filter:""}};var vn={};Object.defineProperty(vn,"__esModule",{value:!0});var Tr=x;const sT="YYYY-MM-DD",lT="gggg-[W]ww",GN="YYYY-MM",JN="YYYY-[Q]Q",KN="YYYY";function Iv(e){var n,r;const t=window.app.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n[e])==null?void 0:r.enabled)}function Ev(){var e,t,n,r;try{const{internalPlugins:a,plugins:o}=window.app;if(Iv("daily")){const{format:f,folder:h,template:g}=((t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:f||sT,folder:(h==null?void 0:h.trim())||"",template:(g==null?void 0:g.trim())||""}}const{folder:i,format:l,template:c}=((r=(n=a.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:l||sT,folder:(i==null?void 0:i.trim())||"",template:(c==null?void 0:c.trim())||""}}catch{}}function Cv(){var e,t,n,r,a,o,i;try{const l=window.app.plugins,c=(e=l.getPlugin("calendar"))==null?void 0:e.options,f=(n=(t=l.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(Iv("weekly"))return{format:f.format||lT,folder:((r=f.folder)==null?void 0:r.trim())||"",template:((a=f.template)==null?void 0:a.trim())||""};const h=c||{};return{format:h.weeklyNoteFormat||lT,folder:((o=h.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((i=h.weeklyNoteTemplate)==null?void 0:i.trim())||""}}catch{}}function xv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:o.format||GN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function Mv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:o.format||JN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function kv(){var t,n,r,a;const e=window.app.plugins;try{const o=Iv("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:o.format||KN,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function QN(...e){let t=[];for(let r=0,a=e.length;r{const N=r(),B=e.clone().set({hour:N.get("hour"),minute:N.get("minute"),second:N.get("second")});return S&&B.add(parseInt(D,10),I),M?B.format(M.substring(1).trim()):B.format(o)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(o)));return t.foldManager.save(g,c),g}catch(g){console.error(`Failed to create file: '${h}'`,g),new Tr.Notice("Unable to create new file.")}}function d7(e,t){return t[Ws(e,"day")]??null}function f7(){const{vault:e}=window.app,{folder:t}=Ev(),n=e.getAbstractFileByPath(Tr.normalizePath(t));if(!n)throw new c7("Failed to find daily notes folder");const r={};return Tr.Vault.recurseChildren(n,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"day");if(o){const i=Ws(o,"day");r[i]=a}}}),r}class h7 extends Error{}function p7(){const{moment:e}=window;let t=e.localeData()._week.dow;const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)n.push(n.shift()),t--;return n}function m7(e){return p7().indexOf(e.toLowerCase())}async function nA(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Cv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*title\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(h,g,y)=>{const w=m7(g);return e.weekday(w).format(y.trim())}));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function g7(e,t){return t[Ws(e,"week")]??null}function v7(){const e={};if(!aA())return e;const{vault:t}=window.app,{folder:n}=Cv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new h7("Failed to find weekly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"week");if(o){const i=Ws(o,"week");e[i]=a}}}),e}class y7 extends Error{}async function rA(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=xv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function w7(e,t){return t[Ws(e,"month")]??null}function b7(){const e={};if(!oA())return e;const{vault:t}=window.app,{folder:n}=xv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new y7("Failed to find monthly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"month");if(o){const i=Ws(o,"month");e[i]=a}}}),e}class S7 extends Error{}async function D7(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Mv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function T7(e,t){return t[Ws(e,"quarter")]??null}function I7(){const e={};if(!iA())return e;const{vault:t}=window.app,{folder:n}=Mv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new S7("Failed to find quarterly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"quarter");if(o){const i=Ws(o,"quarter");e[i]=a}}}),e}class E7 extends Error{}async function C7(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=kv(),[o,i]=await jp(n),l=e.format(r),c=await Nv(a,l);try{const f=await t.create(c,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(h,g,y,w,S,D)=>{const I=window.moment(),M=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return y&&M.add(parseInt(w,10),S),D?M.format(D.substring(1).trim()):M.format(r)}).replace(/{{\s*date\s*}}/gi,l).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,l));return window.app.foldManager.save(f,i),f}catch(f){console.error(`Failed to create file: '${c}'`,f),new Tr.Notice("Unable to create new file.")}}function x7(e,t){return t[Ws(e,"year")]??null}function M7(){const e={};if(!sA())return e;const{vault:t}=window.app,{folder:n}=kv(),r=t.getAbstractFileByPath(Tr.normalizePath(n));if(!r)throw new E7("Failed to find yearly notes folder");return Tr.Vault.recurseChildren(r,a=>{if(a instanceof Tr.TFile){const o=Lp(a,"year");if(o){const i=Ws(o,"year");e[i]=a}}}),e}function k7(){var r,a;const{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;const n=e.plugins.getPlugin("periodic-notes");return n&&((a=(r=n.settings)==null?void 0:r.daily)==null?void 0:a.enabled)}function aA(){var n,r;const{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;const t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function oA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function iA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function sA(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function N7(e){const t={day:Ev,week:Cv,month:xv,quarter:Mv,year:kv}[e];return t()}function A7(e,t){return{day:tA,month:rA,week:nA}[e](t)}vn.DEFAULT_DAILY_NOTE_FORMAT=sT;vn.DEFAULT_MONTHLY_NOTE_FORMAT=GN;vn.DEFAULT_QUARTERLY_NOTE_FORMAT=JN;vn.DEFAULT_WEEKLY_NOTE_FORMAT=lT;vn.DEFAULT_YEARLY_NOTE_FORMAT=KN;var Kg=vn.appHasDailyNotesPluginLoaded=k7;vn.appHasMonthlyNotesPluginLoaded=oA;vn.appHasQuarterlyNotesPluginLoaded=iA;vn.appHasWeeklyNotesPluginLoaded=aA;vn.appHasYearlyNotesPluginLoaded=sA;var lA=vn.createDailyNote=tA;vn.createMonthlyNote=rA;vn.createPeriodicNote=A7;vn.createQuarterlyNote=D7;vn.createWeeklyNote=nA;vn.createYearlyNote=C7;var Ju=vn.getAllDailyNotes=f7;vn.getAllMonthlyNotes=b7;vn.getAllQuarterlyNotes=I7;vn.getAllWeeklyNotes=v7;vn.getAllYearlyNotes=M7;var pb=vn.getDailyNote=d7,Jc=vn.getDailyNoteSettings=Ev,hp=vn.getDateFromFile=Lp;vn.getDateFromPath=u7;vn.getDateUID=Ws;vn.getMonthlyNote=w7;vn.getMonthlyNoteSettings=xv;vn.getPeriodicNoteSettings=N7;vn.getQuarterlyNote=T7;vn.getQuarterlyNoteSettings=Mv;vn.getTemplateInfo=jp;vn.getWeeklyNote=g7;vn.getWeeklyNoteSettings=Cv;vn.getYearlyNote=x7;vn.getYearlyNoteSettings=kv;const F7={},O7={},P7={},j7={},uA={welcome:"Welcome to Thino",ribbonIconTitle:"Thino",to:"to",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekDaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],year:null,month:null,"Basic Options":"Basic options","User name":"User name","Set your user name here. 'Memos 😏' By default":"Set your user name here. 'Thino 😏' By default",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"Insert after heading","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"You should set the same heading below if you want to insert and process thino below the same heading.","Allows admonitions to be created using ":"Allows admonitions to be created using ","Process Memos below":"Process thino below","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.","Save Memo button label":"Save thino button label","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"The text shown on the save Thino button in the UI. 'NOTEIT' by default.","Focus on editor when open memos":"Focus on editor when open thino","Focus on editor when open memos. Focus by default.":"Focus on editor when open thino. Focus by default.","Open daily memos with open memos":"Open daily thino with open thino","Open daily memos with open memos. Open by default.":"Open daily thino with open thino. Open by default.","Open Memos when obsidian opens":"Open Thino when obsidian opens","When enable this, Memos will open when Obsidian opens. False by default.":"When enable this, Thino will open when Obsidian opens. False by default.","Hide done tasks in Memo list":"Hide done tasks in Thino list","Hide all done tasks in Memo list. Show done tasks by default.":"Hide all done tasks in Thino list. Show done tasks by default.","Advanced Options":"Advanced Options","UI language for date":"UI language for date","Translates the date UI language. Only 'en' and 'zh' are available.":"Translates the date UI language. Only 'en' and 'zh' are available.","Default prefix when save thino":"Default prefix when save thino","Set the default prefix when create memo, 'List' by default.":"Set the default prefix when create thino, 'List' by default.","Default insert date format":"Default insert date format","Set the default date format when insert date by @, 'Tasks' by default.":"Set the default date format when insert date by @, 'Tasks' by default.","Default editor position on mobile":"Default editor position on mobile","Set the default editor position on Mobile, 'Top' by default.":"Set the default editor position on Mobile, 'Top' by default.","Use button to show editor on mobile":"Use button to show editor on mobile","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Set a float button to call editor on mobile. Only when editor located at the bottom works.","Show Time When Copy Results":"Show Time When Copy Results","Show time when you copy results, like 12:00. Copy time by default.":"Show time when you copy results, like 12:00. Copy time by default.","Show Date When Copy Results":"Show Date When Copy Results","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Show date when you copy results, like [[2022-01-01]]. Copy date by default.","Add Blank Line Between Different Date":"Add Blank Line Between Different Date","Add blank line when copy result with date. No blank line by default.":"Add blank line when copy result with date. No blank line by default.","Share Options":"Share Options","Share Memos Image Footer Start":"Share Thino Image Footer Start","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default","Share Memos Image Footer End":"Share Thino Image Footer End","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default","Save Shared Image To Folder For Mobile":"Save Shared Image To Folder For Mobile","Save image to folder for mobile. False by Default":"Save image to folder for mobile. False by Default","Say Thank You":"Say Thank You",Donate:"Donate","If you like this plugin, consider donating to support continued development:":"If you like this plugin, consider donating to support continued development:","File Name of Recycle Bin":"File Name of Recycle Bin","Set the filename for recycle bin. 'delete' By default":"Set the filename for recycle bin. 'delete' By default","File Name of Query File":"File Name of Query File","Set the filename for query file. 'query' By default":"Set the filename for query file. 'query' By default","Use Tags In Vault":"Use Tags In Vault","Use tags in vault rather than only in Memos. False by default.":"Use tags in vault rather than only in Thino. False by default.","Ready to convert image into background":"Ready to convert image into background",List:"List",Task:"Task",Top:"Top",Bottom:"Bottom",TAG:"TAG",DAY:"DAY",QUERY:"Query",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE","CONFIRM!":"CONFIRM!","CREATE FILTER":"CREATE FILTER","Comment it...":"Comment it...",Settings:"Settings","Recycle bin":"Recycle bin","About Me":"About Me","Fetching data...":"Fetching data...","Here is No Memos.":"Here is No Thino.","Frequently Used Tags":"Frequently Used Tags","What do you think now...":"What do you think now...",READ:"READ",MARK:"MARK",SHARE:"SHARE",SOURCE:"SOURCE",RESTORE:"RESTORE",ARCHIVE:"Archive","DELETE AT":"DELETE AT","Noooop!":"Noooop!","All Data is Loaded 🎉":"All Data is Loaded 🎉","Quick filter":"Quick filter",TYPE:"TYPE",LINKED:"LINKED","NO TAGS":"NO TAGS","HAS LINKS":"HAS LINKS","HAS IMAGES":"HAS IMAGES",INCLUDE:"INCLUDE",EXCLUDE:"EXCLUDE",TEXT:"TEXT",IS:"IS",AND:"AND",OR:"OR",LIST:"LIST",ISNOT:"ISNOT",PATH:"PATH",METADATA:"METADATA",SELECT:"SELECT","ADD FILTER TERMS":"ADD FILTER TERMS",FILTER:"FILTER",Filter:"Filter",TITLE:"TITLE","CREATE QUERY":"CREATE QUERY","EDIT QUERY":"EDIT QUERY",MATCH:"MATCH",TIMES:"TIMES","Share Memo Image":"Share Thino Image","↗Click the button to save":"↗Click the button to save","Image is generating...":"Image is generating...","Image is loading...":"Image is loading...","Loading...":"Loading...","😟 Cannot load image, image link maybe broken":"😟 Cannot load image, image link maybe broken","Daily Memos":"Daily Thino","CANCEL EDIT":"CANCEL EDIT","LINK TO THE":"LINK TO THE","Mobile Options":"Mobile Options","Experimental Options":"Experimental Options","Don't support web image yet, please input image path in vault":"Don't support web image yet, please input image path in vault","Background Image in Dark Theme":"Background Image in Dark Theme","Background Image in Light Theme":"Background Image in Light Theme",'Set background image in dark theme. Set something like "Daily/one.png"':'Set background image in dark theme. Set something like "Daily/one.png"','Set background image in light theme. Set something like "Daily/one.png"':'Set background image in light theme. Set something like "Daily/one.png"','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Set default thino composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default',"Default Memo Composition":"[Deprecated] Default Thino Composition","Show Tasks Label":"Show Tasks Label","Show tasks label near the time text. False by default":"Show tasks label near the time text. False by default","Please Open Memos First":"Please Open Thino First",DATE:"DATE",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"BEFORE",AFTER:"AFTER","Allow Comments On Memos":"Allow Comments On Thino","You can comment on memos. False by default":"You can comment on thino. False by default",Import:"Import","TITLE CANNOT BE NULL!":"TITLE CANNOT BE NULL!","FILTER CANNOT BE NULL!":"FILTER CANNOT BE NULL!","Comments In Original DailyNotes/Notes":"Comments In Original DailyNotes/Notes","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"You should install Dataview Plugin ver 0.5.9 or later to use this feature.","Open Memos Successfully":"Open Thino Successfully","Fetch Memos Error":"😭 Fetch Error","Copied to clipboard Successfully":"Copied to clipboard Successfully","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin","Please finish the last filter setting first":"Please finish the last filter setting first","Close Memos Successfully":"Close Thino Successfully","Insert as Memo":"Insert as Thino","Insert file as memo content":"Insert file as thino content","Image load failed":"Image load failed","Content cannot be empty":"Content cannot be empty","Unable to create new file.":"Unable to create new file.","Failed to fetch deleted memos: ":"Failed to fetch deleted thino: ","RESTORE SUCCEED":"RESTORE SUCCEED","DELETE SUCCEED":"DELETE SUCCEED","Save Memo button icon":"Save Thino button icon","The icon shown on the save Memo button in the UI.":"The icon shown on the save Thino button in the UI.","Fetch Memos From Particular Notes":"Fetch Thino From Particular Notes",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'You can set any Dataview Query for thino to fetch it. All thino in those notes will show on list. "#memo" by default',"Allow Memos to Fetch Memo from Notes":"Allow Thino to Fetch Thino from Notes","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"Use Thino to manage all thino in your notes, not only in daily notes. False by default","Always Show Memo Comments":"Always Show Thino Comments","Always show memo comments on memos. False by default":"Always show thino comments on thino. False by default","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.","Please check your daily note plugin OR periodic notes plugin settings":"Please check your daily note plugin OR periodic notes plugin settings","Use which plugin's default configuration":"Use which plugin's default configuration","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino use the plugin's default configuration to fetch thino from daily, 'Daily' by default.",Daily:"Daily","Always Show Leaf Sidebar on PC":"Always Show Leaf Sidebar on PC","Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.","fetch more":"fetch more","Search all settings":"Search all settings",General:"General",Theme:"Theme",Share:"Share",Advanced:"Advanced",Thino:"Thino","Random Review":"Random Review","ARCHIVED AT":"ARCHIVED AT","Failed to get memos from daily notes":"Failed to get thino from daily notes","Failed to delete memo":"Failed to delete thino","CTRL + ENTER to save":"CTRL + ENTER to save","Started from":"Started from","Custom Background Image":"Custom Background Image","Set custom background image.":"Set custom background image.","Custom Memo Footer":"Custom Thino Footer","Set custom memo footer.":"Set custom thino footer.","Heatmap Color Scheme":"Heatmap Color Scheme","Set different color scheme for heatmap.":"Set different color scheme for heatmap.","Enable Local Http Server":"Enable Local Http Server","Memos Http Server Port":"Thino Http Server Port","Set memos http server port to listen. '43999' by default":"Set thino http server port to listen. '43999' by default","Default Editor Mode":"Default Editor Mode","Live-Preview Mode OR Source Mode.":"Live-Preview Mode/Source Mode.","Save type for Thino":"Save type for Thino",DAILY:"DAILY",MULTI:"MULTI",CANVAS:"CANVAS",ALL:"ALL",FILE:"FILE",TODO:"TODO",DONE:"DONE",JOURNAL:"JOURNAL",OTHER:"OTHER","Failed to create daily note, check if it exists.":"Failed to create daily note, check if it exists.","Failed to create daily note. Please check if you created a folder for daily notes.":"Failed to create daily note. Please check if you created a folder for daily notes.","After you verify your account, please refresh this page.":"After you verify your account, please refresh this page.",Verify:"Verify","Oops! You forget to verify insider account":"Oops! You forget to verify insider account","If you have any questions, please contact us.":"If you have any questions, please contact us.","Delete Thino Directly":"Delete Thino Directly","When delete thino directly, it will not be moved to trash. False by default.":"When delete thino directly, it will not be moved to trash. False by default.","Enable opening thino globally":"Enable opening thino globally","Enable opening thino globally. False by default.":"Enable opening thino globally. False by default.","Key for opening thino globally":"Key for opening thino globally","Set key for opening thino globally. CTRL + SHIFT + T by default.":"Set key for opening thino globally. CTRL + SHIFT + T by default.","Key for showing thino globally":"Key for showing thino globally","Set key for showing thino globally. CTRL + SHIFT + E by default.":"Set key for showing thino globally. CTRL + SHIFT + E by default.","Get activation code":"Get activation code","Input activation code here":"Input activation code here","Copy Thino id":"Copy Thino id","Activate Pro Version":"Activate Pro Version","Please copy Thino id first":"Please copy Thino id first",'You can set folder name with file name like "folder/file"':'You can set folder name with file name like "folder/file"','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'You can set folder name like "folder1/folder2/folder3" to create sub-folder',"Default save type":"Default save location",'Set the default save type for thino. "DAILY" by default':'Set the default save type for thino. "DAILY" by default',"Sync Thino via PKMer":"Sync Thino via PKMer",Unlink:"Unlink",Link:"Link","Connect to PKMer Sync, you can check it in ":"Connect to PKMer Sync, you can check it in ","PKMer Sync":"PKMer Sync","Remove successfully":"Remove successfully",Deactivate:"Deactivate",Remove:"Remove","Confirm?":"Confirm?","Sync Status":"Sync Status","Start or stop sync":"Start or stop sync","Stop sync successfully":"Stop sync successfully","Start sync successfully":"Start sync successfully",Stop:"Stop",Start:"Start","Show thino near mouse":"Show thino near mouse","Query not found":"Query not found","Send to clipboard successfully":"Send to clipboard successfully","Thino - Failed to start HTTP server, please check the port is available.":"Thino - Failed to start HTTP server, please check the port is available.","Thino - Started HTTP server on port":"Thino - Started HTTP server on port","Thino - Terminated HTTP server":"Thino - Terminated HTTP server","File not exist":"File not exist","Thino not found":"Thino not found","File not found for the given thino path, is creating a new file":"File not found for the given thino path, is creating a new file","Saved sync token successfully":"Saved sync token successfully","Failed to find daily notes folder":"Failed to find daily notes folder","Please install obsidian-hover-editor plugin first":"Please install obsidian-hover-editor plugin first","Copied app id successfully":"Copied app id successfully","Please input token first":"Please input token first","Please enable sync first":"Please enable sync first","Init Failed":"Init Failed","Verify successfully":"Verify successfully","Failed to verify":"Failed to verify","Folder not found for the given thino path, is creating a new folder":"Folder not found for the given thino path, is creating a new folder","File not found for the given thino path":"File not found for the given thino path","Failed to read current daily note, check if it exists.":"Failed to read current daily note, check if it exists.","Failed to save":"Failed to save","Failed to login, please login again":"Failed to login, please login again","COPY FAILED":"COPY FAILED","COPY SUCCEED":"COPY SUCCEED","Copy selected text":"Copy selected text","Copy thino":"Copy thino",COPY:"COPY","This is a pro feature, please upgrade to pro version to use it.":"This is a pro feature, please upgrade to pro version to use it.","You can get pro version from: ":"You can get pro version from: ",Save:"Save",Cancel:"Cancel","Thino Daily Target":"Thino Daily Target",Input:"Input","#Tag":"#Tag","to create tag":"to create tag","You have verified your account. Congrats!":"You have verified your account. Congrats!","Pro features":"Pro features","Target Thino Count":"Target Thino Count",on:"on","Switch waterfall view":"Switch waterfall view","Switch view":"Switch view","Switch list view":"Switch list view","Set daily target":"Set daily target","Thino Save To: ":"Thino Save To: ","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",words:"words","Return To Home Page":"Return Home","Open thino in center window":"Open thino in center window","Open thino in float window":"Open thino in float window","Open thino in right sidebar":"Open thino in right sidebar","Open thino in left sidebar":"Open thino in left sidebar","Show thino editor":"Show thino editor","Toggle minimal mode":"Toggle minimal mode","Focus on thino editor":"Focus on thino editor","ReSync web thinos to local":"ReSync web thinos to local","Sync local thinos to web":"Sync local thinos to web","Show daily thino":"Show daily thino","Focus on search bar":"Focus on search bar","Show-thino in popover(Hover editor)":"Show-thino in popover(Hover editor)","Center window":"Center window","Float window":"Float window","Right sidebar":"Right sidebar","Left sidebar":"Left sidebar","Save thino type when sync local":"Save thino type when sync local","Set the default save thino type when sync local, FILE by default.":"Set the default save thino type when sync local, FILE by default.","Sync service":"Sync service","Pro verification status":"Pro verification status","Live-preview":"Live-preview",Source:"Source","Global copy":"Global copy","Set the folder name":"Set the folder name","Set the filename":"Set the filename","Set the filename for current location file":"Set the filename for current location file","Switch calendar type":"Switch calendar type",alphabetical:"alphabetical",alphabeticalReverse:"alphabeticalReverse",byCount:"byCount",byCountReverse:"byCountReverse","Type here":"Type here",Today:"Today",Yesterday:"Yesterday","Last 7 days":"Last 7 days","Last 30 days":"Last 30 days","Last 90 days":"Last 90 days","Last 180 days":"Last 180 days","Last 365 days":"Last 365 days",Found:"Found","Copy filtered thinos":"Copy filtered thinos","Bulk delete":"Bulk delete","Bulk archive":"Bulk archive","Bulk tag operation":"Bulk tag operation","Bulk restore":"Bulk restore","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.",Preview:"Preview","Set and save":"Set and save","Show day mark in thino list":"Show day mark in thino list","Show day mark on the top of daily range thino. False by default.":"Show day mark on the top of daily range thino. False by default.","Click to expand or fold, Cmd+Click to show all thinos of the day":"Click to expand or fold, Cmd+Click to show all thinos of the day","You can buy a license from":"You can buy a license from","No thinos in range":"No thinos in range",Month:"Month",Week:"Week",Day:"Day",Agenda:"Agenda",Tomorrow:"Tomorrow",Previous:"Previous",Next:"Next","Search all columns...":"Search all columns...","Basic Info":"Basic Info","Additional Info":"Additional Info","Created At":"Created At",Content:"Content","Thino Type":"Thino Type","Source Type":"Source Type","Row status":"Row status",Path:"Path","Pinned Status":"Pinned Status",Table:"Table",Chat:"Chat",Moments:"Moments",Waterfall:"Waterfall",Calendar:"Calendar","Go to page":"Go to page",Page:"Page",Show:"Show",rows:"rows","Temp Filter":"Temp Filter","Open link directly in Thino view":"Open link directly in Thino view","Day mark range":"Day mark range","Set the range of day mark. Day by default.":"Set the range of day mark. Day by default.","Thino is locked":"Thino is locked","Please unlock Thino by input password":"Please unlock Thino by input password","Auto Download Image":"Auto Download Image","Auto download image when save to thino. 'false' by default":"Auto download image when save to thino. 'false' by default","Thino Http IP Type":"Thino Http IP Type","Set Thino http server ip to listen. 'localhost' by default":"Set Thino http server ip to listen. 'localhost' by default","Password to lock Thino":"Password to lock Thino",Unlock:"Unlock",Locked:"Locked","Password is incorrect":"Password is incorrect",Lock:"Lock","Need password to unlock Thino":"Need password to unlock Thino","You have not set a password or enable this feature yet":"You have not set a password or enable this feature yet",Password:"Password","Password for Thino":"Password for Thino","Please input your password to change password settings":"Please input your password to change password settings","Please input your password":"Please input your password","Lock thino":"Lock thino",date:"date",time:"time",event:"event","Add tag position":"Add tag position","Set the position of the tag when adding tag automatically":"Set the position of the tag when adding tag automatically","Add tag automatically":"Add tag automatically","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"Add tag to the end or beginning of the thino content when creating a thino and filtering tags","Add tag with new line":"Add tag with new line","Add tag with new line when adding tag automatically":"Add tag with new line when adding tag automatically","Input to select more tags":"Input to select more tags","Tag Bulk Edit":"Tag Bulk Edit","Tag Bulk Select":"Tag Bulk Select","Exist Tags":"Exist Tags","Selected Tags":"Selected Tags","Click to remove exist tag":"Click to remove exist tag","Click to remove selected tag":"Click to remove selected tag","Select tags":"Select tags","Input to select exist tag":"Input to select exist tag",Beginning:"Beginning",End:"End","Set the heading for saving thino":"Set the heading for saving thino","# Heading":"# Heading","Chat view style":"Chat view style","Set the style of chat view":"Set the style of chat view","Background image for moments view":"Background image for moments view","Set the background image for moments view":"Set the background image for moments view","Icon for moments/chat view/share image":"Icon for moments/chat view/share image","Set the icon for moments/chat view/share image":"Set the icon for moments/chat view/share image","Quote for moments view/share image":"Quote for moments view/share image","Set the quote for moments view/share image":"Set the quote for moments view/share image","Theme for Thino":"Theme for Thino","Set the theme for Thino":"Set the theme for Thino","Interface Details":"Interface Details","Task amount":"Task amount","Thino status":"Thino status","Used tags":"Used tags","Used days":"Used days","Most active day":"Most active day","Most active hour":"Most active hour","Thino amount":"Thino amount","No content to generate.":"No content to generate.","Image generated successfully.":"Image generated successfully.","Failed to generate image.":"Failed to generate image.","Share filtered thinos as image":"Share filtered thinos as image","Latest version":"Latest version","Previous version":"Previous version","Thino update info":"Thino update info","Debug info copied to clipboard":"Debug info copied to clipboard","Copy debug info":"Copy debug info","Failed to load changelog":"Failed to load changelog","View online":"View online",ChangeLog:"ChangeLog","Please open thino first":"Please open thino first","Insert editor":"Insert editor","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.","Default time prefix for thino in daily notes":"Default time prefix for thino in daily notes","Set default time prefix for thino in daily notes.":"Set default time prefix for thino in daily notes.","Save image successfully":"Save image successfully","User quote":"User quote","Set user quote for thino":"Set user quote for thino","User icon":"User icon","Set user icon for thino. You can input http/https link or file path in vault.":"Set user icon for thino. You can input http/https link or file path in vault.","User info":"User info","Copy filtered results":"Copy filtered results","Share image":"Share image",Default:"Default",Gray:"Gray",Grass:"Grass",Flame:"Flame",Olive:"Olive",Ice:"Ice",Magenta:"Magenta","Daily notes":"Daily notes",Editor:"Editor","Append/prepend text when share to Thino":"Append/prepend text when share to Thino","Append text when share to Thino":"Append text when share to Thino","Prepend text when share to Thino":"Prepend text when share to Thino","Add newline when append/prepend text":"Add newline when append/prepend text","Input anything here":"Input anything here",Prepend:"Prepend",Append:"Append",Both:"Both",None:"None","Hide pinned group":"Hide pinned group","Hide pinned group in thino list. False by default.":"Hide pinned group in thino list. False by default.","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.","Different insert target for different type":"Different insert target for different type","Toggle this to set different insert target for different type of thino, like task or list type of thino":"Toggle this to set different insert target for different type of thino, like task or list type of thino","You can set whole diary or only part of it":"You can set whole diary or only part of it","Set process target":"Set process target",Custom:"Custom","Whole diary":"Whole Diary","Set thino insert place":"Set thino insert place","Set where to insert thino content":"Set where to insert thino content","End of the diary":"End of the diary","Custom location":"Custom location","Setting guide":"User setting guide","Details settings":"Details settings","Start Thino":"Start Thino","About Thino Pro":"About Thino Pro",Enabled:"Enabled",Enable:"Enable","Daily notes folder":"Daily notes folder","Set daily notes folder":"Set daily notes folder","Daily note name format":"Daily note name format","Set daily note name format":"Set daily note name format","Daily note plugin":"Daily note plugin","Enable daily note plugin":"Enable daily note plugin",Selected:"Selected",Select:"Select","A classic theme for Thino with a two-column layout":"A classic theme for Thino with a two-column layout",Classic:"Classic","A modern theme for Thino with a three-column layout and some unique features.":"A modern theme for Thino with a three-column layout and some unique features.",Modern:"Modern","Go and enjoy Thino":"Go and enjoy Thino","Congrats! All settings done":"Congrats! All settings done","Adjust settings that influence your user experience with Thino.":"Adjust settings that influence your user experience with Thino.","Set preferences for using Thino":"Set preferences for using Thino","If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.","Go with daily note plugin":"Go with daily note plugin","Choose a theme for Thino.":"Choose a theme for Thino.","Set theme for Thino":"Set theme for Thino","Set up your user info for Thino.":"Set up your user info for Thino.","Get started with Thino":"Get started with Thino","Skip and start Thino":"Skip and start Thino","Next step":"Next step","Back to previous step":"Back to previous step","Click to enable =>":"Click to enable =>","This is Thino's sidebar. Navigate to different path or select query filter.":"This is Thino's sidebar. Navigate to different path or select query filter.","Click here and go to settings page.":"Click here and go to settings page.","Click here and go to different path.":"Click here and go to different path.","Select or create query filter here.":"Select or create query filter here.","See the status of Thinos here.":"See the status of Thinos here.","Search your thino quickly here.":"Search your thino quickly here.","Edit or create your thino here.":"Edit or create your thino here.","See your thinos here.":"See your thinos here.","See your time status of thinos here.":"See your time status of thinos here.","See your tags here. Tags will be shown when thino contains tags.":"See your tags here. Tags will be shown when thino contains tags.",Done:"Done","Thino is ready to use. ":"Thino is ready to use. ","You can start using Thino now. If you want to know more about Thino Pro, click the button below.":"You can start using Thino now. If you want to know more about Thino Pro, click the button below.","Default time prefix":"Default time prefix","Append Text Action":"Append Text Action","Prepend Text Action":"Prepend Text Action",Preset:"Preset","Select Tags":"Select Tags","It is not available on small view":"It is not available on small view","Append text":"Append text","Prepend text":"Prepend text","Your daily note folder is not set correctly, please check your settings":"Your daily note folder is not set correctly, please check your settings","Default sharing style":"Default sharing style","Set the default style for sharing thino, 'Modern' by default.":'Set the default style for sharing thino, "Modern" by default.',Clean:"Clean",Minimal:"Minimal",Gradient:"Gradient","Thino share":"Thino share","Copy to clipboard failed":"Copy to clipboard failed","Copy to clipboard successfully":"Copy to clipboard successfully","Your content has been copied to clipboard, and inserted into the editor. Please try it again":"Your content has been copied to clipboard, and inserted into the editor. Please try it again","Share thino":"Share thino","Set file name after create thino":"Set file name after create thino","You can set file name after create thino. A input box will show when you create thino.":"You can set file name after create thino. A input box will show when you create thino.",SPLIT:"SPLIT","Split by Heading 1":"Split by Heading 1","Split by Heading 2":"Split by Heading 2","Split by Heading 3":"Split by Heading 3","Insert task":"Insert task","All settings have been reset to default.":"All settings have been reset to default.","Reset all Thino settings":"Reset all Thino settings","Reset settings":"Reset settings","Reset Thino settings to default settings.":"Reset Thino settings to default settings.","Task Management":"Task Management","Append completed date when task done in thino":"Append completed date when task done in thino","Append completed date when task done in thino. False by default":"Append completed date when task done in thino. False by default","Set tag for single file that Thino indexes":"Set tag for single file that Thino indexes","When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":"Set tag for file type file","Set tag for multi type file":"Set tag for multi type file","Please input the tag":"Please input the tag","Merge thinos in to thino share image":"Merge thinos in to thino share image","Custom height for Thino content":"Custom height for Thino content","Set custom height for Thino content. Like 200px or 20rem":"Set custom height for Thino content. Like 200px or 20rem","Input height":"Input height","Submit issue":"Submit issue","Current version":"Current version","Bug report":"Bug report","Click the button to copy debug info and open the issue page":"Click the button to copy debug info and open the issue page","Copy and go":"Copy and go","Debug info copied":"Debug info copied","Feature request":"Feature request","Submit your feature request to the issue page":"Submit your feature request to the issue page",Go:"Go","Toggle query list visibility":"Toggle query list visibility","Toggle tags visibility":"Toggle tags visibility","Toggle sidebar visibility":"Toggle sidebar visibility",Collapse:"Collapse",Expand:"Expand","Max height for collapse":"Max height for collapse","The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)","Render content":"Render content","Optimize for Callout":"Optimize for Callout","Won't render content contains more than 3 callouts automatically. True by default":"Won't render content contains more than 3 callouts automatically. True by default","The value should be greater than":"The value should be greater than","Append Text":"Append Text","Prepend Text":"Prepend Text","Thino height when collapsed":"Thino height when collapsed","The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":"The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)","This option will allow you use other views when leaf width is not enough. False by default.":"This option will allow you use other views when leaf width is not enough. False by default.","Can select other views when leaf width is not enough":"Can select other views when leaf width is not enough","TRASH BOX":"TRASH BOX","Wait templater to finish parse before insert thino":"Wait templater to finish parse before insert thino","This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.","Get thino capture extension":"Get thino capture extension","You can capture idea/text from chrome now.":"You can capture idea/text from chrome now.","Open File":"Open File","Exported CSV file":"Exported CSV file","Updated At":"Updated At","Export to CSV":"Export to CSV","Quick add button on mobile navbar":"Quick add button on mobile navbar","Always show status text":"Always show status text","Support filter by metadata from file":"Support filter by metadata from file","When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.","Show source near timestamp in thino":"Show source near timestamp in thino","When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.","Show Update Message":"Show Update Message","Show update message when Thino is updated. True by default":"Show update message when Thino is updated. True by default","Sync manually":"Sync manually","Show all scrollbars":"Show all scrollbars","TIME RANGE":"TIME RANGE",WITHIN:"WITHIN","7 days":"7 days","14 days":"14 days","30 days":"30 days","3 months":"3 months","6 months":"6 months","1 year":"1 year","This week":"This week","Last week":"Last week","This month":"This month","Last month":"Last month","This year":"This year","Last year":"Last year"},L7={},R7={},_7={welcome:"Bienvenue dans Mémo !",ribbonIconTitle:"Mémos",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekDaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],to:"à",year:null,month:null,"Basic Options":"Options basique","User name":"Username","Set your user name here. 'Memos 😏' By default":"Définissez votre username ici. Défaut : 'Memo 😏'","Insert after heading":"Insérer après le titre","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Vous devez définir le même titre en-dessous si vous voulez insérer et traiter des mémos sous le même titre.","Allows admonitions to be created using ":"Permet de créer des admonitions en utilisant","Process Memos below":"Insérer Mémo sous","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Seulement les entrée sous cette section/phrase dans vos notes seront considérés. S'il n'existe pas, aucune notes ne sera traité pour ce fichier.","Save Memo button label":"Titre du bouton de sauvegarde","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"Le texte affiché sur le bouton de sauvegarde dans l'UI. Défaut : 'NOTEIT'","Focus on editor when open memos":"Focus sur l'éditeur lors de l'ouverture du mémo.","Focus on editor when open memos. Focus by default.":"Focus sur l'éditeur lors de l'ouverture du mémo. Focus par défaut.","Open daily memos with open memos":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open daily memos with open memos. Open by default.":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open Memos when obsidian opens":"Ouvrir Mémo quand Obsidian est ouvert.","When enable this, Memos will open when Obsidian opens. False by default.":"Quand activé, Memo sera ouvert quand Obsidian à l'ouverture d'Obsidian. Désactivé par défaut.","Hide done tasks in Memo list":"Masquer les tâches accomplies dans la liste des mémos.","Hide all done tasks in Memo list. Show done tasks by default.":"Masquer les tâches accomplies dans les mémos. Affiche les tâches accomplies par défaut.","Advanced Options":"Options avancées","UI language for date":"Langue de l'UI pour la date","Translates the date UI language. Only 'en' and 'zh' are available.":"Traduit la langue des dates dans l'UI. Seuls 'en', 'fr' et 'zh' sont disponibles. ","Default prefix":"Préfix par défaut.","Set the default prefix when create memo, 'List' by default.":"Définit le préfix par défaut lors de la création d'un mémo. Défault : 'Liste'","Default insert date format":"Format de la date insérée par défaut.","Default editor position on mobile":"Position par défaut de l'éditeur sur mobile.","Set the default date format when insert date by @, 'Tasks' by default.":"Définit le format de la date par défaut lors de l'insertion de la date par @. Défaut : 'Tâches'.","Set the default editor position on Mobile, 'Top' by default.":"Position par défaut de l'éditeur sur le mobile. Défaut : 'Haut'.","Use button to show editor on mobile":"Utilisation du bouton pour afficher l'éditeur sur le mobile.","Show Time When Copy Results":"Aficher l'heure quand les résultats sont copiés","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Place un bouton flottant pour appeler l'éditeur sur mobile. Fonctionne uniquement quand l'éditeur est placé en bas.","Show time when you copy results, like 12:00. Copy time by default.":"Affiche l'heure quand les résultats sont copiés, comme '12:00'. Copie l'heure par défaut","Show Date When Copy Results":"Affiche la date quand les résultats sont copiés","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Affiche la date quand les résultats sont copiés, comme [[2022-01-01]]. Par défaut, copie la date.","Add Blank Line Between Different Date":"Ajoute une ligne entre les différentes dates.","Add blank line when copy result with date. No blank line by default.":"Ajoute une ligne lors de la copie du résultat avec la date. Pas de ligne par défaut.","Share Options":"Options de partage","Share Memos Image Footer Start":"Début du pied de page — Partage de mémo de mémos","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Définissez ce que vous voulez ici, utilisez {ThinoNum} pour afficher le nombre de thino, {UsedDay} pour les jours. Par défaut : '{ThinoNum} Thino {UsedDay} Days.","Share Memos Image Footer End":"Fin du pied de page — Partage de mémo","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Définissez ce que vous voulez ici. Utilisez {UserName} comme username. Par défaut : '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"Sauvegarde des images partagés dans un dossier sur mobile.","Save image to folder for mobile. False by Default":"Sauvegarder les images dans un dossier sur mobile. Désactivé par défaut.","Say Thank You":"Dites Merci",Donate:"Faire un don","If you like this plugin, consider donating to support continued development:":"Si vous aimez ce plugin, envisagez de faire un don pour soutenir le développement continu :","File Name of Recycle Bin":"Nom de la corbeille","Set the filename for recycle bin. 'delete' By default":"Définition du nom de la poubelle. Défaut : 'Delete'","Set the filename for query file. 'query' By default":"Définit le nom de fichier pour les requête. Défaut : 'Query'","Use Tags In Vault":"Utiliser des tags dans le Coffre","Use tags in vault rather than only in Memos. False by default.":"Utiliser des tags du coffre plutôt que ceux que seulement dans Mémo. Désactivé par défaut.","Ready to convert image into background":"Prêt pour convertir des image en arrière-plan.",List:"Liste",Task:"Tâche",Top:"Haut",Bottom:"Bas",TAG:"TAG",DAY:"JOUR",QUERY:"RECHERCHE",EDIT:"EDITER",PIN:"PIN",UNPIN:"ÉPINGLER",DELETE:"DESÉPINGLER","CONFIRM!":"CONFIRMER !","CREATE FILTER":"CRÉER FILTRE",Settings:"Paramètres","Recycle bin":"Corbeille","About Me":"À propos de moi","Fetching data...":"Récupération des données...","Here is No Memos.":"Il n'y a pas de Memos.","Frequently Used Tags":"Tags fréquemment utilisés","What do you think now...":"Que pensez-vous maintenant...",READ:"LU",MARK:"MARQUER",SHARE:"PARTAGER",SOURCE:"SOURCE",RESTORE:"RESTAURER","DELETE AT":"SUPPRIMER","Noooop!":"Noooop!","All Data is Loaded 🎉":"Toutes les données sont chargées 🎉","Quick filter":"Filtre rapide",TYPE:"TYPE",LINKED:"LIEN","NO TAGS":"PAS DE TAGS","HAS LINKS":"A DES LIENS","HAS IMAGES":"A DES IMAGES",INCLUDE:"INCLUS",EXCLUDE:"EXCLUS",TEXT:"TEXTE",IS:"EST",ISNOT:"N'EST PAS",SELECT:"SELECTION","ADD FILTER TERMS":"AJOUTER DES TERMES FILTRÉ",FILTER:"FILTRE",TITLE:"TITRE","CREATE QUERY":"CRÉER UNE RECHERCHE","EDIT QUERY":"ÉDITER UNE RECHERCHE",MATCH:"MATCH",TIMES:"HEURE","Share Memo Image":"Partager un mémo image","↗Click the button to save":"↗Clique pour sauvegarder","Image is generating...":"Génération de l'image...","Image is loading...":"Image en chargement...","Loading...":"Chargement...","😟 Cannot load image, image link maybe broken":"😟 Impossible de charger l'image, le lien peut être brisé","Daily Memos":"Mémo quotidien","CANCEL EDIT":"ANNULER L'ÉDITION","LINK TO THE":"LIENS À","Mobile Options":"Options mobile","Don't support web image yet, please input image path in vault":"Ne supporte pas les images webs. Merci d'insérer le chemin de l'image depuis le coffre.","Background Image in Dark Theme":"Image de fond en thème sombre","Background Image in Light Theme":"Image de fond en thème clair",'Set background image in dark theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème sombre. Définir 'Daily/one.png' par exemple.",'Set background image in light theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème clair. Définir 'Daily/one.png' par exemple.",'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Définir la composition par défaut du mémo, vous devez utiliser {TIME} comme "HH:mm" et {CONTENT} comme contenu. "{TIME} {CONTENT}" par défaut',"Default Memo Composition":"Composition par défaut du mémo","Show Tasks Label":"Afficher les étiquettes des tâches","Show tasks label near the time text. False by default":"Afficher les étiquettes des tâches à côté du texte horaire. Désactivé par défaut.","Please Open Memos First":"Merci d'ouvrir les mémos en premier"},B7={},H7={},U7={},Y7={},z7={},V7={},W7={},$7={},Z7={welcome:"Bem-vindo ao Thino!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},q7={welcome:"Bem-vindo ao Memos!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of memos, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},G7={},J7={},K7={},Q7={welcome:"欢迎使用 Thino ",ribbonIconTitle:"Thino",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:[null,null,null,null,null,null,null,null,null,null,null,null],weekDays:["周日","周一","周二","周三","周四","周五","周六"],weekDaysShort:["周日","周一","周二","周三","周四","周五","周六"],to:"至",year:"年",month:"月","Basic Options":"基础选项","User name":"用户名","Set your user name here. 'Memos 😏' By default":"在这里设置你喜欢的用户名。 默认为 'Thino 😏'",'You can set target heading like "# Heading" to control data location':'你可以设置目标标题,例如 "# Heading" 来控制数据的位置',"Insert after heading":"在指定标题后插入 Thino","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"若留空,则记录的 thino 内容在日记末尾插入,若填写标题,则记录的 thino 内容统一都记录在该标题下","Process Memos below":"解析指定标题后的 Thino","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"若留空,则在Thino界面会显示所有thino记录内容,若填写标题,则Thino界面只显示该标题下的内容,写入其他位置的内容不显示","Save Memo button label":"保存按钮上的文本","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"在保存按钮上展示的文本。默认为 'NOTEIT'","Focus on editor when open memos":"自动聚焦到 Thino 输入框","Focus on editor when open memos. Focus by default.":"当打开 Thino 的时候自动聚焦到 Thino 输入框。默认开启","Open daily memos with open memos":"打开每日 Thino 的时候打开 Thino 界面","Open daily memos with open memos. Open by default.":"打开每日 Thino 的时候打开 Thino 界面。默认开启","Open Memos when obsidian opens":"当开启 Obsidian 的时候自动打开 Thino","When enable this, Memos will open when Obsidian opens. False by default.":"当开启该选项, Thino 会在 Obsidian 打开时自动打开。默认不开启。","Hide done tasks in Memo list":"在 Thino 列表中隐藏已完成 Thino","Hide all done tasks in Memo list. Show done tasks by default.":"在 Thino 列表中隐藏已完成 Thino。默认不开启","Advanced Options":"进阶选项","UI language for date":"针对日期展示的语言界面","Translates the date UI language. Only 'en' and 'zh' are available.":"对日期的不同翻译。目前只能选择 'en' 和 'zh'(未来会废置)","Default prefix when save thino":"保存 Thino 时的默认前缀","Set the default prefix when create memo, 'List' by default.":"设置默认的前缀样式。默认为列表","Default insert date format":"插入日期附带的样式","Set the default date format when insert date by @, 'Tasks' by default.":"当使用 @ 来快速插入日期时,插入日期附带的样式,默认为 'Tasks' 样式","Default editor position on mobile":"在移动端上的默认编辑器位置","Set the default editor position on Mobile, 'Top' by default.":"设置在移动端上的默认编辑器位置,默认在顶部。","Use button to show editor on mobile":"当编辑器位置在底部时,用按钮来唤出编辑器","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"设置一个浮动按钮来唤出编辑器。当在移动端上启用该选项才会生效","Show Time When Copy Results":"当复制检索结果时附带时间","Show time when you copy results, like 12:00. Copy time by default.":"在复制检索结果时附带其时间,例如 12:00 。默认开启","Show Date When Copy Results":"当复制检索结果时附带日期","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"在复制检索结果时附带其日期,例如 [[2022-01-01]]。默认开启","Add Blank Line Between Different Date":"在复制日期的时候加上空行","Add blank line when copy result with date. No blank line by default.":"在复制日期的时候在相邻的日期之间加上空行。默认无空行","Share Options":"分享选项","Share Memos Image Footer Start":"分享 Thino 图片的左边页脚","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"你可以在这里设置你想要的任意文本,用 {ThinoNum} 来展示你记录的 thino 数量,{UsedDay} 来展示使用日期。默认为'{ThinoNum} Thino {UsedDay} Days'","Share Memos Image Footer End":"分享 Thino 图片的右边页脚","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"你可以在这里设置你想要的任意文本,用 {UserName} 来展示你的用户名。默认为 '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"当在移动端上时保存图片到文件夹","Save image to folder for mobile. False by Default":"当在移动端上时,保存生成的图片到文件夹","Say Thank You":"感谢开发",Donate:"捐赠","If you like this plugin, consider donating to support continued development:":"如果你喜欢这个插件,而且也希望给我买鸡腿,那么可以考虑 Github 页面右边的 Sponsor~","File Name of Recycle Bin":"回收站的文件名","Set the filename for recycle bin. 'delete' By default":"给回收站设置一个文件名。默认为'delete'","File Name of Query File":"检索文件的文件名","Set the filename for query file. 'query' By default":"设置存放检索式的文件的文件名。默认为'query'","Use Tags In Vault":"使用在库内的所有标签","Use tags in vault rather than only in Memos. False by default.":"使用在库内的而不是 Thino 内的标签。默认关闭","Don't support web image yet, please input image path in vault":"暂不支持网络图片,请使用本地图片","Ready to convert image into background":"正在将图片转换为背景图",List:"列表",Task:"任务",Top:"顶部",Bottom:"底部",TAG:"标签",DAY:"天",QUERY:"检索式",EDIT:"编辑",PIN:"置顶",UNPIN:"取消置顶",DELETE:"删除","CONFIRM!":"确定删除","CREATE FILTER":"创建检索式",Filter:"筛选",Settings:"设置","Recycle bin":"回收站","About Me":"关于","Fetching data...":"获取数据中...","Here is No Memos.":"没有找到 Thino","Frequently Used Tags":"常用标签","What do you think now...":"你现在在想什么?",READ:"阅读",MARK:"引用",SHARE:"分享",SOURCE:"来源",RESTORE:"恢复",ARCHIVE:"归档","DELETE AT":"删除于","Noooop!":"啥都没有!","All Data is Loaded 🎉":"所有数据都加载好啦 🎉","Quick filter":"快速筛选",TYPE:"类型",LINKED:"有链接","NO TAGS":"无标签","HAS LINKS":"有超链接","HAS IMAGES":"有图片",INCLUDE:"包括",EXCLUDE:"排除",TEXT:"文本",IS:"是",AND:"和",OR:"或",LIST:"状态",ISNOT:"不是",SELECT:"选择",PATH:"路径",METADATA:"元数据","ADD FILTER TERMS":"添加检索条件",FILTER:"筛选器",TITLE:"标题","CREATE QUERY":"创建检索式","EDIT QUERY":"编辑检索式",MATCH:"匹配",TIMES:"次","Share Memo Image":"分享 Thino 图片","↗Click the button to save":"↗点击右上角的按钮来保存","Image is generating...":"图片正在生成中...","Image is loading...":"图片正在加载中...","😟 Cannot load image, image link maybe broken":"😟 无法加载图片,图片链接也许不存在","Loading...":"努力加载中...","Daily Memos":"每日 Thino","CANCEL EDIT":"取消编辑","LINK TO THE":"链接到","Mobile Options":"移动端选项","Experimental Options":"实验性选项","Background Image in Dark Theme":"深色主题的背景图","Background Image in Light Theme":"浅色主题的背景图",'Set background image in dark theme. Set something like "Daily/one.png"':'设置深色主题的背景图。请设置类似"Daily/one.png"的路径','Set background image in light theme. Set something like "Daily/one.png"':'设置浅色主题的背景图。请设置类似"Daily/one.png"的路径','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'设置默认 Thino 组成,你必须要使用 {TIME} 作为 "HH:mm" 而且要设置 {CONTENT} 作为内容识别。默认情况下, Thino 基于 "{TIME} {CONTENT}" 识别',"Default Memo Composition":"【已弃置】默认 Thino 组成","Show Tasks Label":"展示任务标签","Show tasks label near the time text. False by default":"在 Thino 的时间旁展示任务标签。默认情况下不展示","Please Open Memos First":"请先打开 Thino","Comment it...":"评论...",DATE:"日期",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"Obsidian Natrual DATES language 插件没启动",BEFORE:"在之前",AFTER:"在之后","Allow Comments On Memos":"允许在 Thino 上评论","You can comment on memos. False by default":"你可以在 Thino 点击图标进行评论了。默认不开启",Import:"导入","TITLE CANNOT BE NULL!":"标题不可以为空!","FILTER CANNOT BE NULL!":"筛选器不可以为空!","Comments In Original DailyNotes/Notes":"在原文件中进行评论","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"你需要安装 0.5.9 版本以上的 Dataview 插件来使用该功能","Open Memos Successfully":"成功打开 Thino ","Fetch Memos Error":"😭 Thino 获取失败","Copied to clipboard Successfully":"复制成功","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"请检查你有没有开启日记插件或者 Periodic Notes 插件且启用了日记模式","Please finish the last filter setting first":"先完善上一个过滤器吧","Close Memos Successfully":"成功关闭 Thino ","Insert as Memo":"插入内容为 Thino","Insert file as memo content":"插入文件为 Thino","Image load failed":"有个图片加载失败了😟","Content cannot be empty":"内容不能为空呀","Unable to create new file.":"无法新建文件","Failed to fetch deleted memos: ":"无法获取已删除的 Thino :","RESTORE SUCCEED":"成功恢复 Thino","DELETE SUCCEED":"删除成功","Save Memo button icon":"保存按钮上的图标","The icon shown on the save Memo button in the UI.":"你可以设置保存按钮上的图标","Fetch Memos From Particular Notes":"从指定的文件中获取 Thino",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'你可以给笔记设置指定检索式来让 Memos 可以索引到它。默认为 "#memo" ',"Allow Memos to Fetch Memo from Notes":"允许 Thino 从笔记中获取 Thino","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"使用 Memos 来管理你笔记中的 Memos,不单只 DailyNotes 中的内容。默认为关闭","Always Show Memo Comments":"评论将总是可见","Always show memo comments on memos. False by default":"当开启后评论总是会在 Thino 的下方展示。默认为关闭","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的所在文件夹","Please check your daily note plugin OR periodic notes plugin settings":"请检查你的日记插件和/或 Periodic Notes 插件的设置","Use which plugin's default configuration":"使用哪个插件的默认日记配置","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino 采用指定插件的默认配置来获取 Thino。默认为日记插件。",Daily:"日记插件","Always Show Leaf Sidebar on PC":"在 PC 上总是展示左侧栏","Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":"在 PC 或平板上即使页面宽度小于 875px 时都展示左侧栏。默认为关闭","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的格式","fetch more":"加载更多","Search all settings":"搜索所有设置","Random Review":"随机回顾","ARCHIVED AT":"归档于","Failed to get memos from daily notes":"无法从日记中获取 Thino","Failed to delete memo":"无法删除 Thino","CTRL + ENTER to save":"CTRL + ENTER 保存","Started from":"开始于","Custom Background Image":"自定义背景图","Set custom background image.":"设置自定义背景图","Custom Memo Footer":"自定义 Thino 页脚","Set custom memo footer.":"设置自定义 Thino 页脚","Heatmap Color Scheme":"热力图颜色","Set different color scheme for heatmap.":"设置热力图的颜色","Enable Local Http Server":"启用本地 HTTP 服务器","Memos Http Server Port":"Thino HTTP 服务器端口","Set memos http server port to listen. '43999' by default":"设置 Thino HTTP 服务器端口。默认为 '43999'","Live-Preview Mode OR Source Mode.":"基于 Thino 的所见即所得模式(默认) 或者 源码模式,你可以自己选择适合自己的输入体验。","Default Editor Mode":"默认编辑器模式","Save type for Thino":"Thino 保存类型",DAILY:"日记",MULTI:"多文件",CANVAS:"画布",FILE:"单文件",ALL:"所有","Failed to create daily note, check if it exists.":"无法创建日记,请检查是否存在文件夹","Failed to create daily note. Please check if you created a folder for daily notes.":"无法创建日记,请检查是否存在日记文件夹","After you verify your account, please refresh this page.":"验证成功后,请刷新页面。",Verify:"去验证","Oops! You forget to verify insider account":"内测账户验证失败","If you have any questions, please contact us.":"如果你有任何问题,请联系我们。","Delete Thino Directly":"直接删除 Thino","When delete thino directly, it will not be moved to trash. False by default.":"当直接删除 Thino 时,不会移动到回收站。默认为关闭","Get activation code":"获取激活码","Input activation code here":"在这里输入激活码","Copy Thino id":"获取 Thino id","Activate Pro Version":"激活专业版","Please copy Thino id first":"请先获取 Thino id",'You can set folder name with file name like "folder/file"':'你可以设置例如 "folder/file" 的文件夹名+文件名的搭配来存放在指定文件夹','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'你可以设置例如 "folder1/folder2/folder3" 的文件夹名来创建子文件夹',"Default save type":"默认保存类型",'Set the default save type for thino. "DAILY" by default':'设置 Thino 的默认保存类型。默认为 "日记"',"Enable opening thino globally":"全局唤醒 Thino","Enable opening thino globally. False by default.":"全局唤醒 Thino。默认为关闭","Key for opening thino globally":"全局唤醒 Thino 的快捷键","Set key for opening thino globally. CTRL + SHIFT + T by default.":"设置全局唤醒 Thino 的快捷键。默认为 CTRL + SHIFT + T","Sync Thino via PKMer":"通过 PKMer 同步 Thino",Unlink:"取消链接",Link:"链接","Connect to PKMer Sync, you can check it in ":"连接到 PKMer 同步,你可以在该链接中查看:","PKMer Sync":"PKMer 同步","Remove successfully":"移除成功",Deactivate:"取消激活",Remove:"移除","Confirm?":"确认?","Sync Status":"同步状态","Start or stop sync":"开始或停止同步","Stop sync successfully":"停止同步成功","Start sync successfully":"开始同步成功",Stop:"停止",Start:"开始","Show thino near mouse":"在鼠标附近展示 Thino","Query not found":"检索式未找到","Send to clipboard successfully":"发送到剪贴板成功","Thino - Failed to start HTTP server, please check the port is available.":"Thino - 启动 HTTP 服务器失败,请检查端口是否可用。","Thino - Started HTTP server on port":"Thino - 启动 HTTP 服务器成功,端口为","Thino - Terminated HTTP server":"Thino - 终止 HTTP 服务器","File not exist":"文件不存在","Thino not found":"Thino 未找到","File not found for the given thino path, is creating a new file":"未找到承载指定 Thino 的文件,正在创建新文件","Saved sync token successfully":"保存同步令牌成功","Failed to find daily notes folder":"未找到日记文件夹","Please install obsidian-hover-editor plugin first":"请先安装 obsidian-hover-editor 插件","Copied app id successfully":"复制 app id 成功","Please input token first":"请先输入 token","Please enable sync first":"请先启用同步","Init Failed":"初始化失败","Folder not found for the given thino path, is creating a new folder":"未找到承载指定 Thino 的文件夹,正在创建新文件夹","File not found for the given thino path":"未找到承载指定 Thino 的文件","Failed to read current daily note, check if it exists.":"无法读取日记文件,请检查是否存在","Verify successfully":"验证成功","Failed to verify":"验证失败","Failed to save":"保存失败","Failed to login, please login again":"登录已过期,请重新登录","COPY FAILED":"复制失败","COPY SUCCEED":"复制成功","Copy selected text":"复制选中文本","Copy thino":"复制",COPY:"复制","This is a pro feature, please upgrade to pro version to use it.":"这是专业版功能,请升级到专业版来使用它。","You can get pro version from: ":"你可以从这里获取专业版:",Save:"保存",Cancel:"取消","Thino Daily Target":"Thino 每日目标",Input:"输入","#Tag":"#标签","to create tag":"来创建标签","You have verified your account. Congrats!":"你已经验证了你的账户。恭喜!","Pro features":"专业版功能","Target Thino Count":"目标 Thino 数量",on:"在","Switch waterfall view":"切换瀑布流视图","Switch view":"切换视图","Switch list view":"切换列表视图","Set daily target":"设置每日目标","Thino Save To: ":"Thino 保存到:","Enter fullscreen mode":"进入全屏模式","Exit fullscreen mode":"退出全屏模式",words:"字词","Return To Home Page":"返回首页","Open thino in center window":"在中心窗口打开 thino","Open thino in float window":"在浮动窗口打开 thino","Open thino in right sidebar":"在右侧边栏打开 thino","Open thino in left sidebar":"在左侧边栏打开 thino","Show thino editor":"显示 thino 编辑器","Toggle minimal mode":"切换 Minimal 模式","Focus on thino editor":"聚焦到 thino 编辑器","ReSync web thinos to local":"重新同步 web 上的 thino 到本地","Sync local thinos to web":"同步本地的 thino 到 web","Show daily thino":"显示每日 thino 视图","Focus on search bar":"聚焦到搜索栏","Show-thino in popover(Hover editor)":"在弹出框中显示 thino","Center window":"中心窗口","Float window":"浮动窗口","Right sidebar":"右侧边栏","Left sidebar":"左侧边栏","Save thino type when sync local":"同步本地时保存的 thino 类型","Set the default save thino type when sync local, FILE by default.":"设置同步本地时保存的 thino 类型,默认为单文件。","Sync service":"同步服务","Pro verification status":"专业版激活状态","Live-preview":"所见即所得",Source:"源码",General:"通用",Thino:"Thino",Theme:"主题",Share:"分享",Interface:"界面",Advanced:"进阶","Global copy":"全局复制","Set the folder name":"设置文件夹名","Set the filename":"设置文件名","Set the filename for current location file":"设置当前位置文件的文件名","Switch calendar type":"切换日历类型",alphabetical:"标签名称(A-Z)",alphabeticalReverse:"标签名称(Z-A)",byCount:"按使用次数(从高到低)",byCountReverse:"按使用次数(从低到高)","Type here":"在这里输入",Today:"今天",Yesterday:"昨天","Last 7 days":"最近 7 天","Last 30 days":"最近 30 天","Last 90 days":"最近 90 天","Last 180 days":"最近 180 天","Last 365 days":"最近 365 天",Found:"被找到","Copy filtered thinos":"复制筛选的 thino","Bulk delete":"批量删除","Bulk archive":"批量归档","Bulk tag operation":"标签编辑","Bulk restore":"批量恢复","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"如果你禁用了日记插件,可能会导致 thino 无法被正确删除。请启用插件后再试一次。",Preview:"预览","Set and save":"设置并保存","Show day mark in thino list":"在 Thino 列中展示日期标记","Show day mark on the top of daily range thino. False by default.":"在 Thino 列中展示日期标记。默认为关闭","Click to expand or fold, Cmd+Click to show all thinos of the day":"点击展开或折叠,Cmd+点击展示当天所有 thino","You can buy a license from":"你可以从这里购买许可证","No thinos in range":"该范围内没有 thino",Month:"月视图",Week:"周视图",Day:"日视图",Agenda:"日程视图",Tomorrow:"明天",Previous:"往前",Next:"往后","Search all columns...":"搜索所有的列...","Basic Info":"基础信息","Additional Info":"附加信息","Created At":"创建于",Content:"内容","Thino Type":"Thino 类型","Source Type":"来源类型","Row status":"归档状态",Path:"路径","Pinned Status":"置顶状态",Table:"表格",Chat:"聊天",Moments:"动态",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Set the heading for saving thino":"设置保存 Thino 的标题","# Heading":"# 标题","Open link directly in Thino view":"Thino 视图内直接打开双链","Day mark range":"日期标记范围","Set the range of day mark. Day by default.":"设置日期标记的范围,默认为天","Thino is locked":"Thino 已锁定","Please unlock Thino by input password":"请输入密码来解锁 Thino","Auto Download Image":"自动下载图片","Auto download image when save to thino. 'false' by default":"当保存到 Thino 时自动下载图片。默认为 'false'","Thino Http IP Type":"Thino HTTP 服务器 IP 类型","Set Thino http server ip to listen. 'localhost' by default":"设置 Thino HTTP 服务器 IP。默认为 'localhost'","Password to lock Thino":"锁定 Thino 的密码",Unlock:"解锁",Locked:"已锁定","Password is incorrect":"密码错误",Lock:"锁定","Need password to unlock Thino":"需要密码来解锁 Thino","You have not set a password or enable this feature yet":"你还没有设置密码或者启用该功能",Password:"密码","Password for Thino":"Thino 的密码","Please input your password to change password settings":"请输入原来的密码来修改密码设置","Please input your password":"请输入密码","Lock thino":"锁定 Thino",date:"日期",time:"时间",event:"事件","Add tag position":"添加标签位置","Set the position of the tag when adding tag automatically":"设置自动添加标签的位置","Add tag automatically":"自动添加标签","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"在创建 Thino 和筛选标签时,将标签添加到 Thino 内容的末尾或开头","Add tag with new line":"添加标签时换行","Add tag with new line when adding tag automatically":"自动添加标签时换行","Input to select more tags":"输入来选择更多标签","Tag Bulk Edit":"标签批量编辑","Tag Bulk Select":"标签批量选择","Exist Tags":"已有标签","Selected Tags":"已选标签","Click to remove exist tag":"点击移除已有标签","Click to remove selected tag":"点击移除已选标签","Select tags":"选择标签","Input to select exist tag":"输入来选择已有标签",Beginning:"开头",End:"末尾","Chat view style":"聊天视图样式","Set the style of chat view":"设置聊天视图的样式","Background image for moments view":"动态视图的背景图","Set the background image for moments view":"设置动态视图的背景图","Icon for moments/chat view/share image":"动态/聊天视图/分享图的头像","Set the icon for moments/chat view/share image":"设置动态/聊天视图/分享图的头像","Quote for moments view/share image":"动态视图/分享图的个性签名","Set the quote for moments view/share image":"设置动态视图/分享图的个性签名","Theme for Thino":"Thino 主题","Set the theme for Thino":"设置 Thino 的主题","Interface Details":"界面详情","Task amount":"任务数量","Thino status":"Thino 状态","Used tags":"使用的标签","Used days":"使用的天数","Most active day":"最活跃的一天","Most active hour":"最活跃的一小时","Thino amount":"Thino 数量","No content to generate.":"没有内容可以生成。","Image generated successfully.":"图片生成成功。","Failed to generate image.":"图片生成失败。","Share filtered thinos as image":"分享筛选的 Thino 为图片","Latest version":"最新版本","Previous version":"之前版本","Thino update info":"Thino 更新信息","Debug info copied to clipboard":"调试信息已复制到剪贴板","Copy debug info":"复制调试信息","Failed to load changelog":"无法加载更新日志","View online":"在线查看",ChangeLog:"更新日志","Please open thino first":"请先打开 Thino","Insert editor":"插入编辑器","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"请在 Thino 设置中为多文件设置不同的路径,日记文件夹与多文件保存路径重复,或者存在被重复读取可能","Default time prefix for thino in daily notes":"日记中 Thino 的默认时间前缀","Set default time prefix for thino in daily notes.":"设置日记中 Thino 的默认时间前缀","Save image successfully":"保存图片成功","User quote":"用户签名","Set user quote for thino":"设置用户签名","User icon":"用户头像","Set user icon for thino. You can input http/https link or file path in vault.":"设置用户头像。你可以设置 http/https 链接或者 vault 中的文件路径。","User info":"用户信息","Copy filtered results":"复制筛选结果","Share image":"分享图片",Default:"默认",Gray:"灰色",Grass:"草绿",Flame:"火焰",Olive:"橄榄",Ice:"冰",Magenta:"品红","Daily notes":"日记相关",Editor:"编辑器","Append/prepend text when share to Thino":"分享到 Thino 时添加/前置文本","Append text when share to Thino":"分享到 Thino 时添加文本","Prepend text when share to Thino":"分享到 Thino 时前置文本","Add newline when append/prepend text":"添加换行符",Prepend:"前置",Append:"后置",Both:"两者",None:"无","Hide pinned group":"隐藏置顶分组","Hide pinned group in thino list. False by default.":"隐藏置顶的 Thino 分组。默认为关闭","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"设置 Thino 任务类型的标题,如果提供了标题,所有记录的 Thino 内容将统一归类到该标题下。","Different insert target for different type":"不同类型的 Thino 有不同的插入目标","Toggle this to set different insert target for different type of thino, like task or list type of thino":"切换此选项以为不同类型的 Thino 设置不同的插入目标,例如任务或列表类型的 Thino","Set process target":"设置处理目标","You can set whole diary or only part of it":"你可以设置整个日记或者其中的一部分",Custom:"自定义","Whole diary":"整个日记","Set thino insert place":"设置 Thino 插入位置","Set where to insert thino content":"设置 Thino 内容插入位置","End of the diary":"日记的末尾","Custom location":"自定义位置","Setting guide":"设置流程","Details settings":"详细设置","Start Thino":"开始 Thino","About Thino Pro":"关于 Thino 专业版",Enabled:"已启用",Enable:"启用","Daily notes folder":"日记文件夹","Set daily notes folder":"设置日记文件夹","Daily note name format":"日记文件名格式","Set daily note name format":"设置日记文件名格式","Daily note plugin":"日记插件","Enable daily note plugin":"启用日记插件",Selected:"已选择",Select:"选择","A classic theme for Thino with a two-column layout":"Thino 的经典主题,采用两列布局",Classic:"经典","A modern theme for Thino with a three-column layout and some unique features.":"Thino 的现代主题,采用三列布局和一些独特的功能。",Modern:"现代","Go and enjoy Thino":"去享受 Thino 吧","Congrats! All settings done":"恭喜!所有设置已完成","Adjust settings that influence your user experience with Thino.":"调整影响你使用 Thino 的设置。","Set preferences for using Thino":"设置使用 Thino 的偏好","If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":"如果你使用的是 Thino 基础版,启用日记插件是必须的。配置其设置以有效地使用它。","Go with daily note plugin":"使用日记插件","Choose a theme for Thino.":"选择 Thino 的主题。","Set theme for Thino":"设置 Thino 的主题","Set up your user info for Thino.":"设置你的用户信息。","Get started with Thino":"开始使用 Thino","Skip and start Thino":"跳过并开始 Thino","Next step":"下一步","Back to previous step":"返回上一步","Click to enable =>":"点击启用 =>","This is Thino's sidebar. Navigate to different path or select query filter.":"这是 Thino 的侧边栏。你可以导航到不同的路径或选择查询过滤器。","Click here and go to settings page.":"点击这里并转到设置页面。","Click here and go to different path.":"点击这里并转到不同的路径。","Select or create query filter here.":"在这里选择或创建查询过滤器。","See the status of Thinos here.":"在这里看到 Thino 的状态。","Search your thino quickly here.":"在这里快速搜索你的 Thino。","Edit or create your thino here.":"在这里编辑或创建你的 Thino。","See your thinos here.":"在这里看到你的 Thino。","See your time status of thinos here.":"在这里看到你的 Thino 时间状态。","See your tags here. Tags will be shown when thino contains tags.":"在这里看到你的标签。当 Thino 包含标签时,标签将显示。",Done:"完成","Thino is ready to use. ":"Thino 已准备好使用。","You can start using Thino now. If you want to know more about Thino Pro, click the button below.":"你现在可以开始使用 Thino 了。如果你想了解更多关于 Thino 专业版的信息,请点击下面的按钮。","Default time prefix":"默认时间前缀","Append Text Action":"分享到 Thino 时的后置文本动作","Prepend Text Action":"分享到 Thino 时的前置文本动作",Preset:"预设","Select Tags":"选择标签","It is not available on small view":"在窄的视图中不可用","Append text":"在末尾添加文本","Prepend text":"在开头添加文本","Your daily note folder is not set correctly, please check your settings":"你的日记文件夹设置不正确,请检查你的设置","Default sharing style":"默认分享样式","Set the default style for sharing thino, 'Modern' by default.":"设置 Thino 的默认分享样式,默认为“现代”。",Clean:"清爽",Minimal:"极简",Gradient:"渐变","Thino share":"Thino 分享","Copy to clipboard failed":"复制到剪贴板失败","Copy to clipboard successfully":"复制到剪贴板成功","Your content has been copied to clipboard, and inserted into the editor. Please try it again":"你的内容已经复制到剪贴板,并插入到编辑器中。请再试一次","Share thino":"分享 Thino","Set file name after create thino":"创建 Thino 后设置文件名","You can set file name after create thino. A input box will show when you create thino.":"你可以在创建 Thino 后设置文件名。当你创建 Thino 时,会显示一个输入框。",SPLIT:"分割","Split by Heading 1":"按一级标题分割","Split by Heading 2":"按二级标题分割","Split by Heading 3":"按三级标题分割","Insert task":"插入任务","All settings have been reset to default.":"所有设置已重置为默认值。","Reset all Thino settings":"重置所有 Thino 设置","Reset settings":"重置设置","Reset Thino settings to default settings.":"将 Thino 设置重置为默认设置。","Task Management":"任务管理","Append completed date when task done in thino":"在 Thino 中的任务完成时添加完成日期","Append completed date when task done in thino. False by default":"在 Thino 中的任务完成时添加完成日期。默认为关闭","Set tag for single file that Thino indexes":"Thino 会索引被设置标签的单文件","When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"当你在这里设置一个标签时,Thino 会索引包含这个标签的文件,并在列表中显示。不需要添加 `#`。","Set tag for file type file":"为单文件类型文件设置标签","Set tag for multi type file":"为多文件类型文件设置标签","Please input the tag":"请输入标签","Merge thinos in to thino share image":"合并 Thino 到 Thino 分享图片","Custom height for Thino content":"自定义 Thino 内容高度","Set custom height for Thino content. Like 200px or 20rem":"设置 Thino 内容的自定义高度。如 200px 或 20rem","Input height":"输入高度","Submit issue":"提交问题","Current version":"当前版本","Bug report":"Bug 报告","Click the button to copy debug info and open the issue page":"点击按钮复制调试信息并打开问题页面","Copy and go":"复制并前往","Debug info copied":"调试信息已复制","Feature request":"功能请求","Submit your feature request to the issue page":"提交你的功能请求到问题页面",Go:"前往","Toggle query list visibility":"切换 Query 列表可见性","Toggle tags visibility":"切换标签可见性","Toggle sidebar visibility":"切换侧边栏可见性",Collapse:"收起",Expand:"展开","Max height for collapse":"折叠的最大高度","The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":"Thino 折叠的最大高度,设置为 0 时,Thino 不会折叠。默认为 0。(这不是行数,而是像素高度值)","Render content":"渲染内容","Optimize for Callout":"优化 Callout 渲染性能问题","Won't render content contains more than 3 callouts automatically. True by default":"不会自动渲染包含超过 3 个 Callout 的内容。默认为开启","The value should be greater than":"值应大于","Append Text":"后置文本","Prepend Text":"前置文本","Thino height when collapsed":"Thino 折叠时的高度","The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":"Thino 折叠时的高度,当设置为 0 时,完全折叠。默认为 100。(这不是行数,而是像素高度值)","This option will allow you use other views when leaf width is not enough. False by default.":"当页面宽度不够时,可以选择其他视图。默认为关闭。","Can select other views when leaf width is not enough":"当页面宽度不够时,可以选择其他视图","TRASH BOX":"回收站","Wait templater to finish parse before insert thino":"在插入 Thino 之前等待 Templater 完成解析","This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":"此选项将允许您在插入 Thino 之前等待 Templater 完成解析,这可能会导致您在插入 Thino 之间需要确认两次。默认为关闭。","Get thino capture extension":"获取 Thino 剪裁扩展","You can capture idea/text from chrome now.":"你现在可以从 Chrome 中捕获想法/文本。","Open File":"打开文件","Exported CSV file":"导出的 CSV 文件","Updated At":"更新于","Export to CSV":"导出为 CSV","Quick add button on mobile navbar":"移动端导航栏的快速添加按钮","Always show status text":"始终显示状态文本","Support filter by metadata from file":"支持通过文件中的元数据进行筛选","When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":"启用后,你可以通过文件中的元数据进行筛选,例如文件中的标签。但画布中的 Thino 不支持。默认为关闭。","Show source near timestamp in thino":"在 Thino 时间戳旁显示 Thino 的来源","When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":"启用后,你可以在 Thino 时间戳旁看到 Thino 的来源。你可以在元数据中设置 title 来覆盖文件名。默认为关闭。","Show Update Message":"显示更新消息","Show update message when Thino is updated. True by default":"Thino 更新时显示更新消息。默认为开启","Sync manually":"手动同步","Show all scrollbars":"显示所有滚动条","TIME RANGE":"时间范围",WITHIN:"在内","7 days":"7天","14 days":"14天","30 days":"30天","3 months":"3个月","6 months":"6个月","1 year":"1年","This week":"本周","Last week":"上周","This month":"本月","Last month":"上月","This year":"今年","Last year":"去年"},X7={},eR={ar:F7,cs:O7,da:P7,de:j7,en:uA,"en-gb":L7,es:R7,fr:_7,hi:B7,id:H7,it:U7,ja:Y7,ko:z7,nl:V7,nn:W7,pl:$7,pt:Z7,"pt-br":q7,ro:G7,ru:J7,tr:K7,"zh-cn":Q7,"zh-tw":X7},kC=eR[x.moment.locale()];function E(e){const t=kC&&kC[e]||uA[e];return t===null?t:t||e}const tR=/```([\s\S]*?)```/g,nR=/\*\*(.+?)\*\*/g,rR=/\*(.+?)\*/g,aR=/\[ \] /g,oR=/\[.{1}\] /g,iR=/^[*-]/g,sR=/(\d+)\. /g,NC=/\[\[([^\]]+)\]\]/g,uT=/\[([^\]]+)\]\((([^\]]+).md)\)/g,lR=(e,t)=>{const n=e.replace(tR,"

$1
").replace(iR,"").replace(sR,"$1.").replace(aR,"").replace(oR,"").replace(nR,"$1").replace(rR,"$1").replace(/<br>/g,"

").replace(/&/g,"&");let r=n;if(t){if(NC.test(n)){const a=n.match(NC);for(let o=0;o{const{metadataCache:n}=Le.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof x.TFile?t?`${t}`:`${e}`:t?`${t}`:`${e}`},uR=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},cR=e=>{var t;return(t=uT.exec(e))==null?void 0:t[1]},dR=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},AC=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},fR=e=>e.replace(/\n/g,"
"),hR=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},FC="mobile-show-sidebar",cA=200,ei=3600*24*1e3,$r=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Wa=/(

|
)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,ua=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Af=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,pR=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Ff=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,ad=/\[@(.+?)\]\((.+?)\)/g,mR=/[#*"\/\\<>:|\[\]\?]/gim,gR=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,Qg=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var cT;(e=>{function t(){return parseInt(x.moment().format("x"))}e.getNowTimeStamp=t;function n(V){const U=/'’A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Z=/\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/.source,Q=/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source,G=new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${U}])+`,Z,Q].join("|"),"g");return(V.match(G)||[]).length}e.getWordCount=n;function r(V){Kg()&&(V!=null&&V.EnabledLocationList.some(U=>U.value==="DAILY"))&&(V!=null&&V.EnabledLocationList.some(U=>U.value==="MULTI"))&&mb().contains(V==null?void 0:V.MemoOtherSaveLocation.MemoDefaultMultiFilePath)&&new x.Notice(E("Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly."),5e3)}e.checkDailyInMulti=r;function a(){const V=navigator.userAgent;let U="Unknown";return V.indexOf("Win")!=-1?U="Windows":V.indexOf("Mac")!=-1?U="MacOS":V.indexOf("Linux")!=-1&&(U="Linux"),U}e.getOSVersion=a;function o(V){return typeof V=="string"&&(V=V.replaceAll("-","/")),new Date(V).getTime()}e.getTimeStampByDate=o;function i(V){const U=new Date(o(V));return new Date(U.getFullYear(),U.getMonth(),U.getDate()).getTime()}e.getDateStampByDate=i;function l(V){const U=new Date(o(V)),Z=U.getFullYear(),Q=U.getMonth()+1,G=U.getDate();return`${Z}/${Q}/${G}`}e.getDateString=l;function c(V){const U=new Date(o(V)),Z=U.getHours(),Q=U.getMinutes(),G=Z<10?"0"+Z:Z,re=Q<10?"0"+Q:Q;return`${G}:${re}`}e.getTimeString=c;function f(V){const U=new Date(o(V)),Z=U.getFullYear(),Q=U.getMonth()+1,G=U.getDate(),re=U.getHours(),de=U.getMinutes(),fe=U.getSeconds(),$=Q<10?"0"+Q:Q,he=G<10?"0"+G:G,se=re<10?"0"+re:re,ue=de<10?"0"+de:de,X=fe<10?"0"+fe:fe;return`${Z}/${$}/${he} ${se}:${ue}:${X}`}e.getDateTimeString=f;function h(V){return Array.from(new Set(V))}e.dedupe=h;function g(V){const U=new Set,Z=[];for(const Q of V)U.has(Q.id)||(U.add(Q.id),Z.push(Q));return Z}e.dedupeObjectWithId=g;function y(V,U){let Z=null;return()=>{Z&&clearTimeout(Z),Z=setTimeout(V,U)}}e.debounce=y;function w(V,U,Z=!1,Q){let G=null,re=!1;function de(...fe){if(G&&clearTimeout(G),Z&&!re){const $=V.apply(this,fe);Q&&typeof Q=="function"&&Q($),re=!0}else G=setTimeout(()=>{const $=V.apply(this,fe);Q&&typeof Q=="function"&&Q($),re=!1,G=null},U)}return de.cancel=function(){G&&clearTimeout(G),G=null,re=!1},de}e.debouncePlus=w;function S(V,U){let Z=!0;return()=>{if(!Z)return!1;Z=!1,setTimeout(()=>{V(),Z=!0},U)}}e.throttle=S;function D(V){const U=[],Z=Object.keys(V).sort();for(const Q of Z){const G=V[Q];G&&(typeof G=="object"?U.push(...D(G).split("&")):U.push(`${Q}=${G}`))}return U.join("&")}e.transformObjectToParamsString=D;function I(V){const U={},Z=V.split("&");for(const Q of Z){const[G,re]=Q.split("=");G&&re&&(U[G]=re)}return U}e.transformParamsStringToObject=I;function M(V){if(!V)return{};const U={},Z=Object.keys(V).sort();for(const Q of Z){const G=V[Q];if(typeof G=="object"){const re=M(JSON.parse(JSON.stringify(G)));re&&Object.keys(re).length>0&&(U[Q]=re)}else G&&(U[Q]=G)}return U}e.filterObjectNullKeys=M;async function N(V){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(V)}catch(U){console.warn("Copy to clipboard failed.",U)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=N;function B(V){return new Promise(U=>{const Z=new Image;Z.onload=()=>{const{width:Q,height:G}=Z;Q>0&&G>0?U({width:Q,height:G}):U({width:0,height:0})},Z.onerror=()=>{U({width:0,height:0})},Z.className="thino-hidden",Z.src=V,document.body.appendChild(Z),Z.remove()})}e.getImageSize=B;async function k(V){var G,re,de,fe;let U;const Q=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!Q&&((fe=(de=(re=(G=window.app.plugins)==null?void 0:G.getPlugin("periodic-notes"))==null?void 0:re.calendarSetManager)==null?void 0:de.getActiveConfig("day"))!=null&&fe.enabled)?(U=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",V),U):(U=await app.internalPlugins.getPluginById("daily-notes").instance.getDailyNote(V)||await lA(V),U)}catch($){return console.error($),new x.Notice(E("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=k;function R(V){const U=[];let Z=0;for(;Z").map(a=>`

${a!==""?a:"
"}

`).join(""),e=lR(e,t),e=e.replace($r,"#$1").replace(Wa,"

#$2").replace(Af,"$1$2").replace(pR,"$1").replace(ad,"$1").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let a=0;a{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;otypeof t[n]=="object"&&t[n]!==null&&typeof e[n]=="object"&&e[n]!==null?dA(e[n],t[n]):Object.prototype.hasOwnProperty.call(e,n)&&e[n]===t[n])}function wR(e,t){switch(t.type){case"SET_MEMOS":{const n=t.payload.memos.sort((a,o)=>{const i=ut.getTimeStampByDate(a.createdAt),l=ut.getTimeStampByDate(o.createdAt);return i===l?o.id.localeCompare(a.id):ut.getTimeStampByDate(o.createdAt)-ut.getTimeStampByDate(a.createdAt)}),r=ut.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=ut.dedupeObjectWithId(t.payload.commentMemos.sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"SET_TAGS":return{...e,tags:t.payload.tags,tagsNum:t.payload.tagsNum};case"INSERT_MEMO":{const n=ut.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=ut.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"DELETE_MEMO_BY_ID":return{...e,memos:[...e.memos].filter(n=>n.id!==t.payload.id)};case"DELETE_MEMO_BY_ID_BATCH":{const n=[...e.memos];return t.payload.ids.forEach(r=>{n.splice(n.findIndex(a=>a.id===r),1)}),{...e,memos:[...n]}}case"REPLACE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?t.payload.memo:r);return{...e,memos:[...n]}}case"REMOVE_PREPARE_UPDATE_THINO":return{...e,preparingUpdateMemo:[]};case"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO":return{...e,preparingUpdateMemo:e.preparingUpdateMemo.filter(n=>n.id!==t.payload.id)};case"SET_WAITING_FOR_TEMPLATER":return{...e,preparingUpdateMemo:[...e.preparingUpdateMemo,{origin:t.payload.origin,date:t.payload.date,isList:t.payload.isList,id:t.payload.id,type:t.payload.type}]};case"CLEAR_MEMOS":return{...fA};case"EDIT_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"EDIT_MEMO_PATH":{const n=e.memos.map(r=>r.path===t.payload.path?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UPDATE_MEMO_BATCH":{const n=e.memos.filter(a=>a.path!==t.payload.path),r=ut.dedupeObjectWithId([...t.payload.memos,...n].sort((a,o)=>ut.getTimeStampByDate(o.createdAt)-ut.getTimeStampByDate(a.createdAt)));return{...e,memos:[...r]}}case"ARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"ARCHIVE_MEMO_BY_ID_BULK":{const n=e.memos.map(r=>t.payload.some(a=>a.id===r.id)?{...r,...t.payload.filter(a=>a.id===r.id)[0]}:r);return{...e,memos:[...n]}}case"UNARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"PIN_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,pinned:t.payload.pinned}:r);return{...e,memos:[...n]}}case"EDIT_COMMENT_MEMO":{const n=e.commentMemos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,commentMemos:[...n]}}default:return e}}const fA={memos:[],commentMemos:[],tags:[],tagsNum:{},preparingUpdateMemo:[]};function bR(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const SR={user:null};function DR(e,t){switch(t.type){case"SET_QUERIES":{const n=ut.dedupeObjectWithId(t.payload.queries.sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)).sort((r,a)=>ut.getTimeStampByDate(a.pinnedAt??0)-ut.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=ut.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,a)=>ut.getTimeStampByDate(a.createdAt)-ut.getTimeStampByDate(r.createdAt)));return{...e,queries:n}}case"DELETE_QUERY_BY_ID":return{...e,queries:[...e.queries].filter(n=>n.id!==t.payload.id)};case"UPDATE_QUERY":{const n=e.queries.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,queries:n}}default:return e}}const TR={queries:[]};function IR(e,t){var n,r,a,o;switch(t.type){case"SET_DAILY_NOTES":return{...e,dailyNotes:t.payload.dailyNotes};case"SET_APP":return e.app?{...e}:{...e,app:t.payload.app};case"SET_PLUGIN":return e.plugin?{...e}:{...e,plugin:t.payload.plugin};case"SET_EDITOR":return e.editor?{...e}:{...e,editor:t.payload.editor};case"SET_SETTINGS":return e.settings&&e.settings===t.payload.settings?{...e}:{...e,settings:t.payload.settings};case"SET_VIEW":return e.view&&((r=(n=e.view)==null?void 0:n.leaf)==null?void 0:r.id)===((o=(a=t.payload.view)==null?void 0:a.leaf)==null?void 0:o.id)?{...e}:{...e,view:t.payload.view};case"CLEAR_VIEW":return e.view&&e.view.unload(),{...e,view:null};case"CLEAR_FILES":return{...e,dailyNotes:null};case"SET_VERIFY_STATE":return{...e,verifyState:t.payload.verifyState};default:return e}}const ER={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},Le=n7({globalState:a7,locationState:qN,memoState:fA,userState:SR,queryState:TR,dailyNotesState:ER},t7({globalState:r7,locationState:o7,memoState:wR,userState:bR,queryState:DR,dailyNotesState:IR})),Lt=P.createContext(Le.getState());String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});class CR{constructor(){Se(this,"initialized",!1)}getState(){return Le.getState().dailyNotesState}setApp(t){return Le.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return Le.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return Le.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return Le.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return Le.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,a=hp(t,"day");return n?delete r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,Le.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return Le.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){try{const t=Ju();return Le.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}catch(t){console.error(t)}}}const ft=new CR;var la;(e=>{function t(o){const i={};for(const l of o)try{const c=localStorage.getItem(l);if(c!==null){const f=JSON.parse(c);i[l]=f}}catch(c){console.error("Get storage failed in ",l,c)}return i}e.get=t;function n(o){for(const i in o)try{const l=JSON.stringify(o[i]);localStorage.setItem(i,l)}catch(l){console.error("Save storage failed in ",i,l)}}e.set=n;function r(o){for(const i of o)try{localStorage.removeItem(i)}catch(l){console.error("Remove storage failed in ",i,l)}}e.remove=r;function a(){var i;const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o),(i=o.contentWindow)==null||i.localStorage.setItem("t",Date.now().toString()),o.remove()}e.emitStorageChangedEvent=a})(la||(la={}));class xR{constructor(){Se(this,"getState",()=>Le.getState().globalState);Se(this,"setEditMemoId",t=>{Le.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});Se(this,"setRefresh",t=>{Le.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});Se(this,"setCommentMemoId",t=>{Le.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});Se(this,"setMarkMemoId",t=>{Le.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});Se(this,"setLoaded",t=>{Le.dispatch({type:"SET_LOADED",payload:{loaded:t}})});Se(this,"setGlobalEditorShown",t=>{Le.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});Se(this,"setIsMobileView",t=>{Le.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});Se(this,"setChangedByMemos",t=>{Le.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});Se(this,"setShowSiderbarInMobileView",t=>{Le.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});Se(this,"setAppSetting",t=>{Le.dispatch({type:"SET_APP_SETTING",payload:t}),la.set(t)});Se(this,"setMemoListView",t=>{Le.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});Se(this,"setInstance",(t,n)=>{Le.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});Se(this,"setLocked",t=>{Le.dispatch({type:"SET_LOCKED",payload:{locked:t}})});Se(this,"setExitSteps",t=>{Le.dispatch({type:"SET_EXIT_STEPS",payload:{exited:t}})});Se(this,"setPluginManifest",t=>{Le.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=la.get(["shouldSplitMemoWord","shouldHideImageUrl","shouldUseMarkdownParser","useTinyUndoHistoryCache"]),n={shouldSplitMemoWord:t.shouldSplitMemoWord||!0,shouldHideImageUrl:t.shouldHideImageUrl||!0,shouldUseMarkdownParser:t.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:t.useTinyUndoHistoryCache||!1};this.setAppSetting(n)}}const dt=new xR;class MR{constructor(){Se(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,a=new URLSearchParams(n),o={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};o.query.tag=a.get("tag")||"",o.query.type=a.get("type")??"",o.query.text=a.get("text")??"",o.query.filter=a.get("filter")??"";const i=parseInt(a.get("from")??"0"),l=parseInt(a.get("to")??"0");l>i&&l!==0&&(o.query.duration={from:i,to:l}),o.hash=r,o.pathname=this.getValidPathname(t),Le.dispatch({type:"SET_LOCATION",payload:o})});Se(this,"getState",()=>Le.getState().locationState);Se(this,"clearQuery",()=>{Le.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});Se(this,"setQuery",t=>{Le.dispatch({type:"SET_QUERY",payload:t})});Se(this,"reloadApp",()=>{Le.dispatch({type:"RELOAD"})});Se(this,"setHash",t=>{Le.dispatch({type:"SET_HASH",payload:{hash:t}})});Se(this,"setPathname",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"pushHistory",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"replaceHistory",t=>{Le.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});Se(this,"setMemoTypeQuery",(t="")=>{Le.dispatch({type:"SET_TYPE",payload:{type:t}})});Se(this,"setMemoFilter",t=>{Le.dispatch({type:"SET_QUERY_FILTER",payload:t})});Se(this,"setTextQuery",t=>{Le.dispatch({type:"SET_TEXT",payload:{text:t}})});Se(this,"setTimeQuery",t=>{Le.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});Se(this,"setPathQuery",t=>{Le.dispatch({type:"SET_PATH_QUERY",payload:{path:t}})});Se(this,"setMetadataQuery",(t,n)=>{Le.dispatch({type:"SET_METADATA_QUERY",payload:{name:t,value:n}})});Se(this,"setTagQuery",t=>{Le.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});Se(this,"setFromAndToQuery",(t,n)=>{Le.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});Se(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const at=new MR,ff=e=>`${e.vault.configDir}/query.json`,hA=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},Rp=async e=>(await hA(e,ff(e))||await pA(e),JSON.parse(await e.vault.adapter.read(ff(e))).queries||[]),Av=async(e,t)=>{await e.vault.adapter.write(ff(e),JSON.stringify({queries:t},null,2))},pA=async e=>{const t=dt.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(ff(e),JSON.stringify({queries:[]},null,2));else{const o=(await e.vault.read(r)).split(` +`);o.length===0&&await e.vault.adapter.write(ff(e),JSON.stringify({queries:[]},null,2));const i=[];for(let l=0;l{const{app:e}=Le.getState().dailyNotesState;return await hA(e,ff(e))||await pA(e),await Rp(e)||[]},NR=(e,t)=>({createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:E("Temp Filter"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),AR=async(e,t)=>{const n=await Rp(Le.getState().dailyNotesState.app)||[],r={createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:x.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await Av(Le.getState().dailyNotesState.app,n),r};var Ew={exports:{}};Ew.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",g=1,y=2,w=4,S=1,D=2,I=1,M=2,N=4,B=8,k=16,R=32,L=64,_=128,V=256,U=512,Z=30,Q="...",G=800,re=16,de=1,fe=2,$=3,he=1/0,se=9007199254740991,ue=17976931348623157e292,X=NaN,oe=4294967295,De=oe-1,je=oe>>>1,Re=[["ary",_],["bind",I],["bindKey",M],["curry",B],["curryRight",k],["flip",U],["partial",R],["partialRight",L],["rearg",V]],Fe="[object Arguments]",Be="[object Array]",Xe="[object AsyncFunction]",Ze="[object Boolean]",st="[object Date]",Ct="[object DOMException]",tn="[object Error]",_e="[object Function]",et="[object GeneratorFunction]",nt="[object Map]",ht="[object Number]",St="[object Null]",Tt="[object Object]",Gt="[object Promise]",_t="[object Proxy]",Vt="[object RegExp]",Xt="[object Set]",dn="[object String]",en="[object Symbol]",Zn="[object Undefined]",Dn="[object WeakMap]",Er="[object WeakSet]",pt="[object ArrayBuffer]",Mt="[object DataView]",Jt="[object Float32Array]",sn="[object Float64Array]",ln="[object Int8Array]",vr="[object Int16Array]",fr="[object Int32Array]",ha="[object Uint8Array]",jr="[object Uint8ClampedArray]",nr="[object Uint16Array]",Lr="[object Uint32Array]",te=/\b__p \+= '';/g,me=/\b(__p \+=) '' \+/g,xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ue=/&(?:amp|lt|gt|quot|#39);/g,He=/[&<>"']/g,Qe=RegExp(Ue.source),tt=RegExp(He.source),kt=/<%-([\s\S]+?)%>/g,Ut=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cr=/^\w*$/,Jn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/[\\^$.*+?()[\]{}|]/g,ta=RegExp(yr.source),Pi=/^\s+/,Nn=/\s/,Aa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fa=/\{\n\/\* \[wrapped with (.+)\] \*/,Zr=/,? & /,fo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Oa=/[()=,{}\[\]\/\s]/,iu=/\\(\\)?/g,si=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,li=/\w*$/,nc=/^[-+]0x[0-9a-f]+$/i,su=/^0b[01]+$/i,us=/^\[object .+?Constructor\]$/,ji=/^0o[0-7]+$/i,cs=/^(?:0|[1-9]\d*)$/,lu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ds=/($^)/,rc=/['\n\r\u2028\u2029\\]/g,An="\\ud800-\\udfff",na="\\u0300-\\u036f",qs="\\ufe20-\\ufe2f",Gs="\\u20d0-\\u20ff",ui=na+qs+Gs,uu="\\u2700-\\u27bf",Fo="a-z\\xdf-\\xf6\\xf8-\\xff",ho="\\xac\\xb1\\xd7\\xf7",Pa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fs="\\u2000-\\u206f",Rr=" \\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",Js="A-Z\\xc0-\\xd6\\xd8-\\xde",Ks="\\ufe0e\\ufe0f",Qs=ho+Pa+fs+Rr,po="['’]",hs="["+An+"]",ci="["+Qs+"]",mo="["+ui+"]",A="\\d+",Y="["+uu+"]",K="["+Fo+"]",ie="[^"+An+Qs+A+uu+Fo+Js+"]",Ne="\\ud83c[\\udffb-\\udfff]",Ie="(?:"+mo+"|"+Ne+")",Ye="[^"+An+"]",it="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+Js+"]",$t="\\u200d",Pn="(?:"+K+"|"+ie+")",Ga="(?:"+Ft+"|"+ie+")",ja="(?:"+po+"(?:d|ll|m|re|s|t|ve))?",ra="(?:"+po+"(?:D|LL|M|RE|S|T|VE))?",Oo=Ie+"?",La="["+Ks+"]?",Ja="(?:"+$t+"(?:"+[Ye,it,ct].join("|")+")"+La+Oo+")*",pa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ra=La+Oo+Ja,Li="(?:"+[Y,it,ct].join("|")+")"+Ra,Ri="(?:"+[Ye+mo+"?",mo,it,ct,hs].join("|")+")",dm=RegExp(po,"g"),Bf=RegExp(mo,"g"),ps=RegExp(Ne+"(?="+Ne+")|"+Ri+Ra,"g"),fm=RegExp([Ft+"?"+K+"+"+ja+"(?="+[ci,Ft,"$"].join("|")+")",Ga+"+"+ra+"(?="+[ci,Ft+Pn,"$"].join("|")+")",Ft+"?"+Pn+"+"+ja,Ft+"+"+ra,go,pa,A,Li].join("|"),"g"),Po=RegExp("["+$t+An+ui+Ks+"]"),Xs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bn=-1,hn={};hn[Jt]=hn[sn]=hn[ln]=hn[vr]=hn[fr]=hn[ha]=hn[jr]=hn[nr]=hn[Lr]=!0,hn[Fe]=hn[Be]=hn[pt]=hn[Ze]=hn[Mt]=hn[st]=hn[tn]=hn[_e]=hn[nt]=hn[ht]=hn[Tt]=hn[Vt]=hn[Xt]=hn[dn]=hn[Dn]=!1;var pn={};pn[Fe]=pn[Be]=pn[pt]=pn[Mt]=pn[Ze]=pn[st]=pn[Jt]=pn[sn]=pn[ln]=pn[vr]=pn[fr]=pn[nt]=pn[ht]=pn[Tt]=pn[Vt]=pn[Xt]=pn[dn]=pn[en]=pn[ha]=pn[jr]=pn[nr]=pn[Lr]=!0,pn[tn]=pn[_e]=pn[Dn]=!1;var jo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vo={"&":"&","<":"<",">":">",'"':""","'":"'"},ac={"&":"&","<":"<",">":">",""":'"',"'":"'"},ms={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oc=parseFloat,el=parseInt,tl=typeof dr=="object"&&dr&&dr.Object===Object&&dr,fd=typeof self=="object"&&self&&self.Object===Object&&self,zn=tl||fd||Function("return this")(),nl=t&&!t.nodeType&&t,Lo=nl&&!0&&e&&!e.nodeType&&e,hd=Lo&&Lo.exports===nl,di=hd&&tl.process,qr=function(){try{var be=Lo&&Lo.require&&Lo.require("util").types;return be||di&&di.binding&&di.binding("util")}catch{}}(),rl=qr&&qr.isArrayBuffer,Gr=qr&&qr.isDate,gs=qr&&qr.isMap,_i=qr&&qr.isRegExp,al=qr&&qr.isSet,ic=qr&&qr.isTypedArray;function xr(be,ze,Oe){switch(Oe.length){case 0:return be.call(ze);case 1:return be.call(ze,Oe[0]);case 2:return be.call(ze,Oe[0],Oe[1]);case 3:return be.call(ze,Oe[0],Oe[1],Oe[2])}return be.apply(ze,Oe)}function vs(be,ze,Oe,vt){for(var Qt=-1,Tn=be==null?0:be.length;++Qt-1}function aa(be,ze,Oe){for(var vt=-1,Qt=be==null?0:be.length;++vt-1;);return Oe}function oa(be,ze){for(var Oe=be.length;Oe--&&ys(ze,be[Oe],0)>-1;);return Oe}function Ka(be,ze){for(var Oe=be.length,vt=0;Oe--;)be[Oe]===ze&&++vt;return vt}var Qa=H(jo),pu=H(vo);function vd(be){return"\\"+ms[be]}function Bi(be,ze){return be==null?n:be[ze]}function dc(be){return Po.test(be)}function P1(be){return Xs.test(be)}function j1(be){for(var ze,Oe=[];!(ze=be.next()).done;)Oe.push(ze.value);return Oe}function Yf(be){var ze=-1,Oe=Array(be.size);return be.forEach(function(vt,Qt){Oe[++ze]=[Qt,vt]}),Oe}function hm(be,ze){return function(Oe){return be(ze(Oe))}}function _o(be,ze){for(var Oe=-1,vt=be.length,Qt=0,Tn=[];++Oe-1}function ky(d,p){var T=this.__data__,j=wa(T,d);return j<0?(++this.size,T.push([d,p])):T[j][1]=p,this}_a.prototype.clear=Dc,_a.prototype.delete=to,_a.prototype.get=nh,_a.prototype.has=My,_a.prototype.set=ky;function Ho(d){var p=-1,T=d==null?0:d.length;for(this.clear();++p=p?d:p)),d}function no(d,p,T,j,z,ee){var ce,ve=p&g,Te=p&y,We=p&w;if(T&&(ce=z?T(d,j,z,ee):T(d)),ce!==n)return ce;if(!Sr(d))return d;var $e=an(d);if($e){if(ce=Qy(d),!ve)return Ha(d,ce)}else{var Ke=Ta(d),mt=Ke==_e||Ke==et;if(Hc(d))return Om(d,ve);if(Ke==Tt||Ke==Fe||mt&&!z){if(ce=Te||mt?{}:Pc(d),!ve)return Te?z1(d,pi(ce,d)):Yy(d,Xn(ce,d))}else{if(!pn[Ke])return z?d:{};ce=Ia(d,Ke,ve)}}ee||(ee=new ya);var Nt=ee.get(d);if(Nt)return Nt;ee.set(d,ce),fC(d)?d.forEach(function(zt){ce.add(no(zt,p,T,zt,d,ee))}):cC(d)&&d.forEach(function(zt,mn){ce.set(mn,no(zt,p,T,mn,d,ee))});var Yt=We?Te?Yd:Mh:Te?qo:Ca,cn=$e?n:Yt(d);return wr(cn||d,function(zt,mn){cn&&(mn=zt,zt=d[mn]),Du(ce,mn,no(zt,p,T,mn,d,ee))}),ce}function Oy(d){var p=Ca(d);return function(T){return kd(T,d,p)}}function kd(d,p,T){var j=T.length;if(d==null)return!j;for(d=Un(d);j--;){var z=T[j],ee=p[z],ce=d[z];if(ce===n&&!(z in d)||!ee(ce))return!1}return!0}function Sm(d,p,T){if(typeof d!="function")throw new Bo(i);return Lc(function(){d.apply(n,T)},p)}function $i(d,p,T,j){var z=-1,ee=ol,ce=!0,ve=d.length,Te=[],We=p.length;if(!ve)return Te;T&&(p=jn(p,It(T))),j?(ee=aa,ce=!1):p.length>=a&&(ee=Rt,ce=!1,p=new wu(p));e:for(;++zz?0:z+T),j=j===n||j>z?z:un(j),j<0&&(j+=z),j=T>j?0:pC(j);T0&&T(ve)?p>1?_r(ve,p-1,T,j,z):Ro(z,ve):j||(z[z.length]=ve)}return z}var Nd=_m(),lh=_m(!0);function zo(d,p){return d&&Nd(d,p,Ca)}function pl(d,p){return d&&lh(d,p,Ca)}function Ba(d,p){return fi(p,function(T){return Fu(d[T])})}function So(d,p){p=Is(p,d);for(var T=0,j=p.length;d!=null&&Tp}function ml(d,p){return d!=null&&In.call(d,p)}function Dm(d,p){return d!=null&&p in Un(d)}function jy(d,p,T){return d>=ma(p,T)&&d=120&&$e.length>=120)?new wu(ce&&$e):n}$e=d[0];var Ke=-1,mt=ve[0];e:for(;++Ke-1;)ve!==d&&Gf.call(ve,Te,1),Gf.call(d,Te,1);return d}function Pd(d,p){for(var T=d?p.length:0,j=T-1;T--;){var z=p[T];if(T==j||z!==ee){var ee=z;Vo(z)?Gf.call(d,z,1):Cu(d,z)}}return d}function jd(d,p){return d+ll(Id()*(p-d+1))}function Nm(d,p,T,j){for(var z=-1,ee=kr(vu((p-d)/(T||1)),0),ce=Oe(ee);ee--;)ce[j?ee:++z]=d,d+=T;return ce}function xc(d,p){var T="";if(!d||p<1||p>se)return T;do p%2&&(T+=d),p=ll(p/2),p&&(d+=d);while(p);return T}function rn(d,p){return Oh(Ah(d,p,Go),d+"")}function Eu(d){return Vi(Xh(d))}function or(d,p){var T=Xh(d);return To(T,Ts(p,0,T.length))}function ir(d,p,T,j){if(!Sr(d))return d;p=Is(p,d);for(var z=-1,ee=p.length,ce=ee-1,ve=d;ve!=null&&++zz?0:z+p),T=T>z?z:T,T<0&&(T+=z),z=p>T?0:T-p>>>0,p>>>=0;for(var ee=Oe(z);++j>>1,ce=d[ee];ce!==null&&!Di(ce)&&(T?ce<=p:ce=a){var We=p?null:Ua(d);if(We)return sl(We);ce=!1,z=Rt,Te=new wu}else Te=p?[]:ve;e:for(;++j=j?d:Sa(d,p,T)}var kc=Ey||function(d){return zn.clearTimeout(d)};function Om(d,p){if(p)return d.slice();var T=d.length,j=mm?mm(T):new d.constructor(T);return d.copy(j),j}function Nc(d){var p=new d.constructor(d.byteLength);return new Dd(p).set(new Dd(d)),p}function Dh(d,p){var T=p?Nc(d.buffer):d.buffer;return new d.constructor(T,d.byteOffset,d.byteLength)}function Hy(d){var p=new d.constructor(d.source,li.exec(d));return p.lastIndex=d.lastIndex,p}function Pm(d){return wo?Un(wo.call(d)):{}}function jm(d,p){var T=p?Nc(d.buffer):d.buffer;return new d.constructor(T,d.byteOffset,d.length)}function Lm(d,p){if(d!==p){var T=d!==n,j=d===null,z=d===d,ee=Di(d),ce=p!==n,ve=p===null,Te=p===p,We=Di(p);if(!ve&&!We&&!ee&&d>p||ee&&ce&&Te&&!ve&&!We||j&&ce&&Te||!T&&Te||!z)return 1;if(!j&&!ee&&!We&&d=ve)return Te;var We=T[j];return Te*(We=="desc"?-1:1)}}return d.index-p.index}function Rm(d,p,T,j){for(var z=-1,ee=d.length,ce=T.length,ve=-1,Te=p.length,We=kr(ee-ce,0),$e=Oe(Te+We),Ke=!j;++ve1?T[z-1]:n,ce=z>2?T[2]:n;for(ee=d.length>3&&typeof ee=="function"?(z--,ee):n,ce&&Fn(T[0],T[1],ce)&&(ee=z<3?n:ee,z=1),p=Un(p);++j-1?z[ee?p[ce]:ce]:n}}function xu(d){return Gi(function(p){var T=p.length,j=T,z=ga.prototype.thru;for(d&&p.reverse();j--;){var ee=p[j];if(typeof ee!="function")throw new Bo(i);if(z&&!ce&&Vd(ee)=="wrapper")var ce=new ga([],!0)}for(j=ce?j:T;++j1&&Sn.reverse(),$e&&Teve))return!1;var We=ee.get(d),$e=ee.get(p);if(We&&$e)return We==p&&$e==d;var Ke=-1,mt=!0,Nt=T&D?new wu:n;for(ee.set(d,p),ee.set(p,d);++Ke1?"& ":"")+p[j],p=p.join(T>2?", ":" "),d.replace(Aa,`{ /* [wrapped with `+p+`] */ -`)}function $1(d){return an(d)||Qd(d)||!!(Iy&&d&&d[Iy])}function Vo(d,p){var T=typeof d;return p=p??ie,!!p&&(T=="number"||T!="symbol"&&cs.test(d))&&d>-1&&d%1==0&&d0){if(++p>=G)return arguments[0]}else p=0;return d.apply(n,arguments)}}function To(d,p){var T=-1,j=d.length,z=j-1;for(p=p===n?j:p;++T1?d[p-1]:n;return T=typeof T=="function"?(d.pop(),T):n,sg(d,T)});function Eo(d){var p=J(d);return p.__chain__=!0,p}function lg(d,p){return p(d),d}function Yh(d,p){return p(d)}var kl=Gi(function(d){var p=d.length,T=p?d[0]:0,j=this.__wrapped__,z=function(ee){return ih(ee,d)};return p>1||this.__actions__.length||!(j instanceof nn)||!Vo(T)?this.thru(z):(j=j.slice(T,+T+(p?1:0)),j.__actions__.push({func:Yh,args:[z],thisArg:n}),new ga(j,this.__chain__).thru(function(ee){return p&&!ee.length&&ee.push(n),ee}))});function Uh(){return Eo(this)}function Au(){return new ga(this.value(),this.__chain__)}function zh(){this.__values__===n&&(this.__values__=hC(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function ug(){return this}function cg(d){for(var p,T=this;T instanceof Ui;){var j=Km(T);j.__index__=0,j.__values__=n,p?z.__wrapped__=j:p=j;var z=j;T=T.__wrapped__}return z.__wrapped__=d,p}function nS(){var d=this.__wrapped__;if(d instanceof nn){var p=d;return this.__actions__.length&&(p=new nn(this)),p=p.reverse(),p.__actions__.push({func:Yh,args:[Ea],thisArg:n}),new ga(p,this.__chain__)}return this.thru(Ea)}function dg(){return Am(this.__wrapped__,this.__actions__)}var rS=_d(function(d,p,T){Tn.call(d,T)?++d[T]:Wi(d,T,1)});function p0(d,p,T){var j=an(d)?sc:mi;return T&&Fn(d,p,T)&&(p=n),j(d,Ot(p,3))}function m0(d,p){var T=an(d)?fi:Iu;return T(d,Ot(p,3))}var Vh=Wy(_c),Wh=Wy(Il);function g0(d,p){return _r(Gh(d,p),1)}function fg(d,p){return _r(Gh(d,p),he)}function aS(d,p,T){return T=T===n?1:un(T),_r(Gh(d,p),T)}function hg(d,p){var T=an(d)?wr:Zi;return T(d,Ot(p,3))}function $h(d,p){var T=an(d)?du:Py;return T(d,Ot(p,3))}var Zh=_d(function(d,p,T){Tn.call(d,T)?d[T].push(p):Wi(d,T,[p])});function pg(d,p,T,j){d=Zo(d)?d:Xh(d),T=T&&!j?un(T):0;var z=d.length;return T<0&&(T=kr(z+T,0)),w0(d)?T<=z&&d.indexOf(p,T)>-1:!!z&&ys(d,p,T)>-1}var qh=rn(function(d,p,T){var j=-1,z=typeof p=="function",ee=Zo(d)?Oe(d.length):[];return Zi(d,function(de){ee[++j]=z?xr(p,de,T):vl(de,p,T)}),ee}),v0=_d(function(d,p,T){Wi(d,T,p)});function Gh(d,p){var T=an(d)?jn:xm;return T(d,Ot(p,3))}function Jh(d,p,T,j){return d==null?[]:(an(p)||(p=p==null?[]:[p]),T=j?n:T,an(T)||(T=T==null?[]:[T]),ph(d,p,T))}var oS=_d(function(d,p,T){d[T?0:1].push(p)},function(){return[[],[]]});function Kd(d,p,T){var j=an(d)?pd:q,z=arguments.length<3;return j(d,Ot(p,4),T,z,Zi)}function iS(d,p,T){var j=an(d)?Hf:q,z=arguments.length<3;return j(d,Ot(p,4),T,z,Py)}function Kh(d,p){var T=an(d)?fi:Iu;return T(d,Me(Ot(p,3)))}function s(d){var p=an(d)?Vi:Eu;return p(d)}function u(d,p,T){(T?Fn(d,p,T):p===n)?p=1:p=un(p);var j=an(d)?Su:or;return j(d,p)}function m(d){var p=an(d)?Fy:Ld;return p(d)}function b(d){if(d==null)return 0;if(Zo(d))return w0(d)?mu(d):d.length;var p=Ta(d);return p==nt||p==Xt?d.size:hh(d).length}function C(d,p,T){var j=an(d)?il:U1;return T&&Fn(d,p,T)&&(p=n),j(d,Ot(p,3))}var O=rn(function(d,p){if(d==null)return[];var T=p.length;return T>1&&Fn(d,p[0],p[1])?p=[]:T>2&&Fn(p[0],p[1],p[2])&&(p=[p[0]]),ph(d,_r(p,1),[])}),W=Kn||function(){return zn.Date.now()};function ue(d,p){if(typeof p!="function")throw new Bo(i);return d=un(d),function(){if(--d<1)return p.apply(this,arguments)}}function ge(d,p,T){return p=T?n:p,p=d&&p==null?d.length:p,qi(d,R,n,n,n,n,p)}function Pe(d,p){var T;if(typeof p!="function")throw new Bo(i);return d=un(d),function(){return--d>0&&(T=p.apply(this,arguments)),d<=1&&(p=n),T}}var Ge=rn(function(d,p,T){var j=I;if(T.length){var z=_o(T,Sl(Ge));j|=B}return qi(d,j,p,T,z)}),rt=rn(function(d,p,T){var j=I|M;if(T.length){var z=_o(T,Sl(rt));j|=B}return qi(p,j,d,T,z)});function qe(d,p,T){p=T?n:p;var j=qi(d,_,n,n,n,n,n,p);return j.placeholder=qe.placeholder,j}function yt(d,p,T){p=T?n:p;var j=qi(d,k,n,n,n,n,n,p);return j.placeholder=yt.placeholder,j}function Dt(d,p,T){var j,z,ee,de,ve,Te,We=0,$e=!1,Ke=!1,mt=!0;if(typeof d!="function")throw new Bo(i);p=Ki(p)||0,Sr(T)&&($e=!!T.leading,Ke="maxWait"in T,ee=Ke?kr(Ki(T.maxWait)||0,p):ee,mt="trailing"in T?!!T.trailing:mt);function Nt(Wr){var As=j,Pu=z;return j=z=n,We=Wr,de=d.apply(Pu,As),de}function Ut(Wr){return We=Wr,ve=Lc(mn,p),$e?Nt(Wr):de}function cn(Wr){var As=Wr-Te,Pu=Wr-We,CC=p-As;return Ke?ma(CC,ee-Pu):CC}function zt(Wr){var As=Wr-Te,Pu=Wr-We;return Te===n||As>=p||As<0||Ke&&Pu>=ee}function mn(){var Wr=W();if(zt(Wr))return Sn(Wr);ve=Lc(mn,cn(Wr))}function Sn(Wr){return ve=n,mt&&j?Nt(Wr):(j=z=n,de)}function Ti(){ve!==n&&kc(ve),We=0,j=Te=z=ve=n}function Co(){return ve===n?de:Sn(W())}function Ii(){var Wr=W(),As=zt(Wr);if(j=arguments,z=this,Te=Wr,As){if(ve===n)return Ut(Te);if(Ke)return kc(ve),ve=Lc(mn,p),Nt(Te)}return ve===n&&(ve=Lc(mn,p)),de}return Ii.cancel=Ti,Ii.flush=Co,Ii}var Et=rn(function(d,p){return Sm(d,1,p)}),br=rn(function(d,p,T){return Sm(d,Ki(p)||0,T)});function Ce(d){return qi(d,Y)}function ye(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new Bo(i);var T=function(){var j=arguments,z=p?p.apply(this,j):j[0],ee=T.cache;if(ee.has(z))return ee.get(z);var de=d.apply(this,j);return T.cache=ee.set(z,de)||ee,de};return T.cache=new(ye.Cache||Ho),T}ye.Cache=Ho;function Me(d){if(typeof d!="function")throw new Bo(i);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function lt(d){return Pe(2,d)}var xt=By(function(d,p){p=p.length==1&&an(p[0])?jn(p[0],It(Ot())):jn(_r(p,1),It(Ot()));var T=p.length;return rn(function(j){for(var z=-1,ee=ma(j.length,T);++z=p}),Qd=Tm(function(){return arguments}())?Tm:function(d){return Ar(d)&&Tn.call(d,"callee")&&!qf.call(d,"callee")},an=Oe.isArray,jP=rl?It(rl):ch;function Zo(d){return d!=null&&y0(d.length)&&!Fu(d)}function Vr(d){return Ar(d)&&Zo(d)}function LP(d){return d===!0||d===!1||Ar(d)&&ba(d)==Ze}var Hc=vm||yS,RP=Gr?It(Gr):Ly;function _P(d){return Ar(d)&&d.nodeType===1&&!mg(d)}function BP(d){if(d==null)return!0;if(Zo(d)&&(an(d)||typeof d=="string"||typeof d.splice=="function"||Hc(d)||Qh(d)||Qd(d)))return!d.length;var p=Ta(d);if(p==nt||p==Xt)return!d.size;if(Wd(d))return!hh(d).length;for(var T in d)if(Tn.call(d,T))return!1;return!0}function HP(d,p){return Ic(d,p)}function YP(d,p,T){T=typeof T=="function"?T:n;var j=T?T(d,p):n;return j===n?Ic(d,p,n,T):!!j}function lS(d){if(!Ar(d))return!1;var p=ba(d);return p==tn||p==Ct||typeof d.message=="string"&&typeof d.name=="string"&&!mg(d)}function UP(d){return typeof d=="number"&&mc(d)}function Fu(d){if(!Sr(d))return!1;var p=ba(d);return p==_e||p==et||p==Xe||p==_t}function uC(d){return typeof d=="number"&&d==un(d)}function y0(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=ie}function Sr(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function Ar(d){return d!=null&&typeof d=="object"}var cC=gs?It(gs):dh;function zP(d,p){return d===p||fh(d,p,Nh(p))}function VP(d,p,T){return T=typeof T=="function"?T:n,fh(d,p,Nh(p),T)}function WP(d){return dC(d)&&d!=+d}function $P(d){if(Xy(d))throw new Qt(o);return Em(d)}function ZP(d){return d===null}function qP(d){return d==null}function dC(d){return typeof d=="number"||Ar(d)&&ba(d)==ht}function mg(d){if(!Ar(d)||ba(d)!=Tt)return!1;var p=hi(d);if(p===null)return!0;var T=Tn.call(p,"constructor")&&p.constructor;return typeof T=="function"&&T instanceof T&&wd.call(T)==$f}var uS=_i?It(_i):Ry;function GP(d){return uC(d)&&d>=-ie&&d<=ie}var fC=al?It(al):Cm;function w0(d){return typeof d=="string"||!an(d)&&Ar(d)&&ba(d)==dn}function Di(d){return typeof d=="symbol"||Ar(d)&&ba(d)==en}var Qh=ic?It(ic):Ad;function JP(d){return d===n}function KP(d){return Ar(d)&&Ta(d)==kn}function QP(d){return Ar(d)&&ba(d)==Er}var XP=Yd(yl),ej=Yd(function(d,p){return d<=p});function hC(d){if(!d)return[];if(Zo(d))return w0(d)?yo(d):Ha(d);if(Ss&&d[Ss])return j1(d[Ss]());var p=Ta(d),T=p==nt?Uf:p==Xt?sl:Xh;return T(d)}function Ou(d){if(!d)return d===0?d:0;if(d=Ki(d),d===he||d===-he){var p=d<0?-1:1;return p*ce}return d===d?d:0}function un(d){var p=Ou(d),T=p%1;return p===p?T?p-T:p:0}function pC(d){return d?Ts(un(d),0,ae):0}function Ki(d){if(typeof d=="number")return d;if(Di(d))return X;if(Sr(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=Sr(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=ot(d);var T=su.test(d);return T||ji.test(d)?el(d.slice(2),T?2:8):nc.test(d)?X:+d}function mC(d){return wi(d,qo(d))}function tj(d){return d?Ts(un(d),-ie,ie):d===0?d:0}function Un(d){return d==null?"":hr(d)}var nj=Ac(function(d,p){if(Wd(p)||Zo(p)){wi(p,Ca(p),d);return}for(var T in p)Tn.call(p,T)&&Du(d,T,p[T])}),gC=Ac(function(d,p){wi(p,qo(p),d)}),b0=Ac(function(d,p,T,j){wi(p,qo(p),d,j)}),rj=Ac(function(d,p,T,j){wi(p,Ca(p),d,j)}),aj=Gi(ih);function oj(d,p){var T=bc(d);return p==null?T:Xn(T,p)}var ij=rn(function(d,p){d=Yn(d);var T=-1,j=p.length,z=j>2?p[2]:n;for(z&&Fn(p[0],p[1],z)&&(j=1);++T1),ee}),wi(d,Ud(d),T),j&&(T=no(T,g|y|w,qy));for(var z=p.length;z--;)Cu(T,p[z]);return T});function Ij(d,p){return yC(d,Me(Ot(p)))}var Ej=Gi(function(d,p){return d==null?{}:Cc(d,p)});function yC(d,p){if(d==null)return{};var T=jn(Ud(d),function(j){return[j]});return p=Ot(p),Mm(d,T,function(j,z){return p(j,z[0])})}function Cj(d,p,T){p=Is(p,d);var j=-1,z=p.length;for(z||(z=1,d=n);++jp){var j=d;d=p,p=j}if(T||d%1||p%1){var z=Id();return ma(d+z*(p-d+oc("1e-"+((z+"").length-1))),p)}return jd(d,p)}var Rj=Cs(function(d,p,T){return p=p.toLowerCase(),d+(T?SC(p):p)});function SC(d){return fS(Un(d).toLowerCase())}function DC(d){return d=Un(d),d&&d.replace(lu,Qa).replace(Bf,"")}function _j(d,p,T){d=Un(d),p=hr(p);var j=d.length;T=T===n?j:Ts(un(T),0,j);var z=T;return T-=p.length,T>=0&&d.slice(T,z)==p}function Bj(d){return d=Un(d),d&&tt.test(d)?d.replace(He,pu):d}function Hj(d){return d=Un(d),d&&ta.test(d)?d.replace(yr,"\\$&"):d}var Yj=Cs(function(d,p,T){return d+(T?"-":"")+p.toLowerCase()}),Uj=Cs(function(d,p,T){return d+(T?" ":"")+p.toLowerCase()}),zj=Bm("toLowerCase");function Vj(d,p,T){d=Un(d),p=un(p);var j=p?mu(d):0;if(!p||j>=p)return d;var z=(p-j)/2;return Hd(ll(z),T)+d+Hd(vu(z),T)}function Wj(d,p,T){d=Un(d),p=un(p);var j=p?mu(d):0;return p&&j>>0,T?(d=Un(d),d&&(typeof p=="string"||p!=null&&!uS(p))&&(p=hr(p),!p&&dc(d))?Es(yo(d),0,T):d.split(p,T)):[]}var Qj=Cs(function(d,p,T){return d+(T?" ":"")+fS(p)});function Xj(d,p,T){return d=Un(d),T=T==null?0:Ts(un(T),0,d.length),p=hr(p),d.slice(T,T+p.length)==p}function eL(d,p,T){var j=J.templateSettings;T&&Fn(d,p,T)&&(p=n),d=Un(d),p=b0({},p,j,Um);var z=b0({},p.imports,j.imports,Um),ee=Ca(z),de=Kt(z,ee),ve,Te,We=0,$e=p.interpolate||ds,Ke="__p += '",mt=yd((p.escape||ds).source+"|"+$e.source+"|"+($e===On?si:ds).source+"|"+(p.evaluate||ds).source+"|$","g"),Nt="//# sourceURL="+(Tn.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bn+"]")+` +`)}function $1(d){return an(d)||Qd(d)||!!(Iy&&d&&d[Iy])}function Vo(d,p){var T=typeof d;return p=p??se,!!p&&(T=="number"||T!="symbol"&&cs.test(d))&&d>-1&&d%1==0&&d0){if(++p>=G)return arguments[0]}else p=0;return d.apply(n,arguments)}}function To(d,p){var T=-1,j=d.length,z=j-1;for(p=p===n?j:p;++T1?d[p-1]:n;return T=typeof T=="function"?(d.pop(),T):n,sg(d,T)});function Eo(d){var p=J(d);return p.__chain__=!0,p}function lg(d,p){return p(d),d}function Uh(d,p){return p(d)}var kl=Gi(function(d){var p=d.length,T=p?d[0]:0,j=this.__wrapped__,z=function(ee){return ih(ee,d)};return p>1||this.__actions__.length||!(j instanceof nn)||!Vo(T)?this.thru(z):(j=j.slice(T,+T+(p?1:0)),j.__actions__.push({func:Uh,args:[z],thisArg:n}),new ga(j,this.__chain__).thru(function(ee){return p&&!ee.length&&ee.push(n),ee}))});function Yh(){return Eo(this)}function Au(){return new ga(this.value(),this.__chain__)}function zh(){this.__values__===n&&(this.__values__=hC(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function ug(){return this}function cg(d){for(var p,T=this;T instanceof Yi;){var j=Km(T);j.__index__=0,j.__values__=n,p?z.__wrapped__=j:p=j;var z=j;T=T.__wrapped__}return z.__wrapped__=d,p}function nS(){var d=this.__wrapped__;if(d instanceof nn){var p=d;return this.__actions__.length&&(p=new nn(this)),p=p.reverse(),p.__actions__.push({func:Uh,args:[Ea],thisArg:n}),new ga(p,this.__chain__)}return this.thru(Ea)}function dg(){return Am(this.__wrapped__,this.__actions__)}var rS=_d(function(d,p,T){In.call(d,T)?++d[T]:Wi(d,T,1)});function p0(d,p,T){var j=an(d)?sc:mi;return T&&Fn(d,p,T)&&(p=n),j(d,Ot(p,3))}function m0(d,p){var T=an(d)?fi:Iu;return T(d,Ot(p,3))}var Vh=Wy(_c),Wh=Wy(Il);function g0(d,p){return _r(Gh(d,p),1)}function fg(d,p){return _r(Gh(d,p),he)}function aS(d,p,T){return T=T===n?1:un(T),_r(Gh(d,p),T)}function hg(d,p){var T=an(d)?wr:Zi;return T(d,Ot(p,3))}function $h(d,p){var T=an(d)?du:Py;return T(d,Ot(p,3))}var Zh=_d(function(d,p,T){In.call(d,T)?d[T].push(p):Wi(d,T,[p])});function pg(d,p,T,j){d=Zo(d)?d:Xh(d),T=T&&!j?un(T):0;var z=d.length;return T<0&&(T=kr(z+T,0)),w0(d)?T<=z&&d.indexOf(p,T)>-1:!!z&&ys(d,p,T)>-1}var qh=rn(function(d,p,T){var j=-1,z=typeof p=="function",ee=Zo(d)?Oe(d.length):[];return Zi(d,function(ce){ee[++j]=z?xr(p,ce,T):vl(ce,p,T)}),ee}),v0=_d(function(d,p,T){Wi(d,T,p)});function Gh(d,p){var T=an(d)?jn:xm;return T(d,Ot(p,3))}function Jh(d,p,T,j){return d==null?[]:(an(p)||(p=p==null?[]:[p]),T=j?n:T,an(T)||(T=T==null?[]:[T]),ph(d,p,T))}var oS=_d(function(d,p,T){d[T?0:1].push(p)},function(){return[[],[]]});function Kd(d,p,T){var j=an(d)?pd:q,z=arguments.length<3;return j(d,Ot(p,4),T,z,Zi)}function iS(d,p,T){var j=an(d)?Hf:q,z=arguments.length<3;return j(d,Ot(p,4),T,z,Py)}function Kh(d,p){var T=an(d)?fi:Iu;return T(d,Me(Ot(p,3)))}function s(d){var p=an(d)?Vi:Eu;return p(d)}function u(d,p,T){(T?Fn(d,p,T):p===n)?p=1:p=un(p);var j=an(d)?Su:or;return j(d,p)}function m(d){var p=an(d)?Fy:Ld;return p(d)}function b(d){if(d==null)return 0;if(Zo(d))return w0(d)?mu(d):d.length;var p=Ta(d);return p==nt||p==Xt?d.size:hh(d).length}function C(d,p,T){var j=an(d)?il:Y1;return T&&Fn(d,p,T)&&(p=n),j(d,Ot(p,3))}var O=rn(function(d,p){if(d==null)return[];var T=p.length;return T>1&&Fn(d,p[0],p[1])?p=[]:T>2&&Fn(p[0],p[1],p[2])&&(p=[p[0]]),ph(d,_r(p,1),[])}),W=Kn||function(){return zn.Date.now()};function le(d,p){if(typeof p!="function")throw new Bo(i);return d=un(d),function(){if(--d<1)return p.apply(this,arguments)}}function ge(d,p,T){return p=T?n:p,p=d&&p==null?d.length:p,qi(d,_,n,n,n,n,p)}function Pe(d,p){var T;if(typeof p!="function")throw new Bo(i);return d=un(d),function(){return--d>0&&(T=p.apply(this,arguments)),d<=1&&(p=n),T}}var Ge=rn(function(d,p,T){var j=I;if(T.length){var z=_o(T,Sl(Ge));j|=R}return qi(d,j,p,T,z)}),rt=rn(function(d,p,T){var j=I|M;if(T.length){var z=_o(T,Sl(rt));j|=R}return qi(p,j,d,T,z)});function qe(d,p,T){p=T?n:p;var j=qi(d,B,n,n,n,n,n,p);return j.placeholder=qe.placeholder,j}function yt(d,p,T){p=T?n:p;var j=qi(d,k,n,n,n,n,n,p);return j.placeholder=yt.placeholder,j}function Dt(d,p,T){var j,z,ee,ce,ve,Te,We=0,$e=!1,Ke=!1,mt=!0;if(typeof d!="function")throw new Bo(i);p=Ki(p)||0,Sr(T)&&($e=!!T.leading,Ke="maxWait"in T,ee=Ke?kr(Ki(T.maxWait)||0,p):ee,mt="trailing"in T?!!T.trailing:mt);function Nt(Wr){var As=j,Pu=z;return j=z=n,We=Wr,ce=d.apply(Pu,As),ce}function Yt(Wr){return We=Wr,ve=Lc(mn,p),$e?Nt(Wr):ce}function cn(Wr){var As=Wr-Te,Pu=Wr-We,CC=p-As;return Ke?ma(CC,ee-Pu):CC}function zt(Wr){var As=Wr-Te,Pu=Wr-We;return Te===n||As>=p||As<0||Ke&&Pu>=ee}function mn(){var Wr=W();if(zt(Wr))return Sn(Wr);ve=Lc(mn,cn(Wr))}function Sn(Wr){return ve=n,mt&&j?Nt(Wr):(j=z=n,ce)}function Ti(){ve!==n&&kc(ve),We=0,j=Te=z=ve=n}function Co(){return ve===n?ce:Sn(W())}function Ii(){var Wr=W(),As=zt(Wr);if(j=arguments,z=this,Te=Wr,As){if(ve===n)return Yt(Te);if(Ke)return kc(ve),ve=Lc(mn,p),Nt(Te)}return ve===n&&(ve=Lc(mn,p)),ce}return Ii.cancel=Ti,Ii.flush=Co,Ii}var Et=rn(function(d,p){return Sm(d,1,p)}),br=rn(function(d,p,T){return Sm(d,Ki(p)||0,T)});function Ce(d){return qi(d,U)}function ye(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new Bo(i);var T=function(){var j=arguments,z=p?p.apply(this,j):j[0],ee=T.cache;if(ee.has(z))return ee.get(z);var ce=d.apply(this,j);return T.cache=ee.set(z,ce)||ee,ce};return T.cache=new(ye.Cache||Ho),T}ye.Cache=Ho;function Me(d){if(typeof d!="function")throw new Bo(i);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function lt(d){return Pe(2,d)}var xt=By(function(d,p){p=p.length==1&&an(p[0])?jn(p[0],It(Ot())):jn(_r(p,1),It(Ot()));var T=p.length;return rn(function(j){for(var z=-1,ee=ma(j.length,T);++z=p}),Qd=Tm(function(){return arguments}())?Tm:function(d){return Ar(d)&&In.call(d,"callee")&&!qf.call(d,"callee")},an=Oe.isArray,LP=rl?It(rl):ch;function Zo(d){return d!=null&&y0(d.length)&&!Fu(d)}function Vr(d){return Ar(d)&&Zo(d)}function RP(d){return d===!0||d===!1||Ar(d)&&ba(d)==Ze}var Hc=vm||yS,_P=Gr?It(Gr):Ly;function BP(d){return Ar(d)&&d.nodeType===1&&!mg(d)}function HP(d){if(d==null)return!0;if(Zo(d)&&(an(d)||typeof d=="string"||typeof d.splice=="function"||Hc(d)||Qh(d)||Qd(d)))return!d.length;var p=Ta(d);if(p==nt||p==Xt)return!d.size;if(Wd(d))return!hh(d).length;for(var T in d)if(In.call(d,T))return!1;return!0}function UP(d,p){return Ic(d,p)}function YP(d,p,T){T=typeof T=="function"?T:n;var j=T?T(d,p):n;return j===n?Ic(d,p,n,T):!!j}function lS(d){if(!Ar(d))return!1;var p=ba(d);return p==tn||p==Ct||typeof d.message=="string"&&typeof d.name=="string"&&!mg(d)}function zP(d){return typeof d=="number"&&mc(d)}function Fu(d){if(!Sr(d))return!1;var p=ba(d);return p==_e||p==et||p==Xe||p==_t}function uC(d){return typeof d=="number"&&d==un(d)}function y0(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=se}function Sr(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function Ar(d){return d!=null&&typeof d=="object"}var cC=gs?It(gs):dh;function VP(d,p){return d===p||fh(d,p,Nh(p))}function WP(d,p,T){return T=typeof T=="function"?T:n,fh(d,p,Nh(p),T)}function $P(d){return dC(d)&&d!=+d}function ZP(d){if(Xy(d))throw new Qt(o);return Em(d)}function qP(d){return d===null}function GP(d){return d==null}function dC(d){return typeof d=="number"||Ar(d)&&ba(d)==ht}function mg(d){if(!Ar(d)||ba(d)!=Tt)return!1;var p=hi(d);if(p===null)return!0;var T=In.call(p,"constructor")&&p.constructor;return typeof T=="function"&&T instanceof T&&wd.call(T)==$f}var uS=_i?It(_i):Ry;function JP(d){return uC(d)&&d>=-se&&d<=se}var fC=al?It(al):Cm;function w0(d){return typeof d=="string"||!an(d)&&Ar(d)&&ba(d)==dn}function Di(d){return typeof d=="symbol"||Ar(d)&&ba(d)==en}var Qh=ic?It(ic):Ad;function KP(d){return d===n}function QP(d){return Ar(d)&&Ta(d)==Dn}function XP(d){return Ar(d)&&ba(d)==Er}var ej=Ud(yl),tj=Ud(function(d,p){return d<=p});function hC(d){if(!d)return[];if(Zo(d))return w0(d)?yo(d):Ha(d);if(Ss&&d[Ss])return j1(d[Ss]());var p=Ta(d),T=p==nt?Yf:p==Xt?sl:Xh;return T(d)}function Ou(d){if(!d)return d===0?d:0;if(d=Ki(d),d===he||d===-he){var p=d<0?-1:1;return p*ue}return d===d?d:0}function un(d){var p=Ou(d),T=p%1;return p===p?T?p-T:p:0}function pC(d){return d?Ts(un(d),0,oe):0}function Ki(d){if(typeof d=="number")return d;if(Di(d))return X;if(Sr(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=Sr(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=ot(d);var T=su.test(d);return T||ji.test(d)?el(d.slice(2),T?2:8):nc.test(d)?X:+d}function mC(d){return wi(d,qo(d))}function nj(d){return d?Ts(un(d),-se,se):d===0?d:0}function Yn(d){return d==null?"":hr(d)}var rj=Ac(function(d,p){if(Wd(p)||Zo(p)){wi(p,Ca(p),d);return}for(var T in p)In.call(p,T)&&Du(d,T,p[T])}),gC=Ac(function(d,p){wi(p,qo(p),d)}),b0=Ac(function(d,p,T,j){wi(p,qo(p),d,j)}),aj=Ac(function(d,p,T,j){wi(p,Ca(p),d,j)}),oj=Gi(ih);function ij(d,p){var T=bc(d);return p==null?T:Xn(T,p)}var sj=rn(function(d,p){d=Un(d);var T=-1,j=p.length,z=j>2?p[2]:n;for(z&&Fn(p[0],p[1],z)&&(j=1);++T1),ee}),wi(d,Yd(d),T),j&&(T=no(T,g|y|w,qy));for(var z=p.length;z--;)Cu(T,p[z]);return T});function Ej(d,p){return yC(d,Me(Ot(p)))}var Cj=Gi(function(d,p){return d==null?{}:Cc(d,p)});function yC(d,p){if(d==null)return{};var T=jn(Yd(d),function(j){return[j]});return p=Ot(p),Mm(d,T,function(j,z){return p(j,z[0])})}function xj(d,p,T){p=Is(p,d);var j=-1,z=p.length;for(z||(z=1,d=n);++jp){var j=d;d=p,p=j}if(T||d%1||p%1){var z=Id();return ma(d+z*(p-d+oc("1e-"+((z+"").length-1))),p)}return jd(d,p)}var _j=Cs(function(d,p,T){return p=p.toLowerCase(),d+(T?SC(p):p)});function SC(d){return fS(Yn(d).toLowerCase())}function DC(d){return d=Yn(d),d&&d.replace(lu,Qa).replace(Bf,"")}function Bj(d,p,T){d=Yn(d),p=hr(p);var j=d.length;T=T===n?j:Ts(un(T),0,j);var z=T;return T-=p.length,T>=0&&d.slice(T,z)==p}function Hj(d){return d=Yn(d),d&&tt.test(d)?d.replace(He,pu):d}function Uj(d){return d=Yn(d),d&&ta.test(d)?d.replace(yr,"\\$&"):d}var Yj=Cs(function(d,p,T){return d+(T?"-":"")+p.toLowerCase()}),zj=Cs(function(d,p,T){return d+(T?" ":"")+p.toLowerCase()}),Vj=Bm("toLowerCase");function Wj(d,p,T){d=Yn(d),p=un(p);var j=p?mu(d):0;if(!p||j>=p)return d;var z=(p-j)/2;return Hd(ll(z),T)+d+Hd(vu(z),T)}function $j(d,p,T){d=Yn(d),p=un(p);var j=p?mu(d):0;return p&&j>>0,T?(d=Yn(d),d&&(typeof p=="string"||p!=null&&!uS(p))&&(p=hr(p),!p&&dc(d))?Es(yo(d),0,T):d.split(p,T)):[]}var Xj=Cs(function(d,p,T){return d+(T?" ":"")+fS(p)});function eL(d,p,T){return d=Yn(d),T=T==null?0:Ts(un(T),0,d.length),p=hr(p),d.slice(T,T+p.length)==p}function tL(d,p,T){var j=J.templateSettings;T&&Fn(d,p,T)&&(p=n),d=Yn(d),p=b0({},p,j,Ym);var z=b0({},p.imports,j.imports,Ym),ee=Ca(z),ce=Kt(z,ee),ve,Te,We=0,$e=p.interpolate||ds,Ke="__p += '",mt=yd((p.escape||ds).source+"|"+$e.source+"|"+($e===On?si:ds).source+"|"+(p.evaluate||ds).source+"|$","g"),Nt="//# sourceURL="+(In.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bn+"]")+` `;d.replace(mt,function(zt,mn,Sn,Ti,Co,Ii){return Sn||(Sn=Ti),Ke+=d.slice(We,Ii).replace(rc,vd),mn&&(ve=!0,Ke+=`' + __e(`+mn+`) + '`),Co&&(Te=!0,Ke+=`'; @@ -9,65 +9,65 @@ __e(`+mn+`) + __p += '`),Sn&&(Ke+=`' + ((__t = (`+Sn+`)) == null ? '' : __t) + '`),We=Ii+zt.length,zt}),Ke+=`'; -`;var Ut=Tn.call(p,"variable")&&p.variable;if(!Ut)Ke=`with (obj) { +`;var Yt=In.call(p,"variable")&&p.variable;if(!Yt)Ke=`with (obj) { `+Ke+` } -`;else if(Oa.test(Ut))throw new Qt(l);Ke=(Te?Ke.replace(te,""):Ke).replace(me,"$1").replace(xe,"$1;"),Ke="function("+(Ut||"obj")+`) { -`+(Ut?"":`obj || (obj = {}); +`;else if(Oa.test(Yt))throw new Qt(l);Ke=(Te?Ke.replace(te,""):Ke).replace(me,"$1").replace(xe,"$1;"),Ke="function("+(Yt||"obj")+`) { +`+(Yt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ve?", __e = _.escape":"")+(Te?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Ke+`return __p -}`;var cn=IC(function(){return Dn(ee,Nt+"return "+Ke).apply(n,de)});if(cn.source=Ke,lS(cn))throw cn;return cn}function tL(d){return Un(d).toLowerCase()}function nL(d){return Un(d).toUpperCase()}function rL(d,p,T){if(d=Un(d),d&&(T||p===n))return ot(d);if(!d||!(p=hr(p)))return d;var j=yo(d),z=yo(p),ee=Hn(j,z),de=oa(j,z)+1;return Es(j,ee,de).join("")}function aL(d,p,T){if(d=Un(d),d&&(T||p===n))return d.slice(0,Vf(d)+1);if(!d||!(p=hr(p)))return d;var j=yo(d),z=oa(j,yo(p))+1;return Es(j,0,z).join("")}function oL(d,p,T){if(d=Un(d),d&&(T||p===n))return d.replace(Pi,"");if(!d||!(p=hr(p)))return d;var j=yo(d),z=Hn(j,yo(p));return Es(j,z).join("")}function iL(d,p){var T=Z,j=Q;if(Sr(p)){var z="separator"in p?p.separator:z;T="length"in p?un(p.length):T,j="omission"in p?hr(p.omission):j}d=Un(d);var ee=d.length;if(dc(d)){var de=yo(d);ee=de.length}if(T>=ee)return d;var ve=T-mu(j);if(ve<1)return j;var Te=de?Es(de,0,ve).join(""):d.slice(0,ve);if(z===n)return Te+j;if(de&&(ve+=Te.length-ve),uS(z)){if(d.slice(ve).search(z)){var We,$e=Te;for(z.global||(z=yd(z.source,Un(li.exec(z))+"g")),z.lastIndex=0;We=z.exec($e);)var Ke=We.index;Te=Te.slice(0,Ke===n?ve:Ke)}}else if(d.indexOf(hr(z),ve)!=ve){var mt=Te.lastIndexOf(z);mt>-1&&(Te=Te.slice(0,mt))}return Te+j}function sL(d){return d=Un(d),d&&Qe.test(d)?d.replace(Ye,wy):d}var lL=Cs(function(d,p,T){return d+(T?" ":"")+p.toUpperCase()}),fS=Bm("toUpperCase");function TC(d,p,T){return d=Un(d),p=T?n:p,p===n?P1(d)?_1(d):lc(d):d.match(p)||[]}var IC=rn(function(d,p){try{return xr(d,n,p)}catch(T){return lS(T)?T:new Qt(T)}}),uL=Gi(function(d,p){return wr(p,function(T){T=bi(T),Wi(d,T,Ge(d[T],d))}),d});function cL(d){var p=d==null?0:d.length,T=Ot();return d=p?jn(d,function(j){if(typeof j[1]!="function")throw new Bo(i);return[T(j[0]),j[1]]}):[],rn(function(j){for(var z=-1;++zie)return[];var T=ae,j=ma(d,ae);p=Ot(p),d-=ae;for(var z=Ee(j,p);++T0||p<0)?new nn(T):(d<0?T=T.takeRight(-d):d&&(T=T.drop(d)),p!==n&&(p=un(p),T=p<0?T.dropRight(-p):T.take(p-d)),T)},nn.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},nn.prototype.toArray=function(){return this.take(ae)},zo(nn.prototype,function(d,p){var T=/^(?:filter|find|map|reject)|While$/.test(p),j=/^(?:head|last)$/.test(p),z=J[j?"take"+(p=="last"?"Right":""):p],ee=j||/^find/.test(p);z&&(J.prototype[p]=function(){var de=this.__wrapped__,ve=j?[1]:arguments,Te=de instanceof nn,We=ve[0],$e=Te||an(de),Ke=function(mn){var Sn=z.apply(J,Ro([mn],ve));return j&&mt?Sn[0]:Sn};$e&&T&&typeof We=="function"&&We.length!=1&&(Te=$e=!1);var mt=this.__chain__,Nt=!!this.__actions__.length,Ut=ee&&!mt,cn=Te&&!Nt;if(!ee&&$e){de=cn?de:new nn(this);var zt=d.apply(de,ve);return zt.__actions__.push({func:Yh,args:[Ke],thisArg:n}),new ga(zt,mt)}return Ut&&cn?d.apply(this,ve):(zt=this.thru(Ke),Ut?j?zt.value()[0]:zt.value():zt)})}),wr(["pop","push","shift","sort","splice","unshift"],function(d){var p=ws[d],T=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",j=/^(?:pop|shift)$/.test(d);J.prototype[d]=function(){var z=arguments;if(j&&!this.__chain__){var ee=this.value();return p.apply(an(ee)?ee:[],z)}return this[T](function(de){return p.apply(an(de)?de:[],z)})}}),zo(nn.prototype,function(d,p){var T=J[p];if(T){var j=T.name+"";Tn.call(yc,j)||(yc[j]=[]),yc[j].push({name:p,func:T})}}),yc[Fc(n,M).name]=[{name:"wrapper",func:n}],nn.prototype.clone=th,nn.prototype.reverse=wm,nn.prototype.value=Sc,J.prototype.at=kl,J.prototype.chain=Uh,J.prototype.commit=Au,J.prototype.next=zh,J.prototype.plant=cg,J.prototype.reverse=nS,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=dg,J.prototype.first=J.prototype.head,Ss&&(J.prototype[Ss]=ug),J},fc=B1();Lo?((Lo.exports=fc)._=fc,nl._=fc):zn._=fc}).call(dr)})(Ew,Ew.exports);var vb=Ew.exports;const Cw=qt(vb);function S0(e){const t=e.match(/^#+/);return t?t[0].length:0}function OC(e,t){const n=e.split(` +}`;var cn=IC(function(){return Tn(ee,Nt+"return "+Ke).apply(n,ce)});if(cn.source=Ke,lS(cn))throw cn;return cn}function nL(d){return Yn(d).toLowerCase()}function rL(d){return Yn(d).toUpperCase()}function aL(d,p,T){if(d=Yn(d),d&&(T||p===n))return ot(d);if(!d||!(p=hr(p)))return d;var j=yo(d),z=yo(p),ee=Hn(j,z),ce=oa(j,z)+1;return Es(j,ee,ce).join("")}function oL(d,p,T){if(d=Yn(d),d&&(T||p===n))return d.slice(0,Vf(d)+1);if(!d||!(p=hr(p)))return d;var j=yo(d),z=oa(j,yo(p))+1;return Es(j,0,z).join("")}function iL(d,p,T){if(d=Yn(d),d&&(T||p===n))return d.replace(Pi,"");if(!d||!(p=hr(p)))return d;var j=yo(d),z=Hn(j,yo(p));return Es(j,z).join("")}function sL(d,p){var T=Z,j=Q;if(Sr(p)){var z="separator"in p?p.separator:z;T="length"in p?un(p.length):T,j="omission"in p?hr(p.omission):j}d=Yn(d);var ee=d.length;if(dc(d)){var ce=yo(d);ee=ce.length}if(T>=ee)return d;var ve=T-mu(j);if(ve<1)return j;var Te=ce?Es(ce,0,ve).join(""):d.slice(0,ve);if(z===n)return Te+j;if(ce&&(ve+=Te.length-ve),uS(z)){if(d.slice(ve).search(z)){var We,$e=Te;for(z.global||(z=yd(z.source,Yn(li.exec(z))+"g")),z.lastIndex=0;We=z.exec($e);)var Ke=We.index;Te=Te.slice(0,Ke===n?ve:Ke)}}else if(d.indexOf(hr(z),ve)!=ve){var mt=Te.lastIndexOf(z);mt>-1&&(Te=Te.slice(0,mt))}return Te+j}function lL(d){return d=Yn(d),d&&Qe.test(d)?d.replace(Ue,wy):d}var uL=Cs(function(d,p,T){return d+(T?" ":"")+p.toUpperCase()}),fS=Bm("toUpperCase");function TC(d,p,T){return d=Yn(d),p=T?n:p,p===n?P1(d)?_1(d):lc(d):d.match(p)||[]}var IC=rn(function(d,p){try{return xr(d,n,p)}catch(T){return lS(T)?T:new Qt(T)}}),cL=Gi(function(d,p){return wr(p,function(T){T=bi(T),Wi(d,T,Ge(d[T],d))}),d});function dL(d){var p=d==null?0:d.length,T=Ot();return d=p?jn(d,function(j){if(typeof j[1]!="function")throw new Bo(i);return[T(j[0]),j[1]]}):[],rn(function(j){for(var z=-1;++zse)return[];var T=oe,j=ma(d,oe);p=Ot(p),d-=oe;for(var z=Ee(j,p);++T0||p<0)?new nn(T):(d<0?T=T.takeRight(-d):d&&(T=T.drop(d)),p!==n&&(p=un(p),T=p<0?T.dropRight(-p):T.take(p-d)),T)},nn.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},nn.prototype.toArray=function(){return this.take(oe)},zo(nn.prototype,function(d,p){var T=/^(?:filter|find|map|reject)|While$/.test(p),j=/^(?:head|last)$/.test(p),z=J[j?"take"+(p=="last"?"Right":""):p],ee=j||/^find/.test(p);z&&(J.prototype[p]=function(){var ce=this.__wrapped__,ve=j?[1]:arguments,Te=ce instanceof nn,We=ve[0],$e=Te||an(ce),Ke=function(mn){var Sn=z.apply(J,Ro([mn],ve));return j&&mt?Sn[0]:Sn};$e&&T&&typeof We=="function"&&We.length!=1&&(Te=$e=!1);var mt=this.__chain__,Nt=!!this.__actions__.length,Yt=ee&&!mt,cn=Te&&!Nt;if(!ee&&$e){ce=cn?ce:new nn(this);var zt=d.apply(ce,ve);return zt.__actions__.push({func:Uh,args:[Ke],thisArg:n}),new ga(zt,mt)}return Yt&&cn?d.apply(this,ve):(zt=this.thru(Ke),Yt?j?zt.value()[0]:zt.value():zt)})}),wr(["pop","push","shift","sort","splice","unshift"],function(d){var p=ws[d],T=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",j=/^(?:pop|shift)$/.test(d);J.prototype[d]=function(){var z=arguments;if(j&&!this.__chain__){var ee=this.value();return p.apply(an(ee)?ee:[],z)}return this[T](function(ce){return p.apply(an(ce)?ce:[],z)})}}),zo(nn.prototype,function(d,p){var T=J[p];if(T){var j=T.name+"";In.call(yc,j)||(yc[j]=[]),yc[j].push({name:p,func:T})}}),yc[Fc(n,M).name]=[{name:"wrapper",func:n}],nn.prototype.clone=th,nn.prototype.reverse=wm,nn.prototype.value=Sc,J.prototype.at=kl,J.prototype.chain=Yh,J.prototype.commit=Au,J.prototype.next=zh,J.prototype.plant=cg,J.prototype.reverse=nS,J.prototype.toJSON=J.prototype.valueOf=J.prototype.value=dg,J.prototype.first=J.prototype.head,Ss&&(J.prototype[Ss]=ug),J},fc=B1();Lo?((Lo.exports=fc)._=fc,nl._=fc):zn._=fc}).call(dr)})(Ew,Ew.exports);var vb=Ew.exports;const Cw=qt(vb);function S0(e){const t=e.match(/^#+/);return t?t[0].length:0}function OC(e,t){const n=e.split(` `);let r="",a=[],o=!1,i=1;for(let l=0;lS0(t)?a.push(c):(o=!1,a=[])}else o&&a.push(c)}return t?vb.isEmpty(a)?{content:"",startLine:-1}:{content:a.join(` -`),startLine:i}:{content:e,startLine:0}}function k2(e){const t={};for(const n of e)n.parent&&n.parent>0&&(t[n.position.start.line]=n.parent);return t}function AR(e,t,n){var g;const r={},a=(y,w)=>{for(;y[w]!==void 0&&y[w]!==w;)w=y[w];return w},o=ft.getState().app,i=n.split(` -`),l=t+i.length-1,c=(g=o.metadataCache.getFileCache(e))==null?void 0:g.listItems,f={};if(!c)return[];c.forEach(y=>{var D,I;const w=y.position.start.line,S=y.position.end.line;if(w>=t&&S<=l){const M=w-t,N=S-t,_=i.slice(M,N+1),k=_.join(` -`);if(y.parent&&y.parent>0&&(r[y.position.start.line]=y.parent),y.parent&&f[y.parent]){if(w-y.parent===1){const L=(D=i[M])==null?void 0:D.match(/^(\s*)/);L&&(f[y.parent].indent=L[0])}const B=new RegExp("^"+f[y.parent].indent);f[y.parent].content+=` +`),startLine:i}:{content:e,startLine:0}}function k2(e){const t={};for(const n of e)n.parent&&n.parent>0&&(t[n.position.start.line]=n.parent);return t}function FR(e,t,n){var g;const r={},a=(y,w)=>{for(;y[w]!==void 0&&y[w]!==w;)w=y[w];return w},o=ft.getState().app,i=n.split(` +`),l=t+i.length-1,c=(g=o.metadataCache.getFileCache(e))==null?void 0:g.listItems,f={};if(!c)return[];c.forEach(y=>{var D,I;const w=y.position.start.line,S=y.position.end.line;if(w>=t&&S<=l){const M=w-t,N=S-t,B=i.slice(M,N+1),k=B.join(` +`);if(y.parent&&y.parent>0&&(r[y.position.start.line]=y.parent),y.parent&&f[y.parent]){if(w-y.parent===1){const L=(D=i[M])==null?void 0:D.match(/^(\s*)/);L&&(f[y.parent].indent=L[0])}const R=new RegExp("^"+f[y.parent].indent);f[y.parent].content+=` `+k.split(` -`).map(L=>L==null?void 0:L.replace(B,"")).join(` -`)}else if(y.parent&&f[a(r,y.parent)]){const B=new RegExp("^"+f[a(r,y.parent)].indent);f[a(r,y.parent)].content+=` +`).map(L=>L==null?void 0:L.replace(R,"")).join(` +`)}else if(y.parent&&f[a(r,y.parent)]){const R=new RegExp("^"+f[a(r,y.parent)].indent);f[a(r,y.parent)].content+=` `+k.split(` -`).map(L=>L==null?void 0:L.replace(B,"")).join(` -`)}else if(new RegExp(mR).test(k)){f[w]||(f[w]={content:"",blockId:"",indent:""});const B=_.length>1&&((I=_[1])==null?void 0:I.match(/^(\s*)/));B&&(f[w].indent=B[0]),f[w].content=k.split(` +`).map(L=>L==null?void 0:L.replace(R,"")).join(` +`)}else if(new RegExp(gR).test(k)){f[w]||(f[w]={content:"",blockId:"",indent:""});const R=B.length>1&&((I=B[1])==null?void 0:I.match(/^(\s*)/));R&&(f[w].indent=R[0]),f[w].content=k.split(` `).map(L=>L==null?void 0:L.replace(f[w].indent,"")).join(` -`),f[w].blockId=y.id}}});const h=Object.keys(f).map(y=>({line:f[y].content,blockId:f[y].blockId||"",index:parseInt(y)}));return e.path.includes("2024-04-07"),h}async function FR(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new x.Notice(E("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),dt.setChangedByMemos(!0)),n}async function OR(e,t){var a;let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=(a=t.metadataCache.getFileCache(e))==null?void 0:a.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function PR(e){const t=e.split(/\r?\n/),n=[];let r=!1,a=[],o="";for(let i=0;i [!thino]")?(r&&(n.push({metadata:o,content:a.join(` +`),f[w].blockId=y.id}}});const h=Object.keys(f).map(y=>({line:f[y].content,blockId:f[y].blockId||"",index:parseInt(y)}));return e.path.includes("2024-04-07"),h}async function OR(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new x.Notice(E("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),dt.setChangedByMemos(!0)),n}async function PR(e,t){var a;let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=(a=t.metadataCache.getFileCache(e))==null?void 0:a.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function jR(e){const t=e.split(/\r?\n/),n=[];let r=!1,a=[],o="";for(let i=0;i [!thino]")?(r&&(n.push({metadata:o,content:a.join(` `).trim()}),a=[]),r=!0,o=l.replace("> [!thino]","").trim()):r&&l.startsWith(">")?a.push(l.replace(/^> /,"")):r&&!l.startsWith(">")&&(r=!1,n.push({metadata:o,content:a.join(` `).trim()}),a=[],o="")}return r&&n.push({metadata:o,content:a.join(` -`).trim()}),n}const jR=e=>{let t;switch(e){case" ":t="TASK-TODO";break;case"x":case"X":t="TASK-DONE";break;default:t="TASK-"+e;break}return t};async function LR(e,t){if(!t)return 0;const{vault:n}=Le.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,a=e!=null&&e.ProcessEntriesBelow&&(e==null?void 0:e.ProcessContentTarget)!=="whole"?e==null?void 0:e.ProcessEntriesBelow:"",o=(e==null?void 0:e.ProcessContentTarget)!=="whole"?e!=null&&e.DifferentInsertTarget?e!=null&&e.InsertAfterForTask?e==null?void 0:e.InsertAfterForTask:"":a:"";let i;try{i=await n.read(t)}catch(S){console.error(S),i=await n.cachedRead(t)}let l;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?l="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):l="(-|\\*) (\\[(.{1})\\]\\s)?((\\)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const c=new RegExp(l,"g"),f=(i.match(c)||[]).length,h=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),g=new RegExp(o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),y=(i.match(h)||[]).length,w=(i.match(g)||[]).length;return i=null,y||w?f:0}function PC(e,t,n,r,a){var g,y,w;const o=Le.getState().dailyNotesState.app||window.app,i=hp(a,"day")||x.moment(a.stat.ctime);let l;const c=AR(a,n,t),f=o==null?void 0:o.metadataCache.getFileCache(a),h={frontmatter:(f==null?void 0:f.frontmatter)||{},tags:((g=f==null?void 0:f.frontmatter)==null?void 0:g.tags)||[]};for(const S of c){const D=HR(e.DefaultMemoComposition,S.line),I=YR(e.DefaultMemoComposition,S.line),M=UR(S.line);let N=RR(S.line);if(i.hours(parseInt(D)),i.minutes(parseInt(I)),M&&i.seconds(parseInt(M)),!M&&i.seconds(0),/^\s*[-*]\s(\[(.)\])\s/g.test(S.line)){const Z=zR(S.line);N=_R(S.line),l=jR(Z)}else l="JOURNAL";let _=N.trim().replaceAll(/
/g,` -`);const k=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(N),B=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(N),L=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(N),R=(y=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(N))==null?void 0:y[2],V=(w=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(N))==null?void 0:w[2],Y=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(N)?"PUBLIC":"PRIVATE";_=_.replace(/\s\[pinned::[^\]]+\]/g,"").replace(/\s\[visibility::[^\]]+\]/g,"").replace(/\s\[archived::[^\]]+\]/g,"").replace(/\s\[deleted::[^\]]+\]/g,"").replace(/\s\[webId::[^\]]+\]/g,""),S.blockId&&(_=_.replace("^"+(S==null?void 0:S.blockId),"")),r.push({id:i.format("YYYYMMDDHHmmss")+`${S.index}`,content:_.trim(),createdAt:i.format("YYYY/MM/DD HH:mm:ss"),updatedAt:i.format("YYYY/MM/DD HH:mm:ss"),thinoType:l,hasId:S.blockId?S.blockId:"",linkId:"",path:a.path,deletedAt:L?x.moment(R,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:B?"ARCHIVED":"NORMAL",visibility:Y,pinned:k,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:V,fileInfo:h})}}function RR(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,"$4")}function _R(e){return BR(e)}const BR=e=>{var r;let t;return t="^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(\\d{1,2}:\\d{2}(:\\d{2})?)\\s([\\w\\W]*)",(r=new RegExp(t,"").exec(e))==null?void 0:r[4]},HR=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)",(a=new RegExp(n,"").exec(t))==null?void 0:a[6]},YR=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},UR=e=>{var r;const t="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)";return(r=new RegExp(t,"").exec(e))==null?void 0:r[7]},zR=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)/.exec(e))==null?void 0:t[2]},mA=()=>Kg()?!0:(new x.Notice(E("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function gA(e,t){var l;if(!e)return t;const n=Le.getState().dailyNotesState.app||window.app,r=await OR(e,n);let a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");const o=n==null?void 0:n.metadataCache.getFileCache(e),i={frontmatter:(o==null?void 0:o.frontmatter)||{},tags:((l=o==null?void 0:o.frontmatter)==null?void 0:l.tags)||[]};await n.fileManager.processFrontMatter(e,c=>{if(c.id||(c.id=ut.randomId(16)),c.createdAt?a=x.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?c.createdAt:a:c.createdAt=a,!r.trim())return t;const f=!!c.pinned,h=c.rowStatus&&c.rowStatus==="ARCHIVED",g=!!c.deletedAt,y=c.deletedAt?c.deletedAt:"",w=c.visibility?c.visibility:"PRIVATE",S=c.thinoType?c.thinoType:"JOURNAL",D=c.webId?c.webId:"",I=c.id?c.id:"",M=c.hasId?c.hasId:"",N=c.linkId?c.linkId:"",_=e.path,k="Memo",B="MULTI",L=[];return t.push({id:I,content:r,createdAt:a,updatedAt:a,deletedAt:g?x.moment(y,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:f,rowStatus:h?"ARCHIVED":"NORMAL",visibility:w,thinoType:S,hasId:M,linkId:N,path:_,creatorName:k,sourceType:B,resourceList:L,webId:D,fileInfo:i}),t})}async function fT(e,t){var I,M,N,_,k,B,L;if(!e)return t;const{vault:n,metadataCache:r}=Le.getState().dailyNotesState.app||window.app;let a;try{a=await n.read(e)}catch(R){console.error(R),a=await n.cachedRead(e)}if(!a)return;const o=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),i=x.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),l=e.path,c="Thino",f="FILE",h="",g="",y=[],w=r.getFileCache(e),S={frontmatter:(w==null?void 0:w.frontmatter)||{},tags:((I=w==null?void 0:w.frontmatter)==null?void 0:I.tags)||[]},D=PR(a);for(const R of D){const V=R.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!V)continue;const Y=(N=(M=R.metadata.match(/id::([^\]]*)/g))==null?void 0:M[0])==null?void 0:N.replace("id::","");if(!Y)continue;const Z=V?V[0]:o,Q=V?V[0]:i,G=R.metadata.match(/webId::([^\]]*)/g)?(k=(_=R.metadata.match(/webId::([^\]]*)/g))==null?void 0:_[0])==null?void 0:k.replace("webId::",""):"",le=R.metadata.contains("[pinned::true]"),se=R.metadata.contains("[archived::true]"),fe=R.metadata.contains("[deleted::"),$=(B=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(R.metadata))==null?void 0:B[2],he=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(R.metadata)?"PUBLIC":"PRIVATE",ie=(L=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(R.metadata))==null?void 0:L[2];t.push({id:Y,content:R.content,createdAt:Z,updatedAt:Q,deletedAt:fe?x.moment($,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:le,rowStatus:se?"ARCHIVED":"NORMAL",visibility:he,thinoType:ie||"JOURNAL",hasId:h,linkId:g,path:l,creatorName:c,sourceType:f,resourceList:y,webId:G,fileInfo:S})}return t}async function vA(e,t){if(!e)return[];const n=Le.getState().dailyNotesState.settings,{vault:r}=Le.getState().dailyNotesState.app||window.app;if(await LR(n,e)===0)return;let o;try{o=await r.read(e)}catch(g){console.error(g),o=await r.cachedRead(e)}const{content:i,startLine:l}=OC(o,(n==null?void 0:n.ProcessContentTarget)==="whole"?"":n.ProcessEntriesBelow);let c="",f=0;if(n.DifferentInsertTarget&&(n==null?void 0:n.ProcessContentTarget)!=="whole"&&n.InsertAfterForTask&&!i.includes(n.InsertAfterForTask)){const{content:g,startLine:y}=OC(o,n.InsertAfterForTask);c=g,f=y}const h=[];PC(n,i,l,h,e),n.DifferentInsertTarget&&c&&PC(n,c,f,h,e),h.length!==0&&t.push(...h.sort((g,y)=>g.createdAt>y.createdAt?-1:1))}async function yA(e,t){const n=Le.getState().dailyNotesState.app||window.app;if(!(e instanceof x.TFile))return;let r;try{r=await n.vault.read(e)}catch(i){console.error(i),r=await n.vault.cachedRead(e)}if(!r)return;const a=JSON.parse(r),o=a==null?void 0:a.nodes;for(const i of o){if(i.type==="group"||i.createdAt===void 0||i.text.trim()==="")continue;const c=x.moment(i==null?void 0:i.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),f=x.moment(i==null?void 0:i.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),h=i!=null&&i.deletedAt?x.moment(i==null?void 0:i.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",g=!!(i!=null&&i.pinned),y=i!=null&&i.archived?"ARCHIVED":"NORMAL",w=i!=null&&i.visibility?i==null?void 0:i.visibility:"PRIVATE",S=i!=null&&i.thinoType?i==null?void 0:i.thinoType:"JOURNAL",D=i!=null&&i.text?i==null?void 0:i.text:"",I=i!=null&&i.id?i==null?void 0:i.id:"",M=i!=null&&i.hasId?i==null?void 0:i.hasId:"",N=i!=null&&i.linkId?i==null?void 0:i.linkId:"",_=e.path,k="Memo",B="CANVAS",L=[],R=i!=null&&i.webId?i==null?void 0:i.webId:void 0;t.push({id:I,content:D,createdAt:c,updatedAt:f,deletedAt:h,pinned:g,rowStatus:y,visibility:w,thinoType:S,hasId:M,linkId:N,path:_,creatorName:k,sourceType:B,resourceList:L,webId:R,fileInfo:{frontmatter:{},tags:[]}})}}async function jC(e=[]){const t=[],n=[],r=Le.getState().dailyNotesState.app||app,{vault:a}=r,{settings:o}=Le.getState().dailyNotesState,i=r.loadLocalStorage("tokenForSync"),l=async(c,f)=>{for(const h of c)try{await f(h,t,o)}catch(g){console.error(g),new x.Notice(g)}};try{if(e.includes("CANVAS")){const c=VR(a);await l(c,yA)}}catch(c){console.error(c)}try{if(e.includes("MULTI")){const c=WR(a,r,o);await l(c,gA)}}catch(c){console.error(c)}try{if(e.includes("DAILY")){const c=await $R(a);await l(c,vA)}}catch(c){console.error(c)}try{if(e.includes("FILE")||i){const c=ZR(a,r,o);await l(c,fT)}}catch(c){console.error(c)}return{memos:t,commentMemos:n}}function VR(e){return e.getAllLoadedFiles().filter(t=>t instanceof x.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function WR(e,t,n){const r=e.getMarkdownFiles(),a=r.filter(i=>{var l,c;return((l=i.parent)==null?void 0:l.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))&&!((c=i.path)!=null&&c.endsWith("thino.md"))}),o=n.TagForMultiTypeFiles?r.filter(i=>{var l,c,f;return!((l=i.parent)!=null&&l.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!((c=i.path)!=null&&c.endsWith("thino.md")))&&((f=x.getAllTags(t.metadataCache.getFileCache(i)))==null?void 0:f.contains("#"+n.TagForMultiTypeFiles.replace("#","")))}):[];return[...a,...o]}async function $R(e){const t=mb();t===void 0&&new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(x.normalizePath(t))||new x.Notice(E("Failed to find daily notes folder"));const r=Ju();return Object.values(r).filter(a=>a instanceof x.TFile&&a.extension==="md")}function ZR(e,t,n){const r=e.getMarkdownFiles(),a=r.filter(i=>i.name.trim().includes("thino")),o=n.TagForFileTypeFiles?r.filter(i=>{var l;return!i.name.trim().includes("thino")&&((l=x.getAllTags(t.metadataCache.getFileCache(i)))==null?void 0:l.contains("#"+n.TagForFileTypeFiles.replace("#","")))}):[];return[...a,...o]}const qR=async(e,t,n)=>{const r=await Rp(Le.getState().dailyNotesState.app)||[],a=r.find(l=>l.id===e),o={...a,title:t,querystring:n},i=r.findIndex(l=>l.id===e);return r[i]=o,await Av(Le.getState().dailyNotesState.app,r),[a]},GR="https://api.thino.pkmer.cn/test",_p=GR,JR="unknown",KR=/!\[(?[^\]]+)\]\((?[^)]+)\)/g;function QR(e){return e.substring(e.lastIndexOf(".")+1)}function XR(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${QR(e.id)}`,size:e.size.toString()}}function e_(e){const t=e==null?void 0:e.matchAll(KR);return t?Array.from(t).map(n=>{var r;return XR({url:(r=n.groups)==null?void 0:r.link,id:JR,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function Fv(e){var t;return{id:e.id,createdAt:x.moment(e.ctime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment(e.mtime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?x.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:e_(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime}}async function t_(e){const n={url:`${_p}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(o=>Fv(o))}catch(a){console.error(`Error processing memo response: ${a}`)}}).catch(r=>(console.error(r),[]))}function Bp(){const e=Le.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function N2(e){const t=`${_p}/thino/createThino`,n={content:e.content,thinoType:(e==null?void 0:e.thinoType)||"FILE",pinned:!1,rowStatus:"NORMAL",encrypted:!1},r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create memo: ${a.status}`);try{const o=a.json;return Fv(o.payload)}catch(o){console.error(`Error processing memo creation response: ${o}`)}}).catch(a=>(console.error(a),null))}function n_(e){return{id:e.id,ctime:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").valueOf(),mtime:x.moment(e.updatedAt,"YYYY/MM/DD HH:mm:ss").valueOf(),ttime:e.deletedAt?x.moment(e.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():void 0,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,encrypted:!1,thinoType:e.sourceType==="DAILY"?"DAILY":"FILE",tags:[]}}async function r_(e){const t=`${_p}/thino/createThinosByData`,n=e.map(a=>n_(a)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create thinos: ${a.status}`);try{return a.json.payload.map(l=>Fv(l))}catch(o){console.error(`Error processing thinos creation response: ${o}`)}}).catch(a=>(console.error(a),[]))}async function SS(e){const n={url:`${_p}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const a=r.json;return Fv(a.payload)}catch(a){console.error(`Error processing memo update response: ${a}`)}}).catch(r=>(console.error(r),null))}async function Xg(e){const n={url:`${_p}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const a=r.json;return Fv(a.payload)}catch(a){console.error(`Error processing memo recovery response: ${a}`)}}).catch(r=>(console.error(r),null))}async function A2(e){const n={url:`${_p}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}function a_(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function o_(e){const t=[];let n=e;for(;n.contains(` +`).trim()}),n}const LR=e=>{let t;switch(e){case" ":t="TASK-TODO";break;case"x":case"X":t="TASK-DONE";break;default:t="TASK-"+e;break}return t};async function RR(e,t){if(!t)return 0;const{vault:n}=Le.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,a=e!=null&&e.ProcessEntriesBelow&&(e==null?void 0:e.ProcessContentTarget)!=="whole"?e==null?void 0:e.ProcessEntriesBelow:"",o=(e==null?void 0:e.ProcessContentTarget)!=="whole"?e!=null&&e.DifferentInsertTarget?e!=null&&e.InsertAfterForTask?e==null?void 0:e.InsertAfterForTask:"":a:"";let i;try{i=await n.read(t)}catch(S){console.error(S),i=await n.cachedRead(t)}let l;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?l="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):l="(-|\\*) (\\[(.{1})\\]\\s)?((\\)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const c=new RegExp(l,"g"),f=(i.match(c)||[]).length,h=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),g=new RegExp(o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),y=(i.match(h)||[]).length,w=(i.match(g)||[]).length;return i=null,y||w?f:0}function PC(e,t,n,r,a){var g,y,w;const o=Le.getState().dailyNotesState.app||window.app,i=hp(a,"day")||x.moment(a.stat.ctime);let l;const c=FR(a,n,t),f=o==null?void 0:o.metadataCache.getFileCache(a),h={frontmatter:(f==null?void 0:f.frontmatter)||{},tags:((g=f==null?void 0:f.frontmatter)==null?void 0:g.tags)||[]};for(const S of c){const D=UR(e.DefaultMemoComposition,S.line),I=YR(e.DefaultMemoComposition,S.line),M=zR(S.line);let N=_R(S.line);if(i.hours(parseInt(D)),i.minutes(parseInt(I)),M&&i.seconds(parseInt(M)),!M&&i.seconds(0),/^\s*[-*]\s(\[(.)\])\s/g.test(S.line)){const Z=VR(S.line);N=BR(S.line),l=LR(Z)}else l="JOURNAL";let B=N.trim().replaceAll(/
/g,` +`);const k=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(N),R=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(N),L=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(N),_=(y=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(N))==null?void 0:y[2],V=(w=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(N))==null?void 0:w[2],U=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(N)?"PUBLIC":"PRIVATE";B=B.replace(/\s\[pinned::[^\]]+\]/g,"").replace(/\s\[visibility::[^\]]+\]/g,"").replace(/\s\[archived::[^\]]+\]/g,"").replace(/\s\[deleted::[^\]]+\]/g,"").replace(/\s\[webId::[^\]]+\]/g,""),S.blockId&&(B=B.replace("^"+(S==null?void 0:S.blockId),"")),r.push({id:i.format("YYYYMMDDHHmmss")+`${S.index}`,content:B.trim(),createdAt:i.format("YYYY/MM/DD HH:mm:ss"),updatedAt:i.format("YYYY/MM/DD HH:mm:ss"),thinoType:l,hasId:S.blockId?S.blockId:"",linkId:"",path:a.path,deletedAt:L?x.moment(_,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:R?"ARCHIVED":"NORMAL",visibility:U,pinned:k,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:V,fileInfo:h})}}function _R(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,"$4")}function BR(e){return HR(e)}const HR=e=>{var r;let t;return t="^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(\\d{1,2}:\\d{2}(:\\d{2})?)\\s([\\w\\W]*)",(r=new RegExp(t,"").exec(e))==null?void 0:r[4]},UR=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)",(a=new RegExp(n,"").exec(t))==null?void 0:a[6]},YR=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},zR=e=>{var r;const t="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)";return(r=new RegExp(t,"").exec(e))==null?void 0:r[7]},VR=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)/.exec(e))==null?void 0:t[2]},mA=()=>Kg()?!0:(new x.Notice(E("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function gA(e,t){var l;if(!e)return t;const n=Le.getState().dailyNotesState.app||window.app,r=await PR(e,n);let a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");const o=n==null?void 0:n.metadataCache.getFileCache(e),i={frontmatter:(o==null?void 0:o.frontmatter)||{},tags:((l=o==null?void 0:o.frontmatter)==null?void 0:l.tags)||[]};await n.fileManager.processFrontMatter(e,c=>{if(c.id||(c.id=ut.randomId(16)),c.createdAt?a=x.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?c.createdAt:a:c.createdAt=a,!r.trim())return t;const f=!!c.pinned,h=c.rowStatus&&c.rowStatus==="ARCHIVED",g=!!c.deletedAt,y=c.deletedAt?c.deletedAt:"",w=c.visibility?c.visibility:"PRIVATE",S=c.thinoType?c.thinoType:"JOURNAL",D=c.webId?c.webId:"",I=c.id?c.id:"",M=c.hasId?c.hasId:"",N=c.linkId?c.linkId:"",B=e.path,k="Memo",R="MULTI",L=[];return t.push({id:I,content:r,createdAt:a,updatedAt:a,deletedAt:g?x.moment(y,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:f,rowStatus:h?"ARCHIVED":"NORMAL",visibility:w,thinoType:S,hasId:M,linkId:N,path:B,creatorName:k,sourceType:R,resourceList:L,webId:D,fileInfo:i}),t})}async function fT(e,t){var I,M,N,B,k,R,L;if(!e)return t;const{vault:n,metadataCache:r}=Le.getState().dailyNotesState.app||window.app;let a;try{a=await n.read(e)}catch(_){console.error(_),a=await n.cachedRead(e)}if(!a)return;const o=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),i=x.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),l=e.path,c="Thino",f="FILE",h="",g="",y=[],w=r.getFileCache(e),S={frontmatter:(w==null?void 0:w.frontmatter)||{},tags:((I=w==null?void 0:w.frontmatter)==null?void 0:I.tags)||[]},D=jR(a);for(const _ of D){const V=_.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!V)continue;const U=(N=(M=_.metadata.match(/id::([^\]]*)/g))==null?void 0:M[0])==null?void 0:N.replace("id::","");if(!U)continue;const Z=V?V[0]:o,Q=V?V[0]:i,G=_.metadata.match(/webId::([^\]]*)/g)?(k=(B=_.metadata.match(/webId::([^\]]*)/g))==null?void 0:B[0])==null?void 0:k.replace("webId::",""):"",re=_.metadata.contains("[pinned::true]"),de=_.metadata.contains("[archived::true]"),fe=_.metadata.contains("[deleted::"),$=(R=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(_.metadata))==null?void 0:R[2],he=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(_.metadata)?"PUBLIC":"PRIVATE",se=(L=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(_.metadata))==null?void 0:L[2];t.push({id:U,content:_.content,createdAt:Z,updatedAt:Q,deletedAt:fe?x.moment($,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:re,rowStatus:de?"ARCHIVED":"NORMAL",visibility:he,thinoType:se||"JOURNAL",hasId:h,linkId:g,path:l,creatorName:c,sourceType:f,resourceList:y,webId:G,fileInfo:S})}return t}async function vA(e,t){if(!e)return[];const n=Le.getState().dailyNotesState.settings,{vault:r}=Le.getState().dailyNotesState.app||window.app;if(await RR(n,e)===0)return;let o;try{o=await r.read(e)}catch(g){console.error(g),o=await r.cachedRead(e)}const{content:i,startLine:l}=OC(o,(n==null?void 0:n.ProcessContentTarget)==="whole"?"":n.ProcessEntriesBelow);let c="",f=0;if(n.DifferentInsertTarget&&(n==null?void 0:n.ProcessContentTarget)!=="whole"&&n.InsertAfterForTask&&!i.includes(n.InsertAfterForTask)){const{content:g,startLine:y}=OC(o,n.InsertAfterForTask);c=g,f=y}const h=[];PC(n,i,l,h,e),n.DifferentInsertTarget&&c&&PC(n,c,f,h,e),h.length!==0&&t.push(...h.sort((g,y)=>g.createdAt>y.createdAt?-1:1))}async function yA(e,t){const n=Le.getState().dailyNotesState.app||window.app;if(!(e instanceof x.TFile))return;let r;try{r=await n.vault.read(e)}catch(i){console.error(i),r=await n.vault.cachedRead(e)}if(!r)return;const a=JSON.parse(r),o=a==null?void 0:a.nodes;for(const i of o){if(i.type==="group"||i.createdAt===void 0||i.text.trim()==="")continue;const c=x.moment(i==null?void 0:i.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),f=x.moment(i==null?void 0:i.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),h=i!=null&&i.deletedAt?x.moment(i==null?void 0:i.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",g=!!(i!=null&&i.pinned),y=i!=null&&i.archived?"ARCHIVED":"NORMAL",w=i!=null&&i.visibility?i==null?void 0:i.visibility:"PRIVATE",S=i!=null&&i.thinoType?i==null?void 0:i.thinoType:"JOURNAL",D=i!=null&&i.text?i==null?void 0:i.text:"",I=i!=null&&i.id?i==null?void 0:i.id:"",M=i!=null&&i.hasId?i==null?void 0:i.hasId:"",N=i!=null&&i.linkId?i==null?void 0:i.linkId:"",B=e.path,k="Memo",R="CANVAS",L=[],_=i!=null&&i.webId?i==null?void 0:i.webId:void 0;t.push({id:I,content:D,createdAt:c,updatedAt:f,deletedAt:h,pinned:g,rowStatus:y,visibility:w,thinoType:S,hasId:M,linkId:N,path:B,creatorName:k,sourceType:R,resourceList:L,webId:_,fileInfo:{frontmatter:{},tags:[]}})}}async function jC(e=[]){const t=[],n=[],r=Le.getState().dailyNotesState.app||app,{vault:a}=r,{settings:o}=Le.getState().dailyNotesState,i=r.loadLocalStorage("tokenForSync"),l=async(c,f)=>{for(const h of c)try{await f(h,t,o)}catch(g){console.error(g),new x.Notice(g)}};try{if(e.includes("CANVAS")){const c=WR(a);await l(c,yA)}}catch(c){console.error(c)}try{if(e.includes("MULTI")){const c=$R(a,r,o);await l(c,gA)}}catch(c){console.error(c)}try{if(e.includes("DAILY")){const c=await ZR(a);await l(c,vA)}}catch(c){console.error(c)}try{if(e.includes("FILE")||i){const c=qR(a,r,o);await l(c,fT)}}catch(c){console.error(c)}return{memos:t,commentMemos:n}}function WR(e){return e.getAllLoadedFiles().filter(t=>t instanceof x.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function $R(e,t,n){const r=e.getMarkdownFiles(),a=r.filter(i=>{var l,c;return((l=i.parent)==null?void 0:l.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))&&!((c=i.path)!=null&&c.endsWith("thino.md"))}),o=n.TagForMultiTypeFiles?r.filter(i=>{var l,c,f;return!((l=i.parent)!=null&&l.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!((c=i.path)!=null&&c.endsWith("thino.md")))&&((f=x.getAllTags(t.metadataCache.getFileCache(i)))==null?void 0:f.contains("#"+n.TagForMultiTypeFiles.replace("#","")))}):[];return[...a,...o]}async function ZR(e){const t=mb();t===void 0&&new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(x.normalizePath(t))||new x.Notice(E("Failed to find daily notes folder"));const r=Ju();return Object.values(r).filter(a=>a instanceof x.TFile&&a.extension==="md")}function qR(e,t,n){const r=e.getMarkdownFiles(),a=r.filter(i=>i.name.trim().includes("thino")),o=n.TagForFileTypeFiles?r.filter(i=>{var l;return!i.name.trim().includes("thino")&&((l=x.getAllTags(t.metadataCache.getFileCache(i)))==null?void 0:l.contains("#"+n.TagForFileTypeFiles.replace("#","")))}):[];return[...a,...o]}const GR=async(e,t,n)=>{const r=await Rp(Le.getState().dailyNotesState.app)||[],a=r.find(l=>l.id===e),o={...a,title:t,querystring:n},i=r.findIndex(l=>l.id===e);return r[i]=o,await Av(Le.getState().dailyNotesState.app,r),[a]},JR="https://api.thino.pkmer.cn/test",_p=JR,KR="unknown",QR=/!\[(?[^\]]+)\]\((?[^)]+)\)/g;function XR(e){return e.substring(e.lastIndexOf(".")+1)}function e_(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${XR(e.id)}`,size:e.size.toString()}}function t_(e){const t=e==null?void 0:e.matchAll(QR);return t?Array.from(t).map(n=>{var r;return e_({url:(r=n.groups)==null?void 0:r.link,id:KR,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function Fv(e){var t;return{id:e.id,createdAt:x.moment(e.ctime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment(e.mtime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?x.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:t_(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime,thinoType:(e==null?void 0:e.thinoStatus)||"JOURNAL"}}async function n_(e){const n={url:`${_p}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(o=>Fv(o))}catch(a){console.error(`Error processing memo response: ${a}`)}}).catch(r=>(console.error(r),[]))}function Bp(){const e=Le.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function N2(e){const t=`${_p}/thino/createThino`,n={content:e.content,thinoType:(e==null?void 0:e.thinoType)||"FILE",thinoStatus:(e==null?void 0:e.thinoStatus)||"JOURNAL",pinned:!1,rowStatus:"NORMAL",encrypted:!1},r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create memo: ${a.status}`);try{const o=a.json;return Fv(o.payload)}catch(o){console.error(`Error processing memo creation response: ${o}`)}}).catch(a=>(console.error(a),null))}function r_(e){return{id:e.id,ctime:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").valueOf(),mtime:x.moment(e.updatedAt,"YYYY/MM/DD HH:mm:ss").valueOf(),ttime:e.deletedAt?x.moment(e.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():void 0,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,encrypted:!1,thinoType:e.sourceType==="DAILY"?"DAILY":"FILE",thinoStatus:e.thinoType,tags:[]}}async function a_(e){const t=`${_p}/thino/createThinosByData`,n=e.map(a=>r_(a)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create thinos: ${a.status}`);try{return a.json.payload.map(l=>Fv(l))}catch(o){console.error(`Error processing thinos creation response: ${o}`)}}).catch(a=>(console.error(a),[]))}async function SS(e){const n={url:`${_p}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const a=r.json;return Fv(a.payload)}catch(a){console.error(`Error processing memo update response: ${a}`)}}).catch(r=>(console.error(r),null))}async function Xg(e){const n={url:`${_p}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const a=r.json;return Fv(a.payload)}catch(a){console.error(`Error processing memo recovery response: ${a}`)}}).catch(r=>(console.error(r),null))}async function A2(e){const n={url:`${_p}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Bp()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}function o_(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function i_(e){const t=[];let n=e;for(;n.contains(` `);){const r=n.indexOf(` -`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function i_({content:e,isList:t,name:n}){var N;const r=Le.getState().dailyNotesState.settings,a=x.moment(),o=ut.randomId(16),i=(r==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",l=n||`${a.format("YYYYMMDD")}-${o}`,c=`${i}/${l}.md`,f={id:o,content:e,deletedAt:"",path:c,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI",fileInfo:{tags:[],frontmatter:{}}},h=ft.getState().app||window.app,{vault:g,fileManager:y}=h,w=g.getAbstractFileByPath(i);(!w||!(w instanceof x.TFolder))&&(new x.Notice(E("Folder not found for the given thino path, is creating a new folder")),await g.createFolder(i)),dt.setChangedByMemos(!0);let S;const D=h.vault.getFileByPath(c);D?S=await g.create(`${i}/${a.format("YYYYMMDD")}-${o}.md`,e):S=await g.create(c,e),await y.processFrontMatter(S,_=>{_.id=o,_.createdAt=a.format("YYYY/MM/DD HH:mm:ss"),_.updatedAt=a.format("YYYY/MM/DD HH:mm:ss"),_.thinoType=t?"JOURNAL":"TASK-TODO"}),(!n||D)&&(r!=null&&r.SetFileNameAfterCreate)&&h.fileManager.promptForFileRename(S);const I=h.metadataCache.getFileCache(S),M={tags:((N=I==null?void 0:I.frontmatter)==null?void 0:N.tags)||[],frontmatter:(I==null?void 0:I.frontmatter)||{}};return{...f,fileInfo:M}}async function s_({content:e,isList:t}){var _;const n=Le.getState().dailyNotesState.settings,r=x.moment(),a=ut.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",i={id:a,content:e,deletedAt:"",path:o,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",fileInfo:{tags:[],frontmatter:{}}},l=ft.getState().app,{vault:c}=l;let f=c.getAbstractFileByPath(o);(!f||!(f instanceof x.TFile))&&(new x.Notice(E("File not found for the given thino path, is creating a new file")),f=await c.create(o,""));const h=l.metadataCache.getFileCache(f),g={tags:((_=h==null?void 0:h.frontmatter)==null?void 0:_.tags)||[],frontmatter:(h==null?void 0:h.frontmatter)||{}};let y="";try{y=await c.read(f)||await c.cachedRead(f)}catch(k){console.error(k),new x.Notice(E("Failed to read current daily note, check if it exists."))}const w=y.indexOf(`# ${r.format("YYYY-MM-DD")}`);let S=y.indexOf(` +`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function s_({content:e,isList:t,name:n}){var N;const r=Le.getState().dailyNotesState.settings,a=x.moment(),o=ut.randomId(16),i=(r==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",l=n||`${a.format("YYYYMMDD")}-${o}`,c=`${i}/${l}.md`,f={id:o,content:e,deletedAt:"",path:c,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI",fileInfo:{tags:[],frontmatter:{}}},h=ft.getState().app||window.app,{vault:g,fileManager:y}=h,w=g.getAbstractFileByPath(i);(!w||!(w instanceof x.TFolder))&&(new x.Notice(E("Folder not found for the given thino path, is creating a new folder")),await g.createFolder(i)),dt.setChangedByMemos(!0);let S;const D=h.vault.getFileByPath(c);D?S=await g.create(`${i}/${a.format("YYYYMMDD")}-${o}.md`,e):S=await g.create(c,e),await y.processFrontMatter(S,B=>{B.id=o,B.createdAt=a.format("YYYY/MM/DD HH:mm:ss"),B.updatedAt=a.format("YYYY/MM/DD HH:mm:ss"),B.thinoType=t?"JOURNAL":"TASK-TODO"}),(!n||D)&&(r!=null&&r.SetFileNameAfterCreate)&&h.fileManager.promptForFileRename(S);const I=h.metadataCache.getFileCache(S),M={tags:((N=I==null?void 0:I.frontmatter)==null?void 0:N.tags)||[],frontmatter:(I==null?void 0:I.frontmatter)||{}};return{...f,fileInfo:M}}async function l_({content:e,isList:t}){var B;const n=Le.getState().dailyNotesState.settings,r=x.moment(),a=ut.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",i={id:a,content:e,deletedAt:"",path:o,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",fileInfo:{tags:[],frontmatter:{}}},l=ft.getState().app,{vault:c}=l;let f=c.getAbstractFileByPath(o);(!f||!(f instanceof x.TFile))&&(new x.Notice(E("File not found for the given thino path, is creating a new file")),f=await c.create(o,""));const h=l.metadataCache.getFileCache(f),g={tags:((B=h==null?void 0:h.frontmatter)==null?void 0:B.tags)||[],frontmatter:(h==null?void 0:h.frontmatter)||{}};let y="";try{y=await c.read(f)||await c.cachedRead(f)}catch(k){console.error(k),new x.Notice(E("Failed to read current daily note, check if it exists."))}const w=y.indexOf(`# ${r.format("YYYY-MM-DD")}`);let S=y.indexOf(` #`,w+1);S===-1&&(S=y.length);const D=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${a}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,I=e.replace(/\n/g,` > `),M=` ${D} > ${I} `;let N;if(w===-1){const k=`# ${r.format("YYYY-MM-DD")}`;N=`${y.substring(0,S)} ${k}${M} -${y.substring(S)}`}else N=`${y.substring(0,S)}${M}${y.substring(S)}`;return setTimeout(async()=>{dt.setChangedByMemos(!0),await c.modify(f,N)},200),{...i,fileInfo:g}}async function LC(e){var N;const t=Le.getState().dailyNotesState.settings,n=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id,fileInfo:e==null?void 0:e.fileInfo},i=ft.getState().app,{vault:l}=i;let c=l.getAbstractFileByPath(a);(!c||!(c instanceof x.TFile))&&(new x.Notice(E("File not found for the given thino path, is creating a new file")),c=await l.create(a,""));let f="";try{f=await l.read(c)||await l.cachedRead(c)}catch(_){console.error(_),new x.Notice(E("Failed to read current daily note, check if it exists."))}const h=i.metadataCache.getFileCache(c),g={tags:((N=h==null?void 0:h.frontmatter)==null?void 0:N.tags)||[],frontmatter:(h==null?void 0:h.frontmatter)||{}},y=f.indexOf(`# ${n.format("YYYY-MM-DD")}`);let w=f.indexOf(` +${y.substring(S)}`}else N=`${y.substring(0,S)}${M}${y.substring(S)}`;return setTimeout(async()=>{dt.setChangedByMemos(!0),await c.modify(f,N)},200),{...i,fileInfo:g}}async function LC(e){var N;const t=Le.getState().dailyNotesState.settings,n=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id,fileInfo:e==null?void 0:e.fileInfo},i=ft.getState().app,{vault:l}=i;let c=l.getAbstractFileByPath(a);(!c||!(c instanceof x.TFile))&&(new x.Notice(E("File not found for the given thino path, is creating a new file")),c=await l.create(a,""));let f="";try{f=await l.read(c)||await l.cachedRead(c)}catch(B){console.error(B),new x.Notice(E("Failed to read current daily note, check if it exists."))}const h=i.metadataCache.getFileCache(c),g={tags:((N=h==null?void 0:h.frontmatter)==null?void 0:N.tags)||[],frontmatter:(h==null?void 0:h.frontmatter)||{}},y=f.indexOf(`# ${n.format("YYYY-MM-DD")}`);let w=f.indexOf(` #`,y+1);w===-1&&(w=f.length);const S=`> [!thino] ${n.format("YYYY/MM/DD HH:mm:ss")} %% [id::${r}] [thinoType::JOURNAL]${e.rowStatus==="ARCHIVED"?" [archived::true]":""}${e.pinned===!0?" [pinned::true]":""}${e.deletedAt?` [deleted::${e.deletedAt}]`:""}${e.id?` [webId::${e.id}]`:""} %%`,D=e.content.replace(/\n/g,` > `),I=` ${S} > ${D} -`;let M;if(y===-1){const _=`# ${n.format("YYYY-MM-DD")}`;M=`${f.substring(0,w)} -${_}${I} -${f.substring(w)}`}else M=`${f.substring(0,w)}${I}${f.substring(w)}`;return dt.setChangedByMemos(!0),await l.modify(c,M),{...o,fileInfo:g}}async function l_({content:e,isList:t}){const n=Le.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=x.moment(),o=ut.randomId(16),i={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS",fileInfo:{tags:[],frontmatter:{}}},l=ft.getState().app,{vault:c}=l,f=await FR(r,l);if(!f||!(f instanceof x.TFile)){new x.Notice(E("File not found for the given thino path, is creating a new file"));return}const h=await c.read(f),g=JSON.parse(h);if(g.nodes.find(I=>I.id===i.id))return;let w;g.nodes.length>0&&(w=[...g.nodes].reduce((I,M)=>{if(!I.createdAt)return M;const N=x.moment(I.createdAt,"YYYY/MM/DD HH:mm:ss"),_=x.moment(M.createdAt,"YYYY/MM/DD HH:mm:ss");return N.isAfter(_)?I:M}));const S=w?{x:w.x,y:w.y+100,width:w.width,height:w.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...S,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),dt.setChangedByMemos(!0);const D=JSON.stringify(g,null,2);return await c.modify(f,D),i}async function DS(e,t,n,r){var $,he;const{vault:a}=Le.getState().dailyNotesState.app||window.app,o=Le.getState().dailyNotesState.app||window.app,i=Le.getState().dailyNotesState.settings,l=o.vault.getConfig("useTab")===void 0||window.app.vault.getConfig("useTab")===!0,c=l?1:o.vault.getConfig("tabSize"),f=(l?" ":" ").repeat(c),h=e.split(` +`;let M;if(y===-1){const B=`# ${n.format("YYYY-MM-DD")}`;M=`${f.substring(0,w)} +${B}${I} +${f.substring(w)}`}else M=`${f.substring(0,w)}${I}${f.substring(w)}`;return dt.setChangedByMemos(!0),await l.modify(c,M),{...o,fileInfo:g}}async function u_({content:e,isList:t}){const n=Le.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=x.moment(),o=ut.randomId(16),i={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS",fileInfo:{tags:[],frontmatter:{}}},l=ft.getState().app,{vault:c}=l,f=await OR(r,l);if(!f||!(f instanceof x.TFile)){new x.Notice(E("File not found for the given thino path, is creating a new file"));return}const h=await c.read(f),g=JSON.parse(h);if(g.nodes.find(I=>I.id===i.id))return;let w;g.nodes.length>0&&(w=[...g.nodes].reduce((I,M)=>{if(!I.createdAt)return M;const N=x.moment(I.createdAt,"YYYY/MM/DD HH:mm:ss"),B=x.moment(M.createdAt,"YYYY/MM/DD HH:mm:ss");return N.isAfter(B)?I:M}));const S=w?{x:w.x,y:w.y+100,width:w.width,height:w.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...S,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),dt.setChangedByMemos(!0);const D=JSON.stringify(g,null,2);return await c.modify(f,D),i}async function DS(e,t,n,r){var $,he;const{vault:a}=Le.getState().dailyNotesState.app||window.app,o=Le.getState().dailyNotesState.app||window.app,i=Le.getState().dailyNotesState.settings,l=o.vault.getConfig("useTab")===void 0||window.app.vault.getConfig("useTab")===!0,c=l?1:o.vault.getConfig("tabSize"),f=(l?" ":" ").repeat(c),h=e.split(` `).join(` -`+f),g=n||x.moment(),{DifferentInsertTarget:y,InsertAfterForTask:w,InsertType:S}=i,D=g.format(i.DefaultTimePrefix||"HH:mm"),I=S==="end"?"":t?i.InsertAfter:y&&w||i.InsertAfter,M=o==null?void 0:o.loadLocalStorage("tokenForSync");let N="";try{!r&&e&&M&&i.startSync&&(N=(await N2({content:e,thinoType:"DAILY"})).id)}catch(ie){console.error(ie)}const _=t?"- ":"- [ ] ",k=i!=null&&i.DefaultMemoComposition?`${_}${($=i==null?void 0:i.DefaultMemoComposition)==null?void 0:$.replace(/{TIME}/g,D).replace(/{CONTENT}/g,(h.split(` +`+f),g=n||x.moment(),{DifferentInsertTarget:y,InsertAfterForTask:w,InsertType:S}=i,D=g.format(i.DefaultTimePrefix||"HH:mm"),I=S==="end"?"":t?i.InsertAfter:y&&w||i.InsertAfter,M=o==null?void 0:o.loadLocalStorage("tokenForSync");let N="";try{!r&&e&&M&&i.startSync&&(N=(await N2({content:e,thinoType:"DAILY",thinoStatus:t?"JOURNAL":"TASK-TODO"})).id)}catch(se){console.error(se)}const B=t?"- ":"- [ ] ",k=i!=null&&i.DefaultMemoComposition?`${B}${($=i==null?void 0:i.DefaultMemoComposition)==null?void 0:$.replace(/{TIME}/g,D).replace(/{CONTENT}/g,(h.split(` `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(h)?` `+f:"")+h)}${h.split(` `).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(h.split(` `)[h.split(` `).length-1])&&N?` -`+f:" "}${N?`[webId::${N}]`:""}`:`${_}${D} ${h.split(` +`+f:" "}${N?`[webId::${N}]`:""}`:`${B}${D} ${h.split(` `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(h)?` `+f:""}${h}${h.split(` `).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(h.split(` `)[h.split(` `).length-1])&&N?` -`+f:" "}${N?`[webId::${N}]`:""}`,B=Ju(),L=pb(g,B),R="fake"+ut.randomId(16);let V=!1;const Y=o.plugins.getPlugin("templater-obsidian");let Z;if(L?Z=L:(Y!=null&&Y.templater&&(Y!=null&&Y.settings.trigger_on_file_creation)&&(we.setWaitingForTemplater({origin:e,date:g,isList:t,id:R,type:N?"web":"local"}),V=!0),Z=await ut.createDailyNoteCheck(g)),!Z){new x.Notice(E("Failed to create daily note, check if it exists."));return}if(L||await ft.fechLocalDailyNotes(),Y&&(Y!=null&&Y.templater)&&(Y!=null&&Y.settings.trigger_on_file_creation)&&V)return dt.setChangedByMemos(!0),{id:R,content:e,deletedAt:"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:Z.path,hasId:"",linkId:"",webId:N,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:{tags:[],frontmatter:{}}};let Q="";try{Q=await a.read(Z)||await a.cachedRead(Z)}catch(ie){console.error(ie),new x.Notice(E("Failed to read current daily note, check if it exists."))}const G=o.metadataCache.getFileCache(Z),le={tags:((he=G==null?void 0:G.frontmatter)==null?void 0:he.tags)||[],frontmatter:(G==null?void 0:G.frontmatter)||{}},se=await wA(I,k,Q);await a.modify(Z,se.content);const fe=se.posNum===-1?bA(se.content).length-(k.split(` -`).length-1)-1:se.posNum+1;return dt.setChangedByMemos(!0),{id:g.format("YYYYMMDDHHmm")+"00"+fe,content:e,deletedAt:"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:Z.path,hasId:"",linkId:"",webId:N,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:le}}async function RC(e){var fe;const{vault:t}=Le.getState().dailyNotesState.app||window.app,n=Le.getState().dailyNotesState.app||window.app,{DefaultMemoComposition:r,InsertAfter:a,DefaultTimePrefix:o,DifferentInsertTarget:i,InsertAfterForTask:l,InsertType:c}=Le.getState().dailyNotesState.settings;let f=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const $=" [webId::"+e.id+"]";f+=$}const h=x.moment();if(e.deletedAt){const $=" [deleted::"+h.format("YYYYMMDDHHmmss")+"]";f+=$}const g=n.vault.getConfig("useTab")===void 0||n.vault.getConfig("useTab")===!0,y=g?1:n.vault.getConfig("tabSize"),w=(g?" ":" ").repeat(y),S=e.content.split(` +`+f:" "}${N?`[webId::${N}]`:""}`,R=Ju(),L=pb(g,R),_="fake"+ut.randomId(16);let V=!1;const U=o.plugins.getPlugin("templater-obsidian");let Z;if(L?Z=L:(U!=null&&U.templater&&(U!=null&&U.settings.trigger_on_file_creation)&&(we.setWaitingForTemplater({origin:e,date:g,isList:t,id:_,type:N?"web":"local"}),V=!0),Z=await ut.createDailyNoteCheck(g)),!Z){new x.Notice(E("Failed to create daily note, check if it exists."));return}if(L||await ft.fechLocalDailyNotes(),U&&(U!=null&&U.templater)&&(U!=null&&U.settings.trigger_on_file_creation)&&V)return dt.setChangedByMemos(!0),{id:_,content:e,deletedAt:"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:Z.path,hasId:"",linkId:"",webId:N,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:{tags:[],frontmatter:{}}};let Q="";try{Q=await a.read(Z)||await a.cachedRead(Z)}catch(se){console.error(se),new x.Notice(E("Failed to read current daily note, check if it exists."))}const G=o.metadataCache.getFileCache(Z),re={tags:((he=G==null?void 0:G.frontmatter)==null?void 0:he.tags)||[],frontmatter:(G==null?void 0:G.frontmatter)||{}},de=await wA(I,k,Q);await a.modify(Z,de.content);const fe=de.posNum===-1?bA(de.content).length-(k.split(` +`).length-1)-1:de.posNum+1;return dt.setChangedByMemos(!0),{id:g.format("YYYYMMDDHHmm")+"00"+fe,content:e,deletedAt:"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:Z.path,hasId:"",linkId:"",webId:N,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:re}}async function RC(e){var fe;const{vault:t}=Le.getState().dailyNotesState.app||window.app,n=Le.getState().dailyNotesState.app||window.app,{DefaultMemoComposition:r,InsertAfter:a,DefaultTimePrefix:o,DifferentInsertTarget:i,InsertAfterForTask:l,InsertType:c}=Le.getState().dailyNotesState.settings;let f=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const $=" [webId::"+e.id+"]";f+=$}const h=x.moment();if(e.deletedAt){const $=" [deleted::"+h.format("YYYYMMDDHHmmss")+"]";f+=$}const g=n.vault.getConfig("useTab")===void 0||n.vault.getConfig("useTab")===!0,y=g?1:n.vault.getConfig("tabSize"),w=(g?" ":" ").repeat(y),S=e.content.split(` `).join(` -`+w),D=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),I=D.format(o||"HH:mm"),M=e.thinoType?"- [ ] ":"- ",N=r?`${M}${r==null?void 0:r.replace(/{TIME}/g,I).replace(/{CONTENT}/g,(S.split(` +`+w),D=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),I=D.format(o||"HH:mm"),M=!e.thinoType||e.thinoType==="JOURNAL"?"- ":e.thinoType==="TASK-TODO"?"- [ ] ":"- [x] ",N=r?`${M}${r==null?void 0:r.replace(/{TIME}/g,I).replace(/{CONTENT}/g,(S.split(` `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(S)?` `+w:"")+S)}${S.split(` `).length>1&&/```/g.test(S.split(` @@ -79,67 +79,67 @@ ${f.substring(w)}`}else M=`${f.substring(0,w)}${I}${f.substring(w)}`;return dt.s `).length>1&&/```/g.test(S.split(` `)[S.split(` `).length-1])&&f.trim()?` -`+w:" "}${f}`,_=Ju(),k=pb(D,_),B="fake"+ut.randomId(16);let L=!1;const R=n.plugins.getPlugin("templater-obsidian");let V;if(k?V=k:(R!=null&&R.templater&&(R!=null&&R.settings.trigger_on_file_creation)&&(we.setWaitingForTemplater({origin:e.content,date:D,isList:e.thinoType&&e.thinoType==="JOURNAL",id:B,type:"local"}),L=!0),V=await ut.createDailyNoteCheck(D)),!V){new x.Notice(E("Failed to create daily note, check if it exists.")),new x.Notice(E("Your content has been copied to clipboard, and inserted into the editor. Please try it again")),await navigator.clipboard.writeText(e.content);const $=n.workspace.getLeavesOfType("thino_view").first();n.workspace.trigger("send-to-thino",e.content,$);return}if(k||await ft.fechLocalDailyNotes(),R&&(R!=null&&R.templater)&&(R!=null&&R.settings.trigger_on_file_creation)&&L)return dt.setChangedByMemos(!0),{id:B,content:e.content,deletedAt:e.deletedAt??"",createdAt:D.format("YYYY/MM/DD HH:mm:ss"),updatedAt:D.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:V.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.webId||e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:(e==null?void 0:e.fileInfo)||{tags:[],frontmatter:{}}};const Y=n.metadataCache.getFileCache(V),Z={tags:((fe=Y==null?void 0:Y.frontmatter)==null?void 0:fe.tags)||[],frontmatter:(Y==null?void 0:Y.frontmatter)||{}};let Q="";try{Q=await t.read(V)||await t.cachedRead(V)}catch($){console.error($),new x.Notice(E("Failed to read current daily note, check if it exists."))}const G=c==="end"?"":e.thinoType&&i&&l||a,le=await wA(G,N,Q);await t.modify(V,le.content);const se=le.posNum===-1?bA(le.content).length-1:le.posNum+1;return dt.setChangedByMemos(!0),{id:D.format("YYYYMMDDHHmm")+"00"+se,content:e.content,deletedAt:e.deletedAt??"",createdAt:D.format("YYYY/MM/DD HH:mm:ss"),updatedAt:D.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:V.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:Z}}async function wA(e,t,n){const r=new RegExp(`(s*?)${await a_(e)}(s*?)`),a=o_(n),o=a.findIndex(f=>r.test(f)),i=(e==null?void 0:e.trim())===""?!0:o===-1;i&&console.error("unable to find insert after line in file.");const l=a.slice(o+1).findIndex(f=>/(^#+ |---|^\^[a-zA-Z0-9-]{2,}$)/.test(f)),c=l!==-1;if(c){let f;for(let h=l+o;h>o;h--)if(!/^[\s\n ]*$/.test(a[h])){f=h;break}return f||(f=o),await _C(t,n,i?-1:f,c)}else return await _C(t,n,a.length-1,c)}async function _C(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t} +`+w:" "}${f}`,B=Ju(),k=pb(D,B),R="fake"+ut.randomId(16);let L=!1;const _=n.plugins.getPlugin("templater-obsidian");let V;if(k?V=k:(_!=null&&_.templater&&(_!=null&&_.settings.trigger_on_file_creation)&&(we.setWaitingForTemplater({origin:e.content,date:D,isList:e.thinoType&&e.thinoType==="JOURNAL",id:R,type:"local"}),L=!0),V=await ut.createDailyNoteCheck(D)),!V){new x.Notice(E("Failed to create daily note, check if it exists.")),new x.Notice(E("Your content has been copied to clipboard, and inserted into the editor. Please try it again")),await navigator.clipboard.writeText(e.content);const $=n.workspace.getLeavesOfType("thino_view").first();n.workspace.trigger("send-to-thino",e.content,$);return}if(k||await ft.fechLocalDailyNotes(),_&&(_!=null&&_.templater)&&(_!=null&&_.settings.trigger_on_file_creation)&&L)return dt.setChangedByMemos(!0),{id:R,content:e.content,deletedAt:e.deletedAt??"",createdAt:D.format("YYYY/MM/DD HH:mm:ss"),updatedAt:D.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:V.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.webId||e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:(e==null?void 0:e.fileInfo)||{tags:[],frontmatter:{}}};const U=n.metadataCache.getFileCache(V),Z={tags:((fe=U==null?void 0:U.frontmatter)==null?void 0:fe.tags)||[],frontmatter:(U==null?void 0:U.frontmatter)||{}};let Q="";try{Q=await t.read(V)||await t.cachedRead(V)}catch($){console.error($),new x.Notice(E("Failed to read current daily note, check if it exists."))}const G=c==="end"?"":e.thinoType&&i&&l||a,re=await wA(G,N,Q);await t.modify(V,re.content);const de=re.posNum===-1?bA(re.content).length-1:re.posNum+1;return dt.setChangedByMemos(!0),{id:D.format("YYYYMMDDHHmm")+"00"+de,content:e.content,deletedAt:e.deletedAt??"",createdAt:D.format("YYYY/MM/DD HH:mm:ss"),updatedAt:D.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:V.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:Z}}async function wA(e,t,n){const r=new RegExp(`(s*?)${await o_(e)}(s*?)`),a=i_(n),o=a.findIndex(f=>r.test(f)),i=(e==null?void 0:e.trim())===""?!0:o===-1;i&&console.error("unable to find insert after line in file.");const l=a.slice(o+1).findIndex(f=>/(^#+ |---|^\^[a-zA-Z0-9-]{2,}$)/.test(f)),c=l!==-1;if(c){let f;for(let h=l+o;h>o;h--)if(!/^[\s\n ]*$/.test(a[h])){f=h;break}return f||(f=o),await _C(t,n,i?-1:f,c)}else return await _C(t,n,a.length-1,c)}async function _C(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t} ${e}`,posNum:-1};const a=t.split(` `),o=a.slice(0,n+1).join(` `),i=a.slice(n+1).join(` `),l=i.trim().length>0;return{content:`${o}${!l&&!r||!o.endsWith(` `)?` `:""}${e}${(l||r?` -`:"")+i}`,posNum:n}}const bA=e=>e.split(/\r?\n/);async function u_(e){const t=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(E("File not found for the given thino path"));return}await t.vault.delete(n)}async function c_(e){const t=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(E("File not found for the given thino path"));return}const a=(await t.vault.read(n)).split(` +`:"")+i}`,posNum:n}}const bA=e=>e.split(/\r?\n/);async function c_(e){const t=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(E("File not found for the given thino path"));return}await t.vault.delete(n)}async function d_(e){const t=Le.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(E("File not found for the given thino path"));return}const a=(await t.vault.read(n)).split(` `),o=a.findIndex(c=>c.includes(e.id));if(o===-1){new x.Notice(E("Thino not found"));return}const i=a.findIndex((c,f)=>f>o&&c.trim()==="");i===-1?a.splice(o,a.length-o):a.splice(o,i-o);const l=a.join(` -`);if(!l){new x.Notice(E("Thino not found"));return}dt.setChangedByMemos(!0),await t.vault.modify(n,l)}async function d_(e){const t=Le.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new x.Notice(E("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,i=o.findIndex(h=>h.id===e.id);if(i===-1){new x.Notice(E("Thino not found"));return}o.splice(i,1);const l=a.edges;l.filter(h=>h.fromNode===e.id||h.toNode===e.id).forEach(h=>{const g=l.findIndex(y=>y.id===h.id);g!==-1&&l.splice(g,1)}),dt.setChangedByMemos(!0);const f=JSON.stringify(a,null,2);await t.vault.modify(n,f)}async function f_(e){mA()||new x.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t,metadataCache:n}=Le.getState().dailyNotesState.app,r=e.path,a=t.getAbstractFileByPath(r);if(!a){new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings"));return}const o=await t.read(a),i=o.split(` +`);if(!l){new x.Notice(E("Thino not found"));return}dt.setChangedByMemos(!0),await t.vault.modify(n,l)}async function f_(e){const t=Le.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new x.Notice(E("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,i=o.findIndex(h=>h.id===e.id);if(i===-1){new x.Notice(E("Thino not found"));return}o.splice(i,1);const l=a.edges;l.filter(h=>h.fromNode===e.id||h.toNode===e.id).forEach(h=>{const g=l.findIndex(y=>y.id===h.id);g!==-1&&l.splice(g,1)}),dt.setChangedByMemos(!0);const f=JSON.stringify(a,null,2);await t.vault.modify(n,f)}async function h_(e){mA()||new x.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t,metadataCache:n}=Le.getState().dailyNotesState.app,r=e.path,a=t.getAbstractFileByPath(r);if(!a){new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings"));return}const o=await t.read(a),i=o.split(` `),l=n.getFileCache(a),c=(l==null?void 0:l.listItems)||[],f=parseInt(e.id.slice(14));let h=f;function g(D,I){const M=[];for(const N in I)I[N]===D&&M.push(parseInt(N),...g(parseInt(N),I));return M}const y=k2(c),w=c.find(D=>D.position.start.line===f),S=g(f,y);if(S.length>0){const D=S.map(I=>{const M=c.find(N=>N.position.start.line===I);return M?M.position.end.line:-1});h=Math.max(...D,w.position.end.line)}else h=w.position.end.line;if(!o){new x.Notice(E("Thino not found"));return}dt.setChangedByMemos(!0),i.splice(f,h-f+1),await t.modify(a,i.join(` -`))}async function h_(){const{vault:e,metadataCache:t}=Le.getState().dailyNotesState.app,n=Le.getState().dailyNotesState.settings,a=mb()+"/"+n.DeleteFileName+".md",o=[],i=t.getFirstLinkpathDest("",a);if(i instanceof x.TFile){let l=await e.read(i),c=p_(l);if(c.length===0)return o;for(let f=0;fe.split(/\r?\n/),m_=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},g_=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},v_=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function y_(e){const t=await Rp(Le.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await Av(Le.getState().dailyNotesState.app,t)}const w_=async e=>{const{app:t}=Le.getState().dailyNotesState,n=await Rp(t)||[],r=n.find(a=>a.id===e);if(r){const a=x.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=a,await Av(t,n),a}else{new x.Notice(E("Query not found"));return}},b_=async e=>{const{app:t}=Le.getState().dailyNotesState,n=await Rp(t)||[],r=n.find(a=>a.id===e);if(r){r.pinnedAt="",await Av(t,n);return}else{new x.Notice(E("Query not found"));return}};function S_(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const a=r[1].trim(),o={};a.split(" ").forEach(l=>{const[c,f]=l.slice(1,-1).split("::");o[c]=f});for(const l of Object.keys(t))if(l!=="id"&&l!=="content"){if(l==="rowStatus"&&t.rowStatus==="ARCHIVED"){o.archived="true";continue}else if(l==="rowStatus"&&t.rowStatus==="NORMAL"){delete o.archived;continue}if(l==="deleted"&&t.deleted){const c=x.moment().format("YYYYMMDDHHmmss");o.deleted=c}else typeof t[l]=="boolean"?t[l]?o[l]="true":delete o[l]:t[l]&&(o[l]=t[l])}const i=Object.entries(o).map(([l,c])=>`[${l}::${c}]`).join(" ");return e.replace(n,`%% ${i} %%`)}async function js(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Le.getState().dailyNotesState.app,a=n.getAbstractFileByPath(e.path);if(!a)return e;const o=x.moment();if(await r.processFrontMatter(a,i=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&dt.setChangedByMemos(!0),t.id&&(i.id=t.id),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.webId&&(i.webId=t.webId),t.pinned!==void 0&&(i.pinned=t.pinned),t.deleted!==void 0&&(i.deletedAt=t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):""),i.createdAt||(i.createdAt=o.format("YYYY/MM/DD HH:mm:ss")),i.updatedAt=o.format("YYYY/MM/DD HH:mm:ss")}),t.content){const i=await n.read(a);let l=i;const c=t.content.replace(/\$/g,"$$$$");l=i.replace(e.content,c),await n.modify(a,l)}return dt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Rl(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Le.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=x.moment();let o="";try{o=await n.read(r)}catch(M){console.error(M),o=await n.cachedRead(r)}const i=o.split(/\r?\n/),l=i.findIndex(M=>M.includes("id::"+e.id)||M.includes("Id::"+e.id)||e.webId&&M.includes(e.webId)),c=i[l];if(!c)return e;const f=S_(c,t);if(!c)return e;const h=f+` +`))}async function p_(){const{vault:e,metadataCache:t}=Le.getState().dailyNotesState.app,n=Le.getState().dailyNotesState.settings,a=mb()+"/"+n.DeleteFileName+".md",o=[],i=t.getFirstLinkpathDest("",a);if(i instanceof x.TFile){let l=await e.read(i),c=m_(l);if(c.length===0)return o;for(let f=0;fe.split(/\r?\n/),g_=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},v_=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},y_=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function w_(e){const t=await Rp(Le.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await Av(Le.getState().dailyNotesState.app,t)}const b_=async e=>{const{app:t}=Le.getState().dailyNotesState,n=await Rp(t)||[],r=n.find(a=>a.id===e);if(r){const a=x.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=a,await Av(t,n),a}else{new x.Notice(E("Query not found"));return}},S_=async e=>{const{app:t}=Le.getState().dailyNotesState,n=await Rp(t)||[],r=n.find(a=>a.id===e);if(r){r.pinnedAt="",await Av(t,n);return}else{new x.Notice(E("Query not found"));return}};function D_(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const a=r[1].trim(),o={};a.split(" ").forEach(l=>{const[c,f]=l.slice(1,-1).split("::");o[c]=f});for(const l of Object.keys(t))if(l!=="id"&&l!=="content"){if(l==="rowStatus"&&t.rowStatus==="ARCHIVED"){o.archived="true";continue}else if(l==="rowStatus"&&t.rowStatus==="NORMAL"){delete o.archived;continue}if(l==="deleted"&&t.deleted){const c=x.moment().format("YYYYMMDDHHmmss");o.deleted=c}else typeof t[l]=="boolean"?t[l]?o[l]="true":delete o[l]:t[l]&&(typeof t[l]=="string"||typeof t[l]=="boolean")&&(o[l]=t[l])}const i=Object.entries(o).map(([l,c])=>`[${l}::${c}]`).join(" ");return e.replace(n,`%% ${i} %%`)}async function js(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Le.getState().dailyNotesState.app,a=n.getAbstractFileByPath(e.path);if(!a)return e;const o=x.moment();if(await r.processFrontMatter(a,i=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&dt.setChangedByMemos(!0),t.id&&(i.id=t.id),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.webId&&(i.webId=t.webId),t.pinned!==void 0&&(i.pinned=t.pinned),t.deleted!==void 0&&(i.deletedAt=t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):""),i.createdAt||(i.createdAt=o.format("YYYY/MM/DD HH:mm:ss")),i.updatedAt=o.format("YYYY/MM/DD HH:mm:ss")}),t.content){const i=await n.read(a);let l=i;const c=t.content.replace(/\$/g,"$$$$");l=i.replace(e.content,c),await n.modify(a,l)}return dt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:e.thinoType,createdAt:e.createdAt||o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Rl(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Le.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=x.moment();let o="";try{o=await n.read(r)}catch(M){console.error(M),o=await n.cachedRead(r)}const i=o.split(/\r?\n/),l=i.findIndex(M=>M.includes("id::"+e.id)||M.includes("Id::"+e.id)||e.webId&&M.includes(e.webId)),c=i[l];if(!c)return e;const f=D_(c,t);if(!c)return e;const h=f+` `,g=i.findIndex((M,N)=>N>l&&M.trim()==="");let y="";g===-1&&(y=i.slice(l+1).join(` `)),g!==-1&&(y=i.slice(l+1,g).join(` `));let w=y;t!=null&&t.content&&(w=t.content.split(/\r?\n/).map(k=>"> "+k).join(` `));const D=(h+w).split(/\r?\n/);i.splice(l,g!==-1?g-l:i.length-l,...D);const I=i.join(` -`);return await n.modify(r,I),dt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function _l(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Le.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),i=o.nodes.find(f=>f.id===e.id);if(!i)return e;t.content&&(i.text=t.content),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.pinned!==void 0&&(i.pinned=t.pinned),t.webId&&(i.webId=t.webId);const l=x.moment();t.deleted!==void 0&&(i.deletedAt=t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):""),i.updatedAt=l.format("YYYY/MM/DD HH:mm:ss");const c=JSON.stringify(o,null,2);return await n.modify(r,c),dt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Bl(e,t){var le;mA()||new x.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n,metadataCache:r}=Le.getState().dailyNotesState.app,a=Le.getState().dailyNotesState.app,{settings:o}=Le.getState().dailyNotesState,i=e.id.toString().slice(0,14),l=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(i,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(i,"YYYYMMDDHHmmss"),c=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(l,"day"),f=e.path,h=n.getAbstractFileByPath(f)||n.getAbstractFileByPath(e.path);if(!h)return new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings")),e;const y=(await n.read(h)).split(` -`),w=r.getFileCache(h),S=(w==null?void 0:w.listItems)||[];if(S.length===0)return new x.Notice(E("Thino not found")),e;const D=parseInt(e.id.slice(14));let I=D;function M(se,fe){const $=[];for(const he in fe)fe[he]===se&&$.push(parseInt(he),...M(parseInt(he),fe));return $}const N=k2(S),_=S.find(se=>se.position.start.line===D);if(!_)return new x.Notice(E("Thino not found")),e;const k=M(D,N);if(k.length>0){const se=k.map(fe=>{const $=S.find(he=>he.position.start.line===fe);return $?$.position.end.line:-1});I=Math.max(...se,_.position.end.line)}else I=_.position.end.line;const B=y.slice(D,I+1);let L=B.join(` -`);const R=c?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14);if(!L)return new x.Notice(E("Thino not found")),e;const V=a.vault.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,Y=V?1:a.vault.getConfig("tabSize"),Z=(V?" ":" ").repeat(Y);let Q=R;if(o.DefaultTimePrefix!=="HH:mm"&&(Q=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format(o.DefaultTimePrefix)),t.content){const se=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",fe=(e.pinned?" [pinned::true]":"")+(e.deletedAt?` [deleted::${e.deletedAt}]`:"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.webId?" [webId::"+e.webId+"]":""),$=t.content.trim().split(` +`);return await n.modify(r,I),dt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function _l(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Le.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),i=o.nodes.find(f=>f.id===e.id);if(!i)return e;t.content&&(i.text=t.content),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.pinned!==void 0&&(i.pinned=t.pinned),t.webId&&(i.webId=t.webId);const l=x.moment();t.deleted!==void 0&&(i.deletedAt=t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):""),i.updatedAt=l.format("YYYY/MM/DD HH:mm:ss");const c=JSON.stringify(o,null,2);return await n.modify(r,c),dt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?l.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}function SA(e,t){const n=[];for(const r in t)t[r]===e&&n.push(parseInt(r),...SA(parseInt(r),t));return n}async function Bl(e,t){var G;mA()||new x.Notice(E("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n,metadataCache:r}=Le.getState().dailyNotesState.app,a=Le.getState().dailyNotesState.app,{settings:o}=Le.getState().dailyNotesState,i=e.id.toString().slice(0,14),l=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(i,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(i,"YYYYMMDDHHmmss"),c=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(l,"day"),f=e.path,h=n.getAbstractFileByPath(f)||n.getAbstractFileByPath(e.path);if(!h)return new x.Notice(E("Please check your daily note plugin OR periodic notes plugin settings")),e;const y=(await n.read(h)).split(` +`),w=r.getFileCache(h),S=(w==null?void 0:w.listItems)||[];if(S.length===0)return new x.Notice(E("Thino not found")),e;const D=parseInt(e.id.slice(14));let I=D;const M=k2(S),N=S.find(re=>re.position.start.line===D);if(!N)return new x.Notice(E("Thino not found")),e;const B=SA(D,M);if(B.length>0){const re=B.map(de=>{const fe=S.find($=>$.position.start.line===de);return fe?fe.position.end.line:-1});I=Math.max(...re,N.position.end.line)}else I=N.position.end.line;const k=y.slice(D,I+1);let R=k.join(` +`);const L=c?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14);if(!R)return new x.Notice(E("Thino not found")),e;const _=a.vault.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,V=_?1:a.vault.getConfig("tabSize"),U=(_?" ":" ").repeat(V);let Z=L;if(o.DefaultTimePrefix!=="HH:mm"&&(Z=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format(o.DefaultTimePrefix)),t.content){const re=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",de=(e.pinned?" [pinned::true]":"")+(e.deletedAt?` [deleted::${e.deletedAt}]`:"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.webId?" [webId::"+e.webId+"]":""),fe=t.content.trim().split(` `)[t.content.trim().split(` -`).length-1].trim(),he=e.hasId&&t.content.trim().split(` -`).length>1&&new RegExp(/(-|\*|\d{1,2}\.)\s/g).test($)?" ^"+e.hasId:" ";L=`${se}${Q}${he}${t.content.trim().split(` +`).length-1].trim(),$=e.hasId&&t.content.trim().split(` +`).length>1&&new RegExp(/(-|\*|\d{1,2}\.)\s/g).test(fe)?" ^"+e.hasId:" ";R=`${re}${Z}${$}${t.content.trim().split(` `).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(t.content)?` -`+Z:""}${t.content.trim().split(` +`+U:""}${t.content.trim().split(` `).join(` -`+Z)}${/((-|\*|\d\.|>)\s|```)/g.test(t.content.split(` +`+U)}${/((-|\*|\d\.|>)\s|```)/g.test(t.content.split(` `)[t.content.split(` `).length-1])?` -`+Z:" "}${fe.trim()}`}if(t.thinoType){const se=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";L=L.replace(/^((- \[.\] )|((-|\*) ))/,se)}if(t.rowStatus){const se=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";L=L.includes("[archived::")?L.replace(/\[archived::(true|false)\]/,se):L+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}${de.trim()}`}if(t.thinoType){const re=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";R=R.replace(/^((- \[.\] )|((-|\*) ))/,re)}if(t.rowStatus){const re=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";R=R.includes("[archived::")?R.replace(/\[archived::(true|false)\]/,re):R+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se}if(t.visibility){const se='[visibility::"'+t.visibility+'"]';L=L.includes("[visibility::")?L.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,se):L+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}`+re}if(t.visibility){const re='[visibility::"'+t.visibility+'"]';R=R.includes("[visibility::")?R.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,re):R+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se}if(t.pinned!==void 0){const se=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";L=L.includes("[pinned::")?L.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":se):L+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}`+re}if(t.pinned!==void 0){const re=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";R=R.includes("[pinned::")?R.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":re):R+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se}if(t.webId!==void 0){const se="[webId::"+t.webId+"]";L=L.includes("[webId::")?L.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":se):L+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}`+re}if(t.webId!==void 0){const re="[webId::"+t.webId+"]";R=R.includes("[webId::")?R.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":re):R+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se}const G=x.moment();if(t.deleted!==void 0){const se="[deleted::"+G.format("YYYYMMDDHHmmss")+"]";t.deleted?(L=L.replace(/\[deleted::([^\]]+)\]/,""),L=L+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}`+re}const Q=x.moment();if(t.deleted!==void 0){const re="[deleted::"+Q.format("YYYYMMDDHHmmss")+"]";t.deleted?(R=R.replace(/\[deleted::([^\]]+)\]/,""),R=R+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se):t.deleted===!1&&(L=L.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId&&((le=t.content)==null?void 0:le.split(` -`).length)===1){const se=" ^"+e.hasId;L=L.trim().replace(/\s\^([0-9a-zA-Z-]+)($|\n)/g,"")+`${/((-|\*|\d\.|>)\s|```)/g.test(L.split(` -`)[L.split(` +`+U:" "}`+re):t.deleted===!1&&(R=R.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId&&((G=t.content)==null?void 0:G.split(` +`).length)===1){const re=" ^"+e.hasId;R=R.trim().replace(/\s\^([0-9a-zA-Z-]+)($|\n)/g,"")+`${/((-|\*|\d\.|>)\s|```)/g.test(R.split(` +`)[R.split(` `).length-1])?` -`+Z:" "}`+se}return L!==B.join(` -`)?(y.splice(D,I-_.position.start.line+1,L.trim()),await n.modify(h,y.join(` -`)),dt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?G.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}async function D_(e,t,n){var M;const{vault:r,metadataCache:a}=Le.getState().dailyNotesState.app||window.app,o=r.getFileByPath(e);if(!o)return;const i=((M=a.getFileCache(o))==null?void 0:M.listItems)||[],l=k2(i),c=[],f=r.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,h=f?1:r.getConfig("tabSize"),g=(f?" ":" ").repeat(h);function y(N,_){const k=[];for(const B in _)_[B]===N&&k.push(parseInt(B),...y(parseInt(B),_));return k}const w=x.moment(),S=t.map(N=>{const _=i.find(R=>R.position.start.line===parseInt(N.id.slice(14))),B=y(parseInt(N.id.slice(14)),l).map(R=>{const V=i.find(Y=>Y.position.start.line===R);return V?V.position.end.line:-1}),L=Math.max(...B,_.position.end.line);return{id:N.id,start:_.position.start.line,end:L}}),I=(await r.read(o)).split(` +`+U:" "}`+re}return R!==k.join(` +`)?(y.splice(D,I-N.position.start.line+1,R.trim()),await n.modify(h,y.join(` +`)),dt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?Q.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}async function T_(e,t,n){var M;const{vault:r,metadataCache:a}=Le.getState().dailyNotesState.app||window.app,o=r.getFileByPath(e);if(!o)return;const i=((M=a.getFileCache(o))==null?void 0:M.listItems)||[],l=k2(i),c=[],f=r.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,h=f?1:r.getConfig("tabSize"),g=(f?" ":" ").repeat(h);function y(N,B){const k=[];for(const R in B)B[R]===N&&k.push(parseInt(R),...y(parseInt(R),B));return k}const w=x.moment(),S=t.map(N=>{const B=i.find(_=>_.position.start.line===parseInt(N.id.slice(14))),R=y(parseInt(N.id.slice(14)),l).map(_=>{const V=i.find(U=>U.position.start.line===_);return V?V.position.end.line:-1}),L=Math.max(...R,B.position.end.line);return{id:N.id,start:B.position.start.line,end:L}}),I=(await r.read(o)).split(` `);return S.forEach(N=>{const k=I.slice(N.start,N.end+1).join(` `),L=k.split(` `)[k.split(` -`).length-1].trim();let R=k;if(n==="delete"){const V="[deleted::"+w.format("YYYYMMDDHHmmss")+"]";R=R.replace(/\[deleted::([^\]]+)\]/,""),R=k+`${k.split(` +`).length-1].trim();let _=k;if(n==="delete"){const V="[deleted::"+w.format("YYYYMMDDHHmmss")+"]";_=_.replace(/\[deleted::([^\]]+)\]/,""),_=k+`${k.split(` `).length>1&&/```/g.test(L)?` -`+g:" "}`+V}if(n==="restoreFromDelete"&&(R=R.replace(/ ?\[deleted::([^\]]+)\]/,"")),n==="archive"){const V="[archived::true]";R=R.includes("[archived::")?R.replace(/\[archived::(true|false)\]/,V):R+`${R.split(` +`+g:" "}`+V}if(n==="restoreFromDelete"&&(_=_.replace(/ ?\[deleted::([^\]]+)\]/,"")),n==="archive"){const V="[archived::true]";_=_.includes("[archived::")?_.replace(/\[archived::(true|false)\]/,V):_+`${_.split(` `).length>1&&/```/g.test(L)?` -`+g:" "}`+V}n==="restoreFromArchive"&&(R=R.replace(/ ?\[archived::(true|false)\]/,"")),n==="deleteForever"?I.splice(N.start,N.end-N.start+1):I.splice(N.start,N.end-N.start+1,R),c.push({...t.find(V=>V.id===N.id),deletedAt:n==="delete"?w.format("YYYY/MM/DD HH:mm:ss"):"",rowStatus:n==="archive"?"ARCHIVED":"NORMAL"})}),await r.modify(o,I.join(` -`)),dt.setChangedByMemos(!0),c}const T_=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return _l(e,{id:e.id,pinned:!0});case"DAILY":return Bl(e,{id:e.id,pinned:!0});case"MULTI":return js(e,{id:e.id,pinned:!0});case"FILE":return Rl(e,{id:e.id,pinned:!0})}},I_=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return _l(e,{id:e.id,pinned:!1});case"DAILY":return Bl(e,{id:e.id,pinned:!1});case"MULTI":return js(e,{id:e.id,pinned:!1});case"FILE":return Rl(e,{id:e.id,pinned:!1})}};var hT;(e=>{async function t(D){return await jC(D)}e.getMyMemos=t;async function n(D){return await jC([D])}e.updateSpecificTypeMemo=n;function r(){return h_()}e.getMyDeletedMemos=r;function a(D){const I=we.getMemoById(D);if(I)switch(I==null?void 0:I.sourceType){case"DAILY":return Bl(I,{id:I.id,deleted:!1});case"CANVAS":return _l(I,{id:I.id,deleted:!1});case"MULTI":return js(I,{id:I.id,deleted:!1});case"FILE":return Rl(I,{id:I.id,deleted:!1})}}e.restoreMemo=a;function o(D){return c_(D)}e.deleteMemoInSingleFile=o;function i(D){return u_(D)}e.deleteMemoInMultiFiles=i;function l(D){return f_(D)}e.deleteMemoInDailyNote=l;function c(D){return d_(D)}e.deleteMemoInCanvas=c;function f(){return MR()}e.getMyQueries=f;async function h(D,I){return await NR(D,I)}e.createQuery=h;function g(D,I,M){return qR(D,I,M)}e.updateQuery=g;function y(D){return y_(D)}e.deleteQueryById=y;function w(D){return w_(D)}e.pinQuery=w;function S(D){return b_(D)}e.unpinQuery=S})(hT||(hT={}));const Ko=hT;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});class Of extends Error{}class E_ extends Of{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class C_ extends Of{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class x_ extends Of{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class jg extends Of{}class SA extends Of{constructor(t){super(`Invalid unit ${t}`)}}class Xi extends Of{}class Yc extends Of{constructor(){super("Zone is an abstract class")}}const gt="numeric",zs="short",Mi="long",xw={year:gt,month:gt,day:gt},DA={year:gt,month:zs,day:gt},M_={year:gt,month:zs,day:gt,weekday:zs},TA={year:gt,month:Mi,day:gt},IA={year:gt,month:Mi,day:gt,weekday:Mi},EA={hour:gt,minute:gt},CA={hour:gt,minute:gt,second:gt},xA={hour:gt,minute:gt,second:gt,timeZoneName:zs},MA={hour:gt,minute:gt,second:gt,timeZoneName:Mi},kA={hour:gt,minute:gt,hourCycle:"h23"},NA={hour:gt,minute:gt,second:gt,hourCycle:"h23"},AA={hour:gt,minute:gt,second:gt,hourCycle:"h23",timeZoneName:zs},FA={hour:gt,minute:gt,second:gt,hourCycle:"h23",timeZoneName:Mi},OA={year:gt,month:gt,day:gt,hour:gt,minute:gt},PA={year:gt,month:gt,day:gt,hour:gt,minute:gt,second:gt},jA={year:gt,month:zs,day:gt,hour:gt,minute:gt},LA={year:gt,month:zs,day:gt,hour:gt,minute:gt,second:gt},k_={year:gt,month:zs,day:gt,weekday:zs,hour:gt,minute:gt},RA={year:gt,month:Mi,day:gt,hour:gt,minute:gt,timeZoneName:zs},_A={year:gt,month:Mi,day:gt,hour:gt,minute:gt,second:gt,timeZoneName:zs},BA={year:gt,month:Mi,day:gt,weekday:Mi,hour:gt,minute:gt,timeZoneName:Mi},HA={year:gt,month:Mi,day:gt,weekday:Mi,hour:gt,minute:gt,second:gt,timeZoneName:Mi};class Ov{get type(){throw new Yc}get name(){throw new Yc}get ianaName(){return this.name}get isUniversal(){throw new Yc}offsetName(t,n){throw new Yc}formatOffset(t,n){throw new Yc}offset(t){throw new Yc}equals(t){throw new Yc}get isValid(){throw new Yc}}let TS=null;class yb extends Ov{static get instance(){return TS===null&&(TS=new yb),TS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return UA(t,n,r)}formatOffset(t,n){return zg(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let aw={};function N_(e){return aw[e]||(aw[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),aw[e]}const A_={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function F_(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,i,l,c,f,h]=r;return[i,a,o,l,c,f,h]}function O_(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a=0?S:1e3+S,(y-w)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let BC={};function P_(e,t={}){const n=JSON.stringify([e,t]);let r=BC[n];return r||(r=new Intl.ListFormat(e,t),BC[n]=r),r}let pT={};function mT(e,t={}){const n=JSON.stringify([e,t]);let r=pT[n];return r||(r=new Intl.DateTimeFormat(e,t),pT[n]=r),r}let gT={};function j_(e,t={}){const n=JSON.stringify([e,t]);let r=gT[n];return r||(r=new Intl.NumberFormat(e,t),gT[n]=r),r}let vT={};function L_(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=vT[a];return o||(o=new Intl.RelativeTimeFormat(e,t),vT[a]=o),o}let Lg=null;function R_(){return Lg||(Lg=new Intl.DateTimeFormat().resolvedOptions().locale,Lg)}function __(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=mT(e).resolvedOptions(),a=e}catch{const c=e.substring(0,n);r=mT(c).resolvedOptions(),a=c}const{numberingSystem:o,calendar:i}=r;return[a,o,i]}}function B_(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function H_(e){const t=[];for(let n=1;n<=12;n++){const r=At.utc(2016,n,1);t.push(e(r))}return t}function Y_(e){const t=[];for(let n=1;n<=7;n++){const r=At.utc(2016,11,13+n);t.push(e(r))}return t}function T0(e,t,n,r,a){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):a(t)}function U_(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class z_{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...i}=r;if(!n||Object.keys(i).length>0){const l={useGrouping:!1,...r};r.padTo>0&&(l.minimumIntegerDigits=r.padTo),this.inf=j_(t,l)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):O2(t,3);return Xr(n,this.padTo)}}}class V_{constructor(t,n,r){this.opts=r;let a;if(t.zone.isUniversal){const i=-1*(t.offset/60),l=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;t.offset!==0&&zu.create(l).valid?(a=l,this.dt=t):(a="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:At.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,a=t.zone.name);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=mT(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class W_{constructor(t,n,r){this.opts={style:"long",...r},!n&&YA()&&(this.rtf=L_(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):lB(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class ur{static fromOpts(t){return ur.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,a=!1){const o=t||Qr.defaultLocale,i=o||(a?"en-US":R_()),l=n||Qr.defaultNumberingSystem,c=r||Qr.defaultOutputCalendar;return new ur(i,l,c,o)}static resetCache(){Lg=null,pT={},gT={},vT={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return ur.create(t,n,r)}constructor(t,n,r,a){const[o,i,l]=__(t);this.locale=o,this.numberingSystem=n||i||null,this.outputCalendar=r||l||null,this.intl=B_(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=U_(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:ur.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return T0(this,t,r,WA,()=>{const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=H_(i=>this.extract(i,a,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return T0(this,t,r,qA,()=>{const a=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Y_(i=>this.extract(i,a,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return T0(this,void 0,t,()=>GA,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[At.utc(2016,11,13,9),At.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return T0(this,t,n,JA,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[At.utc(-40,1,1),At.utc(2017,1,1)].map(a=>this.extract(a,r,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),i=o.find(l=>l.type.toLowerCase()===r);return i?i.value:null}numberFormatter(t={}){return new z_(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new V_(t,this.intl,n)}relFormatter(t={}){return new W_(this.intl,this.isEnglish(),t)}listFormatter(t={}){return P_(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let IS=null;class ko extends Ov{static get utcInstance(){return IS===null&&(IS=new ko(0)),IS}static instance(t){return t===0?ko.utcInstance:new ko(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ko(bb(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${zg(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${zg(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return zg(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class $_ extends Ov{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gc(e,t){if(Cn(e)||e===null)return t;if(e instanceof Ov)return e;if(Z_(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?yb.instance:n==="utc"||n==="gmt"?ko.utcInstance:ko.parseSpecifier(n)||zu.create(e)}else return hf(e)?ko.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new $_(e)}let HC=()=>Date.now(),YC="system",UC=null,zC=null,VC=null,WC=60,$C;class Qr{static get now(){return HC}static set now(t){HC=t}static set defaultZone(t){YC=t}static get defaultZone(){return Gc(YC,yb.instance)}static get defaultLocale(){return UC}static set defaultLocale(t){UC=t}static get defaultNumberingSystem(){return zC}static set defaultNumberingSystem(t){zC=t}static get defaultOutputCalendar(){return VC}static set defaultOutputCalendar(t){VC=t}static get twoDigitCutoffYear(){return WC}static set twoDigitCutoffYear(t){WC=t%100}static get throwOnInvalid(){return $C}static set throwOnInvalid(t){$C=t}static resetCaches(){ur.resetCache(),zu.resetCache()}}function Cn(e){return typeof e>"u"}function hf(e){return typeof e=="number"}function wb(e){return typeof e=="number"&&e%1===0}function Z_(e){return typeof e=="string"}function q_(e){return Object.prototype.toString.call(e)==="[object Date]"}function YA(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function G_(e){return Array.isArray(e)?e:[e]}function ZC(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function J_(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function bp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Yu(e,t,n){return wb(e)&&e>=t&&e<=n}function K_(e,t){return e-t*Math.floor(e/t)}function Xr(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function qc(e){if(!(Cn(e)||e===null||e===""))return parseInt(e,10)}function Xd(e){if(!(Cn(e)||e===null||e===""))return parseFloat(e)}function F2(e){if(!(Cn(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function O2(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Pv(e){return e%4===0&&(e%100!==0||e%400===0)}function Ug(e){return Pv(e)?366:365}function Mw(e,t){const n=K_(t-1,12)+1,r=e+(t-n)/12;return n===2?Pv(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function P2(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function kw(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function yT(e){return e>99?e:e>Qr.twoDigitCutoffYear?1900+e:2e3+e}function UA(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const i={timeZoneName:t,...o},l=new Intl.DateTimeFormat(n,i).formatToParts(a).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function bb(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function zA(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Xi(`Invalid unit value ${e}`);return t}function Nw(e,t){const n={};for(const r in e)if(bp(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=zA(a)}return n}function zg(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Xr(n,2)}:${Xr(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Xr(n,2)}${Xr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sb(e){return J_(e,["hour","minute","second","millisecond"])}const Q_=["January","February","March","April","May","June","July","August","September","October","November","December"],VA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],X_=["J","F","M","A","M","J","J","A","S","O","N","D"];function WA(e){switch(e){case"narrow":return[...X_];case"short":return[...VA];case"long":return[...Q_];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const $A=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ZA=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],eB=["M","T","W","T","F","S","S"];function qA(e){switch(e){case"narrow":return[...eB];case"short":return[...ZA];case"long":return[...$A];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const GA=["AM","PM"],tB=["Before Christ","Anno Domini"],nB=["BC","AD"],rB=["B","A"];function JA(e){switch(e){case"narrow":return[...rB];case"short":return[...nB];case"long":return[...tB];default:return null}}function aB(e){return GA[e.hour<12?0:1]}function oB(e,t){return qA(t)[e.weekday-1]}function iB(e,t){return WA(t)[e.month-1]}function sB(e,t){return JA(t)[e.year<0?0:1]}function lB(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const g=e==="days";switch(t){case 1:return g?"tomorrow":`next ${a[e][0]}`;case-1:return g?"yesterday":`last ${a[e][0]}`;case 0:return g?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,l=Math.abs(t),c=l===1,f=a[e],h=r?c?f[1]:f[2]||f[1]:c?a[e][0]:e;return i?`${l} ${h} ago`:`in ${l} ${h}`}function qC(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const uB={D:xw,DD:DA,DDD:TA,DDDD:IA,t:EA,tt:CA,ttt:xA,tttt:MA,T:kA,TT:NA,TTT:AA,TTTT:FA,f:OA,ff:jA,fff:RA,ffff:BA,F:PA,FF:LA,FFF:_A,FFFF:HA};class uo{static create(t,n={}){return new uo(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let i=0;i0&&o.push({literal:a,val:r}),n=null,r="",a=!a):a||l===n?r+=l:(r.length>0&&o.push({literal:!1,val:r}),r=l,n=l)}return r.length>0&&o.push({literal:a,val:r}),o}static macroTokenToFormatOpts(t){return uB[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Xr(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(w,S)=>this.loc.extract(t,w,S),i=w=>t.isOffsetFixed&&t.offset===0&&w.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,w.format):"",l=()=>r?aB(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(w,S)=>r?iB(t,w):o(S?{month:w}:{month:w,day:"numeric"},"month"),f=(w,S)=>r?oB(t,w):o(S?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),h=w=>{const S=uo.macroTokenToFormatOpts(w);return S?this.formatWithSystemDefault(t,S):w},g=w=>r?sB(t,w):o({era:w},"era"),y=w=>{switch(w){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(w)}};return qC(uo.parseFormat(n),y)}formatDurationFromString(t,n){const r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=c=>f=>{const h=r(f);return h?this.num(c.get(h),f.length):f},o=uo.parseFormat(n),i=o.reduce((c,{literal:f,val:h})=>f?c:c.concat(h),[]),l=t.shiftTo(...i.map(r).filter(c=>c));return qC(o,a(l))}}class Bs{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const KA=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Hp(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Yp(...e){return t=>e.reduce(([n,r,a],o)=>{const[i,l,c]=o(t,a);return[{...n,...i},l||r,c]},[{},null,1]).slice(0,2)}function Up(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function QA(...e){return(t,n)=>{const r={};let a;for(a=0;aw!==void 0&&(S||w&&h)?-w:w;return[{years:y(Xd(n)),months:y(Xd(r)),weeks:y(Xd(a)),days:y(Xd(o)),hours:y(Xd(i)),minutes:y(Xd(l)),seconds:y(Xd(c),c==="-0"),milliseconds:y(F2(f),g)}]}const DB={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function R2(e,t,n,r,a,o,i){const l={year:t.length===2?yT(qc(t)):qc(t),month:VA.indexOf(n)+1,day:qc(r),hour:qc(a),minute:qc(o)};return i&&(l.second=qc(i)),e&&(l.weekday=e.length>3?$A.indexOf(e)+1:ZA.indexOf(e)+1),l}const TB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function IB(e){const[,t,n,r,a,o,i,l,c,f,h,g]=e,y=R2(t,a,r,n,o,i,l);let w;return c?w=DB[c]:f?w=0:w=bb(h,g),[y,new ko(w)]}function EB(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const CB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xB=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,MB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function GC(e){const[,t,n,r,a,o,i,l]=e;return[R2(t,a,r,n,o,i,l),ko.utcInstance]}function kB(e){const[,t,n,r,a,o,i,l]=e;return[R2(t,l,n,r,a,o,i),ko.utcInstance]}const NB=Hp(dB,L2),AB=Hp(fB,L2),FB=Hp(hB,L2),OB=Hp(e6),n6=Yp(yB,zp,jv,Lv),PB=Yp(pB,zp,jv,Lv),jB=Yp(mB,zp,jv,Lv),LB=Yp(zp,jv,Lv);function RB(e){return Up(e,[NB,n6],[AB,PB],[FB,jB],[OB,LB])}function _B(e){return Up(EB(e),[TB,IB])}function BB(e){return Up(e,[CB,GC],[xB,GC],[MB,kB])}function HB(e){return Up(e,[bB,SB])}const YB=Yp(zp);function UB(e){return Up(e,[wB,YB])}const zB=Hp(gB,vB),VB=Hp(t6),WB=Yp(zp,jv,Lv);function $B(e){return Up(e,[zB,n6],[VB,WB])}const ZB="Invalid Duration",r6={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},qB={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...r6},Qi=146097/400,ep=146097/4800,GB={years:{quarters:4,months:12,weeks:Qi/7,days:Qi,hours:Qi*24,minutes:Qi*24*60,seconds:Qi*24*60*60,milliseconds:Qi*24*60*60*1e3},quarters:{months:3,weeks:Qi/28,days:Qi/4,hours:Qi*24/4,minutes:Qi*24*60/4,seconds:Qi*24*60*60/4,milliseconds:Qi*24*60*60*1e3/4},months:{weeks:ep/7,days:ep,hours:ep*24,minutes:ep*24*60,seconds:ep*24*60*60,milliseconds:ep*24*60*60*1e3},...r6},af=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],JB=af.slice(0).reverse();function Uc(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new bt(r)}function KB(e){return e<0?Math.floor(e):Math.ceil(e)}function a6(e,t,n,r,a){const o=e[a][n],i=t[n]/o,l=Math.sign(i)===Math.sign(r[a]),c=!l&&r[a]!==0&&Math.abs(i)<=1?KB(i):Math.trunc(i);r[a]+=c,t[n]-=c*o}function QB(e,t){JB.reduce((n,r)=>Cn(t[r])?n:(n&&a6(e,t,n,t,r),r),null)}function XB(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class bt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?GB:qB;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||ur.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return bt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Xi(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new bt({values:Nw(t,bt.normalizeUnit),loc:ur.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(hf(t))return bt.fromMillis(t);if(bt.isDuration(t))return t;if(typeof t=="object")return bt.fromObject(t);throw new Xi(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=HB(t);return r?bt.fromObject(r,n):bt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=UB(t);return r?bt.fromObject(r,n):bt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Xi("need to specify a reason the Duration is invalid");const r=t instanceof Bs?t:new Bs(t,n);if(Qr.throwOnInvalid)throw new x_(r);return new bt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new SA(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?uo.create(this.loc,r).formatDurationFromString(this,t):ZB}toHuman(t={}){const n=af.map(r=>{const a=this.values[r];return Cn(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(a)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=O2(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let a=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(a+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(a+=".SSS"));let o=r.toFormat(a);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t),r={};for(const a of af)(bp(n.values,a)||bp(this.values,a))&&(r[a]=n.get(a)+this.get(a));return Uc(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=zA(t(this.values[r],r));return Uc(this,{values:n},!0)}get(t){return this[bt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Nw(t,bt.normalizeUnit)};return Uc(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return Uc(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return QB(this.matrix,t),Uc(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=XB(this.normalize().shiftToAll().toObject());return Uc(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(i=>bt.normalizeUnit(i));const n={},r={},a=this.toObject();let o;for(const i of af)if(t.indexOf(i)>=0){o=i;let l=0;for(const f in r)l+=this.matrix[f][i]*r[f],r[f]=0;hf(a[i])&&(l+=a[i]);const c=Math.trunc(l);n[i]=c,r[i]=(l*1e3-c*1e3)/1e3;for(const f in a)af.indexOf(f)>af.indexOf(i)&&a6(this.matrix,a,f,n,i)}else hf(a[i])&&(r[i]=a[i]);for(const i in r)r[i]!==0&&(n[o]+=i===o?r[i]:r[i]/this.matrix[o][i]);return Uc(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Uc(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of af)if(!n(this.values[r],t.values[r]))return!1;return!0}}const tp="Invalid Interval";function eH(e,t){return!e||!e.isValid?Or.invalid("missing or invalid start"):!t||!t.isValid?Or.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Or.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(wg).filter(i=>this.contains(i)).sort(),r=[];let{s:a}=this,o=0;for(;a+this.e?this.e:i;r.push(Or.fromDateTimes(a,l)),a=l,o+=1}return r}splitBy(t){const n=bt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const i=[];for(;rc*a));o=+l>+this.e?this.e:l,i.push(Or.fromDateTimes(r,o)),r=o,a+=1}return i}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e=r?null:Or.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.st.e?this.e:t.e;return Or.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],i)=>o?o.overlaps(i)||o.abutsStart(i)?[a,o.union(i)]:[a.concat([o]),i]:[a,i],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),i=Array.prototype.concat(...o),l=i.sort((c,f)=>c.time-f.time);for(const c of l)r+=c.type==="s"?1:-1,r===1?n=c.time:(n&&+n!=+c.time&&a.push(Or.fromDateTimes(n,c.time)),n=null);return Or.merge(a)}difference(...t){return Or.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:tp}toLocaleString(t=xw,n={}){return this.isValid?uo.create(this.s.loc.clone(n),t).formatInterval(this):tp}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:tp}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:tp}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:tp}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:tp}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):bt.invalid(this.invalidReason)}mapEndpoints(t){return Or.fromDateTimes(t(this.s),t(this.e))}}class I0{static hasDST(t=Qr.defaultZone){const n=At.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return zu.isValidZone(t)}static normalizeZone(t){return Gc(t,Qr.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||ur.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||ur.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||ur.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||ur.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return ur.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return ur.create(n,null,"gregory").eras(t)}static features(){return{relative:YA()}}}function JC(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(bt.fromMillis(r).as("days"))}function tH(e,t,n){const r=[["years",(c,f)=>f.year-c.year],["quarters",(c,f)=>f.quarter-c.quarter+(f.year-c.year)*4],["months",(c,f)=>f.month-c.month+(f.year-c.year)*12],["weeks",(c,f)=>{const h=JC(c,f);return(h-h%7)/7}],["days",JC]],a={},o=e;let i,l;for(const[c,f]of r)n.indexOf(c)>=0&&(i=c,a[c]=f(e,t),l=o.plus(a),l>t?(a[c]--,e=o.plus(a)):e=l);return[e,a,l,i]}function nH(e,t,n,r){let[a,o,i,l]=tH(e,t,n);const c=t-a,f=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);f.length===0&&(i0?bt.fromMillis(c,r).shiftTo(...f).plus(h):h}const _2={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},KC={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},rH=_2.hanidec.replace(/[\[|\]]/g,"").split("");function aH(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=o&&r<=i&&(t+=r-o)}}return parseInt(t,10)}else return t}function Fs({numberingSystem:e},t=""){return new RegExp(`${_2[e||"latn"]}${t}`)}const oH="missing Intl.DateTimeFormat.formatToParts support";function Ln(e,t=n=>n){return{regex:e,deser:([n])=>t(aH(n))}}const iH=" ",o6=`[ ${iH}]`,i6=new RegExp(o6,"g");function sH(e){return e.replace(/\./g,"\\.?").replace(i6,o6)}function QC(e){return e.replace(/\./g,"").replace(i6," ").toLowerCase()}function Os(e,t){return e===null?null:{regex:RegExp(e.map(sH).join("|")),deser:([n])=>e.findIndex(r=>QC(n)===QC(r))+t}}function XC(e,t){return{regex:e,deser:([,n,r])=>bb(n,r),groups:t}}function ES(e){return{regex:e,deser:([t])=>t}}function lH(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uH(e,t){const n=Fs(t),r=Fs(t,"{2}"),a=Fs(t,"{3}"),o=Fs(t,"{4}"),i=Fs(t,"{6}"),l=Fs(t,"{1,2}"),c=Fs(t,"{1,3}"),f=Fs(t,"{1,6}"),h=Fs(t,"{1,9}"),g=Fs(t,"{2,4}"),y=Fs(t,"{4,6}"),w=I=>({regex:RegExp(lH(I.val)),deser:([M])=>M,literal:!0}),D=(I=>{if(e.literal)return w(I);switch(I.val){case"G":return Os(t.eras("short",!1),0);case"GG":return Os(t.eras("long",!1),0);case"y":return Ln(f);case"yy":return Ln(g,yT);case"yyyy":return Ln(o);case"yyyyy":return Ln(y);case"yyyyyy":return Ln(i);case"M":return Ln(l);case"MM":return Ln(r);case"MMM":return Os(t.months("short",!0,!1),1);case"MMMM":return Os(t.months("long",!0,!1),1);case"L":return Ln(l);case"LL":return Ln(r);case"LLL":return Os(t.months("short",!1,!1),1);case"LLLL":return Os(t.months("long",!1,!1),1);case"d":return Ln(l);case"dd":return Ln(r);case"o":return Ln(c);case"ooo":return Ln(a);case"HH":return Ln(r);case"H":return Ln(l);case"hh":return Ln(r);case"h":return Ln(l);case"mm":return Ln(r);case"m":return Ln(l);case"q":return Ln(l);case"qq":return Ln(r);case"s":return Ln(l);case"ss":return Ln(r);case"S":return Ln(c);case"SSS":return Ln(a);case"u":return ES(h);case"uu":return ES(l);case"uuu":return Ln(n);case"a":return Os(t.meridiems(),0);case"kkkk":return Ln(o);case"kk":return Ln(g,yT);case"W":return Ln(l);case"WW":return Ln(r);case"E":case"c":return Ln(n);case"EEE":return Os(t.weekdays("short",!1,!1),1);case"EEEE":return Os(t.weekdays("long",!1,!1),1);case"ccc":return Os(t.weekdays("short",!0,!1),1);case"cccc":return Os(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return XC(new RegExp(`([+-]${l.source})(?::(${r.source}))?`),2);case"ZZZ":return XC(new RegExp(`([+-]${l.source})(${r.source})?`),2);case"z":return ES(/[a-z_+-/]{1,256}?/i);default:return w(I)}})(e)||{invalidReason:oH};return D.token=e,D}const cH={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dH(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const a=t[n];let o=cH[n];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function fH(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function hH(e,t,n){const r=e.match(t);if(r){const a={};let o=1;for(const i in n)if(bp(n,i)){const l=n[i],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(a[l.token.val[0]]=l.deser(r.slice(o,o+c))),o+=c}return[r,a]}else return[r,{}]}function pH(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Cn(e.z)||(n=zu.create(e.z)),Cn(e.Z)||(n||(n=new ko(e.Z)),r=e.Z),Cn(e.q)||(e.M=(e.q-1)*3+1),Cn(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Cn(e.u)||(e.S=F2(e.u)),[Object.keys(e).reduce((o,i)=>{const l=t(i);return l&&(o[l]=e[i]),o},{}),n,r]}let CS=null;function mH(){return CS||(CS=At.fromMillis(1555555555555)),CS}function gH(e,t){if(e.literal)return e;const n=uo.macroTokenToFormatOpts(e.val),r=u6(n,t);return r==null||r.includes(void 0)?e:r}function s6(e,t){return Array.prototype.concat(...e.map(n=>gH(n,t)))}function l6(e,t,n){const r=s6(uo.parseFormat(n),e),a=r.map(i=>uH(i,e)),o=a.find(i=>i.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[i,l]=fH(a),c=RegExp(i,"i"),[f,h]=hH(t,c,l),[g,y,w]=h?pH(h):[null,null,void 0];if(bp(h,"a")&&bp(h,"H"))throw new jg("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:f,matches:h,result:g,zone:y,specificOffset:w}}}function vH(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:i}=l6(e,t,n);return[r,a,o,i]}function u6(e,t){return e?uo.create(t,e).formatDateTimeParts(mH()).map(a=>dH(a,e)):null}const c6=[0,31,59,90,120,151,181,212,243,273,304,334],d6=[0,31,60,91,121,152,182,213,244,274,305,335];function es(e,t){return new Bs("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function f6(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function h6(e,t,n){return n+(Pv(e)?d6:c6)[t-1]}function p6(e,t){const n=Pv(e)?d6:c6,r=n.findIndex(o=>okw(t)?(l=t+1,i=1):l=t,{weekYear:l,weekNumber:i,weekday:o,...Sb(e)}}function ex(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=f6(t,1,4),o=Ug(t);let i=n*7+r-a-3,l;i<1?(l=t-1,i+=Ug(l)):i>o?(l=t+1,i-=Ug(t)):l=t;const{month:c,day:f}=p6(l,i);return{year:l,month:c,day:f,...Sb(e)}}function xS(e){const{year:t,month:n,day:r}=e,a=h6(t,n,r);return{year:t,ordinal:a,...Sb(e)}}function tx(e){const{year:t,ordinal:n}=e,{month:r,day:a}=p6(t,n);return{year:t,month:r,day:a,...Sb(e)}}function yH(e){const t=wb(e.weekYear),n=Yu(e.weekNumber,1,kw(e.weekYear)),r=Yu(e.weekday,1,7);return t?n?r?!1:es("weekday",e.weekday):es("week",e.week):es("weekYear",e.weekYear)}function wH(e){const t=wb(e.year),n=Yu(e.ordinal,1,Ug(e.year));return t?n?!1:es("ordinal",e.ordinal):es("year",e.year)}function m6(e){const t=wb(e.year),n=Yu(e.month,1,12),r=Yu(e.day,1,Mw(e.year,e.month));return t?n?r?!1:es("day",e.day):es("month",e.month):es("year",e.year)}function g6(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=Yu(t,0,23)||t===24&&n===0&&r===0&&a===0,i=Yu(n,0,59),l=Yu(r,0,59),c=Yu(a,0,999);return o?i?l?c?!1:es("millisecond",a):es("second",r):es("minute",n):es("hour",t)}const MS="Invalid DateTime",nx=864e13;function E0(e){return new Bs("unsupported zone",`the zone "${e.name}" is not supported`)}function kS(e){return e.weekData===null&&(e.weekData=wT(e.c)),e.weekData}function vg(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new At({...n,...t,old:n})}function v6(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[e-Math.min(a,o)*60*1e3,Math.max(a,o)]}function rx(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ow(e,t,n){return v6(P2(e),t,n)}function ax(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:a,day:Math.min(e.c.day,Mw(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},i=bt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=P2(o);let[c,f]=v6(l,n,e.zone);return i!==0&&(c+=i,f=e.zone.offset(c)),{ts:c,o:f}}function yg(e,t,n,r,a,o){const{setZone:i,zone:l}=n;if(e&&Object.keys(e).length!==0){const c=t||l,f=At.fromObject(e,{...n,zone:c,specificOffset:o});return i?f:f.setZone(l)}else return At.invalid(new Bs("unparsable",`the input "${a}" can't be parsed as ${r}`))}function C0(e,t,n=!0){return e.isValid?uo.create(ur.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function NS(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Xr(e.c.year,n?6:4),t?(r+="-",r+=Xr(e.c.month),r+="-",r+=Xr(e.c.day)):(r+=Xr(e.c.month),r+=Xr(e.c.day)),r}function ox(e,t,n,r,a,o){let i=Xr(e.c.hour);return t?(i+=":",i+=Xr(e.c.minute),(e.c.second!==0||!n)&&(i+=":")):i+=Xr(e.c.minute),(e.c.second!==0||!n)&&(i+=Xr(e.c.second),(e.c.millisecond!==0||!r)&&(i+=".",i+=Xr(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!o?i+="Z":e.o<0?(i+="-",i+=Xr(Math.trunc(-e.o/60)),i+=":",i+=Xr(Math.trunc(-e.o%60))):(i+="+",i+=Xr(Math.trunc(e.o/60)),i+=":",i+=Xr(Math.trunc(e.o%60)))),o&&(i+="["+e.zone.ianaName+"]"),i}const y6={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bH={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},SH={ordinal:1,hour:0,minute:0,second:0,millisecond:0},w6=["year","month","day","hour","minute","second","millisecond"],DH=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],TH=["year","ordinal","hour","minute","second","millisecond"];function ix(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new SA(e);return t}function sx(e,t){const n=Gc(t.zone,Qr.defaultZone),r=ur.fromObject(t),a=Qr.now();let o,i;if(Cn(e.year))o=a;else{for(const f of w6)Cn(e[f])&&(e[f]=y6[f]);const l=m6(e)||g6(e);if(l)return At.invalid(l);const c=n.offset(a);[o,i]=ow(e,c,n)}return new At({ts:o,zone:n,loc:r,o:i})}function lx(e,t,n){const r=Cn(n.round)?!0:n.round,a=(i,l)=>(i=O2(i,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(i,l)),o=i=>n.calendary?t.hasSame(e,i)?0:t.startOf(i).diff(e.startOf(i),i).get(i):t.diff(e,i).get(i);if(n.unit)return a(o(n.unit),n.unit);for(const i of n.units){const l=o(i);if(Math.abs(l)>=1)return a(l,i)}return a(e>t?-0:0,n.units[n.units.length-1])}function ux(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class At{constructor(t){const n=t.zone||Qr.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Bs("invalid input"):null)||(n.isValid?null:E0(n));this.ts=Cn(t.ts)?Qr.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const l=n.offset(this.ts);a=rx(this.ts,l),r=Number.isNaN(a.year)?new Bs("invalid input"):null,a=r?null:a,o=r?null:l}this._zone=n,this.loc=t.loc||ur.create(),this.invalid=r,this.weekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new At({})}static local(){const[t,n]=ux(arguments),[r,a,o,i,l,c,f]=n;return sx({year:r,month:a,day:o,hour:i,minute:l,second:c,millisecond:f},t)}static utc(){const[t,n]=ux(arguments),[r,a,o,i,l,c,f]=n;return t.zone=ko.utcInstance,sx({year:r,month:a,day:o,hour:i,minute:l,second:c,millisecond:f},t)}static fromJSDate(t,n={}){const r=q_(t)?t.valueOf():NaN;if(Number.isNaN(r))return At.invalid("invalid input");const a=Gc(n.zone,Qr.defaultZone);return a.isValid?new At({ts:r,zone:a,loc:ur.fromObject(n)}):At.invalid(E0(a))}static fromMillis(t,n={}){if(hf(t))return t<-nx||t>nx?At.invalid("Timestamp out of range"):new At({ts:t,zone:Gc(n.zone,Qr.defaultZone),loc:ur.fromObject(n)});throw new Xi(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(hf(t))return new At({ts:t*1e3,zone:Gc(n.zone,Qr.defaultZone),loc:ur.fromObject(n)});throw new Xi("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Gc(n.zone,Qr.defaultZone);if(!r.isValid)return At.invalid(E0(r));const a=Qr.now(),o=Cn(n.specificOffset)?r.offset(a):n.specificOffset,i=Nw(t,ix),l=!Cn(i.ordinal),c=!Cn(i.year),f=!Cn(i.month)||!Cn(i.day),h=c||f,g=i.weekYear||i.weekNumber,y=ur.fromObject(n);if((h||l)&&g)throw new jg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&l)throw new jg("Can't mix ordinal dates with month/day");const w=g||i.weekday&&!h;let S,D,I=rx(a,o);w?(S=DH,D=bH,I=wT(I)):l?(S=TH,D=SH,I=xS(I)):(S=w6,D=y6);let M=!1;for(const V of S){const Y=i[V];Cn(Y)?M?i[V]=D[V]:i[V]=I[V]:M=!0}const N=w?yH(i):l?wH(i):m6(i),_=N||g6(i);if(_)return At.invalid(_);const k=w?ex(i):l?tx(i):i,[B,L]=ow(k,o,r),R=new At({ts:B,zone:r,o:L,loc:y});return i.weekday&&h&&t.weekday!==R.weekday?At.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${R.toISO()}`):R}static fromISO(t,n={}){const[r,a]=RB(t);return yg(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=_B(t);return yg(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=BB(t);return yg(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Cn(t)||Cn(n))throw new Xi("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,i=ur.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[l,c,f,h]=vH(i,t,n);return h?At.invalid(h):yg(l,c,r,`format ${n}`,t,f)}static fromString(t,n,r={}){return At.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=$B(t);return yg(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Xi("need to specify a reason the DateTime is invalid");const r=t instanceof Bs?t:new Bs(t,n);if(Qr.throwOnInvalid)throw new E_(r);return new At({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=u6(t,ur.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return s6(uo.parseFormat(t),ur.fromObject(n)).map(a=>a.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?kS(this).weekYear:NaN}get weekNumber(){return this.isValid?kS(this).weekNumber:NaN}get weekday(){return this.isValid?kS(this).weekday:NaN}get ordinal(){return this.isValid?xS(this.c).ordinal:NaN}get monthShort(){return this.isValid?I0.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?I0.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?I0.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?I0.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Pv(this.year)}get daysInMonth(){return Mw(this.year,this.month)}get daysInYear(){return this.isValid?Ug(this.year):NaN}get weeksInWeekYear(){return this.isValid?kw(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=uo.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(ko.instance(t),n)}toLocal(){return this.setZone(Qr.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Gc(t,Qr.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),i=this.toObject();[a]=ow(i,o,t)}return vg(this,{ts:a,zone:t})}else return At.invalid(E0(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return vg(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Nw(t,ix),r=!Cn(n.weekYear)||!Cn(n.weekNumber)||!Cn(n.weekday),a=!Cn(n.ordinal),o=!Cn(n.year),i=!Cn(n.month)||!Cn(n.day),l=o||i,c=n.weekYear||n.weekNumber;if((l||a)&&c)throw new jg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(i&&a)throw new jg("Can't mix ordinal dates with month/day");let f;r?f=ex({...wT(this.c),...n}):Cn(n.ordinal)?(f={...this.toObject(),...n},Cn(n.day)&&(f.day=Math.min(Mw(f.year,f.month),f.day))):f=tx({...xS(this.c),...n});const[h,g]=ow(f,this.o,this.zone);return vg(this,{ts:h,o:g})}plus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t);return vg(this,ax(this,n))}minus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t).negate();return vg(this,ax(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=bt.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?uo.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):MS}toLocaleString(t=xw,n={}){return this.isValid?uo.create(this.loc.clone(n),t).formatDateTime(this):MS}toLocaleParts(t={}){return this.isValid?uo.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const i=t==="extended";let l=NS(this,i);return l+="T",l+=ox(this,i,n,r,a,o),l}toISODate({format:t="extended"}={}){return this.isValid?NS(this,t==="extended"):null}toISOWeekDate(){return C0(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:i="extended"}={}){return this.isValid?(a?"T":"")+ox(this,i==="extended",n,t,r,o):null}toRFC2822(){return C0(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return C0(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?NS(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),C0(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():MS}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return bt.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=G_(n).map(bt.normalizeUnit),i=t.valueOf()>this.valueOf(),l=i?this:t,c=i?t:this,f=nH(l,c,o,a);return i?f.negate():f}diffNow(t="milliseconds",n={}){return this.diff(At.now(),t,n)}until(t){return this.isValid?Or.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n)<=r&&r<=a.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||At.fromObject({},{zone:this.zone}),r=t.padding?thisn.valueOf(),Math.min)}static max(...t){if(!t.every(At.isDateTime))throw new Xi("max requires all arguments be DateTimes");return ZC(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,i=ur.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return l6(i,t,n)}static fromStringExplain(t,n,r={}){return At.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return xw}static get DATE_MED(){return DA}static get DATE_MED_WITH_WEEKDAY(){return M_}static get DATE_FULL(){return TA}static get DATE_HUGE(){return IA}static get TIME_SIMPLE(){return EA}static get TIME_WITH_SECONDS(){return CA}static get TIME_WITH_SHORT_OFFSET(){return xA}static get TIME_WITH_LONG_OFFSET(){return MA}static get TIME_24_SIMPLE(){return kA}static get TIME_24_WITH_SECONDS(){return NA}static get TIME_24_WITH_SHORT_OFFSET(){return AA}static get TIME_24_WITH_LONG_OFFSET(){return FA}static get DATETIME_SHORT(){return OA}static get DATETIME_SHORT_WITH_SECONDS(){return PA}static get DATETIME_MED(){return jA}static get DATETIME_MED_WITH_SECONDS(){return LA}static get DATETIME_MED_WITH_WEEKDAY(){return k_}static get DATETIME_FULL(){return RA}static get DATETIME_FULL_WITH_SECONDS(){return _A}static get DATETIME_HUGE(){return BA}static get DATETIME_HUGE_WITH_SECONDS(){return HA}}function wg(e){if(At.isDateTime(e))return e;if(e&&e.valueOf&&hf(e.valueOf()))return At.fromJSDate(e);if(e&&typeof e=="object")return At.fromObject(e);throw new Xi(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const B2={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},IH={allowHtml:!0};({...B2,...IH});class H2{constructor(t){this.value=t,this.successful=!0}map(t){return new H2(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,n){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}}class Y2{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new Y2(t(this.error))}bimap(t,n){return this.mapErr(n)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}}var Aw;(function(e){function t(o){return new H2(o)}e.success=t;function n(o){return new Y2(o)}e.failure=n;function r(o,i,l){return o.successful?i.successful?l(o.value,i.value):n(i.error):n(o.error)}e.flatMap2=r;function a(o,i,l){return r(o,i,(c,f)=>t(l(c,f)))}e.map2=a})(Aw||(Aw={}));var EH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof dr<"u"?dr:typeof self<"u"?self:{},pe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:EH,function(){return function(n){var r={};function a(o){if(r[o])return r[o].exports;var i=r[o]={i:o,l:!1,exports:{}};return n[o].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=n,a.c=r,a.d=function(o,i,l){a.o(o,i)||Object.defineProperty(o,i,{configurable:!1,enumerable:!0,get:l})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,"a",i),i},a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)},a.p="",a(a.s=0)}([function(n,r,a){function o(te){if(!(this instanceof o))return new o(te);this._=te}var i=o.prototype;function l(te,me){for(var xe=0;xe>7),buf:function(He){var Qe=c(function(tt,kt,Yt,On){return tt.concat(Yt===On.length-1?Buffer.from([kt,0]).readUInt16BE(0):On.readUInt16BE(Yt))},[],He);return Buffer.from(f(function(tt){return(tt<<1&65535)>>8},Qe))}(xe.buf)}}),xe}function g(){return typeof Buffer<"u"}function y(){if(!g())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function w(te){y();var me=c(function(Qe,tt){return Qe+tt},0,te);if(me%8!=0)throw new Error("The bits ["+te.join(", ")+"] add up to "+me+" which is not an even number of bytes; the total should be divisible by 8");var xe,Ye=me/8,He=(xe=function(Qe){return Qe>48},c(function(Qe,tt){return Qe||(xe(tt)?tt:Qe)},null,te));if(He)throw new Error(He+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o(function(Qe,tt){var kt=Ye+tt;return kt>Qe.length?V(tt,Ye.toString()+" bytes"):R(kt,c(function(Yt,On){var yn=h(On,Yt.buf);return{coll:Yt.coll.concat(yn.v),buf:yn.buf}},{coll:[],buf:Qe.slice(tt,kt)},te).coll)})}function S(te,me){return new o(function(xe,Ye){return y(),Ye+me>xe.length?V(Ye,me+" bytes for "+te):R(Ye+me,xe.slice(Ye,Ye+me))})}function D(te,me){if(typeof(xe=me)!="number"||Math.floor(xe)!==xe||me<0||me>6)throw new Error(te+" requires integer length in range [0, 6].");var xe}function I(te){return D("uintBE",te),S("uintBE("+te+")",te).map(function(me){return me.readUIntBE(0,te)})}function M(te){return D("uintLE",te),S("uintLE("+te+")",te).map(function(me){return me.readUIntLE(0,te)})}function N(te){return D("intBE",te),S("intBE("+te+")",te).map(function(me){return me.readIntBE(0,te)})}function _(te){return D("intLE",te),S("intLE("+te+")",te).map(function(me){return me.readIntLE(0,te)})}function k(te){return te instanceof o}function B(te){return{}.toString.call(te)==="[object Array]"}function L(te){return g()&&Buffer.isBuffer(te)}function R(te,me){return{status:!0,index:te,value:me,furthest:-1,expected:[]}}function V(te,me){return B(me)||(me=[me]),{status:!1,index:-1,value:null,furthest:te,expected:me}}function Y(te,me){if(!me||te.furthest>me.furthest)return te;var xe=te.furthest===me.furthest?function(Ye,He){if(function(){if(o._supportsSet!==void 0)return o._supportsSet;var yr=typeof Set<"u";return o._supportsSet=yr,yr}()&&Array.from){for(var Qe=new Set(Ye),tt=0;tt=0;){if(tt in xe){Ye=xe[tt].line,Qe===0&&(Qe=xe[tt].lineStart);break}(te.charAt(tt)===` +`+g:" "}`+V}n==="restoreFromArchive"&&(_=_.replace(/ ?\[archived::(true|false)\]/,"")),n==="deleteForever"?I.splice(N.start,N.end-N.start+1):I.splice(N.start,N.end-N.start+1,_),c.push({...t.find(V=>V.id===N.id),deletedAt:n==="delete"?w.format("YYYY/MM/DD HH:mm:ss"):"",rowStatus:n==="archive"?"ARCHIVED":"NORMAL"})}),await r.modify(o,I.join(` +`)),dt.setChangedByMemos(!0),c}const I_=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return _l(e,{id:e.id,pinned:!0});case"DAILY":return Bl(e,{id:e.id,pinned:!0});case"MULTI":return js(e,{id:e.id,pinned:!0});case"FILE":return Rl(e,{id:e.id,pinned:!0})}},E_=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return _l(e,{id:e.id,pinned:!1});case"DAILY":return Bl(e,{id:e.id,pinned:!1});case"MULTI":return js(e,{id:e.id,pinned:!1});case"FILE":return Rl(e,{id:e.id,pinned:!1})}};var hT;(e=>{async function t(D){return await jC(D)}e.getMyMemos=t;async function n(D){return await jC([D])}e.updateSpecificTypeMemo=n;function r(){return p_()}e.getMyDeletedMemos=r;function a(D){const I=we.getMemoById(D);if(I)switch(I==null?void 0:I.sourceType){case"DAILY":return Bl(I,{id:I.id,deleted:!1});case"CANVAS":return _l(I,{id:I.id,deleted:!1});case"MULTI":return js(I,{id:I.id,deleted:!1});case"FILE":return Rl(I,{id:I.id,deleted:!1})}}e.restoreMemo=a;function o(D){return d_(D)}e.deleteMemoInSingleFile=o;function i(D){return c_(D)}e.deleteMemoInMultiFiles=i;function l(D){return h_(D)}e.deleteMemoInDailyNote=l;function c(D){return f_(D)}e.deleteMemoInCanvas=c;function f(){return kR()}e.getMyQueries=f;async function h(D,I){return await AR(D,I)}e.createQuery=h;function g(D,I,M){return GR(D,I,M)}e.updateQuery=g;function y(D){return w_(D)}e.deleteQueryById=y;function w(D){return b_(D)}e.pinQuery=w;function S(D){return S_(D)}e.unpinQuery=S})(hT||(hT={}));const Ko=hT;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});class Of extends Error{}class C_ extends Of{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class x_ extends Of{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class M_ extends Of{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class jg extends Of{}class DA extends Of{constructor(t){super(`Invalid unit ${t}`)}}class Xi extends Of{}class Uc extends Of{constructor(){super("Zone is an abstract class")}}const gt="numeric",zs="short",Mi="long",xw={year:gt,month:gt,day:gt},TA={year:gt,month:zs,day:gt},k_={year:gt,month:zs,day:gt,weekday:zs},IA={year:gt,month:Mi,day:gt},EA={year:gt,month:Mi,day:gt,weekday:Mi},CA={hour:gt,minute:gt},xA={hour:gt,minute:gt,second:gt},MA={hour:gt,minute:gt,second:gt,timeZoneName:zs},kA={hour:gt,minute:gt,second:gt,timeZoneName:Mi},NA={hour:gt,minute:gt,hourCycle:"h23"},AA={hour:gt,minute:gt,second:gt,hourCycle:"h23"},FA={hour:gt,minute:gt,second:gt,hourCycle:"h23",timeZoneName:zs},OA={hour:gt,minute:gt,second:gt,hourCycle:"h23",timeZoneName:Mi},PA={year:gt,month:gt,day:gt,hour:gt,minute:gt},jA={year:gt,month:gt,day:gt,hour:gt,minute:gt,second:gt},LA={year:gt,month:zs,day:gt,hour:gt,minute:gt},RA={year:gt,month:zs,day:gt,hour:gt,minute:gt,second:gt},N_={year:gt,month:zs,day:gt,weekday:zs,hour:gt,minute:gt},_A={year:gt,month:Mi,day:gt,hour:gt,minute:gt,timeZoneName:zs},BA={year:gt,month:Mi,day:gt,hour:gt,minute:gt,second:gt,timeZoneName:zs},HA={year:gt,month:Mi,day:gt,weekday:Mi,hour:gt,minute:gt,timeZoneName:Mi},UA={year:gt,month:Mi,day:gt,weekday:Mi,hour:gt,minute:gt,second:gt,timeZoneName:Mi};class Ov{get type(){throw new Uc}get name(){throw new Uc}get ianaName(){return this.name}get isUniversal(){throw new Uc}offsetName(t,n){throw new Uc}formatOffset(t,n){throw new Uc}offset(t){throw new Uc}equals(t){throw new Uc}get isValid(){throw new Uc}}let TS=null;class yb extends Ov{static get instance(){return TS===null&&(TS=new yb),TS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return zA(t,n,r)}formatOffset(t,n){return zg(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let aw={};function A_(e){return aw[e]||(aw[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),aw[e]}const F_={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function O_(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,i,l,c,f,h]=r;return[i,a,o,l,c,f,h]}function P_(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a=0?S:1e3+S,(y-w)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let BC={};function j_(e,t={}){const n=JSON.stringify([e,t]);let r=BC[n];return r||(r=new Intl.ListFormat(e,t),BC[n]=r),r}let pT={};function mT(e,t={}){const n=JSON.stringify([e,t]);let r=pT[n];return r||(r=new Intl.DateTimeFormat(e,t),pT[n]=r),r}let gT={};function L_(e,t={}){const n=JSON.stringify([e,t]);let r=gT[n];return r||(r=new Intl.NumberFormat(e,t),gT[n]=r),r}let vT={};function R_(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=vT[a];return o||(o=new Intl.RelativeTimeFormat(e,t),vT[a]=o),o}let Lg=null;function __(){return Lg||(Lg=new Intl.DateTimeFormat().resolvedOptions().locale,Lg)}function B_(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=mT(e).resolvedOptions(),a=e}catch{const c=e.substring(0,n);r=mT(c).resolvedOptions(),a=c}const{numberingSystem:o,calendar:i}=r;return[a,o,i]}}function H_(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function U_(e){const t=[];for(let n=1;n<=12;n++){const r=At.utc(2016,n,1);t.push(e(r))}return t}function Y_(e){const t=[];for(let n=1;n<=7;n++){const r=At.utc(2016,11,13+n);t.push(e(r))}return t}function T0(e,t,n,r,a){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):a(t)}function z_(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class V_{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...i}=r;if(!n||Object.keys(i).length>0){const l={useGrouping:!1,...r};r.padTo>0&&(l.minimumIntegerDigits=r.padTo),this.inf=L_(t,l)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):O2(t,3);return Xr(n,this.padTo)}}}class W_{constructor(t,n,r){this.opts=r;let a;if(t.zone.isUniversal){const i=-1*(t.offset/60),l=i>=0?`Etc/GMT+${i}`:`Etc/GMT${i}`;t.offset!==0&&zu.create(l).valid?(a=l,this.dt=t):(a="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:At.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,a=t.zone.name);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=mT(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class $_{constructor(t,n,r){this.opts={style:"long",...r},!n&&YA()&&(this.rtf=R_(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):uB(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class ur{static fromOpts(t){return ur.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,a=!1){const o=t||Qr.defaultLocale,i=o||(a?"en-US":__()),l=n||Qr.defaultNumberingSystem,c=r||Qr.defaultOutputCalendar;return new ur(i,l,c,o)}static resetCache(){Lg=null,pT={},gT={},vT={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return ur.create(t,n,r)}constructor(t,n,r,a){const[o,i,l]=B_(t);this.locale=o,this.numberingSystem=n||i||null,this.outputCalendar=r||l||null,this.intl=H_(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=z_(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:ur.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return T0(this,t,r,$A,()=>{const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=U_(i=>this.extract(i,a,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return T0(this,t,r,GA,()=>{const a=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Y_(i=>this.extract(i,a,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return T0(this,void 0,t,()=>JA,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[At.utc(2016,11,13,9),At.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return T0(this,t,n,KA,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[At.utc(-40,1,1),At.utc(2017,1,1)].map(a=>this.extract(a,r,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),i=o.find(l=>l.type.toLowerCase()===r);return i?i.value:null}numberFormatter(t={}){return new V_(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new W_(t,this.intl,n)}relFormatter(t={}){return new $_(this.intl,this.isEnglish(),t)}listFormatter(t={}){return j_(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let IS=null;class ko extends Ov{static get utcInstance(){return IS===null&&(IS=new ko(0)),IS}static instance(t){return t===0?ko.utcInstance:new ko(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ko(bb(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${zg(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${zg(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return zg(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Z_ extends Ov{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gc(e,t){if(xn(e)||e===null)return t;if(e instanceof Ov)return e;if(q_(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?yb.instance:n==="utc"||n==="gmt"?ko.utcInstance:ko.parseSpecifier(n)||zu.create(e)}else return hf(e)?ko.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new Z_(e)}let HC=()=>Date.now(),UC="system",YC=null,zC=null,VC=null,WC=60,$C;class Qr{static get now(){return HC}static set now(t){HC=t}static set defaultZone(t){UC=t}static get defaultZone(){return Gc(UC,yb.instance)}static get defaultLocale(){return YC}static set defaultLocale(t){YC=t}static get defaultNumberingSystem(){return zC}static set defaultNumberingSystem(t){zC=t}static get defaultOutputCalendar(){return VC}static set defaultOutputCalendar(t){VC=t}static get twoDigitCutoffYear(){return WC}static set twoDigitCutoffYear(t){WC=t%100}static get throwOnInvalid(){return $C}static set throwOnInvalid(t){$C=t}static resetCaches(){ur.resetCache(),zu.resetCache()}}function xn(e){return typeof e>"u"}function hf(e){return typeof e=="number"}function wb(e){return typeof e=="number"&&e%1===0}function q_(e){return typeof e=="string"}function G_(e){return Object.prototype.toString.call(e)==="[object Date]"}function YA(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function J_(e){return Array.isArray(e)?e:[e]}function ZC(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function K_(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function bp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Uu(e,t,n){return wb(e)&&e>=t&&e<=n}function Q_(e,t){return e-t*Math.floor(e/t)}function Xr(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function qc(e){if(!(xn(e)||e===null||e===""))return parseInt(e,10)}function Xd(e){if(!(xn(e)||e===null||e===""))return parseFloat(e)}function F2(e){if(!(xn(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function O2(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Pv(e){return e%4===0&&(e%100!==0||e%400===0)}function Yg(e){return Pv(e)?366:365}function Mw(e,t){const n=Q_(t-1,12)+1,r=e+(t-n)/12;return n===2?Pv(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function P2(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function kw(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function yT(e){return e>99?e:e>Qr.twoDigitCutoffYear?1900+e:2e3+e}function zA(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const i={timeZoneName:t,...o},l=new Intl.DateTimeFormat(n,i).formatToParts(a).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function bb(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function VA(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Xi(`Invalid unit value ${e}`);return t}function Nw(e,t){const n={};for(const r in e)if(bp(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=VA(a)}return n}function zg(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Xr(n,2)}:${Xr(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Xr(n,2)}${Xr(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sb(e){return K_(e,["hour","minute","second","millisecond"])}const X_=["January","February","March","April","May","June","July","August","September","October","November","December"],WA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],eB=["J","F","M","A","M","J","J","A","S","O","N","D"];function $A(e){switch(e){case"narrow":return[...eB];case"short":return[...WA];case"long":return[...X_];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ZA=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],qA=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],tB=["M","T","W","T","F","S","S"];function GA(e){switch(e){case"narrow":return[...tB];case"short":return[...qA];case"long":return[...ZA];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const JA=["AM","PM"],nB=["Before Christ","Anno Domini"],rB=["BC","AD"],aB=["B","A"];function KA(e){switch(e){case"narrow":return[...aB];case"short":return[...rB];case"long":return[...nB];default:return null}}function oB(e){return JA[e.hour<12?0:1]}function iB(e,t){return GA(t)[e.weekday-1]}function sB(e,t){return $A(t)[e.month-1]}function lB(e,t){return KA(t)[e.year<0?0:1]}function uB(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const g=e==="days";switch(t){case 1:return g?"tomorrow":`next ${a[e][0]}`;case-1:return g?"yesterday":`last ${a[e][0]}`;case 0:return g?"today":`this ${a[e][0]}`}}const i=Object.is(t,-0)||t<0,l=Math.abs(t),c=l===1,f=a[e],h=r?c?f[1]:f[2]||f[1]:c?a[e][0]:e;return i?`${l} ${h} ago`:`in ${l} ${h}`}function qC(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const cB={D:xw,DD:TA,DDD:IA,DDDD:EA,t:CA,tt:xA,ttt:MA,tttt:kA,T:NA,TT:AA,TTT:FA,TTTT:OA,f:PA,ff:LA,fff:_A,ffff:HA,F:jA,FF:RA,FFF:BA,FFFF:UA};class uo{static create(t,n={}){return new uo(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let i=0;i0&&o.push({literal:a,val:r}),n=null,r="",a=!a):a||l===n?r+=l:(r.length>0&&o.push({literal:!1,val:r}),r=l,n=l)}return r.length>0&&o.push({literal:a,val:r}),o}static macroTokenToFormatOpts(t){return cB[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Xr(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(w,S)=>this.loc.extract(t,w,S),i=w=>t.isOffsetFixed&&t.offset===0&&w.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,w.format):"",l=()=>r?oB(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(w,S)=>r?sB(t,w):o(S?{month:w}:{month:w,day:"numeric"},"month"),f=(w,S)=>r?iB(t,w):o(S?{weekday:w}:{weekday:w,month:"long",day:"numeric"},"weekday"),h=w=>{const S=uo.macroTokenToFormatOpts(w);return S?this.formatWithSystemDefault(t,S):w},g=w=>r?lB(t,w):o({era:w},"era"),y=w=>{switch(w){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(w)}};return qC(uo.parseFormat(n),y)}formatDurationFromString(t,n){const r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=c=>f=>{const h=r(f);return h?this.num(c.get(h),f.length):f},o=uo.parseFormat(n),i=o.reduce((c,{literal:f,val:h})=>f?c:c.concat(h),[]),l=t.shiftTo(...i.map(r).filter(c=>c));return qC(o,a(l))}}class Bs{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const QA=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Hp(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Up(...e){return t=>e.reduce(([n,r,a],o)=>{const[i,l,c]=o(t,a);return[{...n,...i},l||r,c]},[{},null,1]).slice(0,2)}function Yp(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function XA(...e){return(t,n)=>{const r={};let a;for(a=0;aw!==void 0&&(S||w&&h)?-w:w;return[{years:y(Xd(n)),months:y(Xd(r)),weeks:y(Xd(a)),days:y(Xd(o)),hours:y(Xd(i)),minutes:y(Xd(l)),seconds:y(Xd(c),c==="-0"),milliseconds:y(F2(f),g)}]}const TB={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function R2(e,t,n,r,a,o,i){const l={year:t.length===2?yT(qc(t)):qc(t),month:WA.indexOf(n)+1,day:qc(r),hour:qc(a),minute:qc(o)};return i&&(l.second=qc(i)),e&&(l.weekday=e.length>3?ZA.indexOf(e)+1:qA.indexOf(e)+1),l}const IB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function EB(e){const[,t,n,r,a,o,i,l,c,f,h,g]=e,y=R2(t,a,r,n,o,i,l);let w;return c?w=TB[c]:f?w=0:w=bb(h,g),[y,new ko(w)]}function CB(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const xB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,MB=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,kB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function GC(e){const[,t,n,r,a,o,i,l]=e;return[R2(t,a,r,n,o,i,l),ko.utcInstance]}function NB(e){const[,t,n,r,a,o,i,l]=e;return[R2(t,l,n,r,a,o,i),ko.utcInstance]}const AB=Hp(fB,L2),FB=Hp(hB,L2),OB=Hp(pB,L2),PB=Hp(t6),r6=Up(wB,zp,jv,Lv),jB=Up(mB,zp,jv,Lv),LB=Up(gB,zp,jv,Lv),RB=Up(zp,jv,Lv);function _B(e){return Yp(e,[AB,r6],[FB,jB],[OB,LB],[PB,RB])}function BB(e){return Yp(CB(e),[IB,EB])}function HB(e){return Yp(e,[xB,GC],[MB,GC],[kB,NB])}function UB(e){return Yp(e,[SB,DB])}const YB=Up(zp);function zB(e){return Yp(e,[bB,YB])}const VB=Hp(vB,yB),WB=Hp(n6),$B=Up(zp,jv,Lv);function ZB(e){return Yp(e,[VB,r6],[WB,$B])}const qB="Invalid Duration",a6={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},GB={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...a6},Qi=146097/400,ep=146097/4800,JB={years:{quarters:4,months:12,weeks:Qi/7,days:Qi,hours:Qi*24,minutes:Qi*24*60,seconds:Qi*24*60*60,milliseconds:Qi*24*60*60*1e3},quarters:{months:3,weeks:Qi/28,days:Qi/4,hours:Qi*24/4,minutes:Qi*24*60/4,seconds:Qi*24*60*60/4,milliseconds:Qi*24*60*60*1e3/4},months:{weeks:ep/7,days:ep,hours:ep*24,minutes:ep*24*60,seconds:ep*24*60*60,milliseconds:ep*24*60*60*1e3},...a6},af=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],KB=af.slice(0).reverse();function Yc(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new bt(r)}function QB(e){return e<0?Math.floor(e):Math.ceil(e)}function o6(e,t,n,r,a){const o=e[a][n],i=t[n]/o,l=Math.sign(i)===Math.sign(r[a]),c=!l&&r[a]!==0&&Math.abs(i)<=1?QB(i):Math.trunc(i);r[a]+=c,t[n]-=c*o}function XB(e,t){KB.reduce((n,r)=>xn(t[r])?n:(n&&o6(e,t,n,t,r),r),null)}function eH(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class bt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?JB:GB;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||ur.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return bt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Xi(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new bt({values:Nw(t,bt.normalizeUnit),loc:ur.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(hf(t))return bt.fromMillis(t);if(bt.isDuration(t))return t;if(typeof t=="object")return bt.fromObject(t);throw new Xi(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=UB(t);return r?bt.fromObject(r,n):bt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=zB(t);return r?bt.fromObject(r,n):bt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Xi("need to specify a reason the Duration is invalid");const r=t instanceof Bs?t:new Bs(t,n);if(Qr.throwOnInvalid)throw new M_(r);return new bt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new DA(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?uo.create(this.loc,r).formatDurationFromString(this,t):qB}toHuman(t={}){const n=af.map(r=>{const a=this.values[r];return xn(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(a)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=O2(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let a=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(a+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(a+=".SSS"));let o=r.toFormat(a);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t),r={};for(const a of af)(bp(n.values,a)||bp(this.values,a))&&(r[a]=n.get(a)+this.get(a));return Yc(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=VA(t(this.values[r],r));return Yc(this,{values:n},!0)}get(t){return this[bt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Nw(t,bt.normalizeUnit)};return Yc(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const i={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return Yc(this,i)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return XB(this.matrix,t),Yc(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=eH(this.normalize().shiftToAll().toObject());return Yc(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(i=>bt.normalizeUnit(i));const n={},r={},a=this.toObject();let o;for(const i of af)if(t.indexOf(i)>=0){o=i;let l=0;for(const f in r)l+=this.matrix[f][i]*r[f],r[f]=0;hf(a[i])&&(l+=a[i]);const c=Math.trunc(l);n[i]=c,r[i]=(l*1e3-c*1e3)/1e3;for(const f in a)af.indexOf(f)>af.indexOf(i)&&o6(this.matrix,a,f,n,i)}else hf(a[i])&&(r[i]=a[i]);for(const i in r)r[i]!==0&&(n[o]+=i===o?r[i]:r[i]/this.matrix[o][i]);return Yc(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Yc(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of af)if(!n(this.values[r],t.values[r]))return!1;return!0}}const tp="Invalid Interval";function tH(e,t){return!e||!e.isValid?Or.invalid("missing or invalid start"):!t||!t.isValid?Or.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Or.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(wg).filter(i=>this.contains(i)).sort(),r=[];let{s:a}=this,o=0;for(;a+this.e?this.e:i;r.push(Or.fromDateTimes(a,l)),a=l,o+=1}return r}splitBy(t){const n=bt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const i=[];for(;rc*a));o=+l>+this.e?this.e:l,i.push(Or.fromDateTimes(r,o)),r=o,a+=1}return i}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e=r?null:Or.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.st.e?this.e:t.e;return Or.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],i)=>o?o.overlaps(i)||o.abutsStart(i)?[a,o.union(i)]:[a.concat([o]),i]:[a,i],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),i=Array.prototype.concat(...o),l=i.sort((c,f)=>c.time-f.time);for(const c of l)r+=c.type==="s"?1:-1,r===1?n=c.time:(n&&+n!=+c.time&&a.push(Or.fromDateTimes(n,c.time)),n=null);return Or.merge(a)}difference(...t){return Or.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:tp}toLocaleString(t=xw,n={}){return this.isValid?uo.create(this.s.loc.clone(n),t).formatInterval(this):tp}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:tp}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:tp}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:tp}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:tp}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):bt.invalid(this.invalidReason)}mapEndpoints(t){return Or.fromDateTimes(t(this.s),t(this.e))}}class I0{static hasDST(t=Qr.defaultZone){const n=At.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return zu.isValidZone(t)}static normalizeZone(t){return Gc(t,Qr.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||ur.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||ur.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||ur.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||ur.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return ur.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return ur.create(n,null,"gregory").eras(t)}static features(){return{relative:YA()}}}function JC(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(bt.fromMillis(r).as("days"))}function nH(e,t,n){const r=[["years",(c,f)=>f.year-c.year],["quarters",(c,f)=>f.quarter-c.quarter+(f.year-c.year)*4],["months",(c,f)=>f.month-c.month+(f.year-c.year)*12],["weeks",(c,f)=>{const h=JC(c,f);return(h-h%7)/7}],["days",JC]],a={},o=e;let i,l;for(const[c,f]of r)n.indexOf(c)>=0&&(i=c,a[c]=f(e,t),l=o.plus(a),l>t?(a[c]--,e=o.plus(a)):e=l);return[e,a,l,i]}function rH(e,t,n,r){let[a,o,i,l]=nH(e,t,n);const c=t-a,f=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);f.length===0&&(i0?bt.fromMillis(c,r).shiftTo(...f).plus(h):h}const _2={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},KC={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},aH=_2.hanidec.replace(/[\[|\]]/g,"").split("");function oH(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=o&&r<=i&&(t+=r-o)}}return parseInt(t,10)}else return t}function Fs({numberingSystem:e},t=""){return new RegExp(`${_2[e||"latn"]}${t}`)}const iH="missing Intl.DateTimeFormat.formatToParts support";function Ln(e,t=n=>n){return{regex:e,deser:([n])=>t(oH(n))}}const sH=" ",i6=`[ ${sH}]`,s6=new RegExp(i6,"g");function lH(e){return e.replace(/\./g,"\\.?").replace(s6,i6)}function QC(e){return e.replace(/\./g,"").replace(s6," ").toLowerCase()}function Os(e,t){return e===null?null:{regex:RegExp(e.map(lH).join("|")),deser:([n])=>e.findIndex(r=>QC(n)===QC(r))+t}}function XC(e,t){return{regex:e,deser:([,n,r])=>bb(n,r),groups:t}}function ES(e){return{regex:e,deser:([t])=>t}}function uH(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function cH(e,t){const n=Fs(t),r=Fs(t,"{2}"),a=Fs(t,"{3}"),o=Fs(t,"{4}"),i=Fs(t,"{6}"),l=Fs(t,"{1,2}"),c=Fs(t,"{1,3}"),f=Fs(t,"{1,6}"),h=Fs(t,"{1,9}"),g=Fs(t,"{2,4}"),y=Fs(t,"{4,6}"),w=I=>({regex:RegExp(uH(I.val)),deser:([M])=>M,literal:!0}),D=(I=>{if(e.literal)return w(I);switch(I.val){case"G":return Os(t.eras("short",!1),0);case"GG":return Os(t.eras("long",!1),0);case"y":return Ln(f);case"yy":return Ln(g,yT);case"yyyy":return Ln(o);case"yyyyy":return Ln(y);case"yyyyyy":return Ln(i);case"M":return Ln(l);case"MM":return Ln(r);case"MMM":return Os(t.months("short",!0,!1),1);case"MMMM":return Os(t.months("long",!0,!1),1);case"L":return Ln(l);case"LL":return Ln(r);case"LLL":return Os(t.months("short",!1,!1),1);case"LLLL":return Os(t.months("long",!1,!1),1);case"d":return Ln(l);case"dd":return Ln(r);case"o":return Ln(c);case"ooo":return Ln(a);case"HH":return Ln(r);case"H":return Ln(l);case"hh":return Ln(r);case"h":return Ln(l);case"mm":return Ln(r);case"m":return Ln(l);case"q":return Ln(l);case"qq":return Ln(r);case"s":return Ln(l);case"ss":return Ln(r);case"S":return Ln(c);case"SSS":return Ln(a);case"u":return ES(h);case"uu":return ES(l);case"uuu":return Ln(n);case"a":return Os(t.meridiems(),0);case"kkkk":return Ln(o);case"kk":return Ln(g,yT);case"W":return Ln(l);case"WW":return Ln(r);case"E":case"c":return Ln(n);case"EEE":return Os(t.weekdays("short",!1,!1),1);case"EEEE":return Os(t.weekdays("long",!1,!1),1);case"ccc":return Os(t.weekdays("short",!0,!1),1);case"cccc":return Os(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return XC(new RegExp(`([+-]${l.source})(?::(${r.source}))?`),2);case"ZZZ":return XC(new RegExp(`([+-]${l.source})(${r.source})?`),2);case"z":return ES(/[a-z_+-/]{1,256}?/i);default:return w(I)}})(e)||{invalidReason:iH};return D.token=e,D}const dH={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function fH(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const a=t[n];let o=dH[n];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function hH(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function pH(e,t,n){const r=e.match(t);if(r){const a={};let o=1;for(const i in n)if(bp(n,i)){const l=n[i],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(a[l.token.val[0]]=l.deser(r.slice(o,o+c))),o+=c}return[r,a]}else return[r,{}]}function mH(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xn(e.z)||(n=zu.create(e.z)),xn(e.Z)||(n||(n=new ko(e.Z)),r=e.Z),xn(e.q)||(e.M=(e.q-1)*3+1),xn(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xn(e.u)||(e.S=F2(e.u)),[Object.keys(e).reduce((o,i)=>{const l=t(i);return l&&(o[l]=e[i]),o},{}),n,r]}let CS=null;function gH(){return CS||(CS=At.fromMillis(1555555555555)),CS}function vH(e,t){if(e.literal)return e;const n=uo.macroTokenToFormatOpts(e.val),r=c6(n,t);return r==null||r.includes(void 0)?e:r}function l6(e,t){return Array.prototype.concat(...e.map(n=>vH(n,t)))}function u6(e,t,n){const r=l6(uo.parseFormat(n),e),a=r.map(i=>cH(i,e)),o=a.find(i=>i.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[i,l]=hH(a),c=RegExp(i,"i"),[f,h]=pH(t,c,l),[g,y,w]=h?mH(h):[null,null,void 0];if(bp(h,"a")&&bp(h,"H"))throw new jg("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:f,matches:h,result:g,zone:y,specificOffset:w}}}function yH(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:i}=u6(e,t,n);return[r,a,o,i]}function c6(e,t){return e?uo.create(t,e).formatDateTimeParts(gH()).map(a=>fH(a,e)):null}const d6=[0,31,59,90,120,151,181,212,243,273,304,334],f6=[0,31,60,91,121,152,182,213,244,274,305,335];function es(e,t){return new Bs("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function h6(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function p6(e,t,n){return n+(Pv(e)?f6:d6)[t-1]}function m6(e,t){const n=Pv(e)?f6:d6,r=n.findIndex(o=>okw(t)?(l=t+1,i=1):l=t,{weekYear:l,weekNumber:i,weekday:o,...Sb(e)}}function ex(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=h6(t,1,4),o=Yg(t);let i=n*7+r-a-3,l;i<1?(l=t-1,i+=Yg(l)):i>o?(l=t+1,i-=Yg(t)):l=t;const{month:c,day:f}=m6(l,i);return{year:l,month:c,day:f,...Sb(e)}}function xS(e){const{year:t,month:n,day:r}=e,a=p6(t,n,r);return{year:t,ordinal:a,...Sb(e)}}function tx(e){const{year:t,ordinal:n}=e,{month:r,day:a}=m6(t,n);return{year:t,month:r,day:a,...Sb(e)}}function wH(e){const t=wb(e.weekYear),n=Uu(e.weekNumber,1,kw(e.weekYear)),r=Uu(e.weekday,1,7);return t?n?r?!1:es("weekday",e.weekday):es("week",e.week):es("weekYear",e.weekYear)}function bH(e){const t=wb(e.year),n=Uu(e.ordinal,1,Yg(e.year));return t?n?!1:es("ordinal",e.ordinal):es("year",e.year)}function g6(e){const t=wb(e.year),n=Uu(e.month,1,12),r=Uu(e.day,1,Mw(e.year,e.month));return t?n?r?!1:es("day",e.day):es("month",e.month):es("year",e.year)}function v6(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=Uu(t,0,23)||t===24&&n===0&&r===0&&a===0,i=Uu(n,0,59),l=Uu(r,0,59),c=Uu(a,0,999);return o?i?l?c?!1:es("millisecond",a):es("second",r):es("minute",n):es("hour",t)}const MS="Invalid DateTime",nx=864e13;function E0(e){return new Bs("unsupported zone",`the zone "${e.name}" is not supported`)}function kS(e){return e.weekData===null&&(e.weekData=wT(e.c)),e.weekData}function vg(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new At({...n,...t,old:n})}function y6(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[e-Math.min(a,o)*60*1e3,Math.max(a,o)]}function rx(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ow(e,t,n){return y6(P2(e),t,n)}function ax(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:a,day:Math.min(e.c.day,Mw(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},i=bt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),l=P2(o);let[c,f]=y6(l,n,e.zone);return i!==0&&(c+=i,f=e.zone.offset(c)),{ts:c,o:f}}function yg(e,t,n,r,a,o){const{setZone:i,zone:l}=n;if(e&&Object.keys(e).length!==0){const c=t||l,f=At.fromObject(e,{...n,zone:c,specificOffset:o});return i?f:f.setZone(l)}else return At.invalid(new Bs("unparsable",`the input "${a}" can't be parsed as ${r}`))}function C0(e,t,n=!0){return e.isValid?uo.create(ur.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function NS(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Xr(e.c.year,n?6:4),t?(r+="-",r+=Xr(e.c.month),r+="-",r+=Xr(e.c.day)):(r+=Xr(e.c.month),r+=Xr(e.c.day)),r}function ox(e,t,n,r,a,o){let i=Xr(e.c.hour);return t?(i+=":",i+=Xr(e.c.minute),(e.c.second!==0||!n)&&(i+=":")):i+=Xr(e.c.minute),(e.c.second!==0||!n)&&(i+=Xr(e.c.second),(e.c.millisecond!==0||!r)&&(i+=".",i+=Xr(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!o?i+="Z":e.o<0?(i+="-",i+=Xr(Math.trunc(-e.o/60)),i+=":",i+=Xr(Math.trunc(-e.o%60))):(i+="+",i+=Xr(Math.trunc(e.o/60)),i+=":",i+=Xr(Math.trunc(e.o%60)))),o&&(i+="["+e.zone.ianaName+"]"),i}const w6={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},SH={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},DH={ordinal:1,hour:0,minute:0,second:0,millisecond:0},b6=["year","month","day","hour","minute","second","millisecond"],TH=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],IH=["year","ordinal","hour","minute","second","millisecond"];function ix(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new DA(e);return t}function sx(e,t){const n=Gc(t.zone,Qr.defaultZone),r=ur.fromObject(t),a=Qr.now();let o,i;if(xn(e.year))o=a;else{for(const f of b6)xn(e[f])&&(e[f]=w6[f]);const l=g6(e)||v6(e);if(l)return At.invalid(l);const c=n.offset(a);[o,i]=ow(e,c,n)}return new At({ts:o,zone:n,loc:r,o:i})}function lx(e,t,n){const r=xn(n.round)?!0:n.round,a=(i,l)=>(i=O2(i,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(i,l)),o=i=>n.calendary?t.hasSame(e,i)?0:t.startOf(i).diff(e.startOf(i),i).get(i):t.diff(e,i).get(i);if(n.unit)return a(o(n.unit),n.unit);for(const i of n.units){const l=o(i);if(Math.abs(l)>=1)return a(l,i)}return a(e>t?-0:0,n.units[n.units.length-1])}function ux(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class At{constructor(t){const n=t.zone||Qr.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Bs("invalid input"):null)||(n.isValid?null:E0(n));this.ts=xn(t.ts)?Qr.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const l=n.offset(this.ts);a=rx(this.ts,l),r=Number.isNaN(a.year)?new Bs("invalid input"):null,a=r?null:a,o=r?null:l}this._zone=n,this.loc=t.loc||ur.create(),this.invalid=r,this.weekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new At({})}static local(){const[t,n]=ux(arguments),[r,a,o,i,l,c,f]=n;return sx({year:r,month:a,day:o,hour:i,minute:l,second:c,millisecond:f},t)}static utc(){const[t,n]=ux(arguments),[r,a,o,i,l,c,f]=n;return t.zone=ko.utcInstance,sx({year:r,month:a,day:o,hour:i,minute:l,second:c,millisecond:f},t)}static fromJSDate(t,n={}){const r=G_(t)?t.valueOf():NaN;if(Number.isNaN(r))return At.invalid("invalid input");const a=Gc(n.zone,Qr.defaultZone);return a.isValid?new At({ts:r,zone:a,loc:ur.fromObject(n)}):At.invalid(E0(a))}static fromMillis(t,n={}){if(hf(t))return t<-nx||t>nx?At.invalid("Timestamp out of range"):new At({ts:t,zone:Gc(n.zone,Qr.defaultZone),loc:ur.fromObject(n)});throw new Xi(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(hf(t))return new At({ts:t*1e3,zone:Gc(n.zone,Qr.defaultZone),loc:ur.fromObject(n)});throw new Xi("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Gc(n.zone,Qr.defaultZone);if(!r.isValid)return At.invalid(E0(r));const a=Qr.now(),o=xn(n.specificOffset)?r.offset(a):n.specificOffset,i=Nw(t,ix),l=!xn(i.ordinal),c=!xn(i.year),f=!xn(i.month)||!xn(i.day),h=c||f,g=i.weekYear||i.weekNumber,y=ur.fromObject(n);if((h||l)&&g)throw new jg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&l)throw new jg("Can't mix ordinal dates with month/day");const w=g||i.weekday&&!h;let S,D,I=rx(a,o);w?(S=TH,D=SH,I=wT(I)):l?(S=IH,D=DH,I=xS(I)):(S=b6,D=w6);let M=!1;for(const V of S){const U=i[V];xn(U)?M?i[V]=D[V]:i[V]=I[V]:M=!0}const N=w?wH(i):l?bH(i):g6(i),B=N||v6(i);if(B)return At.invalid(B);const k=w?ex(i):l?tx(i):i,[R,L]=ow(k,o,r),_=new At({ts:R,zone:r,o:L,loc:y});return i.weekday&&h&&t.weekday!==_.weekday?At.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${_.toISO()}`):_}static fromISO(t,n={}){const[r,a]=_B(t);return yg(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=BB(t);return yg(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=HB(t);return yg(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xn(t)||xn(n))throw new Xi("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,i=ur.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[l,c,f,h]=yH(i,t,n);return h?At.invalid(h):yg(l,c,r,`format ${n}`,t,f)}static fromString(t,n,r={}){return At.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=ZB(t);return yg(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Xi("need to specify a reason the DateTime is invalid");const r=t instanceof Bs?t:new Bs(t,n);if(Qr.throwOnInvalid)throw new C_(r);return new At({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=c6(t,ur.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return l6(uo.parseFormat(t),ur.fromObject(n)).map(a=>a.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?kS(this).weekYear:NaN}get weekNumber(){return this.isValid?kS(this).weekNumber:NaN}get weekday(){return this.isValid?kS(this).weekday:NaN}get ordinal(){return this.isValid?xS(this.c).ordinal:NaN}get monthShort(){return this.isValid?I0.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?I0.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?I0.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?I0.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Pv(this.year)}get daysInMonth(){return Mw(this.year,this.month)}get daysInYear(){return this.isValid?Yg(this.year):NaN}get weeksInWeekYear(){return this.isValid?kw(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=uo.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(ko.instance(t),n)}toLocal(){return this.setZone(Qr.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Gc(t,Qr.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),i=this.toObject();[a]=ow(i,o,t)}return vg(this,{ts:a,zone:t})}else return At.invalid(E0(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return vg(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Nw(t,ix),r=!xn(n.weekYear)||!xn(n.weekNumber)||!xn(n.weekday),a=!xn(n.ordinal),o=!xn(n.year),i=!xn(n.month)||!xn(n.day),l=o||i,c=n.weekYear||n.weekNumber;if((l||a)&&c)throw new jg("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(i&&a)throw new jg("Can't mix ordinal dates with month/day");let f;r?f=ex({...wT(this.c),...n}):xn(n.ordinal)?(f={...this.toObject(),...n},xn(n.day)&&(f.day=Math.min(Mw(f.year,f.month),f.day))):f=tx({...xS(this.c),...n});const[h,g]=ow(f,this.o,this.zone);return vg(this,{ts:h,o:g})}plus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t);return vg(this,ax(this,n))}minus(t){if(!this.isValid)return this;const n=bt.fromDurationLike(t).negate();return vg(this,ax(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=bt.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?uo.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):MS}toLocaleString(t=xw,n={}){return this.isValid?uo.create(this.loc.clone(n),t).formatDateTime(this):MS}toLocaleParts(t={}){return this.isValid?uo.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const i=t==="extended";let l=NS(this,i);return l+="T",l+=ox(this,i,n,r,a,o),l}toISODate({format:t="extended"}={}){return this.isValid?NS(this,t==="extended"):null}toISOWeekDate(){return C0(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:i="extended"}={}){return this.isValid?(a?"T":"")+ox(this,i==="extended",n,t,r,o):null}toRFC2822(){return C0(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return C0(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?NS(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),C0(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():MS}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return bt.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=J_(n).map(bt.normalizeUnit),i=t.valueOf()>this.valueOf(),l=i?this:t,c=i?t:this,f=rH(l,c,o,a);return i?f.negate():f}diffNow(t="milliseconds",n={}){return this.diff(At.now(),t,n)}until(t){return this.isValid?Or.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n)<=r&&r<=a.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||At.fromObject({},{zone:this.zone}),r=t.padding?thisn.valueOf(),Math.min)}static max(...t){if(!t.every(At.isDateTime))throw new Xi("max requires all arguments be DateTimes");return ZC(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,i=ur.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return u6(i,t,n)}static fromStringExplain(t,n,r={}){return At.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return xw}static get DATE_MED(){return TA}static get DATE_MED_WITH_WEEKDAY(){return k_}static get DATE_FULL(){return IA}static get DATE_HUGE(){return EA}static get TIME_SIMPLE(){return CA}static get TIME_WITH_SECONDS(){return xA}static get TIME_WITH_SHORT_OFFSET(){return MA}static get TIME_WITH_LONG_OFFSET(){return kA}static get TIME_24_SIMPLE(){return NA}static get TIME_24_WITH_SECONDS(){return AA}static get TIME_24_WITH_SHORT_OFFSET(){return FA}static get TIME_24_WITH_LONG_OFFSET(){return OA}static get DATETIME_SHORT(){return PA}static get DATETIME_SHORT_WITH_SECONDS(){return jA}static get DATETIME_MED(){return LA}static get DATETIME_MED_WITH_SECONDS(){return RA}static get DATETIME_MED_WITH_WEEKDAY(){return N_}static get DATETIME_FULL(){return _A}static get DATETIME_FULL_WITH_SECONDS(){return BA}static get DATETIME_HUGE(){return HA}static get DATETIME_HUGE_WITH_SECONDS(){return UA}}function wg(e){if(At.isDateTime(e))return e;if(e&&e.valueOf&&hf(e.valueOf()))return At.fromJSDate(e);if(e&&typeof e=="object")return At.fromObject(e);throw new Xi(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const B2={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},EH={allowHtml:!0};({...B2,...EH});class H2{constructor(t){this.value=t,this.successful=!0}map(t){return new H2(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,n){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}}class U2{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new U2(t(this.error))}bimap(t,n){return this.mapErr(n)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}}var Aw;(function(e){function t(o){return new H2(o)}e.success=t;function n(o){return new U2(o)}e.failure=n;function r(o,i,l){return o.successful?i.successful?l(o.value,i.value):n(i.error):n(o.error)}e.flatMap2=r;function a(o,i,l){return r(o,i,(c,f)=>t(l(c,f)))}e.map2=a})(Aw||(Aw={}));var CH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof dr<"u"?dr:typeof self<"u"?self:{},pe={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:CH,function(){return function(n){var r={};function a(o){if(r[o])return r[o].exports;var i=r[o]={i:o,l:!1,exports:{}};return n[o].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=n,a.c=r,a.d=function(o,i,l){a.o(o,i)||Object.defineProperty(o,i,{configurable:!1,enumerable:!0,get:l})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var i=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(i,"a",i),i},a.o=function(o,i){return Object.prototype.hasOwnProperty.call(o,i)},a.p="",a(a.s=0)}([function(n,r,a){function o(te){if(!(this instanceof o))return new o(te);this._=te}var i=o.prototype;function l(te,me){for(var xe=0;xe>7),buf:function(He){var Qe=c(function(tt,kt,Ut,On){return tt.concat(Ut===On.length-1?Buffer.from([kt,0]).readUInt16BE(0):On.readUInt16BE(Ut))},[],He);return Buffer.from(f(function(tt){return(tt<<1&65535)>>8},Qe))}(xe.buf)}}),xe}function g(){return typeof Buffer<"u"}function y(){if(!g())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function w(te){y();var me=c(function(Qe,tt){return Qe+tt},0,te);if(me%8!=0)throw new Error("The bits ["+te.join(", ")+"] add up to "+me+" which is not an even number of bytes; the total should be divisible by 8");var xe,Ue=me/8,He=(xe=function(Qe){return Qe>48},c(function(Qe,tt){return Qe||(xe(tt)?tt:Qe)},null,te));if(He)throw new Error(He+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o(function(Qe,tt){var kt=Ue+tt;return kt>Qe.length?V(tt,Ue.toString()+" bytes"):_(kt,c(function(Ut,On){var yn=h(On,Ut.buf);return{coll:Ut.coll.concat(yn.v),buf:yn.buf}},{coll:[],buf:Qe.slice(tt,kt)},te).coll)})}function S(te,me){return new o(function(xe,Ue){return y(),Ue+me>xe.length?V(Ue,me+" bytes for "+te):_(Ue+me,xe.slice(Ue,Ue+me))})}function D(te,me){if(typeof(xe=me)!="number"||Math.floor(xe)!==xe||me<0||me>6)throw new Error(te+" requires integer length in range [0, 6].");var xe}function I(te){return D("uintBE",te),S("uintBE("+te+")",te).map(function(me){return me.readUIntBE(0,te)})}function M(te){return D("uintLE",te),S("uintLE("+te+")",te).map(function(me){return me.readUIntLE(0,te)})}function N(te){return D("intBE",te),S("intBE("+te+")",te).map(function(me){return me.readIntBE(0,te)})}function B(te){return D("intLE",te),S("intLE("+te+")",te).map(function(me){return me.readIntLE(0,te)})}function k(te){return te instanceof o}function R(te){return{}.toString.call(te)==="[object Array]"}function L(te){return g()&&Buffer.isBuffer(te)}function _(te,me){return{status:!0,index:te,value:me,furthest:-1,expected:[]}}function V(te,me){return R(me)||(me=[me]),{status:!1,index:-1,value:null,furthest:te,expected:me}}function U(te,me){if(!me||te.furthest>me.furthest)return te;var xe=te.furthest===me.furthest?function(Ue,He){if(function(){if(o._supportsSet!==void 0)return o._supportsSet;var yr=typeof Set<"u";return o._supportsSet=yr,yr}()&&Array.from){for(var Qe=new Set(Ue),tt=0;tt=0;){if(tt in xe){Ue=xe[tt].line,Qe===0&&(Qe=xe[tt].lineStart);break}(te.charAt(tt)===` `||te.charAt(tt)==="\r"&&te.charAt(tt+1)!==` -`)&&(He++,Qe===0&&(Qe=tt+1)),tt--}var kt=Ye+He,Yt=me-Qe;return xe[me]={line:kt,lineStart:Qe},{offset:me,line:kt+1,column:Yt+1}}function G(te){if(!k(te))throw new Error("not a parser: "+te)}function le(te,me){return typeof te=="string"?te.charAt(me):te[me]}function se(te){if(typeof te!="number")throw new Error("not a number: "+te)}function fe(te){if(typeof te!="function")throw new Error("not a function: "+te)}function $(te){if(typeof te!="string")throw new Error("not a string: "+te)}var he=2,ie=3,ce=8,X=5*ce,ae=4*ce,De=" ";function je(te,me){return new Array(me+1).join(te)}function Re(te,me,xe){var Ye=me-te.length;return Ye<=0?te:je(xe,Ye)+te}function Fe(te,me,xe,Ye){return{from:te-me>0?te-me:0,to:te+xe>Ye?Ye:te+xe}}function Be(te,me){var xe,Ye,He,Qe,tt,kt=me.index,Yt=kt.offset,On=1;if(Yt===te.length)return"Got the end of the input";if(L(te)){var yn=Yt-Yt%ce,Cr=Yt-yn,Jn=Fe(yn,X,ae+ce,te.length),yr=f(function(Nn){return f(function(Aa){return Re(Aa.toString(16),2,"0")},Nn)},function(Nn,Aa){var Fa=Nn.length,Zr=[],fo=0;if(Fa<=Aa)return[Nn.slice()];for(var Oa=0;Oa=4&&(xe+=1),On=2,He=f(function(Nn){return Nn.length<=4?Nn.join(" "):Nn.slice(0,4).join(" ")+" "+Nn.slice(4).join(" ")},yr),(tt=(8*(Qe.to>0?Qe.to-1:Qe.to)).toString(16).length)<2&&(tt=2)}else{var ta=te.split(/\r\n|[\n\r\u2028\u2029]/);xe=kt.column-1,Ye=kt.line-1,Qe=Fe(Ye,he,ie,ta.length),He=ta.slice(Qe.from,Qe.to),tt=Qe.to.toString().length}var Pi=Ye-Qe.from;return L(te)&&(tt=(8*(Qe.to>0?Qe.to-1:Qe.to)).toString(16).length)<2&&(tt=2),c(function(Nn,Aa,Fa){var Zr,fo=Fa===Pi,Oa=fo?"> ":De;return Zr=L(te)?Re((8*(Qe.from+Fa)).toString(16),tt,"0"):Re((Qe.from+Fa+1).toString(),tt," "),[].concat(Nn,[Oa+Zr+" | "+Aa],fo?[De+je(" ",tt)+" | "+Re("",xe," ")+je("^",On)]:[])},[],He).join(` +`)&&(He++,Qe===0&&(Qe=tt+1)),tt--}var kt=Ue+He,Ut=me-Qe;return xe[me]={line:kt,lineStart:Qe},{offset:me,line:kt+1,column:Ut+1}}function G(te){if(!k(te))throw new Error("not a parser: "+te)}function re(te,me){return typeof te=="string"?te.charAt(me):te[me]}function de(te){if(typeof te!="number")throw new Error("not a number: "+te)}function fe(te){if(typeof te!="function")throw new Error("not a function: "+te)}function $(te){if(typeof te!="string")throw new Error("not a string: "+te)}var he=2,se=3,ue=8,X=5*ue,oe=4*ue,De=" ";function je(te,me){return new Array(me+1).join(te)}function Re(te,me,xe){var Ue=me-te.length;return Ue<=0?te:je(xe,Ue)+te}function Fe(te,me,xe,Ue){return{from:te-me>0?te-me:0,to:te+xe>Ue?Ue:te+xe}}function Be(te,me){var xe,Ue,He,Qe,tt,kt=me.index,Ut=kt.offset,On=1;if(Ut===te.length)return"Got the end of the input";if(L(te)){var yn=Ut-Ut%ue,Cr=Ut-yn,Jn=Fe(yn,X,oe+ue,te.length),yr=f(function(Nn){return f(function(Aa){return Re(Aa.toString(16),2,"0")},Nn)},function(Nn,Aa){var Fa=Nn.length,Zr=[],fo=0;if(Fa<=Aa)return[Nn.slice()];for(var Oa=0;Oa=4&&(xe+=1),On=2,He=f(function(Nn){return Nn.length<=4?Nn.join(" "):Nn.slice(0,4).join(" ")+" "+Nn.slice(4).join(" ")},yr),(tt=(8*(Qe.to>0?Qe.to-1:Qe.to)).toString(16).length)<2&&(tt=2)}else{var ta=te.split(/\r\n|[\n\r\u2028\u2029]/);xe=kt.column-1,Ue=kt.line-1,Qe=Fe(Ue,he,se,ta.length),He=ta.slice(Qe.from,Qe.to),tt=Qe.to.toString().length}var Pi=Ue-Qe.from;return L(te)&&(tt=(8*(Qe.to>0?Qe.to-1:Qe.to)).toString(16).length)<2&&(tt=2),c(function(Nn,Aa,Fa){var Zr,fo=Fa===Pi,Oa=fo?"> ":De;return Zr=L(te)?Re((8*(Qe.from+Fa)).toString(16),tt,"0"):Re((Qe.from+Fa+1).toString(),tt," "),[].concat(Nn,[Oa+Zr+" | "+Aa],fo?[De+je(" ",tt)+" | "+Re("",xe," ")+je("^",On)]:[])},[],He).join(` `)}function Xe(te,me){return[` `,"-- PARSING FAILED "+je("-",50),` @@ -150,9 +150,9 @@ ${e}`,posNum:-1};const a=t.split(` `+xe[0]:`Expected one of the following: `+xe.join(", ")),` -`].join("");var xe}function Ze(te){return te.flags!==void 0?te.flags:[te.global?"g":"",te.ignoreCase?"i":"",te.multiline?"m":"",te.unicode?"u":"",te.sticky?"y":""].join("")}function st(){for(var te=[].slice.call(arguments),me=te.length,xe=0;xe=2?se(me):me=0;var xe=function(He){return RegExp("^(?:"+He.source+")",Ze(He))}(te),Ye=""+te;return o(function(He,Qe){var tt=xe.exec(He.slice(Qe));if(tt){if(0<=me&&me<=tt.length){var kt=tt[0],Yt=tt[me];return R(Qe+kt.length,Yt)}return V(Qe,"valid match group (0 to "+tt.length+") in "+Ye)}return V(Qe,Ye)})}function St(te){return o(function(me,xe){return R(xe,te)})}function Tt(te){return o(function(me,xe){return V(xe,te)})}function Gt(te){if(k(te))return o(function(me,xe){var Ye=te._(me,xe);return Ye.index=xe,Ye.value="",Ye});if(typeof te=="string")return Gt(nt(te));if(te instanceof RegExp)return Gt(ht(te));throw new Error("not a string, regexp, or parser: "+te)}function _t(te){return G(te),o(function(me,xe){var Ye=te._(me,xe),He=me.slice(xe,Ye.index);return Ye.status?V(xe,'not "'+He+'"'):R(xe,null)})}function Vt(te){return fe(te),o(function(me,xe){var Ye=le(me,xe);return xe=te.length?V(me,"any character/byte"):R(me+1,le(te,me))}),kn=o(function(te,me){return R(te.length,te.slice(me))}),Er=o(function(te,me){return me=2?de(me):me=0;var xe=function(He){return RegExp("^(?:"+He.source+")",Ze(He))}(te),Ue=""+te;return o(function(He,Qe){var tt=xe.exec(He.slice(Qe));if(tt){if(0<=me&&me<=tt.length){var kt=tt[0],Ut=tt[me];return _(Qe+kt.length,Ut)}return V(Qe,"valid match group (0 to "+tt.length+") in "+Ue)}return V(Qe,Ue)})}function St(te){return o(function(me,xe){return _(xe,te)})}function Tt(te){return o(function(me,xe){return V(xe,te)})}function Gt(te){if(k(te))return o(function(me,xe){var Ue=te._(me,xe);return Ue.index=xe,Ue.value="",Ue});if(typeof te=="string")return Gt(nt(te));if(te instanceof RegExp)return Gt(ht(te));throw new Error("not a string, regexp, or parser: "+te)}function _t(te){return G(te),o(function(me,xe){var Ue=te._(me,xe),He=me.slice(xe,Ue.index);return Ue.status?V(xe,'not "'+He+'"'):_(xe,null)})}function Vt(te){return fe(te),o(function(me,xe){var Ue=re(me,xe);return xe=te.length?V(me,"any character/byte"):_(me+1,re(te,me))}),Dn=o(function(te,me){return _(te.length,te.slice(me))}),Er=o(function(te,me){return me=0}).desc(me)},o.optWhitespace=ln,o.Parser=o,o.range=function(te,me){return Vt(function(xe){return te<=xe&&xe<=me}).desc(te+"-"+me)},o.regex=ht,o.regexp=ht,o.sepBy=_e,o.sepBy1=et,o.seq=st,o.seqMap=Ct,o.seqObj=function(){for(var te,me={},xe=0,Ye=(te=arguments,Array.prototype.slice.call(te)),He=Ye.length,Qe=0;Qe255)throw new Error("Value specified to byte constructor ("+te+"=0x"+te.toString(16)+") is larger in value than a single byte.");var me=(te>15?"0x":"0x0")+te.toString(16);return o(function(xe,Ye){var He=le(xe,Ye);return He===te?R(Ye+1,He):V(Ye,me)})},buffer:function(te){return S("buffer",te).map(function(me){return Buffer.from(me)})},encodedString:function(te,me){return S("string",me).map(function(xe){return xe.toString(te)})},uintBE:I,uint8BE:I(1),uint16BE:I(2),uint32BE:I(4),uintLE:M,uint8LE:M(1),uint16LE:M(2),uint32LE:M(4),intBE:N,int8BE:N(1),int16BE:N(2),int32BE:N(4),intLE:_,int8LE:_(1),int16LE:_(2),int32LE:_(4),floatBE:S("floatBE",4).map(function(te){return te.readFloatBE(0)}),floatLE:S("floatLE",4).map(function(te){return te.readFloatLE(0)}),doubleBE:S("doubleBE",8).map(function(te){return te.readDoubleBE(0)}),doubleLE:S("doubleLE",8).map(function(te){return te.readDoubleLE(0)})},n.exports=o}])})})(pe);var U2=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g;function b6(e){return e==null?e:e.shiftToAll().normalize()}function cx(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}pe.exports.alt(pe.exports.regex(new RegExp(U2(),"")),pe.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),pe.exports.whitespace.map(e=>"-"),pe.exports.any.map(e=>"")).many().map(e=>e.join(""));const CH=pe.exports.alt(pe.exports.regex(new RegExp(U2(),"")),pe.exports.regex(/[0-9\p{Letter}_-]+/u),pe.exports.whitespace.map(e=>" "),pe.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function xH(e){return CH.tryParse(e)}function MH(e){return e=b6(e),e=bt.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var ev;(function(e){function t(k,B=B2,L=!1){let R=n(k);if(!R)return B.renderNullAs;switch(R.type){case"null":return B.renderNullAs;case"string":return R.value;case"number":case"boolean":return""+R.value;case"html":return R.value.outerHTML;case"widget":return R.value.markdown();case"link":return R.value.markdown();case"function":return"";case"array":let V="";return L&&(V+="["),V+=R.value.map(Y=>t(Y,B,!0)).join(", "),L&&(V+="]"),V;case"object":return"{ "+Object.entries(R.value).map(Y=>Y[0]+": "+t(Y[1],B,!0)).join(", ")+" }";case"date":return R.value.second==0&&R.value.hour==0&&R.value.minute==0?R.value.toFormat(B.defaultDateFormat):R.value.toFormat(B.defaultDateTimeFormat);case"duration":return MH(R.value)}}e.toString=t;function n(k){return y(k)?{type:"null",value:k}:f(k)?{type:"number",value:k}:c(k)?{type:"string",value:k}:S(k)?{type:"boolean",value:k}:g(k)?{type:"duration",value:k}:h(k)?{type:"date",value:k}:I(k)?{type:"widget",value:k}:w(k)?{type:"array",value:k}:D(k)?{type:"link",value:k}:_(k)?{type:"function",value:k}:M(k)?{type:"html",value:k}:N(k)?{type:"object",value:k}:void 0}e.wrapValue=n;function r(k,B){if(N(k)){let L={};for(let[R,V]of Object.entries(k))L[R]=r(V,B);return L}else if(w(k)){let L=[];for(let R of k)L.push(r(R,B));return L}else return B(k)}e.mapLeaves=r;function a(k,B,L){var R,V;if(k===void 0&&(k=null),B===void 0&&(B=null),k===null&&B===null)return 0;if(k===null)return-1;if(B===null)return 1;let Y=n(k),Z=n(B);if(Y===void 0&&Z===void 0)return 0;if(Y===void 0)return-1;if(Z===void 0)return 1;if(Y.type!=Z.type)return Y.type.localeCompare(Z.type);if(Y.value===Z.value)return 0;switch(Y.type){case"string":return Y.value.localeCompare(Z.value);case"number":return Y.valueje),se=le(Q.path).localeCompare(le(G.path));if(se!=0)return se;let fe=Q.type.localeCompare(G.type);return fe!=0?fe:Q.subpath&&!G.subpath?1:!Q.subpath&&G.subpath?-1:!Q.subpath&&!G.subpath?0:((R=Q.subpath)!==null&&R!==void 0?R:"").localeCompare((V=G.subpath)!==null&&V!==void 0?V:"");case"date":return Y.value0;case"boolean":return B.value;case"link":return!!B.value.path;case"date":return B.value.toMillis()!=0;case"duration":return B.value.as("seconds")!=0;case"object":return Object.keys(B.value).length>0;case"array":return B.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=i;function l(k){if(k==null)return k;if(e.isArray(k))return[].concat(k.map(B=>l(B)));if(e.isObject(k)){let B={};for(let[L,R]of Object.entries(k))B[L]=l(R);return B}else return k}e.deepCopy=l;function c(k){return typeof k=="string"}e.isString=c;function f(k){return typeof k=="number"}e.isNumber=f;function h(k){return k instanceof At}e.isDate=h;function g(k){return k instanceof bt}e.isDuration=g;function y(k){return k==null}e.isNull=y;function w(k){return Array.isArray(k)}e.isArray=w;function S(k){return typeof k=="boolean"}e.isBoolean=S;function D(k){return k instanceof so}e.isLink=D;function I(k){return k instanceof z2}e.isWidget=I;function M(k){return typeof HTMLElement<"u"?k instanceof HTMLElement:!1}e.isHtml=M;function N(k){return typeof k=="object"&&!M(k)&&!I(k)&&!w(k)&&!g(k)&&!h(k)&&!D(k)&&k!==void 0&&!y(k)}e.isObject=N;function _(k){return typeof k=="function"}e.isFunction=_})(ev||(ev={}));var dx;(function(e){function t(a){return ev.isObject(a)&&Object.keys(a).length==2&&"key"in a&&"rows"in a}e.isElementGroup=t;function n(a){for(let o of a)if(!t(o))return!1;return!0}e.isGrouping=n;function r(a){if(n(a)){let o=0;for(let i of a)o+=r(i.rows);return o}else return a.length}e.count=r})(dx||(dx={}));class so{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new so({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let a=t.split("#^");return so.block(a[0],a[1],n,r)}else if(t.includes("#")){let a=t.split("#");return so.header(a[0],a[1],n,r)}else return so.file(t,n,r)}static header(t,n,r,a){return new so({path:t,embed:r,display:a,subpath:xH(n),type:"header"})}static block(t,n,r,a){return new so({path:t,embed:r,display:a,subpath:n,type:"block"})}static fromObject(t){return new so(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new so(Object.assign({},this,{path:t}))}withDisplay(t){return new so(Object.assign({},this,{display:t}))}withHeader(t){return so.header(this.path,t,this.embed,this.display)}toFile(){return so.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new so(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new so(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+cx(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var t,n;const r=this.path.replace("|","\\|");return this.type=="header"?r+"#"+((t=this.subpath)===null||t===void 0?void 0:t.replace("|","\\|")):this.type=="block"?r+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):r}fileName(){return cx(this.path).replace(".md","")}}class z2{constructor(t){this.$widget=t}}class kH extends z2{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${ev.toString(this.key)}: ${ev.toString(this.value)}`}}class NH extends z2{constructor(t,n){super("dataview:external-link"),this.url=t,this.display=n}markdown(){var t;return`[${(t=this.display)!==null&&t!==void 0?t:this.url}](${this.url})`}}var fx;(function(e){function t(i,l){return new kH(i,l)}e.listPair=t;function n(i,l){return new NH(i,l)}e.externalLink=n;function r(i){return i.$widget==="dataview:list-pair"}e.isListPair=r;function a(i){return i.$widget==="dataview:external-link"}e.isExternalLink=a;function o(i){return r(i)||a(i)}e.isBuiltin=o})(fx||(fx={}));var Fr;(function(e){function t(y){return{type:"variable",name:y}}e.variable=t;function n(y){return{type:"literal",value:y}}e.literal=n;function r(y,w,S){return{type:"binaryop",left:y,op:w,right:S}}e.binaryOp=r;function a(y,w){return{type:"index",object:y,index:w}}e.index=a;function o(y){let w=y.split("."),S=e.variable(w[0]);for(let D=1;D"||y==">="||y=="!="||y=="="}e.isCompareOp=g,e.NULL=e.literal(null)})(Fr||(Fr={}));var Hl;(function(e){function t(h){return{type:"tag",tag:h}}e.tag=t;function n(h){return{type:"csv",path:h}}e.csv=n;function r(h){return{type:"folder",folder:h}}e.folder=r;function a(h,g){return{type:"link",file:h,direction:g?"incoming":"outgoing"}}e.link=a;function o(h,g,y){return{type:"binaryop",left:h,op:g,right:y}}e.binaryOp=o;function i(h,g){return{type:"binaryop",left:h,op:"&",right:g}}e.and=i;function l(h,g){return{type:"binaryop",left:h,op:"|",right:g}}e.or=l;function c(h){return{type:"negate",child:h}}e.negate=c;function f(){return{type:"empty"}}e.empty=f})(Hl||(Hl={}));const hx=new RegExp(U2(),""),bT={year:bt.fromObject({years:1}),years:bt.fromObject({years:1}),yr:bt.fromObject({years:1}),yrs:bt.fromObject({years:1}),month:bt.fromObject({months:1}),months:bt.fromObject({months:1}),mo:bt.fromObject({months:1}),mos:bt.fromObject({months:1}),week:bt.fromObject({weeks:1}),weeks:bt.fromObject({weeks:1}),wk:bt.fromObject({weeks:1}),wks:bt.fromObject({weeks:1}),w:bt.fromObject({weeks:1}),day:bt.fromObject({days:1}),days:bt.fromObject({days:1}),d:bt.fromObject({days:1}),hour:bt.fromObject({hours:1}),hours:bt.fromObject({hours:1}),hr:bt.fromObject({hours:1}),hrs:bt.fromObject({hours:1}),h:bt.fromObject({hours:1}),minute:bt.fromObject({minutes:1}),minutes:bt.fromObject({minutes:1}),min:bt.fromObject({minutes:1}),mins:bt.fromObject({minutes:1}),m:bt.fromObject({minutes:1}),second:bt.fromObject({seconds:1}),seconds:bt.fromObject({seconds:1}),sec:bt.fromObject({seconds:1}),secs:bt.fromObject({seconds:1}),s:bt.fromObject({seconds:1})},ST={now:()=>At.local(),today:()=>At.local().startOf("day"),yesterday:()=>At.local().startOf("day").minus(bt.fromObject({days:1})),tomorrow:()=>At.local().startOf("day").plus(bt.fromObject({days:1})),sow:()=>At.local().startOf("week"),"start-of-week":()=>At.local().startOf("week"),eow:()=>At.local().endOf("week"),"end-of-week":()=>At.local().endOf("week"),soy:()=>At.local().startOf("year"),"start-of-year":()=>At.local().startOf("year"),eoy:()=>At.local().endOf("year"),"end-of-year":()=>At.local().endOf("year"),som:()=>At.local().startOf("month"),"start-of-month":()=>At.local().startOf("month"),eom:()=>At.local().endOf("month"),"end-of-month":()=>At.local().endOf("month")},DT=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function AH(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function FH(e){let[t,n]=AH(e);return so.infer(t,!1,n)}function bg(e,t,n){return pe.exports.seqMap(e,pe.exports.seq(pe.exports.optWhitespace,t,pe.exports.optWhitespace,e).many(),(r,a)=>{if(a.length==0)return r;let o=n(r,a[0][1],a[0][3]);for(let i=1;i(a,o)=>{let i=e._(a,o);if(!i.status)return i;for(let l of t){let c=l(i.value)._(a,i.index);if(!c.status)return i;i=c}return i})}const Ps=pe.exports.createLanguage({number:e=>pe.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>pe.exports.string('"').then(pe.exports.alt(e.escapeCharacter,pe.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(pe.exports.string('"')).desc("string"),escapeCharacter:e=>pe.exports.string("\\").then(pe.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>pe.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>pe.exports.seqMap(pe.exports.string("#"),pe.exports.alt(pe.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>pe.exports.seqMap(pe.exports.alt(pe.exports.regexp(new RegExp("\\p{Letter}","u")),pe.exports.regexp(hx).desc("text")),pe.exports.alt(pe.exports.regexp(/[0-9\p{Letter}_-]/u),pe.exports.regexp(hx).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>pe.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>FH(t)).desc("file link"),embedLink:e=>pe.exports.seqMap(pe.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>pe.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>pe.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>pe.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>pe.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>pe.exports.seqMap(pe.exports.regexp(/\d{4}/),pe.exports.string("-"),pe.exports.regexp(/\d{2}/),(t,n,r)=>At.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>pe.exports.alt(...Object.keys(ST).sort((t,n)=>n.length-t.length).map(pe.exports.string)),date:e=>OH(e.rootDate,t=>pe.exports.seqMap(pe.exports.string("-"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string("T"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string(":"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string(":"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>pe.exports.alt(pe.exports.seqMap(pe.exports.string("."),pe.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),pe.exports.succeed(t)),t=>pe.exports.alt(pe.exports.seqMap(pe.exports.string("+").or(pe.exports.string("-")),pe.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),pe.exports.seqMap(pe.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),pe.exports.seqMap(pe.exports.string("["),pe.exports.regexp(/[0-9A-Za-z+-\/]+/u),pe.exports.string("]"),(n,r,a)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>pe.exports.alt(e.dateShorthand.map(t=>ST[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>pe.exports.alt(...Object.keys(bT).sort((t,n)=>n.length-t.length).map(pe.exports.string)),duration:e=>pe.exports.seqMap(e.number,pe.exports.optWhitespace,e.durationType,(t,n,r)=>bT[r].mapUnits(a=>a*t)).sepBy1(pe.exports.string(",").trim(pe.exports.optWhitespace).or(pe.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>pe.exports.string("null"),tagSource:e=>e.tag.map(t=>Hl.tag(t)),csvSource:e=>pe.exports.seqMap(pe.exports.string("csv(").skip(pe.exports.optWhitespace),e.string,pe.exports.string(")"),(t,n,r)=>Hl.csv(n)),linkIncomingSource:e=>e.link.map(t=>Hl.link(t.path,!0)),linkOutgoingSource:e=>pe.exports.seqMap(pe.exports.string("outgoing(").skip(pe.exports.optWhitespace),e.link,pe.exports.string(")"),(t,n,r)=>Hl.link(n.path,!1)),folderSource:e=>e.string.map(t=>Hl.folder(t)),parensSource:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.source,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>r),negateSource:e=>pe.exports.seqMap(pe.exports.alt(pe.exports.string("-"),pe.exports.string("!")),e.atomSource,(t,n)=>Hl.negate(n)),atomSource:e=>pe.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>bg(e.atomSource,e.binaryBooleanOp.map(t=>t),Hl.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>DT.includes(t.toUpperCase())?pe.exports.fail("Variable fields cannot be a keyword ("+DT.join(" or ")+")"):pe.exports.succeed(Fr.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>Fr.literal(t)).desc("number"),stringField:e=>e.string.map(t=>Fr.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>Fr.literal(t)).desc("boolean"),dateField:e=>pe.exports.seqMap(pe.exports.string("date("),pe.exports.optWhitespace,e.datePlus,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>Fr.literal(r)).desc("date"),durationField:e=>pe.exports.seqMap(pe.exports.string("dur("),pe.exports.optWhitespace,e.duration,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>Fr.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>Fr.NULL),linkField:e=>e.link.map(t=>Fr.literal(t)),listField:e=>e.field.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("[").skip(pe.exports.optWhitespace),pe.exports.optWhitespace.then(pe.exports.string("]"))).map(t=>Fr.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>pe.exports.seqMap(e.identifier.or(e.string),pe.exports.string(":").trim(pe.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("{").skip(pe.exports.optWhitespace),pe.exports.optWhitespace.then(pe.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return Fr.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>pe.exports.alt(e.date,e.duration.map(t=>b6(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>pe.exports.alt(pe.exports.seqMap(e.atomInlineField,pe.exports.string(",").trim(pe.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>pe.exports.alt(e.embedLink.map(t=>Fr.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>pe.exports.seqMap(e.atomField,pe.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let a of n)switch(a.type){case"dot":r=Fr.index(r,Fr.literal(a.field));break;case"index":r=Fr.index(r,a.field);break;case"function":r=Fr.func(r,a.fields);break}return r}),negatedField:e=>pe.exports.seqMap(pe.exports.string("!"),e.indexField,(t,n)=>Fr.negate(n)).desc("negated field"),parensField:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.field,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>r),lambdaField:e=>pe.exports.seqMap(e.identifier.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("(").trim(pe.exports.optWhitespace),pe.exports.string(")").trim(pe.exports.optWhitespace)),pe.exports.string("=>").trim(pe.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>pe.exports.seqMap(pe.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>pe.exports.seqMap(pe.exports.string("["),pe.exports.optWhitespace,e.field,pe.exports.optWhitespace,pe.exports.string("]"),(t,n,r,a,o)=>({type:"index",field:r})),functionPostfix:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.field.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)),pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>({type:"function",fields:r})),binaryMulDivField:e=>bg(e.indexField,e.binaryMulDiv,Fr.binaryOp),binaryPlusMinusField:e=>bg(e.binaryMulDivField,e.binaryPlusMinus,Fr.binaryOp),binaryCompareField:e=>bg(e.binaryPlusMinusField,e.binaryCompareOp,Fr.binaryOp),binaryBooleanField:e=>bg(e.binaryCompareField,e.binaryBooleanOp,Fr.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function PH(e){try{return Aw.success(Ps.field.tryParse(e))}catch(t){return Aw.failure(""+t)}}var Fw;(function(e){function t(r,a){return{name:r,field:a}}e.named=t;function n(r,a){return{field:r,direction:a}}e.sortBy=n})(Fw||(Fw={}));function jH(e){return pe.exports.custom((t,n)=>(r,a)=>{let o=e._(r,a);return o.status?Object.assign({},o,{value:[o.value,r.substring(a,o.index)]}):o})}function LH(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const RH=pe.exports.createLanguage({queryType:e=>pe.exports.alt(pe.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>pe.exports.seqMap(Ps.field.skip(pe.exports.whitespace),pe.exports.regexp(/AS/i).skip(pe.exports.whitespace),Ps.identifier.or(Ps.string),(t,n,r)=>Fw.named(r,t)),namedField:e=>pe.exports.alt(e.explicitNamedField,jH(Ps.field).map(([t,n])=>Fw.named(LH(n),t))),sortField:e=>pe.exports.seqMap(Ps.field.skip(pe.exports.optWhitespace),pe.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,n)=>{let r=n.length==0?"ascending":n[0].toLowerCase();return r=="desc"&&(r="descending"),r=="asc"&&(r="ascending"),{field:t,direction:r}}),headerClause:e=>e.queryType.skip(pe.exports.whitespace).chain(t=>{switch(t){case"table":return pe.exports.seqMap(pe.exports.regexp(/WITHOUT\s+ID/i).skip(pe.exports.optWhitespace).atMost(1),pe.exports.sepBy(e.namedField,pe.exports.string(",").trim(pe.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return pe.exports.seqMap(pe.exports.regexp(/WITHOUT\s+ID/i).skip(pe.exports.optWhitespace).atMost(1),Ps.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return pe.exports.succeed({type:"task"});case"calendar":return pe.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return pe.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>pe.exports.seqMap(pe.exports.regexp(/FROM/i),pe.exports.whitespace,Ps.source,(t,n,r)=>r),whereClause:e=>pe.exports.seqMap(pe.exports.regexp(/WHERE/i),pe.exports.whitespace,Ps.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE "),sortByClause:e=>pe.exports.seqMap(pe.exports.regexp(/SORT/i),pe.exports.whitespace,e.sortField.sepBy1(pe.exports.string(",").trim(pe.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>pe.exports.seqMap(pe.exports.regexp(/LIMIT/i),pe.exports.whitespace,Ps.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT "),flattenClause:e=>pe.exports.seqMap(pe.exports.regexp(/FLATTEN/i).skip(pe.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:e=>pe.exports.seqMap(pe.exports.regexp(/GROUP BY/i).skip(pe.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:e=>pe.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>pe.exports.seqMap(e.headerClause.trim(pe.exports.optWhitespace),e.fromClause.trim(pe.exports.optWhitespace).atMost(1),e.clause.trim(pe.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?Hl.folder(""):n[0],operations:r,settings:B2}))}),_H=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},BH=e=>e.plugins.enabledPlugins.has("dataview");Ku.DATE_SHORTHANDS=ST;Ku.DURATION_TYPES=bT;Ku.EXPRESSION=Ps;Ku.KEYWORDS=DT;Ku.QUERY_LANGUAGE=RH;var HH=Ku.getAPI=_H;Ku.isPluginEnabled=BH;Ku.parseField=PH;async function YH(e,t,n,r,a){var I,M;const{vault:o,metadataCache:i}=Le.getState().dailyNotesState.app===void 0?app:Le.getState().dailyNotesState.app,l=Le.getState().dailyNotesState.settings,c=e.replace(/\n/g,"
");if(n===void 0)return;const f=i.getFirstLinkpathDest("",n),h=x.moment(),g=h.format("YYYYMMDDHHmmss"),y=r.slice(14),w=" ",S=g+" "+c.trim(),D=w+"- "+g+" "+c.trim();if(f){let N;if(l!=null&&l.CommentOnMemos&&(l!=null&&l.CommentsInOriginalNotes)){const L=HH();if(L!==void 0)try{N=(M=(I=L.page(f.path))==null?void 0:I.file.lists.values)==null?void 0:M.filter(R=>R.line===parseInt(y))}catch(R){console.error(R)}}const _=await o.read(f);let k=0;N[0].children.values.length>0?k=N[0].children.values[N[0].children.values.length-1].line:k=N[0].line;const B=await UH(D,_,k);if(await o.modify(f,B.content),t)return{id:g+(k+1),content:S,deletedAt:"",createdAt:h.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:f.path,hasId:"",linkId:a}}}async function UH(e,t,n){if(n===-1)return{content:`${t} +`),nr=tn(jr,ha,fr).desc("newline"),Lr=tn(nr,Er);o.all=Dn,o.alt=tn,o.any=Zn,o.cr=fr,o.createLanguage=function(te){var me={};for(var xe in te)({}).hasOwnProperty.call(te,xe)&&function(Ue){me[Ue]=Xt(function(){return te[Ue](me)})}(xe);return me},o.crlf=jr,o.custom=function(te){return o(te(_,V))},o.digit=pt,o.digits=Mt,o.empty=dn,o.end=Lr,o.eof=Er,o.fail=Tt,o.formatError=Xe,o.index=en,o.isParser=k,o.lazy=Xt,o.letter=Jt,o.letters=sn,o.lf=ha,o.lookahead=Gt,o.makeFailure=V,o.makeSuccess=_,o.newline=nr,o.noneOf=function(te){return Vt(function(me){return te.indexOf(me)<0}).desc("none of '"+te+"'")},o.notFollowedBy=_t,o.of=St,o.oneOf=function(te){for(var me=te.split(""),xe=0;xe=0}).desc(me)},o.optWhitespace=ln,o.Parser=o,o.range=function(te,me){return Vt(function(xe){return te<=xe&&xe<=me}).desc(te+"-"+me)},o.regex=ht,o.regexp=ht,o.sepBy=_e,o.sepBy1=et,o.seq=st,o.seqMap=Ct,o.seqObj=function(){for(var te,me={},xe=0,Ue=(te=arguments,Array.prototype.slice.call(te)),He=Ue.length,Qe=0;Qe255)throw new Error("Value specified to byte constructor ("+te+"=0x"+te.toString(16)+") is larger in value than a single byte.");var me=(te>15?"0x":"0x0")+te.toString(16);return o(function(xe,Ue){var He=re(xe,Ue);return He===te?_(Ue+1,He):V(Ue,me)})},buffer:function(te){return S("buffer",te).map(function(me){return Buffer.from(me)})},encodedString:function(te,me){return S("string",me).map(function(xe){return xe.toString(te)})},uintBE:I,uint8BE:I(1),uint16BE:I(2),uint32BE:I(4),uintLE:M,uint8LE:M(1),uint16LE:M(2),uint32LE:M(4),intBE:N,int8BE:N(1),int16BE:N(2),int32BE:N(4),intLE:B,int8LE:B(1),int16LE:B(2),int32LE:B(4),floatBE:S("floatBE",4).map(function(te){return te.readFloatBE(0)}),floatLE:S("floatLE",4).map(function(te){return te.readFloatLE(0)}),doubleBE:S("doubleBE",8).map(function(te){return te.readDoubleBE(0)}),doubleLE:S("doubleLE",8).map(function(te){return te.readDoubleLE(0)})},n.exports=o}])})})(pe);var Y2=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g;function S6(e){return e==null?e:e.shiftToAll().normalize()}function cx(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}pe.exports.alt(pe.exports.regex(new RegExp(Y2(),"")),pe.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),pe.exports.whitespace.map(e=>"-"),pe.exports.any.map(e=>"")).many().map(e=>e.join(""));const xH=pe.exports.alt(pe.exports.regex(new RegExp(Y2(),"")),pe.exports.regex(/[0-9\p{Letter}_-]+/u),pe.exports.whitespace.map(e=>" "),pe.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function MH(e){return xH.tryParse(e)}function kH(e){return e=S6(e),e=bt.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var ev;(function(e){function t(k,R=B2,L=!1){let _=n(k);if(!_)return R.renderNullAs;switch(_.type){case"null":return R.renderNullAs;case"string":return _.value;case"number":case"boolean":return""+_.value;case"html":return _.value.outerHTML;case"widget":return _.value.markdown();case"link":return _.value.markdown();case"function":return"";case"array":let V="";return L&&(V+="["),V+=_.value.map(U=>t(U,R,!0)).join(", "),L&&(V+="]"),V;case"object":return"{ "+Object.entries(_.value).map(U=>U[0]+": "+t(U[1],R,!0)).join(", ")+" }";case"date":return _.value.second==0&&_.value.hour==0&&_.value.minute==0?_.value.toFormat(R.defaultDateFormat):_.value.toFormat(R.defaultDateTimeFormat);case"duration":return kH(_.value)}}e.toString=t;function n(k){return y(k)?{type:"null",value:k}:f(k)?{type:"number",value:k}:c(k)?{type:"string",value:k}:S(k)?{type:"boolean",value:k}:g(k)?{type:"duration",value:k}:h(k)?{type:"date",value:k}:I(k)?{type:"widget",value:k}:w(k)?{type:"array",value:k}:D(k)?{type:"link",value:k}:B(k)?{type:"function",value:k}:M(k)?{type:"html",value:k}:N(k)?{type:"object",value:k}:void 0}e.wrapValue=n;function r(k,R){if(N(k)){let L={};for(let[_,V]of Object.entries(k))L[_]=r(V,R);return L}else if(w(k)){let L=[];for(let _ of k)L.push(r(_,R));return L}else return R(k)}e.mapLeaves=r;function a(k,R,L){var _,V;if(k===void 0&&(k=null),R===void 0&&(R=null),k===null&&R===null)return 0;if(k===null)return-1;if(R===null)return 1;let U=n(k),Z=n(R);if(U===void 0&&Z===void 0)return 0;if(U===void 0)return-1;if(Z===void 0)return 1;if(U.type!=Z.type)return U.type.localeCompare(Z.type);if(U.value===Z.value)return 0;switch(U.type){case"string":return U.value.localeCompare(Z.value);case"number":return U.valueje),de=re(Q.path).localeCompare(re(G.path));if(de!=0)return de;let fe=Q.type.localeCompare(G.type);return fe!=0?fe:Q.subpath&&!G.subpath?1:!Q.subpath&&G.subpath?-1:!Q.subpath&&!G.subpath?0:((_=Q.subpath)!==null&&_!==void 0?_:"").localeCompare((V=G.subpath)!==null&&V!==void 0?V:"");case"date":return U.value0;case"boolean":return R.value;case"link":return!!R.value.path;case"date":return R.value.toMillis()!=0;case"duration":return R.value.as("seconds")!=0;case"object":return Object.keys(R.value).length>0;case"array":return R.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=i;function l(k){if(k==null)return k;if(e.isArray(k))return[].concat(k.map(R=>l(R)));if(e.isObject(k)){let R={};for(let[L,_]of Object.entries(k))R[L]=l(_);return R}else return k}e.deepCopy=l;function c(k){return typeof k=="string"}e.isString=c;function f(k){return typeof k=="number"}e.isNumber=f;function h(k){return k instanceof At}e.isDate=h;function g(k){return k instanceof bt}e.isDuration=g;function y(k){return k==null}e.isNull=y;function w(k){return Array.isArray(k)}e.isArray=w;function S(k){return typeof k=="boolean"}e.isBoolean=S;function D(k){return k instanceof so}e.isLink=D;function I(k){return k instanceof z2}e.isWidget=I;function M(k){return typeof HTMLElement<"u"?k instanceof HTMLElement:!1}e.isHtml=M;function N(k){return typeof k=="object"&&!M(k)&&!I(k)&&!w(k)&&!g(k)&&!h(k)&&!D(k)&&k!==void 0&&!y(k)}e.isObject=N;function B(k){return typeof k=="function"}e.isFunction=B})(ev||(ev={}));var dx;(function(e){function t(a){return ev.isObject(a)&&Object.keys(a).length==2&&"key"in a&&"rows"in a}e.isElementGroup=t;function n(a){for(let o of a)if(!t(o))return!1;return!0}e.isGrouping=n;function r(a){if(n(a)){let o=0;for(let i of a)o+=r(i.rows);return o}else return a.length}e.count=r})(dx||(dx={}));class so{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new so({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let a=t.split("#^");return so.block(a[0],a[1],n,r)}else if(t.includes("#")){let a=t.split("#");return so.header(a[0],a[1],n,r)}else return so.file(t,n,r)}static header(t,n,r,a){return new so({path:t,embed:r,display:a,subpath:MH(n),type:"header"})}static block(t,n,r,a){return new so({path:t,embed:r,display:a,subpath:n,type:"block"})}static fromObject(t){return new so(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new so(Object.assign({},this,{path:t}))}withDisplay(t){return new so(Object.assign({},this,{display:t}))}withHeader(t){return so.header(this.path,t,this.embed,this.display)}toFile(){return so.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new so(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new so(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+cx(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var t,n;const r=this.path.replace("|","\\|");return this.type=="header"?r+"#"+((t=this.subpath)===null||t===void 0?void 0:t.replace("|","\\|")):this.type=="block"?r+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):r}fileName(){return cx(this.path).replace(".md","")}}class z2{constructor(t){this.$widget=t}}class NH extends z2{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${ev.toString(this.key)}: ${ev.toString(this.value)}`}}class AH extends z2{constructor(t,n){super("dataview:external-link"),this.url=t,this.display=n}markdown(){var t;return`[${(t=this.display)!==null&&t!==void 0?t:this.url}](${this.url})`}}var fx;(function(e){function t(i,l){return new NH(i,l)}e.listPair=t;function n(i,l){return new AH(i,l)}e.externalLink=n;function r(i){return i.$widget==="dataview:list-pair"}e.isListPair=r;function a(i){return i.$widget==="dataview:external-link"}e.isExternalLink=a;function o(i){return r(i)||a(i)}e.isBuiltin=o})(fx||(fx={}));var Fr;(function(e){function t(y){return{type:"variable",name:y}}e.variable=t;function n(y){return{type:"literal",value:y}}e.literal=n;function r(y,w,S){return{type:"binaryop",left:y,op:w,right:S}}e.binaryOp=r;function a(y,w){return{type:"index",object:y,index:w}}e.index=a;function o(y){let w=y.split("."),S=e.variable(w[0]);for(let D=1;D"||y==">="||y=="!="||y=="="}e.isCompareOp=g,e.NULL=e.literal(null)})(Fr||(Fr={}));var Hl;(function(e){function t(h){return{type:"tag",tag:h}}e.tag=t;function n(h){return{type:"csv",path:h}}e.csv=n;function r(h){return{type:"folder",folder:h}}e.folder=r;function a(h,g){return{type:"link",file:h,direction:g?"incoming":"outgoing"}}e.link=a;function o(h,g,y){return{type:"binaryop",left:h,op:g,right:y}}e.binaryOp=o;function i(h,g){return{type:"binaryop",left:h,op:"&",right:g}}e.and=i;function l(h,g){return{type:"binaryop",left:h,op:"|",right:g}}e.or=l;function c(h){return{type:"negate",child:h}}e.negate=c;function f(){return{type:"empty"}}e.empty=f})(Hl||(Hl={}));const hx=new RegExp(Y2(),""),bT={year:bt.fromObject({years:1}),years:bt.fromObject({years:1}),yr:bt.fromObject({years:1}),yrs:bt.fromObject({years:1}),month:bt.fromObject({months:1}),months:bt.fromObject({months:1}),mo:bt.fromObject({months:1}),mos:bt.fromObject({months:1}),week:bt.fromObject({weeks:1}),weeks:bt.fromObject({weeks:1}),wk:bt.fromObject({weeks:1}),wks:bt.fromObject({weeks:1}),w:bt.fromObject({weeks:1}),day:bt.fromObject({days:1}),days:bt.fromObject({days:1}),d:bt.fromObject({days:1}),hour:bt.fromObject({hours:1}),hours:bt.fromObject({hours:1}),hr:bt.fromObject({hours:1}),hrs:bt.fromObject({hours:1}),h:bt.fromObject({hours:1}),minute:bt.fromObject({minutes:1}),minutes:bt.fromObject({minutes:1}),min:bt.fromObject({minutes:1}),mins:bt.fromObject({minutes:1}),m:bt.fromObject({minutes:1}),second:bt.fromObject({seconds:1}),seconds:bt.fromObject({seconds:1}),sec:bt.fromObject({seconds:1}),secs:bt.fromObject({seconds:1}),s:bt.fromObject({seconds:1})},ST={now:()=>At.local(),today:()=>At.local().startOf("day"),yesterday:()=>At.local().startOf("day").minus(bt.fromObject({days:1})),tomorrow:()=>At.local().startOf("day").plus(bt.fromObject({days:1})),sow:()=>At.local().startOf("week"),"start-of-week":()=>At.local().startOf("week"),eow:()=>At.local().endOf("week"),"end-of-week":()=>At.local().endOf("week"),soy:()=>At.local().startOf("year"),"start-of-year":()=>At.local().startOf("year"),eoy:()=>At.local().endOf("year"),"end-of-year":()=>At.local().endOf("year"),som:()=>At.local().startOf("month"),"start-of-month":()=>At.local().startOf("month"),eom:()=>At.local().endOf("month"),"end-of-month":()=>At.local().endOf("month")},DT=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function FH(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function OH(e){let[t,n]=FH(e);return so.infer(t,!1,n)}function bg(e,t,n){return pe.exports.seqMap(e,pe.exports.seq(pe.exports.optWhitespace,t,pe.exports.optWhitespace,e).many(),(r,a)=>{if(a.length==0)return r;let o=n(r,a[0][1],a[0][3]);for(let i=1;i(a,o)=>{let i=e._(a,o);if(!i.status)return i;for(let l of t){let c=l(i.value)._(a,i.index);if(!c.status)return i;i=c}return i})}const Ps=pe.exports.createLanguage({number:e=>pe.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>pe.exports.string('"').then(pe.exports.alt(e.escapeCharacter,pe.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(pe.exports.string('"')).desc("string"),escapeCharacter:e=>pe.exports.string("\\").then(pe.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>pe.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>pe.exports.seqMap(pe.exports.string("#"),pe.exports.alt(pe.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>pe.exports.seqMap(pe.exports.alt(pe.exports.regexp(new RegExp("\\p{Letter}","u")),pe.exports.regexp(hx).desc("text")),pe.exports.alt(pe.exports.regexp(/[0-9\p{Letter}_-]/u),pe.exports.regexp(hx).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>pe.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>OH(t)).desc("file link"),embedLink:e=>pe.exports.seqMap(pe.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>pe.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>pe.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>pe.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>pe.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>pe.exports.seqMap(pe.exports.regexp(/\d{4}/),pe.exports.string("-"),pe.exports.regexp(/\d{2}/),(t,n,r)=>At.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>pe.exports.alt(...Object.keys(ST).sort((t,n)=>n.length-t.length).map(pe.exports.string)),date:e=>PH(e.rootDate,t=>pe.exports.seqMap(pe.exports.string("-"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string("T"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string(":"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>pe.exports.seqMap(pe.exports.string(":"),pe.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>pe.exports.alt(pe.exports.seqMap(pe.exports.string("."),pe.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),pe.exports.succeed(t)),t=>pe.exports.alt(pe.exports.seqMap(pe.exports.string("+").or(pe.exports.string("-")),pe.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),pe.exports.seqMap(pe.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),pe.exports.seqMap(pe.exports.string("["),pe.exports.regexp(/[0-9A-Za-z+-\/]+/u),pe.exports.string("]"),(n,r,a)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>pe.exports.alt(e.dateShorthand.map(t=>ST[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>pe.exports.alt(...Object.keys(bT).sort((t,n)=>n.length-t.length).map(pe.exports.string)),duration:e=>pe.exports.seqMap(e.number,pe.exports.optWhitespace,e.durationType,(t,n,r)=>bT[r].mapUnits(a=>a*t)).sepBy1(pe.exports.string(",").trim(pe.exports.optWhitespace).or(pe.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>pe.exports.string("null"),tagSource:e=>e.tag.map(t=>Hl.tag(t)),csvSource:e=>pe.exports.seqMap(pe.exports.string("csv(").skip(pe.exports.optWhitespace),e.string,pe.exports.string(")"),(t,n,r)=>Hl.csv(n)),linkIncomingSource:e=>e.link.map(t=>Hl.link(t.path,!0)),linkOutgoingSource:e=>pe.exports.seqMap(pe.exports.string("outgoing(").skip(pe.exports.optWhitespace),e.link,pe.exports.string(")"),(t,n,r)=>Hl.link(n.path,!1)),folderSource:e=>e.string.map(t=>Hl.folder(t)),parensSource:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.source,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>r),negateSource:e=>pe.exports.seqMap(pe.exports.alt(pe.exports.string("-"),pe.exports.string("!")),e.atomSource,(t,n)=>Hl.negate(n)),atomSource:e=>pe.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>bg(e.atomSource,e.binaryBooleanOp.map(t=>t),Hl.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>DT.includes(t.toUpperCase())?pe.exports.fail("Variable fields cannot be a keyword ("+DT.join(" or ")+")"):pe.exports.succeed(Fr.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>Fr.literal(t)).desc("number"),stringField:e=>e.string.map(t=>Fr.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>Fr.literal(t)).desc("boolean"),dateField:e=>pe.exports.seqMap(pe.exports.string("date("),pe.exports.optWhitespace,e.datePlus,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>Fr.literal(r)).desc("date"),durationField:e=>pe.exports.seqMap(pe.exports.string("dur("),pe.exports.optWhitespace,e.duration,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>Fr.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>Fr.NULL),linkField:e=>e.link.map(t=>Fr.literal(t)),listField:e=>e.field.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("[").skip(pe.exports.optWhitespace),pe.exports.optWhitespace.then(pe.exports.string("]"))).map(t=>Fr.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>pe.exports.seqMap(e.identifier.or(e.string),pe.exports.string(":").trim(pe.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("{").skip(pe.exports.optWhitespace),pe.exports.optWhitespace.then(pe.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return Fr.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>pe.exports.alt(e.date,e.duration.map(t=>S6(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>pe.exports.alt(pe.exports.seqMap(e.atomInlineField,pe.exports.string(",").trim(pe.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>pe.exports.alt(e.embedLink.map(t=>Fr.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>pe.exports.seqMap(e.atomField,pe.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let a of n)switch(a.type){case"dot":r=Fr.index(r,Fr.literal(a.field));break;case"index":r=Fr.index(r,a.field);break;case"function":r=Fr.func(r,a.fields);break}return r}),negatedField:e=>pe.exports.seqMap(pe.exports.string("!"),e.indexField,(t,n)=>Fr.negate(n)).desc("negated field"),parensField:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.field,pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>r),lambdaField:e=>pe.exports.seqMap(e.identifier.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)).wrap(pe.exports.string("(").trim(pe.exports.optWhitespace),pe.exports.string(")").trim(pe.exports.optWhitespace)),pe.exports.string("=>").trim(pe.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>pe.exports.seqMap(pe.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>pe.exports.seqMap(pe.exports.string("["),pe.exports.optWhitespace,e.field,pe.exports.optWhitespace,pe.exports.string("]"),(t,n,r,a,o)=>({type:"index",field:r})),functionPostfix:e=>pe.exports.seqMap(pe.exports.string("("),pe.exports.optWhitespace,e.field.sepBy(pe.exports.string(",").trim(pe.exports.optWhitespace)),pe.exports.optWhitespace,pe.exports.string(")"),(t,n,r,a,o)=>({type:"function",fields:r})),binaryMulDivField:e=>bg(e.indexField,e.binaryMulDiv,Fr.binaryOp),binaryPlusMinusField:e=>bg(e.binaryMulDivField,e.binaryPlusMinus,Fr.binaryOp),binaryCompareField:e=>bg(e.binaryPlusMinusField,e.binaryCompareOp,Fr.binaryOp),binaryBooleanField:e=>bg(e.binaryCompareField,e.binaryBooleanOp,Fr.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function jH(e){try{return Aw.success(Ps.field.tryParse(e))}catch(t){return Aw.failure(""+t)}}var Fw;(function(e){function t(r,a){return{name:r,field:a}}e.named=t;function n(r,a){return{field:r,direction:a}}e.sortBy=n})(Fw||(Fw={}));function LH(e){return pe.exports.custom((t,n)=>(r,a)=>{let o=e._(r,a);return o.status?Object.assign({},o,{value:[o.value,r.substring(a,o.index)]}):o})}function RH(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const _H=pe.exports.createLanguage({queryType:e=>pe.exports.alt(pe.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>pe.exports.seqMap(Ps.field.skip(pe.exports.whitespace),pe.exports.regexp(/AS/i).skip(pe.exports.whitespace),Ps.identifier.or(Ps.string),(t,n,r)=>Fw.named(r,t)),namedField:e=>pe.exports.alt(e.explicitNamedField,LH(Ps.field).map(([t,n])=>Fw.named(RH(n),t))),sortField:e=>pe.exports.seqMap(Ps.field.skip(pe.exports.optWhitespace),pe.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,n)=>{let r=n.length==0?"ascending":n[0].toLowerCase();return r=="desc"&&(r="descending"),r=="asc"&&(r="ascending"),{field:t,direction:r}}),headerClause:e=>e.queryType.skip(pe.exports.whitespace).chain(t=>{switch(t){case"table":return pe.exports.seqMap(pe.exports.regexp(/WITHOUT\s+ID/i).skip(pe.exports.optWhitespace).atMost(1),pe.exports.sepBy(e.namedField,pe.exports.string(",").trim(pe.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return pe.exports.seqMap(pe.exports.regexp(/WITHOUT\s+ID/i).skip(pe.exports.optWhitespace).atMost(1),Ps.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return pe.exports.succeed({type:"task"});case"calendar":return pe.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return pe.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>pe.exports.seqMap(pe.exports.regexp(/FROM/i),pe.exports.whitespace,Ps.source,(t,n,r)=>r),whereClause:e=>pe.exports.seqMap(pe.exports.regexp(/WHERE/i),pe.exports.whitespace,Ps.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE "),sortByClause:e=>pe.exports.seqMap(pe.exports.regexp(/SORT/i),pe.exports.whitespace,e.sortField.sepBy1(pe.exports.string(",").trim(pe.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>pe.exports.seqMap(pe.exports.regexp(/LIMIT/i),pe.exports.whitespace,Ps.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT "),flattenClause:e=>pe.exports.seqMap(pe.exports.regexp(/FLATTEN/i).skip(pe.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:e=>pe.exports.seqMap(pe.exports.regexp(/GROUP BY/i).skip(pe.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:e=>pe.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>pe.exports.seqMap(e.headerClause.trim(pe.exports.optWhitespace),e.fromClause.trim(pe.exports.optWhitespace).atMost(1),e.clause.trim(pe.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?Hl.folder(""):n[0],operations:r,settings:B2}))}),BH=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},HH=e=>e.plugins.enabledPlugins.has("dataview");Ku.DATE_SHORTHANDS=ST;Ku.DURATION_TYPES=bT;Ku.EXPRESSION=Ps;Ku.KEYWORDS=DT;Ku.QUERY_LANGUAGE=_H;var UH=Ku.getAPI=BH;Ku.isPluginEnabled=HH;Ku.parseField=jH;async function YH(e,t,n,r,a){var I,M;const{vault:o,metadataCache:i}=Le.getState().dailyNotesState.app===void 0?app:Le.getState().dailyNotesState.app,l=Le.getState().dailyNotesState.settings,c=e.replace(/\n/g,"
");if(n===void 0)return;const f=i.getFirstLinkpathDest("",n),h=x.moment(),g=h.format("YYYYMMDDHHmmss"),y=r.slice(14),w=" ",S=g+" "+c.trim(),D=w+"- "+g+" "+c.trim();if(f){let N;if(l!=null&&l.CommentOnMemos&&(l!=null&&l.CommentsInOriginalNotes)){const L=UH();if(L!==void 0)try{N=(M=(I=L.page(f.path))==null?void 0:I.file.lists.values)==null?void 0:M.filter(_=>_.line===parseInt(y))}catch(_){console.error(_)}}const B=await o.read(f);let k=0;N[0].children.values.length>0?k=N[0].children.values[N[0].children.values.length-1].line:k=N[0].line;const R=await zH(D,B,k);if(await o.modify(f,R.content),t)return{id:g+(k+1),content:S,deletedAt:"",createdAt:h.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:f.path,hasId:"",linkId:a}}}async function zH(e,t,n){if(n===-1)return{content:`${t} ${e}`,posNum:-1};const r=t.split(` `),a=r.slice(0,n+1).join(` `),o=r.slice(n+1).join(` @@ -160,36 +160,36 @@ ${e}`,posNum:-1};const r=t.split(` ${e} ${o}`,posNum:n}:{content:`${a} ${e} -${o}`,posNum:n}}function zH(e,t,n){var a;const r=t.workspace.getLeavesOfType("markdown");for(const o of r){const i=o.view;if(((a=i==null?void 0:i.file)==null?void 0:a.path)===e){t.workspace.revealLeaf(o);try{return o.view.setEphemeralState({line:n}),!0}catch(l){return console.error(l),!1}}}return!1}const V2=async e=>{var o;const t=ft.getState().app,n=t.workspace.getLeavesOfType("markdown");for(const i of n){const l=i.view;if(((o=l==null?void 0:l.file)==null?void 0:o.path)===e){t.workspace.revealLeaf(i);return}}const r=t.metadataCache.getFirstLinkpathDest("",e);if(!r){new x.Notice(E("File not found for the given thino path"));return}await t.workspace.getLeaf(!0).openFile(r)},W2=async(e,t)=>{const{app:n}=ft.getState(),r=parseInt(e.slice(14));if(zH(t,n,r))return;const a=n.metadataCache.getFirstLinkpathDest("",t);if(!x.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!0)),await o.openFile(a,{eState:{line:r}})}},$2=async(e,t)=>{var f,h,g;const n=ft.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new x.Notice(E("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(y){console.error(y),a=await n.vault.cachedRead(r)}const i=a.split(/\r?\n/).findIndex(y=>y.contains(e)),l=n.workspace.getLeavesOfType("markdown");for(const y of l){const w=y.view;if(((f=w==null?void 0:w.file)==null?void 0:f.path)===r.path){n.workspace.revealLeaf(y);try{(h=y.view.editor)==null||h.setCursor({line:i,ch:1});return}catch(S){console.error(S)}}}const c=n.workspace.getLeaf(!0);await c.openFile(r,{eState:{line:i}});try{(g=c.view.editor)==null||g.setCursor({line:i,ch:1})}catch(y){console.error(y)}},Z2=async(e,t)=>{var l;const n=ft.getState().app,r=(c,f)=>{var g;const h=(g=Array.from(c.nodes.values()))==null?void 0:g.find(y=>y.id===f);return h?(c.selectOnly(h),c.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const c of a){const f=c.view;if(((l=f==null?void 0:f.file)==null?void 0:l.path)===t&&(n.workspace.revealLeaf(c),r(f.canvas,e)))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new x.Notice(E("File not found for the given thino path"));return}const i=n.workspace.getLeaf(!0);await i.openFile(o),setTimeout(()=>{var c;r((c=i.view)==null?void 0:c.canvas,e)},10)};class VH{constructor(){Se(this,"initialized",!1)}getState(){return Le.getState().memoState}async fetchAllMemos(){const t=ft.getState().settings;ut.checkDailyInMulti(t);const n=await Ko.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Le.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Le.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,dt.setLoaded(!0)),r}async updateTypeMemos(t){const n=await Ko.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await Ko.getMyDeletedMemos();return t.sort((n,r)=>ut.getTimeStampByDate(r.deletedAt)-ut.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Le.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Le.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async finishWaitingForTemplaterThinos(){const t=this.getState().preparingUpdateMemo;if(t.length!==0)for(const n of t){const r=this.getMemoById(n.id),a=n.type==="local"?await DS(n.origin,n.isList,n.date,!0):await RC(r);await this.replaceOldThinoWithNewThino(n.id,a),Le.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:n.id}})}}async replaceOldThinoWithNewThino(t,n){this.getMemoById(t)&&Le.dispatch({type:"REPLACE_MEMO_BY_ID",payload:{id:t,memo:n}})}async updateMemoById(t,n,r){const a=this.getMemoByWebId(t);if(!a)return;let o=null;const i=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType||"JOURNAL"};if(dA({...a,deleted:!!n.deletedAt},{...i,webId:n.id}))return a;switch(a.sourceType){case"DAILY":o=await Bl(a,{id:a.id,webId:n.id,...i});break;case"CANVAS":o=await _l(a,{id:a.id,webId:n.id,...i});break;case"MULTI":o=await js(a,{id:a.id,webId:n.id,...i});break;case"FILE":o=await Rl(a,{id:a.id,webId:n.id,...i});break}if(!o)return a;Le.dispatch({type:"EDIT_MEMO",payload:o})}async archiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Bl(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"CANVAS":a=await _l(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"MULTI":a=await js(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"FILE":a=await Rl(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break}}return n.length>0?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async dealWithDailyThinoBulk(t,n,r){const a=await D_(t,n,r);return r==="deleteForever"?await this.deleteThinosWithIdBulk(a.map(o=>o.id)):this.editMemoBulk(a),a}async deleteThinosWithIdBulk(t){for(const n of t)Le.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:n}})}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Bl(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await _l(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await js(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await Rl(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async pushToUpdateList(t,n){Le.dispatch({type:"PREPARE_UPDATE_THINO",payload:{thino:t,originalId:n}})}async removePrepareUpdateThinoById(t){Le.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:t}})}async removePrepareUpdateThino(){Le.dispatch({type:"REMOVE_PREPARE_UPDATE_THINO",payload:null})}async unarchiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Bl(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"CANVAS":a=await _l(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"MULTI":a=await js(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"FILE":a=await Rl(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break}}return n.length>0?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Bl(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await _l(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await js(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await Rl(t,{id:t.id,rowStatus:"NORMAL"});break}return Le.dispatch({type:"UNARCHIVE_MEMO_BY_ID",payload:n}),n}async hideMemoById(t){const n=this.getMemoById(t);if(!n)return n;let r=null;switch(n.sourceType){case"DAILY":r=await Bl(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await _l(n,{id:n.id,deleted:!0});break;case"MULTI":r=await js(n,{id:n.id,deleted:!0});break;case"FILE":r=await Rl(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await Ko.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await Ko.deleteMemoInDailyNote(r);break;case"CANVAS":await Ko.deleteMemoInCanvas(r);break;case"MULTI":await Ko.deleteMemoInMultiFiles(r);break;case"FILE":await Ko.deleteMemoInSingleFile(r);break}Le.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(l){console.error(l),new x.Notice(E("Failed to delete memo"))}if(n&&n==="local")return;const a=ft.getState().settings,o=ft.getState().app;!(o!=null&&o.loadLocalStorage("tokenForSync"))||!a.startSync||r.webId&&await A2(r.webId)}async removeMemosInFile(t,n){var a,o;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());r.push(...l)}else if(t.path.contains("thino.canvas")){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());r.push(...l)}else if((a=t==null?void 0:t.parent)!=null&&a.path.contains(n)||!(t!=null&&t.parent)&&!((o=t==null?void 0:t.parent)!=null&&o.path)){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());l.length>0&&r.push(...l)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await fT(t,r);const i=r.map(l=>l.id);Le.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:i}})}catch(i){console.error(i)}}async removeThinosByPath(t){const r=this.getState().memos.filter(a=>a.path===t).map(a=>a.id);Le.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:r}})}async updateMemosInFile(t,n){const r=[],a=async()=>{var o;if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await vA(t,r);return}else if(t.path.contains("thino.canvas")){await yA(t,r);return}else if((o=t==null?void 0:t.parent)!=null&&o.path.contains(n)&&!t.path.endsWith(".thino.md")){await gA(t,r);return}else if(t.path.endsWith(".thino.md")){console.error(t),await fT(t,r);return}};try{await a(),Le.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(o){console.error(o)}}async updateMemoProperty(t){const n=ut.randomId(16),r=await js(t,{id:n});Le.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;Le.dispatch({type:"EDIT_MEMO",payload:t});const r=ft.getState().settings,a=ft.getState().app;if(!(!(a!=null&&a.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&SS({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?x.moment(t.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE"})}catch(i){console.error(i)}}editMemoBulk(t){for(const n of t)this.editMemo(n);this.updateTagsState()}editCommentMemo(t){Le.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(a=>a.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){var o,i,l,c;const{memos:t}=this.getState(),n=new Set,r={},a=new Map;for(const f of t){if(f.deletedAt!==""&&f.deletedAt||f.rowStatus==="ARCHIVED")continue;const h=[];if(!a.has(f.path)&&f.sourceType!=="FILE"){const S=(Array.isArray((o=f==null?void 0:f.fileInfo)==null?void 0:o.tags)?f.fileInfo.tags:[]).filter(D=>D).map(D=>D.toString().trim());a.set(f.path,S),h.push(...S)}const g=f.content.replace(/<[^>]*>/g,"").replace(/\`\`\`(.*)?\n[\s\S]*?\n\`\`\`/gm,"").replace(/\`([^\`].*?)\`/g,""),y=[...Array.from(g.match($r)||[]),...Array.from(g.match(ua)||[]),...Array.from(g.match(Wa)||[])];h.push(...y);for(const w of h){if(!w||w==="undefined"||!w)continue;let S=w;typeof w!="string"&&(S=w==null?void 0:w.toString());const D=(c=(l=(i=S==null?void 0:S.replace($r,"$1"))==null?void 0:i.replace(ua,"$1"))==null?void 0:l.replace(Wa,"$2"))==null?void 0:c.trim();/^\d+$/.test(D)||(n.add(D),r[D]=(r[D]||0)+1)}}Le.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){Le.dispatch({type:"SET_MEMOS",payload:{memos:[]}})}async getLinkedMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes(t))}async getCommentMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes("comment: "+t))}async createMemoMultiFile({content:t,isList:n,name:r}){return await i_({content:t,isList:n,name:r})}async createMemoSingleFile({content:t,isList:n}){return await s_({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(o=>o.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(o=>o.id===t.id)||n!=null&&n.some(o=>o.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const a=ft.getState().settings;switch(a&&(a!=null&&a.saveThinoType)&&(r=a.saveThinoType!=="FILE"?a.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await LC(t);case"DAILY":return await RC(t);default:return await LC(t)}}async initSync(){const n=this.getState().memos.filter(a=>!a.webId),r=await r_(n);for(const a of r)await this.createOrPatchThinoFromWeb(a)}async createMemoCanvas({text:t,isList:n}){return await l_({content:t,isList:n})}async createMemoDaily(t,n){return await DS(t,n)}setWaitingForTemplater({origin:t,date:n,isList:r,id:a,type:o}){Le.dispatch({type:"SET_WAITING_FOR_TEMPLATER",payload:{origin:t,date:n,isList:r,id:a,type:o}})}async pinMemoById(t){const n=this.getMemoById(t),r=await T_(n);Le.dispatch({type:"PIN_MEMO",payload:r});try{const a=ft.getState().settings,o=ft.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const l=await SS({id:r.webId,pinned:!0});this.editMemo(l)}}catch(a){console.error(a)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await I_(n);Le.dispatch({type:"PIN_MEMO",payload:r});try{const a=ft.getState().settings,o=ft.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const l=await SS({id:r.webId,pinned:!1});this.editMemo(l)}}catch(a){console.error(a)}}async createCommentMemo(t,n,r,a,o){return await YH(t,n,r,a,o)}async importMemos(t,n,r){return await DS(t,n,r)}async createThino({content:t,isList:n,type:r,name:a}){let o=null;switch(r.toLowerCase()){case"canvas":o=await we.createMemoCanvas({text:t,isList:n});break;case"multi":o=await we.createMemoMultiFile({content:t,isList:n,name:a});break;case"daily":o=await we.createMemoDaily(t,n);break;case"file":o=await we.createMemoSingleFile({content:t,isList:n});break;default:o=await we.createMemoDaily(t,n);break}const i=ft.getState().settings,l=ft.getState().app,c=l==null?void 0:l.loadLocalStorage("tokenForSync");return o&&c&&i.startSync&&r!=="DAILY"&&setTimeout(async()=>{try{const f=await N2({content:t,thinoType:"FILE"});await this.updateMemoById(o.id,f,!0)}catch(f){console.error(f)}},200),o}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await W2(n.id,n.path);break;case"CANVAS":await Z2(n.id,n.path);break;case"MULTI":await V2(n.path);break;case"FILE":await $2(n.id,n.path);break}}async updateMemo(t,n,r){const a=this.getMemoById(t);if(a){let o=null;switch(a.sourceType){case"DAILY":o=await Bl(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"CANVAS":o=await _l(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"MULTI":o=await js(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"FILE":o=await Rl(a,{id:a.id,content:n,thinoType:r||a.thinoType})}if(o)return o}return a}}const we=new VH;class WH{getState(){return Le.getState().queryState}async getMyAllQueries(){const t=at.getState().query.filter,n=this.getQueryById(t),r=await Ko.getMyQueries();return Le.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){Le.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){Le.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await Ko.deleteQueryById(t),Le.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await Ko.createQuery(t,n)}createTempQuery(t,n){return kR(t,n)}async updateQuery(t,n,r){return await Ko.updateQuery(t,n,r)}async pinQuery(t){await Ko.pinQuery(t)}async unpinQuery(t){await Ko.unpinQuery(t)}}const on=new WH;class $H{async upload(t){const{vault:n,fileManager:r}=Le.getState().dailyNotesState.app,a=await t.arrayBuffer(),o=ZH(t.type),i=Ju(),l=x.moment(),c=pb(l,i);let f;if(c)c instanceof x.TFile&&(f=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,c),a));else{const h=await lA(l);f=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,h),a)}return r.generateMarkdownLink(f,f.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const a=Array.from(r.getElementsByClassName("memo"));for(const o of a){const i=o.getElementsByClassName("content")[0],l=x.htmlToMarkdown(i.innerHTML),c=await we.importMemos(l,!0,x.moment(o.getElementsByClassName("time")[0].innerHTML));we.pushMemo(c)}}}const ZH=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},q2=new $H;var rs={},S6={exports:{}},Jo={},AS={exports:{}},FS={},px;function qH(){return px||(px=1,function(e){function t(ie,ce){var X=ie.length;ie.push(ce);e:for(;0>>1,De=ie[ae];if(0>>1;aea(Fe,X))Bea(Xe,Fe)?(ie[ae]=Xe,ie[Be]=X,ae=Be):(ie[ae]=Fe,ie[Re]=X,ae=Re);else if(Bea(Xe,X))ie[ae]=Xe,ie[Be]=X,ae=Be;else break e}}return ce}function a(ie,ce){var X=ie.sortIndex-ce.sortIndex;return X!==0?X:ie.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],f=[],h=1,g=null,y=3,w=!1,S=!1,D=!1,I=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(ie){for(var ce=n(f);ce!==null;){if(ce.callback===null)r(f);else if(ce.startTime<=ie)r(f),ce.sortIndex=ce.expirationTime,t(c,ce);else break;ce=n(f)}}function k(ie){if(D=!1,_(ie),!S)if(n(c)!==null)S=!0,$(B);else{var ce=n(f);ce!==null&&he(k,ce.startTime-ie)}}function B(ie,ce){S=!1,D&&(D=!1,M(V),V=-1),w=!0;var X=y;try{for(_(ce),g=n(c);g!==null&&(!(g.expirationTime>ce)||ie&&!Q());){var ae=g.callback;if(typeof ae=="function"){g.callback=null,y=g.priorityLevel;var De=ae(g.expirationTime<=ce);ce=e.unstable_now(),typeof De=="function"?g.callback=De:g===n(c)&&r(c),_(ce)}else r(c);g=n(c)}if(g!==null)var je=!0;else{var Re=n(f);Re!==null&&he(k,Re.startTime-ce),je=!1}return je}finally{g=null,y=X,w=!1}}var L=!1,R=null,V=-1,Y=5,Z=-1;function Q(){return!(e.unstable_now()-Zie||125ae?(ie.sortIndex=X,t(f,ie),n(c)===null&&ie===n(f)&&(D?(M(V),V=-1):D=!0,he(k,X-ae))):(ie.sortIndex=De,t(c,ie),S||w||(S=!0,$(B))),ie},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(ie){var ce=y;return function(){var X=y;y=ce;try{return ie.apply(this,arguments)}finally{y=X}}}}(FS)),FS}var mx;function GH(){return mx||(mx=1,AS.exports=qH()),AS.exports}var gx;function JH(){if(gx)return Jo;gx=1;var e=P,t=GH();function n(s){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+s,m=1;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},g={};function y(s){return c.call(g,s)?!0:c.call(h,s)?!1:f.test(s)?g[s]=!0:(h[s]=!0,!1)}function w(s,u,m,b){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function S(s,u,m,b){if(u===null||typeof u>"u"||w(s,u,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function D(s,u,m,b,C,O,W){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=b,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=s,this.type=u,this.sanitizeURL=O,this.removeEmptyString=W}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){I[s]=new D(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var u=s[0];I[u]=new D(u,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){I[s]=new D(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){I[s]=new D(s,2,!1,s,null,!1,!1)}),"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(s){I[s]=new D(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){I[s]=new D(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){I[s]=new D(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){I[s]=new D(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){I[s]=new D(s,5,!1,s.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function N(s){return s[1].toUpperCase()}"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(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){I[s]=new D(s,1,!1,s.toLowerCase(),null,!1,!1)}),I.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){I[s]=new D(s,1,!1,s.toLowerCase(),null,!0,!0)});function _(s,u,m,b){var C=I.hasOwnProperty(u)?I[u]:null;(C!==null?C.type!==0:b||!(2{var o;const t=ft.getState().app,n=t.workspace.getLeavesOfType("markdown");for(const i of n){const l=i.view;if(((o=l==null?void 0:l.file)==null?void 0:o.path)===e){t.workspace.revealLeaf(i);return}}const r=t.metadataCache.getFirstLinkpathDest("",e);if(!r){new x.Notice(E("File not found for the given thino path"));return}await t.workspace.getLeaf(!0).openFile(r)},W2=async(e,t)=>{const{app:n}=ft.getState(),r=parseInt(e.slice(14));if(VH(t,n,r))return;const a=n.metadataCache.getFirstLinkpathDest("",t);if(!x.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!0)),await o.openFile(a,{eState:{line:r}})}},$2=async(e,t)=>{var f,h,g;const n=ft.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new x.Notice(E("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(y){console.error(y),a=await n.vault.cachedRead(r)}const i=a.split(/\r?\n/).findIndex(y=>y.contains(e)),l=n.workspace.getLeavesOfType("markdown");for(const y of l){const w=y.view;if(((f=w==null?void 0:w.file)==null?void 0:f.path)===r.path){n.workspace.revealLeaf(y);try{(h=y.view.editor)==null||h.setCursor({line:i,ch:1});return}catch(S){console.error(S)}}}const c=n.workspace.getLeaf(!0);await c.openFile(r,{eState:{line:i}});try{(g=c.view.editor)==null||g.setCursor({line:i,ch:1})}catch(y){console.error(y)}},Z2=async(e,t)=>{var l;const n=ft.getState().app,r=(c,f)=>{var g;const h=(g=Array.from(c.nodes.values()))==null?void 0:g.find(y=>y.id===f);return h?(c.selectOnly(h),c.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const c of a){const f=c.view;if(((l=f==null?void 0:f.file)==null?void 0:l.path)===t&&(n.workspace.revealLeaf(c),r(f.canvas,e)))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new x.Notice(E("File not found for the given thino path"));return}const i=n.workspace.getLeaf(!0);await i.openFile(o),setTimeout(()=>{var c;r((c=i.view)==null?void 0:c.canvas,e)},10)};class WH{constructor(){Se(this,"initialized",!1)}getState(){return Le.getState().memoState}async fetchAllMemos(){const t=ft.getState().settings;ut.checkDailyInMulti(t);const n=await Ko.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Le.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Le.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,dt.setLoaded(!0)),r}async updateTypeMemos(t){const n=await Ko.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Le.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await Ko.getMyDeletedMemos();return t.sort((n,r)=>ut.getTimeStampByDate(r.deletedAt)-ut.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Le.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Le.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async finishWaitingForTemplaterThinos(){const t=this.getState().preparingUpdateMemo;if(t.length!==0)for(const n of t){const r=this.getMemoById(n.id),a=n.type==="local"?await DS(n.origin,n.isList,n.date,!0):await RC(r);await this.replaceOldThinoWithNewThino(n.id,a),Le.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:n.id}})}}async replaceOldThinoWithNewThino(t,n){this.getMemoById(t)&&Le.dispatch({type:"REPLACE_MEMO_BY_ID",payload:{id:t,memo:n}})}async updateMemoById(t,n,r){const a=this.getMemoByWebId(t);if(!a)return;let o=null;const i=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType||"JOURNAL"};if(dA({...a,deleted:!!n.deletedAt},{...i,webId:n.id}))return a;switch(a.sourceType){case"DAILY":o=await Bl(a,{id:a.id,webId:n.id,...i});break;case"CANVAS":o=await _l(a,{id:a.id,webId:n.id,...i});break;case"MULTI":o=await js(a,{id:a.id,webId:n.id,...i});break;case"FILE":o=await Rl(a,{id:a.id,webId:n.id,...i});break}if(!o)return a;Le.dispatch({type:"EDIT_MEMO",payload:o})}async archiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Bl(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"CANVAS":a=await _l(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"MULTI":a=await js(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"FILE":a=await Rl(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break}}return n.length>0?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async dealWithDailyThinoBulk(t,n,r){const a=await T_(t,n,r);return r==="deleteForever"?await this.deleteThinosWithIdBulk(a.map(o=>o.id)):this.editMemoBulk(a),a}async deleteThinosWithIdBulk(t){for(const n of t)Le.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:n}})}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Bl(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await _l(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await js(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await Rl(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async pushToUpdateList(t,n){Le.dispatch({type:"PREPARE_UPDATE_THINO",payload:{thino:t,originalId:n}})}async removePrepareUpdateThinoById(t){Le.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:t}})}async removePrepareUpdateThino(){Le.dispatch({type:"REMOVE_PREPARE_UPDATE_THINO",payload:null})}async unarchiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Bl(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"CANVAS":a=await _l(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"MULTI":a=await js(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"FILE":a=await Rl(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break}}return n.length>0?(Le.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Bl(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await _l(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await js(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await Rl(t,{id:t.id,rowStatus:"NORMAL"});break}return Le.dispatch({type:"UNARCHIVE_MEMO_BY_ID",payload:n}),n}async hideMemoById(t){const n=this.getMemoById(t);if(!n)return n;let r=null;switch(n.sourceType){case"DAILY":r=await Bl(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await _l(n,{id:n.id,deleted:!0});break;case"MULTI":r=await js(n,{id:n.id,deleted:!0});break;case"FILE":r=await Rl(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await Ko.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await Ko.deleteMemoInDailyNote(r);break;case"CANVAS":await Ko.deleteMemoInCanvas(r);break;case"MULTI":await Ko.deleteMemoInMultiFiles(r);break;case"FILE":await Ko.deleteMemoInSingleFile(r);break}Le.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(l){console.error(l),new x.Notice(E("Failed to delete memo"))}if(n&&n==="local")return;const a=ft.getState().settings,o=ft.getState().app;!(o!=null&&o.loadLocalStorage("tokenForSync"))||!a.startSync||r.webId&&await A2(r.webId)}async removeMemosInFile(t,n){var a,o;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());r.push(...l)}else if(t.path.contains("thino.canvas")){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());r.push(...l)}else if((a=t==null?void 0:t.parent)!=null&&a.path.contains(n)||!(t!=null&&t.parent)&&!((o=t==null?void 0:t.parent)!=null&&o.path)){const l=this.getState().memos.filter(c=>c.path.trim()===t.path.trim());l.length>0&&r.push(...l)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await fT(t,r);const i=r.map(l=>l.id);Le.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:i}})}catch(i){console.error(i)}}async removeThinosByPath(t){const r=this.getState().memos.filter(a=>a.path===t).map(a=>a.id);Le.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:r}})}async updateMemosInFile(t,n){const r=[],a=async()=>{var o;if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await vA(t,r);return}else if(t.path.contains("thino.canvas")){await yA(t,r);return}else if((o=t==null?void 0:t.parent)!=null&&o.path.contains(n)&&!t.path.endsWith(".thino.md")){await gA(t,r);return}else if(t.path.endsWith(".thino.md")){console.error(t),await fT(t,r);return}};try{await a(),Le.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(o){console.error(o)}}async updateMemoProperty(t){const n=ut.randomId(16),r=await js(t,{id:n});Le.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;Le.dispatch({type:"EDIT_MEMO",payload:t});const r=ft.getState().settings,a=ft.getState().app;if(!(!(a!=null&&a.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&SS({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?x.moment(t.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE",thinoStatus:t.thinoType==="JOURNAL"?"JOURNAL":t.thinoType==="TASK-TODO"?"TASK-TODO":"TASK-DONE"})}catch(i){console.error(i)}}editMemoBulk(t){for(const n of t)this.editMemo(n);this.updateTagsState()}editCommentMemo(t){Le.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(a=>a.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){var o,i,l,c;const{memos:t}=this.getState(),n=new Set,r={},a=new Map;for(const f of t){if(f.deletedAt!==""&&f.deletedAt||f.rowStatus==="ARCHIVED")continue;const h=[];if(!a.has(f.path)&&f.sourceType!=="FILE"){const S=(Array.isArray((o=f==null?void 0:f.fileInfo)==null?void 0:o.tags)?f.fileInfo.tags:[]).filter(D=>D).map(D=>D.toString().trim());a.set(f.path,S),h.push(...S)}const g=f.content.replace(/<[^>]*>/g,"").replace(/\`\`\`(.*)?\n[\s\S]*?\n\`\`\`/gm,"").replace(/\`([^\`].*?)\`/g,""),y=[...Array.from(g.match($r)||[]),...Array.from(g.match(ua)||[]),...Array.from(g.match(Wa)||[])];h.push(...y);for(const w of h){if(!w||w==="undefined"||!w)continue;let S=w;typeof w!="string"&&(S=w==null?void 0:w.toString());const D=(c=(l=(i=S==null?void 0:S.replace($r,"$1"))==null?void 0:i.replace(ua,"$1"))==null?void 0:l.replace(Wa,"$2"))==null?void 0:c.trim();/^\d+$/.test(D)||(n.add(D),r[D]=(r[D]||0)+1)}}Le.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){Le.dispatch({type:"SET_MEMOS",payload:{memos:[]}})}async getLinkedMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes(t))}async getCommentMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes("comment: "+t))}async createMemoMultiFile({content:t,isList:n,name:r}){return await s_({content:t,isList:n,name:r})}async createMemoSingleFile({content:t,isList:n}){return await l_({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(o=>o.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(o=>o.id===t.id)||n!=null&&n.some(o=>o.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const a=ft.getState().settings;switch(a&&(a!=null&&a.saveThinoType)&&(r=a.saveThinoType!=="FILE"?a.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await LC(t);case"DAILY":return await RC(t);default:return await LC(t)}}async initSync(){const n=this.getState().memos.filter(a=>!a.webId),r=await a_(n);for(const a of r)await this.createOrPatchThinoFromWeb(a)}async createMemoCanvas({text:t,isList:n}){return await u_({content:t,isList:n})}async createMemoDaily(t,n){return await DS(t,n)}setWaitingForTemplater({origin:t,date:n,isList:r,id:a,type:o}){Le.dispatch({type:"SET_WAITING_FOR_TEMPLATER",payload:{origin:t,date:n,isList:r,id:a,type:o}})}async pinMemoById(t){const n=this.getMemoById(t),r=await I_(n);Le.dispatch({type:"PIN_MEMO",payload:r});try{const a=ft.getState().settings,o=ft.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const l=await SS({id:r.webId,pinned:!0});this.editMemo(l)}}catch(a){console.error(a)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await E_(n);Le.dispatch({type:"PIN_MEMO",payload:r});try{const a=ft.getState().settings,o=ft.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const l=await SS({id:r.webId,pinned:!1});this.editMemo(l)}}catch(a){console.error(a)}}async createCommentMemo(t,n,r,a,o){return await YH(t,n,r,a,o)}async importMemos(t,n,r){return await DS(t,n,r)}async createThino({content:t,isList:n,type:r,name:a}){let o=null;switch(r.toLowerCase()){case"canvas":o=await we.createMemoCanvas({text:t,isList:n});break;case"multi":o=await we.createMemoMultiFile({content:t,isList:n,name:a});break;case"daily":o=await we.createMemoDaily(t,n);break;case"file":o=await we.createMemoSingleFile({content:t,isList:n});break;default:o=await we.createMemoDaily(t,n);break}const i=ft.getState().settings,l=ft.getState().app,c=l==null?void 0:l.loadLocalStorage("tokenForSync");return o&&c&&i.startSync&&r!=="DAILY"&&setTimeout(async()=>{try{const f=await N2({content:t,thinoType:"FILE",thinoStatus:n?"JOURNAL":"TASK-TODO"});await this.updateMemoById(o.id,f,!0)}catch(f){console.error(f)}},200),o}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await W2(n.id,n.path);break;case"CANVAS":await Z2(n.id,n.path);break;case"MULTI":await V2(n.path);break;case"FILE":await $2(n.id,n.path);break}}async updateMemo(t,n,r){const a=this.getMemoById(t);if(a){let o=null;switch(a.sourceType){case"DAILY":o=await Bl(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"CANVAS":o=await _l(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"MULTI":o=await js(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"FILE":o=await Rl(a,{id:a.id,content:n,thinoType:r||a.thinoType})}if(o)return o}return a}}const we=new WH;class $H{getState(){return Le.getState().queryState}async getMyAllQueries(){const t=at.getState().query.filter,n=this.getQueryById(t),r=await Ko.getMyQueries();return Le.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){Le.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){Le.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await Ko.deleteQueryById(t),Le.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await Ko.createQuery(t,n)}createTempQuery(t,n){return NR(t,n)}async updateQuery(t,n,r){return await Ko.updateQuery(t,n,r)}async pinQuery(t){await Ko.pinQuery(t)}async unpinQuery(t){await Ko.unpinQuery(t)}}const on=new $H;class ZH{async upload(t){const{vault:n,fileManager:r}=Le.getState().dailyNotesState.app,a=await t.arrayBuffer(),o=qH(t.type),i=Ju(),l=x.moment(),c=pb(l,i);let f;if(c)c instanceof x.TFile&&(f=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,c),a));else{const h=await lA(l);f=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,h),a)}return r.generateMarkdownLink(f,f.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const a=Array.from(r.getElementsByClassName("memo"));for(const o of a){const i=o.getElementsByClassName("content")[0],l=x.htmlToMarkdown(i.innerHTML),c=await we.importMemos(l,!0,x.moment(o.getElementsByClassName("time")[0].innerHTML));we.pushMemo(c)}}}const qH=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},q2=new ZH;var rs={},D6={exports:{}},Jo={},AS={exports:{}},FS={},px;function GH(){return px||(px=1,function(e){function t(se,ue){var X=se.length;se.push(ue);e:for(;0>>1,De=se[oe];if(0>>1;oea(Fe,X))Bea(Xe,Fe)?(se[oe]=Xe,se[Be]=X,oe=Be):(se[oe]=Fe,se[Re]=X,oe=Re);else if(Bea(Xe,X))se[oe]=Xe,se[Be]=X,oe=Be;else break e}}return ue}function a(se,ue){var X=se.sortIndex-ue.sortIndex;return X!==0?X:se.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],f=[],h=1,g=null,y=3,w=!1,S=!1,D=!1,I=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(se){for(var ue=n(f);ue!==null;){if(ue.callback===null)r(f);else if(ue.startTime<=se)r(f),ue.sortIndex=ue.expirationTime,t(c,ue);else break;ue=n(f)}}function k(se){if(D=!1,B(se),!S)if(n(c)!==null)S=!0,$(R);else{var ue=n(f);ue!==null&&he(k,ue.startTime-se)}}function R(se,ue){S=!1,D&&(D=!1,M(V),V=-1),w=!0;var X=y;try{for(B(ue),g=n(c);g!==null&&(!(g.expirationTime>ue)||se&&!Q());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,y=g.priorityLevel;var De=oe(g.expirationTime<=ue);ue=e.unstable_now(),typeof De=="function"?g.callback=De:g===n(c)&&r(c),B(ue)}else r(c);g=n(c)}if(g!==null)var je=!0;else{var Re=n(f);Re!==null&&he(k,Re.startTime-ue),je=!1}return je}finally{g=null,y=X,w=!1}}var L=!1,_=null,V=-1,U=5,Z=-1;function Q(){return!(e.unstable_now()-Zse||125oe?(se.sortIndex=X,t(f,se),n(c)===null&&se===n(f)&&(D?(M(V),V=-1):D=!0,he(k,X-oe))):(se.sortIndex=De,t(c,se),S||w||(S=!0,$(R))),se},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(se){var ue=y;return function(){var X=y;y=ue;try{return se.apply(this,arguments)}finally{y=X}}}}(FS)),FS}var mx;function JH(){return mx||(mx=1,AS.exports=GH()),AS.exports}var gx;function KH(){if(gx)return Jo;gx=1;var e=P,t=JH();function n(s){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+s,m=1;m"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},g={};function y(s){return c.call(g,s)?!0:c.call(h,s)?!1:f.test(s)?g[s]=!0:(h[s]=!0,!1)}function w(s,u,m,b){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function S(s,u,m,b){if(u===null||typeof u>"u"||w(s,u,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function D(s,u,m,b,C,O,W){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=b,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=s,this.type=u,this.sanitizeURL=O,this.removeEmptyString=W}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){I[s]=new D(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var u=s[0];I[u]=new D(u,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){I[s]=new D(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){I[s]=new D(s,2,!1,s,null,!1,!1)}),"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(s){I[s]=new D(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){I[s]=new D(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){I[s]=new D(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){I[s]=new D(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){I[s]=new D(s,5,!1,s.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function N(s){return s[1].toUpperCase()}"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(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var u=s.replace(M,N);I[u]=new D(u,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){I[s]=new D(s,1,!1,s.toLowerCase(),null,!1,!1)}),I.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){I[s]=new D(s,1,!1,s.toLowerCase(),null,!0,!0)});function B(s,u,m,b){var C=I.hasOwnProperty(u)?I[u]:null;(C!==null?C.type!==0:b||!(2ue||C[W]!==O[ue]){var ge=` -`+C[W].replace(" at new "," at ");return s.displayName&&ge.includes("")&&(ge=ge.replace("",s.displayName)),ge}while(1<=W&&0<=ue);break}}}finally{je=!1,Error.prepareStackTrace=m}return(s=s?s.displayName||s.name:"")?De(s):""}function Fe(s){switch(s.tag){case 5:return De(s.type);case 16:return De("Lazy");case 13:return De("Suspense");case 19:return De("SuspenseList");case 0:case 2:case 15:return s=Re(s.type,!1),s;case 11:return s=Re(s.type.render,!1),s;case 1:return s=Re(s.type,!0),s;default:return""}}function Be(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case R:return"Fragment";case L:return"Portal";case Y:return"Profiler";case V:return"StrictMode";case le:return"Suspense";case se:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case Q:return(s.displayName||"Context")+".Consumer";case Z:return(s._context.displayName||"Context")+".Provider";case G:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case fe:return u=s.displayName||null,u!==null?u:Be(s.type)||"Memo";case $:u=s._payload,s=s._init;try{return Be(s(u))}catch{}}return null}function Xe(s){var u=s.type;switch(s.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=u.render,s=s.displayName||s.name||"",u.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Be(u);case 8:return u===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function Ze(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function st(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Ct(s){var u=st(s)?"checked":"value",m=Object.getOwnPropertyDescriptor(s.constructor.prototype,u),b=""+s[u];if(!s.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,O=m.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return C.call(this)},set:function(W){b=""+W,O.call(this,W)}}),Object.defineProperty(s,u,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(W){b=""+W},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function tn(s){s._valueTracker||(s._valueTracker=Ct(s))}function _e(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var m=u.getValue(),b="";return s&&(b=st(s)?s.checked?"true":"false":s.value),s=b,s!==m?(u.setValue(s),!0):!1}function et(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function nt(s,u){var m=u.checked;return X({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??s._wrapperState.initialChecked})}function ht(s,u){var m=u.defaultValue==null?"":u.defaultValue,b=u.checked!=null?u.checked:u.defaultChecked;m=Ze(u.value!=null?u.value:m),s._wrapperState={initialChecked:b,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function St(s,u){u=u.checked,u!=null&&_(s,"checked",u,!1)}function Tt(s,u){St(s,u);var m=Ze(u.value),b=u.type;if(m!=null)b==="number"?(m===0&&s.value===""||s.value!=m)&&(s.value=""+m):s.value!==""+m&&(s.value=""+m);else if(b==="submit"||b==="reset"){s.removeAttribute("value");return}u.hasOwnProperty("value")?_t(s,u.type,m):u.hasOwnProperty("defaultValue")&&_t(s,u.type,Ze(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(s.defaultChecked=!!u.defaultChecked)}function Gt(s,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var b=u.type;if(!(b!=="submit"&&b!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+s._wrapperState.initialValue,m||u===s.value||(s.value=u),s.defaultValue=u}m=s.name,m!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,m!==""&&(s.name=m)}function _t(s,u,m){(u!=="number"||et(s.ownerDocument)!==s)&&(m==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+m&&(s.defaultValue=""+m))}var Vt=Array.isArray;function Xt(s,u,m,b){if(s=s.options,u){u={};for(var C=0;C"+u.valueOf().toString()+"",u=Mt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}});function sn(s,u){if(u){var m=s.firstChild;if(m&&m===s.lastChild&&m.nodeType===3){m.nodeValue=u;return}}s.textContent=u}var ln={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vr=["Webkit","ms","Moz","O"];Object.keys(ln).forEach(function(s){vr.forEach(function(u){u=u+s.charAt(0).toUpperCase()+s.substring(1),ln[u]=ln[s]})});function fr(s,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||ln.hasOwnProperty(s)&&ln[s]?(""+u).trim():u+"px"}function ha(s,u){s=s.style;for(var m in u)if(u.hasOwnProperty(m)){var b=m.indexOf("--")===0,C=fr(m,u[m],b);m==="float"&&(m="cssFloat"),b?s.setProperty(m,C):s[m]=C}}var jr=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nr(s,u){if(u){if(jr[s]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function Lr(s,u){if(s.indexOf("-")===-1)return typeof u.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var te=null;function me(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var xe=null,Ye=null,He=null;function Qe(s){if(s=ga(s)){if(typeof xe!="function")throw Error(n(280));var u=s.stateNode;u&&(u=th(u),xe(s.stateNode,s.type,u))}}function tt(s){Ye?He?He.push(s):He=[s]:Ye=s}function kt(){if(Ye){var s=Ye,u=He;if(He=Ye=null,Qe(s),u)for(s=0;s>>=0,s===0?32:31-(Js(s)/Ks|0)|0}var po=64,hs=4194304;function ci(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function mo(s,u){var m=s.pendingLanes;if(m===0)return 0;var b=0,C=s.suspendedLanes,O=s.pingedLanes,W=m&268435455;if(W!==0){var ue=W&~C;ue!==0?b=ci(ue):(O&=W,O!==0&&(b=ci(O)))}else W=m&~C,W!==0?b=ci(W):O!==0&&(b=ci(O));if(b===0)return 0;if(u!==0&&u!==b&&!(u&C)&&(C=b&-b,O=u&-u,C>=O||C===16&&(O&4194240)!==0))return u;if(b&4&&(b|=m&16),u=s.entangledLanes,u!==0)for(s=s.entanglements,u&=b;0m;m++)u.push(s);return u}function Ie(s,u,m){s.pendingLanes|=u,u!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,u=31-Rr(u),s[u]=m}function Ue(s,u){var m=s.pendingLanes&~u;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=u,s.mutableReadLanes&=u,s.entangledLanes&=u,u=s.entanglements;var b=s.eventTimes;for(s=s.expirationTimes;0=Rt),Ka=" ",Qa=!1;function pu(s,u){switch(s){case"keyup":return It.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bi=!1;function dc(s,u){switch(s){case"compositionend":return vd(u);case"keypress":return u.which!==32?null:(Qa=!0,Ka);case"textInput":return s=u.data,s===Ka&&Qa?null:s;default:return null}}function P1(s,u){if(Bi)return s==="compositionend"||!Kt&&pu(s,u)?(s=hd(),Lo=nl=zn=null,Bi=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:m,offset:u-s};s=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Qt(m)}}function Mr(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?Mr(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function Yn(){for(var s=window,u=et();u instanceof s.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)s=u.contentWindow;else break;u=et(s.document)}return u}function yd(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}function H1(s){var u=Yn(),m=s.focusedElem,b=s.selectionRange;if(u!==m&&m&&m.ownerDocument&&Mr(m.ownerDocument.documentElement,m)){if(b!==null&&yd(m)){if(u=b.start,s=b.end,s===void 0&&(s=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(s,m.value.length);else if(s=(u=m.ownerDocument||document)&&u.defaultView||window,s.getSelection){s=s.getSelection();var C=m.textContent.length,O=Math.min(b.start,C);b=b.end===void 0?O:Math.min(b.end,C),!s.extend&&O>b&&(C=b,b=O,O=C),C=Dn(m,O);var W=Dn(m,b);C&&W&&(s.rangeCount!==1||s.anchorNode!==C.node||s.anchorOffset!==C.offset||s.focusNode!==W.node||s.focusOffset!==W.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),s.removeAllRanges(),O>b?(s.addRange(u),s.extend(W.node,W.offset)):(u.setEnd(W.node,W.offset),s.addRange(u)))}}for(u=[],s=m;s=s.parentNode;)s.nodeType===1&&u.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m=document.documentMode,ws=null,pm=null,Hi=null,hc=!1;function wd(s,u,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;hc||ws==null||ws!==et(b)||(b=ws,"selectionStart"in b&&yd(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Hi&&vt(Hi,b)||(Hi=b,b=Kf(pm,"onSelect"),0Sc||(s.current=wm[Sc],wm[Sc]=null,Sc--)}function qn(s,u){Sc++,wm[Sc]=s.current,s.current=u}var fl={},va=Xa(fl),eo=Xa(!1),_a=fl;function Dc(s,u){var m=s.type.contextTypes;if(!m)return fl;var b=s.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var C={},O;for(O in m)C[O]=u[O];return b&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=u,s.__reactInternalMemoizedMaskedChildContext=C),C}function to(s){return s=s.childContextTypes,s!=null}function nh(){Qn(eo),Qn(va)}function My(s,u,m){if(va.current!==fl)throw Error(n(168));qn(va,u),qn(eo,m)}function ky(s,u,m){var b=s.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var C in b)if(!(C in u))throw Error(n(108,Xe(s)||"Unknown",C));return X({},m,b)}function Ho(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||fl,_a=va.current,qn(va,s),qn(eo,eo.current),!0}function Ny(s,u,m){var b=s.stateNode;if(!b)throw Error(n(169));m?(s=ky(s,u,_a),b.__reactInternalMemoizedMergedChildContext=s,Qn(eo),Qn(va),qn(va,s)):Qn(eo),qn(eo,m)}var Ds=null,rh=!1,bm=!1;function Ay(s){Ds===null?Ds=[s]:Ds.push(s)}function wu(s){rh=!0,Ay(s)}function hl(){if(!bm&&Ds!==null){bm=!0;var s=0,u=ct;try{var m=Ds;for(ct=1;s>=W,C-=W,zi=1<<32-Rr(u)+C|m<Wt?(Kr=jt,jt=null):Kr=jt.sibling;var In=qe(Ce,jt,Me[Wt],lt);if(In===null){jt===null&&(jt=Kr);break}s&&jt&&In.alternate===null&&u(Ce,jt),ye=O(In,ye,Wt),Pt===null?xt=In:Pt.sibling=In,Pt=In,jt=Kr}if(Wt===Me.length)return m(Ce,jt),Xn&&Su(Ce,Wt),xt;if(jt===null){for(;WtWt?(Kr=jt,jt=null):Kr=jt.sibling;var Nl=qe(Ce,jt,In.value,lt);if(Nl===null){jt===null&&(jt=Kr);break}s&&jt&&Nl.alternate===null&&u(Ce,jt),ye=O(Nl,ye,Wt),Pt===null?xt=Nl:Pt.sibling=Nl,Pt=Nl,jt=Kr}if(In.done)return m(Ce,jt),Xn&&Su(Ce,Wt),xt;if(jt===null){for(;!In.done;Wt++,In=Me.next())In=rt(Ce,In.value,lt),In!==null&&(ye=O(In,ye,Wt),Pt===null?xt=In:Pt.sibling=In,Pt=In);return Xn&&Su(Ce,Wt),xt}for(jt=b(Ce,jt);!In.done;Wt++,In=Me.next())In=yt(jt,Ce,Wt,In.value,lt),In!==null&&(s&&In.alternate!==null&&jt.delete(In.key===null?Wt:In.key),ye=O(In,ye,Wt),Pt===null?xt=In:Pt.sibling=In,Pt=In);return s&&jt.forEach(function(sS){return u(Ce,sS)}),Xn&&Su(Ce,Wt),xt}function br(Ce,ye,Me,lt){if(typeof Me=="object"&&Me!==null&&Me.type===R&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case B:e:{for(var xt=Me.key,Pt=ye;Pt!==null;){if(Pt.key===xt){if(xt=Me.type,xt===R){if(Pt.tag===7){m(Ce,Pt.sibling),ye=C(Pt,Me.props.children),ye.return=Ce,Ce=ye;break e}}else if(Pt.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===$&&hh(xt)===Pt.type){m(Ce,Pt.sibling),ye=C(Pt,Me.props),ye.ref=Ad(Ce,Pt,Me),ye.return=Ce,Ce=ye;break e}m(Ce,Pt);break}else u(Ce,Pt);Pt=Pt.sibling}Me.type===R?(ye=Au(Me.props.children,Ce.mode,lt,Me.key),ye.return=Ce,Ce=ye):(lt=Uh(Me.type,Me.key,Me.props,null,Ce.mode,lt),lt.ref=Ad(Ce,ye,Me),lt.return=Ce,Ce=lt)}return W(Ce);case L:e:{for(Pt=Me.key;ye!==null;){if(ye.key===Pt)if(ye.tag===4&&ye.stateNode.containerInfo===Me.containerInfo&&ye.stateNode.implementation===Me.implementation){m(Ce,ye.sibling),ye=C(ye,Me.children||[]),ye.return=Ce,Ce=ye;break e}else{m(Ce,ye);break}else u(Ce,ye);ye=ye.sibling}ye=cg(Me,Ce.mode,lt),ye.return=Ce,Ce=ye}return W(Ce);case $:return Pt=Me._init,br(Ce,ye,Pt(Me._payload),lt)}if(Vt(Me))return Dt(Ce,ye,Me,lt);if(ce(Me))return Et(Ce,ye,Me,lt);Fd(Ce,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"?(Me=""+Me,ye!==null&&ye.tag===6?(m(Ce,ye.sibling),ye=C(ye,Me),ye.return=Ce,Ce=ye):(m(Ce,ye),ye=ug(Me,Ce.mode,lt),ye.return=Ce,Ce=ye),W(Ce)):m(Ce,ye)}return br}var yl=_y(!0),xm=_y(!1),Ec={},yi=Xa(Ec),wl=Xa(Ec),Od=Xa(Ec);function bl(s){if(s===Ec)throw Error(n(174));return s}function ph(s,u){switch(qn(Od,u),qn(wl,s),qn(yi,Ec),s=u.nodeType,s){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:pt(null,"");break;default:s=s===8?u.parentNode:u,u=s.namespaceURI||null,s=s.tagName,u=pt(u,s)}Qn(yi),qn(yi,u)}function Cc(){Qn(yi),Qn(wl),Qn(Od)}function Mm(s){bl(Od.current);var u=bl(yi.current),m=pt(u,s.type);u!==m&&(qn(wl,s),qn(yi,m))}function km(s){wl.current===s&&(Qn(yi),Qn(wl))}var er=Xa(0);function Pd(s){for(var u=s;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var jd=[];function Nm(){for(var s=0;sm?m:4,s(!0);var b=rn.transition;rn.transition={};try{s(!1),u()}finally{ct=m,rn.transition=b}}function _d(){return Yr().memoizedState}function Ac(s,u,m){var b=Cl(s);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},_m(s))Vy(u,m);else if(m=ba(s,u,m,b),m!==null){var C=Ua();Si(m,s,b,C),Bm(m,u,b)}}function zy(s,u,m){var b=Cl(s),C={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(_m(s))Vy(u,C);else{var O=s.alternate;if(s.lanes===0&&(O===null||O.lanes===0)&&(O=u.lastRenderedReducer,O!==null))try{var W=u.lastRenderedState,ue=O(W,m);if(C.hasEagerState=!0,C.eagerState=ue,Oe(ue,W)){var ge=u.interleaved;ge===null?(C.next=C,uh(u)):(C.next=ge.next,ge.next=C),u.interleaved=C;return}}catch{}m=ba(s,u,C,b),m!==null&&(C=Ua(),Si(m,s,b,C),Bm(m,u,b))}}function _m(s){var u=s.alternate;return s===or||u!==null&&u===or}function Vy(s,u){Ld=mh=!0;var m=s.pending;m===null?u.next=u:(u.next=m.next,m.next=u),s.pending=u}function Bm(s,u,m){if(m&4194240){var b=u.lanes;b&=s.pendingLanes,m|=b,u.lanes=m,it(s,m)}}var Cs={readContext:Ba,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},Bd={readContext:Ba,useCallback:function(s,u){return hr().memoizedState=[s,u===void 0?null:u],s},useContext:Ba,useEffect:Hy,useImperativeHandle:function(s,u,m){return m=m!=null?m.concat([s]):null,Nc(4194308,4,Yy.bind(null,u,s),m)},useLayoutEffect:function(s,u){return Nc(4194308,4,s,u)},useInsertionEffect:function(s,u){return Nc(4,2,s,u)},useMemo:function(s,u){var m=hr();return u=u===void 0?null:u,s=s(),m.memoizedState=[s,u],s},useReducer:function(s,u,m){var b=hr();return u=m!==void 0?m(u):u,b.memoizedState=b.baseState=u,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:u},b.queue=s,s=s.dispatch=Ac.bind(null,or,s),[b.memoizedState,s]},useRef:function(s){var u=hr();return s={current:s},u.memoizedState=s},useState:Es,useDebugValue:Th,useDeferredValue:function(s){return hr().memoizedState=s},useTransition:function(){var s=Es(!1),u=s[0];return s=z1.bind(null,s[1]),hr().memoizedState=s,[u,s]},useMutableSource:function(){},useSyncExternalStore:function(s,u,m){var b=or,C=hr();if(Xn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jr===null)throw Error(n(349));Eu&30||Fm(b,u,m)}C.memoizedState=m;var O={value:m,getSnapshot:u};return C.queue=O,Hy(Sh.bind(null,b,O,s),[s]),b.flags|=2048,kc(9,bh.bind(null,b,O,m,u),void 0,null),m},useId:function(){var s=hr(),u=Jr.identifierPrefix;if(Xn){var m=Vi,b=zi;m=(b&~(1<<32-Rr(b)-1)).toString(32)+m,u=":"+u+"R"+m,m=Sa++,0le||C[W]!==O[le]){var ge=` +`+C[W].replace(" at new "," at ");return s.displayName&&ge.includes("")&&(ge=ge.replace("",s.displayName)),ge}while(1<=W&&0<=le);break}}}finally{je=!1,Error.prepareStackTrace=m}return(s=s?s.displayName||s.name:"")?De(s):""}function Fe(s){switch(s.tag){case 5:return De(s.type);case 16:return De("Lazy");case 13:return De("Suspense");case 19:return De("SuspenseList");case 0:case 2:case 15:return s=Re(s.type,!1),s;case 11:return s=Re(s.type.render,!1),s;case 1:return s=Re(s.type,!0),s;default:return""}}function Be(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case _:return"Fragment";case L:return"Portal";case U:return"Profiler";case V:return"StrictMode";case re:return"Suspense";case de:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case Q:return(s.displayName||"Context")+".Consumer";case Z:return(s._context.displayName||"Context")+".Provider";case G:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case fe:return u=s.displayName||null,u!==null?u:Be(s.type)||"Memo";case $:u=s._payload,s=s._init;try{return Be(s(u))}catch{}}return null}function Xe(s){var u=s.type;switch(s.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=u.render,s=s.displayName||s.name||"",u.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Be(u);case 8:return u===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function Ze(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function st(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Ct(s){var u=st(s)?"checked":"value",m=Object.getOwnPropertyDescriptor(s.constructor.prototype,u),b=""+s[u];if(!s.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,O=m.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return C.call(this)},set:function(W){b=""+W,O.call(this,W)}}),Object.defineProperty(s,u,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(W){b=""+W},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function tn(s){s._valueTracker||(s._valueTracker=Ct(s))}function _e(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var m=u.getValue(),b="";return s&&(b=st(s)?s.checked?"true":"false":s.value),s=b,s!==m?(u.setValue(s),!0):!1}function et(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function nt(s,u){var m=u.checked;return X({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??s._wrapperState.initialChecked})}function ht(s,u){var m=u.defaultValue==null?"":u.defaultValue,b=u.checked!=null?u.checked:u.defaultChecked;m=Ze(u.value!=null?u.value:m),s._wrapperState={initialChecked:b,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function St(s,u){u=u.checked,u!=null&&B(s,"checked",u,!1)}function Tt(s,u){St(s,u);var m=Ze(u.value),b=u.type;if(m!=null)b==="number"?(m===0&&s.value===""||s.value!=m)&&(s.value=""+m):s.value!==""+m&&(s.value=""+m);else if(b==="submit"||b==="reset"){s.removeAttribute("value");return}u.hasOwnProperty("value")?_t(s,u.type,m):u.hasOwnProperty("defaultValue")&&_t(s,u.type,Ze(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(s.defaultChecked=!!u.defaultChecked)}function Gt(s,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var b=u.type;if(!(b!=="submit"&&b!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+s._wrapperState.initialValue,m||u===s.value||(s.value=u),s.defaultValue=u}m=s.name,m!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,m!==""&&(s.name=m)}function _t(s,u,m){(u!=="number"||et(s.ownerDocument)!==s)&&(m==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+m&&(s.defaultValue=""+m))}var Vt=Array.isArray;function Xt(s,u,m,b){if(s=s.options,u){u={};for(var C=0;C"+u.valueOf().toString()+"",u=Mt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}});function sn(s,u){if(u){var m=s.firstChild;if(m&&m===s.lastChild&&m.nodeType===3){m.nodeValue=u;return}}s.textContent=u}var ln={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vr=["Webkit","ms","Moz","O"];Object.keys(ln).forEach(function(s){vr.forEach(function(u){u=u+s.charAt(0).toUpperCase()+s.substring(1),ln[u]=ln[s]})});function fr(s,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||ln.hasOwnProperty(s)&&ln[s]?(""+u).trim():u+"px"}function ha(s,u){s=s.style;for(var m in u)if(u.hasOwnProperty(m)){var b=m.indexOf("--")===0,C=fr(m,u[m],b);m==="float"&&(m="cssFloat"),b?s.setProperty(m,C):s[m]=C}}var jr=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function nr(s,u){if(u){if(jr[s]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function Lr(s,u){if(s.indexOf("-")===-1)return typeof u.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var te=null;function me(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var xe=null,Ue=null,He=null;function Qe(s){if(s=ga(s)){if(typeof xe!="function")throw Error(n(280));var u=s.stateNode;u&&(u=th(u),xe(s.stateNode,s.type,u))}}function tt(s){Ue?He?He.push(s):He=[s]:Ue=s}function kt(){if(Ue){var s=Ue,u=He;if(He=Ue=null,Qe(s),u)for(s=0;s>>=0,s===0?32:31-(Js(s)/Ks|0)|0}var po=64,hs=4194304;function ci(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function mo(s,u){var m=s.pendingLanes;if(m===0)return 0;var b=0,C=s.suspendedLanes,O=s.pingedLanes,W=m&268435455;if(W!==0){var le=W&~C;le!==0?b=ci(le):(O&=W,O!==0&&(b=ci(O)))}else W=m&~C,W!==0?b=ci(W):O!==0&&(b=ci(O));if(b===0)return 0;if(u!==0&&u!==b&&!(u&C)&&(C=b&-b,O=u&-u,C>=O||C===16&&(O&4194240)!==0))return u;if(b&4&&(b|=m&16),u=s.entangledLanes,u!==0)for(s=s.entanglements,u&=b;0m;m++)u.push(s);return u}function Ie(s,u,m){s.pendingLanes|=u,u!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,u=31-Rr(u),s[u]=m}function Ye(s,u){var m=s.pendingLanes&~u;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=u,s.mutableReadLanes&=u,s.entangledLanes&=u,u=s.entanglements;var b=s.eventTimes;for(s=s.expirationTimes;0=Rt),Ka=" ",Qa=!1;function pu(s,u){switch(s){case"keyup":return It.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vd(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Bi=!1;function dc(s,u){switch(s){case"compositionend":return vd(u);case"keypress":return u.which!==32?null:(Qa=!0,Ka);case"textInput":return s=u.data,s===Ka&&Qa?null:s;default:return null}}function P1(s,u){if(Bi)return s==="compositionend"||!Kt&&pu(s,u)?(s=hd(),Lo=nl=zn=null,Bi=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:m,offset:u-s};s=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=Qt(m)}}function Mr(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?Mr(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function Un(){for(var s=window,u=et();u instanceof s.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)s=u.contentWindow;else break;u=et(s.document)}return u}function yd(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}function H1(s){var u=Un(),m=s.focusedElem,b=s.selectionRange;if(u!==m&&m&&m.ownerDocument&&Mr(m.ownerDocument.documentElement,m)){if(b!==null&&yd(m)){if(u=b.start,s=b.end,s===void 0&&(s=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(s,m.value.length);else if(s=(u=m.ownerDocument||document)&&u.defaultView||window,s.getSelection){s=s.getSelection();var C=m.textContent.length,O=Math.min(b.start,C);b=b.end===void 0?O:Math.min(b.end,C),!s.extend&&O>b&&(C=b,b=O,O=C),C=Tn(m,O);var W=Tn(m,b);C&&W&&(s.rangeCount!==1||s.anchorNode!==C.node||s.anchorOffset!==C.offset||s.focusNode!==W.node||s.focusOffset!==W.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),s.removeAllRanges(),O>b?(s.addRange(u),s.extend(W.node,W.offset)):(u.setEnd(W.node,W.offset),s.addRange(u)))}}for(u=[],s=m;s=s.parentNode;)s.nodeType===1&&u.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m=document.documentMode,ws=null,pm=null,Hi=null,hc=!1;function wd(s,u,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;hc||ws==null||ws!==et(b)||(b=ws,"selectionStart"in b&&yd(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Hi&&vt(Hi,b)||(Hi=b,b=Kf(pm,"onSelect"),0Sc||(s.current=wm[Sc],wm[Sc]=null,Sc--)}function qn(s,u){Sc++,wm[Sc]=s.current,s.current=u}var fl={},va=Xa(fl),eo=Xa(!1),_a=fl;function Dc(s,u){var m=s.type.contextTypes;if(!m)return fl;var b=s.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var C={},O;for(O in m)C[O]=u[O];return b&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=u,s.__reactInternalMemoizedMaskedChildContext=C),C}function to(s){return s=s.childContextTypes,s!=null}function nh(){Qn(eo),Qn(va)}function My(s,u,m){if(va.current!==fl)throw Error(n(168));qn(va,u),qn(eo,m)}function ky(s,u,m){var b=s.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var C in b)if(!(C in u))throw Error(n(108,Xe(s)||"Unknown",C));return X({},m,b)}function Ho(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||fl,_a=va.current,qn(va,s),qn(eo,eo.current),!0}function Ny(s,u,m){var b=s.stateNode;if(!b)throw Error(n(169));m?(s=ky(s,u,_a),b.__reactInternalMemoizedMergedChildContext=s,Qn(eo),Qn(va),qn(va,s)):Qn(eo),qn(eo,m)}var Ds=null,rh=!1,bm=!1;function Ay(s){Ds===null?Ds=[s]:Ds.push(s)}function wu(s){rh=!0,Ay(s)}function hl(){if(!bm&&Ds!==null){bm=!0;var s=0,u=ct;try{var m=Ds;for(ct=1;s>=W,C-=W,zi=1<<32-Rr(u)+C|m<Wt?(Kr=jt,jt=null):Kr=jt.sibling;var En=qe(Ce,jt,Me[Wt],lt);if(En===null){jt===null&&(jt=Kr);break}s&&jt&&En.alternate===null&&u(Ce,jt),ye=O(En,ye,Wt),Pt===null?xt=En:Pt.sibling=En,Pt=En,jt=Kr}if(Wt===Me.length)return m(Ce,jt),Xn&&Su(Ce,Wt),xt;if(jt===null){for(;WtWt?(Kr=jt,jt=null):Kr=jt.sibling;var Nl=qe(Ce,jt,En.value,lt);if(Nl===null){jt===null&&(jt=Kr);break}s&&jt&&Nl.alternate===null&&u(Ce,jt),ye=O(Nl,ye,Wt),Pt===null?xt=Nl:Pt.sibling=Nl,Pt=Nl,jt=Kr}if(En.done)return m(Ce,jt),Xn&&Su(Ce,Wt),xt;if(jt===null){for(;!En.done;Wt++,En=Me.next())En=rt(Ce,En.value,lt),En!==null&&(ye=O(En,ye,Wt),Pt===null?xt=En:Pt.sibling=En,Pt=En);return Xn&&Su(Ce,Wt),xt}for(jt=b(Ce,jt);!En.done;Wt++,En=Me.next())En=yt(jt,Ce,Wt,En.value,lt),En!==null&&(s&&En.alternate!==null&&jt.delete(En.key===null?Wt:En.key),ye=O(En,ye,Wt),Pt===null?xt=En:Pt.sibling=En,Pt=En);return s&&jt.forEach(function(sS){return u(Ce,sS)}),Xn&&Su(Ce,Wt),xt}function br(Ce,ye,Me,lt){if(typeof Me=="object"&&Me!==null&&Me.type===_&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case R:e:{for(var xt=Me.key,Pt=ye;Pt!==null;){if(Pt.key===xt){if(xt=Me.type,xt===_){if(Pt.tag===7){m(Ce,Pt.sibling),ye=C(Pt,Me.props.children),ye.return=Ce,Ce=ye;break e}}else if(Pt.elementType===xt||typeof xt=="object"&&xt!==null&&xt.$$typeof===$&&hh(xt)===Pt.type){m(Ce,Pt.sibling),ye=C(Pt,Me.props),ye.ref=Ad(Ce,Pt,Me),ye.return=Ce,Ce=ye;break e}m(Ce,Pt);break}else u(Ce,Pt);Pt=Pt.sibling}Me.type===_?(ye=Au(Me.props.children,Ce.mode,lt,Me.key),ye.return=Ce,Ce=ye):(lt=Yh(Me.type,Me.key,Me.props,null,Ce.mode,lt),lt.ref=Ad(Ce,ye,Me),lt.return=Ce,Ce=lt)}return W(Ce);case L:e:{for(Pt=Me.key;ye!==null;){if(ye.key===Pt)if(ye.tag===4&&ye.stateNode.containerInfo===Me.containerInfo&&ye.stateNode.implementation===Me.implementation){m(Ce,ye.sibling),ye=C(ye,Me.children||[]),ye.return=Ce,Ce=ye;break e}else{m(Ce,ye);break}else u(Ce,ye);ye=ye.sibling}ye=cg(Me,Ce.mode,lt),ye.return=Ce,Ce=ye}return W(Ce);case $:return Pt=Me._init,br(Ce,ye,Pt(Me._payload),lt)}if(Vt(Me))return Dt(Ce,ye,Me,lt);if(ue(Me))return Et(Ce,ye,Me,lt);Fd(Ce,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"?(Me=""+Me,ye!==null&&ye.tag===6?(m(Ce,ye.sibling),ye=C(ye,Me),ye.return=Ce,Ce=ye):(m(Ce,ye),ye=ug(Me,Ce.mode,lt),ye.return=Ce,Ce=ye),W(Ce)):m(Ce,ye)}return br}var yl=_y(!0),xm=_y(!1),Ec={},yi=Xa(Ec),wl=Xa(Ec),Od=Xa(Ec);function bl(s){if(s===Ec)throw Error(n(174));return s}function ph(s,u){switch(qn(Od,u),qn(wl,s),qn(yi,Ec),s=u.nodeType,s){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:pt(null,"");break;default:s=s===8?u.parentNode:u,u=s.namespaceURI||null,s=s.tagName,u=pt(u,s)}Qn(yi),qn(yi,u)}function Cc(){Qn(yi),Qn(wl),Qn(Od)}function Mm(s){bl(Od.current);var u=bl(yi.current),m=pt(u,s.type);u!==m&&(qn(wl,s),qn(yi,m))}function km(s){wl.current===s&&(Qn(yi),Qn(wl))}var er=Xa(0);function Pd(s){for(var u=s;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var jd=[];function Nm(){for(var s=0;sm?m:4,s(!0);var b=rn.transition;rn.transition={};try{s(!1),u()}finally{ct=m,rn.transition=b}}function _d(){return Ur().memoizedState}function Ac(s,u,m){var b=Cl(s);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},_m(s))Vy(u,m);else if(m=ba(s,u,m,b),m!==null){var C=Ya();Si(m,s,b,C),Bm(m,u,b)}}function zy(s,u,m){var b=Cl(s),C={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(_m(s))Vy(u,C);else{var O=s.alternate;if(s.lanes===0&&(O===null||O.lanes===0)&&(O=u.lastRenderedReducer,O!==null))try{var W=u.lastRenderedState,le=O(W,m);if(C.hasEagerState=!0,C.eagerState=le,Oe(le,W)){var ge=u.interleaved;ge===null?(C.next=C,uh(u)):(C.next=ge.next,ge.next=C),u.interleaved=C;return}}catch{}m=ba(s,u,C,b),m!==null&&(C=Ya(),Si(m,s,b,C),Bm(m,u,b))}}function _m(s){var u=s.alternate;return s===or||u!==null&&u===or}function Vy(s,u){Ld=mh=!0;var m=s.pending;m===null?u.next=u:(u.next=m.next,m.next=u),s.pending=u}function Bm(s,u,m){if(m&4194240){var b=u.lanes;b&=s.pendingLanes,m|=b,u.lanes=m,it(s,m)}}var Cs={readContext:Ba,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},Bd={readContext:Ba,useCallback:function(s,u){return hr().memoizedState=[s,u===void 0?null:u],s},useContext:Ba,useEffect:Hy,useImperativeHandle:function(s,u,m){return m=m!=null?m.concat([s]):null,Nc(4194308,4,Uy.bind(null,u,s),m)},useLayoutEffect:function(s,u){return Nc(4194308,4,s,u)},useInsertionEffect:function(s,u){return Nc(4,2,s,u)},useMemo:function(s,u){var m=hr();return u=u===void 0?null:u,s=s(),m.memoizedState=[s,u],s},useReducer:function(s,u,m){var b=hr();return u=m!==void 0?m(u):u,b.memoizedState=b.baseState=u,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:u},b.queue=s,s=s.dispatch=Ac.bind(null,or,s),[b.memoizedState,s]},useRef:function(s){var u=hr();return s={current:s},u.memoizedState=s},useState:Es,useDebugValue:Th,useDeferredValue:function(s){return hr().memoizedState=s},useTransition:function(){var s=Es(!1),u=s[0];return s=z1.bind(null,s[1]),hr().memoizedState=s,[u,s]},useMutableSource:function(){},useSyncExternalStore:function(s,u,m){var b=or,C=hr();if(Xn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Jr===null)throw Error(n(349));Eu&30||Fm(b,u,m)}C.memoizedState=m;var O={value:m,getSnapshot:u};return C.queue=O,Hy(Sh.bind(null,b,O,s),[s]),b.flags|=2048,kc(9,bh.bind(null,b,O,m,u),void 0,null),m},useId:function(){var s=hr(),u=Jr.identifierPrefix;if(Xn){var m=Vi,b=zi;m=(b&~(1<<32-Rr(b)-1)).toString(32)+m,u=":"+u+"R"+m,m=Sa++,0<\/script>",s=s.removeChild(s.firstChild)):typeof b.is=="string"?s=W.createElement(m,{is:b.is}):(s=W.createElement(m),m==="select"&&(W=s,b.multiple?W.multiple=!0:b.size&&(W.size=b.size))):s=W.createElementNS(s,m),s[Yi]=u,s[dl]=b,Ky(s,u,!1,!1),u.stateNode=s;e:{switch(W=Lr(m,b),m){case"dialog":Kn("cancel",s),Kn("close",s),C=b;break;case"iframe":case"object":case"embed":Kn("load",s),C=b;break;case"video":case"audio":for(C=0;CBc&&(u.flags|=128,b=!0,Pc(O,!1),u.lanes=4194304)}else{if(!b)if(s=Pd(W),s!==null){if(u.flags|=128,b=!0,m=s.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Pc(O,!0),O.tail===null&&O.tailMode==="hidden"&&!W.alternate&&!Xn)return Ia(u),null}else 2*An()-O.renderingStartTime>Bc&&m!==1073741824&&(u.flags|=128,b=!0,Pc(O,!1),u.lanes=4194304);O.isBackwards?(W.sibling=u.child,u.child=W):(m=O.last,m!==null?m.sibling=W:u.child=W,O.last=W)}return O.tail!==null?(u=O.tail,O.rendering=u,O.tail=u.sibling,O.renderingStartTime=An(),u.sibling=null,m=er.current,qn(er,b?m&1|2:m&1),u):(Ia(u),null);case 22:case 23:return og(),b=u.memoizedState!==null,s!==null&&s.memoizedState!==null!==b&&(u.flags|=8192),b&&u.mode&1?Io&1073741824&&(Ia(u),u.subtreeFlags&6&&(u.flags|=8192)):Ia(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function $1(s,u){switch(Du(u),u.tag){case 1:return to(u.type)&&nh(),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Cc(),Qn(eo),Qn(va),Nm(),s=u.flags,s&65536&&!(s&128)?(u.flags=s&-65537|128,u):null;case 5:return km(u),null;case 13:if(Qn(er),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(n(340));$i()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return Qn(er),null;case 4:return Cc(),null;case 10:return lh(u.type._context),null;case 22:case 23:return og(),null;case 24:return null;default:return null}}var Vo=!1,Fn=!1,Zm=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Dl(s,u){var m=s.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){pr(s,u,b)}else m.current=null}function qm(s,u,m){try{m()}catch(b){pr(s,u,b)}}var Xy=!1;function Wd(s,u){if(Ed=vo,s=Yn(),yd(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var C=b.anchorOffset,O=b.focusNode;b=b.focusOffset;try{m.nodeType,O.nodeType}catch{m=null;break e}var W=0,ue=-1,ge=-1,Pe=0,Ge=0,rt=s,qe=null;t:for(;;){for(var yt;rt!==m||C!==0&&rt.nodeType!==3||(ue=W+C),rt!==O||b!==0&&rt.nodeType!==3||(ge=W+b),rt.nodeType===3&&(W+=rt.nodeValue.length),(yt=rt.firstChild)!==null;)qe=rt,rt=yt;for(;;){if(rt===s)break t;if(qe===m&&++Pe===C&&(ue=W),qe===O&&++Ge===b&&(ge=W),(yt=rt.nextSibling)!==null)break;rt=qe,qe=rt.parentNode}rt=yt}m=ue===-1||ge===-1?null:{start:ue,end:ge}}else m=null}m=m||{start:0,end:0}}else m=null;for(yu={focusedElem:s,selectionRange:m},vo=!1,wt=u;wt!==null;)if(u=wt,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,wt=s;else for(;wt!==null;){u=wt;try{var Dt=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Dt!==null){var Et=Dt.memoizedProps,br=Dt.memoizedState,Ce=u.stateNode,ye=Ce.getSnapshotBeforeUpdate(u.elementType===u.type?Et:mi(u.type,Et),br);Ce.__reactInternalSnapshotBeforeUpdate=ye}break;case 3:var Me=u.stateNode.containerInfo;Me.nodeType===1?Me.textContent="":Me.nodeType===9&&Me.documentElement&&Me.removeChild(Me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(lt){pr(u,u.return,lt)}if(s=u.sibling,s!==null){s.return=u.return,wt=s;break}wt=u.return}return Dt=Xy,Xy=!1,Dt}function jc(s,u,m){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&s)===s){var O=C.destroy;C.destroy=void 0,O!==void 0&&qm(u,m,O)}C=C.next}while(C!==b)}}function $d(s,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&s)===s){var b=m.create;m.destroy=b()}m=m.next}while(m!==u)}}function Gm(s){var u=s.ref;if(u!==null){var m=s.stateNode;switch(s.tag){case 5:s=m;break;default:s=m}typeof u=="function"?u(s):u.current=s}}function e0(s){var u=s.alternate;u!==null&&(s.alternate=null,e0(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&(delete u[Yi],delete u[dl],delete u[eh],delete u[J],delete u[bc])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function t0(s){return s.tag===5||s.tag===3||s.tag===4}function n0(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||t0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Ah(s,u,m){var b=s.tag;if(b===5||b===6)s=s.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(s,u):m.insertBefore(s,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(s,m)):(u=m,u.appendChild(s)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=Qf));else if(b!==4&&(s=s.child,s!==null))for(Ah(s,u,m),s=s.sibling;s!==null;)Ah(s,u,m),s=s.sibling}function Fh(s,u,m){var b=s.tag;if(b===5||b===6)s=s.stateNode,u?m.insertBefore(s,u):m.appendChild(s);else if(b!==4&&(s=s.child,s!==null))for(Fh(s,u,m),s=s.sibling;s!==null;)Fh(s,u,m),s=s.sibling}var ia=null,Do=!1;function Ms(s,u,m){for(m=m.child;m!==null;)Lc(s,u,m),m=m.sibling}function Lc(s,u,m){if(Pa&&typeof Pa.onCommitFiberUnmount=="function")try{Pa.onCommitFiberUnmount(ho,m)}catch{}switch(m.tag){case 5:Fn||Dl(m,u);case 6:var b=ia,C=Do;ia=null,Ms(s,u,m),ia=b,Do=C,ia!==null&&(Do?(s=ia,m=m.stateNode,s.nodeType===8?s.parentNode.removeChild(m):s.removeChild(m)):ia.removeChild(m.stateNode));break;case 18:ia!==null&&(Do?(s=ia,m=m.stateNode,s.nodeType===8?ym(s.parentNode,m):s.nodeType===1&&ym(s,m),pn(s)):ym(ia,m.stateNode));break;case 4:b=ia,C=Do,ia=m.stateNode.containerInfo,Do=!0,Ms(s,u,m),ia=b,Do=C;break;case 0:case 11:case 14:case 15:if(!Fn&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var O=C,W=O.destroy;O=O.tag,W!==void 0&&(O&2||O&4)&&qm(m,u,W),C=C.next}while(C!==b)}Ms(s,u,m);break;case 1:if(!Fn&&(Dl(m,u),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(ue){pr(m,u,ue)}Ms(s,u,m);break;case 21:Ms(s,u,m);break;case 22:m.mode&1?(Fn=(b=Fn)||m.memoizedState!==null,Ms(s,u,m),Fn=b):Ms(s,u,m);break;default:Ms(s,u,m)}}function Oh(s){var u=s.updateQueue;if(u!==null){s.updateQueue=null;var m=s.stateNode;m===null&&(m=s.stateNode=new Zm),u.forEach(function(b){var C=eS.bind(null,s,b);m.has(b)||(m.add(b),b.then(C,C))})}}function Wo(s,u){var m=u.deletions;if(m!==null)for(var b=0;bC&&(C=W),b&=~O}if(b=C,b=An()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Z1(b/1960))-b,10s?16:s,zr===null)var b=!1;else{if(s=zr,zr=null,_h=0,bn&6)throw Error(n(331));var C=bn;for(bn|=4,wt=s.current;wt!==null;){var O=wt,W=O.child;if(wt.flags&16){var ue=O.deletions;if(ue!==null){for(var ge=0;geAn()-jh?ku(s,0):Xm|=m),Ea(s,u)}function d0(s,u){u===0&&(s.mode&1?(u=hs,hs<<=1,!(hs&130023424)&&(hs=4194304)):u=1);var m=Ua();s=gi(s,u),s!==null&&(Ie(s,u,m),Ea(s,m))}function X1(s){var u=s.memoizedState,m=0;u!==null&&(m=u.retryLane),d0(s,m)}function eS(s,u){var m=0;switch(s.tag){case 13:var b=s.stateNode,C=s.memoizedState;C!==null&&(m=C.retryLane);break;case 19:b=s.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(u),d0(s,m)}var f0;f0=function(s,u,m){if(s!==null)if(s.memoizedProps!==u.pendingProps||eo.current)Da=!0;else{if(!(s.lanes&m)&&!(u.flags&128))return Da=!1,Ta(s,u,m);Da=!!(s.flags&131072)}else Da=!1,Xn&&u.flags&1048576&&Fy(u,oh,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;Oc(s,u),s=u.pendingProps;var C=Dc(u,va.current);pl(u,m),C=gh(null,u,b,s,C,m);var O=vh();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,to(b)?(O=!0,Ho(u)):O=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Dm(u),C.updater=dh,u.stateNode=C,C._reactInternals=u,Cm(u,b,s,m),u=Vm(null,u,b,!0,O,m)):(u.tag=0,Xn&&O&&Md(u),Ya(null,u,C,m),u=u.child),u;case 16:b=u.elementType;e:{switch(Oc(s,u),s=u.pendingProps,C=b._init,b=C(b._payload),u.type=b,C=u.tag=Yh(b),s=mi(b,s),C){case 0:u=xh(null,u,b,s,m);break e;case 1:u=Gy(null,u,b,s,m);break e;case 11:u=Ym(null,u,b,s,m);break e;case 14:u=qi(null,u,b,mi(b.type,s),m);break e}throw Error(n(306,b,""))}return u;case 0:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),xh(s,u,b,C,m);case 1:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Gy(s,u,b,C,m);case 3:e:{if(Gi(u),s===null)throw Error(n(387));b=u.pendingProps,O=u.memoizedState,C=O.element,jy(s,u),ch(u,b,null,m);var W=u.memoizedState;if(b=W.element,O.isDehydrated)if(O={element:b,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},u.updateQueue.baseState=O,u.memoizedState=O,u.flags&256){C=xu(Error(n(423)),u),u=Mh(s,u,b,m,C);break e}else if(b!==C){C=xu(Error(n(424)),u),u=Mh(s,u,b,m,C);break e}else for(bo=cl(u.stateNode.containerInfo.firstChild),wa=u,Xn=!0,pi=null,m=xm(u,null,b,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if($i(),b===C){u=Ji(s,u,m);break e}Ya(s,u,b,m)}u=u.child}return u;case 5:return Mm(u),s===null&&no(u),b=u.type,C=u.pendingProps,O=s!==null?s.memoizedProps:null,W=C.children,Cd(b,C)?W=null:O!==null&&Cd(b,O)&&(u.flags|=32),qy(s,u),Ya(s,u,W,m),u.child;case 6:return s===null&&no(u),null;case 13:return Vd(s,u,m);case 4:return ph(u,u.stateNode.containerInfo),b=u.pendingProps,s===null?u.child=yl(u,null,b,m):Ya(s,u,b,m),u.child;case 11:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Ym(s,u,b,C,m);case 7:return Ya(s,u,u.pendingProps,m),u.child;case 8:return Ya(s,u,u.pendingProps.children,m),u.child;case 12:return Ya(s,u,u.pendingProps.children,m),u.child;case 10:e:{if(b=u.type._context,C=u.pendingProps,O=u.memoizedProps,W=C.value,qn(Tu,b._currentValue),b._currentValue=W,O!==null)if(Oe(O.value,W)){if(O.children===C.children&&!eo.current){u=Ji(s,u,m);break e}}else for(O=u.child,O!==null&&(O.return=u);O!==null;){var ue=O.dependencies;if(ue!==null){W=O.child;for(var ge=ue.firstContext;ge!==null;){if(ge.context===b){if(O.tag===1){ge=vi(-1,m&-m),ge.tag=2;var Pe=O.updateQueue;if(Pe!==null){Pe=Pe.shared;var Ge=Pe.pending;Ge===null?ge.next=ge:(ge.next=Ge.next,Ge.next=ge),Pe.pending=ge}}O.lanes|=m,ge=O.alternate,ge!==null&&(ge.lanes|=m),zo(O.return,m,u),ue.lanes|=m;break}ge=ge.next}}else if(O.tag===10)W=O.type===u.type?null:O.child;else if(O.tag===18){if(W=O.return,W===null)throw Error(n(341));W.lanes|=m,ue=W.alternate,ue!==null&&(ue.lanes|=m),zo(W,m,u),W=O.sibling}else W=O.child;if(W!==null)W.return=O;else for(W=O;W!==null;){if(W===u){W=null;break}if(O=W.sibling,O!==null){O.return=W.return,W=O;break}W=W.return}O=W}Ya(s,u,C.children,m),u=u.child}return u;case 9:return C=u.type,b=u.pendingProps.children,pl(u,m),C=Ba(C),b=b(C),u.flags|=1,Ya(s,u,b,m),u.child;case 14:return b=u.type,C=mi(b,u.pendingProps),C=mi(b.type,C),qi(s,u,b,C,m);case 15:return Um(s,u,u.type,u.pendingProps,m);case 17:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Oc(s,u),u.tag=1,to(b)?(s=!0,Ho(u)):s=!1,pl(u,m),Em(u,b,C),Cm(u,b,C,m),Vm(null,u,b,!0,s,m);case 19:return Jy(s,u,m);case 22:return zm(s,u,m)}throw Error(n(156,u.tag))};function h0(s,u){return cs(s,u)}function tS(s,u,m,b){this.tag=s,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Eo(s,u,m,b){return new tS(s,u,m,b)}function lg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Yh(s){if(typeof s=="function")return lg(s)?1:0;if(s!=null){if(s=s.$$typeof,s===G)return 11;if(s===fe)return 14}return 2}function kl(s,u){var m=s.alternate;return m===null?(m=Eo(s.tag,u,s.key,s.mode),m.elementType=s.elementType,m.type=s.type,m.stateNode=s.stateNode,m.alternate=s,s.alternate=m):(m.pendingProps=u,m.type=s.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=s.flags&14680064,m.childLanes=s.childLanes,m.lanes=s.lanes,m.child=s.child,m.memoizedProps=s.memoizedProps,m.memoizedState=s.memoizedState,m.updateQueue=s.updateQueue,u=s.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=s.sibling,m.index=s.index,m.ref=s.ref,m}function Uh(s,u,m,b,C,O){var W=2;if(b=s,typeof s=="function")lg(s)&&(W=1);else if(typeof s=="string")W=5;else e:switch(s){case R:return Au(m.children,C,O,u);case V:W=8,C|=8;break;case Y:return s=Eo(12,m,u,C|2),s.elementType=Y,s.lanes=O,s;case le:return s=Eo(13,m,u,C),s.elementType=le,s.lanes=O,s;case se:return s=Eo(19,m,u,C),s.elementType=se,s.lanes=O,s;case he:return zh(m,C,O,u);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Z:W=10;break e;case Q:W=9;break e;case G:W=11;break e;case fe:W=14;break e;case $:W=16,b=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return u=Eo(W,m,u,C),u.elementType=s,u.type=b,u.lanes=O,u}function Au(s,u,m,b){return s=Eo(7,s,b,u),s.lanes=m,s}function zh(s,u,m,b){return s=Eo(22,s,b,u),s.elementType=he,s.lanes=m,s.stateNode={isHidden:!1},s}function ug(s,u,m){return s=Eo(6,s,null,u),s.lanes=m,s}function cg(s,u,m){return u=Eo(4,s.children!==null?s.children:[],s.key,u),u.lanes=m,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}function nS(s,u,m,b,C){this.tag=u,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ne(0),this.expirationTimes=Ne(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.identifierPrefix=b,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function dg(s,u,m,b,C,O,W,ue,ge){return s=new nS(s,u,m,ue,ge),u===1?(u=1,O===!0&&(u|=8)):u=0,O=Eo(3,null,null,u),s.current=O,O.stateNode=s,O.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dm(O),s}function rS(s,u,m){var b=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(D6)}catch(e){console.error(e)}}D6();S6.exports=JH();var G2=S6.exports;const J2=qt(G2);var Rv,T6=G2;Rv=rs.createRoot=T6.createRoot;rs.hydrateRoot=T6.hydrateRoot;const KH=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:a}=e,o=()=>{r&&a()},i=l=>{(l.key==="Escape"||(l.ctrlKey||l.metaKey)&&l.key.toLowerCase()==="w")&&a()};return v.jsx("div",{className:`dialog-wrapper ${n}`,onClick:o,onKeyDown:l=>i(l),children:v.jsx("div",{className:"dialog-container",onClick:l=>l.stopPropagation(),children:t})})};function Db(e,t,n){const r=document.createElement("div");document.body.append(r),setTimeout(()=>{var c;(c=r.firstElementChild)==null||c.classList.add("showup")},0);const a={destroy:()=>{var c,f;(c=r.firstElementChild)==null||c.classList.remove("showup"),(f=r.firstElementChild)==null||f.classList.add("showoff"),setTimeout(()=>{r.detach(),l.unmount(),document.body.find(".domtoimage-thino")&&document.body.findAll(".domtoimage-thino").forEach(g=>{g.detach()})},cA)}},o={...n,destroy:a.destroy};let i=v.jsx(KH,{destroy:a.destroy,clickSpaceDestroy:!0,...e,children:v.jsx(t,{...o})});i=v.jsx(is,{store:Le,context:Lt,children:i});const l=rs.createRoot(r);return l.render(i),a}class QH extends x.Modal{constructor(n,r,a){super(n);Se(this,"plugin");this.version=a,this.plugin=r}onOpen(){super.onOpen(),this.titleEl.setText(E("Submit issue")),new x.Setting(this.contentEl).setName(E("Current version")+": "+this.version),new x.Setting(this.contentEl).setName(E("Bug report")).setDesc(E("Click the button to copy debug info and open the issue page")).addButton(n=>{n.setButtonText(E("Copy and go")).onClick(async()=>{await sC(this.plugin),new x.Notice(E("Debug info copied")),setTimeout(()=>{window.open("https://github.com/Quorafind/Obsidian-Thino/issues/new/choose","_blank"),this.close()},100)})}),new x.Setting(this.contentEl).setName(E("Feature request")).setDesc(E("Submit your feature request to the issue page")).addButton(n=>{n.setButtonText(E("Go")).onClick(async()=>{window.open("https://github.com/Quorafind/Obsidian-Thino/issues/new/choose","_blank"),this.close()})})}}function I6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t={};return e.forEach(n=>{const r=n.createdAt.split(" ")[0];t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},eY=e=>{const t={};return e.forEach(n=>{const r=n.createdAt.slice(11,13);t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]};function vx(e,t,n){const r=P.useRef(),a=P.useRef();P.useEffect(()=>{const i=t-e,l=c=>{a.current||(a.current=c);const f=c-a.current;if(f<1e3){const h=f/1e3;n(e+i*h),r.current=requestAnimationFrame(l)}else n(t)};return r.current=requestAnimationFrame(l),()=>cancelAnimationFrame(r.current)},[t,n,e])}const K2=({statusType:e})=>{const{memoState:{memos:t,tags:n},locationState:{pathname:r},dailyNotesState:{settings:a,app:o}}=P.useContext(Lt),[i,l]=P.useState(0),[c,f]=P.useState(0),[h,g]=P.useState(0),[y,w]=P.useState(null),[S,D]=P.useState(!1),I=ne.useRef(null),[M,N]=P.useState(0),[_,k]=P.useState(0),[B,L]=P.useState(0),[R,V]=P.useState(""),[Y,Z]=P.useState(""),[Q,G]=P.useState(!1),[le,se]=P.useState(null);P.useEffect(()=>{if(e==="banner")return;const ie=t.filter(ce=>!ce.deletedAt&&ce.rowStatus!=="ARCHIVED");L(ie.filter(ce=>{var X;return(X=ce.thinoType)==null?void 0:X.startsWith("TASK")}).length),V(XH(t)),Z(eY(t))},[t]),P.useLayoutEffect(()=>{if(!o)return;const{tags:ie,memos:ce,days:X}=tY(o);g(ie),l(ce),f(X)},[o]),P.useEffect(()=>{!a||!o||(D(i>9999||h>999||c>999),nY({tags:h,memos:i,days:c},o))},[i,h,c]),P.useEffect(()=>{we.initialized&&t&&r==="/"&&(g(n.length),l(t.filter(ie=>!(ie.deletedAt!==""&&ie.deletedAt)).length),w(t.length>0?t[t.length-1]:null))},[n,t,r]),P.useEffect(()=>{if(!we.initialized)return;if(!y){f(0);return}if(!I.current||!(y!=null&&y.createdAt))return;x.requireApiVersion("1.4.4")&&x.setTooltip(I.current,E("Started from")+" "+ut.getDateTimeString((y==null?void 0:y.createdAt)??""));const ie=x.moment().diff(x.moment(y.createdAt,"YYYY/MM/DD HH:mm:ss"),"days")+1;f(t?ie:0)},[y]);const fe=(ie,ce)=>{if(Q&&ce===le){at.setMemoFilter(""),G(!1);return}const X=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([ie]));on.pushQuery(X),at.setMemoFilter(X.id),G(!0),se(ce)},$=()=>{fe({type:"LIST",value:{operator:"IS_NOT",value:"LIST"},relation:"AND"},"LIST")},he=()=>{fe({type:"TYPE",value:{operator:"IS_NOT",value:"NOT_TAGGED"},relation:"AND"},"TYPE")};return vx(M,i,N),vx(_,c,k),v.jsx("div",{className:ar("status-text-container",S?"text-overflow":"",e),children:e==="banner"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"status-text memos-text",children:[v.jsx("span",{className:"amount-text",children:Math.round(M)}),v.jsx("span",{className:"type-text",children:"THINO"})]}),v.jsxs("div",{className:"status-text tags-text",children:[v.jsx("span",{className:"amount-text",children:h}),v.jsx("span",{className:"type-text",children:E("TAG")})]}),v.jsxs("div",{ref:I,className:"status-text duration-text",onClick:()=>{dt.setShowSiderbarInMobileView(!1),at.setPathname("/daily")},children:[v.jsx("span",{className:"amount-text",children:Math.round(_)??0}),v.jsx("span",{className:"type-text",children:E("DAY")})]})]}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"status-sidebar-header title-text",children:v.jsx("span",{className:"normal-text",children:E("Thino status")})}),v.jsxs("div",{className:"status-sidebar-wrapper",children:[v.jsxs("div",{className:"status-text memos-text",children:[v.jsx("span",{className:"type-text",children:E("Thino amount")}),v.jsx("span",{className:"amount-text",children:Math.round(M)})]}),v.jsxs("div",{className:"status-text memos-text",onClick:$,children:[v.jsx("span",{className:"type-text",children:E("Task amount")}),v.jsx("span",{className:"amount-text",children:Math.round(B)??0})]}),v.jsxs("div",{className:"status-text tags-text",onClick:he,children:[v.jsx("span",{className:"type-text",children:E("Used tags")}),v.jsx("span",{className:"amount-text",children:h})]}),v.jsxs("div",{ref:I,className:"status-text duration-text",onClick:()=>{dt.setShowSiderbarInMobileView(!1),at.setPathname("/daily")},children:[v.jsx("span",{className:"type-text",children:E("Used days")}),v.jsx("span",{className:"amount-text",children:Math.round(_)??0})]}),v.jsxs("div",{className:"status-text most-active-day-text",onClick:()=>{const ie=x.moment(R,"YYYY/MM/DD").startOf("day").valueOf(),ce=x.moment(R,"YYYY/MM/DD").endOf("day").valueOf();at.setFromAndToQuery(ie,ce)},children:[v.jsx("span",{className:"type-text",children:E("Most active day")}),v.jsx("span",{className:"amount-text",children:R})]}),v.jsxs("div",{className:"status-text most-active-hour-text",children:[v.jsx("span",{className:"type-text",children:E("Most active hour")}),v.jsx("span",{className:"amount-text",children:Y})]})]})]})})};function E6(e){return`userBannerCache:${e}`}function tY(e){try{const t=E6(e==null?void 0:e.appId),n=la.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(t){return console.error(t),{tags:0,memos:0,days:0}}}function nY({tags:e,memos:t,days:n},r){try{const a={tags:e,memos:t,days:n},o=E6(r==null?void 0:r.appId);la.set({[o]:JSON.stringify(a)})}catch(a){console.error(a)}}function Gl(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function C6(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function rY(e,t){const n=Gl(e);return isNaN(t)?C6(e,NaN):(t&&n.setDate(n.getDate()+t),n)}let aY={};function x6(){return aY}function yx(e,t){var l,c,f,h;const n=x6(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(f=n.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=Gl(e),o=a.getDay(),i=(oo-i);return n>=r&&n<=a}function np(e,t){return rY(e,-t)}const uY=[{text:E("AND"),value:"AND"},{text:E("OR"),value:"OR"}],jl={TAG:{value:"TAG",text:E("TAG"),operators:[{text:E("INCLUDE"),value:"CONTAIN"},{text:E("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:E("TYPE"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"CONNECTED",text:E("LINKED")},{value:"NOT_TAGGED",text:E("NO TAGS")},{value:"LINKED",text:E("HAS LINKS")},{value:"IMAGED",text:E("HAS IMAGES")}]},TEXT:{value:"TEXT",text:E("TEXT"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},DATE:{value:"DATE",text:E("DATE"),operators:[{value:"NOT_CONTAIN",text:E("BEFORE")},{value:"CONTAIN",text:E("AFTER")}]},LIST:{value:"LIST",text:E("LIST"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"TODO",text:E("TODO")},{value:"DONE",text:E("DONE")},{value:"LIST",text:E("JOURNAL")},{value:"OTHER",text:E("OTHER")}]},SOURCE:{value:"SOURCE",text:E("SOURCE"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"DAILY",text:E("DAILY")},{value:"MULTI",text:E("MULTI")},{value:"FILE",text:E("FILE")},{value:"CANVAS",text:E("CANVAS")}]},PATH:{value:"PATH",text:E("PATH"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},METADATA:{value:"METADATA",text:E("METADATA"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},TIME_RANGE:{value:"TIME_RANGE",text:E("TIME RANGE"),operators:[{value:"WITHIN",text:E("WITHIN")},{value:"BEFORE",text:E("BEFORE")}],values:[{value:"7d",text:E("7 days")},{value:"14d",text:E("14 days")},{value:"30d",text:E("30 days")},{value:"90d",text:E("3 months")},{value:"180d",text:E("6 months")},{value:"365d",text:E("1 year")},{value:"thisWeek",text:E("This week")},{value:"thisMonth",text:E("This month")},{value:"thisYear",text:E("This year")},{value:"lastWeek",text:E("Last week")},{value:"lastMonth",text:E("Last month")},{value:"lastYear",text:E("Last year")}]}},TT=jl.TYPE.values,cY=e=>{for(const t of TT)if(t.value===e)return t.text;return""},Sx=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),Vp=(e,t)=>{let n=!0;for(const r of t){const{relation:a}=r,o=dY(e,r);a==="OR"?n=n||o:n=n&&o}return n},dY=(e,t)=>{var i,l;const{type:n,value:{operator:r,value:a}}=t;if(a==="")return!0;let o=!0;if(n==="TAG"){let c=!0;const f=new Set;for(const h of Array.from(e.content.match($r)||[])){const y=h.replace($r,"$1").trim().split("/");let w="";for(const S of y)w+=S,f.add(w),w+="/"}for(const h of Array.from(e.content.match(ua)||[])){const y=h.replace(ua,"$1").trim().split("/");let w="";for(const S of y)w+=S,f.add(w),w+="/"}f.has(a)||(c=!1),r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="TYPE"){let c=!1;(a==="NOT_TAGGED"&&e.content.match($r)===null&&e.content.match(Wa)===null||a==="LINKED"&&e.content.match(Af)!==null||a==="IMAGED"&&e.content.match(Ff)!==null||a==="CONNECTED"&&e.content.match(ad)!==null)&&(c=!0),r==="IS_NOT"&&(c=!c),o=c}else if(n==="TEXT"){let c=!1;x.prepareSimpleSearch(a.toLowerCase())(e.content.toLowerCase())&&(c=!0),r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="LIST"){let f=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(a);r==="IS_NOT"&&(f=!f),o=f}else if(n==="PATH"){let c=e.path.toLowerCase().includes(a.toLowerCase());r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="METADATA"){let c=!1;const f=(i=e==null?void 0:e.fileInfo)==null?void 0:i.frontmatter;a.name?f&&Object.keys(f).length>0&&a.name&&(f[a.name]?c=f[a.name]&&((l=f[a.name])==null?void 0:l.toString().contains(a.value)):c=!1):c=!0,r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="SOURCE"){let c=e.sourceType===a;r==="IS_NOT"&&(c=!c),o=c}else if(n==="TIME_RANGE"){let c=!1;if(["7d","14d","30d","90d","180d","365d"].includes(a)){const f=new Date(e.createdAt).valueOf(),h=Date.now(),g=t.value.value.slice(0,-1),y=parseInt(g)*(24*60*60*1e3);r==="WITHIN"?c=h-f<=y:r==="BEFORE"&&(c=h-f>y)}else{const f=new Date(e.createdAt),h=new Date,{value:g,operator:y}=t.value;let w;switch(g){case"thisWeek":w={start:yx(h),end:h};break;case"thisMonth":w={start:wx(h),end:h};break;case"thisYear":w={start:bx(h),end:h};break;case"lastWeek":w={start:yx(np(h,7)),end:sY(np(h,7))};break;case"lastMonth":w={start:wx(np(h,30)),end:oY(np(h,30))};break;case"lastYear":w={start:bx(np(h,365)),end:iY(np(h,365))};break}w&&(c=lY(f,w)),y==="BEFORE"&&(c=!c)}o=c}else if(n==="DATE"){const c=x.moment(a,"YYYY-MM-DD").isValid();let f,h;if(c)f=x.moment(a,"YYYY-MM-DD"),h=f.isBefore(x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),"day");else{const y=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(a);y.date!==null&&(h=y.moment.isBefore(x.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(h=!h),o=h}return o=e.linkId===""?o:!1,o};function Xl(e){const[t,n]=P.useState(()=>!!e),r=P.useCallback(a=>{n(typeof a=="boolean"?a:o=>!o)},[]);return[t,r]}const _v=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=P.useContext(Lt),r=ne.useRef(null),a=ne.useRef(null),[o,i]=Xl(!1);P.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var g;(g=r.current)==null||g.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var g;(g=r.current)==null||g.focus()})))},[r,e,t]),P.useEffect(()=>{a&&x.setIcon(a.current,"search")},[a]);const l=g=>{const{type:y}=at.getState().query;g===y&&(g=""),at.setMemoTypeQuery(g)},c=g=>{const y=g.currentTarget.value;if(!y.contains(" -time: ")){at.setTextQuery(y);return}const w=y.split(" -time: ")[1],S=w.length>10?w.match(/\d{4}-\d{2}-\d{2}/g):null;if(S==null){at.setTextQuery(y.split(" -time: ")[0]);return}if(S.length===1){const D=x.moment(S[0]);at.setTimeQuery({from:D.startOf("day").valueOf(),to:D.endOf("day").valueOf()})}else if(S.length===2){const D=x.moment(S[0]),I=x.moment(S[1]);at.setTimeQuery({from:D.startOf("day").valueOf(),to:I.endOf("day").valueOf()})}at.setTextQuery(y.split(" -time: ")[0])},f=()=>{i(!0)},h=()=>{i(!1)};return v.jsxs("div",{className:"search-bar-container",children:[v.jsxs("div",{className:"search-bar-inputer",children:[v.jsx("span",{ref:a,className:"btn icon-img"}),v.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:f,onMouseOut:h,placeholder:o?E("Type here"):"",onChange:c})]}),v.jsx("div",{className:"quickly-action-wrapper",children:v.jsxs("div",{className:"quickly-action-container",children:[v.jsx("span",{className:"title-text",children:E("Quick filter")}),v.jsxs("div",{className:"section-container types-container",children:[v.jsxs("span",{className:"section-text",children:[E("TYPE"),":"]}),v.jsx("div",{className:"values-container",children:TT.map((g,y)=>v.jsxs("div",{children:[v.jsx("span",{className:`type-item ${n===g.value?"selected":""}`,onClick:()=>{l(g.value)},children:g.text}),y+1{const{children:t,when:n}=e;return n?v.jsx(v.Fragment,{children:t}):null},ts=fY;function fn(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:E("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:E("You can get pro version from: ")}),a=localStorage.getItem("language");let o="https://pkmer.cn/products/UserProfile/";a&&a==="zh"?o="https://pkmer.cn/products/thino/":o="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:o}}),new x.Notice(e,5e3)}const{exec:hY,execSync:pke}=x.Platform.isDesktop&&require("child_process"),{createHash:pY}=x.Platform.isDesktop&&require("crypto"),mY={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},gY=x.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${mY[vY()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"};function vY(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function yY(e){return pY("sha256").update(e).digest("hex")}function wY(e){switch(process.platform){case"darwin":return e.split("IOPlatformUUID")[1].split(` -`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return e.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}function cr(e=!1){return new Promise((t,n)=>{hY(gY[process.platform],{},(r,a)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const o=wY(a.toString());return t(e?o:yY(o))})})}const Dx={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome"},bY=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:a},globalState:{manifest:o,isMobileView:i}}=P.useContext(Lt),l=P.useRef(null),c=P.useRef(null),[f,h]=P.useState((window.app||t).loadLocalStorage("thinoListView")),[g,y]=P.useState(null);P.useEffect(()=>{if(!o||!t)return;const S=t==null?void 0:t.plugins.getPlugin(o.id);y(S),h(S==null?void 0:S.settings.MemoListView),dt.setMemoListView(S==null?void 0:S.settings.MemoListView)},[o,t]),P.useEffect(()=>{if(!t||!n||!g||!g.settings)return;const S=()=>{var I,M;if(n.leaf.height===0)return;const D=(I=g==null?void 0:g.settings)==null?void 0:I.MemoListView;(M=g==null?void 0:g.settings)!=null&&M.SupportSelectOtherView||D==="chat"||D==="moments"||(n.leaf.width>950?(h(D),dt.setMemoListView(D)):n.leaf.width<=950&&(dt.setMemoListView("list"),h("list")))};S(),c.current||(c.current=t.workspace.on("resize",S),n.registerEvent(c.current))},[t,n,g]),P.useEffect(()=>{l&&(x.setIcon(l.current,Dx[f||"list"]),dt.setMemoListView(f),x.requireApiVersion("1.4.4")&&x.setTooltip(l.current,E("Switch view")))},[f]);const w=async S=>{var k;const D=!x.Platform.isDesktop&&await((k=window.Capacitor)==null?void 0:k.Plugins.Device.getId()),I=x.Platform.isDesktop?await cr():D.identifier||D.uuid;if(!r||(r==null?void 0:r.appId)!==I){fn();return}const M=async B=>{dt.setMemoListView(B),g&&(g.settings.MemoListView=B,await g.saveSettings()),h(B)},N=[{view:"list",title:E("List")},{view:"chat",title:E("Chat")},{view:"moments",title:E("Moments")}];(!i||a!=null&&a.SupportSelectOtherView)&&N.push({view:"waterfall",title:E("Waterfall")},{view:"calendar",title:E("Calendar")},{view:"table",title:E("Table")});const _=new x.Menu;N.forEach(({view:B,title:L})=>{_.addItem(R=>{R.setChecked(f===B).setIcon(Dx[B]).setTitle(L).onClick(()=>{f!==B&&M(B)})})}),_.showAtMouseEvent(S.nativeEvent)};return v.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""} pro`,ref:l,onClick:w})},SY=()=>{const e=P.useRef(null);return P.useEffect(()=>{e&&(x.setIcon(e.current,"calendar-check"),x.setTooltip&&x.setTooltip(e.current,E("Daily Memos")))},[e]),v.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{at.setPathname("/daily")}})},OS=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),Tx={initialValue:"",interval:300};class DY{constructor(t,n=Tx){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndexthis.actions,this.setState=(r,a)=>{this.actions=[...r],this.currentIndex=a{this.actions=[OS()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const a=r;a.key==="z"&&!a.shiftKey&&(a.metaKey||a.ctrlKey)?(r.preventDefault(),this.runUndo()):(a.key==="z"&&a.shiftKey&&(a.metaKey||a.ctrlKey)||a.key==="y"&&(a.metaKey||a.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const a=r,o=this.actions[this.currentIndex];this.pushNewAction({type:a.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-o.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const a=this.actions[this.currentIndex];a&&a.type===r.type&&r.timestamp-a.timestamp=this.config.maxSize?(this.actions.shift(),this.actions[0]=OS()):this.currentIndex++,this.actions[this.currentIndex]=r,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(const r of this.listeners)r([...this.actions],this.currentIndex)},this.element=t,this.config=Object.assign(Object.assign({},Tx),n),this.config.initialActions&&this.config.initialActions.length>0?(this.actions=this.config.initialActions,this.config.initialIndex!==void 0&&this.config.initialIndex{e(n=>!n)},[])}var M6={exports:{}};(function(e){(function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n=typeof window<"u",r=n&&window.mozInnerScreenX!=null;function a(o,i,l){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var c=l&&l.debug||!1;if(c){var f=document.querySelector("#input-textarea-caret-position-mirror-div");f&&f.parentNode.removeChild(f)}var h=document.createElement("div");h.id="input-textarea-caret-position-mirror-div",document.body.appendChild(h);var g=h.style,y=window.getComputedStyle?getComputedStyle(o):o.currentStyle;g.whiteSpace="pre-wrap",o.nodeName!=="INPUT"&&(g.wordWrap="break-word"),g.position="absolute",c||(g.visibility="hidden"),t.forEach(function(D){g[D]=y[D]}),r?o.scrollHeight>parseInt(y.height)&&(g.overflowY="scroll"):g.overflow="hidden",h.textContent=o.value.substring(0,i),o.nodeName==="INPUT"&&(h.textContent=h.textContent.replace(/\s/g," "));var w=document.createElement("span");w.textContent=o.value.substring(i)||".",h.appendChild(w);var S={top:w.offsetTop+parseInt(y.borderTopWidth),left:w.offsetLeft+parseInt(y.borderLeftWidth)};return c?w.style.backgroundColor="#aaa":document.body.removeChild(h),S}e.exports=a})()})(M6);var IY=M6.exports;const EY=qt(IY);var k6=dr.CustomEvent;function CY(){try{var e=new k6("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var xY=CY()?k6:typeof document<"u"&&typeof document.createEvent=="function"?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=!!n.bubbles,r.cancelable=!!n.cancelable,r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r};const MY=qt(xY);function kY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NY(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:!1,f=r.props.onItemHighlighted;r.state.selectedItem!==l&&r.setState({selectedItem:l},function(){f(l),c&&r.props.dropdownScroll(r.itemsRef[r.getId(l)])})},r.scroll=function(l){l.preventDefault();var c=r.props.values,f=l.keyCode||l.which,h=r.getPositionInList(),g;switch(f){case xi.DOWN:g=h+1;break;case xi.UP:g=h-1;break;default:g=h;break}g=(g%c.length+c.length)%c.length,r.selectItem(c[g],[xi.DOWN,xi.UP].includes(f))},r.isSelected=function(l){var c=r.state.selectedItem;return c?r.getId(c)===r.getId(l):!1},r}return Tb(t,[{key:"componentDidMount",value:function(){this.listeners.push(df.add([xi.DOWN,xi.UP],this.scroll),df.add([xi.ENTER,xi.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var a=this,o=r.values,i=this.props.values,l=o.map(function(f){return a.getId(f)}).join(""),c=i.map(function(f){return a.getId(f)}).join("");l!==c&&i&&i[0]&&this.selectItem(i[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),df.remove(r)}},{key:"render",value:function(){var r=this,a=this.props,o=a.values,i=a.component,l=a.style,c=a.itemClassName,f=a.className,h=a.itemStyle;return ne.createElement("ul",{className:"rta__list ".concat(f||""),style:l},o.map(function(g){return ne.createElement(RY,{key:r.getId(g),innerRef:function(w){r.itemsRef[r.getId(g)]=w},selected:r.isSelected(g),item:g,className:c,style:h,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:i})}))}}]),t}(ne.Component);function BY(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,a=t.offsetTop,o=e.scrollTop;a<\/script>",s=s.removeChild(s.firstChild)):typeof b.is=="string"?s=W.createElement(m,{is:b.is}):(s=W.createElement(m),m==="select"&&(W=s,b.multiple?W.multiple=!0:b.size&&(W.size=b.size))):s=W.createElementNS(s,m),s[Ui]=u,s[dl]=b,Ky(s,u,!1,!1),u.stateNode=s;e:{switch(W=Lr(m,b),m){case"dialog":Kn("cancel",s),Kn("close",s),C=b;break;case"iframe":case"object":case"embed":Kn("load",s),C=b;break;case"video":case"audio":for(C=0;CBc&&(u.flags|=128,b=!0,Pc(O,!1),u.lanes=4194304)}else{if(!b)if(s=Pd(W),s!==null){if(u.flags|=128,b=!0,m=s.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Pc(O,!0),O.tail===null&&O.tailMode==="hidden"&&!W.alternate&&!Xn)return Ia(u),null}else 2*An()-O.renderingStartTime>Bc&&m!==1073741824&&(u.flags|=128,b=!0,Pc(O,!1),u.lanes=4194304);O.isBackwards?(W.sibling=u.child,u.child=W):(m=O.last,m!==null?m.sibling=W:u.child=W,O.last=W)}return O.tail!==null?(u=O.tail,O.rendering=u,O.tail=u.sibling,O.renderingStartTime=An(),u.sibling=null,m=er.current,qn(er,b?m&1|2:m&1),u):(Ia(u),null);case 22:case 23:return og(),b=u.memoizedState!==null,s!==null&&s.memoizedState!==null!==b&&(u.flags|=8192),b&&u.mode&1?Io&1073741824&&(Ia(u),u.subtreeFlags&6&&(u.flags|=8192)):Ia(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function $1(s,u){switch(Du(u),u.tag){case 1:return to(u.type)&&nh(),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Cc(),Qn(eo),Qn(va),Nm(),s=u.flags,s&65536&&!(s&128)?(u.flags=s&-65537|128,u):null;case 5:return km(u),null;case 13:if(Qn(er),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(n(340));$i()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return Qn(er),null;case 4:return Cc(),null;case 10:return lh(u.type._context),null;case 22:case 23:return og(),null;case 24:return null;default:return null}}var Vo=!1,Fn=!1,Zm=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Dl(s,u){var m=s.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){pr(s,u,b)}else m.current=null}function qm(s,u,m){try{m()}catch(b){pr(s,u,b)}}var Xy=!1;function Wd(s,u){if(Ed=vo,s=Un(),yd(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var C=b.anchorOffset,O=b.focusNode;b=b.focusOffset;try{m.nodeType,O.nodeType}catch{m=null;break e}var W=0,le=-1,ge=-1,Pe=0,Ge=0,rt=s,qe=null;t:for(;;){for(var yt;rt!==m||C!==0&&rt.nodeType!==3||(le=W+C),rt!==O||b!==0&&rt.nodeType!==3||(ge=W+b),rt.nodeType===3&&(W+=rt.nodeValue.length),(yt=rt.firstChild)!==null;)qe=rt,rt=yt;for(;;){if(rt===s)break t;if(qe===m&&++Pe===C&&(le=W),qe===O&&++Ge===b&&(ge=W),(yt=rt.nextSibling)!==null)break;rt=qe,qe=rt.parentNode}rt=yt}m=le===-1||ge===-1?null:{start:le,end:ge}}else m=null}m=m||{start:0,end:0}}else m=null;for(yu={focusedElem:s,selectionRange:m},vo=!1,wt=u;wt!==null;)if(u=wt,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,wt=s;else for(;wt!==null;){u=wt;try{var Dt=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Dt!==null){var Et=Dt.memoizedProps,br=Dt.memoizedState,Ce=u.stateNode,ye=Ce.getSnapshotBeforeUpdate(u.elementType===u.type?Et:mi(u.type,Et),br);Ce.__reactInternalSnapshotBeforeUpdate=ye}break;case 3:var Me=u.stateNode.containerInfo;Me.nodeType===1?Me.textContent="":Me.nodeType===9&&Me.documentElement&&Me.removeChild(Me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(lt){pr(u,u.return,lt)}if(s=u.sibling,s!==null){s.return=u.return,wt=s;break}wt=u.return}return Dt=Xy,Xy=!1,Dt}function jc(s,u,m){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&s)===s){var O=C.destroy;C.destroy=void 0,O!==void 0&&qm(u,m,O)}C=C.next}while(C!==b)}}function $d(s,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&s)===s){var b=m.create;m.destroy=b()}m=m.next}while(m!==u)}}function Gm(s){var u=s.ref;if(u!==null){var m=s.stateNode;switch(s.tag){case 5:s=m;break;default:s=m}typeof u=="function"?u(s):u.current=s}}function e0(s){var u=s.alternate;u!==null&&(s.alternate=null,e0(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&(delete u[Ui],delete u[dl],delete u[eh],delete u[J],delete u[bc])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function t0(s){return s.tag===5||s.tag===3||s.tag===4}function n0(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||t0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Ah(s,u,m){var b=s.tag;if(b===5||b===6)s=s.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(s,u):m.insertBefore(s,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(s,m)):(u=m,u.appendChild(s)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=Qf));else if(b!==4&&(s=s.child,s!==null))for(Ah(s,u,m),s=s.sibling;s!==null;)Ah(s,u,m),s=s.sibling}function Fh(s,u,m){var b=s.tag;if(b===5||b===6)s=s.stateNode,u?m.insertBefore(s,u):m.appendChild(s);else if(b!==4&&(s=s.child,s!==null))for(Fh(s,u,m),s=s.sibling;s!==null;)Fh(s,u,m),s=s.sibling}var ia=null,Do=!1;function Ms(s,u,m){for(m=m.child;m!==null;)Lc(s,u,m),m=m.sibling}function Lc(s,u,m){if(Pa&&typeof Pa.onCommitFiberUnmount=="function")try{Pa.onCommitFiberUnmount(ho,m)}catch{}switch(m.tag){case 5:Fn||Dl(m,u);case 6:var b=ia,C=Do;ia=null,Ms(s,u,m),ia=b,Do=C,ia!==null&&(Do?(s=ia,m=m.stateNode,s.nodeType===8?s.parentNode.removeChild(m):s.removeChild(m)):ia.removeChild(m.stateNode));break;case 18:ia!==null&&(Do?(s=ia,m=m.stateNode,s.nodeType===8?ym(s.parentNode,m):s.nodeType===1&&ym(s,m),pn(s)):ym(ia,m.stateNode));break;case 4:b=ia,C=Do,ia=m.stateNode.containerInfo,Do=!0,Ms(s,u,m),ia=b,Do=C;break;case 0:case 11:case 14:case 15:if(!Fn&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var O=C,W=O.destroy;O=O.tag,W!==void 0&&(O&2||O&4)&&qm(m,u,W),C=C.next}while(C!==b)}Ms(s,u,m);break;case 1:if(!Fn&&(Dl(m,u),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(le){pr(m,u,le)}Ms(s,u,m);break;case 21:Ms(s,u,m);break;case 22:m.mode&1?(Fn=(b=Fn)||m.memoizedState!==null,Ms(s,u,m),Fn=b):Ms(s,u,m);break;default:Ms(s,u,m)}}function Oh(s){var u=s.updateQueue;if(u!==null){s.updateQueue=null;var m=s.stateNode;m===null&&(m=s.stateNode=new Zm),u.forEach(function(b){var C=eS.bind(null,s,b);m.has(b)||(m.add(b),b.then(C,C))})}}function Wo(s,u){var m=u.deletions;if(m!==null)for(var b=0;bC&&(C=W),b&=~O}if(b=C,b=An()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Z1(b/1960))-b,10s?16:s,zr===null)var b=!1;else{if(s=zr,zr=null,_h=0,bn&6)throw Error(n(331));var C=bn;for(bn|=4,wt=s.current;wt!==null;){var O=wt,W=O.child;if(wt.flags&16){var le=O.deletions;if(le!==null){for(var ge=0;geAn()-jh?ku(s,0):Xm|=m),Ea(s,u)}function d0(s,u){u===0&&(s.mode&1?(u=hs,hs<<=1,!(hs&130023424)&&(hs=4194304)):u=1);var m=Ya();s=gi(s,u),s!==null&&(Ie(s,u,m),Ea(s,m))}function X1(s){var u=s.memoizedState,m=0;u!==null&&(m=u.retryLane),d0(s,m)}function eS(s,u){var m=0;switch(s.tag){case 13:var b=s.stateNode,C=s.memoizedState;C!==null&&(m=C.retryLane);break;case 19:b=s.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(u),d0(s,m)}var f0;f0=function(s,u,m){if(s!==null)if(s.memoizedProps!==u.pendingProps||eo.current)Da=!0;else{if(!(s.lanes&m)&&!(u.flags&128))return Da=!1,Ta(s,u,m);Da=!!(s.flags&131072)}else Da=!1,Xn&&u.flags&1048576&&Fy(u,oh,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;Oc(s,u),s=u.pendingProps;var C=Dc(u,va.current);pl(u,m),C=gh(null,u,b,s,C,m);var O=vh();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,to(b)?(O=!0,Ho(u)):O=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Dm(u),C.updater=dh,u.stateNode=C,C._reactInternals=u,Cm(u,b,s,m),u=Vm(null,u,b,!0,O,m)):(u.tag=0,Xn&&O&&Md(u),Ua(null,u,C,m),u=u.child),u;case 16:b=u.elementType;e:{switch(Oc(s,u),s=u.pendingProps,C=b._init,b=C(b._payload),u.type=b,C=u.tag=Uh(b),s=mi(b,s),C){case 0:u=xh(null,u,b,s,m);break e;case 1:u=Gy(null,u,b,s,m);break e;case 11:u=Um(null,u,b,s,m);break e;case 14:u=qi(null,u,b,mi(b.type,s),m);break e}throw Error(n(306,b,""))}return u;case 0:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),xh(s,u,b,C,m);case 1:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Gy(s,u,b,C,m);case 3:e:{if(Gi(u),s===null)throw Error(n(387));b=u.pendingProps,O=u.memoizedState,C=O.element,jy(s,u),ch(u,b,null,m);var W=u.memoizedState;if(b=W.element,O.isDehydrated)if(O={element:b,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},u.updateQueue.baseState=O,u.memoizedState=O,u.flags&256){C=xu(Error(n(423)),u),u=Mh(s,u,b,m,C);break e}else if(b!==C){C=xu(Error(n(424)),u),u=Mh(s,u,b,m,C);break e}else for(bo=cl(u.stateNode.containerInfo.firstChild),wa=u,Xn=!0,pi=null,m=xm(u,null,b,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if($i(),b===C){u=Ji(s,u,m);break e}Ua(s,u,b,m)}u=u.child}return u;case 5:return Mm(u),s===null&&no(u),b=u.type,C=u.pendingProps,O=s!==null?s.memoizedProps:null,W=C.children,Cd(b,C)?W=null:O!==null&&Cd(b,O)&&(u.flags|=32),qy(s,u),Ua(s,u,W,m),u.child;case 6:return s===null&&no(u),null;case 13:return Vd(s,u,m);case 4:return ph(u,u.stateNode.containerInfo),b=u.pendingProps,s===null?u.child=yl(u,null,b,m):Ua(s,u,b,m),u.child;case 11:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Um(s,u,b,C,m);case 7:return Ua(s,u,u.pendingProps,m),u.child;case 8:return Ua(s,u,u.pendingProps.children,m),u.child;case 12:return Ua(s,u,u.pendingProps.children,m),u.child;case 10:e:{if(b=u.type._context,C=u.pendingProps,O=u.memoizedProps,W=C.value,qn(Tu,b._currentValue),b._currentValue=W,O!==null)if(Oe(O.value,W)){if(O.children===C.children&&!eo.current){u=Ji(s,u,m);break e}}else for(O=u.child,O!==null&&(O.return=u);O!==null;){var le=O.dependencies;if(le!==null){W=O.child;for(var ge=le.firstContext;ge!==null;){if(ge.context===b){if(O.tag===1){ge=vi(-1,m&-m),ge.tag=2;var Pe=O.updateQueue;if(Pe!==null){Pe=Pe.shared;var Ge=Pe.pending;Ge===null?ge.next=ge:(ge.next=Ge.next,Ge.next=ge),Pe.pending=ge}}O.lanes|=m,ge=O.alternate,ge!==null&&(ge.lanes|=m),zo(O.return,m,u),le.lanes|=m;break}ge=ge.next}}else if(O.tag===10)W=O.type===u.type?null:O.child;else if(O.tag===18){if(W=O.return,W===null)throw Error(n(341));W.lanes|=m,le=W.alternate,le!==null&&(le.lanes|=m),zo(W,m,u),W=O.sibling}else W=O.child;if(W!==null)W.return=O;else for(W=O;W!==null;){if(W===u){W=null;break}if(O=W.sibling,O!==null){O.return=W.return,W=O;break}W=W.return}O=W}Ua(s,u,C.children,m),u=u.child}return u;case 9:return C=u.type,b=u.pendingProps.children,pl(u,m),C=Ba(C),b=b(C),u.flags|=1,Ua(s,u,b,m),u.child;case 14:return b=u.type,C=mi(b,u.pendingProps),C=mi(b.type,C),qi(s,u,b,C,m);case 15:return Ym(s,u,u.type,u.pendingProps,m);case 17:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:mi(b,C),Oc(s,u),u.tag=1,to(b)?(s=!0,Ho(u)):s=!1,pl(u,m),Em(u,b,C),Cm(u,b,C,m),Vm(null,u,b,!0,s,m);case 19:return Jy(s,u,m);case 22:return zm(s,u,m)}throw Error(n(156,u.tag))};function h0(s,u){return cs(s,u)}function tS(s,u,m,b){this.tag=s,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Eo(s,u,m,b){return new tS(s,u,m,b)}function lg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Uh(s){if(typeof s=="function")return lg(s)?1:0;if(s!=null){if(s=s.$$typeof,s===G)return 11;if(s===fe)return 14}return 2}function kl(s,u){var m=s.alternate;return m===null?(m=Eo(s.tag,u,s.key,s.mode),m.elementType=s.elementType,m.type=s.type,m.stateNode=s.stateNode,m.alternate=s,s.alternate=m):(m.pendingProps=u,m.type=s.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=s.flags&14680064,m.childLanes=s.childLanes,m.lanes=s.lanes,m.child=s.child,m.memoizedProps=s.memoizedProps,m.memoizedState=s.memoizedState,m.updateQueue=s.updateQueue,u=s.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=s.sibling,m.index=s.index,m.ref=s.ref,m}function Yh(s,u,m,b,C,O){var W=2;if(b=s,typeof s=="function")lg(s)&&(W=1);else if(typeof s=="string")W=5;else e:switch(s){case _:return Au(m.children,C,O,u);case V:W=8,C|=8;break;case U:return s=Eo(12,m,u,C|2),s.elementType=U,s.lanes=O,s;case re:return s=Eo(13,m,u,C),s.elementType=re,s.lanes=O,s;case de:return s=Eo(19,m,u,C),s.elementType=de,s.lanes=O,s;case he:return zh(m,C,O,u);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Z:W=10;break e;case Q:W=9;break e;case G:W=11;break e;case fe:W=14;break e;case $:W=16,b=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return u=Eo(W,m,u,C),u.elementType=s,u.type=b,u.lanes=O,u}function Au(s,u,m,b){return s=Eo(7,s,b,u),s.lanes=m,s}function zh(s,u,m,b){return s=Eo(22,s,b,u),s.elementType=he,s.lanes=m,s.stateNode={isHidden:!1},s}function ug(s,u,m){return s=Eo(6,s,null,u),s.lanes=m,s}function cg(s,u,m){return u=Eo(4,s.children!==null?s.children:[],s.key,u),u.lanes=m,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}function nS(s,u,m,b,C){this.tag=u,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ne(0),this.expirationTimes=Ne(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ne(0),this.identifierPrefix=b,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function dg(s,u,m,b,C,O,W,le,ge){return s=new nS(s,u,m,le,ge),u===1?(u=1,O===!0&&(u|=8)):u=0,O=Eo(3,null,null,u),s.current=O,O.stateNode=s,O.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dm(O),s}function rS(s,u,m){var b=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T6)}catch(e){console.error(e)}}T6();D6.exports=KH();var G2=D6.exports;const J2=qt(G2);var Rv,I6=G2;Rv=rs.createRoot=I6.createRoot;rs.hydrateRoot=I6.hydrateRoot;const QH=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:a}=e,o=()=>{r&&a()},i=l=>{(l.key==="Escape"||(l.ctrlKey||l.metaKey)&&l.key.toLowerCase()==="w")&&a()};return v.jsx("div",{className:`dialog-wrapper ${n}`,onClick:o,onKeyDown:l=>i(l),children:v.jsx("div",{className:"dialog-container",onClick:l=>l.stopPropagation(),children:t})})};function Db(e,t,n){const r=document.createElement("div");document.body.append(r),setTimeout(()=>{var c;(c=r.firstElementChild)==null||c.classList.add("showup")},0);const a={destroy:()=>{var c,f;(c=r.firstElementChild)==null||c.classList.remove("showup"),(f=r.firstElementChild)==null||f.classList.add("showoff"),setTimeout(()=>{r.detach(),l.unmount(),document.body.find(".domtoimage-thino")&&document.body.findAll(".domtoimage-thino").forEach(g=>{g.detach()})},cA)}},o={...n,destroy:a.destroy};let i=v.jsx(QH,{destroy:a.destroy,clickSpaceDestroy:!0,...e,children:v.jsx(t,{...o})});i=v.jsx(is,{store:Le,context:Lt,children:i});const l=rs.createRoot(r);return l.render(i),a}class XH extends x.Modal{constructor(n,r,a){super(n);Se(this,"plugin");this.version=a,this.plugin=r}onOpen(){super.onOpen(),this.titleEl.setText(E("Submit issue")),new x.Setting(this.contentEl).setName(E("Current version")+": "+this.version),new x.Setting(this.contentEl).setName(E("Bug report")).setDesc(E("Click the button to copy debug info and open the issue page")).addButton(n=>{n.setButtonText(E("Copy and go")).onClick(async()=>{await sC(this.plugin),new x.Notice(E("Debug info copied")),setTimeout(()=>{window.open("https://github.com/Quorafind/Obsidian-Thino/issues/new/choose","_blank"),this.close()},100)})}),new x.Setting(this.contentEl).setName(E("Feature request")).setDesc(E("Submit your feature request to the issue page")).addButton(n=>{n.setButtonText(E("Go")).onClick(async()=>{window.open("https://github.com/Quorafind/Obsidian-Thino/issues/new/choose","_blank"),this.close()})})}}function E6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t={};return e.forEach(n=>{const r=n.createdAt.split(" ")[0];t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},tU=e=>{const t={};return e.forEach(n=>{const r=n.createdAt.slice(11,13);t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]};function vx(e,t,n){const r=P.useRef(),a=P.useRef();P.useEffect(()=>{const i=t-e,l=c=>{a.current||(a.current=c);const f=c-a.current;if(f<1e3){const h=f/1e3;n(e+i*h),r.current=requestAnimationFrame(l)}else n(t)};return r.current=requestAnimationFrame(l),()=>cancelAnimationFrame(r.current)},[t,n,e])}const K2=({statusType:e})=>{const{memoState:{memos:t,tags:n},locationState:{pathname:r},dailyNotesState:{settings:a,app:o}}=P.useContext(Lt),[i,l]=P.useState(0),[c,f]=P.useState(0),[h,g]=P.useState(0),[y,w]=P.useState(null),[S,D]=P.useState(!1),I=ne.useRef(null),[M,N]=P.useState(0),[B,k]=P.useState(0),[R,L]=P.useState(0),[_,V]=P.useState(""),[U,Z]=P.useState(""),[Q,G]=P.useState(!1),[re,de]=P.useState(null);P.useEffect(()=>{if(e==="banner")return;const se=t.filter(ue=>!ue.deletedAt&&ue.rowStatus!=="ARCHIVED");L(se.filter(ue=>{var X;return(X=ue.thinoType)==null?void 0:X.startsWith("TASK")}).length),V(eU(t)),Z(tU(t))},[t]),P.useLayoutEffect(()=>{if(!o)return;const{tags:se,memos:ue,days:X}=nU(o);g(se),l(ue),f(X)},[o]),P.useEffect(()=>{!a||!o||(D(i>9999||h>999||c>999),rU({tags:h,memos:i,days:c},o))},[i,h,c]),P.useEffect(()=>{we.initialized&&t&&r==="/"&&(g(n.length),l(t.filter(se=>!(se.deletedAt!==""&&se.deletedAt)).length),w(t.length>0?t[t.length-1]:null))},[n,t,r]),P.useEffect(()=>{if(!we.initialized)return;if(!y){f(0);return}if(!I.current||!(y!=null&&y.createdAt))return;x.requireApiVersion("1.4.4")&&x.setTooltip(I.current,E("Started from")+" "+ut.getDateTimeString((y==null?void 0:y.createdAt)??""));const se=x.moment().diff(x.moment(y.createdAt,"YYYY/MM/DD HH:mm:ss"),"days")+1;f(t?se:0)},[y]);const fe=(se,ue)=>{if(Q&&ue===re){at.setMemoFilter(""),G(!1);return}const X=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([se]));on.pushQuery(X),at.setMemoFilter(X.id),G(!0),de(ue)},$=()=>{fe({type:"LIST",value:{operator:"IS_NOT",value:"LIST"},relation:"AND"},"LIST")},he=()=>{fe({type:"TYPE",value:{operator:"IS_NOT",value:"NOT_TAGGED"},relation:"AND"},"TYPE")};return vx(M,i,N),vx(B,c,k),v.jsx("div",{className:ar("status-text-container",S?"text-overflow":"",e),children:e==="banner"?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"status-text memos-text",children:[v.jsx("span",{className:"amount-text",children:Math.round(M)}),v.jsx("span",{className:"type-text",children:"THINO"})]}),v.jsxs("div",{className:"status-text tags-text",children:[v.jsx("span",{className:"amount-text",children:h}),v.jsx("span",{className:"type-text",children:E("TAG")})]}),v.jsxs("div",{ref:I,className:"status-text duration-text",onClick:()=>{dt.setShowSiderbarInMobileView(!1),at.setPathname("/daily")},children:[v.jsx("span",{className:"amount-text",children:Math.round(B)??0}),v.jsx("span",{className:"type-text",children:E("DAY")})]})]}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"status-sidebar-header title-text",children:v.jsx("span",{className:"normal-text",children:E("Thino status")})}),v.jsxs("div",{className:"status-sidebar-wrapper",children:[v.jsxs("div",{className:"status-text memos-text",children:[v.jsx("span",{className:"type-text",children:E("Thino amount")}),v.jsx("span",{className:"amount-text",children:Math.round(M)})]}),v.jsxs("div",{className:"status-text memos-text",onClick:$,children:[v.jsx("span",{className:"type-text",children:E("Task amount")}),v.jsx("span",{className:"amount-text",children:Math.round(R)??0})]}),v.jsxs("div",{className:"status-text tags-text",onClick:he,children:[v.jsx("span",{className:"type-text",children:E("Used tags")}),v.jsx("span",{className:"amount-text",children:h})]}),v.jsxs("div",{ref:I,className:"status-text duration-text",onClick:()=>{dt.setShowSiderbarInMobileView(!1),at.setPathname("/daily")},children:[v.jsx("span",{className:"type-text",children:E("Used days")}),v.jsx("span",{className:"amount-text",children:Math.round(B)??0})]}),v.jsxs("div",{className:"status-text most-active-day-text",onClick:()=>{const se=x.moment(_,"YYYY/MM/DD").startOf("day").valueOf(),ue=x.moment(_,"YYYY/MM/DD").endOf("day").valueOf();at.setFromAndToQuery(se,ue)},children:[v.jsx("span",{className:"type-text",children:E("Most active day")}),v.jsx("span",{className:"amount-text",children:_})]}),v.jsxs("div",{className:"status-text most-active-hour-text",children:[v.jsx("span",{className:"type-text",children:E("Most active hour")}),v.jsx("span",{className:"amount-text",children:U})]})]})]})})};function C6(e){return`userBannerCache:${e}`}function nU(e){try{const t=C6(e==null?void 0:e.appId),n=la.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(t){return console.error(t),{tags:0,memos:0,days:0}}}function rU({tags:e,memos:t,days:n},r){try{const a={tags:e,memos:t,days:n},o=C6(r==null?void 0:r.appId);la.set({[o]:JSON.stringify(a)})}catch(a){console.error(a)}}function Gl(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function x6(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function aU(e,t){const n=Gl(e);return isNaN(t)?x6(e,NaN):(t&&n.setDate(n.getDate()+t),n)}let oU={};function M6(){return oU}function yx(e,t){var l,c,f,h;const n=M6(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(f=n.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=Gl(e),o=a.getDay(),i=(oo-i);return n>=r&&n<=a}function np(e,t){return aU(e,-t)}const cU=[{text:E("AND"),value:"AND"},{text:E("OR"),value:"OR"}],jl={TAG:{value:"TAG",text:E("TAG"),operators:[{text:E("INCLUDE"),value:"CONTAIN"},{text:E("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:E("TYPE"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"CONNECTED",text:E("LINKED")},{value:"NOT_TAGGED",text:E("NO TAGS")},{value:"LINKED",text:E("HAS LINKS")},{value:"IMAGED",text:E("HAS IMAGES")}]},TEXT:{value:"TEXT",text:E("TEXT"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},DATE:{value:"DATE",text:E("DATE"),operators:[{value:"NOT_CONTAIN",text:E("BEFORE")},{value:"CONTAIN",text:E("AFTER")}]},LIST:{value:"LIST",text:E("LIST"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"TODO",text:E("TODO")},{value:"DONE",text:E("DONE")},{value:"LIST",text:E("JOURNAL")},{value:"OTHER",text:E("OTHER")}]},SOURCE:{value:"SOURCE",text:E("SOURCE"),operators:[{value:"IS",text:E("IS")},{value:"IS_NOT",text:E("ISNOT")}],values:[{value:"DAILY",text:E("DAILY")},{value:"MULTI",text:E("MULTI")},{value:"FILE",text:E("FILE")},{value:"CANVAS",text:E("CANVAS")}]},PATH:{value:"PATH",text:E("PATH"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},METADATA:{value:"METADATA",text:E("METADATA"),operators:[{value:"CONTAIN",text:E("INCLUDE")},{value:"NOT_CONTAIN",text:E("EXCLUDE")}]},TIME_RANGE:{value:"TIME_RANGE",text:E("TIME RANGE"),operators:[{value:"WITHIN",text:E("WITHIN")},{value:"BEFORE",text:E("BEFORE")}],values:[{value:"7d",text:E("7 days")},{value:"14d",text:E("14 days")},{value:"30d",text:E("30 days")},{value:"90d",text:E("3 months")},{value:"180d",text:E("6 months")},{value:"365d",text:E("1 year")},{value:"thisWeek",text:E("This week")},{value:"thisMonth",text:E("This month")},{value:"thisYear",text:E("This year")},{value:"lastWeek",text:E("Last week")},{value:"lastMonth",text:E("Last month")},{value:"lastYear",text:E("Last year")}]}},TT=jl.TYPE.values,dU=e=>{for(const t of TT)if(t.value===e)return t.text;return""},Sx=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),Vp=(e,t)=>{let n=!0;for(const r of t){const{relation:a}=r,o=fU(e,r);a==="OR"?n=n||o:n=n&&o}return n},fU=(e,t)=>{var i,l;const{type:n,value:{operator:r,value:a}}=t;if(a==="")return!0;let o=!0;if(n==="TAG"){let c=!0;const f=new Set;for(const h of Array.from(e.content.match($r)||[])){const y=h.replace($r,"$1").trim().split("/");let w="";for(const S of y)w+=S,f.add(w),w+="/"}for(const h of Array.from(e.content.match(ua)||[])){const y=h.replace(ua,"$1").trim().split("/");let w="";for(const S of y)w+=S,f.add(w),w+="/"}f.has(a)||(c=!1),r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="TYPE"){let c=!1;(a==="NOT_TAGGED"&&e.content.match($r)===null&&e.content.match(Wa)===null||a==="LINKED"&&e.content.match(Af)!==null||a==="IMAGED"&&e.content.match(Ff)!==null||a==="CONNECTED"&&e.content.match(ad)!==null)&&(c=!0),r==="IS_NOT"&&(c=!c),o=c}else if(n==="TEXT"){let c=!1;x.prepareSimpleSearch(a.toLowerCase())(e.content.toLowerCase())&&(c=!0),r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="LIST"){let f=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(a);r==="IS_NOT"&&(f=!f),o=f}else if(n==="PATH"){let c=e.path.toLowerCase().includes(a.toLowerCase());r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="METADATA"){let c=!1;const f=(i=e==null?void 0:e.fileInfo)==null?void 0:i.frontmatter;a.name?f&&Object.keys(f).length>0&&a.name&&(f[a.name]?c=f[a.name]&&((l=f[a.name])==null?void 0:l.toString().contains(a.value)):c=!1):c=!0,r==="NOT_CONTAIN"&&(c=!c),o=c}else if(n==="SOURCE"){let c=e.sourceType===a;r==="IS_NOT"&&(c=!c),o=c}else if(n==="TIME_RANGE"){let c=!1;if(["7d","14d","30d","90d","180d","365d"].includes(a)){const f=new Date(e.createdAt).valueOf(),h=Date.now(),g=t.value.value.slice(0,-1),y=parseInt(g)*(24*60*60*1e3);r==="WITHIN"?c=h-f<=y:r==="BEFORE"&&(c=h-f>y)}else{const f=new Date(e.createdAt),h=new Date,{value:g,operator:y}=t.value;let w;switch(g){case"thisWeek":w={start:yx(h),end:h};break;case"thisMonth":w={start:wx(h),end:h};break;case"thisYear":w={start:bx(h),end:h};break;case"lastWeek":w={start:yx(np(h,7)),end:lU(np(h,7))};break;case"lastMonth":w={start:wx(np(h,30)),end:iU(np(h,30))};break;case"lastYear":w={start:bx(np(h,365)),end:sU(np(h,365))};break}w&&(c=uU(f,w)),y==="BEFORE"&&(c=!c)}o=c}else if(n==="DATE"){const c=x.moment(a,"YYYY-MM-DD").isValid();let f,h;if(c)f=x.moment(a,"YYYY-MM-DD"),h=f.isBefore(x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),"day");else{const y=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(a);y.date!==null&&(h=y.moment.isBefore(x.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(h=!h),o=h}return o=e.linkId===""?o:!1,o};function Xl(e){const[t,n]=P.useState(()=>!!e),r=P.useCallback(a=>{n(typeof a=="boolean"?a:o=>!o)},[]);return[t,r]}const _v=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=P.useContext(Lt),r=ne.useRef(null),a=ne.useRef(null),[o,i]=Xl(!1);P.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var g;(g=r.current)==null||g.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var g;(g=r.current)==null||g.focus()})))},[r,e,t]),P.useEffect(()=>{a&&x.setIcon(a.current,"search")},[a]);const l=g=>{const{type:y}=at.getState().query;g===y&&(g=""),at.setMemoTypeQuery(g)},c=g=>{const y=g.currentTarget.value;if(!y.contains(" -time: ")){at.setTextQuery(y);return}const w=y.split(" -time: ")[1],S=w.length>10?w.match(/\d{4}-\d{2}-\d{2}/g):null;if(S==null){at.setTextQuery(y.split(" -time: ")[0]);return}if(S.length===1){const D=x.moment(S[0]);at.setTimeQuery({from:D.startOf("day").valueOf(),to:D.endOf("day").valueOf()})}else if(S.length===2){const D=x.moment(S[0]),I=x.moment(S[1]);at.setTimeQuery({from:D.startOf("day").valueOf(),to:I.endOf("day").valueOf()})}at.setTextQuery(y.split(" -time: ")[0])},f=()=>{i(!0)},h=()=>{i(!1)};return v.jsxs("div",{className:"search-bar-container",children:[v.jsxs("div",{className:"search-bar-inputer",children:[v.jsx("span",{ref:a,className:"btn icon-img"}),v.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:f,onMouseOut:h,placeholder:o?E("Type here"):"",onChange:c})]}),v.jsx("div",{className:"quickly-action-wrapper",children:v.jsxs("div",{className:"quickly-action-container",children:[v.jsx("span",{className:"title-text",children:E("Quick filter")}),v.jsxs("div",{className:"section-container types-container",children:[v.jsxs("span",{className:"section-text",children:[E("TYPE"),":"]}),v.jsx("div",{className:"values-container",children:TT.map((g,y)=>v.jsxs("div",{children:[v.jsx("span",{className:`type-item ${n===g.value?"selected":""}`,onClick:()=>{l(g.value)},children:g.text}),y+1{const{children:t,when:n}=e;return n?v.jsx(v.Fragment,{children:t}):null},ts=hU;function fn(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:E("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:E("You can get pro version from: ")}),a=localStorage.getItem("language");let o="https://pkmer.cn/products/UserProfile/";a&&a==="zh"?o="https://pkmer.cn/products/thino/":o="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:o}}),new x.Notice(e,5e3)}const{exec:pU,execSync:mke}=x.Platform.isDesktop&&require("child_process"),{createHash:mU}=x.Platform.isDesktop&&require("crypto"),gU={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},vU=x.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${gU[yU()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"};function yU(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function wU(e){return mU("sha256").update(e).digest("hex")}function bU(e){switch(process.platform){case"darwin":return e.split("IOPlatformUUID")[1].split(` +`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return e.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}function cr(e=!1){return new Promise((t,n)=>{pU(vU[process.platform],{},(r,a)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const o=bU(a.toString());return t(e?o:wU(o))})})}const Dx={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome"},SU=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:a},globalState:{manifest:o,isMobileView:i}}=P.useContext(Lt),l=P.useRef(null),c=P.useRef(null),[f,h]=P.useState((window.app||t).loadLocalStorage("thinoListView")),[g,y]=P.useState(null);P.useEffect(()=>{if(!o||!t)return;const S=t==null?void 0:t.plugins.getPlugin(o.id);y(S),h(S==null?void 0:S.settings.MemoListView),dt.setMemoListView(S==null?void 0:S.settings.MemoListView)},[o,t]),P.useEffect(()=>{if(!t||!n||!g||!g.settings)return;const S=()=>{var I,M;if(n.leaf.height===0)return;const D=(I=g==null?void 0:g.settings)==null?void 0:I.MemoListView;(M=g==null?void 0:g.settings)!=null&&M.SupportSelectOtherView||D==="chat"||D==="moments"||(n.leaf.width>950?(h(D),dt.setMemoListView(D)):n.leaf.width<=950&&(dt.setMemoListView("list"),h("list")))};S(),c.current||(c.current=t.workspace.on("resize",S),n.registerEvent(c.current))},[t,n,g]),P.useEffect(()=>{l&&(x.setIcon(l.current,Dx[f||"list"]),dt.setMemoListView(f),x.requireApiVersion("1.4.4")&&x.setTooltip(l.current,E("Switch view")))},[f]);const w=async S=>{var k;const D=!x.Platform.isDesktop&&await((k=window.Capacitor)==null?void 0:k.Plugins.Device.getId()),I=x.Platform.isDesktop?await cr():D.identifier||D.uuid;if(!r||(r==null?void 0:r.appId)!==I){fn();return}const M=async R=>{dt.setMemoListView(R),g&&(g.settings.MemoListView=R,await g.saveSettings()),h(R)},N=[{view:"list",title:E("List")},{view:"chat",title:E("Chat")},{view:"moments",title:E("Moments")}];(!i||a!=null&&a.SupportSelectOtherView)&&N.push({view:"waterfall",title:E("Waterfall")},{view:"calendar",title:E("Calendar")},{view:"table",title:E("Table")});const B=new x.Menu;N.forEach(({view:R,title:L})=>{B.addItem(_=>{_.setChecked(f===R).setIcon(Dx[R]).setTitle(L).onClick(()=>{f!==R&&M(R)})})}),B.showAtMouseEvent(S.nativeEvent)};return v.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""} pro`,ref:l,onClick:w})},DU=()=>{const e=P.useRef(null);return P.useEffect(()=>{e&&(x.setIcon(e.current,"calendar-check"),x.setTooltip&&x.setTooltip(e.current,E("Daily Memos")))},[e]),v.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{at.setPathname("/daily")}})},OS=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),Tx={initialValue:"",interval:300};class TU{constructor(t,n=Tx){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndexthis.actions,this.setState=(r,a)=>{this.actions=[...r],this.currentIndex=a{this.actions=[OS()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const a=r;a.key==="z"&&!a.shiftKey&&(a.metaKey||a.ctrlKey)?(r.preventDefault(),this.runUndo()):(a.key==="z"&&a.shiftKey&&(a.metaKey||a.ctrlKey)||a.key==="y"&&(a.metaKey||a.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const a=r,o=this.actions[this.currentIndex];this.pushNewAction({type:a.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-o.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const a=this.actions[this.currentIndex];a&&a.type===r.type&&r.timestamp-a.timestamp=this.config.maxSize?(this.actions.shift(),this.actions[0]=OS()):this.currentIndex++,this.actions[this.currentIndex]=r,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(const r of this.listeners)r([...this.actions],this.currentIndex)},this.element=t,this.config=Object.assign(Object.assign({},Tx),n),this.config.initialActions&&this.config.initialActions.length>0?(this.actions=this.config.initialActions,this.config.initialIndex!==void 0&&this.config.initialIndex{e(n=>!n)},[])}var k6={exports:{}};(function(e){(function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n=typeof window<"u",r=n&&window.mozInnerScreenX!=null;function a(o,i,l){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var c=l&&l.debug||!1;if(c){var f=document.querySelector("#input-textarea-caret-position-mirror-div");f&&f.parentNode.removeChild(f)}var h=document.createElement("div");h.id="input-textarea-caret-position-mirror-div",document.body.appendChild(h);var g=h.style,y=window.getComputedStyle?getComputedStyle(o):o.currentStyle;g.whiteSpace="pre-wrap",o.nodeName!=="INPUT"&&(g.wordWrap="break-word"),g.position="absolute",c||(g.visibility="hidden"),t.forEach(function(D){g[D]=y[D]}),r?o.scrollHeight>parseInt(y.height)&&(g.overflowY="scroll"):g.overflow="hidden",h.textContent=o.value.substring(0,i),o.nodeName==="INPUT"&&(h.textContent=h.textContent.replace(/\s/g," "));var w=document.createElement("span");w.textContent=o.value.substring(i)||".",h.appendChild(w);var S={top:w.offsetTop+parseInt(y.borderTopWidth),left:w.offsetLeft+parseInt(y.borderLeftWidth)};return c?w.style.backgroundColor="#aaa":document.body.removeChild(h),S}e.exports=a})()})(k6);var EU=k6.exports;const CU=qt(EU);var N6=dr.CustomEvent;function xU(){try{var e=new N6("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var MU=xU()?N6:typeof document<"u"&&typeof document.createEvent=="function"?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=!!n.bubbles,r.cancelable=!!n.cancelable,r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r};const kU=qt(MU);function NU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AU(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:!1,f=r.props.onItemHighlighted;r.state.selectedItem!==l&&r.setState({selectedItem:l},function(){f(l),c&&r.props.dropdownScroll(r.itemsRef[r.getId(l)])})},r.scroll=function(l){l.preventDefault();var c=r.props.values,f=l.keyCode||l.which,h=r.getPositionInList(),g;switch(f){case xi.DOWN:g=h+1;break;case xi.UP:g=h-1;break;default:g=h;break}g=(g%c.length+c.length)%c.length,r.selectItem(c[g],[xi.DOWN,xi.UP].includes(f))},r.isSelected=function(l){var c=r.state.selectedItem;return c?r.getId(c)===r.getId(l):!1},r}return Tb(t,[{key:"componentDidMount",value:function(){this.listeners.push(df.add([xi.DOWN,xi.UP],this.scroll),df.add([xi.ENTER,xi.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var a=this,o=r.values,i=this.props.values,l=o.map(function(f){return a.getId(f)}).join(""),c=i.map(function(f){return a.getId(f)}).join("");l!==c&&i&&i[0]&&this.selectItem(i[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),df.remove(r)}},{key:"render",value:function(){var r=this,a=this.props,o=a.values,i=a.component,l=a.style,c=a.itemClassName,f=a.className,h=a.itemStyle;return ne.createElement("ul",{className:"rta__list ".concat(f||""),style:l},o.map(function(g){return ne.createElement(_U,{key:r.getId(g),innerRef:function(w){r.itemsRef[r.getId(g)]=w},selected:r.isSelected(g),item:g,className:c,style:h,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:i})}))}}]),t}(ne.Component);function HU(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,a=t.offsetTop,o=e.scrollTop;ag.right&&w.left+i>y.width?(h=i-y.width,l.push(zc.X.LEFT),c.push(zc.X.RIGHT)):(h=i,l.push(zc.X.RIGHT),c.push(zc.X.LEFT)),_>g.bottom&&w.top+o>y.height?(f=o-y.height,l.push(zc.Y.TOP),c.push(zc.Y.BOTTOM)):(f=o,l.push(zc.Y.BOTTOM),c.push(zc.Y.TOP)),this.props.renderToBody&&(f+=w.top,h+=w.left),this.ref.style.top="".concat(f,"px"),this.ref.style.left="".concat(h,"px"),(r=this.ref.classList).remove.apply(r,c),(a=this.ref.classList).add.apply(a,l)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,i=a.className,l=a.innerRef,c=a.children,f=a.renderToBody,h=document.body,g=ne.createElement("div",{ref:function(w){r.ref=w,l(w)},className:"rta__autocomplete ".concat(i||""),style:o},c);return f&&h!==null?J2.createPortal(g,h):g}}]),t}(ne.Component),N6=function(e){Eb(t,e);function t(n){var r;Bv(this,t),r=Ib(this,Sp(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=df.add(xi.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(df.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var c=r.textareaRef,f=c.selectionStart,h=c.selectionEnd;return f===h?null:r.state.value.substr(f,h-f)},r.setCaretPosition=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(c,c))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var c=r.textareaRef.selectionEnd;return c},r._handleCaretChange=function(c){var f=function(){var y=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?y:0};if(c.type==="keydown"){var h=c.keyCode||c.which;switch(h){case xi.UP:case xi.DOWN:r._isAutocompleteOpen()||f();break;case xi.LEFT:case xi.RIGHT:f();break}return}f()},r._onSelect=function(c){var f=r.state,h=f.selectionEnd,g=f.currentTrigger,y=f.value,w=r.props.onItemSelected;if(g){var S=r._getTextToReplace(g);if(!S){r._closeAutocomplete();return}var D=S(c);if(!D){r._closeAutocomplete();return}w&&w({currentTrigger:g,item:c});var I=function(Z,Q,G){switch(Z){case"start":return G;case"next":case"end":return G+Q.length;default:if(!Number.isInteger(Z))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return Z}},M=y.slice(0,h),N=x0(g),_=M.length-M.lastIndexOf(g),k=M.search(new RegExp("(?!".concat(N,")$")))-_,B=D.caretPosition==="next"?"".concat(D.text," "):D.text,L=I(D.caretPosition,B,k),R=M.substring(0,k)+B,V=y.replace(M,R);r.setState({value:V,dataLoading:!1},function(){var Y=r.tokenRegExpEnding.exec(B),Z=Y?Y[0].length:1;r.lastTrigger=L&&L-Z,r.textareaRef.value=V,r.textareaRef.selectionEnd=L,r._changeHandler();var Q=r.textareaRef.scrollTop;r.setCaretPosition(L),window.chrome&&(r.textareaRef.scrollTop=Q)})}},r._getTextToReplace=function(c){var f=r.props.trigger[c];if(!c||!f)return null;var h=f.output;return function(g){if(typeof g=="object"&&(!h||typeof h!="function"))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(h){var y=h(g,c);if(y===void 0||typeof y=="number")throw new Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}. +Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`))},UU=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],x0=function(t){return LU(t).map(function(n){return UU.includes(n)?"\\".concat(n):n}).join("")},YU=function(e){Eb(t,e);function t(){return Bv(this,t),Ib(this,Sp(t).apply(this,arguments))}return Tb(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var a=document.querySelector(r);if(!a)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=a}else if(r instanceof HTMLElement)this.containerElem=r;else throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var r,a,o=this.props.top||0,i=this.props.left||0,l=[],c=[],f=0,h=0,g=this.containerElem.getBoundingClientRect(),y=this.ref.getBoundingClientRect(),w=this.props.textareaRef.getBoundingClientRect(),S=window.getComputedStyle(this.ref),D=parseInt(S.getPropertyValue("margin-top"),10),I=parseInt(S.getPropertyValue("margin-bottom"),10),M=parseInt(S.getPropertyValue("margin-left"),10),N=parseInt(S.getPropertyValue("margin-right"),10),B=D+I+w.top+o+y.height,k=M+N+w.left+i+y.width;k>g.right&&w.left+i>y.width?(h=i-y.width,l.push(zc.X.LEFT),c.push(zc.X.RIGHT)):(h=i,l.push(zc.X.RIGHT),c.push(zc.X.LEFT)),B>g.bottom&&w.top+o>y.height?(f=o-y.height,l.push(zc.Y.TOP),c.push(zc.Y.BOTTOM)):(f=o,l.push(zc.Y.BOTTOM),c.push(zc.Y.TOP)),this.props.renderToBody&&(f+=w.top,h+=w.left),this.ref.style.top="".concat(f,"px"),this.ref.style.left="".concat(h,"px"),(r=this.ref.classList).remove.apply(r,c),(a=this.ref.classList).add.apply(a,l)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,i=a.className,l=a.innerRef,c=a.children,f=a.renderToBody,h=document.body,g=ne.createElement("div",{ref:function(w){r.ref=w,l(w)},className:"rta__autocomplete ".concat(i||""),style:o},c);return f&&h!==null?J2.createPortal(g,h):g}}]),t}(ne.Component),A6=function(e){Eb(t,e);function t(n){var r;Bv(this,t),r=Ib(this,Sp(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=df.add(xi.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(df.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var c=r.textareaRef,f=c.selectionStart,h=c.selectionEnd;return f===h?null:r.state.value.substr(f,h-f)},r.setCaretPosition=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(c,c))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var c=r.textareaRef.selectionEnd;return c},r._handleCaretChange=function(c){var f=function(){var y=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?y:0};if(c.type==="keydown"){var h=c.keyCode||c.which;switch(h){case xi.UP:case xi.DOWN:r._isAutocompleteOpen()||f();break;case xi.LEFT:case xi.RIGHT:f();break}return}f()},r._onSelect=function(c){var f=r.state,h=f.selectionEnd,g=f.currentTrigger,y=f.value,w=r.props.onItemSelected;if(g){var S=r._getTextToReplace(g);if(!S){r._closeAutocomplete();return}var D=S(c);if(!D){r._closeAutocomplete();return}w&&w({currentTrigger:g,item:c});var I=function(Z,Q,G){switch(Z){case"start":return G;case"next":case"end":return G+Q.length;default:if(!Number.isInteger(Z))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return Z}},M=y.slice(0,h),N=x0(g),B=M.length-M.lastIndexOf(g),k=M.search(new RegExp("(?!".concat(N,")$")))-B,R=D.caretPosition==="next"?"".concat(D.text," "):D.text,L=I(D.caretPosition,R,k),_=M.substring(0,k)+R,V=y.replace(M,_);r.setState({value:V,dataLoading:!1},function(){var U=r.tokenRegExpEnding.exec(R),Z=U?U[0].length:1;r.lastTrigger=L&&L-Z,r.textareaRef.value=V,r.textareaRef.selectionEnd=L,r._changeHandler();var Q=r.textareaRef.scrollTop;r.setCaretPosition(L),window.chrome&&(r.textareaRef.scrollTop=Q)})}},r._getTextToReplace=function(c){var f=r.props.trigger[c];if(!c||!f)return null;var h=f.output;return function(g){if(typeof g=="object"&&(!h||typeof h!="function"))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(h){var y=h(g,c);if(y===void 0||typeof y=="number")throw new Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}. Got "`.concat(String(y),'". Check the implementation for trigger "').concat(c,`" See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information. `));if(y===null)return null;if(typeof y=="string")return{text:y,caretPosition:Ex};if(!y.text&&typeof y.text!="string")throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(c,`" `));if(!y.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(c,`" `));return y}if(typeof g!="string")throw new Error(`Output item should be string -`);return{text:"".concat(c).concat(g).concat(c),caretPosition:Ex}}},r._getCurrentTriggerSettings=function(){var c=r.state.currentTrigger;return c?r.props.trigger[c]:null},r._getValuesFromProvider=function(){var c=r.state,f=c.currentTrigger,h=c.actualToken,g=r._getCurrentTriggerSettings();if(!(!f||!g)){var y=g.dataProvider,w=g.component;if(typeof y!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var S=y(h);S instanceof Promise||(S=Promise.resolve(S)),S.then(function(D){if(!Array.isArray(D))throw new Error("Trigger provider has to provide an array!");if(typeof w!="function")throw new Error("Component should be defined!");if(f===r.state.currentTrigger){if(!D.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:D,component:w})}}).catch(function(D){return Cx(D.message)})}},r._getSuggestions=function(){var c=r.state,f=c.currentTrigger,h=c.data;return!f||!h||h&&!h.length?null:h},r._createRegExp=function(){var c=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(c).sort(function(f,h){return fh?-1:0}).map(function(f){return x0(f)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(c).sort(function(f,h){return fh?-1:0}).map(function(f){return x0(f)}).join("|"),")$"))},r._closeAutocomplete=function(){var c=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){c&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var c=NY({},r.props),f=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var h in c)f.includes(h)&&delete c[h];return c},r._changeHandler=function(c){var f=r.props,h=f.trigger,g=f.onChange,y=f.minChar,w=f.onCaretPositionChange,S=f.movePopupAsYouType,D=r.state,I=D.top,M=D.left,N=c;N||(N=new MY("change",{bubbles:!0}),r.textareaRef.dispatchEvent(N));var _=N.target||r.textareaRef,k=_.selectionEnd,B=_.value;if(r.lastValueBubbledEvent=B,g&&N&&(N.persist&&N.persist(),g(new Proxy(N,{get:function(X,ae,De){return ae==="target"?_:Reflect.get(X,ae,De)}}))),w){var L=r.getCaretPosition();w(L)}r.setState({value:B});var R=function(){var X=EY(_,k),ae=X.top,De=X.left;r.setState({top:ae-r.textareaRef.scrollTop||0,left:De})},V=function(X){r.lastTrigger=k-X,r._closeAutocomplete(),R()};if(k<=r.lastTrigger){var Y=B.slice(0,k),Z=r.tokenRegExp.exec(Y);V(Z?Z[0].length:0)}var Q=B.slice(r.lastTrigger,k),G=r.tokenRegExp.exec(Q),le=G&&G[0],se=G&&G[1]||null,fe=se?se.length-1:0,$=r.tokenRegExpEnding.exec(Q);if($?V($[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!le||le.length<=y+fe)&&(r.state.currentTrigger&&!h[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(se&&h[se].afterWhitespace&&!/\s/.test(B[k-le.length-1])&&B[k-le.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&h[r.state.currentTrigger].allowWhitespace){if(G=new RegExp("".concat(x0(r.state.currentTrigger),".*$")).exec(B.slice(0,k)),le=G&&G[0],!le){r._closeAutocomplete();return}se=Object.keys(h).find(function(ce){return ce.slice(0,fe+1)===le.slice(0,fe+1)})||null}var he=le.slice(1);if(se){(S||I===null&&M===null||r.state.currentTrigger!==se)&&R(),r.escListenerInit();var ie=r._getTextToReplace(se);r.setState({selectionEnd:k,currentTrigger:se,textToReplace:ie,actualToken:he},function(){try{r._getValuesFromProvider()}catch(ce){Cx(ce.message)}})}},r._selectHandler=function(c){var f=r.props,h=f.onCaretPositionChange,g=f.onSelect;if(h){var y=r.getCaretPosition();h(y)}g&&(c.persist(),g(c))},r._shouldStayOpen=function(c){var f=c.relatedTarget;return f===null&&(f=document.activeElement),!!(r.dropdownRef&&f instanceof Node&&r.dropdownRef.contains(f))},r._onClick=function(c){var f=r.props.onClick;f&&(c.persist(),f(c)),!r._shouldStayOpen(c)&&r._closeAutocomplete()},r._onBlur=function(c){var f=r.props.onBlur;f&&(c.persist(),f(c)),!r._shouldStayOpen(c)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(c){var f=r.props.onItemHighlighted,h=r.state.currentTrigger;if(f)if(typeof f=="function")f({currentTrigger:h,item:c});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(c){var f=r.props.scrollToItem;if(f){if(f===!0){BY(r.dropdownRef,c);return}if(typeof f!="function"||f.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");f(r.dropdownRef,c)}},r._isAutocompleteOpen=function(){var c=r.state,f=c.dataLoading,h=c.currentTrigger,g=r._getSuggestions();return!!((f||g)&&h)},r._textareaRef=function(c){r.props.innerRef&&r.props.innerRef(c),r.textareaRef=c},r.lastTrigger=0,r.escListener=null;var a=r.props,o=a.loadingComponent,i=a.trigger,l=a.value;if(l&&(r.state.value=l),r._createRegExp(),!o)throw new Error("RTA: loadingComponent is not defined");if(!i)throw new Error("RTA: trigger is not defined");return r}return Tb(t,[{key:"componentDidMount",value:function(){df.startListen(this.textareaRef),this.textareaRef&&this.textareaRef.addEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("keydown",this._handleCaretChange)}},{key:"componentDidUpdate",value:function(r){var a=r.trigger,o=r.value,i=this.props,l=i.trigger,c=i.value;Object.keys(l).join("")!==Object.keys(a).join("")&&this._createRegExp(),o!==c&&this.lastValueBubbledEvent!==c&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),df.stopListen(this.textareaRef),this.textareaRef&&this.textareaRef.removeEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("keydown",this._handleCaretChange)}},{key:"render",value:function(){var r=this,a=this.props,o=a.loadingComponent,i=a.style,l=a.className,c=a.listStyle,f=a.itemStyle,h=a.boundariesElement,g=a.movePopupAsYouType,y=a.listClassName,w=a.itemClassName,S=a.dropdownClassName,D=a.dropdownStyle,I=a.containerStyle,M=a.containerClassName,N=a.loaderStyle,_=a.loaderClassName,k=a.textAreaComponent,B=a.renderToBody,L=this.state,R=L.left,V=L.top,Y=L.dataLoading,Z=L.component,Q=L.value,G=L.textToReplace,le=this._isAutocompleteOpen(),se=this._getSuggestions(),fe={},$;return k.component?($=k.component,fe[k.ref]=this._textareaRef):($=k,fe.ref=this._textareaRef),ne.createElement("div",{className:"rta ".concat(Y===!0?"rta--loading":""," ").concat(M||""),style:I},ne.createElement($,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(l||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:Q,style:i},fe)),le&&ne.createElement(YY,{innerRef:function(ie){r.dropdownRef=ie},top:V,left:R,style:D,className:S,movePopupAsYouType:g,boundariesElement:h,textareaRef:this.textareaRef,renderToBody:B},se&&Z&&G&&ne.createElement(_Y,{values:se,component:Z,style:c,className:y,itemClassName:w,itemStyle:f,getTextToReplace:G,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),Y&&ne.createElement("div",{className:"rta__loader ".concat(se!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(_||""),style:N},ne.createElement(o,{data:se}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var a=r.value;return a==null?null:{value:a}}}]),t}(ne.Component);N6.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const UY=()=>{const{app:e}=ft.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},zY=e=>{let t=[];const n=ft.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=UY();else{const{tags:o}=we.getState();t=o}const r=e.toLowerCase(),a=[];return t.forEach(o=>{o&&o.toLowerCase().contains(r)&&a.push({name:o,char:o})}),a},VY=e=>{const{app:t}=ft.getState(),n=t.vault.getAllLoadedFiles(),r=[];let a;return n.forEach(o=>{e==="["?a="":e.contains("[")&&(a=e.slice(1));const i=a.toLowerCase();o instanceof x.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(o.extension)&&o.path.toLowerCase().contains(i)&&r.push({name:o.basename,char:o.name,file:o})}),r};var PS=P,WY=function(e){return typeof e=="function"},$Y=function(e){var t=PS.useState(e),n=t[0],r=t[1],a=PS.useRef(n),o=PS.useCallback(function(i){a.current=WY(i)?i(a.current):i,r(a.current)},[]);return[n,o,a]},ZY=$Y;const xo=qt(ZY);function qY(e){return e.containerEl.matches(".memos-list-view")}function jS(){}function GY(e){const n=e.app.workspace.getLeavesOfType("thino_view")[0];return{app:e.app,showSearch:jS,toggleMode:jS,onMarkdownScroll:jS,getMode:()=>"source",getViewType:()=>"thino_view",id:(n==null?void 0:n.id)||ut.randomId(6),scroll:0,editMode:null,get file(){var r;return((r=n==null?void 0:n.view)==null?void 0:r.file)||null},get path(){var r,a;return((a=(r=n==null?void 0:n.view)==null?void 0:r.file)==null?void 0:a.path)||""}}}const JY=(e,t)=>{const{dailyNotesState:{app:n,plugin:r,view:a,dailyNotes:o}}=P.useContext(Lt),[i,l]=P.useState(null),[c,f]=P.useState(!1),[h,g]=P.useState(""),[y,w]=P.useState(null),S=P.useRef(x.debounce((R,V,Y)=>{QY(R,V,Y)},100)),D=P.useRef();P.useEffect(()=>{var R;if(!y){if(!o&&!(n&&window.app)){const V=(R=n||window.app)==null?void 0:R.vault.getMarkdownFiles();w(V[0]);return}for(const V in o)if(o[V]instanceof x.TFile){w(o[V]);break}}},[o]),P.useEffect(()=>{var G;if(!(r!=null&&r.MarkdownEditor)||!e)return;class R extends r.MarkdownEditor{updateBottomPadding(){}onUpdate(se,fe){super.onUpdate(se,fe),M&&M(this.get())}}const V=GY(r),Y=r.addChild(new R(n,e,V));Y&&!t&&a&&dt.setInstance(`${(G=a.leaf)==null?void 0:G.id}`,Y),V.editMode=Y,Y.owner.editor=Y.editor;const Z=KY(n,t?"modal":"view");Y.set&&Y.set(Z||"",!0),n.workspace.trigger("thino-editor-created",e,Y.editor);const Q=Y.cm;return D.current=Q,f(!0),l(Y),()=>{f(!1),i==null||i.destroy(),r.removeChild(Y),D.current=null}},[e,r]),P.useEffect(()=>{!i||!n||S.current(h,n,t?"modal":"view")},[h,n]);const I=()=>{i&&i.toggleSource()},M=x.debounce(R=>N(R),500,!0),N=R=>{g(R)};return{instance:i,value:h,set:R=>{try{i&&((i==null?void 0:i.editor).replaceSelection(R),g(R))}catch(V){console.error(V)}},get:()=>i?i.get():"",append:(R,V)=>{if(!i||V&&V!==i.owner.id)return;const Z=(i.get()||"")+R;(i==null?void 0:i.editor).replaceSelection(R),g(Z)},clear:()=>{i&&(i.clear(),g(""))},toggleSource:I}};function A6(e,t){return`thinoEditorContentCache:${e}:${t||"view"}`}function KY(e,t){try{const n=A6(e==null?void 0:e.appId,t);return la.get([n])[n]||""}catch(n){return console.error(n),""}}function QY(e,t,n){try{const r=A6(t==null?void 0:t.appId,n);la.set({[r]:e})}catch(r){console.error(r)}}function XY(e,t){return{line:e.line,ch:e.ch+t}}const xx=({entity:{name:e,char:t,file:n}})=>v.jsx("div",{children:`${t}`}),eU=({data:e})=>v.jsx("div",{children:"Loading"});let Al;const tU=P.forwardRef((e,t)=>{var Re;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:a},dailyNotesState:{settings:o,app:i}}=P.useContext(Lt),{SaveMemoButtonLabel:l,SaveMemoButtonIcon:c}=o,{className:f,inputerType:h,initialContent:g,placeholder:y,showConfirmBtn:w,showCancelBtn:S,onConfirmBtnClick:D,onCancelBtnClick:I,onContentChange:M}=e,N=P.useRef(null),_=P.useRef(null),k=P.useRef(null),B=TY(),{instance:L,value:R,set:V,get:Y,append:Z,clear:Q,toggleSource:G}=JY(_.current,e.modal),[,le,se]=xo(0),[fe,$]=xo(!1);P.useEffect(()=>{var Fe,Be;if(o&&o.FocusOnEditor)switch(h){case"minimal":case"memos":(Fe=N.current)==null||Fe.focus();break;case"obsidian":L&&((Be=L.editor)==null||Be.focus())}},[o,L]),P.useEffect(()=>{if(!i)return;const Fe=i.workspace.getLeavesOfType(lo);let Be,Xe;Fe.length>0?(Xe=Fe[0].view.containerEl,Be=Xe.offsetHeight):(Xe=document,Be=window.outerHeight),le(Be)},[i]),P.useEffect(()=>{!N.current||h==="obsidian"||g&&(N.current.value=g,B())},[]),P.useEffect(()=>{var Fe;if(h!=="obsidian")if(n){if(!N.current)return;const{tinyUndoActionsCache:Be,tinyUndoIndexCache:Xe}=la.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return k.current=new DY(N.current,{interval:5e3,initialActions:Be,initialIndex:Xe}),k.current.subscribe((Ze,st)=>{la.set({tinyUndoActionsCache:Ze,tinyUndoIndexCache:st})}),()=>{var Ze;(Ze=k.current)==null||Ze.destroy()}}else(Fe=k.current)==null||Fe.destroy(),k.current=null,la.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),P.useEffect(()=>{N.current&&(N.current.style.height="auto",N.current.style.height=(N.current.scrollHeight??0)+"px")},[(Re=N.current)==null?void 0:Re.value]),P.useImperativeHandle(t,()=>({element:N.current,blur:()=>{var Fe,Be;switch(h){case"minimal":case"memos":(Fe=N.current)==null||Fe.blur();break;case"obsidian":L&&((Be=L.editor)==null||Be.blur())}},focus:Fe=>{var Be,Xe,Ze,st,Ct;switch(h){case"minimal":case"memos":(Be=N.current)==null||Be.focus();break;case"obsidian":if(L){if(Fe&&Fe!==((st=(Ze=(Xe=L==null?void 0:L.owner)==null?void 0:Xe.view)==null?void 0:Ze.leaf)==null?void 0:st.id))return;(Ct=L.editor)==null||Ct.focus()}}},insertTag:Fe=>{var Be,Xe,Ze;switch(h){case"minimal":case"memos":{if(!N.current)return;const st=N.current.value;N.current.value=st.slice(0,N.current.selectionStart)+"# "+st.slice(N.current.selectionStart),M(N.current.value),B();break}case"obsidian":if(Fe&&Fe!==((Ze=(Xe=(Be=L==null?void 0:L.owner)==null?void 0:Be.view)==null?void 0:Xe.leaf)==null?void 0:Ze.id))return;if(L){const st=L.editor,Ct=st.getCursor("from");st.replaceRange("#",Ct),st.setSelection(XY(Ct,1))}break}},insertText:(Fe,Be)=>{switch(h){case"minimal":case"memos":{if(!N.current)return;const Xe=N.current.value;N.current.value=Xe.slice(0,N.current.selectionStart)+Fe+Xe.slice(N.current.selectionStart),M(N.current.value),B()}break;case"obsidian":L&&Z(Fe,Be);break}},setContent:Fe=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value=Fe,M(N.current.value),B());break;case"obsidian":L&&V(Fe);break}},getContent:()=>{switch(h){case"minimal":case"memos":return N.current?N.current.value:"";case"obsidian":return Y()}},toggleSource:()=>{switch(h){case"minimal":case"memos":break;case"obsidian":G();break}},clear:()=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value="",M(N.current.value),B());break;case"obsidian":Q();break}}}),[L,h]);const he=Fe=>{if(!N.current)return;const{fileManager:Be}=Le.getState().dailyNotesState.app;if(Fe.currentTrigger==="#"){const Xe=N.current.value;let Ze;Al!=null?Ze=Al.length:Ze=0;let st=N.current.selectionStart;for(let Ct=0;Ct{var Fe;M(((Fe=N.current)==null?void 0:Fe.value)||""),B()},[]),ce=()=>{var Fe;switch(h){case"minimal":case"memos":if(!N.current)return;N.current.value=ae(),D(N.current.value),N.current.value="",B(),(Fe=k.current)==null||Fe.resetState();break;case"obsidian":D(Y()),Q(),B();break}},X=P.useCallback(()=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value="",M(N.current.value),B());break;case"obsidian":Q();break}I()},[h,L,N]),ae=()=>la.get(["thinoEditorContentCache"]).thinoEditorContentCache||"",De=()=>{if(N.current)return N.current.value=ae(),N.current.value},je=Fe=>{switch(Fe){case"memos":return v.jsx(N6,{className:`common-editor-inputer scroll ${fe?" editing":""}`,loadingComponent:eU,placeholder:y,movePopupAsYouType:!0,value:De(),innerRef:Be=>{N.current=Be},onFocus:()=>{$(!0)},onBlur:()=>{$(!1)},onInput:ie,style:{maxHeight:`${se.current>400?se.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:he,scrollToItem:!0,trigger:{"#":{dataProvider:Be=>(Al=Be,zY(Be).map(({name:Xe,char:Ze})=>({name:Xe,char:Ze}))),component:xx,afterWhitespace:!0,output:Be=>Be.char},"[[":{dataProvider:Be=>(Al=Be,VY(Be).slice(0,10).map(({name:Xe,char:Ze,file:st})=>({name:Xe,char:Ze,file:st}))),component:xx,afterWhitespace:!0,output:Be=>Be.char}}});case"minimal":return v.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:y,ref:N,onInput:ie});case"obsidian":return v.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",onClick:()=>{var Be;(Be=L==null?void 0:L.editor)==null||Be.focus()},ref:_});default:return v.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:_})}};return v.jsxs("div",{className:"common-editor-wrapper "+f,children:[je(h),v.jsxs("div",{className:"common-tools-wrapper",children:[v.jsx("div",{className:"common-tools-container",children:v.jsx(ts,{when:e.tools!==void 0,children:e.tools})}),v.jsxs("div",{className:"btns-container",children:[v.jsx(ts,{when:S,children:v.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&X()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&X()},children:at.getState().pathname==="/"&&a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":E("CANCEL EDIT")})}),v.jsx(ts,{when:w,children:v.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&ce()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&ce()},children:[a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":l,v.jsx("span",{className:"icon-text",children:null})]})})]})]})]})}),nU=typeof window<"u"?P.useLayoutEffect:P.useEffect;function rU(e,t,n,r){const a=P.useRef(t);nU(()=>{a.current=t},[t]),P.useEffect(()=>{const o=(n==null?void 0:n.current)||window;if(!(o&&o.addEventListener))return;const i=l=>{a.current(l)};return o.addEventListener(e,i,r),()=>{o.removeEventListener(e,i,r)}},[e,n,r])}function Hv(e,t,n="mousedown"){rU(n,r=>{const a=r.target;if(!a||!a.isConnected||a.closest(".suggestion-container")||a.closest(".menu"))return;(Array.isArray(e)?e.every(i=>i.current&&!i.current.contains(a)):e.current&&!e.current.contains(a))&&t(r)})}const F6=e=>{const{year:t,handleYearChange:n}=e,[r,a]=P.useState([]),[o,i]=P.useState(t),l=P.useRef(null),c=P.useRef(null),[f,h]=ne.useState(!1),g=ne.useRef(null);Hv(g,()=>{h(!1)}),P.useEffect(()=>{l.current&&x.setIcon(l.current,"chevron-left"),c.current&&x.setIcon(c.current,"chevron-right")},[l,c,f]),P.useEffect(()=>{w(o)},[t]);const w=S=>{const D=parseInt(S),I=D-D%10,M=[];for(let N=0;N<10;N++)M.push(`${I+N}`);a(M)};return v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"btn year-btn",onClick:()=>{h(!f)},children:[v.jsx("span",{children:t}),v.jsx("span",{children:E("year")})]}),f&&v.jsxs("div",{ref:g,className:"year-picker-wrapper",children:[v.jsxs("div",{className:"year-picker-header",children:[v.jsxs("div",{className:"year-picker-header-title",children:[o," "+(E("year")||"")]}),v.jsxs("div",{className:"year-picker-header-btns",children:[v.jsx("span",{className:"btn",ref:l,onClick:()=>{const S=parseInt(o)-10;i(S.toString()),w(S.toString())}}),v.jsx("span",{className:"btn",ref:c,onClick:()=>{const S=parseInt(o)+10;i(S.toString()),w(S.toString())}})]})]}),v.jsx("div",{className:"year-picker-body",children:v.jsx("div",{className:"year-picker-body-list",children:r.map(S=>v.jsx("div",{className:`year-picker-body-item ${S===o?"selected":""}`,onClick:()=>{i(S),n(S),h(!1)},children:S},S))})})]})]})},O6=e=>{const{month:t,handleMonthChange:n}=e,[r,a]=P.useState([]),[o,i]=P.useState((parseInt(t)+1).toString()),[l,c]=ne.useState(!1),f=ne.useRef(null);Hv(f,()=>{c(!1)}),P.useEffect(()=>{g()},[t]);const g=()=>{const y=[];for(let w=1;w<=12;w++)y.push(`${w}`);a(y)};return v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"btn month-btn",onClick:()=>{c(!l)},children:[v.jsxs("span",{children:[E("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),v.jsx("span",{children:E("month")||""})]}),l&&v.jsxs("div",{ref:f,className:"month-picker-wrapper",children:[v.jsxs("div",{className:"month-picker-header",children:[v.jsxs("div",{className:"month-picker-header-title",children:[o," "+(E("month")||"")]}),v.jsx("div",{className:"month-picker-header-btns"})]}),v.jsx("div",{className:"month-picker-body",children:v.jsx("div",{className:"month-picker-body-list",children:r.map(y=>v.jsx("div",{className:`month-picker-body-item ${y===o?"selected":""}`,onClick:()=>{i(y),n(y),c(!1)},children:y},y))})})]})]})},Cb=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[a,o]=P.useState(Sg(n)),[i,l]=P.useState(n);P.useEffect(()=>{o(Sg(n))},[n]);const c=new Date(a),f=c.getDay(),h=[];for(let S=0;S{r(D,S.nativeEvent),l(D)},w=S=>{const D=c.getFullYear(),I=c.getMonth()+1;let M=0;I===1&&S===-1?M=new Date(`${D-1}/12/1`).getTime():I===12&&S===1?M=new Date(`${D+1}/1/1`).getTime():M=new Date(`${D}/${I+S}/1`).getTime(),o(Sg(M))};return v.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[v.jsxs("div",{className:"date-picker-header",children:[v.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-left")},className:"btn btn-text",onClick:()=>w(-1)}),v.jsxs("span",{className:"normal-text",children:[v.jsx(F6,{year:c.getFullYear().toString(),handleYearChange:S=>{o(Sg(new Date(`${S}/${c.getMonth()+1}/1`).getTime()))}}),v.jsx(O6,{month:c.getMonth().toString(),handleMonthChange:S=>{o(Sg(new Date(`${c.getFullYear()}/${parseInt(S)}/1`).getTime()))}})]}),v.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-right")},className:"btn btn-text",onClick:()=>w(1)})]}),v.jsxs("div",{className:"date-picker-day-container",children:[v.jsx("div",{className:"date-picker-day-header",children:E("weekDaysShort").map(S=>v.jsx("span",{className:"day-item",children:S},S))}),v.jsx("div",{className:"date-picker-day-content",children:h.map(S=>S.date===0?v.jsx("span",{className:"day-item null",children:""},S.datestamp):v.jsx("span",{className:`day-item ${S.datestamp===n?"current":""} ${S.datestamp===i?"selected":""}`,onClick:D=>y(D,S.datestamp),children:v.jsx("span",{className:"day-item-text",children:S.date})},S.datestamp))})]})]})};function aU(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/ei}function Sg(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}var Mx=function(t){return t.reduce(function(n,r){var a=r[0],o=r[1];return n[a]=o,n},{})},kx=typeof window<"u"&&window.document&&window.document.createElement?P.useLayoutEffect:P.useEffect,ti="top",as="bottom",os="right",ni="left",Q2="auto",Yv=[ti,as,os,ni],Dp="start",tv="end",oU="clippingParents",P6="viewport",Dg="popper",iU="reference",Nx=Yv.reduce(function(e,t){return e.concat([t+"-"+Dp,t+"-"+tv])},[]),X2=[].concat(Yv,[Q2]).reduce(function(e,t){return e.concat([t,t+"-"+Dp,t+"-"+tv])},[]),sU="beforeRead",lU="read",uU="afterRead",cU="beforeMain",dU="main",fU="afterMain",hU="beforeWrite",pU="write",mU="afterWrite",gU=[sU,lU,uU,cU,dU,fU,hU,pU,mU];function eu(e){return e?(e.nodeName||"").toLowerCase():null}function Ni(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bf(e){var t=Ni(e).Element;return e instanceof t||e instanceof Element}function ns(e){var t=Ni(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function eI(e){if(typeof ShadowRoot>"u")return!1;var t=Ni(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function vU(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},a=t.attributes[n]||{},o=t.elements[n];!ns(o)||!eu(o)||(Object.assign(o.style,r),Object.keys(a).forEach(function(i){var l=a[i];l===!1?o.removeAttribute(i):o.setAttribute(i,l===!0?"":l)}))})}function yU(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var a=t.elements[r],o=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(c,f){return c[f]="",c},{});!ns(a)||!eu(a)||(Object.assign(a.style,l),Object.keys(o).forEach(function(c){a.removeAttribute(c)}))})}}const wU={name:"applyStyles",enabled:!0,phase:"write",fn:vU,effect:yU,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var pf=Math.max,Ow=Math.min,Tp=Math.round;function ET(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function j6(){return!/^((?!chrome|android).)*safari/i.test(ET())}function Ip(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&ns(e)&&(a=e.offsetWidth>0&&Tp(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Tp(r.height)/e.offsetHeight||1);var i=bf(e)?Ni(e):window,l=i.visualViewport,c=!j6()&&n,f=(r.left+(c&&l?l.offsetLeft:0))/a,h=(r.top+(c&&l?l.offsetTop:0))/o,g=r.width/a,y=r.height/o;return{width:g,height:y,top:h,right:f+g,bottom:h+y,left:f,x:f,y:h}}function tI(e){var t=Ip(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function L6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&eI(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Vu(e){return Ni(e).getComputedStyle(e)}function bU(e){return["table","td","th"].indexOf(eu(e))>=0}function od(e){return((bf(e)?e.ownerDocument:e.document)||window.document).documentElement}function xb(e){return eu(e)==="html"?e:e.assignedSlot||e.parentNode||(eI(e)?e.host:null)||od(e)}function Ax(e){return!ns(e)||Vu(e).position==="fixed"?null:e.offsetParent}function SU(e){var t=/firefox/i.test(ET()),n=/Trident/i.test(ET());if(n&&ns(e)){var r=Vu(e);if(r.position==="fixed")return null}var a=xb(e);for(eI(a)&&(a=a.host);ns(a)&&["html","body"].indexOf(eu(a))<0;){var o=Vu(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function Uv(e){for(var t=Ni(e),n=Ax(e);n&&bU(n)&&Vu(n).position==="static";)n=Ax(n);return n&&(eu(n)==="html"||eu(n)==="body"&&Vu(n).position==="static")?t:n||SU(e)||t}function nI(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Vg(e,t,n){return pf(e,Ow(t,n))}function DU(e,t,n){var r=Vg(e,t,n);return r>n?n:r}function R6(){return{top:0,right:0,bottom:0,left:0}}function _6(e){return Object.assign({},R6(),e)}function B6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var TU=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,_6(typeof t!="number"?t:B6(t,Yv))};function IU(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Jl(n.placement),c=nI(l),f=[ni,os].indexOf(l)>=0,h=f?"height":"width";if(!(!o||!i)){var g=TU(a.padding,n),y=tI(o),w=c==="y"?ti:ni,S=c==="y"?as:os,D=n.rects.reference[h]+n.rects.reference[c]-i[c]-n.rects.popper[h],I=i[c]-n.rects.reference[c],M=Uv(o),N=M?c==="y"?M.clientHeight||0:M.clientWidth||0:0,_=D/2-I/2,k=g[w],B=N-y[h]-g[S],L=N/2-y[h]/2+_,R=Vg(k,L,B),V=c;n.modifiersData[r]=(t={},t[V]=R,t.centerOffset=R-L,t)}}function EU(e){var t=e.state,n=e.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||L6(t.elements.popper,a)&&(t.elements.arrow=a))}const H6={name:"arrow",enabled:!0,phase:"main",fn:IU,effect:EU,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ep(e){return e.split("-")[1]}var CU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function xU(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:Tp(n*a)/a||0,y:Tp(r*a)/a||0}}function Fx(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,i=e.offsets,l=e.position,c=e.gpuAcceleration,f=e.adaptive,h=e.roundOffsets,g=e.isFixed,y=i.x,w=y===void 0?0:y,S=i.y,D=S===void 0?0:S,I=typeof h=="function"?h({x:w,y:D}):{x:w,y:D};w=I.x,D=I.y;var M=i.hasOwnProperty("x"),N=i.hasOwnProperty("y"),_=ni,k=ti,B=window;if(f){var L=Uv(n),R="clientHeight",V="clientWidth";if(L===Ni(n)&&(L=od(n),Vu(L).position!=="static"&&l==="absolute"&&(R="scrollHeight",V="scrollWidth")),a===ti||(a===ni||a===os)&&o===tv){k=as;var Y=g&&L===B&&B.visualViewport?B.visualViewport.height:L[R];D-=Y-r.height,D*=c?1:-1}if(a===ni||(a===ti||a===as)&&o===tv){_=os;var Z=g&&L===B&&B.visualViewport?B.visualViewport.width:L[V];w-=Z-r.width,w*=c?1:-1}}var Q=Object.assign({position:l},f&&CU),G=h===!0?xU({x:w,y:D},Ni(n)):{x:w,y:D};if(w=G.x,D=G.y,c){var le;return Object.assign({},Q,(le={},le[k]=N?"0":"",le[_]=M?"0":"",le.transform=(B.devicePixelRatio||1)<=1?"translate("+w+"px, "+D+"px)":"translate3d("+w+"px, "+D+"px, 0)",le))}return Object.assign({},Q,(t={},t[k]=N?D+"px":"",t[_]=M?w+"px":"",t.transform="",t))}function MU(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=r===void 0?!0:r,o=n.adaptive,i=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,f={placement:Jl(t.placement),variation:Ep(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fx(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fx(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Y6={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:MU,data:{}};var M0={passive:!0};function kU(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=a===void 0?!0:a,i=r.resize,l=i===void 0?!0:i,c=Ni(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&f.forEach(function(h){h.addEventListener("scroll",n.update,M0)}),l&&c.addEventListener("resize",n.update,M0),function(){o&&f.forEach(function(h){h.removeEventListener("scroll",n.update,M0)}),l&&c.removeEventListener("resize",n.update,M0)}}const U6={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kU,data:{}};var NU={left:"right",right:"left",bottom:"top",top:"bottom"};function sw(e){return e.replace(/left|right|bottom|top/g,function(t){return NU[t]})}var AU={start:"end",end:"start"};function Ox(e){return e.replace(/start|end/g,function(t){return AU[t]})}function rI(e){var t=Ni(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aI(e){return Ip(od(e)).left+rI(e).scrollLeft}function FU(e,t){var n=Ni(e),r=od(e),a=n.visualViewport,o=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){o=a.width,i=a.height;var f=j6();(f||!f&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:o,height:i,x:l+aI(e),y:c}}function OU(e){var t,n=od(e),r=rI(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=pf(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=pf(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+aI(e),c=-r.scrollTop;return Vu(a||n).direction==="rtl"&&(l+=pf(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:l,y:c}}function oI(e){var t=Vu(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function z6(e){return["html","body","#document"].indexOf(eu(e))>=0?e.ownerDocument.body:ns(e)&&oI(e)?e:z6(xb(e))}function Wg(e,t){var n;t===void 0&&(t=[]);var r=z6(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ni(r),i=a?[o].concat(o.visualViewport||[],oI(r)?r:[]):r,l=t.concat(i);return a?l:l.concat(Wg(xb(i)))}function CT(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function PU(e,t){var n=Ip(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Px(e,t,n){return t===P6?CT(FU(e,n)):bf(t)?PU(t,n):CT(OU(od(e)))}function jU(e){var t=Wg(xb(e)),n=["absolute","fixed"].indexOf(Vu(e).position)>=0,r=n&&ns(e)?Uv(e):e;return bf(r)?t.filter(function(a){return bf(a)&&L6(a,r)&&eu(a)!=="body"}):[]}function LU(e,t,n,r){var a=t==="clippingParents"?jU(e):[].concat(t),o=[].concat(a,[n]),i=o[0],l=o.reduce(function(c,f){var h=Px(e,f,r);return c.top=pf(h.top,c.top),c.right=Ow(h.right,c.right),c.bottom=Ow(h.bottom,c.bottom),c.left=pf(h.left,c.left),c},Px(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function V6(e){var t=e.reference,n=e.element,r=e.placement,a=r?Jl(r):null,o=r?Ep(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(a){case ti:c={x:i,y:t.y-n.height};break;case as:c={x:i,y:t.y+t.height};break;case os:c={x:t.x+t.width,y:l};break;case ni:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var f=a?nI(a):null;if(f!=null){var h=f==="y"?"height":"width";switch(o){case Dp:c[f]=c[f]-(t[h]/2-n[h]/2);break;case tv:c[f]=c[f]+(t[h]/2-n[h]/2);break}}return c}function nv(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=r===void 0?e.placement:r,o=n.strategy,i=o===void 0?e.strategy:o,l=n.boundary,c=l===void 0?oU:l,f=n.rootBoundary,h=f===void 0?P6:f,g=n.elementContext,y=g===void 0?Dg:g,w=n.altBoundary,S=w===void 0?!1:w,D=n.padding,I=D===void 0?0:D,M=_6(typeof I!="number"?I:B6(I,Yv)),N=y===Dg?iU:Dg,_=e.rects.popper,k=e.elements[S?N:y],B=LU(bf(k)?k:k.contextElement||od(e.elements.popper),c,h,i),L=Ip(e.elements.reference),R=V6({reference:L,element:_,strategy:"absolute",placement:a}),V=CT(Object.assign({},_,R)),Y=y===Dg?V:L,Z={top:B.top-Y.top+M.top,bottom:Y.bottom-B.bottom+M.bottom,left:B.left-Y.left+M.left,right:Y.right-B.right+M.right},Q=e.modifiersData.offset;if(y===Dg&&Q){var G=Q[a];Object.keys(Z).forEach(function(le){var se=[os,as].indexOf(le)>=0?1:-1,fe=[ti,as].indexOf(le)>=0?"y":"x";Z[le]+=G[fe]*se})}return Z}function RU(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,i=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,f=c===void 0?X2:c,h=Ep(r),g=h?l?Nx:Nx.filter(function(S){return Ep(S)===h}):Yv,y=g.filter(function(S){return f.indexOf(S)>=0});y.length===0&&(y=g);var w=y.reduce(function(S,D){return S[D]=nv(e,{placement:D,boundary:a,rootBoundary:o,padding:i})[Jl(D)],S},{});return Object.keys(w).sort(function(S,D){return w[S]-w[D]})}function _U(e){if(Jl(e)===Q2)return[];var t=sw(e);return[Ox(e),t,Ox(t)]}function BU(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=a===void 0?!0:a,i=n.altAxis,l=i===void 0?!0:i,c=n.fallbackPlacements,f=n.padding,h=n.boundary,g=n.rootBoundary,y=n.altBoundary,w=n.flipVariations,S=w===void 0?!0:w,D=n.allowedAutoPlacements,I=t.options.placement,M=Jl(I),N=M===I,_=c||(N||!S?[sw(I)]:_U(I)),k=[I].concat(_).reduce(function(Re,Fe){return Re.concat(Jl(Fe)===Q2?RU(t,{placement:Fe,boundary:h,rootBoundary:g,padding:f,flipVariations:S,allowedAutoPlacements:D}):Fe)},[]),B=t.rects.reference,L=t.rects.popper,R=new Map,V=!0,Y=k[0],Z=0;Z=0,fe=se?"width":"height",$=nv(t,{placement:Q,boundary:h,rootBoundary:g,altBoundary:y,padding:f}),he=se?le?os:ni:le?as:ti;B[fe]>L[fe]&&(he=sw(he));var ie=sw(he),ce=[];if(o&&ce.push($[G]<=0),l&&ce.push($[he]<=0,$[ie]<=0),ce.every(function(Re){return Re})){Y=Q,V=!1;break}R.set(Q,ce)}if(V)for(var X=S?3:1,ae=function(Fe){var Be=k.find(function(Xe){var Ze=R.get(Xe);if(Ze)return Ze.slice(0,Fe).every(function(st){return st})});if(Be)return Y=Be,"break"},De=X;De>0;De--){var je=ae(De);if(je==="break")break}t.placement!==Y&&(t.modifiersData[r]._skip=!0,t.placement=Y,t.reset=!0)}}const W6={name:"flip",enabled:!0,phase:"main",fn:BU,requiresIfExists:["offset"],data:{_skip:!1}};function jx(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Lx(e){return[ti,os,as,ni].some(function(t){return e[t]>=0})}function HU(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,i=nv(t,{elementContext:"reference"}),l=nv(t,{altBoundary:!0}),c=jx(i,r),f=jx(l,a,o),h=Lx(c),g=Lx(f);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:h,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":g})}const $6={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:HU};function YU(e,t,n){var r=Jl(e),a=[ni,ti].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=o[0],l=o[1];return i=i||0,l=(l||0)*a,[ni,os].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function UU(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=a===void 0?[0,0]:a,i=X2.reduce(function(h,g){return h[g]=YU(g,t.rects,o),h},{}),l=i[t.placement],c=l.x,f=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=i}const Z6={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:UU};function zU(e){var t=e.state,n=e.name;t.modifiersData[n]=V6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const q6={name:"popperOffsets",enabled:!0,phase:"read",fn:zU,data:{}};function VU(e){return e==="x"?"y":"x"}function WU(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=a===void 0?!0:a,i=n.altAxis,l=i===void 0?!1:i,c=n.boundary,f=n.rootBoundary,h=n.altBoundary,g=n.padding,y=n.tether,w=y===void 0?!0:y,S=n.tetherOffset,D=S===void 0?0:S,I=nv(t,{boundary:c,rootBoundary:f,padding:g,altBoundary:h}),M=Jl(t.placement),N=Ep(t.placement),_=!N,k=nI(M),B=VU(k),L=t.modifiersData.popperOffsets,R=t.rects.reference,V=t.rects.popper,Y=typeof D=="function"?D(Object.assign({},t.rects,{placement:t.placement})):D,Z=typeof Y=="number"?{mainAxis:Y,altAxis:Y}:Object.assign({mainAxis:0,altAxis:0},Y),Q=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,G={x:0,y:0};if(L){if(o){var le,se=k==="y"?ti:ni,fe=k==="y"?as:os,$=k==="y"?"height":"width",he=L[k],ie=he+I[se],ce=he-I[fe],X=w?-V[$]/2:0,ae=N===Dp?R[$]:V[$],De=N===Dp?-V[$]:-R[$],je=t.elements.arrow,Re=w&&je?tI(je):{width:0,height:0},Fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:R6(),Be=Fe[se],Xe=Fe[fe],Ze=Vg(0,R[$],Re[$]),st=_?R[$]/2-X-Ze-Be-Z.mainAxis:ae-Ze-Be-Z.mainAxis,Ct=_?-R[$]/2+X+Ze+Xe+Z.mainAxis:De+Ze+Xe+Z.mainAxis,tn=t.elements.arrow&&Uv(t.elements.arrow),_e=tn?k==="y"?tn.clientTop||0:tn.clientLeft||0:0,et=(le=Q==null?void 0:Q[k])!=null?le:0,nt=he+st-et-_e,ht=he+Ct-et,St=Vg(w?Ow(ie,nt):ie,he,w?pf(ce,ht):ce);L[k]=St,G[k]=St-he}if(l){var Tt,Gt=k==="x"?ti:ni,_t=k==="x"?as:os,Vt=L[B],Xt=B==="y"?"height":"width",dn=Vt+I[Gt],en=Vt-I[_t],Zn=[ti,ni].indexOf(M)!==-1,kn=(Tt=Q==null?void 0:Q[B])!=null?Tt:0,Er=Zn?dn:Vt-R[Xt]-V[Xt]-kn+Z.altAxis,pt=Zn?Vt+R[Xt]+V[Xt]-kn-Z.altAxis:en,Mt=w&&Zn?DU(Er,Vt,pt):Vg(w?Er:dn,Vt,w?pt:en);L[B]=Mt,G[B]=Mt-Vt}t.modifiersData[r]=G}}const G6={name:"preventOverflow",enabled:!0,phase:"main",fn:WU,requiresIfExists:["offset"]};function $U(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ZU(e){return e===Ni(e)||!ns(e)?rI(e):$U(e)}function qU(e){var t=e.getBoundingClientRect(),n=Tp(t.width)/e.offsetWidth||1,r=Tp(t.height)/e.offsetHeight||1;return n!==1||r!==1}function GU(e,t,n){n===void 0&&(n=!1);var r=ns(t),a=ns(t)&&qU(t),o=od(t),i=Ip(e,a,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((eu(t)!=="body"||oI(o))&&(l=ZU(t)),ns(t)?(c=Ip(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=aI(o))),{x:i.left+l.scrollLeft-c.x,y:i.top+l.scrollTop-c.y,width:i.width,height:i.height}}function JU(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function a(o){n.add(o.name);var i=[].concat(o.requires||[],o.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&a(c)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||a(o)}),r}function KU(e){var t=JU(e);return gU.reduce(function(n,r){return n.concat(t.filter(function(a){return a.phase===r}))},[])}function QU(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function XU(e){var t=e.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Rx={placement:"bottom",modifiers:[],strategy:"absolute"};function _x(){for(var e=arguments.length,t=new Array(e),n=0;n({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),fz=e=>{const n=P.useRef(null),[r,a]=P.useState(null),[o,i]=P.useState(0);let l,c;const f=()=>{if(x.Platform.isMobile){l="right-end",c=["bottom"];return}const g=window.innerWidth-o>280*1.2,y=window.innerWidth-o<280,w=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){g?(l="right-end",c=["left-end"]):y&&w?(l="left-end",c=["right-end"]):(l="bottom",c=["bottom"]);return}g?(l="top-end",c=["top-start"]):y&&o>280?(l="top-start",c=["top-end"]):(l="top",c=["top"])};P.useEffect(()=>{e&&f()},[o,e==null?void 0:e.DefaultEditorLocation]);const h=Mb(n.current,r,dz(l,c));return{setPosX:i,popperRef:n,setPopperElement:a,popper:h}},hz=()=>{const e=new Set,t=at.getState().query.filter,n=at.getState().query.tag,r=on.getQueryById(t||"");if(r&&r.querystring){const a=JSON.parse(r.querystring);if(Array.isArray(a))for(const o of a)o.type==="TAG"&&o.value&&o.value.operator==="CONTAIN"&&e.add(o.value.value)}return n&&e.add(n),Array.from(e)},pz=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:a,selectionEnd:o}=e,i=document.createElement("div"),l=window.getComputedStyle(e);for(const D of l)i.style.setProperty(D,l.getPropertyValue(D));i.style.position="fixed",i.style.visibility="hidden",i.style.whiteSpace="pre-wrap";const f=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;i.textContent=f.substring(0,o||0),e.tagName==="TEXTAREA"&&(i.style.height="auto");const h=document.createElement("span");h.textContent=f.substring(o||0)||".",i.appendChild(h),document.body.appendChild(i);const{offsetLeft:g,offsetTop:y,offsetHeight:w,offsetWidth:S}=h;return document.body.removeChild(i),{x:t+g,y:n+y,h:r+w,w:a+S}},mf=({className:e,editorType:t,destroy:n,modal:r})=>{const{globalState:a,dailyNotesState:{app:o,settings:i,view:l,verifyState:c}}=P.useContext(Lt),[f,h]=Xl(!0),g=P.useRef(f),[y,w]=xo(!0),S=P.useRef(null),D=P.useRef(null),I=P.useRef(a),[M,N]=xo(!1),[_,k]=xo(!1),{setPosX:B,popperRef:L,setPopperElement:R,popper:V}=fz(i),[Y]=xo(parseInt(x.moment().format("x"))),Z=P.useRef(null),[Q,G]=xo((i==null?void 0:i.EnabledLocationList.length)===1?i==null?void 0:i.EnabledLocationList[0].value:(i==null?void 0:i.MemoSaveLocation)||"DAILY"),le=P.useRef(i.MemoSaveLocation||"DAILY");P.useEffect(()=>{g.current=f},[f]),P.useEffect(()=>{!D.current||!o||!l||(l.registerEvent(o.workspace.on("focus-on-textarea",_e=>{var et;(et=D.current)==null||et.focus(_e==null?void 0:_e.id)})),l.registerEvent(o.workspace.on("blur-on-memos",()=>{var _e;(_e=D.current)==null||_e.blur()})),l.registerEvent(o.workspace.on("send-to-thino",async(_e,et)=>{var nt,ht;if(typeof _e=="string")(nt=D.current)==null||nt.insertText(_e+` -`,et.id);else{const St=_e.toPNG(),Tt=new Blob([St],{type:"image/png"}),Gt=new File([Tt],"image.png",{type:"image/png",lastModified:Date.now()});if(!Gt)return;const _t=await ce(Gt);_t&&((ht=D.current)==null||ht.insertText(_t+` -`,et.id))}})))},[D,l,o]),P.useEffect(()=>{i&&h(i.DefaultPrefix==="List")},[i==null?void 0:i.DefaultPrefix]),P.useEffect(()=>{if(i){if(i.EnabledLocationList.length===1){G(i.EnabledLocationList[0].value);return}G(i.MemoSaveLocation||"DAILY")}},[i==null?void 0:i.MemoSaveLocation,i==null?void 0:i.EnabledLocationList]),P.useEffect(()=>{var nt;if(!i||!Z.current)return;const _e=(nt=Qg.find(ht=>ht.title===Q))==null?void 0:nt.icon;x.setIcon(Z.current,_e),x.requireApiVersion("1.4.4")&&x.setTooltip(Z.current,E("Thino Save To: ")+Q),le.current=Q;const et=a.manifest;if(et){const ht=o==null?void 0:o.plugins.getPlugin(et.id);if(ht){if(ht.settings.MemoSaveLocation===Q)return;ht.settings.MemoSaveLocation=Q,ht.saveSettings()}}},[Q,y]),P.useEffect(()=>{D.current&&i.MemoSaveLocation&&G(i.MemoSaveLocation)},[Z,i]),P.useEffect(()=>{if(!D.current||!i||x.Platform.isDesktop||a.globalEditorShown)return;const _e=i.UseButtonToShowEditor&&i.DefaultEditorLocation==="Bottom";if(x.Platform.isDesktop){w(!0);return}if(t&&t==="inline"){w(!0);return}if(w(x.Platform.isMobile&&!_e),!_e||a.memoListView==="chat")return;const et=document.body.find(".memolist-scrollview");et&&(et.onscroll=()=>{if(a.globalEditorShown)return;if(!a.memoListView&&dt.getState().memoListView==="chat"){et.onscroll=null;return}const nt=D.current.getContent();x.Platform.isMobile&&_e&&!nt&&w(!1)})},[a.globalEditorShown,t,D]);const se=()=>{k(!1)};P.useEffect(()=>{var _e,et,nt,ht,St,Tt,Gt,_t,Vt;if(o&&(a.markMemoId||(_e=a.editMemoId)!=null&&_e.trim()&&a.editMemoId!==I.current.editMemoId)){const Xt=o.workspace.getLeavesOfType("thino_view");Xt.length>0&&o.workspace.revealLeaf(Xt[0])}if(a.markMemoId){const Xt=`${E("MARK")}: [@THINO](${a.markMemoId})`;(et=D.current)==null||et.insertText(Xt),(nt=D.current)==null||nt.focus(),dt.setMarkMemoId("");return}if((ht=a.editMemoId)!=null&&ht.trim()&&a.editMemoId!==I.current.editMemoId){const Xt=we.getMemoById(a.editMemoId);if(Xt)switch(h(Xt.thinoType==="JOURNAL"),i.EditorType){case"memos":(St=D.current)==null||St.setContent(Xt.content.replace(/ \^\S{6}$/,"")||""),(Tt=D.current)==null||Tt.focus();break;case"obsidian":(Gt=D.current)==null||Gt.clear(),(_t=D.current)==null||_t.setContent(Xt.content.replace(/ \^\S{6}$/,"")||""),(Vt=D.current)==null||Vt.focus();break}}I.current=a},[a.markMemoId,a.editMemoId]),P.useEffect(()=>{var _e,et,nt;!D.current||M||i.EditorType==="memos"&&((_e=D.current)==null||_e.element.addEventListener("paste",fe),(et=D.current)==null||et.element.addEventListener("drop",$),(nt=D.current)==null||nt.element.addEventListener("click",he),N(!0))},[D.current]);const fe=async _e=>{var et;if(_e.clipboardData&&_e.clipboardData.files.length>0){_e.preventDefault();const nt=_e.clipboardData.files;for(const ht of nt){const St=await ce(ht);St&&((et=D.current)==null||et.insertText(St))}}},$=async _e=>{var et;if(_e.dataTransfer&&_e.dataTransfer.files.length>0){_e.preventDefault();const nt=_e.dataTransfer.files;for(const ht of nt){const St=await ce(ht);St&&((et=D.current)==null||et.insertText(St))}}},he=()=>{var _e;De(((_e=D.current)==null?void 0:_e.element.value)||"")},ie=async(_e,et)=>{var St,Tt,Gt;const nt=_e.ctrlKey||_e.metaKey,ht=_e.altKey;if(_e.key==="Escape"&&a.globalEditorShown&&(dt.setGlobalEditorShown(!1),_e.preventDefault()),nt&&_e.key==="Enter"){_e.preventDefault(),_e.stopPropagation(),et?(await X((Tt=D.current)==null?void 0:Tt.getContent()),(Gt=D.current)==null||Gt.clear()):await X((St=D.current)==null?void 0:St.element.value);return}if(ht)for(let _t=0;_t{var _t;et||De(((_t=D.current)==null?void 0:_t.element.value)||"")})},ce=P.useCallback(async _e=>{const{type:et}=_e;if(et.startsWith("image"))try{return`${await q2.upload(_e)}`}catch(nt){new x.Notice(nt)}},[]),X=async _e=>{if(!_e||_e.trim()===""){new x.Notice(E("Content cannot be empty"));return}const et=ft.getState().settings,nt=et==null?void 0:et.addTagAutomatically,ht=et==null?void 0:et.addTagWithNewline,St=et==null?void 0:et.addTagPosition,Gt=(hz()||[]).filter(dn=>!_e.includes(`#${dn}`)),_t=async(dn,en)=>{en=en.replaceAll(" "," "),k0("");try{if(!dn){let kn;switch(le.current){case"CANVAS":kn=await we.createMemoCanvas({text:en,isList:g.current});break;case"MULTI":kn=await we.createMemoMultiFile({content:en,isList:g.current});break;case"DAILY":kn=await we.createMemoDaily(en,g.current);break;case"FILE":kn=await we.createMemoSingleFile({content:en,isList:g.current});break}if(!kn)return;we.pushMemo(kn),(!nt||Gt.length===0)&&at.clearQuery();const Er=o||ft.getState().app,pt=Er==null?void 0:Er.loadLocalStorage("tokenForSync");kn&&pt&&i.startSync&&setTimeout(async()=>{try{if(le.current!=="DAILY"){const Mt=await N2({content:en,thinoType:"FILE"});await we.updateMemoById(kn.id,Mt,!0)}}catch(Mt){console.error(Mt)}},200);return}const Zn=we.getMemoById(dn);if(Zn&&(Zn.content!==en||Zn.thinoType!==(g.current?"JOURNAL":"TASK-TODO"))){const kn=await we.updateMemo(Zn.id,en,g.current?"JOURNAL":Zn.thinoType.startsWith("TASK")?Zn.thinoType:"TASK-TODO");kn.updatedAt=ut.getDateTimeString(Date.now()),we.editMemo(kn)}dt.setEditMemoId("")}catch(Zn){new x.Notice(Zn.message)}};n&&n();const{editMemoId:Vt}=dt.getState(),Xt=Gt&&Gt.length>0&&nt&&!Vt?St==="Beginning"?`${Gt.map(dn=>`#${dn}`).join(" ")} ${ht?` +`);return{text:"".concat(c).concat(g).concat(c),caretPosition:Ex}}},r._getCurrentTriggerSettings=function(){var c=r.state.currentTrigger;return c?r.props.trigger[c]:null},r._getValuesFromProvider=function(){var c=r.state,f=c.currentTrigger,h=c.actualToken,g=r._getCurrentTriggerSettings();if(!(!f||!g)){var y=g.dataProvider,w=g.component;if(typeof y!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var S=y(h);S instanceof Promise||(S=Promise.resolve(S)),S.then(function(D){if(!Array.isArray(D))throw new Error("Trigger provider has to provide an array!");if(typeof w!="function")throw new Error("Component should be defined!");if(f===r.state.currentTrigger){if(!D.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:D,component:w})}}).catch(function(D){return Cx(D.message)})}},r._getSuggestions=function(){var c=r.state,f=c.currentTrigger,h=c.data;return!f||!h||h&&!h.length?null:h},r._createRegExp=function(){var c=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(c).sort(function(f,h){return fh?-1:0}).map(function(f){return x0(f)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(c).sort(function(f,h){return fh?-1:0}).map(function(f){return x0(f)}).join("|"),")$"))},r._closeAutocomplete=function(){var c=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){c&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var c=AU({},r.props),f=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var h in c)f.includes(h)&&delete c[h];return c},r._changeHandler=function(c){var f=r.props,h=f.trigger,g=f.onChange,y=f.minChar,w=f.onCaretPositionChange,S=f.movePopupAsYouType,D=r.state,I=D.top,M=D.left,N=c;N||(N=new kU("change",{bubbles:!0}),r.textareaRef.dispatchEvent(N));var B=N.target||r.textareaRef,k=B.selectionEnd,R=B.value;if(r.lastValueBubbledEvent=R,g&&N&&(N.persist&&N.persist(),g(new Proxy(N,{get:function(X,oe,De){return oe==="target"?B:Reflect.get(X,oe,De)}}))),w){var L=r.getCaretPosition();w(L)}r.setState({value:R});var _=function(){var X=CU(B,k),oe=X.top,De=X.left;r.setState({top:oe-r.textareaRef.scrollTop||0,left:De})},V=function(X){r.lastTrigger=k-X,r._closeAutocomplete(),_()};if(k<=r.lastTrigger){var U=R.slice(0,k),Z=r.tokenRegExp.exec(U);V(Z?Z[0].length:0)}var Q=R.slice(r.lastTrigger,k),G=r.tokenRegExp.exec(Q),re=G&&G[0],de=G&&G[1]||null,fe=de?de.length-1:0,$=r.tokenRegExpEnding.exec(Q);if($?V($[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!re||re.length<=y+fe)&&(r.state.currentTrigger&&!h[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(de&&h[de].afterWhitespace&&!/\s/.test(R[k-re.length-1])&&R[k-re.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&h[r.state.currentTrigger].allowWhitespace){if(G=new RegExp("".concat(x0(r.state.currentTrigger),".*$")).exec(R.slice(0,k)),re=G&&G[0],!re){r._closeAutocomplete();return}de=Object.keys(h).find(function(ue){return ue.slice(0,fe+1)===re.slice(0,fe+1)})||null}var he=re.slice(1);if(de){(S||I===null&&M===null||r.state.currentTrigger!==de)&&_(),r.escListenerInit();var se=r._getTextToReplace(de);r.setState({selectionEnd:k,currentTrigger:de,textToReplace:se,actualToken:he},function(){try{r._getValuesFromProvider()}catch(ue){Cx(ue.message)}})}},r._selectHandler=function(c){var f=r.props,h=f.onCaretPositionChange,g=f.onSelect;if(h){var y=r.getCaretPosition();h(y)}g&&(c.persist(),g(c))},r._shouldStayOpen=function(c){var f=c.relatedTarget;return f===null&&(f=document.activeElement),!!(r.dropdownRef&&f instanceof Node&&r.dropdownRef.contains(f))},r._onClick=function(c){var f=r.props.onClick;f&&(c.persist(),f(c)),!r._shouldStayOpen(c)&&r._closeAutocomplete()},r._onBlur=function(c){var f=r.props.onBlur;f&&(c.persist(),f(c)),!r._shouldStayOpen(c)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(c){var f=r.props.onItemHighlighted,h=r.state.currentTrigger;if(f)if(typeof f=="function")f({currentTrigger:h,item:c});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(c){var f=r.props.scrollToItem;if(f){if(f===!0){HU(r.dropdownRef,c);return}if(typeof f!="function"||f.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");f(r.dropdownRef,c)}},r._isAutocompleteOpen=function(){var c=r.state,f=c.dataLoading,h=c.currentTrigger,g=r._getSuggestions();return!!((f||g)&&h)},r._textareaRef=function(c){r.props.innerRef&&r.props.innerRef(c),r.textareaRef=c},r.lastTrigger=0,r.escListener=null;var a=r.props,o=a.loadingComponent,i=a.trigger,l=a.value;if(l&&(r.state.value=l),r._createRegExp(),!o)throw new Error("RTA: loadingComponent is not defined");if(!i)throw new Error("RTA: trigger is not defined");return r}return Tb(t,[{key:"componentDidMount",value:function(){df.startListen(this.textareaRef),this.textareaRef&&this.textareaRef.addEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("keydown",this._handleCaretChange)}},{key:"componentDidUpdate",value:function(r){var a=r.trigger,o=r.value,i=this.props,l=i.trigger,c=i.value;Object.keys(l).join("")!==Object.keys(a).join("")&&this._createRegExp(),o!==c&&this.lastValueBubbledEvent!==c&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),df.stopListen(this.textareaRef),this.textareaRef&&this.textareaRef.removeEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("keydown",this._handleCaretChange)}},{key:"render",value:function(){var r=this,a=this.props,o=a.loadingComponent,i=a.style,l=a.className,c=a.listStyle,f=a.itemStyle,h=a.boundariesElement,g=a.movePopupAsYouType,y=a.listClassName,w=a.itemClassName,S=a.dropdownClassName,D=a.dropdownStyle,I=a.containerStyle,M=a.containerClassName,N=a.loaderStyle,B=a.loaderClassName,k=a.textAreaComponent,R=a.renderToBody,L=this.state,_=L.left,V=L.top,U=L.dataLoading,Z=L.component,Q=L.value,G=L.textToReplace,re=this._isAutocompleteOpen(),de=this._getSuggestions(),fe={},$;return k.component?($=k.component,fe[k.ref]=this._textareaRef):($=k,fe.ref=this._textareaRef),ne.createElement("div",{className:"rta ".concat(U===!0?"rta--loading":""," ").concat(M||""),style:I},ne.createElement($,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(l||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:Q,style:i},fe)),re&&ne.createElement(YU,{innerRef:function(se){r.dropdownRef=se},top:V,left:_,style:D,className:S,movePopupAsYouType:g,boundariesElement:h,textareaRef:this.textareaRef,renderToBody:R},de&&Z&&G&&ne.createElement(BU,{values:de,component:Z,style:c,className:y,itemClassName:w,itemStyle:f,getTextToReplace:G,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),U&&ne.createElement("div",{className:"rta__loader ".concat(de!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(B||""),style:N},ne.createElement(o,{data:de}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var a=r.value;return a==null?null:{value:a}}}]),t}(ne.Component);A6.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const zU=()=>{const{app:e}=ft.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},VU=e=>{let t=[];const n=ft.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=zU();else{const{tags:o}=we.getState();t=o}const r=e.toLowerCase(),a=[];return t.forEach(o=>{o&&o.toLowerCase().contains(r)&&a.push({name:o,char:o})}),a},WU=e=>{const{app:t}=ft.getState(),n=t.vault.getAllLoadedFiles(),r=[];let a;return n.forEach(o=>{e==="["?a="":e.contains("[")&&(a=e.slice(1));const i=a.toLowerCase();o instanceof x.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(o.extension)&&o.path.toLowerCase().contains(i)&&r.push({name:o.basename,char:o.name,file:o})}),r};var PS=P,$U=function(e){return typeof e=="function"},ZU=function(e){var t=PS.useState(e),n=t[0],r=t[1],a=PS.useRef(n),o=PS.useCallback(function(i){a.current=$U(i)?i(a.current):i,r(a.current)},[]);return[n,o,a]},qU=ZU;const xo=qt(qU);function GU(e){return e.containerEl.matches(".memos-list-view")}function jS(){}function JU(e){const n=e.app.workspace.getLeavesOfType("thino_view")[0];return{app:e.app,showSearch:jS,toggleMode:jS,onMarkdownScroll:jS,getMode:()=>"source",getViewType:()=>"thino_view",id:(n==null?void 0:n.id)||ut.randomId(6),scroll:0,editMode:null,get file(){var r;return((r=n==null?void 0:n.view)==null?void 0:r.file)||null},get path(){var r,a;return((a=(r=n==null?void 0:n.view)==null?void 0:r.file)==null?void 0:a.path)||""}}}const KU=(e,t)=>{const{dailyNotesState:{app:n,plugin:r,view:a,dailyNotes:o}}=P.useContext(Lt),[i,l]=P.useState(null),[c,f]=P.useState(!1),[h,g]=P.useState(""),[y,w]=P.useState(null),S=P.useRef(x.debounce((_,V,U)=>{XU(_,V,U)},100)),D=P.useRef();P.useEffect(()=>{var _;if(!y){if(!o&&!(n&&window.app)){const V=(_=n||window.app)==null?void 0:_.vault.getMarkdownFiles();w(V[0]);return}for(const V in o)if(o[V]instanceof x.TFile){w(o[V]);break}}},[o]),P.useEffect(()=>{var G;if(!(r!=null&&r.MarkdownEditor)||!e)return;class _ extends r.MarkdownEditor{updateBottomPadding(){}onUpdate(de,fe){super.onUpdate(de,fe),M&&M(this.get())}}const V=JU(r),U=r.addChild(new _(n,e,V));U&&!t&&a&&dt.setInstance(`${(G=a.leaf)==null?void 0:G.id}`,U),V.editMode=U,U.owner.editor=U.editor;const Z=QU(n,t?"modal":"view");U.set&&U.set(Z||"",!0),n.workspace.trigger("thino-editor-created",e,U.editor);const Q=U.cm;return D.current=Q,f(!0),l(U),()=>{f(!1),i==null||i.destroy(),r.removeChild(U),D.current=null}},[e,r]),P.useEffect(()=>{!i||!n||S.current(h,n,t?"modal":"view")},[h,n]);const I=()=>{i&&i.toggleSource()},M=x.debounce(_=>N(_),500,!0),N=_=>{g(_)};return{instance:i,value:h,set:_=>{try{i&&((i==null?void 0:i.editor).replaceSelection(_),g(_))}catch(V){console.error(V)}},get:()=>i?i.get():"",append:(_,V)=>{if(!i||V&&V!==i.owner.id)return;const Z=(i.get()||"")+_;(i==null?void 0:i.editor).replaceSelection(_),g(Z)},clear:()=>{i&&(i.clear(),g(""))},toggleSource:I}};function F6(e,t){return`thinoEditorContentCache:${e}:${t||"view"}`}function QU(e,t){try{const n=F6(e==null?void 0:e.appId,t);return la.get([n])[n]||""}catch(n){return console.error(n),""}}function XU(e,t,n){try{const r=F6(t==null?void 0:t.appId,n);la.set({[r]:e})}catch(r){console.error(r)}}function eY(e,t){return{line:e.line,ch:e.ch+t}}const xx=({entity:{name:e,char:t,file:n}})=>v.jsx("div",{children:`${t}`}),tY=({data:e})=>v.jsx("div",{children:"Loading"});let Al;const nY=P.forwardRef((e,t)=>{var Re;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:a},dailyNotesState:{settings:o,app:i}}=P.useContext(Lt),{SaveMemoButtonLabel:l,SaveMemoButtonIcon:c}=o,{className:f,inputerType:h,initialContent:g,placeholder:y,showConfirmBtn:w,showCancelBtn:S,onConfirmBtnClick:D,onCancelBtnClick:I,onContentChange:M}=e,N=P.useRef(null),B=P.useRef(null),k=P.useRef(null),R=IU(),{instance:L,value:_,set:V,get:U,append:Z,clear:Q,toggleSource:G}=KU(B.current,e.modal),[,re,de]=xo(0),[fe,$]=xo(!1);P.useEffect(()=>{var Fe,Be;if(o&&o.FocusOnEditor)switch(h){case"minimal":case"memos":(Fe=N.current)==null||Fe.focus();break;case"obsidian":L&&((Be=L.editor)==null||Be.focus())}},[o,L]),P.useEffect(()=>{if(!i)return;const Fe=i.workspace.getLeavesOfType(lo);let Be,Xe;Fe.length>0?(Xe=Fe[0].view.containerEl,Be=Xe.offsetHeight):(Xe=document,Be=window.outerHeight),re(Be)},[i]),P.useEffect(()=>{!N.current||h==="obsidian"||g&&(N.current.value=g,R())},[]),P.useEffect(()=>{var Fe;if(h!=="obsidian")if(n){if(!N.current)return;const{tinyUndoActionsCache:Be,tinyUndoIndexCache:Xe}=la.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return k.current=new TU(N.current,{interval:5e3,initialActions:Be,initialIndex:Xe}),k.current.subscribe((Ze,st)=>{la.set({tinyUndoActionsCache:Ze,tinyUndoIndexCache:st})}),()=>{var Ze;(Ze=k.current)==null||Ze.destroy()}}else(Fe=k.current)==null||Fe.destroy(),k.current=null,la.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),P.useEffect(()=>{N.current&&(N.current.style.height="auto",N.current.style.height=(N.current.scrollHeight??0)+"px")},[(Re=N.current)==null?void 0:Re.value]),P.useImperativeHandle(t,()=>({element:N.current,blur:()=>{var Fe,Be;switch(h){case"minimal":case"memos":(Fe=N.current)==null||Fe.blur();break;case"obsidian":L&&((Be=L.editor)==null||Be.blur())}},focus:Fe=>{var Be,Xe,Ze,st,Ct;switch(h){case"minimal":case"memos":(Be=N.current)==null||Be.focus();break;case"obsidian":if(L){if(Fe&&Fe!==((st=(Ze=(Xe=L==null?void 0:L.owner)==null?void 0:Xe.view)==null?void 0:Ze.leaf)==null?void 0:st.id))return;(Ct=L.editor)==null||Ct.focus()}}},insertTag:Fe=>{var Be,Xe,Ze;switch(h){case"minimal":case"memos":{if(!N.current)return;const st=N.current.value;N.current.value=st.slice(0,N.current.selectionStart)+"# "+st.slice(N.current.selectionStart),M(N.current.value),R();break}case"obsidian":if(Fe&&Fe!==((Ze=(Xe=(Be=L==null?void 0:L.owner)==null?void 0:Be.view)==null?void 0:Xe.leaf)==null?void 0:Ze.id))return;if(L){const st=L.editor,Ct=st.getCursor("from");st.replaceRange("#",Ct),st.setSelection(eY(Ct,1))}break}},insertText:(Fe,Be)=>{switch(h){case"minimal":case"memos":{if(!N.current)return;const Xe=N.current.value;N.current.value=Xe.slice(0,N.current.selectionStart)+Fe+Xe.slice(N.current.selectionStart),M(N.current.value),R()}break;case"obsidian":L&&Z(Fe,Be);break}},setContent:Fe=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value=Fe,M(N.current.value),R());break;case"obsidian":L&&V(Fe);break}},getContent:()=>{switch(h){case"minimal":case"memos":return N.current?N.current.value:"";case"obsidian":return U()}},toggleSource:()=>{switch(h){case"minimal":case"memos":break;case"obsidian":G();break}},clear:()=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value="",M(N.current.value),R());break;case"obsidian":Q();break}}}),[L,h]);const he=Fe=>{if(!N.current)return;const{fileManager:Be}=Le.getState().dailyNotesState.app;if(Fe.currentTrigger==="#"){const Xe=N.current.value;let Ze;Al!=null?Ze=Al.length:Ze=0;let st=N.current.selectionStart;for(let Ct=0;Ct{var Fe;M(((Fe=N.current)==null?void 0:Fe.value)||""),R()},[]),ue=()=>{var Fe;switch(h){case"minimal":case"memos":if(!N.current)return;N.current.value=oe(),D(N.current.value),N.current.value="",R(),(Fe=k.current)==null||Fe.resetState();break;case"obsidian":D(U()),Q(),R();break}},X=P.useCallback(()=>{switch(h){case"minimal":case"memos":N.current&&(N.current.value="",M(N.current.value),R());break;case"obsidian":Q();break}I()},[h,L,N]),oe=()=>la.get(["thinoEditorContentCache"]).thinoEditorContentCache||"",De=()=>{if(N.current)return N.current.value=oe(),N.current.value},je=Fe=>{switch(Fe){case"memos":return v.jsx(A6,{className:`common-editor-inputer scroll ${fe?" editing":""}`,loadingComponent:tY,placeholder:y,movePopupAsYouType:!0,value:De(),innerRef:Be=>{N.current=Be},onFocus:()=>{$(!0)},onBlur:()=>{$(!1)},onInput:se,style:{maxHeight:`${de.current>400?de.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:he,scrollToItem:!0,trigger:{"#":{dataProvider:Be=>(Al=Be,VU(Be).map(({name:Xe,char:Ze})=>({name:Xe,char:Ze}))),component:xx,afterWhitespace:!0,output:Be=>Be.char},"[[":{dataProvider:Be=>(Al=Be,WU(Be).slice(0,10).map(({name:Xe,char:Ze,file:st})=>({name:Xe,char:Ze,file:st}))),component:xx,afterWhitespace:!0,output:Be=>Be.char}}});case"minimal":return v.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:y,ref:N,onInput:se});case"obsidian":return v.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",onClick:()=>{var Be;(Be=L==null?void 0:L.editor)==null||Be.focus()},ref:B});default:return v.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:B})}};return v.jsxs("div",{className:"common-editor-wrapper "+f,children:[je(h),v.jsxs("div",{className:"common-tools-wrapper",children:[v.jsx("div",{className:"common-tools-container",children:v.jsx(ts,{when:e.tools!==void 0,children:e.tools})}),v.jsxs("div",{className:"btns-container",children:[v.jsx(ts,{when:S,children:v.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&X()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&X()},children:at.getState().pathname==="/"&&a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":E("CANCEL EDIT")})}),v.jsx(ts,{when:w,children:v.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&ue()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&ue()},children:[a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":l,v.jsx("span",{className:"icon-text",children:null})]})})]})]})]})}),rY=typeof window<"u"?P.useLayoutEffect:P.useEffect;function aY(e,t,n,r){const a=P.useRef(t);rY(()=>{a.current=t},[t]),P.useEffect(()=>{const o=(n==null?void 0:n.current)||window;if(!(o&&o.addEventListener))return;const i=l=>{a.current(l)};return o.addEventListener(e,i,r),()=>{o.removeEventListener(e,i,r)}},[e,n,r])}function Hv(e,t,n="mousedown"){aY(n,r=>{const a=r.target;if(!a||!a.isConnected||a.closest(".suggestion-container")||a.closest(".menu"))return;(Array.isArray(e)?e.every(i=>i.current&&!i.current.contains(a)):e.current&&!e.current.contains(a))&&t(r)})}const O6=e=>{const{year:t,handleYearChange:n}=e,[r,a]=P.useState([]),[o,i]=P.useState(t),l=P.useRef(null),c=P.useRef(null),[f,h]=ne.useState(!1),g=ne.useRef(null);Hv(g,()=>{h(!1)}),P.useEffect(()=>{l.current&&x.setIcon(l.current,"chevron-left"),c.current&&x.setIcon(c.current,"chevron-right")},[l,c,f]),P.useEffect(()=>{w(o)},[t]);const w=S=>{const D=parseInt(S),I=D-D%10,M=[];for(let N=0;N<10;N++)M.push(`${I+N}`);a(M)};return v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"btn year-btn",onClick:()=>{h(!f)},children:[v.jsx("span",{children:t}),v.jsx("span",{children:E("year")})]}),f&&v.jsxs("div",{ref:g,className:"year-picker-wrapper",children:[v.jsxs("div",{className:"year-picker-header",children:[v.jsxs("div",{className:"year-picker-header-title",children:[o," "+(E("year")||"")]}),v.jsxs("div",{className:"year-picker-header-btns",children:[v.jsx("span",{className:"btn",ref:l,onClick:()=>{const S=parseInt(o)-10;i(S.toString()),w(S.toString())}}),v.jsx("span",{className:"btn",ref:c,onClick:()=>{const S=parseInt(o)+10;i(S.toString()),w(S.toString())}})]})]}),v.jsx("div",{className:"year-picker-body",children:v.jsx("div",{className:"year-picker-body-list",children:r.map(S=>v.jsx("div",{className:`year-picker-body-item ${S===o?"selected":""}`,onClick:()=>{i(S),n(S),h(!1)},children:S},S))})})]})]})},P6=e=>{const{month:t,handleMonthChange:n}=e,[r,a]=P.useState([]),[o,i]=P.useState((parseInt(t)+1).toString()),[l,c]=ne.useState(!1),f=ne.useRef(null);Hv(f,()=>{c(!1)}),P.useEffect(()=>{g()},[t]);const g=()=>{const y=[];for(let w=1;w<=12;w++)y.push(`${w}`);a(y)};return v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"btn month-btn",onClick:()=>{c(!l)},children:[v.jsxs("span",{children:[E("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),v.jsx("span",{children:E("month")||""})]}),l&&v.jsxs("div",{ref:f,className:"month-picker-wrapper",children:[v.jsxs("div",{className:"month-picker-header",children:[v.jsxs("div",{className:"month-picker-header-title",children:[o," "+(E("month")||"")]}),v.jsx("div",{className:"month-picker-header-btns"})]}),v.jsx("div",{className:"month-picker-body",children:v.jsx("div",{className:"month-picker-body-list",children:r.map(y=>v.jsx("div",{className:`month-picker-body-item ${y===o?"selected":""}`,onClick:()=>{i(y),n(y),c(!1)},children:y},y))})})]})]})},Cb=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[a,o]=P.useState(Sg(n)),[i,l]=P.useState(n);P.useEffect(()=>{o(Sg(n))},[n]);const c=new Date(a),f=c.getDay(),h=[];for(let S=0;S{r(D,S.nativeEvent),l(D)},w=S=>{const D=c.getFullYear(),I=c.getMonth()+1;let M=0;I===1&&S===-1?M=new Date(`${D-1}/12/1`).getTime():I===12&&S===1?M=new Date(`${D+1}/1/1`).getTime():M=new Date(`${D}/${I+S}/1`).getTime(),o(Sg(M))};return v.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[v.jsxs("div",{className:"date-picker-header",children:[v.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-left")},className:"btn btn-text",onClick:()=>w(-1)}),v.jsxs("span",{className:"normal-text",children:[v.jsx(O6,{year:c.getFullYear().toString(),handleYearChange:S=>{o(Sg(new Date(`${S}/${c.getMonth()+1}/1`).getTime()))}}),v.jsx(P6,{month:c.getMonth().toString(),handleMonthChange:S=>{o(Sg(new Date(`${c.getFullYear()}/${parseInt(S)}/1`).getTime()))}})]}),v.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-right")},className:"btn btn-text",onClick:()=>w(1)})]}),v.jsxs("div",{className:"date-picker-day-container",children:[v.jsx("div",{className:"date-picker-day-header",children:E("weekDaysShort").map(S=>v.jsx("span",{className:"day-item",children:S},S))}),v.jsx("div",{className:"date-picker-day-content",children:h.map(S=>S.date===0?v.jsx("span",{className:"day-item null",children:""},S.datestamp):v.jsx("span",{className:`day-item ${S.datestamp===n?"current":""} ${S.datestamp===i?"selected":""}`,onClick:D=>y(D,S.datestamp),children:v.jsx("span",{className:"day-item-text",children:S.date})},S.datestamp))})]})]})};function oY(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/ei}function Sg(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}var Mx=function(t){return t.reduce(function(n,r){var a=r[0],o=r[1];return n[a]=o,n},{})},kx=typeof window<"u"&&window.document&&window.document.createElement?P.useLayoutEffect:P.useEffect,ti="top",as="bottom",os="right",ni="left",Q2="auto",Uv=[ti,as,os,ni],Dp="start",tv="end",iY="clippingParents",j6="viewport",Dg="popper",sY="reference",Nx=Uv.reduce(function(e,t){return e.concat([t+"-"+Dp,t+"-"+tv])},[]),X2=[].concat(Uv,[Q2]).reduce(function(e,t){return e.concat([t,t+"-"+Dp,t+"-"+tv])},[]),lY="beforeRead",uY="read",cY="afterRead",dY="beforeMain",fY="main",hY="afterMain",pY="beforeWrite",mY="write",gY="afterWrite",vY=[lY,uY,cY,dY,fY,hY,pY,mY,gY];function eu(e){return e?(e.nodeName||"").toLowerCase():null}function Ni(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bf(e){var t=Ni(e).Element;return e instanceof t||e instanceof Element}function ns(e){var t=Ni(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function eI(e){if(typeof ShadowRoot>"u")return!1;var t=Ni(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yY(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},a=t.attributes[n]||{},o=t.elements[n];!ns(o)||!eu(o)||(Object.assign(o.style,r),Object.keys(a).forEach(function(i){var l=a[i];l===!1?o.removeAttribute(i):o.setAttribute(i,l===!0?"":l)}))})}function wY(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var a=t.elements[r],o=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(c,f){return c[f]="",c},{});!ns(a)||!eu(a)||(Object.assign(a.style,l),Object.keys(o).forEach(function(c){a.removeAttribute(c)}))})}}const bY={name:"applyStyles",enabled:!0,phase:"write",fn:yY,effect:wY,requires:["computeStyles"]};function Jl(e){return e.split("-")[0]}var pf=Math.max,Ow=Math.min,Tp=Math.round;function ET(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function L6(){return!/^((?!chrome|android).)*safari/i.test(ET())}function Ip(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&ns(e)&&(a=e.offsetWidth>0&&Tp(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Tp(r.height)/e.offsetHeight||1);var i=bf(e)?Ni(e):window,l=i.visualViewport,c=!L6()&&n,f=(r.left+(c&&l?l.offsetLeft:0))/a,h=(r.top+(c&&l?l.offsetTop:0))/o,g=r.width/a,y=r.height/o;return{width:g,height:y,top:h,right:f+g,bottom:h+y,left:f,x:f,y:h}}function tI(e){var t=Ip(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function R6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&eI(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Vu(e){return Ni(e).getComputedStyle(e)}function SY(e){return["table","td","th"].indexOf(eu(e))>=0}function od(e){return((bf(e)?e.ownerDocument:e.document)||window.document).documentElement}function xb(e){return eu(e)==="html"?e:e.assignedSlot||e.parentNode||(eI(e)?e.host:null)||od(e)}function Ax(e){return!ns(e)||Vu(e).position==="fixed"?null:e.offsetParent}function DY(e){var t=/firefox/i.test(ET()),n=/Trident/i.test(ET());if(n&&ns(e)){var r=Vu(e);if(r.position==="fixed")return null}var a=xb(e);for(eI(a)&&(a=a.host);ns(a)&&["html","body"].indexOf(eu(a))<0;){var o=Vu(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function Yv(e){for(var t=Ni(e),n=Ax(e);n&&SY(n)&&Vu(n).position==="static";)n=Ax(n);return n&&(eu(n)==="html"||eu(n)==="body"&&Vu(n).position==="static")?t:n||DY(e)||t}function nI(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Vg(e,t,n){return pf(e,Ow(t,n))}function TY(e,t,n){var r=Vg(e,t,n);return r>n?n:r}function _6(){return{top:0,right:0,bottom:0,left:0}}function B6(e){return Object.assign({},_6(),e)}function H6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var IY=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B6(typeof t!="number"?t:H6(t,Uv))};function EY(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Jl(n.placement),c=nI(l),f=[ni,os].indexOf(l)>=0,h=f?"height":"width";if(!(!o||!i)){var g=IY(a.padding,n),y=tI(o),w=c==="y"?ti:ni,S=c==="y"?as:os,D=n.rects.reference[h]+n.rects.reference[c]-i[c]-n.rects.popper[h],I=i[c]-n.rects.reference[c],M=Yv(o),N=M?c==="y"?M.clientHeight||0:M.clientWidth||0:0,B=D/2-I/2,k=g[w],R=N-y[h]-g[S],L=N/2-y[h]/2+B,_=Vg(k,L,R),V=c;n.modifiersData[r]=(t={},t[V]=_,t.centerOffset=_-L,t)}}function CY(e){var t=e.state,n=e.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||R6(t.elements.popper,a)&&(t.elements.arrow=a))}const U6={name:"arrow",enabled:!0,phase:"main",fn:EY,effect:CY,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ep(e){return e.split("-")[1]}var xY={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MY(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:Tp(n*a)/a||0,y:Tp(r*a)/a||0}}function Fx(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,i=e.offsets,l=e.position,c=e.gpuAcceleration,f=e.adaptive,h=e.roundOffsets,g=e.isFixed,y=i.x,w=y===void 0?0:y,S=i.y,D=S===void 0?0:S,I=typeof h=="function"?h({x:w,y:D}):{x:w,y:D};w=I.x,D=I.y;var M=i.hasOwnProperty("x"),N=i.hasOwnProperty("y"),B=ni,k=ti,R=window;if(f){var L=Yv(n),_="clientHeight",V="clientWidth";if(L===Ni(n)&&(L=od(n),Vu(L).position!=="static"&&l==="absolute"&&(_="scrollHeight",V="scrollWidth")),a===ti||(a===ni||a===os)&&o===tv){k=as;var U=g&&L===R&&R.visualViewport?R.visualViewport.height:L[_];D-=U-r.height,D*=c?1:-1}if(a===ni||(a===ti||a===as)&&o===tv){B=os;var Z=g&&L===R&&R.visualViewport?R.visualViewport.width:L[V];w-=Z-r.width,w*=c?1:-1}}var Q=Object.assign({position:l},f&&xY),G=h===!0?MY({x:w,y:D},Ni(n)):{x:w,y:D};if(w=G.x,D=G.y,c){var re;return Object.assign({},Q,(re={},re[k]=N?"0":"",re[B]=M?"0":"",re.transform=(R.devicePixelRatio||1)<=1?"translate("+w+"px, "+D+"px)":"translate3d("+w+"px, "+D+"px, 0)",re))}return Object.assign({},Q,(t={},t[k]=N?D+"px":"",t[B]=M?w+"px":"",t.transform="",t))}function kY(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=r===void 0?!0:r,o=n.adaptive,i=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,f={placement:Jl(t.placement),variation:Ep(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fx(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fx(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Y6={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kY,data:{}};var M0={passive:!0};function NY(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=a===void 0?!0:a,i=r.resize,l=i===void 0?!0:i,c=Ni(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&f.forEach(function(h){h.addEventListener("scroll",n.update,M0)}),l&&c.addEventListener("resize",n.update,M0),function(){o&&f.forEach(function(h){h.removeEventListener("scroll",n.update,M0)}),l&&c.removeEventListener("resize",n.update,M0)}}const z6={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:NY,data:{}};var AY={left:"right",right:"left",bottom:"top",top:"bottom"};function sw(e){return e.replace(/left|right|bottom|top/g,function(t){return AY[t]})}var FY={start:"end",end:"start"};function Ox(e){return e.replace(/start|end/g,function(t){return FY[t]})}function rI(e){var t=Ni(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function aI(e){return Ip(od(e)).left+rI(e).scrollLeft}function OY(e,t){var n=Ni(e),r=od(e),a=n.visualViewport,o=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){o=a.width,i=a.height;var f=L6();(f||!f&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:o,height:i,x:l+aI(e),y:c}}function PY(e){var t,n=od(e),r=rI(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=pf(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=pf(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+aI(e),c=-r.scrollTop;return Vu(a||n).direction==="rtl"&&(l+=pf(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:i,x:l,y:c}}function oI(e){var t=Vu(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function V6(e){return["html","body","#document"].indexOf(eu(e))>=0?e.ownerDocument.body:ns(e)&&oI(e)?e:V6(xb(e))}function Wg(e,t){var n;t===void 0&&(t=[]);var r=V6(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ni(r),i=a?[o].concat(o.visualViewport||[],oI(r)?r:[]):r,l=t.concat(i);return a?l:l.concat(Wg(xb(i)))}function CT(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function jY(e,t){var n=Ip(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Px(e,t,n){return t===j6?CT(OY(e,n)):bf(t)?jY(t,n):CT(PY(od(e)))}function LY(e){var t=Wg(xb(e)),n=["absolute","fixed"].indexOf(Vu(e).position)>=0,r=n&&ns(e)?Yv(e):e;return bf(r)?t.filter(function(a){return bf(a)&&R6(a,r)&&eu(a)!=="body"}):[]}function RY(e,t,n,r){var a=t==="clippingParents"?LY(e):[].concat(t),o=[].concat(a,[n]),i=o[0],l=o.reduce(function(c,f){var h=Px(e,f,r);return c.top=pf(h.top,c.top),c.right=Ow(h.right,c.right),c.bottom=Ow(h.bottom,c.bottom),c.left=pf(h.left,c.left),c},Px(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function W6(e){var t=e.reference,n=e.element,r=e.placement,a=r?Jl(r):null,o=r?Ep(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(a){case ti:c={x:i,y:t.y-n.height};break;case as:c={x:i,y:t.y+t.height};break;case os:c={x:t.x+t.width,y:l};break;case ni:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var f=a?nI(a):null;if(f!=null){var h=f==="y"?"height":"width";switch(o){case Dp:c[f]=c[f]-(t[h]/2-n[h]/2);break;case tv:c[f]=c[f]+(t[h]/2-n[h]/2);break}}return c}function nv(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=r===void 0?e.placement:r,o=n.strategy,i=o===void 0?e.strategy:o,l=n.boundary,c=l===void 0?iY:l,f=n.rootBoundary,h=f===void 0?j6:f,g=n.elementContext,y=g===void 0?Dg:g,w=n.altBoundary,S=w===void 0?!1:w,D=n.padding,I=D===void 0?0:D,M=B6(typeof I!="number"?I:H6(I,Uv)),N=y===Dg?sY:Dg,B=e.rects.popper,k=e.elements[S?N:y],R=RY(bf(k)?k:k.contextElement||od(e.elements.popper),c,h,i),L=Ip(e.elements.reference),_=W6({reference:L,element:B,strategy:"absolute",placement:a}),V=CT(Object.assign({},B,_)),U=y===Dg?V:L,Z={top:R.top-U.top+M.top,bottom:U.bottom-R.bottom+M.bottom,left:R.left-U.left+M.left,right:U.right-R.right+M.right},Q=e.modifiersData.offset;if(y===Dg&&Q){var G=Q[a];Object.keys(Z).forEach(function(re){var de=[os,as].indexOf(re)>=0?1:-1,fe=[ti,as].indexOf(re)>=0?"y":"x";Z[re]+=G[fe]*de})}return Z}function _Y(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,i=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,f=c===void 0?X2:c,h=Ep(r),g=h?l?Nx:Nx.filter(function(S){return Ep(S)===h}):Uv,y=g.filter(function(S){return f.indexOf(S)>=0});y.length===0&&(y=g);var w=y.reduce(function(S,D){return S[D]=nv(e,{placement:D,boundary:a,rootBoundary:o,padding:i})[Jl(D)],S},{});return Object.keys(w).sort(function(S,D){return w[S]-w[D]})}function BY(e){if(Jl(e)===Q2)return[];var t=sw(e);return[Ox(e),t,Ox(t)]}function HY(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=a===void 0?!0:a,i=n.altAxis,l=i===void 0?!0:i,c=n.fallbackPlacements,f=n.padding,h=n.boundary,g=n.rootBoundary,y=n.altBoundary,w=n.flipVariations,S=w===void 0?!0:w,D=n.allowedAutoPlacements,I=t.options.placement,M=Jl(I),N=M===I,B=c||(N||!S?[sw(I)]:BY(I)),k=[I].concat(B).reduce(function(Re,Fe){return Re.concat(Jl(Fe)===Q2?_Y(t,{placement:Fe,boundary:h,rootBoundary:g,padding:f,flipVariations:S,allowedAutoPlacements:D}):Fe)},[]),R=t.rects.reference,L=t.rects.popper,_=new Map,V=!0,U=k[0],Z=0;Z=0,fe=de?"width":"height",$=nv(t,{placement:Q,boundary:h,rootBoundary:g,altBoundary:y,padding:f}),he=de?re?os:ni:re?as:ti;R[fe]>L[fe]&&(he=sw(he));var se=sw(he),ue=[];if(o&&ue.push($[G]<=0),l&&ue.push($[he]<=0,$[se]<=0),ue.every(function(Re){return Re})){U=Q,V=!1;break}_.set(Q,ue)}if(V)for(var X=S?3:1,oe=function(Fe){var Be=k.find(function(Xe){var Ze=_.get(Xe);if(Ze)return Ze.slice(0,Fe).every(function(st){return st})});if(Be)return U=Be,"break"},De=X;De>0;De--){var je=oe(De);if(je==="break")break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}}const $6={name:"flip",enabled:!0,phase:"main",fn:HY,requiresIfExists:["offset"],data:{_skip:!1}};function jx(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Lx(e){return[ti,os,as,ni].some(function(t){return e[t]>=0})}function UY(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,i=nv(t,{elementContext:"reference"}),l=nv(t,{altBoundary:!0}),c=jx(i,r),f=jx(l,a,o),h=Lx(c),g=Lx(f);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:h,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":g})}const Z6={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UY};function YY(e,t,n){var r=Jl(e),a=[ni,ti].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=o[0],l=o[1];return i=i||0,l=(l||0)*a,[ni,os].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function zY(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=a===void 0?[0,0]:a,i=X2.reduce(function(h,g){return h[g]=YY(g,t.rects,o),h},{}),l=i[t.placement],c=l.x,f=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=i}const q6={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:zY};function VY(e){var t=e.state,n=e.name;t.modifiersData[n]=W6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const G6={name:"popperOffsets",enabled:!0,phase:"read",fn:VY,data:{}};function WY(e){return e==="x"?"y":"x"}function $Y(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=a===void 0?!0:a,i=n.altAxis,l=i===void 0?!1:i,c=n.boundary,f=n.rootBoundary,h=n.altBoundary,g=n.padding,y=n.tether,w=y===void 0?!0:y,S=n.tetherOffset,D=S===void 0?0:S,I=nv(t,{boundary:c,rootBoundary:f,padding:g,altBoundary:h}),M=Jl(t.placement),N=Ep(t.placement),B=!N,k=nI(M),R=WY(k),L=t.modifiersData.popperOffsets,_=t.rects.reference,V=t.rects.popper,U=typeof D=="function"?D(Object.assign({},t.rects,{placement:t.placement})):D,Z=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),Q=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,G={x:0,y:0};if(L){if(o){var re,de=k==="y"?ti:ni,fe=k==="y"?as:os,$=k==="y"?"height":"width",he=L[k],se=he+I[de],ue=he-I[fe],X=w?-V[$]/2:0,oe=N===Dp?_[$]:V[$],De=N===Dp?-V[$]:-_[$],je=t.elements.arrow,Re=w&&je?tI(je):{width:0,height:0},Fe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:_6(),Be=Fe[de],Xe=Fe[fe],Ze=Vg(0,_[$],Re[$]),st=B?_[$]/2-X-Ze-Be-Z.mainAxis:oe-Ze-Be-Z.mainAxis,Ct=B?-_[$]/2+X+Ze+Xe+Z.mainAxis:De+Ze+Xe+Z.mainAxis,tn=t.elements.arrow&&Yv(t.elements.arrow),_e=tn?k==="y"?tn.clientTop||0:tn.clientLeft||0:0,et=(re=Q==null?void 0:Q[k])!=null?re:0,nt=he+st-et-_e,ht=he+Ct-et,St=Vg(w?Ow(se,nt):se,he,w?pf(ue,ht):ue);L[k]=St,G[k]=St-he}if(l){var Tt,Gt=k==="x"?ti:ni,_t=k==="x"?as:os,Vt=L[R],Xt=R==="y"?"height":"width",dn=Vt+I[Gt],en=Vt-I[_t],Zn=[ti,ni].indexOf(M)!==-1,Dn=(Tt=Q==null?void 0:Q[R])!=null?Tt:0,Er=Zn?dn:Vt-_[Xt]-V[Xt]-Dn+Z.altAxis,pt=Zn?Vt+_[Xt]+V[Xt]-Dn-Z.altAxis:en,Mt=w&&Zn?TY(Er,Vt,pt):Vg(w?Er:dn,Vt,w?pt:en);L[R]=Mt,G[R]=Mt-Vt}t.modifiersData[r]=G}}const J6={name:"preventOverflow",enabled:!0,phase:"main",fn:$Y,requiresIfExists:["offset"]};function ZY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function qY(e){return e===Ni(e)||!ns(e)?rI(e):ZY(e)}function GY(e){var t=e.getBoundingClientRect(),n=Tp(t.width)/e.offsetWidth||1,r=Tp(t.height)/e.offsetHeight||1;return n!==1||r!==1}function JY(e,t,n){n===void 0&&(n=!1);var r=ns(t),a=ns(t)&&GY(t),o=od(t),i=Ip(e,a,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((eu(t)!=="body"||oI(o))&&(l=qY(t)),ns(t)?(c=Ip(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=aI(o))),{x:i.left+l.scrollLeft-c.x,y:i.top+l.scrollTop-c.y,width:i.width,height:i.height}}function KY(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function a(o){n.add(o.name);var i=[].concat(o.requires||[],o.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&a(c)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||a(o)}),r}function QY(e){var t=KY(e);return vY.reduce(function(n,r){return n.concat(t.filter(function(a){return a.phase===r}))},[])}function XY(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ez(e){var t=e.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Rx={placement:"bottom",modifiers:[],strategy:"absolute"};function _x(){for(var e=arguments.length,t=new Array(e),n=0;n({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),hz=e=>{const n=P.useRef(null),[r,a]=P.useState(null),[o,i]=P.useState(0);let l,c;const f=()=>{if(x.Platform.isMobile){l="right-end",c=["bottom"];return}const g=window.innerWidth-o>280*1.2,y=window.innerWidth-o<280,w=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){g?(l="right-end",c=["left-end"]):y&&w?(l="left-end",c=["right-end"]):(l="bottom",c=["bottom"]);return}g?(l="top-end",c=["top-start"]):y&&o>280?(l="top-start",c=["top-end"]):(l="top",c=["top"])};P.useEffect(()=>{e&&f()},[o,e==null?void 0:e.DefaultEditorLocation]);const h=Mb(n.current,r,fz(l,c));return{setPosX:i,popperRef:n,setPopperElement:a,popper:h}},pz=()=>{const e=new Set,t=at.getState().query.filter,n=at.getState().query.tag,r=on.getQueryById(t||"");if(r&&r.querystring){const a=JSON.parse(r.querystring);if(Array.isArray(a))for(const o of a)o.type==="TAG"&&o.value&&o.value.operator==="CONTAIN"&&e.add(o.value.value)}return n&&e.add(n),Array.from(e)},mz=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:a,selectionEnd:o}=e,i=document.createElement("div"),l=window.getComputedStyle(e);for(const D of l)i.style.setProperty(D,l.getPropertyValue(D));i.style.position="fixed",i.style.visibility="hidden",i.style.whiteSpace="pre-wrap";const f=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;i.textContent=f.substring(0,o||0),e.tagName==="TEXTAREA"&&(i.style.height="auto");const h=document.createElement("span");h.textContent=f.substring(o||0)||".",i.appendChild(h),document.body.appendChild(i);const{offsetLeft:g,offsetTop:y,offsetHeight:w,offsetWidth:S}=h;return document.body.removeChild(i),{x:t+g,y:n+y,h:r+w,w:a+S}},mf=({className:e,editorType:t,destroy:n,modal:r})=>{const{globalState:a,dailyNotesState:{app:o,settings:i,view:l,verifyState:c}}=P.useContext(Lt),[f,h]=Xl(!0),g=P.useRef(f),[y,w]=xo(!0),S=P.useRef(null),D=P.useRef(null),I=P.useRef(a),[M,N]=xo(!1),[B,k]=xo(!1),{setPosX:R,popperRef:L,setPopperElement:_,popper:V}=hz(i),[U]=xo(parseInt(x.moment().format("x"))),Z=P.useRef(null),[Q,G]=xo((i==null?void 0:i.EnabledLocationList.length)===1?i==null?void 0:i.EnabledLocationList[0].value:(i==null?void 0:i.MemoSaveLocation)||"DAILY"),re=P.useRef(i.MemoSaveLocation||"DAILY");P.useEffect(()=>{g.current=f},[f]),P.useEffect(()=>{!D.current||!o||!l||(l.registerEvent(o.workspace.on("focus-on-textarea",_e=>{var et;(et=D.current)==null||et.focus(_e==null?void 0:_e.id)})),l.registerEvent(o.workspace.on("blur-on-memos",()=>{var _e;(_e=D.current)==null||_e.blur()})),l.registerEvent(o.workspace.on("send-to-thino",async(_e,et)=>{var nt,ht;if(typeof _e=="string")(nt=D.current)==null||nt.insertText(_e+` +`,et.id);else{const St=_e.toPNG(),Tt=new Blob([St],{type:"image/png"}),Gt=new File([Tt],"image.png",{type:"image/png",lastModified:Date.now()});if(!Gt)return;const _t=await ue(Gt);_t&&((ht=D.current)==null||ht.insertText(_t+` +`,et.id))}})))},[D,l,o]),P.useEffect(()=>{i&&h(i.DefaultPrefix==="List")},[i==null?void 0:i.DefaultPrefix]),P.useEffect(()=>{if(i){if(i.EnabledLocationList.length===1){G(i.EnabledLocationList[0].value);return}G(i.MemoSaveLocation||"DAILY")}},[i==null?void 0:i.MemoSaveLocation,i==null?void 0:i.EnabledLocationList]),P.useEffect(()=>{var nt;if(!i||!Z.current)return;const _e=(nt=Qg.find(ht=>ht.title===Q))==null?void 0:nt.icon;x.setIcon(Z.current,_e),x.requireApiVersion("1.4.4")&&x.setTooltip(Z.current,E("Thino Save To: ")+Q),re.current=Q;const et=a.manifest;if(et){const ht=o==null?void 0:o.plugins.getPlugin(et.id);if(ht){if(ht.settings.MemoSaveLocation===Q)return;ht.settings.MemoSaveLocation=Q,ht.saveSettings()}}},[Q,y]),P.useEffect(()=>{D.current&&i.MemoSaveLocation&&G(i.MemoSaveLocation)},[Z,i]),P.useEffect(()=>{if(!D.current||!i||x.Platform.isDesktop||a.globalEditorShown)return;const _e=i.UseButtonToShowEditor&&i.DefaultEditorLocation==="Bottom";if(x.Platform.isDesktop){w(!0);return}if(t&&t==="inline"){w(!0);return}if(w(x.Platform.isMobile&&!_e),!_e||a.memoListView==="chat")return;const et=document.body.find(".memolist-scrollview");et&&(et.onscroll=()=>{if(a.globalEditorShown)return;if(!a.memoListView&&dt.getState().memoListView==="chat"){et.onscroll=null;return}const nt=D.current.getContent();x.Platform.isMobile&&_e&&!nt&&w(!1)})},[a.globalEditorShown,t,D]);const de=()=>{k(!1)};P.useEffect(()=>{var _e,et,nt,ht,St,Tt,Gt,_t,Vt;if(o&&(a.markMemoId||(_e=a.editMemoId)!=null&&_e.trim()&&a.editMemoId!==I.current.editMemoId)){const Xt=o.workspace.getLeavesOfType("thino_view");Xt.length>0&&o.workspace.revealLeaf(Xt[0])}if(a.markMemoId){const Xt=`${E("MARK")}: [@THINO](${a.markMemoId})`;(et=D.current)==null||et.insertText(Xt),(nt=D.current)==null||nt.focus(),dt.setMarkMemoId("");return}if((ht=a.editMemoId)!=null&&ht.trim()&&a.editMemoId!==I.current.editMemoId){const Xt=we.getMemoById(a.editMemoId);if(Xt)switch(h(Xt.thinoType==="JOURNAL"),i.EditorType){case"memos":(St=D.current)==null||St.setContent(Xt.content.replace(/ \^\S{6}$/,"")||""),(Tt=D.current)==null||Tt.focus();break;case"obsidian":(Gt=D.current)==null||Gt.clear(),(_t=D.current)==null||_t.setContent(Xt.content.replace(/ \^\S{6}$/,"")||""),(Vt=D.current)==null||Vt.focus();break}}I.current=a},[a.markMemoId,a.editMemoId]),P.useEffect(()=>{var _e,et,nt;!D.current||M||i.EditorType==="memos"&&((_e=D.current)==null||_e.element.addEventListener("paste",fe),(et=D.current)==null||et.element.addEventListener("drop",$),(nt=D.current)==null||nt.element.addEventListener("click",he),N(!0))},[D.current]);const fe=async _e=>{var et;if(_e.clipboardData&&_e.clipboardData.files.length>0){_e.preventDefault();const nt=_e.clipboardData.files;for(const ht of nt){const St=await ue(ht);St&&((et=D.current)==null||et.insertText(St))}}},$=async _e=>{var et;if(_e.dataTransfer&&_e.dataTransfer.files.length>0){_e.preventDefault();const nt=_e.dataTransfer.files;for(const ht of nt){const St=await ue(ht);St&&((et=D.current)==null||et.insertText(St))}}},he=()=>{var _e;De(((_e=D.current)==null?void 0:_e.element.value)||"")},se=async(_e,et)=>{var St,Tt,Gt;const nt=_e.ctrlKey||_e.metaKey,ht=_e.altKey;if(_e.key==="Escape"&&a.globalEditorShown&&(dt.setGlobalEditorShown(!1),_e.preventDefault()),nt&&_e.key==="Enter"){_e.preventDefault(),_e.stopPropagation(),et?(await X((Tt=D.current)==null?void 0:Tt.getContent()),(Gt=D.current)==null||Gt.clear()):await X((St=D.current)==null?void 0:St.element.value);return}if(ht)for(let _t=0;_t{var _t;et||De(((_t=D.current)==null?void 0:_t.element.value)||"")})},ue=P.useCallback(async _e=>{const{type:et}=_e;if(et.startsWith("image"))try{return`${await q2.upload(_e)}`}catch(nt){new x.Notice(nt)}},[]),X=async _e=>{if(!_e||_e.trim()===""){new x.Notice(E("Content cannot be empty"));return}const et=ft.getState().settings,nt=et==null?void 0:et.addTagAutomatically,ht=et==null?void 0:et.addTagWithNewline,St=et==null?void 0:et.addTagPosition,Gt=(pz()||[]).filter(dn=>!_e.includes(`#${dn}`)),_t=async(dn,en)=>{en=en.replaceAll(" "," "),k0("");try{if(!dn){let Dn;switch(re.current){case"CANVAS":Dn=await we.createMemoCanvas({text:en,isList:g.current});break;case"MULTI":Dn=await we.createMemoMultiFile({content:en,isList:g.current});break;case"DAILY":Dn=await we.createMemoDaily(en,g.current);break;case"FILE":Dn=await we.createMemoSingleFile({content:en,isList:g.current});break}if(!Dn)return;we.pushMemo(Dn),(!nt||Gt.length===0)&&at.clearQuery();const Er=o||ft.getState().app,pt=Er==null?void 0:Er.loadLocalStorage("tokenForSync");Dn&&pt&&i.startSync&&setTimeout(async()=>{try{if(re.current!=="DAILY"){const Mt=await N2({content:en,thinoType:"FILE",thinoStatus:Dn.thinoType==="JOURNAL"?"JOURNAL":Dn.thinoType==="TASK-TODO"?"TASK-TODO":"TASK-DONE"});await we.updateMemoById(Dn.id,Mt,!0)}}catch(Mt){console.error(Mt)}},200);return}const Zn=we.getMemoById(dn);if(Zn&&(Zn.content!==en||Zn.thinoType!==(g.current?"JOURNAL":"TASK-TODO"))){const Dn=await we.updateMemo(Zn.id,en,g.current?"JOURNAL":Zn.thinoType.startsWith("TASK")?Zn.thinoType:"TASK-TODO");Dn.updatedAt=ut.getDateTimeString(Date.now()),we.editMemo(Dn)}dt.setEditMemoId("")}catch(Zn){new x.Notice(Zn.message)}};n&&n();const{editMemoId:Vt}=dt.getState(),Xt=Gt&&Gt.length>0&&nt&&!Vt?St==="Beginning"?`${Gt.map(dn=>`#${dn}`).join(" ")} ${ht?` `:""}${_e}`:`${_e} ${ht?` -`:""}${Gt.map(dn=>`#${dn}`).join(" ")}`:_e;await _t(Vt,Xt),k0("")},ae=P.useCallback(()=>{var _e;dt.setEditMemoId(""),(_e=D.current)==null||_e.setContent(""),k0("")},[]),De=P.useCallback(_e=>{if(k0(_e??""),!D.current)return;const et=D.current.getContent(),nt=D.current.element.selectionStart,ht=et.slice(0,nt),St=et.slice(nt);(ht.endsWith("@")||ht.endsWith("📆"))&&St.startsWith(" ")||(ht.endsWith("@")||ht.endsWith("📆"))&&St===""?(Ze(),k(!0)):k(!1),setTimeout(()=>{var Tt;(Tt=D.current)==null||Tt.focus()})},[i.EditorType]),je=_e=>{if(!D.current||!i)return;_e&&(se(),h(!1));const et=D.current.getContent(),nt=D.current.element.selectionStart,ht=et.slice(0,nt),St=et.slice(nt),Tt=x.moment(_e);if(ht.endsWith("@"))switch(i.InsertDateFormat){case"Dataview":D.current.element.value=et.slice(0,D.current.element.selectionStart-1)+"[due:: "+Tt.format("YYYY-MM-DD")+"]"+St,D.current.element.setSelectionRange(nt+17,nt+17),D.current.focus(),De(D.current.element.value);break;case"Tasks":D.current.element.value=et.slice(0,D.current.element.selectionStart-1)+"📅 "+Tt.format("YYYY-MM-DD")+St,D.current.element.setSelectionRange(nt+11,nt+11),D.current.focus(),De(D.current.element.value)}else{D.current.element.value=ht+Tt.format("YYYY-MM-DD")+St,D.current.element.setSelectionRange(nt+10,nt+10),D.current.focus(),De(D.current.element.value);return}},Re=()=>{D.current&&h()},Fe=async()=>{var nt;const _e=!x.Platform.isDesktop&&await((nt=window.Capacitor)==null?void 0:nt.Plugins.Device.getId()),et=x.Platform.isDesktop?await cr():_e.identifier||_e.uuid;return!c||(c==null?void 0:c.appId)!==et?(fn(),!1):!0},Be=async _e=>{if(!await Fe())return;const et=new x.Menu;i.EnabledLocationList.forEach(Tt=>{et.addItem(Gt=>{var _t;Gt.setTitle(E(Tt.value)).setIcon(((_t=Qg.find(Vt=>Vt.title===Tt.value))==null?void 0:_t.icon)??"file").setChecked(Q===Tt.value).onClick(()=>{G(Tt.value)})})});let nt=_e.target,ht=null;for(;!nt.hasClass("location-wrapper")&&(ht=nt.parentElement,ht);)nt=ht;const St=nt.getBoundingClientRect();setTimeout(()=>{et.showAtPosition({x:St.x,y:St.bottom,width:St.width,left:!1,overlap:!0})},200)},Xe=P.useCallback(()=>{var _e,et;if(!(!D.current&&i.EditorType==="memos"))switch(i.EditorType){case"obsidian":(_e=D.current)==null||_e.focus(),(et=D.current)==null||et.insertTag();break;case"memos":{const nt=D.current.getContent(),ht=D.current.element.selectionStart,St=nt.slice(0,ht),Tt=nt.slice(ht);let Gt=St+"# "+Tt,_t=St.length+1;St.endsWith("#")&&Tt.startsWith(" ")&&(Gt=St.slice(0,St.length-1)+Tt.slice(1),_t=St.length-1),D.current.element.value=Gt,D.current.element.setSelectionRange(_t,_t),D.current.focus();const Vt=new Event("input",{bubbles:!0,cancelable:!0});D.current.element.dispatchEvent(Vt),De(D.current.element.value)}}},[o]),Ze=P.useCallback(()=>{if(!D.current||!L.current||!i||!o)return;const nt=o.workspace.getLeavesOfType(lo)[0].view.containerEl,ht=280,St=nt.clientWidth,{x:Tt,y:Gt}=pz(D.current.element);let _t,Vt;x.Platform.isMobile?(window.innerWidth-Tt>ht?_t=(Tt+ht+16>St,Tt+18):window.innerWidth-TtSt,Tt+34):_t=D.current.element.clientWidth/2,i.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?Vt=Gt+4:i.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?Vt=Gt+19:i.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&(Vt=Gt+36)):(_t=(Tt+ht+16>St,Tt+18),Vt=Gt+34),B(Tt),L.current.style.left=`${_t}px`,L.current.style.top=`${Vt}px`},[i,o]),st=P.useCallback(()=>{const _e=document.createElement("input");document.body.appendChild(_e),_e.type="file",_e.multiple=!1,_e.accept="image/png, image/gif, image/jpeg",_e.onchange=async()=>{var ht;if(!_e.files||_e.files.length===0)return;const et=_e.files[0],nt=await ce(et);nt&&((ht=D.current)==null||ht.insertText(nt)),document.body.removeChild(_e)},_e.click()},[]),Ct=!!a.editMemoId,tn=P.useMemo(()=>({className:"memo-editor",inputerType:i.EditorType||"obsidian",modal:r,initialContent:mz(),placeholder:E("What do you think now..."),showConfirmBtn:!0,showCancelBtn:Ct,showTools:!0,onConfirmBtnClick:X,onCancelBtnClick:ae,onContentChange:De}),[Ct,i.EditorType]);return v.jsxs(v.Fragment,{children:[!a.globalEditorShown&&t==="block"&&v.jsx("div",{ref:_e=>{S.current=_e,_e&&x.setIcon&&x.setIcon(_e,"plus-circle")},className:`memo-show-editor-button ${y?"hidden":""}`,onClick:()=>{var _e;(_e=S.current.firstElementChild)==null||_e.toggleClass("rotate-hidden",!0),setTimeout(()=>{w(!0),S.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var et;(et=D.current)==null||et.focus()},600)}}),v.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${Ct?"edit-ing":""} ${a.globalEditorShown?"fullscreen-editor":""} ${y?"":"hidden"}`,onKeyDownCapture:_e=>ie(_e,!0),children:[v.jsx("span",{className:`tip-text ${Ct?"":"hidden"}`,children:"Modifying..."}),v.jsx(tU,{ref:D,...tn,tools:v.jsxs(v.Fragment,{children:[v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,"hash")},className:"btn action-btn add-tag",onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&Xe()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&Xe()}}),v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&st()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&st()}}),v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,f?"layout-list":"check-square")},className:ar("btn action-btn list-or-task",f?"list":"task"),onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&Re()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&Re()}}),v.jsx("div",{ref:_e=>{_e&&(x.setIcon&&x.setIcon(_e,a.globalEditorShown?"shrink":"expand"),x.setTooltip&&x.setTooltip(_e,a.globalEditorShown?E("Exit fullscreen mode"):E("Enter fullscreen mode")))},className:"action-btn show-editor pro",onPointerDown:async()=>{await Fe()&&(w(!0),dt.setGlobalEditorShown(!a.globalEditorShown))}}),v.jsx("div",{className:"action-btn split-line pro"}),v.jsx("div",{className:"action-btn location-wrapper pro",onClick:async _e=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&await Be(_e)},onPointerDown:async _e=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&await Be(_e)},children:v.jsx("div",{ref:Z,className:"action-btn file-location-btn"})})]})}),v.jsx("div",{ref:L,className:"date-picker",children:_&&v.jsx("div",{tabIndex:-1,style:V.styles.popper,...V.attributes.popper,ref:R,role:"dialog",children:v.jsx(Cb,{className:`editor-date-picker ${_?"":"hidden"}`,datestamp:Y,handleDateStampChange:je})})})]})]})};function mz(){return la.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function k0(e){la.set({thinoEditorContentCache:e})}const gz=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(a=>{if(a.date==x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return a.have.push(n),!0})||t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},vz=e=>we.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>ut.getTimeStampByDate(t.createdAt)-ut.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:ut.getDateTimeString(t.createdAt),dateStr:ut.getDateString(t.createdAt)})),yz=e=>{const t=ft.getState().settings,n=gR(),r=t!=null&&t.ShowDate?" ":"",a="YYYY/MM/DD HH:mm:ss",o=/comment:(.*)$/g,i=/^\d{14}/g,l=(g,y,w)=>{const S=x.moment(g.createdAt,a).format("HH:mm");return w?w.replace(/{TIME}/g,S).replace(/{CONTENT}/g,y):`${S} ${y}`},c=g=>{const y=g.match(/TASK-(.*)?/g);return y?y[1]:""},f=g=>g==="TASK-TODO"?"- [ ] ":g==="TASK-DONE"?"- [x] ":g.match(/TASK-(.*)?/g)?`- [${c(g)}] `:"- ",h=g=>g.reduce((y,w)=>{const S=w.sourceType!=="MULTI"?`${w.content}`:`[[${w.path}]]`,D=t!=null&&t.ShowTime?l(w,S,t==null?void 0:t.DefaultMemoComposition):S,I=`${f(w.thinoType)}${D}`;let M="";return t.CommentOnMemos&&w.hasId!==void 0&&w.hasId!==""&&(M=vz(w).reduce((_,k)=>{const B=f(k.thinoType),L=k.content.replace(o,"").replace(i,""),R=t!=null&&t.ShowDate?`${B}[[${x.moment(k.createdAt).format(n)}]] ${x.moment(k.createdAt).format("HH:mm")} ${L}`:`${B}${L}`;return _+r+" "+R+` +`:""}${Gt.map(dn=>`#${dn}`).join(" ")}`:_e;await _t(Vt,Xt),k0("")},oe=P.useCallback(()=>{var _e;dt.setEditMemoId(""),(_e=D.current)==null||_e.setContent(""),k0("")},[]),De=P.useCallback(_e=>{if(k0(_e??""),!D.current)return;const et=D.current.getContent(),nt=D.current.element.selectionStart,ht=et.slice(0,nt),St=et.slice(nt);(ht.endsWith("@")||ht.endsWith("📆"))&&St.startsWith(" ")||(ht.endsWith("@")||ht.endsWith("📆"))&&St===""?(Ze(),k(!0)):k(!1),setTimeout(()=>{var Tt;(Tt=D.current)==null||Tt.focus()})},[i.EditorType]),je=_e=>{if(!D.current||!i)return;_e&&(de(),h(!1));const et=D.current.getContent(),nt=D.current.element.selectionStart,ht=et.slice(0,nt),St=et.slice(nt),Tt=x.moment(_e);if(ht.endsWith("@"))switch(i.InsertDateFormat){case"Dataview":D.current.element.value=et.slice(0,D.current.element.selectionStart-1)+"[due:: "+Tt.format("YYYY-MM-DD")+"]"+St,D.current.element.setSelectionRange(nt+17,nt+17),D.current.focus(),De(D.current.element.value);break;case"Tasks":D.current.element.value=et.slice(0,D.current.element.selectionStart-1)+"📅 "+Tt.format("YYYY-MM-DD")+St,D.current.element.setSelectionRange(nt+11,nt+11),D.current.focus(),De(D.current.element.value)}else{D.current.element.value=ht+Tt.format("YYYY-MM-DD")+St,D.current.element.setSelectionRange(nt+10,nt+10),D.current.focus(),De(D.current.element.value);return}},Re=()=>{D.current&&h()},Fe=async()=>{var nt;const _e=!x.Platform.isDesktop&&await((nt=window.Capacitor)==null?void 0:nt.Plugins.Device.getId()),et=x.Platform.isDesktop?await cr():_e.identifier||_e.uuid;return!c||(c==null?void 0:c.appId)!==et?(fn(),!1):!0},Be=async _e=>{if(!await Fe())return;const et=new x.Menu;i.EnabledLocationList.forEach(Tt=>{et.addItem(Gt=>{var _t;Gt.setTitle(E(Tt.value)).setIcon(((_t=Qg.find(Vt=>Vt.title===Tt.value))==null?void 0:_t.icon)??"file").setChecked(Q===Tt.value).onClick(()=>{G(Tt.value)})})});let nt=_e.target,ht=null;for(;!nt.hasClass("location-wrapper")&&(ht=nt.parentElement,ht);)nt=ht;const St=nt.getBoundingClientRect();setTimeout(()=>{et.showAtPosition({x:St.x,y:St.bottom,width:St.width,left:!1,overlap:!0})},200)},Xe=P.useCallback(()=>{var _e,et;if(!(!D.current&&i.EditorType==="memos"))switch(i.EditorType){case"obsidian":(_e=D.current)==null||_e.focus(),(et=D.current)==null||et.insertTag();break;case"memos":{const nt=D.current.getContent(),ht=D.current.element.selectionStart,St=nt.slice(0,ht),Tt=nt.slice(ht);let Gt=St+"# "+Tt,_t=St.length+1;St.endsWith("#")&&Tt.startsWith(" ")&&(Gt=St.slice(0,St.length-1)+Tt.slice(1),_t=St.length-1),D.current.element.value=Gt,D.current.element.setSelectionRange(_t,_t),D.current.focus();const Vt=new Event("input",{bubbles:!0,cancelable:!0});D.current.element.dispatchEvent(Vt),De(D.current.element.value)}}},[o]),Ze=P.useCallback(()=>{if(!D.current||!L.current||!i||!o)return;const nt=o.workspace.getLeavesOfType(lo)[0].view.containerEl,ht=280,St=nt.clientWidth,{x:Tt,y:Gt}=mz(D.current.element);let _t,Vt;x.Platform.isMobile?(window.innerWidth-Tt>ht?_t=(Tt+ht+16>St,Tt+18):window.innerWidth-TtSt,Tt+34):_t=D.current.element.clientWidth/2,i.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?Vt=Gt+4:i.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?Vt=Gt+19:i.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&(Vt=Gt+36)):(_t=(Tt+ht+16>St,Tt+18),Vt=Gt+34),R(Tt),L.current.style.left=`${_t}px`,L.current.style.top=`${Vt}px`},[i,o]),st=P.useCallback(()=>{const _e=document.createElement("input");document.body.appendChild(_e),_e.type="file",_e.multiple=!1,_e.accept="image/png, image/gif, image/jpeg",_e.onchange=async()=>{var ht;if(!_e.files||_e.files.length===0)return;const et=_e.files[0],nt=await ue(et);nt&&((ht=D.current)==null||ht.insertText(nt)),document.body.removeChild(_e)},_e.click()},[]),Ct=!!a.editMemoId,tn=P.useMemo(()=>({className:"memo-editor",inputerType:i.EditorType||"obsidian",modal:r,initialContent:gz(),placeholder:E("What do you think now..."),showConfirmBtn:!0,showCancelBtn:Ct,showTools:!0,onConfirmBtnClick:X,onCancelBtnClick:oe,onContentChange:De}),[Ct,i.EditorType]);return v.jsxs(v.Fragment,{children:[!a.globalEditorShown&&t==="block"&&v.jsx("div",{ref:_e=>{S.current=_e,_e&&x.setIcon&&x.setIcon(_e,"plus-circle")},className:`memo-show-editor-button ${y?"thino-hidden":""}`,onClick:()=>{var _e;(_e=S.current.firstElementChild)==null||_e.toggleClass("rotate-hidden",!0),setTimeout(()=>{w(!0),S.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var et;(et=D.current)==null||et.focus()},600)}}),v.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${Ct?"edit-ing":""} ${a.globalEditorShown?"fullscreen-editor":""} ${y?"":"thino-hidden"}`,onKeyDownCapture:_e=>se(_e,!0),children:[v.jsx("span",{className:`tip-text ${Ct?"":"thino-hidden"}`,children:"Modifying..."}),v.jsx(nY,{ref:D,...tn,tools:v.jsxs(v.Fragment,{children:[v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,"hash")},className:"btn action-btn add-tag",onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&Xe()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&Xe()}}),v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&st()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&st()}}),a.editMemoId===""&&v.jsx("span",{ref:_e=>{_e&&x.setIcon(_e,f?"layout-list":"check-square")},className:ar("btn action-btn list-or-task",f?"list":"task"),onClick:()=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&Re()},onPointerDown:()=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&Re()}}),v.jsx("div",{ref:_e=>{_e&&(x.setIcon&&x.setIcon(_e,a.globalEditorShown?"shrink":"expand"),x.setTooltip&&x.setTooltip(_e,a.globalEditorShown?E("Exit fullscreen mode"):E("Enter fullscreen mode")))},className:"action-btn show-editor pro",onPointerDown:async()=>{await Fe()&&(w(!0),dt.setGlobalEditorShown(!a.globalEditorShown))}}),v.jsx("div",{className:"action-btn split-line pro"}),v.jsx("div",{className:"action-btn location-wrapper pro",onClick:async _e=>{i&&i.DefaultEditorLocation==="Top"&&!a.globalEditorShown&&await Be(_e)},onPointerDown:async _e=>{(i&&i.DefaultEditorLocation==="Bottom"||a.globalEditorShown)&&await Be(_e)},children:v.jsx("div",{ref:Z,className:"action-btn file-location-btn"})})]})}),v.jsx("div",{ref:L,className:"date-picker",children:B&&v.jsx("div",{tabIndex:-1,style:V.styles.popper,...V.attributes.popper,ref:_,role:"dialog",children:v.jsx(Cb,{className:`editor-date-picker ${B?"":"thino-hidden"}`,datestamp:U,handleDateStampChange:je})})})]})]})};function gz(){return la.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function k0(e){la.set({thinoEditorContentCache:e})}const vz=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(a=>{if(a.date==x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return a.have.push(n),!0})||t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},yz=e=>we.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>ut.getTimeStampByDate(t.createdAt)-ut.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:ut.getDateTimeString(t.createdAt),dateStr:ut.getDateString(t.createdAt)})),wz=e=>{const t=ft.getState().settings,n=vR(),r=t!=null&&t.ShowDate?" ":"",a="YYYY/MM/DD HH:mm:ss",o=/comment:(.*)$/g,i=/^\d{14}/g,l=(g,y,w)=>{const S=x.moment(g.createdAt,a).format("HH:mm");return w?w.replace(/{TIME}/g,S).replace(/{CONTENT}/g,y):`${S} ${y}`},c=g=>{const y=g.match(/TASK-(.*)?/g);return y?y[1]:""},f=g=>g==="TASK-TODO"?"- [ ] ":g==="TASK-DONE"?"- [x] ":g.match(/TASK-(.*)?/g)?`- [${c(g)}] `:"- ",h=g=>g.reduce((y,w)=>{const S=w.sourceType!=="MULTI"?`${w.content}`:`[[${w.path}]]`,D=t!=null&&t.ShowTime?l(w,S,t==null?void 0:t.DefaultMemoComposition):S,I=`${f(w.thinoType)}${D}`;let M="";return t.CommentOnMemos&&w.hasId!==void 0&&w.hasId!==""&&(M=yz(w).reduce((B,k)=>{const R=f(k.thinoType),L=k.content.replace(o,"").replace(i,""),_=t!=null&&t.ShowDate?`${R}[[${x.moment(k.createdAt).format(n)}]] ${x.moment(k.createdAt).format("HH:mm")} ${L}`:`${R}${L}`;return B+r+" "+_+` `},"")),y+r+I.replace(/ \^\S{6}/g,"")+` `+M},"");return e.reduce((g,y)=>{const w=t!=null&&t.ShowDate?`- [[${x.moment(y.date,"YYYY-MM-DD").format(n)}]] `:"",S=h(y.have),D=t!=null&&t.ShowDate&&(t!=null&&t.AddBlankLineWhenDate)&&!(t!=null&&t.CommentOnMemos)?` `:"";return g+w+S+D},"").replace(/
/g,` - `)},wz=[{label:E("Today"),value:x.moment().format("YYYY-MM-DD")},{label:E("Yesterday"),value:x.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:E("Last 7 days"),value:x.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:E("Last 30 days"),value:x.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:E("Last 90 days"),value:x.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:E("Last 180 days"),value:x.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:E("Last 365 days"),value:x.moment().subtract(365,"days").format("YYYY-MM-DD")}],Q6=e=>{const{handleValueChange:t,setShownStatus:n}=e;return v.jsxs(v.Fragment,{children:[e.type==="icon"&&v.jsx("div",{className:"quick-date-btn-group",children:wz.map((r,a)=>v.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},a))}),v.jsx(Cb,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||x.moment().startOf("day").valueOf(),handleDateStampChange:(r,a)=>{t(e.type==="icon"?x.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},Pw=e=>{const{handleValueChange:t}=e,[n,r]=ne.useState(!1),a=ne.useRef(null),o=ne.useRef(null),i=Mb(o.current,a.current,{placement:"bottom-start"});return Hv(a,()=>{r(!1)}),v.jsxs(v.Fragment,{children:[v.jsx("span",{ref:c=>{o.current=c,c&&e.type==="icon"&&x.setIcon(c,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!x.Platform.isMobile&&r(!n),!x.Platform.isMobile&&(i!=null&&i.update)&&(i==null||i.update()),x.Platform.isMobile&&new X6(ft.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:x.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),v.jsx("div",{className:`menu-btns-popup ${n?"":"hidden"}`,ref:a,style:i.styles.popper,children:v.jsx(Q6,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class X6 extends x.Modal{constructor(n,r,a){super(n);Se(this,"root");Se(this,"type");Se(this,"handleValueChange");this.type=r,this.handleValueChange=a}onOpen(){const{contentEl:n}=this;this.root=Rv(n),this.root.render(v.jsx(Q6,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const bz=(e,t)=>(e%t+t)%t;class Sz{constructor(t,n,r){Se(this,"owner");Se(this,"values");Se(this,"suggestions");Se(this,"selectedItem");Se(this,"containerEl");this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",a=>{if(!a.isComposing)return this.useSelectedItem(a),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const a=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,a),n.push(a)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=bz(t,this.suggestions.length),a=this.suggestions[this.selectedItem],o=this.suggestions[r];a==null||a.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}}class e9{constructor(t,n){Se(this,"inputEl");Se(this,"popper");Se(this,"scope");Se(this,"suggestEl");Se(this,"suggest");Se(this,"cb");this.inputEl=t,this.scope=new x.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new Sz(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("click",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",a=>{a.preventDefault()})}clearInput(){this.inputEl.value="",this.inputEl.trigger("blur"),this.inputEl.trigger("focus"),this.inputEl.trigger("input"),this.onInputChanged()}onInputChanged(){const t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=K6(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:a})=>{const o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,a.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}destroy(){this.inputEl.removeEventListener("input",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("blur",this.close.bind(this)),this.close()}updateCb(t){this.cb=t}}const Dz=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let rv=class extends e9{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=ft.getState(),a=t.toLocaleLowerCase(),o=n.UseVaultTags?Dz(r):we.getState().tags;return this.fuzzySearchItemsOptimized(a,o).map(i=>i.item)}renderSuggestion(t,n){n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:t})}selectSuggestion(t){this.inputEl.value=t,this.cb&&this.cb(t),this.inputEl.dispatchEvent(new Event("change")),this.inputEl.trigger("change"),this.close()}};const Tz=e=>{const t=new Set;return e.forEach(n=>{const r=new RegExp($r).exec(n.content),a=new RegExp(ua).exec(n.content);if(r)for(let o=1;o{const[t,n]=ne.useState([]),r=ne.useRef(null),a=ne.useRef(null);P.useEffect(()=>{if(a.current){if(r.current){r.current.updateCb(o);return}r.current=new rv(a.current,o)}},[a.current,t]);const o=l=>{if(!l)return;const c=new Set(t);c.add(l),n(Array.from(c)),r.current.clearInput()},i=()=>{e(t)};return v.jsxs("div",{className:"thino-tag-operation",children:[v.jsx("div",{className:"tag-operation-title",children:E("Tag Bulk Select")}),v.jsxs("div",{className:"tag-operation-content",children:[v.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[v.jsx("div",{className:"name",children:E("Selected Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove selected tag")})]}),v.jsx("div",{className:"tag-operation-content-tags selected-tags",children:t.map(l=>v.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{n(t.filter(c=>c!==l))},children:l},l))}),v.jsx("div",{className:"tag-operation-content-inputer",children:v.jsx("input",{placeholder:E("Input to select exist tag"),ref:a,onKeyDown:l=>{l.key==="Enter"&&o(a.current.value)}})}),v.jsxs("div",{className:"tag-operation-content-btn-group",children:[v.jsx("button",{className:"cancel-btn",onClick:()=>{e([])},children:E("Cancel")}),v.jsx("button",{className:"save-btn",onClick:i,children:E("Save")})]})]})]})},Cz=({app:e,thinos:t,closeDialog:n})=>{const[r,a]=ne.useState([]),[o,i]=ne.useState([]),[l,c]=ne.useState([]),f=ne.useRef(null),h=ne.useRef(null),g=ne.useRef(null),y=ne.useRef("End"),w=ne.useRef(!1),S=ne.useRef(null);P.useEffect(()=>{t&&t.length&&a(Tz(t))},[t]),P.useEffect(()=>{!g.current||!h.current||(new x.Setting(h.current).setName(E("Add tag position")).addDropdown(N=>{N.addOption("End",E("End")),N.addOption("Beginning",E("Beginning")),N.setValue("End").onChange(async _=>{y.current=_})}),new x.Setting(g.current).setName(E("Add tag with new line")).addToggle(N=>{N.setValue(!1).onChange(async _=>{w.current=_})}))},[]);const D=N=>{if(!N)return;const _=new Set(o);_.add(N),i(Array.from(_)),f.current.clearInput()};P.useEffect(()=>{if(S.current){if(f.current){f.current.updateCb(D);return}f.current=new rv(S.current,D)}},[S.current,o]);const I=()=>{n(),M({remove:l,add:o,targetThinos:t})},M=async({remove:N,add:_,targetThinos:k})=>{const B=w.current||!1,L=[];for(const R of k){let V=R.content;for(const Y of N)V=V.replace(new RegExp(`#${Y}`,"g"),"");if(V=V.trim(),_.length>0&&(V=y.current==="Beginning"?`${_.map(Y=>`#${Y}`).join(" ")} ${B?` -`:""}${V}`:`${V} ${B?` -`:""}${_.map(Y=>`#${Y}`).join(" ")}`),R&&R.content!==V){const Y=await we.updateMemo(R.id,V==null?void 0:V.trim());L.push(Y)}}L.length>0&&we.editMemoBulk(L),L.length>0&&at.clearQuery()};return v.jsxs("div",{className:"thino-tag-operation",children:[v.jsx("div",{className:"tag-operation-title",children:E("Tag Bulk Edit")}),v.jsxs("div",{className:"tag-operation-content",children:[r.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[v.jsx("div",{className:"name",children:E("Exist Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove exist tag")})]}),v.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(N=>v.jsx("div",{className:ar("tag-operation-content-tag",l.includes(N)&&"tag-operation-content-tag-removed"),onClick:()=>{l.includes(N)||c([...l,N]),l.includes(N)&&c(l.filter(_=>_!==N)),o.includes(N)&&i(o.filter(_=>_!==N))},children:N},N))})]}),v.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[v.jsx("div",{className:"name",children:E("Selected Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove selected tag")})]}),v.jsx("div",{className:"tag-operation-content-tags selected-tags",children:o.map(N=>v.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{i(o.filter(_=>_!==N))},children:N},N))}),v.jsx("div",{className:"tag-operation-content-inputer",children:v.jsx("input",{placeholder:E("Input to select exist tag"),ref:S,onKeyDown:N=>{N.key==="Enter"&&D(S.current.value)}})}),v.jsxs("div",{className:"tag-operation-settings",children:[v.jsx("div",{ref:h}),v.jsx("div",{ref:g})]}),v.jsxs("div",{className:"tag-operation-content-btn-group",children:[v.jsx("button",{className:"cancel-btn",onClick:n,children:E("Cancel")}),v.jsx("button",{className:"save-btn",onClick:I,children:E("Save")})]})]})]})},xT=new Map,Sf=async(e,t=!0)=>{const{vault:n,metadataCache:r}=ft.getState().app;if(t&&xT.has(e))return Promise.resolve(xT.get(e));if(e.contains("data:image"))return e;let a;const o=await n.adapter.exists(x.normalizePath(e));let i="";try{if(!o&&!/(http|https)/g.test(e)&&!e.includes("data:image")){let l;if(e.startsWith("app://")){const c=x.normalizePath(decodeURIComponent(e).replace(x.Platform.resourcePathPrefix,"").replace(/\?(.*)$/,"").replace(x.normalizePath(app==null?void 0:app.vault.adapter.basePath),""));i=x.normalizePath(decodeURIComponent(c))}else{if(l=r.getFirstLinkpathDest(e,""),!l){new x.Notice(E("File not exist"));return}i=l.path}}else i=e}catch(l){console.error(l)}if(i){if(/(http|https)/g.test(i))if(i.startsWith("http://localhost")){let l=i;l=l.replace("http://localhost/_capacitor_file_",""),l=decodeURIComponent(l).replace(/\?(.*)$/,"").replace(app==null?void 0:app.vault.adapter.basePath,""),l=x.normalizePath(decodeURIComponent(l));const c=await n.adapter.readBinary(l),f=new Uint8Array(c);a=new Blob([f],{type:"image/png"})}else try{const l=await x.requestUrl(e),c=new Uint8Array(l.arrayBuffer);a=new Blob([c],{type:"image/png"})}catch{}else if(i){const l=await n.adapter.readBinary(i),c=new Uint8Array(l);a=new Blob([c],{type:"image/png"})}return a?await xz(a,e):""}},xz=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const a=r.result;xT.set(t,a),n(a)},r.readAsDataURL(e)}),Rg=async e=>{if(!e.style.backgroundImage.includes("url(")&&!e.style.backgroundImage.includes("http"))return;let t=e.style.backgroundImage.includes("url(")?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;return t?(t.startsWith("http://localhost")&&(t=t.replace("http://localhost/_capacitor_file_",""),t=decodeURIComponent(t).replace(/\?(.*)$/,"").replace(app==null?void 0:app.vault.adapter.basePath,""),t=x.normalizePath(decodeURIComponent(t))),await Sf(t)):void 0},Mz=async e=>{var n;return e.getAttribute("src")?(n=e==null?void 0:e.src)!=null&&n.startsWith("http://localhost")?await Sf(e.getAttribute("path")||x.normalizePath(e==null?void 0:e.parentElement.getAttribute("src"))):await Sf(e.getAttribute("src")):void 0},Zt=_z(),jw=Bz(),t9=Hz(),n9=Yz(),ef={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},wn={toSvg:r9,toPng:Az,toJpeg:Fz,toBlob:Oz,toPixelData:Nz,toCanvas:Pz,impl:{fontFaces:t9,images:n9,util:Zt,inliner:jw,urlCache:[],options:{}}},iI=(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1,uw=(typeof global<"u"?global.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,kz=(typeof global<"u"?global.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function r9(e,t){wn.impl.util.getWindow(e),t=t||{},jz(t);let n=[];return Promise.resolve(e).then(r).then(function(c){return a9(c,t,null)}).then(Lz).then(Rz).then(i).then(l).then(a).then(o);function r(c){if(c.nodeType===iI)return c;const f=c,h=c.parentNode,g=document.createElement("span");return h.replaceChild(g,f),g.append(c),n.push({parent:h,child:f,wrapper:g}),g}function a(c){for(;n.length>0;){const f=n.pop();f.parent.replaceChild(f.child,f.wrapper)}return c}function o(c){return wn.impl.urlCache=[],Zz(),c}function i(c){t.bgcolor&&(c.style.backgroundColor=t.bgcolor),t.width&&(c.style.width=`${t.width}px`),t.height&&(c.style.height=`${t.height}px`),t.style&&Object.keys(t.style).forEach(function(h){c.style[h]=t.style[h]});let f=null;return typeof t.onclone=="function"&&(f=t.onclone(c)),Promise.resolve(f).then(function(){return c})}function l(c){let f=t.width||Zt.width(c),h=t.height||Zt.height(c);return Promise.resolve(c).then(function(g){return g.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(g)}).then(Zt.escapeXhtml).then(function(g){const y=(Zt.isDimensionMissing(f)?' width="100%"':` width="${f}"`)+(Zt.isDimensionMissing(h)?' height="100%"':` height="${h}"`);return`${g}`}).then(function(g){return`data:image/svg+xml;charset=utf-8,${g}`})}}function Nz(e,t){return zv(e,t).then(function(n){return n.getContext("2d").getImageData(0,0,Zt.width(e),Zt.height(e)).data})}function Az(e,t){return zv(e,t).then(function(n){return n.toDataURL()})}function Fz(e,t){return zv(e,t).then(function(n){return n.toDataURL("image/jpeg",(t?t.quality:void 0)||1)})}function Oz(e,t){return zv(e,t).then(Zt.canvasToBlob)}function Pz(e,t){return zv(e,t)}function jz(e){typeof e.copyDefaultStyles>"u"?wn.impl.options.copyDefaultStyles=ef.copyDefaultStyles:wn.impl.options.copyDefaultStyles=e.copyDefaultStyles,typeof e.imagePlaceholder>"u"?wn.impl.options.imagePlaceholder=ef.imagePlaceholder:wn.impl.options.imagePlaceholder=e.imagePlaceholder,typeof e.cacheBust>"u"?wn.impl.options.cacheBust=ef.cacheBust:wn.impl.options.cacheBust=e.cacheBust,typeof e.corsImg>"u"?wn.impl.options.corsImg=ef.corsImg:wn.impl.options.corsImg=e.corsImg,typeof e.useCredentials>"u"?wn.impl.options.useCredentials=ef.useCredentials:wn.impl.options.useCredentials=e.useCredentials,typeof e.httpTimeout>"u"?wn.impl.options.httpTimeout=ef.httpTimeout:wn.impl.options.httpTimeout=e.httpTimeout,typeof e.styleCaching>"u"?wn.impl.options.styleCaching=ef.styleCaching:wn.impl.options.styleCaching=e.styleCaching,wn.impl.options.requestUrl=e.requestUrl,wn.impl.options.type=e.type||"image/png"}function zv(e,t){return t=t||{},r9(e,t).then(Zt.makeImage).then(function(r){const a=typeof t.scale!="number"?1:t.scale,o=n(e,a),i=o.getContext("2d");return i.msImageSmoothingEnabled=!1,i.imageSmoothingEnabled=!1,r&&(i.scale(a,a),i.drawImage(r,0,0)),o});function n(r,a){let o=t.width||Zt.width(r),i=t.height||Zt.height(r);Zt.isDimensionMissing(o)&&(o=Zt.isDimensionMissing(i)?300:i*2),Zt.isDimensionMissing(i)&&(i=o/2);const l=document.createElement("canvas");if(l.width=o*a,l.height=i*a,t.bgcolor){const c=l.getContext("2d");c.fillStyle=t.bgcolor,c.fillRect(0,0,l.width,l.height)}return l}}let Ci=null;function a9(e,t,n,r){const a=t.filter;if(e===Ci||Zt.isHTMLScriptElement(e)||Zt.isHTMLStyleElement(e)||Zt.isHTMLLinkElement(e)||n!==null&&a&&!a(e))return Promise.resolve();return Promise.resolve(e).then(o).then(function(f){return l(f,i(e))}).then(function(f){return c(f,e)});function o(f){return Zt.isHTMLCanvasElement(f)?Zt.makeImage(f.toDataURL()):f.cloneNode(!1)}function i(f){return Zt.isElementHostForOpenShadowRoot(f)?f.shadowRoot:f}function l(f,h){const g=S(h);let y=Promise.resolve();if(g.length!==0){const D=uw(w(h));Zt.asArray(g).forEach(function(I){y=y.then(function(){return a9(I,t,D).then(function(M){M&&f.appendChild(M)})})})}return y.then(function(){return f});function w(D){return Zt.isShadowRoot(D)?D.host:D}function S(D){return Zt.isShadowSlotElement(D)?D.assignedNodes():D.childNodes}}function c(f,h){if(!Zt.isElement(f)||Zt.isShadowSlotElement(h))return Promise.resolve(f);return Promise.resolve().then(g).then(y).then(w).then(S).then(function(){return f});function g(){I(h,f);function D(M,N){N.font=M.font,N.fontFamily=M.fontFamily,N.fontFeatureSettings=M.fontFeatureSettings,N.fontKerning=M.fontKerning,N.fontSize=M.fontSize,N.fontStretch=M.fontStretch,N.fontStyle=M.fontStyle,N.fontVariant=M.fontVariant,N.fontVariantCaps=M.fontVariantCaps,N.fontVariantEastAsian=M.fontVariantEastAsian,N.fontVariantLigatures=M.fontVariantLigatures,N.fontVariantNumeric=M.fontVariantNumeric,N.fontVariationSettings=M.fontVariationSettings,N.fontWeight=M.fontWeight}function I(M,N){const _=uw(M);_.cssText?(N.style.cssText=_.cssText,D(_,N.style)):(zz(t,M,_,n,N),n===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(k=>N.style.removeProperty(k)),["left","right","top","bottom"].forEach(k=>{N.style.getPropertyValue(k)&&N.style.setProperty(k,"0px")})))}}function y(){const D=Zt.uid();[":before",":after"].forEach(function(M){I(M)});function I(M){const N=uw(h,M),_=N.getPropertyValue("content");if(_===""||_==="none")return;const k=f.getAttribute("class")||"";f.setAttribute("class",`${k} ${D}`);const B=document.createElement("style");B.appendChild(L()),f.appendChild(B);function L(){const R=`.${D}:${M}`,V=N.cssText?Y():Z();return document.createTextNode(`${R}{${V}}`);function Y(){return`${N.cssText} content: ${_};`}function Z(){return`${Zt.asArray(N).map(G).join("; ")};`;function G(le){const se=N.getPropertyValue(le),fe=N.getPropertyPriority(le)?" !important":"";return`${le}: ${se}${fe}`}}}}}function w(){Zt.isHTMLTextAreaElement(h)&&(f.innerHTML=h.value),Zt.isHTMLInputElement(h)&&f.setAttribute("value",h.value)}function S(){Zt.isSVGElement(f)&&(f.setAttribute("xmlns","http://www.w3.org/2000/svg"),Zt.isSVGRectElement(f)&&["width","height"].forEach(function(D){const I=f.getAttribute(D);I&&f.style.setProperty(D,I)}))}}}function Lz(e){return t9.resolveAll().then(function(t){if(t!==""){const n=document.createElement("style");e.appendChild(n),n.appendChild(document.createTextNode(t))}return e})}function Rz(e){return n9.inlineAll(e).then(function(){return e})}function _z(){let e=0;return{escape:Y,isDataUrl:M,canvasToBlob:k,resolveUrl:B,getAndEncode:V,uid:L,delay:Z,asArray:Q,escapeXhtml:G,makeImage:R,width:le,height:se,getWindow:t,isElement:o,isElementHostForOpenShadowRoot:n,isShadowRoot:r,isInShadowRoot:a,isHTMLElement:l,isHTMLCanvasElement:i,isHTMLInputElement:f,isHTMLImageElement:c,isHTMLLinkElement:h,isHTMLScriptElement:g,isHTMLStyleElement:y,isHTMLTextAreaElement:w,isShadowSlotElement:S,isSVGElement:D,isSVGRectElement:I,isDimensionMissing:N};function t($){const he=$?$.ownerDocument:void 0;return(he?he.defaultView:void 0)||global||window}function n($){return o($)&&$.shadowRoot!==null}function r($){return $ instanceof t($).ShadowRoot}function a($){return $!==null&&Object.prototype.hasOwnProperty.call($,"getRootNode")&&r($.getRootNode())}function o($){return $ instanceof t($).Element}function i($){return $ instanceof t($).HTMLCanvasElement}function l($){return $ instanceof t($).HTMLElement}function c($){return $ instanceof t($).HTMLImageElement}function f($){return $ instanceof t($).HTMLInputElement}function h($){return $ instanceof t($).HTMLLinkElement}function g($){return $ instanceof t($).HTMLScriptElement}function y($){return $ instanceof t($).HTMLStyleElement}function w($){return $ instanceof t($).HTMLTextAreaElement}function S($){return a($)&&$ instanceof t($).HTMLSlotElement}function D($){return $ instanceof t($).SVGElement}function I($){return $ instanceof t($).SVGRectElement}function M($){return $.search(/^(data:)/)!==-1}function N($){return isNaN($)||$<=0}function _($){return new Promise(function(he){const ie=kz($.toDataURL().split(",")[1]),ce=ie.length,X=new Uint8Array(ce);for(let ae=0;aenew Promise(ce=>{const X=new FileReader;X.onload=function(ae){ce(ae.target.result)},X.readAsDataURL(new Blob([ie.arrayBuffer],{type:ie.headers["content-type"]}))})).catch(ie=>(console.error("cannot fetch resource: "+$+", error: "+ie),"")):he.promise=new Promise(function(ie){const ce=wn.impl.options.httpTimeout,X=new XMLHttpRequest;if(X.onreadystatechange=De,X.ontimeout=je,X.responseType="blob",X.timeout=ce,wn.impl.options.useCredentials&&(X.withCredentials=!0),wn.impl.options.corsImg&&$.indexOf("http")===0&&$.indexOf(window.location.origin)===-1){const Be=(wn.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";X.open(Be,(wn.impl.options.corsImg.url||"").replace("#{cors}",$),!0);let Xe=!1;const Ze=wn.impl.options.corsImg.headers||{};Object.keys(Ze).forEach(function(Ct){Ze[Ct].indexOf("application/json")!==-1&&(Xe=!0),X.setRequestHeader(Ct,Ze[Ct])});const st=Re(wn.impl.options.corsImg.data||"");Object.keys(st).forEach(function(Ct){typeof st[Ct]=="string"&&(st[Ct]=st[Ct].replace("#{cors}",$))}),X.send(Xe?JSON.stringify(st):st)}else X.open("GET",$,!0),X.send();let ae;if(wn.impl.options.imagePlaceholder){const Be=wn.impl.options.imagePlaceholder.split(/,/);Be&&Be[1]&&(ae=Be[1])}function De(){if(X.readyState!==4)return;if(X.status>=300){ae?ie(ae):Fe(`cannot fetch resource: ${$}, status: ${X.status}`);return}const Be=new FileReader;Be.onloadend=function(){ie(Be.result)},Be.readAsDataURL(X.response)}function je(){ae?ie(ae):Fe(`timeout of ${ce}ms occured while fetching resource: ${$}`)}function Re(Be){try{return JSON.parse(JSON.stringify(Be))}catch{Fe("corsImg.data is missing or invalid");return}}function Fe(Be){console.error(Be),ie("")}})),he.promise}function Y($){return $.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")}function Z($){return function(he){return new Promise(function(ie){setTimeout(function(){ie(he)},$)})}}function Q($){const he=[],ie=$.length;for(let ce=0;ce=0;r?(e.setProperty(t,n,r),a&&e.setProperty(`-webkit-${t}`,n,r)):(e.setProperty(t,n),a&&e.setProperty(`-webkit-${t}`,n))}function zz(e,t,n,r,a){const o=wn.impl.options.copyDefaultStyles?Wz(e,t):{},i=a.style;Zt.asArray(n).forEach(function(l){const c=n.getPropertyValue(l),f=o[l],h=r?r.getPropertyValue(l):void 0;if(c!==f||r&&c!==h){const g=n.getPropertyPriority(l);Uz(i,l,c,g)}})}let N0=null,cw={};const Vz=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];function Wz(e,t){const n=l(t),r=c(n);if(cw[r])return cw[r];const a=$z(),o=f(a.document,n),i=h(a,o);return g(o),cw[r]=i,i;function l(y){const w=[];do{if(y.nodeType===iI){const S=y.tagName;if(w.push(S),Vz.includes(S))break}y=y.parentNode}while(y);return w}function c(y){return e.styleCaching==="relaxed"?y.filter((w,S,D)=>S===0||S===D.length-1).join(">"):y.join(">")}function f(y,w){let S=y.body;do{const D=w.pop(),I=y.createElement(D);S.appendChild(I),S=I}while(w.length>0);return S.textContent="​",S}function h(y,w){const S={},D=y.getComputedStyle(w);return Zt.asArray(D).forEach(function(I){S[I]=I==="width"||I==="height"?"auto":D.getPropertyValue(I)}),S}function g(y){do{const w=y.parentElement;w!==null&&w.removeChild(y),y=w}while(y&&y.tagName!=="BODY")}}function $z(){if(Ci)return Ci.contentWindow;const e=document.characterSet||"UTF-8",t=document.doctype,n=t?`":"";return Ci=document.createElement("iframe"),Ci.id="domtoimage-sandbox-"+Zt.uid(),Ci.className="domtoimage-thino",Ci.style.visibility="hidden",Ci.style.position="fixed",document.body.appendChild(Ci),a(Ci,n,e,"domtoimage-sandbox");function r(o){if(o){const i=document.createElement("div");return i.innerText=o,i.innerHTML}else return""}function a(o,i,l,c){try{return o.contentWindow.document.write(`${i}${c}`),o.contentWindow}catch{}const f=document.createElement("meta");f.setAttribute("charset",l);try{const h=document.implementation.createHTMLDocument(c);h.head.appendChild(f);const g=i+h.documentElement.outerHTML;return o.setAttribute("srcdoc",g),o.contentWindow}catch{}return o.contentDocument.head.appendChild(f),o.contentDocument.title=c,o.contentWindow}}function Zz(){Ci&&(document.body.removeChild(Ci),Ci=null),N0&&clearTimeout(N0),N0=setTimeout(()=>{N0=null,cw={}},20*1e3)}async function qz(e,t,n){return await wn.toCanvas(e,{width:e.clientWidth,height:e.clientHeight,quality:1,scale:t?2:1,requestUrl:x.requestUrl,type:n})}const kb=async(e,t)=>(await qz(e,!0,"image/jpeg")).toDataURL(),Bx=async e=>{e.startsWith("http")&&(e=await Sf(e));const t=e.split("base64,")[1],n=gb(t,"image/png");await o9(n),new x.Notice(E("Send to clipboard successfully"))},Gz=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const l=e.metadataCache.getFirstLinkpathDest(t,"");if(!l){new x.Notice(E("File not exist"));return}r=l.path}const a=await e.vault.adapter.readBinary(r),o=new Uint8Array(a),i=new Blob([o],{type:"image/png"});await o9(i)},o9=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},Hx=1.1,Yx=300,Ux=20,Jz=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:a})=>{const o=P.useRef(null),[i,l]=P.useState(-1),c=Le.getState().dailyNotesState.app,[f,h]=P.useState(a),[g,y]=P.useState(t),w={close:P.useRef(null),previous:P.useRef(null),next:P.useRef(null),decrease:P.useRef(null),increase:P.useRef(null),zoom:P.useRef(null),copy:P.useRef(null)};P.useEffect(()=>{!n&&!t||(x.setIcon(w.close.current,"x"),w.previous.current&&x.setIcon(w.previous.current,"arrow-left"),w.next.current&&x.setIcon(w.next.current,"arrow-right"),x.setIcon(w.decrease.current,"zoom-out"),x.setIcon(w.increase.current,"zoom-in"),x.setIcon(w.zoom.current,"circle"),x.setIcon(w.copy.current,"clipboard"))},[w]),P.useEffect(()=>{ut.getImageSize(g).then(({width:L})=>{l(L!==0?40:0)})},[g]);const S=()=>{let L=f-1;L<0&&(L=r.length-1),h(L),y(r[L].src)},D=()=>{let L=f+1;L>=r.length&&(L=0),h(L),y(r[L].src)},I=()=>{e()},M=()=>{i>30&&l(i-10)},N=()=>{l(i+10)},_=L=>{L.target!==o.current&&L.target===o.current.parentElement&&I()},k=L=>{if(L.ctrlKey){L.preventDefault();const R=o.current,V=L.nativeEvent.offsetX,Y=L.nativeEvent.offsetY,Z=V/R.clientWidth,Q=Y/R.clientHeight;let G;L.deltaY>0?G=i/Hx:G=i*Hx,G>Yx?G=Yx:G{if(g&&!n)await Bx(t);else if(n){const R=r[f].parentElement.getAttribute("src");if(!R){await Bx(g);return}await Gz(c,R)}};return v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:w.close,className:"btn close-btn",onClick:I}),v.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:_,onWheel:k,children:[v.jsx("img",{className:i<=0?"hidden":"",ref:o,height:i+"%",src:g}),v.jsx("span",{className:"loading-text "+(i===-1?"":"hidden"),children:E("Image is loading...")}),v.jsx("span",{className:"loading-text "+(i===0?"":"hidden"),children:E("😟 Cannot load image, image link maybe broken")})]}),v.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:w.previous,className:"btn",onClick:S}),v.jsx("button",{ref:w.next,className:"btn",onClick:D})]}),v.jsx("button",{ref:w.decrease,className:"btn",onClick:M}),v.jsx("button",{ref:w.increase,className:"btn",onClick:N}),v.jsx("button",{ref:w.zoom,className:"btn",onClick:()=>l(80)}),v.jsx("button",{ref:w.copy,className:"btn",onClick:B})]})]})};function Nb({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){Db({className:"preview-image-dialog"},Jz,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}var Kz=class extends Error{constructor(e){super(`react-collapsed: ${e}`)}},Lw=(...e)=>(e[0],`${e[1]}`,void 0);function i9(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Qz(e,t,n){const[r,a]=P.useState(t),o=P.useRef(typeof e<"u"),i=o.current?e:r,l=i9(n),c=P.useCallback(f=>{const g=typeof f=="function"?f(i):f;o.current||a(g),l==null||l(g)},[l,i]);return P.useEffect(()=>{Lw(!(o.current&&e==null),"`isExpanded` state is changing from controlled to uncontrolled. useCollapse should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."),Lw(!(!o.current&&e!=null),"`isExpanded` state is changing from uncontrolled to controlled. useCollapse should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop.")},[e]),[i,c]}var Xz="(prefers-reduced-motion: reduce)";function eV(){const[e,t]=P.useState(!1);return P.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(Xz);t(n.matches);const r=a=>{t(a.matches)};if(n.addEventListener)return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)};if(n.addListener)return n.addListener(r),()=>{n.removeListener(r)}},[]),e}var tV=QL.useId||(()=>{});function nV(){return tV()??""}var rV=typeof window<"u"?P.useLayoutEffect:P.useEffect,LS=!1,aV=0,zx=()=>++aV;function oV(e){const t=e||(LS?zx():null),[n,r]=P.useState(t);return rV(()=>{n===null&&r(zx())},[]),P.useEffect(()=>{LS===!1&&(LS=!0)},[]),n!=null?String(n):void 0}function iV(e){const t=nV(),n=oV(e);return typeof e=="string"?e:typeof t=="string"?t:n}function sV(e,t){const n=performance.now(),r={};function a(){r.id=requestAnimationFrame(o=>{o-n>t?e():a()})}return a(),r}function Vx(e){e.id&&cancelAnimationFrame(e.id)}function Wx(e){return e!=null&&e.current?e.current.scrollHeight:(Lw(!0,"Was not able to find a ref to the collapse element via `getCollapseProps`. Ensure that the element exposes its `ref` prop. If it exposes the ref prop under a different name (like `innerRef`), use the `refKey` property to change it. Example:\n\nconst collapseProps = getCollapseProps({refKey: 'innerRef'})"),0)}function lV(e){if(!e||typeof e=="string")return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function uV(e,t){if(e!=null)if(typeof e=="function")e(t);else try{e.current=t}catch{throw new Kz(`Cannot assign value "${t}" to ref "${e}"`)}}function $x(...e){return e.every(t=>t==null)?null:t=>{e.forEach(n=>{uV(n,t)})}}function cV(e){let t=n=>{};t=n=>{if(!(n!=null&&n.current))return;const{paddingTop:r,paddingBottom:a}=window.getComputedStyle(n.current);Lw(!(r&&r!=="0px"||a&&a!=="0px"),`Padding applied to the collapse element will cause the animation to break and not perform as expected. To fix, apply equivalent padding to the direct descendent of the collapse element. Example: + `)},bz=[{label:E("Today"),value:x.moment().format("YYYY-MM-DD")},{label:E("Yesterday"),value:x.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:E("Last 7 days"),value:x.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:E("Last 30 days"),value:x.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:E("Last 90 days"),value:x.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:E("Last 180 days"),value:x.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:E("Last 365 days"),value:x.moment().subtract(365,"days").format("YYYY-MM-DD")}],X6=e=>{const{handleValueChange:t,setShownStatus:n}=e;return v.jsxs(v.Fragment,{children:[e.type==="icon"&&v.jsx("div",{className:"quick-date-btn-group",children:bz.map((r,a)=>v.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},a))}),v.jsx(Cb,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||x.moment().startOf("day").valueOf(),handleDateStampChange:(r,a)=>{t(e.type==="icon"?x.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},Pw=e=>{const{handleValueChange:t}=e,[n,r]=ne.useState(!1),a=ne.useRef(null),o=ne.useRef(null),i=Mb(o.current,a.current,{placement:"bottom-start"});return Hv(a,()=>{r(!1)}),v.jsxs(v.Fragment,{children:[v.jsx("span",{ref:c=>{o.current=c,c&&e.type==="icon"&&x.setIcon(c,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!x.Platform.isMobile&&r(!n),!x.Platform.isMobile&&(i!=null&&i.update)&&(i==null||i.update()),x.Platform.isMobile&&new e9(ft.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:x.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),v.jsx("div",{className:`menu-btns-popup ${n?"":"thino-hidden"}`,ref:a,style:i.styles.popper,children:v.jsx(X6,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class e9 extends x.Modal{constructor(n,r,a){super(n);Se(this,"root");Se(this,"type");Se(this,"handleValueChange");this.type=r,this.handleValueChange=a}onOpen(){const{contentEl:n}=this;this.root=Rv(n),this.root.render(v.jsx(X6,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const Sz=(e,t)=>(e%t+t)%t;class Dz{constructor(t,n,r){Se(this,"owner");Se(this,"values");Se(this,"suggestions");Se(this,"selectedItem");Se(this,"containerEl");this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",a=>{if(!a.isComposing)return this.useSelectedItem(a),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const a=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,a),n.push(a)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=Sz(t,this.suggestions.length),a=this.suggestions[this.selectedItem],o=this.suggestions[r];a==null||a.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}}class t9{constructor(t,n){Se(this,"inputEl");Se(this,"popper");Se(this,"scope");Se(this,"suggestEl");Se(this,"suggest");Se(this,"cb");this.inputEl=t,this.scope=new x.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new Dz(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("click",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",a=>{a.preventDefault()})}clearInput(){this.inputEl.value="",this.inputEl.trigger("blur"),this.inputEl.trigger("focus"),this.inputEl.trigger("input"),this.onInputChanged()}onInputChanged(){const t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=Q6(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:a})=>{const o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,a.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}destroy(){this.inputEl.removeEventListener("input",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("blur",this.close.bind(this)),this.close()}updateCb(t){this.cb=t}}const Tz=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let rv=class extends t9{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=ft.getState(),a=t.toLocaleLowerCase(),o=n.UseVaultTags?Tz(r):we.getState().tags;return this.fuzzySearchItemsOptimized(a,o).map(i=>i.item)}renderSuggestion(t,n){n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:t})}selectSuggestion(t){this.inputEl.value=t,this.cb&&this.cb(t),this.inputEl.dispatchEvent(new Event("change")),this.inputEl.trigger("change"),this.close()}};const Iz=e=>{const t=new Set;return e.forEach(n=>{const r=new RegExp($r).exec(n.content),a=new RegExp(ua).exec(n.content);if(r)for(let o=1;o{const[t,n]=ne.useState([]),r=ne.useRef(null),a=ne.useRef(null);P.useEffect(()=>{if(a.current){if(r.current){r.current.updateCb(o);return}r.current=new rv(a.current,o)}},[a.current,t]);const o=l=>{if(!l)return;const c=new Set(t);c.add(l),n(Array.from(c)),r.current.clearInput()},i=()=>{e(t)};return v.jsxs("div",{className:"thino-tag-operation",children:[v.jsx("div",{className:"tag-operation-title",children:E("Tag Bulk Select")}),v.jsxs("div",{className:"tag-operation-content",children:[v.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[v.jsx("div",{className:"name",children:E("Selected Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove selected tag")})]}),v.jsx("div",{className:"tag-operation-content-tags selected-tags",children:t.map(l=>v.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{n(t.filter(c=>c!==l))},children:l},l))}),v.jsx("div",{className:"tag-operation-content-inputer",children:v.jsx("input",{placeholder:E("Input to select exist tag"),ref:a,onKeyDown:l=>{l.key==="Enter"&&o(a.current.value)}})}),v.jsxs("div",{className:"tag-operation-content-btn-group",children:[v.jsx("button",{className:"cancel-btn",onClick:()=>{e([])},children:E("Cancel")}),v.jsx("button",{className:"save-btn",onClick:i,children:E("Save")})]})]})]})},xz=({app:e,thinos:t,closeDialog:n})=>{const[r,a]=ne.useState([]),[o,i]=ne.useState([]),[l,c]=ne.useState([]),f=ne.useRef(null),h=ne.useRef(null),g=ne.useRef(null),y=ne.useRef("End"),w=ne.useRef(!1),S=ne.useRef(null);P.useEffect(()=>{t&&t.length&&a(Iz(t))},[t]),P.useEffect(()=>{!g.current||!h.current||(new x.Setting(h.current).setName(E("Add tag position")).addDropdown(N=>{N.addOption("End",E("End")),N.addOption("Beginning",E("Beginning")),N.setValue("End").onChange(async B=>{y.current=B})}),new x.Setting(g.current).setName(E("Add tag with new line")).addToggle(N=>{N.setValue(!1).onChange(async B=>{w.current=B})}))},[]);const D=N=>{if(!N)return;const B=new Set(o);B.add(N),i(Array.from(B)),f.current.clearInput()};P.useEffect(()=>{if(S.current){if(f.current){f.current.updateCb(D);return}f.current=new rv(S.current,D)}},[S.current,o]);const I=()=>{n(),M({remove:l,add:o,targetThinos:t})},M=async({remove:N,add:B,targetThinos:k})=>{const R=w.current||!1,L=[];for(const _ of k){let V=_.content;for(const U of N)V=V.replace(new RegExp(`#${U}`,"g"),"");if(V=V.trim(),B.length>0&&(V=y.current==="Beginning"?`${B.map(U=>`#${U}`).join(" ")} ${R?` +`:""}${V}`:`${V} ${R?` +`:""}${B.map(U=>`#${U}`).join(" ")}`),_&&_.content!==V){const U=await we.updateMemo(_.id,V==null?void 0:V.trim());L.push(U)}}L.length>0&&we.editMemoBulk(L),L.length>0&&at.clearQuery()};return v.jsxs("div",{className:"thino-tag-operation",children:[v.jsx("div",{className:"tag-operation-title",children:E("Tag Bulk Edit")}),v.jsxs("div",{className:"tag-operation-content",children:[r.length>0&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[v.jsx("div",{className:"name",children:E("Exist Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove exist tag")})]}),v.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(N=>v.jsx("div",{className:ar("tag-operation-content-tag",l.includes(N)&&"tag-operation-content-tag-removed"),onClick:()=>{l.includes(N)||c([...l,N]),l.includes(N)&&c(l.filter(B=>B!==N)),o.includes(N)&&i(o.filter(B=>B!==N))},children:N},N))})]}),v.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[v.jsx("div",{className:"name",children:E("Selected Tags")}),v.jsx("div",{className:"desc",children:E("Click to remove selected tag")})]}),v.jsx("div",{className:"tag-operation-content-tags selected-tags",children:o.map(N=>v.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{i(o.filter(B=>B!==N))},children:N},N))}),v.jsx("div",{className:"tag-operation-content-inputer",children:v.jsx("input",{placeholder:E("Input to select exist tag"),ref:S,onKeyDown:N=>{N.key==="Enter"&&D(S.current.value)}})}),v.jsxs("div",{className:"tag-operation-settings",children:[v.jsx("div",{ref:h}),v.jsx("div",{ref:g})]}),v.jsxs("div",{className:"tag-operation-content-btn-group",children:[v.jsx("button",{className:"cancel-btn",onClick:n,children:E("Cancel")}),v.jsx("button",{className:"save-btn",onClick:I,children:E("Save")})]})]})]})},xT=new Map,Sf=async(e,t=!0)=>{const{vault:n,metadataCache:r}=ft.getState().app;if(t&&xT.has(e))return Promise.resolve(xT.get(e));if(e.contains("data:image"))return e;let a;const o=await n.adapter.exists(x.normalizePath(e));let i="";try{if(!o&&!/(http|https)/g.test(e)&&!e.includes("data:image")){let l;if(e.startsWith("app://")){const c=x.normalizePath(decodeURIComponent(e).replace(x.Platform.resourcePathPrefix,"").replace(/\?(.*)$/,"").replace(x.normalizePath(app==null?void 0:app.vault.adapter.basePath),""));i=x.normalizePath(decodeURIComponent(c))}else{if(l=r.getFirstLinkpathDest(e,""),!l){new x.Notice(E("File not exist"));return}i=l.path}}else i=e}catch(l){console.error(l)}if(i){if(/(http|https)/g.test(i))if(i.startsWith("http://localhost")){let l=i;l=l.replace("http://localhost/_capacitor_file_",""),l=decodeURIComponent(l).replace(/\?(.*)$/,"").replace(app==null?void 0:app.vault.adapter.basePath,""),l=x.normalizePath(decodeURIComponent(l));const c=await n.adapter.readBinary(l),f=new Uint8Array(c);a=new Blob([f],{type:"image/png"})}else try{const l=await x.requestUrl(e),c=new Uint8Array(l.arrayBuffer);a=new Blob([c],{type:"image/png"})}catch{}else if(i){const l=await n.adapter.readBinary(i),c=new Uint8Array(l);a=new Blob([c],{type:"image/png"})}return a?await Mz(a,e):""}},Mz=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const a=r.result;xT.set(t,a),n(a)},r.readAsDataURL(e)}),Rg=async e=>{if(!e.style.backgroundImage.includes("url(")&&!e.style.backgroundImage.includes("http"))return;let t=e.style.backgroundImage.includes("url(")?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;return t?(t.startsWith("http://localhost")&&(t=t.replace("http://localhost/_capacitor_file_",""),t=decodeURIComponent(t).replace(/\?(.*)$/,"").replace(app==null?void 0:app.vault.adapter.basePath,""),t=x.normalizePath(decodeURIComponent(t))),await Sf(t)):void 0},kz=async e=>{var n;return e.getAttribute("src")?(n=e==null?void 0:e.src)!=null&&n.startsWith("http://localhost")?await Sf(e.getAttribute("path")||x.normalizePath(e==null?void 0:e.parentElement.getAttribute("src"))):await Sf(e.getAttribute("src")):void 0},Zt=Bz(),jw=Hz(),n9=Uz(),r9=Yz(),ef={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},wn={toSvg:a9,toPng:Fz,toJpeg:Oz,toBlob:Pz,toPixelData:Az,toCanvas:jz,impl:{fontFaces:n9,images:r9,util:Zt,inliner:jw,urlCache:[],options:{}}},iI=(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1,uw=(typeof global<"u"?global.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,Nz=(typeof global<"u"?global.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function a9(e,t){wn.impl.util.getWindow(e),t=t||{},Lz(t);let n=[];return Promise.resolve(e).then(r).then(function(c){return o9(c,t,null)}).then(Rz).then(_z).then(i).then(l).then(a).then(o);function r(c){if(c.nodeType===iI)return c;const f=c,h=c.parentNode,g=document.createElement("span");return h.replaceChild(g,f),g.append(c),n.push({parent:h,child:f,wrapper:g}),g}function a(c){for(;n.length>0;){const f=n.pop();f.parent.replaceChild(f.child,f.wrapper)}return c}function o(c){return wn.impl.urlCache=[],qz(),c}function i(c){t.bgcolor&&(c.style.backgroundColor=t.bgcolor),t.width&&(c.style.width=`${t.width}px`),t.height&&(c.style.height=`${t.height}px`),t.style&&Object.keys(t.style).forEach(function(h){c.style[h]=t.style[h]});let f=null;return typeof t.onclone=="function"&&(f=t.onclone(c)),Promise.resolve(f).then(function(){return c})}function l(c){let f=t.width||Zt.width(c),h=t.height||Zt.height(c);return Promise.resolve(c).then(function(g){return g.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(g)}).then(Zt.escapeXhtml).then(function(g){const y=(Zt.isDimensionMissing(f)?' width="100%"':` width="${f}"`)+(Zt.isDimensionMissing(h)?' height="100%"':` height="${h}"`);return`${g}`}).then(function(g){return`data:image/svg+xml;charset=utf-8,${g}`})}}function Az(e,t){return zv(e,t).then(function(n){return n.getContext("2d").getImageData(0,0,Zt.width(e),Zt.height(e)).data})}function Fz(e,t){return zv(e,t).then(function(n){return n.toDataURL()})}function Oz(e,t){return zv(e,t).then(function(n){return n.toDataURL("image/jpeg",(t?t.quality:void 0)||1)})}function Pz(e,t){return zv(e,t).then(Zt.canvasToBlob)}function jz(e,t){return zv(e,t)}function Lz(e){typeof e.copyDefaultStyles>"u"?wn.impl.options.copyDefaultStyles=ef.copyDefaultStyles:wn.impl.options.copyDefaultStyles=e.copyDefaultStyles,typeof e.imagePlaceholder>"u"?wn.impl.options.imagePlaceholder=ef.imagePlaceholder:wn.impl.options.imagePlaceholder=e.imagePlaceholder,typeof e.cacheBust>"u"?wn.impl.options.cacheBust=ef.cacheBust:wn.impl.options.cacheBust=e.cacheBust,typeof e.corsImg>"u"?wn.impl.options.corsImg=ef.corsImg:wn.impl.options.corsImg=e.corsImg,typeof e.useCredentials>"u"?wn.impl.options.useCredentials=ef.useCredentials:wn.impl.options.useCredentials=e.useCredentials,typeof e.httpTimeout>"u"?wn.impl.options.httpTimeout=ef.httpTimeout:wn.impl.options.httpTimeout=e.httpTimeout,typeof e.styleCaching>"u"?wn.impl.options.styleCaching=ef.styleCaching:wn.impl.options.styleCaching=e.styleCaching,wn.impl.options.requestUrl=e.requestUrl,wn.impl.options.type=e.type||"image/png"}function zv(e,t){return t=t||{},a9(e,t).then(Zt.makeImage).then(function(r){const a=typeof t.scale!="number"?1:t.scale,o=n(e,a),i=o.getContext("2d");return i.msImageSmoothingEnabled=!1,i.imageSmoothingEnabled=!1,r&&(i.scale(a,a),i.drawImage(r,0,0)),o});function n(r,a){let o=t.width||Zt.width(r),i=t.height||Zt.height(r);Zt.isDimensionMissing(o)&&(o=Zt.isDimensionMissing(i)?300:i*2),Zt.isDimensionMissing(i)&&(i=o/2);const l=document.createElement("canvas");if(l.width=o*a,l.height=i*a,t.bgcolor){const c=l.getContext("2d");c.fillStyle=t.bgcolor,c.fillRect(0,0,l.width,l.height)}return l}}let Ci=null;function o9(e,t,n,r){const a=t.filter;if(e===Ci||Zt.isHTMLScriptElement(e)||Zt.isHTMLStyleElement(e)||Zt.isHTMLLinkElement(e)||n!==null&&a&&!a(e))return Promise.resolve();return Promise.resolve(e).then(o).then(function(f){return l(f,i(e))}).then(function(f){return c(f,e)});function o(f){return Zt.isHTMLCanvasElement(f)?Zt.makeImage(f.toDataURL()):f.cloneNode(!1)}function i(f){return Zt.isElementHostForOpenShadowRoot(f)?f.shadowRoot:f}function l(f,h){const g=S(h);let y=Promise.resolve();if(g.length!==0){const D=uw(w(h));Zt.asArray(g).forEach(function(I){y=y.then(function(){return o9(I,t,D).then(function(M){M&&f.appendChild(M)})})})}return y.then(function(){return f});function w(D){return Zt.isShadowRoot(D)?D.host:D}function S(D){return Zt.isShadowSlotElement(D)?D.assignedNodes():D.childNodes}}function c(f,h){if(!Zt.isElement(f)||Zt.isShadowSlotElement(h))return Promise.resolve(f);return Promise.resolve().then(g).then(y).then(w).then(S).then(function(){return f});function g(){I(h,f);function D(M,N){N.font=M.font,N.fontFamily=M.fontFamily,N.fontFeatureSettings=M.fontFeatureSettings,N.fontKerning=M.fontKerning,N.fontSize=M.fontSize,N.fontStretch=M.fontStretch,N.fontStyle=M.fontStyle,N.fontVariant=M.fontVariant,N.fontVariantCaps=M.fontVariantCaps,N.fontVariantEastAsian=M.fontVariantEastAsian,N.fontVariantLigatures=M.fontVariantLigatures,N.fontVariantNumeric=M.fontVariantNumeric,N.fontVariationSettings=M.fontVariationSettings,N.fontWeight=M.fontWeight}function I(M,N){const B=uw(M);B.cssText?(N.style.cssText=B.cssText,D(B,N.style)):(Vz(t,M,B,n,N),n===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(k=>N.style.removeProperty(k)),["left","right","top","bottom"].forEach(k=>{N.style.getPropertyValue(k)&&N.style.setProperty(k,"0px")})))}}function y(){const D=Zt.uid();[":before",":after"].forEach(function(M){I(M)});function I(M){const N=uw(h,M),B=N.getPropertyValue("content");if(B===""||B==="none")return;const k=f.getAttribute("class")||"";f.setAttribute("class",`${k} ${D}`);const R=document.createElement("style");R.appendChild(L()),f.appendChild(R);function L(){const _=`.${D}:${M}`,V=N.cssText?U():Z();return document.createTextNode(`${_}{${V}}`);function U(){return`${N.cssText} content: ${B};`}function Z(){return`${Zt.asArray(N).map(G).join("; ")};`;function G(re){const de=N.getPropertyValue(re),fe=N.getPropertyPriority(re)?" !important":"";return`${re}: ${de}${fe}`}}}}}function w(){Zt.isHTMLTextAreaElement(h)&&(f.innerHTML=h.value),Zt.isHTMLInputElement(h)&&f.setAttribute("value",h.value)}function S(){Zt.isSVGElement(f)&&(f.setAttribute("xmlns","http://www.w3.org/2000/svg"),Zt.isSVGRectElement(f)&&["width","height"].forEach(function(D){const I=f.getAttribute(D);I&&f.style.setProperty(D,I)}))}}}function Rz(e){return n9.resolveAll().then(function(t){if(t!==""){const n=document.createElement("style");e.appendChild(n),n.appendChild(document.createTextNode(t))}return e})}function _z(e){return r9.inlineAll(e).then(function(){return e})}function Bz(){let e=0;return{escape:U,isDataUrl:M,canvasToBlob:k,resolveUrl:R,getAndEncode:V,uid:L,delay:Z,asArray:Q,escapeXhtml:G,makeImage:_,width:re,height:de,getWindow:t,isElement:o,isElementHostForOpenShadowRoot:n,isShadowRoot:r,isInShadowRoot:a,isHTMLElement:l,isHTMLCanvasElement:i,isHTMLInputElement:f,isHTMLImageElement:c,isHTMLLinkElement:h,isHTMLScriptElement:g,isHTMLStyleElement:y,isHTMLTextAreaElement:w,isShadowSlotElement:S,isSVGElement:D,isSVGRectElement:I,isDimensionMissing:N};function t($){const he=$?$.ownerDocument:void 0;return(he?he.defaultView:void 0)||global||window}function n($){return o($)&&$.shadowRoot!==null}function r($){return $ instanceof t($).ShadowRoot}function a($){return $!==null&&Object.prototype.hasOwnProperty.call($,"getRootNode")&&r($.getRootNode())}function o($){return $ instanceof t($).Element}function i($){return $ instanceof t($).HTMLCanvasElement}function l($){return $ instanceof t($).HTMLElement}function c($){return $ instanceof t($).HTMLImageElement}function f($){return $ instanceof t($).HTMLInputElement}function h($){return $ instanceof t($).HTMLLinkElement}function g($){return $ instanceof t($).HTMLScriptElement}function y($){return $ instanceof t($).HTMLStyleElement}function w($){return $ instanceof t($).HTMLTextAreaElement}function S($){return a($)&&$ instanceof t($).HTMLSlotElement}function D($){return $ instanceof t($).SVGElement}function I($){return $ instanceof t($).SVGRectElement}function M($){return $.search(/^(data:)/)!==-1}function N($){return isNaN($)||$<=0}function B($){return new Promise(function(he){const se=Nz($.toDataURL().split(",")[1]),ue=se.length,X=new Uint8Array(ue);for(let oe=0;oenew Promise(ue=>{const X=new FileReader;X.onload=function(oe){ue(oe.target.result)},X.readAsDataURL(new Blob([se.arrayBuffer],{type:se.headers["content-type"]}))})).catch(se=>(console.error("cannot fetch resource: "+$+", error: "+se),"")):he.promise=new Promise(function(se){const ue=wn.impl.options.httpTimeout,X=new XMLHttpRequest;if(X.onreadystatechange=De,X.ontimeout=je,X.responseType="blob",X.timeout=ue,wn.impl.options.useCredentials&&(X.withCredentials=!0),wn.impl.options.corsImg&&$.indexOf("http")===0&&$.indexOf(window.location.origin)===-1){const Be=(wn.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";X.open(Be,(wn.impl.options.corsImg.url||"").replace("#{cors}",$),!0);let Xe=!1;const Ze=wn.impl.options.corsImg.headers||{};Object.keys(Ze).forEach(function(Ct){Ze[Ct].indexOf("application/json")!==-1&&(Xe=!0),X.setRequestHeader(Ct,Ze[Ct])});const st=Re(wn.impl.options.corsImg.data||"");Object.keys(st).forEach(function(Ct){typeof st[Ct]=="string"&&(st[Ct]=st[Ct].replace("#{cors}",$))}),X.send(Xe?JSON.stringify(st):st)}else X.open("GET",$,!0),X.send();let oe;if(wn.impl.options.imagePlaceholder){const Be=wn.impl.options.imagePlaceholder.split(/,/);Be&&Be[1]&&(oe=Be[1])}function De(){if(X.readyState!==4)return;if(X.status>=300){oe?se(oe):Fe(`cannot fetch resource: ${$}, status: ${X.status}`);return}const Be=new FileReader;Be.onloadend=function(){se(Be.result)},Be.readAsDataURL(X.response)}function je(){oe?se(oe):Fe(`timeout of ${ue}ms occured while fetching resource: ${$}`)}function Re(Be){try{return JSON.parse(JSON.stringify(Be))}catch{Fe("corsImg.data is missing or invalid");return}}function Fe(Be){console.error(Be),se("")}})),he.promise}function U($){return $.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")}function Z($){return function(he){return new Promise(function(se){setTimeout(function(){se(he)},$)})}}function Q($){const he=[],se=$.length;for(let ue=0;ue=0;r?(e.setProperty(t,n,r),a&&e.setProperty(`-webkit-${t}`,n,r)):(e.setProperty(t,n),a&&e.setProperty(`-webkit-${t}`,n))}function Vz(e,t,n,r,a){const o=wn.impl.options.copyDefaultStyles?$z(e,t):{},i=a.style;Zt.asArray(n).forEach(function(l){const c=n.getPropertyValue(l),f=o[l],h=r?r.getPropertyValue(l):void 0;if(c!==f||r&&c!==h){const g=n.getPropertyPriority(l);zz(i,l,c,g)}})}let N0=null,cw={};const Wz=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];function $z(e,t){const n=l(t),r=c(n);if(cw[r])return cw[r];const a=Zz(),o=f(a.document,n),i=h(a,o);return g(o),cw[r]=i,i;function l(y){const w=[];do{if(y.nodeType===iI){const S=y.tagName;if(w.push(S),Wz.includes(S))break}y=y.parentNode}while(y);return w}function c(y){return e.styleCaching==="relaxed"?y.filter((w,S,D)=>S===0||S===D.length-1).join(">"):y.join(">")}function f(y,w){let S=y.body;do{const D=w.pop(),I=y.createElement(D);S.appendChild(I),S=I}while(w.length>0);return S.textContent="​",S}function h(y,w){const S={},D=y.getComputedStyle(w);return Zt.asArray(D).forEach(function(I){S[I]=I==="width"||I==="height"?"auto":D.getPropertyValue(I)}),S}function g(y){do{const w=y.parentElement;w!==null&&w.removeChild(y),y=w}while(y&&y.tagName!=="BODY")}}function Zz(){if(Ci)return Ci.contentWindow;const e=document.characterSet||"UTF-8",t=document.doctype,n=t?`":"";return Ci=document.createElement("iframe"),Ci.id="domtoimage-sandbox-"+Zt.uid(),Ci.className="domtoimage-thino",Ci.style.visibility="hidden",Ci.style.position="fixed",document.body.appendChild(Ci),a(Ci,n,e,"domtoimage-sandbox");function r(o){if(o){const i=document.createElement("div");return i.innerText=o,i.innerHTML}else return""}function a(o,i,l,c){try{return o.contentWindow.document.write(`${i}${c}`),o.contentWindow}catch{}const f=document.createElement("meta");f.setAttribute("charset",l);try{const h=document.implementation.createHTMLDocument(c);h.head.appendChild(f);const g=i+h.documentElement.outerHTML;return o.setAttribute("srcdoc",g),o.contentWindow}catch{}return o.contentDocument.head.appendChild(f),o.contentDocument.title=c,o.contentWindow}}function qz(){Ci&&(document.body.removeChild(Ci),Ci=null),N0&&clearTimeout(N0),N0=setTimeout(()=>{N0=null,cw={}},20*1e3)}async function Gz(e,t,n){return await wn.toCanvas(e,{width:e.clientWidth,height:e.clientHeight,quality:1,scale:t?2:1,requestUrl:x.requestUrl,type:n})}const kb=async(e,t)=>(await Gz(e,!0,"image/jpeg")).toDataURL(),Bx=async e=>{e.startsWith("http")&&(e=await Sf(e));const t=e.split("base64,")[1],n=gb(t,"image/png");await i9(n),new x.Notice(E("Send to clipboard successfully"))},Jz=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const l=e.metadataCache.getFirstLinkpathDest(t,"");if(!l){new x.Notice(E("File not exist"));return}r=l.path}const a=await e.vault.adapter.readBinary(r),o=new Uint8Array(a),i=new Blob([o],{type:"image/png"});await i9(i)},i9=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},Hx=1.1,Ux=300,Yx=20,Kz=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:a})=>{const o=P.useRef(null),[i,l]=P.useState(-1),c=Le.getState().dailyNotesState.app,[f,h]=P.useState(a),[g,y]=P.useState(t),w={close:P.useRef(null),previous:P.useRef(null),next:P.useRef(null),decrease:P.useRef(null),increase:P.useRef(null),zoom:P.useRef(null),copy:P.useRef(null)};P.useEffect(()=>{!n&&!t||(x.setIcon(w.close.current,"x"),w.previous.current&&x.setIcon(w.previous.current,"arrow-left"),w.next.current&&x.setIcon(w.next.current,"arrow-right"),x.setIcon(w.decrease.current,"zoom-out"),x.setIcon(w.increase.current,"zoom-in"),x.setIcon(w.zoom.current,"circle"),x.setIcon(w.copy.current,"clipboard"))},[w]),P.useEffect(()=>{ut.getImageSize(g).then(({width:L})=>{l(L!==0?40:0)})},[g]);const S=()=>{let L=f-1;L<0&&(L=r.length-1),h(L),y(r[L].src)},D=()=>{let L=f+1;L>=r.length&&(L=0),h(L),y(r[L].src)},I=()=>{e()},M=()=>{i>30&&l(i-10)},N=()=>{l(i+10)},B=L=>{L.target!==o.current&&L.target===o.current.parentElement&&I()},k=L=>{if(L.ctrlKey){L.preventDefault();const _=o.current,V=L.nativeEvent.offsetX,U=L.nativeEvent.offsetY,Z=V/_.clientWidth,Q=U/_.clientHeight;let G;L.deltaY>0?G=i/Hx:G=i*Hx,G>Ux?G=Ux:G{if(g&&!n)await Bx(t);else if(n){const _=r[f].parentElement.getAttribute("src");if(!_){await Bx(g);return}await Jz(c,_)}};return v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:w.close,className:"btn close-btn",onClick:I}),v.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:B,onWheel:k,children:[v.jsx("img",{className:i<=0?"thino-hidden":"",ref:o,height:i+"%",src:g}),v.jsx("span",{className:"loading-text "+(i===-1?"":"thino-hidden"),children:E("Image is loading...")}),v.jsx("span",{className:"loading-text "+(i===0?"":"thino-hidden"),children:E("😟 Cannot load image, image link maybe broken")})]}),v.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:w.previous,className:"btn",onClick:S}),v.jsx("button",{ref:w.next,className:"btn",onClick:D})]}),v.jsx("button",{ref:w.decrease,className:"btn",onClick:M}),v.jsx("button",{ref:w.increase,className:"btn",onClick:N}),v.jsx("button",{ref:w.zoom,className:"btn",onClick:()=>l(80)}),v.jsx("button",{ref:w.copy,className:"btn",onClick:R})]})]})};function Nb({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){Db({className:"preview-image-dialog"},Kz,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}var Qz=class extends Error{constructor(e){super(`react-collapsed: ${e}`)}},Lw=(...e)=>(e[0],`${e[1]}`,void 0);function s9(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Xz(e,t,n){const[r,a]=P.useState(t),o=P.useRef(typeof e<"u"),i=o.current?e:r,l=s9(n),c=P.useCallback(f=>{const g=typeof f=="function"?f(i):f;o.current||a(g),l==null||l(g)},[l,i]);return P.useEffect(()=>{Lw(!(o.current&&e==null),"`isExpanded` state is changing from controlled to uncontrolled. useCollapse should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."),Lw(!(!o.current&&e!=null),"`isExpanded` state is changing from uncontrolled to controlled. useCollapse should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop.")},[e]),[i,c]}var eV="(prefers-reduced-motion: reduce)";function tV(){const[e,t]=P.useState(!1);return P.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=window.matchMedia(eV);t(n.matches);const r=a=>{t(a.matches)};if(n.addEventListener)return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)};if(n.addListener)return n.addListener(r),()=>{n.removeListener(r)}},[]),e}var nV=XL.useId||(()=>{});function rV(){return nV()??""}var aV=typeof window<"u"?P.useLayoutEffect:P.useEffect,LS=!1,oV=0,zx=()=>++oV;function iV(e){const t=e||(LS?zx():null),[n,r]=P.useState(t);return aV(()=>{n===null&&r(zx())},[]),P.useEffect(()=>{LS===!1&&(LS=!0)},[]),n!=null?String(n):void 0}function sV(e){const t=rV(),n=iV(e);return typeof e=="string"?e:typeof t=="string"?t:n}function lV(e,t){const n=performance.now(),r={};function a(){r.id=requestAnimationFrame(o=>{o-n>t?e():a()})}return a(),r}function Vx(e){e.id&&cancelAnimationFrame(e.id)}function Wx(e){return e!=null&&e.current?e.current.scrollHeight:(Lw(!0,"Was not able to find a ref to the collapse element via `getCollapseProps`. Ensure that the element exposes its `ref` prop. If it exposes the ref prop under a different name (like `innerRef`), use the `refKey` property to change it. Example:\n\nconst collapseProps = getCollapseProps({refKey: 'innerRef'})"),0)}function uV(e){if(!e||typeof e=="string")return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function cV(e,t){if(e!=null)if(typeof e=="function")e(t);else try{e.current=t}catch{throw new Qz(`Cannot assign value "${t}" to ref "${e}"`)}}function $x(...e){return e.every(t=>t==null)?null:t=>{e.forEach(n=>{cV(n,t)})}}function dV(e){let t=n=>{};t=n=>{if(!(n!=null&&n.current))return;const{paddingTop:r,paddingBottom:a}=window.getComputedStyle(n.current);Lw(!(r&&r!=="0px"||a&&a!=="0px"),`Padding applied to the collapse element will cause the animation to break and not perform as expected. To fix, apply equivalent padding to the direct descendent of the collapse element. Example: Before:

{children}
@@ -197,15 +197,15 @@ After:
{children}
-
`)},P.useEffect(()=>{t(e)},[e])}var dV=typeof window>"u"?P.useEffect:P.useLayoutEffect;function fV({duration:e,easing:t="cubic-bezier(0.4, 0, 0.2, 1)",onTransitionStateChange:n=()=>{},isExpanded:r,defaultExpanded:a=!1,hasDisabledAnimation:o,id:i,...l}={}){const c=i9(n),f=iV(i?`${i}`:void 0),[h,g]=Qz(r,a),y=P.useRef(h),[w,S]=P.useState(!1),D=eV(),I=o??D,M=P.useRef(),N=P.useRef(),_=P.useRef(null),[k,B]=P.useState(null);cV(_);const L=`${l.collapsedHeight||0}px`;function R(V){if(!_.current)return;const Y=_.current;for(const Z in V){const Q=V[Z];Q?Y.style[Z]=Q:Y.style.removeProperty(Z)}}return dV(()=>{if(!_.current||h===y.current)return;y.current=h;function Y(G){return I?0:e??lV(G)}const Z=G=>`height ${Y(G)}ms ${t}`,Q=G=>{function le(){h?(R({height:"",overflow:"",transition:"",display:""}),c("expandEnd")):(R({transition:""}),c("collapseEnd")),S(!1)}N.current&&Vx(N.current),N.current=sV(le,G)};return S(!0),h?M.current=requestAnimationFrame(()=>{c("expandStart"),R({display:"block",overflow:"hidden",height:L}),M.current=requestAnimationFrame(()=>{c("expanding");const G=Wx(_);Q(Y(G)),_.current&&(_.current.style.transition=Z(G),_.current.style.height=`${G}px`)})}):M.current=requestAnimationFrame(()=>{c("collapseStart");const G=Wx(_);Q(Y(G)),R({transition:Z(G),height:`${G}px`}),M.current=requestAnimationFrame(()=>{c("collapsing"),R({height:L,overflow:"hidden"})})}),()=>{M.current&&cancelAnimationFrame(M.current),N.current&&Vx(N.current)}},[h,L,I,e,t,c]),{isExpanded:h,setExpanded:g,getToggleProps(V){const{disabled:Y,onClick:Z,refKey:Q,...G}={refKey:"ref",onClick(){},disabled:!1,...V},le=k?k.tagName==="BUTTON":void 0,se=V==null?void 0:V[Q||"ref"],fe={id:`react-collapsed-toggle-${f}`,"aria-controls":`react-collapsed-panel-${f}`,"aria-expanded":h,onClick(ie){Y||(Z==null||Z(ie),g(ce=>!ce))},[Q||"ref"]:$x(se,B)},$={type:"button",disabled:Y?!0:void 0},he={"aria-disabled":Y?!0:void 0,role:"button",tabIndex:Y?-1:0};return le===!1?{...fe,...he,...G}:le===!0?{...fe,...$,...G}:{...fe,...$,...he,...G}},getCollapseProps(V){const{style:Y,refKey:Z}={refKey:"ref",style:{},...V},Q=V==null?void 0:V[Z||"ref"];return{id:`react-collapsed-panel-${f}`,"aria-hidden":!h,"aria-labelledby":`react-collapsed-toggle-${f}`,role:"region",...V,[Z||"ref"]:$x(_,Q),style:{boxSizing:"border-box",...!w&&!h?{display:L==="0px"?"none":"block",height:L,overflow:"hidden"}:{},...Y}}}}}const hV=e=>{const{dailyNotesState:{app:t,view:n,settings:r},globalState:{memoListView:a}}=P.useContext(Lt),{getCollapseProps:o,getToggleProps:i,isExpanded:l,setExpanded:c}=fV({defaultExpanded:!0,collapsedHeight:(r==null?void 0:r.ThinoCollapsedHeight)??100}),{memo:f,handleMemoContentClick:h,handleMemoDoubleClick:g}=e,y=ne.useRef(null),[w,S]=ne.useState(""),D=ne.useRef(w),I=ne.useRef(0),[M,N]=ne.useState(!1),[_,k]=ne.useState(!1),B=x.debounce((R,V,Y)=>{for(const Z of R){const{height:Q}=Z.contentRect,G=(V==null?void 0:V.ThinoMaxHeight)||340,le=Q>G;N(le),c(!le),Y.disconnect()}},500);P.useEffect(()=>{var R;if(f.content!==D.current){if(r!=null&&r.OptimizeForCallout&&f.content.split("> [!").length>3&&f.content.split(` -`).length>10&&!_){const V=y.current.createEl("button");V.setText(E("Render content")),V.onclick=async()=>{k(!0),await L()};const Y=y.current.createEl("textarea");Y.setText(f.content),Y.disabled=!0,(R=y.current)==null||R.toggleClass(["raw-content"],!0),c(!0),N(!1);return}L()}},[f.content]),P.useEffect(()=>{_&&I.current!==(r==null?void 0:r.ThinoMaxHeight)&&(y!=null&&y.current.hasChildNodes()&&k(!1),L())},[r==null?void 0:r.ThinoMaxHeight]),P.useEffect(()=>{if(!_)return;const R=y.current;if(!R)return;if(!(r!=null&&r.ThinoMaxHeight)){c(!0),N(!1);return}const V=new ResizeObserver(Y=>{B(Y,r,V)});return V.observe(R),()=>V.disconnect()},[_]);const L=async()=>{var R,V,Y;if(y.current&&n&&t&&f.content!==D.current){y.current.empty(),await x.MarkdownRenderer.render(t,f.content,y.current,f.path,n);const Z=(R=y.current)==null?void 0:R.querySelectorAll(".internal-link");Z==null||Z.forEach(Q=>{const G=Q,le=G.getAttribute("data-href");if(!le)return;t.metadataCache.getFirstLinkpathDest(le,f.path)||Q.classList.add("is-unresolved"),G.addEventListener("mouseover",fe=>{fe.stopPropagation(),t.workspace.trigger("hover-link",{event:fe,source:"thino",hoverParent:n.containerEl,targetEl:G,linktext:le,sourcePath:G.href})})})}D.current=f.content,(V=y.current)==null||V.toggleClass(["markdown-rendered"],!0),(Y=y.current)==null||Y.toggleClass(["raw-content"],!1),k&&k(!0),I.current=(r==null?void 0:r.ThinoMaxHeight)||340};return v.jsxs(v.Fragment,{children:[M&&a==="moments"&&v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:E(l?"Collapse":"Expand")}),!l&&(r==null?void 0:r.ThinoCollapsedHeight)!==0&&v.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:g})]}),v.jsx("div",{...o({style:{margin:0}}),ref:y,className:"memo-content-text",onClick:R=>h(R,f),onDoubleClick:g,onContextMenu:R=>{R.preventDefault()}}),M&&a!=="moments"&&v.jsxs(v.Fragment,{children:[!l&&(r==null?void 0:r.ThinoCollapsedHeight)!==0&&v.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:g}),v.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:E(l?"Collapse":"Expand")})]})]})},s9=P.memo(hV,(e,t)=>e.memo.content===t.memo.content),pV=e=>{const[t,n]=P.useState({...e.memo,createdAtStr:ut.getDateTimeString(e.memo.createdAt)}),[r,a]=P.useState([]),[o,i]=P.useState([]);P.useEffect(()=>{(async()=>{try{const g=[],y=[...t.content.matchAll(ad)];for(const S of y)if(S&&S.length===3){const D=S[2],I=we.getMemoById(D);I&&g.push({...I,createdAtStr:ut.getDateTimeString(I.createdAt),dateStr:ut.getDateString(I.createdAt)})}a([...g]);const w=await we.getLinkedMemos(t.id);i(w.sort((S,D)=>ut.getTimeStampByDate(D.createdAt)-ut.getTimeStampByDate(S.createdAt)).map(S=>({...S,createdAtStr:ut.getDateTimeString(S.createdAt),dateStr:ut.getDateString(S.createdAt)})))}catch(g){console.error(g)}})()},[t.id]);const l=P.useCallback(async h=>{var y;const g=h.target;if(g.className==="memo-link-text"){const w=(y=g.dataset)==null?void 0:y.value,S=we.getMemoById(w??"");if(S){const D={...S,createdAtStr:ut.getDateTimeString(S.createdAt)};a([]),i([]),n(D)}else new x.Notice(E("Thino not found")),g.classList.remove("memo-link-text")}},[]),c=P.useCallback(h=>{a([]),i([]),n({...h,createdAtStr:ut.getDateTimeString(h.createdAt)})},[t.id]),f=P.useCallback(()=>{e.destroy(),dt.setEditMemoId(t.id)},[t.id]);return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"memo-card-container",children:[v.jsxs("div",{className:"header-container",children:[v.jsx("span",{className:"time-text",children:t.createdAtStr}),v.jsxs("div",{className:"btns-container",children:[v.jsx("button",{ref:h=>{h&&x.setIcon(h,"edit")},className:"btn edit-btn",onClick:f}),v.jsx("button",{ref:h=>{h&&x.setIcon(h,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),v.jsx("div",{className:"memo-container",children:v.jsx("div",{className:"memo-content-text",children:v.jsx(s9,{memo:t,handleMemoContentClick:l,handleMemoDoubleClick:()=>{}})})}),v.jsx("div",{className:"layer-container"})]}),r.length>0?v.jsxs("div",{className:"linked-memos-wrapper",children:[v.jsxs("span",{className:"normal-text",children:[E("LINKED")," ",r.length," THINO"," "]}),r.map(h=>{const g=AC(dT(h.content)).replaceAll(` + `)},P.useEffect(()=>{t(e)},[e])}var fV=typeof window>"u"?P.useEffect:P.useLayoutEffect;function hV({duration:e,easing:t="cubic-bezier(0.4, 0, 0.2, 1)",onTransitionStateChange:n=()=>{},isExpanded:r,defaultExpanded:a=!1,hasDisabledAnimation:o,id:i,...l}={}){const c=s9(n),f=sV(i?`${i}`:void 0),[h,g]=Xz(r,a),y=P.useRef(h),[w,S]=P.useState(!1),D=tV(),I=o??D,M=P.useRef(),N=P.useRef(),B=P.useRef(null),[k,R]=P.useState(null);dV(B);const L=`${l.collapsedHeight||0}px`;function _(V){if(!B.current)return;const U=B.current;for(const Z in V){const Q=V[Z];Q?U.style[Z]=Q:U.style.removeProperty(Z)}}return fV(()=>{if(!B.current||h===y.current)return;y.current=h;function U(G){return I?0:e??uV(G)}const Z=G=>`height ${U(G)}ms ${t}`,Q=G=>{function re(){h?(_({height:"",overflow:"",transition:"",display:""}),c("expandEnd")):(_({transition:""}),c("collapseEnd")),S(!1)}N.current&&Vx(N.current),N.current=lV(re,G)};return S(!0),h?M.current=requestAnimationFrame(()=>{c("expandStart"),_({display:"block",overflow:"hidden",height:L}),M.current=requestAnimationFrame(()=>{c("expanding");const G=Wx(B);Q(U(G)),B.current&&(B.current.style.transition=Z(G),B.current.style.height=`${G}px`)})}):M.current=requestAnimationFrame(()=>{c("collapseStart");const G=Wx(B);Q(U(G)),_({transition:Z(G),height:`${G}px`}),M.current=requestAnimationFrame(()=>{c("collapsing"),_({height:L,overflow:"hidden"})})}),()=>{M.current&&cancelAnimationFrame(M.current),N.current&&Vx(N.current)}},[h,L,I,e,t,c]),{isExpanded:h,setExpanded:g,getToggleProps(V){const{disabled:U,onClick:Z,refKey:Q,...G}={refKey:"ref",onClick(){},disabled:!1,...V},re=k?k.tagName==="BUTTON":void 0,de=V==null?void 0:V[Q||"ref"],fe={id:`react-collapsed-toggle-${f}`,"aria-controls":`react-collapsed-panel-${f}`,"aria-expanded":h,onClick(se){U||(Z==null||Z(se),g(ue=>!ue))},[Q||"ref"]:$x(de,R)},$={type:"button",disabled:U?!0:void 0},he={"aria-disabled":U?!0:void 0,role:"button",tabIndex:U?-1:0};return re===!1?{...fe,...he,...G}:re===!0?{...fe,...$,...G}:{...fe,...$,...he,...G}},getCollapseProps(V){const{style:U,refKey:Z}={refKey:"ref",style:{},...V},Q=V==null?void 0:V[Z||"ref"];return{id:`react-collapsed-panel-${f}`,"aria-hidden":!h,"aria-labelledby":`react-collapsed-toggle-${f}`,role:"region",...V,[Z||"ref"]:$x(B,Q),style:{boxSizing:"border-box",...!w&&!h?{display:L==="0px"?"none":"block",height:L,overflow:"hidden"}:{},...U}}}}}const pV=e=>{const{dailyNotesState:{app:t,view:n,settings:r},globalState:{memoListView:a}}=P.useContext(Lt),{getCollapseProps:o,getToggleProps:i,isExpanded:l,setExpanded:c}=hV({defaultExpanded:!0,collapsedHeight:(r==null?void 0:r.ThinoCollapsedHeight)??100}),{memo:f,handleMemoContentClick:h,handleMemoDoubleClick:g}=e,y=ne.useRef(null),[w,S]=ne.useState(""),D=ne.useRef(w),I=ne.useRef(0),[M,N]=ne.useState(!1),[B,k]=ne.useState(!1),R=x.debounce((_,V,U)=>{for(const Z of _){const{height:Q}=Z.contentRect,G=(V==null?void 0:V.ThinoMaxHeight)||340,re=Q>G;N(re),c(!re),U.disconnect()}},500);P.useEffect(()=>{var _;if(f.content!==D.current){if(r!=null&&r.OptimizeForCallout&&f.content.split("> [!").length>3&&f.content.split(` +`).length>10&&!B){const V=y.current.createEl("button");V.setText(E("Render content")),V.onclick=async()=>{k(!0),await L()};const U=y.current.createEl("textarea");U.setText(f.content),U.disabled=!0,(_=y.current)==null||_.toggleClass(["raw-content"],!0),c(!0),N(!1);return}L()}},[f.content]),P.useEffect(()=>{B&&I.current!==(r==null?void 0:r.ThinoMaxHeight)&&(y!=null&&y.current.hasChildNodes()&&k(!1),L())},[r==null?void 0:r.ThinoMaxHeight]),P.useEffect(()=>{if(!B)return;const _=y.current;if(!_)return;if(!(r!=null&&r.ThinoMaxHeight)){c(!0),N(!1);return}const V=new ResizeObserver(U=>{R(U,r,V)});return V.observe(_),()=>V.disconnect()},[B]);const L=async()=>{var _,V,U;if(y.current&&n&&t&&f.content!==D.current){y.current.empty(),await x.MarkdownRenderer.render(t,f.content,y.current,f.path,n);const Z=(_=y.current)==null?void 0:_.querySelectorAll(".internal-link");Z==null||Z.forEach(Q=>{const G=Q,re=G.getAttribute("data-href");if(!re)return;t.metadataCache.getFirstLinkpathDest(re,f.path)||Q.classList.add("is-unresolved"),G.addEventListener("mouseover",fe=>{fe.stopPropagation(),t.workspace.trigger("hover-link",{event:fe,source:"thino",hoverParent:n.containerEl,targetEl:G,linktext:re,sourcePath:G.href})})})}D.current=f.content,(V=y.current)==null||V.toggleClass(["markdown-rendered"],!0),(U=y.current)==null||U.toggleClass(["raw-content"],!1),k&&k(!0),I.current=(r==null?void 0:r.ThinoMaxHeight)||340};return v.jsxs(v.Fragment,{children:[M&&a==="moments"&&v.jsxs(v.Fragment,{children:[v.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:E(l?"Collapse":"Expand")}),!l&&(r==null?void 0:r.ThinoCollapsedHeight)!==0&&v.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:g})]}),v.jsx("div",{...o({style:{margin:0}}),ref:y,className:"memo-content-text",onClick:_=>h(_,f),onDoubleClick:g,onContextMenu:_=>{_.preventDefault()}}),M&&a!=="moments"&&v.jsxs(v.Fragment,{children:[!l&&(r==null?void 0:r.ThinoCollapsedHeight)!==0&&v.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:g}),v.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:E(l?"Collapse":"Expand")})]})]})},l9=P.memo(pV,(e,t)=>e.memo.content===t.memo.content),mV=e=>{const[t,n]=P.useState({...e.memo,createdAtStr:ut.getDateTimeString(e.memo.createdAt)}),[r,a]=P.useState([]),[o,i]=P.useState([]);P.useEffect(()=>{(async()=>{try{const g=[],y=[...t.content.matchAll(ad)];for(const S of y)if(S&&S.length===3){const D=S[2],I=we.getMemoById(D);I&&g.push({...I,createdAtStr:ut.getDateTimeString(I.createdAt),dateStr:ut.getDateString(I.createdAt)})}a([...g]);const w=await we.getLinkedMemos(t.id);i(w.sort((S,D)=>ut.getTimeStampByDate(D.createdAt)-ut.getTimeStampByDate(S.createdAt)).map(S=>({...S,createdAtStr:ut.getDateTimeString(S.createdAt),dateStr:ut.getDateString(S.createdAt)})))}catch(g){console.error(g)}})()},[t.id]);const l=P.useCallback(async h=>{var y;const g=h.target;if(g.className==="memo-link-text"){const w=(y=g.dataset)==null?void 0:y.value,S=we.getMemoById(w??"");if(S){const D={...S,createdAtStr:ut.getDateTimeString(S.createdAt)};a([]),i([]),n(D)}else new x.Notice(E("Thino not found")),g.classList.remove("memo-link-text")}},[]),c=P.useCallback(h=>{a([]),i([]),n({...h,createdAtStr:ut.getDateTimeString(h.createdAt)})},[t.id]),f=P.useCallback(()=>{e.destroy(),dt.setEditMemoId(t.id)},[t.id]);return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"memo-card-container",children:[v.jsxs("div",{className:"header-container",children:[v.jsx("span",{className:"time-text",children:t.createdAtStr}),v.jsxs("div",{className:"btns-container",children:[v.jsx("button",{ref:h=>{h&&x.setIcon(h,"edit")},className:"btn edit-btn",onClick:f}),v.jsx("button",{ref:h=>{h&&x.setIcon(h,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),v.jsx("div",{className:"memo-container",children:v.jsx("div",{className:"memo-content-text",children:v.jsx(l9,{memo:t,handleMemoContentClick:l,handleMemoDoubleClick:()=>{}})})}),v.jsx("div",{className:"layer-container"})]}),r.length>0?v.jsxs("div",{className:"linked-memos-wrapper",children:[v.jsxs("span",{className:"normal-text",children:[E("LINKED")," ",r.length," THINO"," "]}),r.map(h=>{const g=AC(dT(h.content)).replaceAll(` `," ");return v.jsxs("div",{className:"linked-memo-container",onClick:()=>c(h),children:[v.jsxs("span",{className:"time-text",children:[h.dateStr," "]}),g]},h.id)})]}):null,o.length>0?v.jsxs("div",{className:"linked-memos-wrapper",children:[v.jsxs("span",{className:"normal-text",children:[o.length," THINO ",E("LINK TO THE")," THINO"]}),o.map(h=>{const g=AC(dT(h.content)).replaceAll(` -`," ");return v.jsxs("div",{className:"linked-memo-container",onClick:()=>c(h),children:[v.jsxs("span",{className:"time-text",children:[h.dateStr," "]}),g]},h.id)})]}):null]})};function Df(e){Db({className:"memo-card-dialog"},pV,{memo:e})}function mV({mouseEnterDelayMS:e=0,mouseLeaveDelayMS:t=0}={}){const[n,r]=P.useState(!1);let a,o;return[n,{onMouseEnter:()=>{clearTimeout(o),a=window.setTimeout(()=>r(!0),e)},onMouseLeave:()=>{clearTimeout(a),o=window.setTimeout(()=>r(!1),t)}}]}const gV=e=>{const{memo:t,handlePinMemoClick:n,handleFixMemoClick:r,handleSourceMemoClick:a,handleShowMemoStoryDialog:o,handleCopyMemoClick:i,handleEditMemoClick:l,handleGenMemoImageBtnClick:c,handleMarkMemoClick:f,handleArchiveMemo:h,handleDeleteMemoClick:g,handleSplitMemoClick:y}=e,w=Le.getState().dailyNotesState.settings,S=w.EnabledLocationList.find(Y=>Y.value==="MULTI"),[D,I]=Xl(!1),M=P.useRef(null),N={pinRef:P.useRef(null),fixRef:P.useRef(null),typeRef:P.useRef(null),moreRef:P.useRef(null)},[_,k]=mV({mouseEnterDelayMS:500}),B=P.useRef();P.useEffect(()=>{if(!N.typeRef)return;const Y=Qg.find(Z=>Z.title===t.sourceType);x.setIcon(N.typeRef.current,Y.icon),x.requireApiVersion("1.4.4")&&x.setTooltip(N.typeRef.current,t.path),N.fixRef&&(x.setIcon(N.fixRef.current,"shield-alert"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.fixRef.current,"Update Thino property"))},[N.typeRef]),P.useEffect(()=>{N.pinRef&&(t.pinned?(x.setIcon(N.pinRef.current,"pin-off"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,E("UNPIN"))):(x.setIcon(N.pinRef.current,"pin"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,E("PIN"))))},[N.pinRef,t.pinned]);const L=x.debounce(()=>{var Y;if(_&&N.moreRef.current){if(B.current&&B.current._loaded||(Y=B.current)!=null&&Y.useNativeMenu||document.body.find(".more-action-btns-wrapper"))return;const Z=R(),Q=N.moreRef.current.getBoundingClientRect();Z.showAtPosition({x:Q.left,y:Q.bottom})}},200);P.useEffect(()=>{L()},[_]);const R=()=>{var Z;const Y=new x.Menu;return Y.dom.toggleClass(["more-action-btns-wrapper"],!0),Y.useNativeMenu?(Y.setNoIcon(),Y.addItem(Q=>{Q.setTitle(E("COPY")).onClick(i)}),Y.addItem(Q=>{Q.setTitle(E("EDIT")).onClick(l)}),Y.addItem(Q=>{Q.setTitle(E("SHARE")).onClick(c)})):Y.addItem(Q=>{const G=Q.dom;Q.dom.empty(),Q.dom.toggleClass(["more-action-btn-group","more-action-menu-item"],!0);const le=G.createEl("span");new x.ExtraButtonComponent(le).setIcon("copy"),le.toggleClass(["menu-item-icon","more-action-item-icon"],!0),le.onclick=$=>{$.stopPropagation(),$.preventDefault(),i(),Y.close()};const se=G.createEl("span");se.toggleClass(["menu-item-icon","more-action-item-icon"],!0),se.onclick=$=>{$.stopPropagation(),$.preventDefault(),l(),Y.close()},new x.ExtraButtonComponent(se).setIcon("pencil");const fe=G.createEl("span");fe.toggleClass(["menu-item-icon","more-action-item-icon"],!0),fe.onclick=$=>{$.stopPropagation(),$.preventDefault(),c(),Y.close()},new x.ExtraButtonComponent(fe).setIcon("share-2")}),Y.addSeparator(),Y.addItem(Q=>{Q.setIcon("book-open").setTitle(E("READ")).onClick(o)}),Y.addItem(Q=>{Q.setIcon("bookmark").setTitle(E("MARK")).onClick(f)}),((Z=/(^|\n)#{1,6}\s/g.exec(t.content))==null?void 0:Z.length)>1&&S&&Y.addItem(Q=>{Q.setIcon("separator-horizontal").setTitle(E("SPLIT")).onClick(y)}),Y.addItem(Q=>{Q.setIcon("home").setTitle(E("SOURCE")).onClick(()=>a(t))}),Y.addSeparator(),Y.addItem(Q=>{Q.setWarning(!0).setIcon("archive").setTitle(E("ARCHIVE").toUpperCase()).onClick(()=>h(t))}),Y.addItem(Q=>{Q.setWarning(!0).setIcon("trash").setTitle(w.DeleteThinoDirectly?E("DELETE"):E("TRASH BOX").toUpperCase().toUpperCase()).onClick(G=>{if(Y.useNativeMenu)g(G),Y.close();else if(G.stopPropagation(),G.preventDefault(),!D){I(!0),Q.setTitle(E("CONFIRM!")).onClick(le=>{g(le),Y.close()});return}})}),Y.addSeparator(),Y.addItem(Q=>{Q.setDisabled(!0).setTitle(ut.getWordCount(t.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,""))+` ${E("words")}`)}),Y.onHide(()=>{I(!1)}),B.current=Y,Y},V=Y=>{R().showAtMouseEvent(Y.nativeEvent)};return v.jsx("div",{ref:M,className:"memo-top-right-wrapper",children:v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:N.fixRef,className:`btn ${t.sourceType!=="MULTI"||t.id!==""?"hidden":""} fix-memo-btn`,onClick:()=>r(t)}),v.jsx("span",{ref:N.typeRef,className:`btn ${t.sourceType==="DAILY"?"hidden":""} source-type-btn`,onClick:()=>a(t)}),v.jsx("span",{ref:N.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"} pro`,onClick:n}),v.jsx("span",{...k,ref:Y=>{N.moreRef.current=Y,Y&&x.setIcon(Y,"more-horizontal")},onClick:V,className:"btn more-action-btn"})]})})},vV=e=>{var i,l,c;const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:a}=e,o=((l=(i=t.fileInfo)==null?void 0:i.frontmatter)==null?void 0:l.title)||t.path.split("/").pop().split(".").shift();return v.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,v.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),v.jsx("div",{className:`btn memo-type-img ${a!=null&&a.ShowTaskLabel?"":"hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&v.jsx("input",{className:"task-list-item-checkbox",type:"checkbox",checked:t.thinoType!=="TASK-TODO","data-task":t.thinoType==="TASK-TODO"?"":t.thinoType==="TASK-DONE"?"x":(c=t.thinoType)==null?void 0:c.slice(5)})}),(a==null?void 0:a.ShowSourcePath)&&(t.sourceType==="FILE"||t.sourceType==="MULTI")&&v.jsx("span",{className:"time-text source-path","aria-label":o,onClick:()=>{at.setPathQuery(o)},children:o})]})};class yV extends x.SuggestModal{constructor(t,n){super(t),this.thino=n}sanitisedFileName(t){const n=pR;return t.replace(n,"").trim().slice(0,255)}ensureUniqueFileNames(t){const n=[];return t.map(a=>{const o=this.sanitisedFileName(a[0]),i=n.filter(l=>l==o);return n.push(o),i.length>=1?`${o}${i.length+1}`:o})}contentSplitByHeading(t,n){const r=t.split(` +`," ");return v.jsxs("div",{className:"linked-memo-container",onClick:()=>c(h),children:[v.jsxs("span",{className:"time-text",children:[h.dateStr," "]}),g]},h.id)})]}):null]})};function Df(e){Db({className:"memo-card-dialog"},mV,{memo:e})}function gV({mouseEnterDelayMS:e=0,mouseLeaveDelayMS:t=0}={}){const[n,r]=P.useState(!1);let a,o;return[n,{onMouseEnter:()=>{clearTimeout(o),a=window.setTimeout(()=>r(!0),e)},onMouseLeave:()=>{clearTimeout(a),o=window.setTimeout(()=>r(!1),t)}}]}const vV=e=>{const{memo:t,handlePinMemoClick:n,handleFixMemoClick:r,handleSourceMemoClick:a,handleShowMemoStoryDialog:o,handleCopyMemoClick:i,handleEditMemoClick:l,handleGenMemoImageBtnClick:c,handleMarkMemoClick:f,handleArchiveMemo:h,handleDeleteMemoClick:g,handleSplitMemoClick:y}=e,w=Le.getState().dailyNotesState.settings,S=w.EnabledLocationList.find(U=>U.value==="MULTI"),[D,I]=Xl(!1),M=P.useRef(null),N={pinRef:P.useRef(null),fixRef:P.useRef(null),typeRef:P.useRef(null),moreRef:P.useRef(null)},[B,k]=gV({mouseEnterDelayMS:500}),R=P.useRef();P.useEffect(()=>{if(!N.typeRef)return;const U=Qg.find(Z=>Z.title===t.sourceType);x.setIcon(N.typeRef.current,U.icon),x.requireApiVersion("1.4.4")&&x.setTooltip(N.typeRef.current,t.path),N.fixRef&&(x.setIcon(N.fixRef.current,"shield-alert"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.fixRef.current,"Update Thino property"))},[N.typeRef]),P.useEffect(()=>{N.pinRef&&(t.pinned?(x.setIcon(N.pinRef.current,"pin-off"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,E("UNPIN"))):(x.setIcon(N.pinRef.current,"pin"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,E("PIN"))))},[N.pinRef,t.pinned]);const L=x.debounce(()=>{var U;if(B&&N.moreRef.current){if(R.current&&R.current._loaded||(U=R.current)!=null&&U.useNativeMenu||document.body.find(".more-action-btns-wrapper"))return;const Z=_(),Q=N.moreRef.current.getBoundingClientRect();Z.showAtPosition({x:Q.left,y:Q.bottom})}},200);P.useEffect(()=>{L()},[B]);const _=()=>{var Z;const U=new x.Menu;return U.dom.toggleClass(["more-action-btns-wrapper"],!0),U.useNativeMenu?(U.setNoIcon(),U.addItem(Q=>{Q.setTitle(E("COPY")).onClick(i)}),U.addItem(Q=>{Q.setTitle(E("EDIT")).onClick(l)}),U.addItem(Q=>{Q.setTitle(E("SHARE")).onClick(c)})):U.addItem(Q=>{const G=Q.dom;Q.dom.empty(),Q.dom.toggleClass(["more-action-btn-group","more-action-menu-item"],!0);const re=G.createEl("span");new x.ExtraButtonComponent(re).setIcon("copy"),re.toggleClass(["menu-item-icon","more-action-item-icon"],!0),re.onclick=$=>{$.stopPropagation(),$.preventDefault(),i(),U.close()};const de=G.createEl("span");de.toggleClass(["menu-item-icon","more-action-item-icon"],!0),de.onclick=$=>{$.stopPropagation(),$.preventDefault(),l(),U.close()},new x.ExtraButtonComponent(de).setIcon("pencil");const fe=G.createEl("span");fe.toggleClass(["menu-item-icon","more-action-item-icon"],!0),fe.onclick=$=>{$.stopPropagation(),$.preventDefault(),c(),U.close()},new x.ExtraButtonComponent(fe).setIcon("share-2")}),U.addSeparator(),U.addItem(Q=>{Q.setIcon("book-open").setTitle(E("READ")).onClick(o)}),U.addItem(Q=>{Q.setIcon("bookmark").setTitle(E("MARK")).onClick(f)}),((Z=/(^|\n)#{1,6}\s/g.exec(t.content))==null?void 0:Z.length)>1&&S&&U.addItem(Q=>{Q.setIcon("separator-horizontal").setTitle(E("SPLIT")).onClick(y)}),U.addItem(Q=>{Q.setIcon("home").setTitle(E("SOURCE")).onClick(()=>a(t))}),U.addSeparator(),U.addItem(Q=>{Q.setWarning(!0).setIcon("archive").setTitle(E("ARCHIVE").toUpperCase()).onClick(()=>h(t))}),U.addItem(Q=>{Q.setWarning(!0).setIcon("trash").setTitle(w.DeleteThinoDirectly?E("DELETE"):E("TRASH BOX").toUpperCase().toUpperCase()).onClick(G=>{if(U.useNativeMenu)g(G),U.close();else if(G.stopPropagation(),G.preventDefault(),!D){I(!0),Q.setTitle(E("CONFIRM!")).onClick(re=>{g(re),U.close()});return}})}),U.addSeparator(),U.addItem(Q=>{Q.setDisabled(!0).setTitle(ut.getWordCount(t.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,""))+` ${E("words")}`)}),U.onHide(()=>{I(!1)}),R.current=U,U},V=U=>{_().showAtMouseEvent(U.nativeEvent)};return v.jsx("div",{ref:M,className:"memo-top-right-wrapper",children:v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:N.fixRef,className:`btn ${t.sourceType!=="MULTI"||t.id!==""?"thino-hidden":""} fix-memo-btn`,onClick:()=>r(t)}),v.jsx("span",{ref:N.typeRef,className:`btn ${t.sourceType==="DAILY"?"thino-hidden":""} source-type-btn`,onClick:()=>a(t)}),v.jsx("span",{ref:N.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"} pro`,onClick:n}),v.jsx("span",{...k,ref:U=>{N.moreRef.current=U,U&&x.setIcon(U,"more-horizontal")},onClick:V,className:"btn more-action-btn"})]})})},yV=e=>{var i,l,c;const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:a}=e,o=((l=(i=t.fileInfo)==null?void 0:i.frontmatter)==null?void 0:l.title)||t.path.split("/").pop().split(".").shift();return v.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,v.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),v.jsx("div",{className:`btn memo-type-img ${a!=null&&a.ShowTaskLabel?"":"thino-hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&v.jsx("input",{className:"task-list-item-checkbox",type:"checkbox",checked:t.thinoType!=="TASK-TODO","data-task":t.thinoType==="TASK-TODO"?"":t.thinoType==="TASK-DONE"?"x":(c=t.thinoType)==null?void 0:c.slice(5)})}),(a==null?void 0:a.ShowSourcePath)&&(t.sourceType==="FILE"||t.sourceType==="MULTI")&&v.jsx("span",{className:"time-text source-path","aria-label":o,onClick:()=>{at.setPathQuery(o)},children:o})]})};class wV extends x.SuggestModal{constructor(t,n){super(t),this.thino=n}sanitisedFileName(t){const n=mR;return t.replace(n,"").trim().slice(0,255)}ensureUniqueFileNames(t){const n=[];return t.map(a=>{const o=this.sanitisedFileName(a[0]),i=n.filter(l=>l==o);return n.push(o),i.length>=1?`${o}${i.length+1}`:o})}contentSplitByHeading(t,n){const r=t.split(` `),a=new Array(n).join("#")+" ",o=new Array(n+1).join("#")+" ",i=[];let l=[];return r.forEach((c,f)=>{c.startsWith(o)?(l.length>0&&(i.push(l),l=[]),l.push(c)):l.length>0&&!c.startsWith(a)?l.push(c):l.length>0&&(i.push(l),l=[]),f===r.length-1&&l.length>0&&i.push(l)}),i}onChooseSuggestion(t,n){this.selectSuggestion(t,n)}renderSuggestion(t,n){n.setText(t.title)}getSuggestions(){return[{id:"splitByHeading1",title:E("Split by Heading 1")},{id:"splitByHeading2",title:E("Split by Heading 2")},{id:"splitByHeading3",title:E("Split by Heading 3")}]}async selectSuggestion(t,n){let r=[];if(t.id==="splitByHeading1"?r=this.contentSplitByHeading(this.thino.content,1):t.id==="splitByHeading2"?r=this.contentSplitByHeading(this.thino.content,2):t.id==="splitByHeading3"&&(r=this.contentSplitByHeading(this.thino.content,3)),r.length===0){new x.Notice("No headings found"),this.close();return}const a=this.ensureUniqueFileNames(r);for(const l of r){const c=r.indexOf(l),f=await we.createThino({content:l.join(` `),name:a[c],type:"MULTI",isList:!0});we.pushMemo(f)}let o=this.thino.content;r.forEach((l,c)=>{o=o.replace(l.join(` -`),`[[${a[c]}]]`)});const i=await we.updateMemo(this.thino.id,o);i&&we.editMemo(i),this.close()}}const wV=async(e,t,n)=>{const r=n.getAttribute("href"),a=n.className;if(a.contains("tag"))bV(n.innerText.slice(1));else if(a.contains("internal-link")){const o=n.getAttribute("data-href"),i=we.getMemoById(o??"");i?Df(i):await e.workspace.openLinkText(o,o,!x.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},bV=e=>{const t=at.getState().query.tag;at.setTagQuery(t.contains(",")?t.split(",").includes(e)?t.split(",").filter(n=>n!==e).join(","):t+","+e:t===e?"":e)},SV=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),a=[...(e==null?void 0:e.querySelectorAll("img"))||[]],o=a.indexOf(t);Nb({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:a,currentIndex:o})},DV=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=we.getMemoById(t??"");n?Df(n):(new x.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},TV=async(e,t,n,r)=>{var l;const a=e!=null&&e.AppendDateWhenTaskDone?" ✅ "+x.moment().format("YYYY-MM-DD"):"",o=((l=r.parentElement.dataset)==null?void 0:l.task)==="x"?"DONE":"TODO",i=[...(n==null?void 0:n.querySelectorAll("li.task-list-item"))||[]];for(const c of i)if(c===r||c===r.closest("li.task-list-item")){const f=i.indexOf(c),h=t.content.split(/\n/),g=[];for(let M=0;M{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:a,verifyState:o},locationState:{pathname:i}}=P.useContext(Lt),{memo:l,type:c="inline"}=e,f=P.useRef(null),h=P.useRef(null),[g,y]=P.useState(!1);P.useEffect(()=>{g&&setTimeout(()=>{dt.setEditMemoId(l.id)},100)},[g]),P.useEffect(()=>{(i==="/review"||i==="/daily")&&t!==l.id&&g&&y(!1)},[t]);const w=$=>{if($.ctrlKey||$.metaKey){const he=x.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss");at.setFromAndToQuery(he.startOf("day").valueOf(),he.endOf("day").valueOf());return}Df(l)},S=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"){const $=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");$&&$.trigger("click")}dt.setMarkMemoId(l.id)},D=async()=>{var ie;const $=!x.Platform.isDesktop&&await((ie=window.Capacitor)==null?void 0:ie.Plugins.Device.getId()),he=x.Platform.isDesktop?await cr():$.identifier||$.uuid;if(!o||(o==null?void 0:o.appId)!==he){fn();return}l.pinned?await we.unpinMemoById(l.id):await we.pinMemoById(l.id)},I=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"&&x.Platform.isMobile){const $=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");$&&$.trigger("click")}(i==="/review"||i==="/daily")&&y(!0),i!=="/review"&&i!=="/daily"&&dt.setEditMemoId(l.id)},M=async $=>{$.sourceType==="MULTI"&&$.id.trim()===""&&await we.updateMemoProperty($)},N=async $=>{await we.openThinoByID($.id)},_=async $=>{try{const he=await we.archiveMemo($);he&&we.editMemo(he)}catch(he){console.error(he),new x.Notice(he.message)}},k=async()=>{try{if(a.DeleteThinoDirectly)await we.deleteMemoById(l.id);else{const $=await we.hideMemoById(l.id);$&&we.editMemo($)}}catch($){new x.Notice($.message)}dt.getState().editMemoId===l.id&&dt.setEditMemoId("")},B=()=>{if(h.current&&!h.current.confirmStatus){h.current&&h.current.toggleConfirm(!1);return}},L=()=>{uf(l)},R=async()=>{const $=await we.updateMemo(l.id,l.content,l.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");$&&we.editMemo($)},V=async()=>{navigator.clipboard.writeText(l.content).then(()=>{new x.Notice(E("COPY SUCCEED"))}).catch(()=>{new x.Notice(E("COPY FAILED"))})},Y=async()=>{new yV(n,l).open()},Z=$=>{$&&$.target.tagName!=="INPUT"&&I()},Q=async($,he)=>{$.preventDefault(),$.stopPropagation();const ie=$.target;if($.ctrlKey||$.metaKey){await N(he);return}if(ie.tagName==="A"){await wV(n,r,ie);return}if(ie.tagName==="IMG"){SV(f.current,ie);return}if(ie.tagName==="A"&&ie.getAttribute("href")){const ce=ie.getAttribute("href");window.open(ce,"_blank");return}if(ie.className==="memo-link-text"){DV(ie);return}if(ie.tagName==="INPUT"&&ie.hasClass("task-list-item-checkbox")){await TV(a,he,f.current,ie);return}},G=$=>{const he=new x.Menu;he.dom.toggleClass("memo-context-menu",!0);const ie=window.getSelection();(ie==null?void 0:ie.toString().length)>0&&he.addItem(ce=>{ce.setIcon("copy").setTitle(E("Copy selected text")).onClick(()=>{navigator.clipboard.writeText(ie.toString()).then(()=>{new x.Notice(E("COPY SUCCEED"))}).catch(()=>{new x.Notice(E("COPY FAILED"))})})}).addSeparator(),he.addItem(ce=>{ce.setIcon("copy").setTitle(E("Copy thino").toLocaleUpperCase()).onClick(async()=>{await V(),he.close()})}).addItem(ce=>{ce.setIcon("book-open").setTitle(E("READ")).onClick(w)}).addItem(ce=>{ce.setIcon(l.pinned?"pin-off":"pin").setTitle(l.pinned?E("UNPIN"):E("PIN")).onClick(D)}).addItem(ce=>{ce.setIcon("bookmark").setTitle(E("MARK")).onClick(S)}).addItem(ce=>{ce.setIcon("share-2").setTitle(E("SHARE")).onClick(L)}).addItem(ce=>{ce.setIcon("pencil").setTitle(E("EDIT")).onClick(I)}).addItem(ce=>{ce.setIcon("home").setTitle(E("SOURCE")).onClick(()=>N(l))}).addSeparator().addItem(ce=>{ce.setIcon("archive").setTitle(E("ARCHIVE").toLocaleUpperCase()).onClick(()=>_(l))}).addItem(ce=>{ce.setIcon("trash").setTitle(E("DELETE")).onClick(async()=>{await k()})}),he.showAtMouseEvent($.nativeEvent)},le=P.useMemo(()=>({memo:l,handlePinMemoClick:D,handleFixMemoClick:M,handleSourceMemoClick:N,handleArchiveMemo:_,handleDeleteMemoClick:k,handleGenMemoImageBtnClick:L,handleMarkMemoClick:S,handleEditMemoClick:I,handleCopyMemoClick:V,handleShowMemoStoryDialog:w,handleSplitMemoClick:Y}),[l]),se=P.useMemo(()=>({memo:l,handleMemoTypeToggle:R,handleShowMemoStoryDialog:w,settings:a}),[l,a]),fe=P.useMemo(()=>v.jsxs("div",{ref:f,className:`memo-wrapper ${l.pinned?"pinned":""}`,"data-source-type":l.sourceType,"data-thino-type":l.thinoType,"data-thino-id":l.id,onMouseLeave:B,onMouseOver:$=>{$.shiftKey&&($.stopPropagation(),n.workspace.trigger("hover-link",{event:$,source:"thino",hoverParent:r.containerEl,targetEl:f.current,linktext:l.path,sourcePath:l.path,state:{scroll:l.sourceType==="DAILY"?parseInt(l.id.slice(14)):0}}))},onContextMenu:G,children:[g&&v.jsx(mf,{editorType:"inline"}),!g&&v.jsxs(v.Fragment,{children:[c==="inline"&&v.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:$=>{$.target.classList.add("dragging"),$.dataTransfer.setDragImage(f.current,0,0),$.dataTransfer.setData("text/plain",l.content)},onDragEnd:$=>{$.target.classList.remove("dragging")},children:[v.jsx(vV,{...se}),v.jsx(gV,{...le})]}),v.jsx(s9,{memo:l,handleMemoContentClick:Q,handleMemoDoubleClick:Z})]})]}),[l,g]);return v.jsx(v.Fragment,{children:fe})},ai=P.memo(IV,(e,t)=>Cw.isEqual(e.memo,t.memo));class Je extends x.Setting{constructor(n,r){super(n);Se(this,"settingTab");Se(this,"name","");Se(this,"desc","");this.settingTab=r}setName(n){return super.setName(n),this.name=n,this}setDesc(n){return super.setDesc(n),this.desc=n,this}setTab(n){const r=typeof this.name=="string"?this.name:this.name.textContent||"",a=typeof this.desc=="string"?this.desc:this.desc.textContent||"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,a),this}}class EV extends x.Modal{constructor(n,r,a,o,i){super(n);Se(this,"plugin");Se(this,"settingTab");Se(this,"target",5);Se(this,"cb");this.app=n,this.settingTab=r,this.plugin=a,this.target=o,this.cb=i}onOpen(){var l;const{contentEl:n}=this;(l=n.parentElement)==null||l.classList.add("memo-save-location-modal"),n.createEl("h3",{text:E("Thino Daily Target")});const r=n.createDiv("modal-setting");new Je(r,this.settingTab).setName(E("Target Thino Count")).addSlider(c=>{c.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async f=>{this.target=f})});const a=n.createDiv("button-group"),o=a.createEl("button",{text:E("Cancel")}),i=a.createEl("button",{text:E("Save")});i.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},o.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const CV=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:a,settings:o},globalState:{manifest:i}}=P.useContext(Lt),[l,c]=P.useState(),[f,h]=P.useState(5),[g,y]=P.useState(0),[w,S]=P.useState(0),[D,I]=P.useState(o.HeatmapColorScheme||"default"),M=P.useRef(null),N=P.useRef(null);P.useEffect(()=>{o.HeatmapColorScheme&&I(o.HeatmapColorScheme)},[o.HeatmapColorScheme]),P.useEffect(()=>{let k,B=5;i&&a&&(k=a==null?void 0:a.plugins.getPlugin(i.id),B=k==null?void 0:k.settings.MemoDailyTarget,c(k)),h(B)},[i,a]),P.useEffect(()=>{const k=e.find(R=>R.timestamp===t),B=k?k.count:0;S(B);const L=Math.min(100,B/f*100);y(L)},[e,f]),P.useEffect(()=>{x.requireApiVersion("1.4.4")&&(x.setTooltip(N.current,g.toFixed(2)+"%"),x.setTooltip(M.current,E("Set daily target")+` (${w}/${f})`))},[g,w]),P.useEffect(()=>{M.current&&(M.current.hasChildNodes()||x.setIcon(M.current,"crosshair"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.current,g+"%"))},[M,f]);const _=P.useCallback(()=>{if(!l)return;new EV(a,l==null?void 0:l.settingTab,l,f,B=>{h(B)}).open()},[l,f]);return v.jsx(v.Fragment,{children:v.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${D}`,children:[v.jsx("div",{ref:N,className:"daily-progress-bar",children:v.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${g}%`}})}),v.jsx("div",{ref:M,className:"daily-progress-target",onClick:_}),v.jsx("div",{ref:k=>{k&&x.setIcon(k,n==="basic"?"layout-grid":"calendar"),k&&x.setTooltip&&x.setTooltip(k,E("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},xV=(e,t)=>{const n=[],r=Math.floor((e-t)/ei);for(let a=0;a<=r;a++)n.push({timestamp:t+ei*a,count:0,list:0});return n},MV=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:a,handleDateItemClick:o,handleMonthChange:i,dailyStat:l}=e,c=x.moment().startOf("day").valueOf(),[f,h]=P.useState(rp(r)),[g,y]=P.useState(null),[w,S]=P.useState(e.dailyStat);P.useEffect(()=>{h(rp(r));const k=xV(NV(r),rp(r)),B=e.thinos.filter(L=>!L.deletedAt&&L.rowStatus!=="ARCHIVED");for(const L of B){const V=x.moment(L.createdAt,"YYYY/MM/DD HH:mm:ss").startOf("day").diff(x.moment(f).startOf("day"),"days");V>=0&&V{const B=D.getFullYear(),L=D.getMonth()+1;let R=0;L===1&&k===-1?R=new Date(`${B-1}/12/1`).getTime():L===12&&k===1?R=new Date(`${B+1}/1/1`).getTime():R=new Date(`${B}/${L+k}/1`).getTime(),h(rp(R)),i&&i(R)};return v.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[v.jsxs("div",{className:"date-picker-header",children:[v.jsx("span",{ref:k=>{k&&x.setIcon(k,"chevron-left")},className:"btn btn-text",onClick:()=>_(-1)}),v.jsxs("span",{className:"normal-text",children:[v.jsx(F6,{year:D.getFullYear().toString(),handleYearChange:k=>{h(rp(new Date(`${k}/${D.getMonth()+1}/1`).getTime()))}}),v.jsx(O6,{month:D.getMonth().toString(),handleMonthChange:k=>{h(rp(new Date(`${D.getFullYear()}/${parseInt(k)}/1`).getTime()))}})]}),v.jsx("span",{ref:k=>{k&&x.setIcon(k,"chevron-right")},className:"btn btn-text",onClick:()=>_(1)})]}),v.jsxs("div",{className:"date-picker-day-container",children:[v.jsx("div",{className:"date-picker-day-header",children:E("weekDaysShort").map(k=>v.jsx("span",{className:"day-item",children:k},k))}),v.jsx("div",{className:"date-picker-day-content",children:M.map(k=>{if(k.date===0)return v.jsx("span",{className:"day-item null",children:""},k.datestamp);const B=w.find(V=>V.timestamp===k.datestamp)||{count:0,timestamp:k.datestamp,list:0},L=B.count-B.list,R=B.list;return v.jsxs("span",{className:`day-item ${k.datestamp===c?"current":""} ${k.datestamp===g?"selected":""} ${RS(B.count)}`,onClick:V=>{a(r,V.nativeEvent),y(k.datestamp===g?null:k.datestamp),o&&o(V,B)},onMouseOver:V=>{if(!B||!B.count)return;const Y=new x.HoverPopover(n,V.currentTarget,100);l9(Y,{d:k,list:R,task:L})},children:[v.jsx("span",{className:"day-item-text",children:k.date}),v.jsx(v.Fragment,{children:B&&B.count!==0&&v.jsxs("span",{className:"day-item-dots",children:[L>0&&v.jsx("div",{className:`day-item-dot thino-task-dot ${RS(L)}`}),R>0&&v.jsx("div",{className:`day-item-dot thino-list-dot ${RS(R)}`})]})})]},k.datestamp)})})]})]})};function l9(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const a=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});a.createDiv({cls:"thino-date-item",text:`${x.moment(t.datestamp).format("YYYY-MM-DD")}`});const o=a.createDiv({cls:"thino-task-item"});o.createSpan({cls:"thino-task-item-title-text",text:`${E("Task")}: `}),o.createSpan({cls:"thino-task-item-title-count",text:`${r}`});const i=a.createDiv({cls:"thino-list-item"});i.createSpan({cls:"thino-list-item-title-text",text:`${E("List")}: `}),i.createSpan({cls:"thino-list-item-title-count",text:`${n}`})}function kV(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/ei}function rp(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function NV(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return(n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-ei}function RS(e){return e<=0?"":e<=1?"stat-day-L1-bg":e<=2?"stat-day-L2-bg":e<=4?"stat-day-L3-bg":"stat-day-L4-bg"}const Zx={width:12,height:7},qx=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:t+ei*r,count:0,list:0});return n},av=({initThinos:e,basicType:t})=>{const n=parseInt(x.moment().endOf("day").format("x"));new Date(n).getDay();const r=parseInt(x.moment().startOf("day").format("x")),a=new Array(6-new Date(n).getDay()).fill(0),o=Zx.width*Zx.height,i=parseInt(x.moment().startOf("day").subtract(o,"days").format("x")),l=x.moment().startOf("day").subtract(o,"days"),{memoState:{memos:c},dailyNotesState:{view:f,app:h,settings:g,verifyState:y}}=P.useContext(Lt),[w,S]=xo(t||FV(h||window.app)||"heatmap"),[D,I]=xo(x.moment().startOf("day").valueOf()),[M,N]=xo(g.HeatmapColorScheme||"default"),[_,k]=xo(qx(o,i)),[B,L]=xo(null),[R,V,Y]=xo(""),Z=P.useRef(null);P.useEffect(()=>{const fe=qx(o,i),$=(e||c).filter(he=>!he.deletedAt&&he.rowStatus!=="ARCHIVED");for(const he of $){const ce=x.moment(he.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day").diff(l,"days");ce>=0&&ce{g.HeatmapColorScheme&&N(g.HeatmapColorScheme)},[g.HeatmapColorScheme]);const Q=P.useCallback((fe,$)=>{if(!$||!$.count)return;const he=$.count-$.list,ie=$.list,ce={date:$.timestamp,datestamp:$.timestamp},X=new x.HoverPopover(f,fe.currentTarget,100);l9(X,{d:ce,list:ie,task:he})},[]),G=()=>{S(w==="heatmap"?"basic":"heatmap"),AV(h,w==="heatmap"?"basic":"heatmap"),I(x.moment().startOf("day").valueOf())},le=P.useCallback(async(fe,$)=>{if($.count===0)return;const he=at.getState().query.duration,ie=he==null?void 0:he.from,ce=he==null?void 0:he.to,X=x.moment(ie).diff(ce,"day")==0;if(ie===$.timestamp&&X)at.setFromAndToQuery(0,0),L(null),V(null);else if(ie!==$.timestamp&&ie>0&&fe.shiftKey){const ae=x.moment($.timestamp).endOf("day").diff(ce,"day");ie===0&&fe.shiftKey?V("from"):ae<0&&X&&V("to"),x.moment(ie).isBefore($.timestamp)?Y.current==="to"?ae<0?at.setFromAndToQuery($.timestamp,ce):(at.setFromAndToQuery(parseInt(x.moment(ce).startOf("day").format("x")),parseInt(x.moment($.timestamp).endOf("day").format("x"))),V("from")):Y.current==="from"&&(ae<0,at.setFromAndToQuery(ie,parseInt(x.moment($.timestamp).endOf("day").format("x")))):Y.current==="to"?at.setFromAndToQuery($.timestamp,ce):Y.current==="from"&&(at.setFromAndToQuery($.timestamp,parseInt(x.moment(ie).endOf("day").format("x"))),V("to"))}else if(ie===0&&fe.shiftKey)at.setFromAndToQuery($.timestamp,parseInt(x.moment().endOf("day").format("x")));else if($.count>0&&(fe.ctrlKey||fe.metaKey)){const{app:ae,dailyNotes:De}=ft.getState(),je=pb(x.moment($.timestamp),De);if(!x.Platform.isMobile)await ae.workspace.getLeaf(!0).openFile(je);else{let Re=ae.workspace.activeLeaf;Re===null&&(Re=ae.workspace.getLeaf(!0)),Re.openFile(je)}}else $.count>0&&!fe.shiftKey&&!fe.ctrlKey&&!fe.metaKey&&(["/","/recycle"].includes(at.getState().pathname)||at.setPathname("/"),at.setFromAndToQuery($.timestamp,ut.getTimeStampByDate(x.moment($.timestamp+ei).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),L($))},[]),se=P.useMemo(()=>v.jsx(MV,{className:`heatmap-${M}`,view:f,datestamp:D,dailyStat:_,thinos:e||c,handleMonthChange:fe=>{I(fe)},handleDateStampChange:fe=>{},handleDateItemClick:(fe,$)=>le(fe,$)}),[JSON.stringify(_),e,c,f,D,M]);return v.jsxs(v.Fragment,{children:[w==="basic"&&se,w==="heatmap"&&v.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${M}`,ref:Z,children:[v.jsxs("div",{className:"day-tip-text-container",children:[v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[0]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[2]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[4]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[6]})]}),v.jsxs("div",{className:"usage-heat-map",children:[_.slice(_.length-84+a.length,_.length).map((fe,$)=>{const he=fe.count,ie=he<=0?"":he<=1?"stat-day-L1-bg":he<=2?"stat-day-L2-bg":he<=4?"stat-day-L3-bg":"stat-day-L4-bg";return v.jsx("span",{"data-timestamp":fe.timestamp,"data-count":fe.count,"data-list-count":fe.list,"data-task-count":fe.count-fe.list,className:`stat-container ${ie} ${B===fe?"current":""} ${r===fe.timestamp?"today":""}`,onMouseOver:ce=>Q(ce,fe),onClick:ce=>le(ce,fe)},$)}),a.map((fe,$)=>v.jsx("span",{className:"stat-container null"},$))]})]}),!t&&v.jsx(CV,{allStat:_,todayTimeStamp:r,calendarType:w,handleCalendarTypeChange:G})]})};function AV(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function FV(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const u9=({type:e,timestamp:t})=>{const{memoState:{memos:n}}=P.useContext(Lt),[r,a]=P.useState([]),o=ne.useRef(null);return P.useEffect(()=>{if(e==="daily"){if(t){const l=n.filter(c=>x.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(t,"YYYY/MM/DD HH:mm:ss"),"day"));a(l);return}const i=n.filter(l=>x.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(),"day"));a(i)}else if(e==="latest"){const i=n.filter(f=>!f.deletedAt&&f.rowStatus!=="ARCHIVED"),l=i.filter(f=>f.pinned),c=i.filter(f=>!f.pinned).slice(0,5);a([...l,...c])}},[n]),P.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[n]),r.length>0?v.jsx("div",{ref:o,className:"thino-list-container",children:r.map(i=>v.jsx(ai,{memo:i}))}):v.jsx("div",{className:"tip-text-container",children:v.jsx("span",{className:"tip-text",children:E("Here is No Memos.")})})},OV=(e,t)=>{rs.createRoot(e).render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(PV,{plugin:t})})}))},PV=({plugin:e})=>v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"thino-error-code-block",children:E("Please open thino first")}),v.jsx("button",{className:"thino-open-view",onClick:()=>e.openMemos("center"),children:E("Open thino in center window")})]}),jV=(e,t)=>{rs.createRoot(e).render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(LV,{yaml:t})})}))},LV=({yaml:e})=>{const t=Object.keys(e).filter(a=>e[a]),n=e.daily?e.daily:"",r=a=>{switch(a){case"editor":return Gx;case"heatmap":return _V;case"calendar":return BV;case"daily":return YV;case"list":return UV;case"status":return HV;default:return Gx}};return v.jsx(v.Fragment,{children:t.map(a=>v.jsx("div",{"data-embed-type":a,className:ar("thino-embed-container",a==="editor"?"thino-editor-modal":""),children:a==="daily"?r(a)(n):r(a)()}))})};function Gx(){return v.jsx(mf,{editorType:"inline",modal:!0})}function RV(e,t,n){try{const r=rs.createRoot(e);return r.render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(mf,{editorType:"inline",destroy:t,modal:n})})})),r}catch(r){console.error(r)}}function _V(){return v.jsx(av,{basicType:"heatmap"})}function BV(){return v.jsx(av,{basicType:"basic"})}function HV(){return v.jsx(K2,{statusType:"banner"})}function YV(e){return v.jsx(u9,{type:"daily",timestamp:e})}function UV(){return v.jsx(u9,{type:"latest"})}class MT extends x.Modal{constructor(n){super(n);Se(this,"root")}getViewType(){return"thino_view"}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=RV(n,this.close.bind(this),this),r.toggleClass("thino-editor-modal",!0),setTimeout(()=>{var a;(a=n.querySelector("textarea"))==null||a.focus(),this.app.workspace.trigger("focus-on-textarea")},10)}catch(a){console.error(a)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}function zV(e,t){if(e==null)return{};var n=VV(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VV(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function Rw(){return Rw=Object.assign||function(e){for(var t=1;t{this.reCalculateColumnCount()})}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let n=this.props.breakpointCols;typeof n!="object"&&(n={default:parseInt(n)||_S});let r=1/0,a=n.default||_S;for(let o in n){const i=parseInt(o);i>0&&t<=i&&i"u"&&(i="my-masonry-grid_column"));const l=Tg(Tg(Tg({},t),n),{},{style:Tg(Tg({},n.style),{},{width:o}),className:i});return a.map((c,f)=>ne.createElement("div",Rw({},l,{key:f}),c))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:a,columnAttrs:o,column:i,className:l}=t,c=zV(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let f=l;return typeof l!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof l>"u"&&(f="my-masonry-grid")),ne.createElement("div",Rw({},c,{className:f}),this.renderColumns())}}_w.defaultProps=$V;const kT=e=>{P.useContext(Lt);const t=Le.getState().dailyNotesState.settings,{thinos:n,dayMark:r,dayMarkRange:a="day",thinoWrapper:o}=e,[i,l]=ne.useState(!(t!=null&&t.hidePinnedGroup&&r==="PINNED")),c=ne.useRef(null);P.useEffect(()=>{c&&x.setTooltip&&x.setTooltip(c.current,E("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[c]);const f=h=>{if(x.Keymap.isModifier(h.nativeEvent,"Mod")){const g={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"},y=x.moment(r,g[a]);at.setFromAndToQuery(y.startOf(a).valueOf(),y.endOf(a).valueOf());return}l(!i)};return v.jsx(v.Fragment,{children:e.type==="list"?v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:c,className:`day-mark ${i?"":"folded"} PINNED`,onClick:f,children:v.jsxs("span",{className:"day-mark-text",children:[i?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),i&&n.map((h,g)=>o?v.jsx("div",{children:o({thino:h})},`${h.id}-${x.moment(h.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`):v.jsx(ai,{memo:h},`${h.id}-${x.moment(h.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`))]}):v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:c,className:`day-mark ${i?"":"folded"}`,onClick:f,children:v.jsxs("span",{className:"day-mark-text",children:[i?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),v.jsx(_w,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:i&&n.map((h,g)=>o?v.jsx("div",{children:o({thino:h})},`${h.id}-${x.moment(h.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`):v.jsx(ai,{memo:h},`${h.id}-${x.moment(h.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`))})]})})};function Wu(e){"@babel/helpers - typeof";return Wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(e)}function ZV(e,t){if(Wu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c9(e){var t=ZV(e,"string");return Wu(t)=="symbol"?t:String(t)}function lf(e,t,n){return t=c9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function tu(e,t){if(e==null)return{};var n=Ab(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ma(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qx(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n{const r=n.getAttribute("href"),a=n.className;if(a.contains("tag"))SV(n.innerText.slice(1));else if(a.contains("internal-link")){const o=n.getAttribute("data-href"),i=we.getMemoById(o??"");i?Df(i):await e.workspace.openLinkText(o,o,!x.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},SV=e=>{const t=at.getState().query.tag;at.setTagQuery(t.contains(",")?t.split(",").includes(e)?t.split(",").filter(n=>n!==e).join(","):t+","+e:t===e?"":e)},DV=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),a=[...(e==null?void 0:e.querySelectorAll("img"))||[]],o=a.indexOf(t);Nb({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:a,currentIndex:o})},TV=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=we.getMemoById(t??"");n?Df(n):(new x.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},IV=async(e,t,n,r)=>{var l;const a=e!=null&&e.AppendDateWhenTaskDone?" ✅ "+x.moment().format("YYYY-MM-DD"):"",o=((l=r.parentElement.dataset)==null?void 0:l.task)==="x"?"DONE":"TODO",i=[...(n==null?void 0:n.querySelectorAll("li.task-list-item"))||[]];for(const c of i)if(c===r||c===r.closest("li.task-list-item")){const f=i.indexOf(c),h=t.content.split(/\n/),g=[];for(let M=0;M{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:a,verifyState:o},locationState:{pathname:i}}=P.useContext(Lt),{memo:l,type:c="inline"}=e,f=P.useRef(null),h=P.useRef(null),[g,y]=P.useState(!1);P.useEffect(()=>{g&&setTimeout(()=>{dt.setEditMemoId(l.id)},100)},[g]),P.useEffect(()=>{(i==="/review"||i==="/daily")&&t!==l.id&&g&&y(!1)},[t]);const w=$=>{if($.ctrlKey||$.metaKey){const he=x.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss");at.setFromAndToQuery(he.startOf("day").valueOf(),he.endOf("day").valueOf());return}Df(l)},S=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"){const $=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)");$&&$.trigger("click")}dt.setMarkMemoId(l.id)},D=async()=>{var se;const $=!x.Platform.isDesktop&&await((se=window.Capacitor)==null?void 0:se.Plugins.Device.getId()),he=x.Platform.isDesktop?await cr():$.identifier||$.uuid;if(!o||(o==null?void 0:o.appId)!==he){fn();return}l.pinned?await we.unpinMemoById(l.id):await we.pinMemoById(l.id)},I=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"&&x.Platform.isMobile){const $=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)");$&&$.trigger("click")}(i==="/review"||i==="/daily")&&y(!0),i!=="/review"&&i!=="/daily"&&dt.setEditMemoId(l.id)},M=async $=>{$.sourceType==="MULTI"&&$.id.trim()===""&&await we.updateMemoProperty($)},N=async $=>{await we.openThinoByID($.id)},B=async $=>{try{const he=await we.archiveMemo($);he&&we.editMemo(he)}catch(he){console.error(he),new x.Notice(he.message)}},k=async()=>{try{if(a.DeleteThinoDirectly)await we.deleteMemoById(l.id);else{const $=await we.hideMemoById(l.id);$&&we.editMemo($)}}catch($){new x.Notice($.message)}dt.getState().editMemoId===l.id&&dt.setEditMemoId("")},R=()=>{if(h.current&&!h.current.confirmStatus){h.current&&h.current.toggleConfirm(!1);return}},L=()=>{uf(l)},_=async()=>{const $=await we.updateMemo(l.id,l.content,l.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");$&&we.editMemo($)},V=async()=>{navigator.clipboard.writeText(l.content).then(()=>{new x.Notice(E("COPY SUCCEED"))}).catch(()=>{new x.Notice(E("COPY FAILED"))})},U=async()=>{new wV(n,l).open()},Z=$=>{$&&$.target.tagName!=="INPUT"&&I()},Q=async($,he)=>{$.preventDefault(),$.stopPropagation();const se=$.target;if($.ctrlKey||$.metaKey){await N(he);return}if(se.tagName==="A"){await bV(n,r,se);return}if(se.tagName==="IMG"){DV(f.current,se);return}if(se.tagName==="A"&&se.getAttribute("href")){const ue=se.getAttribute("href");window.open(ue,"_blank");return}if(se.className==="memo-link-text"){TV(se);return}if(se.tagName==="INPUT"&&se.hasClass("task-list-item-checkbox")){await IV(a,he,f.current,se);return}},G=$=>{const he=new x.Menu;he.dom.toggleClass("memo-context-menu",!0);const se=window.getSelection();(se==null?void 0:se.toString().length)>0&&he.addItem(ue=>{ue.setIcon("copy").setTitle(E("Copy selected text")).onClick(()=>{navigator.clipboard.writeText(se.toString()).then(()=>{new x.Notice(E("COPY SUCCEED"))}).catch(()=>{new x.Notice(E("COPY FAILED"))})})}).addSeparator(),he.addItem(ue=>{ue.setIcon("copy").setTitle(E("Copy thino").toLocaleUpperCase()).onClick(async()=>{await V(),he.close()})}).addItem(ue=>{ue.setIcon("book-open").setTitle(E("READ")).onClick(w)}).addItem(ue=>{ue.setIcon(l.pinned?"pin-off":"pin").setTitle(l.pinned?E("UNPIN"):E("PIN")).onClick(D)}).addItem(ue=>{ue.setIcon("bookmark").setTitle(E("MARK")).onClick(S)}).addItem(ue=>{ue.setIcon("share-2").setTitle(E("SHARE")).onClick(L)}).addItem(ue=>{ue.setIcon("pencil").setTitle(E("EDIT")).onClick(I)}).addItem(ue=>{ue.setIcon("home").setTitle(E("SOURCE")).onClick(()=>N(l))}).addSeparator().addItem(ue=>{ue.setIcon("archive").setTitle(E("ARCHIVE").toLocaleUpperCase()).onClick(()=>B(l))}).addItem(ue=>{ue.setIcon("trash").setTitle(E("DELETE")).onClick(async()=>{await k()})}),he.showAtMouseEvent($.nativeEvent)},re=P.useMemo(()=>({memo:l,handlePinMemoClick:D,handleFixMemoClick:M,handleSourceMemoClick:N,handleArchiveMemo:B,handleDeleteMemoClick:k,handleGenMemoImageBtnClick:L,handleMarkMemoClick:S,handleEditMemoClick:I,handleCopyMemoClick:V,handleShowMemoStoryDialog:w,handleSplitMemoClick:U}),[l]),de=P.useMemo(()=>({memo:l,handleMemoTypeToggle:_,handleShowMemoStoryDialog:w,settings:a}),[l,a]),fe=P.useMemo(()=>v.jsxs("div",{ref:f,className:`memo-wrapper ${l.pinned?"pinned":""}`,"data-source-type":l.sourceType,"data-thino-type":l.thinoType,"data-thino-id":l.id,onMouseLeave:R,onMouseOver:$=>{$.shiftKey&&($.stopPropagation(),n.workspace.trigger("hover-link",{event:$,source:"thino",hoverParent:r.containerEl,targetEl:f.current,linktext:l.path,sourcePath:l.path,state:{scroll:l.sourceType==="DAILY"?parseInt(l.id.slice(14)):0}}))},onContextMenu:G,children:[g&&v.jsx(mf,{editorType:"inline"}),!g&&v.jsxs(v.Fragment,{children:[c==="inline"&&v.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:$=>{$.target.classList.add("dragging"),$.dataTransfer.setDragImage(f.current,0,0),$.dataTransfer.setData("text/plain",l.content)},onDragEnd:$=>{$.target.classList.remove("dragging")},children:[v.jsx(yV,{...de}),v.jsx(vV,{...re})]}),v.jsx(l9,{memo:l,handleMemoContentClick:Q,handleMemoDoubleClick:Z})]})]}),[l,g]);return v.jsx(v.Fragment,{children:fe})},ai=P.memo(EV,(e,t)=>Cw.isEqual(e.memo,t.memo));class Je extends x.Setting{constructor(n,r){super(n);Se(this,"settingTab");Se(this,"name","");Se(this,"desc","");this.settingTab=r}setName(n){return super.setName(n),this.name=n,this}setDesc(n){return super.setDesc(n),this.desc=n,this}setTab(n){const r=typeof this.name=="string"?this.name:this.name.textContent||"",a=typeof this.desc=="string"?this.desc:this.desc.textContent||"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,a),this}}class CV extends x.Modal{constructor(n,r,a,o,i){super(n);Se(this,"plugin");Se(this,"settingTab");Se(this,"target",5);Se(this,"cb");this.app=n,this.settingTab=r,this.plugin=a,this.target=o,this.cb=i}onOpen(){var l;const{contentEl:n}=this;(l=n.parentElement)==null||l.classList.add("memo-save-location-modal"),n.createEl("h3",{text:E("Thino Daily Target")});const r=n.createDiv("modal-setting");new Je(r,this.settingTab).setName(E("Target Thino Count")).addSlider(c=>{c.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async f=>{this.target=f})});const a=n.createDiv("button-group"),o=a.createEl("button",{text:E("Cancel")}),i=a.createEl("button",{text:E("Save")});i.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},o.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const xV=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:a,settings:o},globalState:{manifest:i}}=P.useContext(Lt),[l,c]=P.useState(),[f,h]=P.useState(5),[g,y]=P.useState(0),[w,S]=P.useState(0),[D,I]=P.useState(o.HeatmapColorScheme||"default"),M=P.useRef(null),N=P.useRef(null);P.useEffect(()=>{o.HeatmapColorScheme&&I(o.HeatmapColorScheme)},[o.HeatmapColorScheme]),P.useEffect(()=>{let k,R=5;i&&a&&(k=a==null?void 0:a.plugins.getPlugin(i.id),R=k==null?void 0:k.settings.MemoDailyTarget,c(k)),h(R)},[i,a]),P.useEffect(()=>{const k=e.find(_=>_.timestamp===t),R=k?k.count:0;S(R);const L=Math.min(100,R/f*100);y(L)},[e,f]),P.useEffect(()=>{x.requireApiVersion("1.4.4")&&(x.setTooltip(N.current,g.toFixed(2)+"%"),x.setTooltip(M.current,E("Set daily target")+` (${w}/${f})`))},[g,w]),P.useEffect(()=>{M.current&&(M.current.hasChildNodes()||x.setIcon(M.current,"crosshair"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.current,g+"%"))},[M,f]);const B=P.useCallback(()=>{if(!l)return;new CV(a,l==null?void 0:l.settingTab,l,f,R=>{h(R)}).open()},[l,f]);return v.jsx(v.Fragment,{children:v.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${D}`,children:[v.jsx("div",{ref:N,className:"daily-progress-bar",children:v.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${g}%`}})}),v.jsx("div",{ref:M,className:"daily-progress-target",onClick:B}),v.jsx("div",{ref:k=>{k&&x.setIcon(k,n==="basic"?"layout-grid":"calendar"),k&&x.setTooltip&&x.setTooltip(k,E("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},MV=(e,t)=>{const n=[],r=Math.floor((e-t)/ei);for(let a=0;a<=r;a++)n.push({timestamp:t+ei*a,count:0,list:0});return n},kV=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:a,handleDateItemClick:o,handleMonthChange:i,dailyStat:l}=e,c=x.moment().startOf("day").valueOf(),[f,h]=P.useState(rp(r)),[g,y]=P.useState(null),[w,S]=P.useState(e.dailyStat);P.useEffect(()=>{h(rp(r));const k=MV(AV(r),rp(r)),R=e.thinos.filter(L=>!L.deletedAt&&L.rowStatus!=="ARCHIVED");for(const L of R){const V=x.moment(L.createdAt,"YYYY/MM/DD HH:mm:ss").startOf("day").diff(x.moment(f).startOf("day"),"days");V>=0&&V{const R=D.getFullYear(),L=D.getMonth()+1;let _=0;L===1&&k===-1?_=new Date(`${R-1}/12/1`).getTime():L===12&&k===1?_=new Date(`${R+1}/1/1`).getTime():_=new Date(`${R}/${L+k}/1`).getTime(),h(rp(_)),i&&i(_)};return v.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[v.jsxs("div",{className:"date-picker-header",children:[v.jsx("span",{ref:k=>{k&&x.setIcon(k,"chevron-left")},className:"btn btn-text",onClick:()=>B(-1)}),v.jsxs("span",{className:"normal-text",children:[v.jsx(O6,{year:D.getFullYear().toString(),handleYearChange:k=>{h(rp(new Date(`${k}/${D.getMonth()+1}/1`).getTime()))}}),v.jsx(P6,{month:D.getMonth().toString(),handleMonthChange:k=>{h(rp(new Date(`${D.getFullYear()}/${parseInt(k)}/1`).getTime()))}})]}),v.jsx("span",{ref:k=>{k&&x.setIcon(k,"chevron-right")},className:"btn btn-text",onClick:()=>B(1)})]}),v.jsxs("div",{className:"date-picker-day-container",children:[v.jsx("div",{className:"date-picker-day-header",children:E("weekDaysShort").map(k=>v.jsx("span",{className:"day-item",children:k},k))}),v.jsx("div",{className:"date-picker-day-content",children:M.map(k=>{if(k.date===0)return v.jsx("span",{className:"day-item null",children:""},k.datestamp);const R=w.find(V=>V.timestamp===k.datestamp)||{count:0,timestamp:k.datestamp,list:0},L=R.count-R.list,_=R.list;return v.jsxs("span",{className:`day-item ${k.datestamp===c?"current":""} ${k.datestamp===g?"selected":""} ${RS(R.count)}`,onClick:V=>{a(r,V.nativeEvent),y(k.datestamp===g?null:k.datestamp),o&&o(V,R)},onMouseOver:V=>{if(!R||!R.count)return;const U=new x.HoverPopover(n,V.currentTarget,100);u9(U,{d:k,list:_,task:L})},children:[v.jsx("span",{className:"day-item-text",children:k.date}),v.jsx(v.Fragment,{children:R&&R.count!==0&&v.jsxs("span",{className:"day-item-dots",children:[L>0&&v.jsx("div",{className:`day-item-dot thino-task-dot ${RS(L)}`}),_>0&&v.jsx("div",{className:`day-item-dot thino-list-dot ${RS(_)}`})]})})]},k.datestamp)})})]})]})};function u9(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const a=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});a.createDiv({cls:"thino-date-item",text:`${x.moment(t.datestamp).format("YYYY-MM-DD")}`});const o=a.createDiv({cls:"thino-task-item"});o.createSpan({cls:"thino-task-item-title-text",text:`${E("Task")}: `}),o.createSpan({cls:"thino-task-item-title-count",text:`${r}`});const i=a.createDiv({cls:"thino-list-item"});i.createSpan({cls:"thino-list-item-title-text",text:`${E("List")}: `}),i.createSpan({cls:"thino-list-item-title-count",text:`${n}`})}function NV(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/ei}function rp(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function AV(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return(n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-ei}function RS(e){return e<=0?"":e<=1?"stat-day-L1-bg":e<=2?"stat-day-L2-bg":e<=4?"stat-day-L3-bg":"stat-day-L4-bg"}const Zx={width:12,height:7},qx=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:t+ei*r,count:0,list:0});return n},av=({initThinos:e,basicType:t})=>{const n=parseInt(x.moment().endOf("day").format("x"));new Date(n).getDay();const r=parseInt(x.moment().startOf("day").format("x")),a=new Array(6-new Date(n).getDay()).fill(0),o=Zx.width*Zx.height,i=parseInt(x.moment().startOf("day").subtract(o,"days").format("x")),l=x.moment().startOf("day").subtract(o,"days"),{memoState:{memos:c},dailyNotesState:{view:f,app:h,settings:g,verifyState:y}}=P.useContext(Lt),[w,S]=xo(t||OV(h||window.app)||"heatmap"),[D,I]=xo(x.moment().startOf("day").valueOf()),[M,N]=xo(g.HeatmapColorScheme||"default"),[B,k]=xo(qx(o,i)),[R,L]=xo(null),[_,V,U]=xo(""),Z=P.useRef(null);P.useEffect(()=>{const fe=qx(o,i),$=(e||c).filter(he=>!he.deletedAt&&he.rowStatus!=="ARCHIVED");for(const he of $){const ue=x.moment(he.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day").diff(l,"days");ue>=0&&ue{g.HeatmapColorScheme&&N(g.HeatmapColorScheme)},[g.HeatmapColorScheme]);const Q=P.useCallback((fe,$)=>{if(!$||!$.count)return;const he=$.count-$.list,se=$.list,ue={date:$.timestamp,datestamp:$.timestamp},X=new x.HoverPopover(f,fe.currentTarget,100);u9(X,{d:ue,list:se,task:he})},[]),G=()=>{S(w==="heatmap"?"basic":"heatmap"),FV(h,w==="heatmap"?"basic":"heatmap"),I(x.moment().startOf("day").valueOf())},re=P.useCallback(async(fe,$)=>{if($.count===0)return;const he=at.getState().query.duration,se=he==null?void 0:he.from,ue=he==null?void 0:he.to,X=x.moment(se).diff(ue,"day")==0;if(se===$.timestamp&&X)at.setFromAndToQuery(0,0),L(null),V(null);else if(se!==$.timestamp&&se>0&&fe.shiftKey){const oe=x.moment($.timestamp).endOf("day").diff(ue,"day");se===0&&fe.shiftKey?V("from"):oe<0&&X&&V("to"),x.moment(se).isBefore($.timestamp)?U.current==="to"?oe<0?at.setFromAndToQuery($.timestamp,ue):(at.setFromAndToQuery(parseInt(x.moment(ue).startOf("day").format("x")),parseInt(x.moment($.timestamp).endOf("day").format("x"))),V("from")):U.current==="from"&&(oe<0,at.setFromAndToQuery(se,parseInt(x.moment($.timestamp).endOf("day").format("x")))):U.current==="to"?at.setFromAndToQuery($.timestamp,ue):U.current==="from"&&(at.setFromAndToQuery($.timestamp,parseInt(x.moment(se).endOf("day").format("x"))),V("to"))}else if(se===0&&fe.shiftKey)at.setFromAndToQuery($.timestamp,parseInt(x.moment().endOf("day").format("x")));else if($.count>0&&(fe.ctrlKey||fe.metaKey)){const{app:oe,dailyNotes:De}=ft.getState(),je=pb(x.moment($.timestamp),De);if(!x.Platform.isMobile)await oe.workspace.getLeaf(!0).openFile(je);else{let Re=oe.workspace.activeLeaf;Re===null&&(Re=oe.workspace.getLeaf(!0)),Re.openFile(je)}}else $.count>0&&!fe.shiftKey&&!fe.ctrlKey&&!fe.metaKey&&(["/","/recycle"].includes(at.getState().pathname)||at.setPathname("/"),at.setFromAndToQuery($.timestamp,ut.getTimeStampByDate(x.moment($.timestamp+ei).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),L($))},[]),de=P.useMemo(()=>v.jsx(kV,{className:`heatmap-${M}`,view:f,datestamp:D,dailyStat:B,thinos:e||c,handleMonthChange:fe=>{I(fe)},handleDateStampChange:fe=>{},handleDateItemClick:(fe,$)=>re(fe,$)}),[JSON.stringify(B),e,c,f,D,M]);return v.jsxs(v.Fragment,{children:[w==="basic"&&de,w==="heatmap"&&v.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${M}`,ref:Z,children:[v.jsxs("div",{className:"day-tip-text-container",children:[v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[0]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[2]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[4]}),v.jsx("span",{className:"tip-text"}),v.jsx("span",{className:"tip-text",children:E("weekDaysShort")[6]})]}),v.jsxs("div",{className:"usage-heat-map",children:[B.slice(B.length-84+a.length,B.length).map((fe,$)=>{const he=fe.count,se=he<=0?"":he<=1?"stat-day-L1-bg":he<=2?"stat-day-L2-bg":he<=4?"stat-day-L3-bg":"stat-day-L4-bg";return v.jsx("span",{"data-timestamp":fe.timestamp,"data-count":fe.count,"data-list-count":fe.list,"data-task-count":fe.count-fe.list,className:`stat-container ${se} ${R===fe?"current":""} ${r===fe.timestamp?"today":""}`,onMouseOver:ue=>Q(ue,fe),onClick:ue=>re(ue,fe)},$)}),a.map((fe,$)=>v.jsx("span",{className:"stat-container null"},$))]})]}),!t&&v.jsx(xV,{allStat:B,todayTimeStamp:r,calendarType:w,handleCalendarTypeChange:G})]})};function FV(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function OV(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const c9=({type:e,timestamp:t})=>{const{memoState:{memos:n}}=P.useContext(Lt),[r,a]=P.useState([]),o=ne.useRef(null);return P.useEffect(()=>{if(e==="daily"){if(t){const l=n.filter(c=>x.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(t,"YYYY/MM/DD HH:mm:ss"),"day"));a(l);return}const i=n.filter(l=>x.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(),"day"));a(i)}else if(e==="latest"){const i=n.filter(f=>!f.deletedAt&&f.rowStatus!=="ARCHIVED"),l=i.filter(f=>f.pinned),c=i.filter(f=>!f.pinned).slice(0,5);a([...l,...c])}},[n]),P.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[n]),r.length>0?v.jsx("div",{ref:o,className:"thino-list-container",children:r.map(i=>v.jsx(ai,{memo:i}))}):v.jsx("div",{className:"tip-text-container",children:v.jsx("span",{className:"tip-text",children:E("Here is No Memos.")})})},PV=(e,t)=>{rs.createRoot(e).render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(jV,{plugin:t})})}))},jV=({plugin:e})=>v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"thino-error-code-block",children:E("Please open thino first")}),v.jsx("button",{className:"thino-open-view",onClick:()=>e.openMemos("center"),children:E("Open thino in center window")})]}),LV=(e,t)=>{rs.createRoot(e).render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(RV,{yaml:t})})}))},RV=({yaml:e})=>{const t=Object.keys(e).filter(a=>e[a]),n=e.daily?e.daily:"",r=a=>{switch(a){case"editor":return Gx;case"heatmap":return BV;case"calendar":return HV;case"daily":return YV;case"list":return zV;case"status":return UV;default:return Gx}};return v.jsx(v.Fragment,{children:t.map(a=>v.jsx("div",{"data-embed-type":a,className:ar("thino-embed-container",a==="editor"?"thino-editor-modal":""),children:a==="daily"?r(a)(n):r(a)()}))})};function Gx(){return v.jsx(mf,{editorType:"inline",modal:!0})}function _V(e,t,n){try{const r=rs.createRoot(e);return r.render(v.jsx(ne.StrictMode,{children:v.jsx(is,{store:Le,context:Lt,children:v.jsx(mf,{editorType:"inline",destroy:t,modal:n})})})),r}catch(r){console.error(r)}}function BV(){return v.jsx(av,{basicType:"heatmap"})}function HV(){return v.jsx(av,{basicType:"basic"})}function UV(){return v.jsx(K2,{statusType:"banner"})}function YV(e){return v.jsx(c9,{type:"daily",timestamp:e})}function zV(){return v.jsx(c9,{type:"latest"})}class MT extends x.Modal{constructor(n){super(n);Se(this,"root")}getViewType(){return"thino_view"}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=_V(n,this.close.bind(this),this),r.toggleClass("thino-editor-modal",!0),setTimeout(()=>{var a;(a=n.querySelector("textarea"))==null||a.focus(),this.app.workspace.trigger("focus-on-textarea")},10)}catch(a){console.error(a)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}function VV(e,t){if(e==null)return{};var n=WV(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WV(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function Rw(){return Rw=Object.assign||function(e){for(var t=1;t{this.reCalculateColumnCount()})}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let n=this.props.breakpointCols;typeof n!="object"&&(n={default:parseInt(n)||_S});let r=1/0,a=n.default||_S;for(let o in n){const i=parseInt(o);i>0&&t<=i&&i"u"&&(i="my-masonry-grid_column"));const l=Tg(Tg(Tg({},t),n),{},{style:Tg(Tg({},n.style),{},{width:o}),className:i});return a.map((c,f)=>ne.createElement("div",Rw({},l,{key:f}),c))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:a,columnAttrs:o,column:i,className:l}=t,c=VV(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let f=l;return typeof l!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof l>"u"&&(f="my-masonry-grid")),ne.createElement("div",Rw({},c,{className:f}),this.renderColumns())}}_w.defaultProps=ZV;const kT=e=>{P.useContext(Lt);const t=Le.getState().dailyNotesState.settings,{thinos:n,dayMark:r,dayMarkRange:a="day",thinoWrapper:o}=e,[i,l]=ne.useState(!(t!=null&&t.hidePinnedGroup&&r==="PINNED")),c=ne.useRef(null);P.useEffect(()=>{c&&x.setTooltip&&x.setTooltip(c.current,E("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[c]);const f=h=>{if(x.Keymap.isModifier(h.nativeEvent,"Mod")){const g={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"},y=x.moment(r,g[a]);at.setFromAndToQuery(y.startOf(a).valueOf(),y.endOf(a).valueOf());return}l(!i)};return v.jsx(v.Fragment,{children:e.type==="list"?v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:c,className:`day-mark ${i?"":"folded"} PINNED`,onClick:f,children:v.jsxs("span",{className:"day-mark-text",children:[i?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),i&&n.map((h,g)=>o?v.jsx("div",{children:o({thino:h})},`${h.id}-${x.moment(h.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`):v.jsx(ai,{memo:h},`${h.id}-${x.moment(h.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`))]}):v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:c,className:`day-mark ${i?"":"folded"}`,onClick:f,children:v.jsxs("span",{className:"day-mark-text",children:[i?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),v.jsx(_w,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:i&&n.map((h,g)=>o?v.jsx("div",{children:o({thino:h})},`${h.id}-${x.moment(h.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`):v.jsx(ai,{memo:h},`${h.id}-${x.moment(h.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`))})]})})};function Wu(e){"@babel/helpers - typeof";return Wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wu(e)}function qV(e,t){if(Wu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d9(e){var t=qV(e,"string");return Wu(t)=="symbol"?t:String(t)}function lf(e,t,n){return t=d9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function tu(e,t){if(e==null)return{};var n=Ab(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ma(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qx(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?R-1:0),Y=1;Yt}),Wv=$p(function(e,t){return e>=t}),uI=$p(function(e,t){return e=t&&a.getHours()-n.getHours()a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r-1&&e%1==0&&e<=ZW}var dI=qW,GW=cI,JW=dI;function KW(e){return e!=null&&JW(e.length)&&!GW(e)}var Zv=KW,QW=9007199254740991,XW=/^(?:0|[1-9]\d*)$/;function e$(e,t){var n=typeof e;return t=t??QW,!!t&&(n=="number"||n!="symbol"&&XW.test(e))&&e>-1&&e%1==0&&e{t.current=e},[e]),t}function fM(e){const t=nZ(e);return P.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function hM(){return P.useState(null)}function rZ(){const e=P.useRef(!0),t=P.useRef(()=>e.current);return P.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function aZ(e){const t=rZ();return[e[0],P.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var oZ=J6({defaultModifiers:[$6,q6,Y6,U6,Z6,W6,G6,H6]}),pM=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},iZ={name:"applyStyles",enabled:!1},sZ={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,a=r.reference,o=r.popper;if("removeAttribute"in a){var i=(a.getAttribute("aria-describedby")||"").split(",").filter(function(l){return l.trim()!==o.id});i.length?a.setAttribute("aria-describedby",i.join(",")):a.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,a=r.elements,o=a.popper,i=a.reference,l=(n=o.getAttribute("role"))==null?void 0:n.toLowerCase();if(o.id&&l==="tooltip"&&"setAttribute"in i){var c=i.getAttribute("aria-describedby");if(c&&c.split(",").indexOf(o.id)!==-1)return;i.setAttribute("aria-describedby",c?c+","+o.id:o.id)}}},lZ=[];function uZ(e,t,n){var r=n===void 0?{}:n,a=r.enabled,o=a===void 0?!0:a,i=r.placement,l=i===void 0?"bottom":i,c=r.strategy,f=c===void 0?"absolute":c,h=r.modifiers,g=h===void 0?lZ:h,y=Ab(r,["enabled","placement","strategy","modifiers"]),w=P.useRef(),S=P.useCallback(function(){var k;(k=w.current)==null||k.update()},[]),D=P.useCallback(function(){var k;(k=w.current)==null||k.forceUpdate()},[]),I=aZ(P.useState({placement:l,update:S,forceUpdate:D,attributes:{},styles:{popper:pM(f),arrow:{}}})),M=I[0],N=I[1],_=P.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(B){var L=B.state,R={},V={};Object.keys(L.elements).forEach(function(Y){R[Y]=L.styles[Y],V[Y]=L.attributes[Y]}),N({state:L,styles:R,attributes:V,update:S,forceUpdate:D,placement:L.placement})}}},[S,D,N]);return P.useEffect(function(){!w.current||!o||w.current.setOptions({placement:l,strategy:f,modifiers:[].concat(g,[_,iZ])})},[f,l,_,o]),P.useEffect(function(){if(!(!o||e==null||t==null))return w.current=oZ(e,t,Pr({},y,{placement:l,strategy:f,modifiers:[].concat(g,[sZ,_])})),function(){w.current!=null&&(w.current.destroy(),w.current=void 0,N(function(k){return Pr({},k,{attributes:{},styles:{popper:pM(f)}})}))}},[o,e,t]),M}function cZ(e,t,n,r){var a=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,a),n.__once&&e.removeEventListener(t,n.__once,a)}function _g(e,t,n,r){return tZ(e,t,n,r),function(){cZ(e,t,n,r)}}function dZ(e){return e&&"setState"in e?J2.findDOMNode(e):e??null}const fZ=function(e){return Gv(dZ(e))};var hZ=27,mM=function(){};function pZ(e){return e.button===0}function mZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gM=function(t){return t&&("current"in t?t.current:t)};function gZ(e,t,n){var r=n===void 0?{}:n,a=r.disabled,o=r.clickTrigger,i=o===void 0?"click":o,l=P.useRef(!1),c=t||mM,f=P.useCallback(function(y){var w,S=gM(e);cz(!!S,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),l.current=!S||mZ(y)||!pZ(y)||!!pv(S,(w=y.composedPath==null?void 0:y.composedPath()[0])!=null?w:y.target)},[e]),h=fM(function(y){l.current||c(y)}),g=fM(function(y){y.keyCode===hZ&&c(y)});P.useEffect(function(){if(!(a||e==null)){var y=window.event,w=fZ(gM(e)),S=_g(w,i,f,!0),D=_g(w,i,function(N){if(N===y){y=void 0;return}h(N)}),I=_g(w,"keyup",function(N){if(N===y){y=void 0;return}g(N)}),M=[];return"ontouchstart"in w.documentElement&&(M=[].slice.call(w.body.children).map(function(N){return _g(N,"mousemove",mM)})),function(){S(),D(),I(),M.forEach(function(N){return N()})}}},[e,a,i,f,h,g])}function vZ(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function yZ(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function wZ(e){var t,n,r,a,o=e.enabled,i=e.enableEvents,l=e.placement,c=e.flip,f=e.offset,h=e.fixed,g=e.containerPadding,y=e.arrowElement,w=e.popperConfig,S=w===void 0?{}:w,D=vZ(S.modifiers);return Pr({},S,{placement:l,enabled:o,strategy:h?"fixed":S.strategy,modifiers:yZ(Pr({},D,{eventListeners:{enabled:i},preventOverflow:Pr({},D.preventOverflow,{options:g?Pr({padding:g},(t=D.preventOverflow)==null?void 0:t.options):(n=D.preventOverflow)==null?void 0:n.options}),offset:{options:Pr({offset:f},(r=D.offset)==null?void 0:r.options)},arrow:Pr({},D.arrow,{enabled:!!y,options:Pr({},(a=D.arrow)==null?void 0:a.options,{element:y})}),flip:Pr({enabled:!!c},D.flip)}))})}function bZ(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function SZ(e,t){e.classList?e.classList.add(t):bZ(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function vM(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function DZ(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=vM(e.className,t):e.setAttribute("class",vM(e.className&&e.className.baseVal||"",t))}var F0;function B9(e){if((!F0&&F0!==0||e)&&pI){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),F0=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return F0}var zS=function(t){var n;return typeof document>"u"?null:t==null?Gv().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function yM(e,t){var n=P.useState(function(){return zS(e)}),r=n[0],a=n[1];if(!r){var o=zS(e);o&&a(o)}return P.useEffect(function(){t&&r&&t(r)},[t,r]),P.useEffect(function(){var i=zS(e);i!==r&&a(i)},[e,r]),r}const wM=e=>!e||typeof e=="function"?e:t=>{e.current=t};function TZ(e,t){const n=wM(e),r=wM(t);return a=>{n&&n(a),r&&r(a)}}function IZ(e,t){return P.useMemo(()=>TZ(e,t),[e,t])}var mI=ne.forwardRef(function(e,t){var n=e.flip,r=e.offset,a=e.placement,o=e.containerPadding,i=o===void 0?5:o,l=e.popperConfig,c=l===void 0?{}:l,f=e.transition,h=hM(),g=h[0],y=h[1],w=hM(),S=w[0],D=w[1],I=IZ(y,t),M=yM(e.container),N=yM(e.target),_=P.useState(!e.show),k=_[0],B=_[1],L=uZ(N,g,wZ({placement:a,enableEvents:!!e.show,containerPadding:i||5,flip:n,offset:r,arrowElement:S,popperConfig:c})),R=L.styles,V=L.attributes,Y=Ab(L,["styles","attributes"]);e.show?k&&B(!1):!e.transition&&!k&&B(!0);var Z=function(){B(!0),e.onExited&&e.onExited.apply(e,arguments)},Q=e.show||f&&!k;if(gZ(g,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!Q)return null;var G=e.children(Pr({},Y,{show:!!e.show,props:Pr({},V.popper,{style:R.popper,ref:I}),arrowProps:Pr({},V.arrow,{style:R.arrow,ref:D})}));if(f){var le=e.onExit,se=e.onExiting,fe=e.onEnter,$=e.onEntering,he=e.onEntered;G=ne.createElement(f,{in:e.show,appear:!0,onExit:le,onExiting:se,onExited:Z,onEnter:fe,onEntering:$,onEntered:he},G)}return M?J2.createPortal(G,M):null});mI.displayName="Overlay";mI.propTypes={show:ke.bool,placement:ke.oneOf(X2),target:ke.any,container:ke.any,flip:ke.bool,children:ke.func.isRequired,containerPadding:ke.number,popperConfig:ke.object,rootClose:ke.bool,rootCloseEvent:ke.oneOf(["click","mousedown"]),rootCloseDisabled:ke.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a-1}var HZ=BZ,YZ=Pb;function UZ(e,t){var n=this.__data__,r=YZ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var zZ=UZ,VZ=xZ,WZ=PZ,$Z=RZ,ZZ=HZ,qZ=zZ;function Gp(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var f=o.get(e),h=o.get(t);if(f&&h)return f==t&&h==e;var g=-1,y=!0,w=n&iJ?new nJ:void 0;for(o.set(e,t),o.set(t,e);++g0&&n(l)?t>1?rF(l,t-1,n,r,a):yte(a,l):r||(a[a.length]=l)}return a}var aF=rF;function bte(e){return function(t,n,r){for(var a=-1,o=Object(t),i=r(t),l=i.length;l--;){var c=i[e?l:++a];if(n(o[c],c,o)===!1)break}return t}}var Ste=bte,Dte=Ste,Tte=Dte(),Ite=Tte,Ete=Ite,Cte=Jv;function xte(e,t){return e&&Ete(e,t,Cte)}var kI=xte,Mte=Zv;function kte(e,t){return function(n,r){if(n==null)return n;if(!Mte(n))return e(n,r);for(var a=n.length,o=t?a:-1,i=Object(n);(t?o--:++ot||o&&i&&c&&!l&&!f||r&&i&&c||!n&&c||!a)return 1;if(!r&&!o&&!f&&e=l)return c;var f=n[r];return c*(f=="desc"?-1:1)}}return e.index-t.index}var Wte=Vte,GS=MI,$te=Ub,Zte=Vb,qte=_te,Gte=Hte,Jte=Bb,Kte=Wte,Qte=zb,Xte=ss;function ene(e,t,n){t.length?t=GS(t,function(o){return Xte(o)?function(i){return $te(i,o.length===1?o[0]:o)}:o}):t=[Qte];var r=-1;t=GS(t,Jte(Zte));var a=qte(e,function(o,i,l){var c=GS(t,function(f){return f(o)});return{criteria:c,index:++r,value:o}});return Gte(a,function(o,i){return Kte(o,i,n)})}var tne=ene;function nne(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var rne=nne,ane=rne,JM=Math.max;function one(e,t,n){return t=JM(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=JM(r.length-t,0),i=Array(o);++a0){if(++t>=pne)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var yne=vne,wne=hne,bne=yne,Sne=bne(wne),sF=Sne,Dne=zb,Tne=oF,Ine=sF;function Ene(e,t){return Ine(Tne(e,t,Dne),e+"")}var lF=Ene,Cne=aF,xne=tne,Mne=lF,QM=Ob,kne=Mne(function(e,t){if(e==null)return[];var n=t.length;return n>1&&QM(e,t[0],t[1])?t=[]:n>2&&QM(t[0],t[1],t[2])&&(t=[t[0]]),xne(e,Cne(t,1),[])}),Nne=kne;const Ane=qt(Nne);function HT(e,t){var n=hI(e);return n?n.innerWidth:t?e.clientWidth:gf(e).width}function uF(e){return h9(e)||M9(e)||sI(e)||p9()}function Fne(e,t){for(var n=-1,r=e==null?0:e.length;++n1),o}),Tie(e,Cie(e),n),r&&(n=bie(n,xie|Mie|kie,Iie));for(var a=t.length;a--;)Sie(n,t[a]);return n}),Aie=Nie;const Fie=qt(Aie);var Oie=lF,Pie=$v,jie=Ob,Lie=Wb,wF=Object.prototype,Rie=wF.hasOwnProperty,_ie=Oie(function(e,t){e=Object(e);var n=-1,r=t.length,a=r>2?t[2]:void 0;for(a&&jie(t[0],t[1],a)&&(r=1);++n0&&(l=l[0]),c=(l=l.filter(function(h){return h}))[0];for(var f=1;f2?r-2:0),o=2;o2&&arguments[2]!==void 0?arguments[2]:"day",r=e,a=[];Wp(r,t,n);)a.push(r),r=Vs(r,1,n);return a}function gse(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=$a(e,"day"),e=hv(e,hv(t)),e=xp(e,xp(t)),e=fv(e,fv(t)),dv(e,dv(t)))}function d3(e){return hv(e)===0&&xp(e)===0&&fv(e)===0&&dv(e)===0}function vse(e,t,n,r){return n==="day"&&(n="date"),Math.abs(nM[n](e,void 0,r)-nM[n](t,void 0,r))}function FI(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+$a(e,n)/c3[n]-+$a(t,n)/c3[n]))}var yse=ke.oneOfType([ke.string,ke.func]);function wse(e,t,n,r,a){var o=typeof r=="function"?r(n,a,e):t.call(e,n,r,a);return ov(o==null||typeof o=="string","`localizer format(..)` must return a string, null, or undefined"),o}function bse(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function OI(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function Sse(e,t){return FI(e,t,"minutes")+OI(e,t)}function Dse(e){var t=$a(e,"day");return FI(t,e,"minutes")+OI(t,e)}function Tse(e,t){return uI(e,t,"day")}function Ise(e,t,n){var r=Vv(e,t,"minutes");return r?Wv(t,n,"minutes"):Fb(t,n,"minutes")}function YT(e,t){return vse(e,t,"day")}function Ese(e){var t=e.evtA,n=t.start,r=t.end,a=t.allDay,o=e.evtB,i=o.start,l=o.end,c=o.allDay,f=+$a(n,"day")-+$a(i,"day"),h=YT(n,r),g=YT(i,l);return f||g-h||!!c-!!a||+n-+i||+r-+l}function Cse(e){var t=e.event,n=t.start,r=t.end,a=e.range,o=a.start,i=a.end,l=$a(n,"day"),c=Wp(l,i,"day"),f=lI(l,r,"minutes"),h=f?Fb(r,o,"minutes"):Wv(r,o,"minutes");return c&&h}function xse(e,t){return Vv(e,t,"day")}function Mse(e,t){return d3(e)&&d3(t)}var kse=ka(function e(t){var n=this;Ma(this,e),ov(typeof t.format=="function","date localizer `format(..)` must be a function"),ov(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||yse,this.formats=t.formats,this.format=function(){for(var r=arguments.length,a=new Array(r),o=0;o1,se=I.eventProp(i,Q,Z,l),fe=ne.createElement("div",{className:"rbc-event-content",title:Y||void 0},_?ne.createElement(_,{event:i,continuesPrior:w,continuesAfter:S,title:V,isAllDay:G,localizer:y,slotStart:B,slotEnd:L}):V);return ne.createElement(k,Object.assign({},this.props,{type:"date"}),ne.createElement("div",Object.assign({},R,{style:tr(tr({},se.style),a),className:ca("rbc-event",o,se.className,{"rbc-selected":l,"rbc-event-allday":le,"rbc-event-continues-prior":w,"rbc-event-continues-after":S}),onClick:function(he){return f&&f(i,he)},onDoubleClick:function(he){return h&&h(i,he)},onKeyDown:function(he){return g&&g(i,he)}}),typeof M=="function"?M(fe):fe))}}]),t}(ne.Component);function Zb(e,t){return!e||t==null?!1:QQ(e,t)}function TF(e,t){var n=e.right-e.left,r=n/t;return r}function IF(e,t,n,r){var a=TF(e,r);return n?r-1-Math.floor((t-e.left)/a):Math.floor((t-e.left)/a)}function jse(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function Lse(e,t,n,r,a){var o=-1,i=-1,l=r-1,c=TF(t,r),f=IF(t,n.x,a,r),h=t.topn.y,g=t.tope.y,y=e.y>t.bottom,w=t.top>e.y,S=n.topt.bottom;return S&&(o=0,i=l),h&&(w?(o=0,i=f):y&&(o=f,i=l)),g&&(o=i=a?l-Math.floor((e.x-t.left)/c):Math.floor((e.x-t.left)/c),h?fN?i-M-R:i+R+f,Y=B>_?l+L-I+c:l+L;return{topOffset:V,leftOffset:Y}}function _se(e){var t=e.containerRef,n=e.accessors,r=e.getters,a=e.selected,o=e.components,i=e.localizer,l=e.position,c=e.show,f=e.events,h=e.slotStart,g=e.slotEnd,y=e.onSelect,w=e.onDoubleClick,S=e.onKeyPress,D=e.handleDragStart,I=e.popperRef,M=e.target,N=e.offset;Ose({ref:I,callback:c}),P.useLayoutEffect(function(){var B=Rse({target:M,offset:N,container:t.current,box:I.current}),L=B.topOffset,R=B.leftOffset;I.current.style.top="".concat(L,"px"),I.current.style.left="".concat(R,"px")},[N.x,N.y,M]);var _=l.width,k={minWidth:_+_/2};return ne.createElement("div",{style:k,className:"rbc-overlay",ref:I},ne.createElement("div",{className:"rbc-overlay-header"},i.format(h,"dayHeaderFormat")),f.map(function(B,L){return ne.createElement(DF,{key:L,type:"popup",localizer:i,event:B,getters:r,onSelect:y,accessors:n,components:o,onDoubleClick:w,onKeyPress:S,continuesPrior:i.lt(n.end(B),h,"day"),continuesAfter:i.gte(n.start(B),g,"day"),slotStart:h,slotEnd:g,selected:Zb(B,a),draggable:!0,onDragStart:function(){return D(B)},onDragEnd:function(){return c()}})}))}var EF=ne.forwardRef(function(e,t){return ne.createElement(_se,Object.assign({},e,{popperRef:t}))});EF.propTypes={accessors:ke.object.isRequired,getters:ke.object.isRequired,selected:ke.object,components:ke.object.isRequired,localizer:ke.object.isRequired,position:ke.object.isRequired,show:ke.func.isRequired,events:ke.array.isRequired,slotStart:ke.instanceOf(Date).isRequired,slotEnd:ke.instanceOf(Date),onSelect:ke.func,onDoubleClick:ke.func,onKeyPress:ke.func,handleDragStart:ke.func,style:ke.object,offset:ke.shape({x:ke.number,y:ke.number})};function Bse(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,a=e.overlay,o=e.accessors,i=e.localizer,l=e.components,c=e.getters,f=e.selected,h=e.handleSelectEvent,g=e.handleDoubleClickEvent,y=e.handleKeyPressEvent,w=e.handleDragStart,S=e.onHide,D=e.overlayDisplay,I=P.useRef(null);if(!a.position)return null;var M=r;isNaN(r)||(M={x:r,y:r});var N=a.position,_=a.events,k=a.date,B=a.end;return ne.createElement(EZ,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:S,target:a.target},function(L){var R=L.props;return ne.createElement(EF,Object.assign({},R,{containerRef:t,ref:I,target:a.target,offset:M,accessors:o,getters:c,selected:f,components:l,localizer:i,position:N,show:D,events:_,slotStart:k,slotEnd:B,onSelect:h,onDoubleClick:g,onKeyPress:y,handleDragStart:w}))})}var PI=ne.forwardRef(function(e,t){return ne.createElement(Bse,Object.assign({},e,{containerRef:t}))});PI.propTypes={popupOffset:ke.oneOfType([ke.number,ke.shape({x:ke.number,y:ke.number})]),overlay:ke.shape({position:ke.object,events:ke.array,date:ke.instanceOf(Date),end:ke.instanceOf(Date)}),accessors:ke.object.isRequired,localizer:ke.object.isRequired,components:ke.object.isRequired,getters:ke.object.isRequired,selected:ke.object,handleSelectEvent:ke.func,handleDoubleClickEvent:ke.func,handleKeyPressEvent:ke.func,handleDragStart:ke.func,onHide:ke.func,overlayDisplay:ke.func};function ao(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return _g(n,e,t,{passive:!1})}function Hse(e,t,n){return!e||pv(e,document.elementFromPoint(t,n))}function Yse(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return K9(a,".rbc-event",e)}function Use(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return K9(a,".rbc-show-more",e)}function qw(e,t){return!!Yse(e,t)}function zse(e,t){return!!Use(e,t)}function ap(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var f3=5,Vse=250,CF=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,a=r===void 0?!1:r,o=n.longPressThreshold,i=o===void 0?250:o,l=n.validContainers,c=l===void 0?[]:l;Ma(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||a,this.longPressThreshold=i,this.validContainers=c,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=ao("touchmove",function(){},window),this._removeKeyDownListener=ao("keydown",this._keyListener),this._removeKeyUpListener=ao("keyup",this._keyListener),this._removeDropFromOutsideListener=ao("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=ao("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return ka(e,[{key:"on",value:function(n,r){var a=this._listeners[n]||(this._listeners[n]=[]);return a.push(r),{remove:function(){var i=a.indexOf(r);i!==-1&&a.splice(i,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o0&&arguments[0]!==void 0?arguments[0]:0;return Wu(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function h3(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Mf(e),a=r.top,o=r.left,i=r.right,l=i===void 0?o:i,c=r.bottom,f=c===void 0?a:c,h=Mf(t),g=h.top,y=h.left,w=h.right,S=w===void 0?y:w,D=h.bottom,I=D===void 0?g:D;return!(f-nI||l-nS)}function Mf(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+p3("left"),r=t.top+p3("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function p3(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var $se=function(e){Ao(t,e);function t(n,r){var a;return Ma(this,t),a=No(this,t,[n,r]),a.state={selecting:!1},a.containerRef=P.createRef(),a}return ka(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(r){!r.selectable&&this.props.selectable&&this._selectable(),r.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var r=this.props,a=r.range,o=r.getNow,i=r.getters,l=r.date,c=r.components.dateCellWrapper,f=r.localizer,h=this.state,g=h.selecting,y=h.startIdx,w=h.endIdx,S=o();return ne.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(D,I){var M=g&&I>=y&&I<=w,N=i.dayProp(D),_=N.className,k=N.style;return ne.createElement(c,{key:I,value:D,range:a},ne.createElement("div",{style:k,className:ca("rbc-day-bg",_,M&&"rbc-selected-cell",f.isSameDate(D,S)&&"rbc-today",l&&f.neq(l,D,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,a=this.containerRef.current,o=this._selector=new CF(this.props.container,{longPressThreshold:this.props.longPressThreshold}),i=function(c,f){if(!qw(a,c)&&!zse(a,c)){var h=Mf(a),g=r.props,y=g.range,w=g.rtl;if(jse(h,c)){var S=IF(h,c.x,w,y.length);r._selectSlot({startIdx:S,endIdx:S,action:f,box:c})}}r._initial={},r.setState({selecting:!1})};o.on("selecting",function(l){var c=r.props,f=c.range,h=c.rtl,g=-1,y=-1;if(r.state.selecting||(gr(r.props.onSelectStart,[l]),r._initial={x:l.x,y:l.y}),o.isSelected(a)){var w=Mf(a),S=Lse(r._initial,w,l,f.length,h);g=S.startIdx,y=S.endIdx}r.setState({selecting:!0,startIdx:g,endIdx:y})}),o.on("beforeSelect",function(l){if(r.props.selectable==="ignoreEvents")return!qw(r.containerRef.current,l)}),o.on("click",function(l){return i(l,"click")}),o.on("doubleClick",function(l){return i(l,"doubleClick")}),o.on("select",function(l){r._selectSlot(tr(tr({},r.state),{},{action:"select",bounds:l})),r._initial={},r.setState({selecting:!1}),gr(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var a=r.endIdx,o=r.startIdx,i=r.action,l=r.bounds,c=r.box;a!==-1&&o!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:o,end:a,action:i,bounds:l,box:c,resourceId:this.props.resourceId})}}]),t}(ne.Component),Zl={propTypes:{slotMetrics:ke.object.isRequired,selected:ke.object,isAllDay:ke.bool,accessors:ke.object.isRequired,localizer:ke.object.isRequired,components:ke.object.isRequired,getters:ke.object.isRequired,onSelect:ke.func,onDoubleClick:ke.func,onKeyPress:ke.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var a=t.accessors,o=t.getters,i=t.onSelect,l=t.onDoubleClick,c=t.onKeyPress,f=t.localizer,h=t.slotMetrics,g=t.components,y=t.resizable,w=h.continuesPrior(n),S=h.continuesAfter(n);return ne.createElement(DF,{event:n,getters:o,localizer:f,accessors:a,components:g,onSelect:i,onDoubleClick:l,onKeyPress:c,continuesPrior:w,continuesAfter:S,slotStart:h.first,slotEnd:h.last,selected:Zb(n,r),resizable:y})},renderSpan:function(t,n,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",o=Math.abs(n)/t*100+"%";return ne.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:o,flexBasis:o,maxWidth:o}},a)}},xF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.segments,i=a.slotMetrics.slots,l=a.className,c=1;return ne.createElement("div",{className:ca(l,"rbc-row")},o.reduce(function(f,h,g){var y=h.event,w=h.left,S=h.right,D=h.span,I="_lvl_"+g,M=w-c,N=Zl.renderEvent(r.props,y);return M&&f.push(Zl.renderSpan(i,M,"".concat(I,"_gap"))),f.push(Zl.renderSpan(i,D,I,N)),c=S+1,f},[]))}}]),t}(ne.Component);xF.defaultProps=tr({},Zl.defaultProps);function MF(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,a=e.localizer;return{first:t[0],last:a.add(t[t.length-1],1,r)}}function Zse(e,t,n,r){var a=MF({dateRange:t,localizer:r}),o=a.first,i=a.last,l=r.diff(o,i,"day"),c=r.max(r.startOf(n.start(e),"day"),o),f=r.min(r.ceil(n.end(e),"day"),i),h=Xee(t,function(y){return r.isSameDate(y,c)}),g=r.diff(c,f,"day");return g=Math.min(g,l),g=Math.max(g-r.segmentOffset,1),{event:e,span:g,left:h+1,right:Math.max(h+g,1)}}function kF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,a,o=[],i=[];for(n=0;n=t?i.push(a):(o[r]||(o[r]=[])).push(a)}for(n=0;n=e.left})}function Gse(e,t,n){var r=fw(e),a=[],o=[];r.forEach(function(c){var f=t.start(c),h=t.end(c);n.daySpan(f,h)>1?a.push(c):o.push(c)});var i=a.sort(function(c,f){return UT(c,f,t,n)}),l=o.sort(function(c,f){return UT(c,f,t,n)});return[].concat(fw(i),fw(l))}function UT(e,t,n,r){var a={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},o={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:a,evtB:o})}var NF=function(t,n){return t.left<=n&&t.right>=n},m3=function(t,n){return t.filter(function(r){return NF(r,n)}).map(function(r){return r.event})},AF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){for(var r=this.props,a=r.segments,o=r.slotMetrics.slots,i=kF(a).levels[0],l=1,c=1,f=[];l<=o;){var h="_lvl_"+l,g=i.filter(function(N){return NF(N,l)})[0]||{},y=g.event,w=g.left,S=g.right,D=g.span;if(!y){l++;continue}var I=Math.max(0,w-c);if(this.canRenderSlotEvent(w,D)){var M=Zl.renderEvent(this.props,y);I&&f.push(Zl.renderSpan(o,I,h+"_gap")),f.push(Zl.renderSpan(o,D,h,M)),c=l=S+1}else I&&f.push(Zl.renderSpan(o,I,h+"_gap")),f.push(Zl.renderSpan(o,1,h,this.renderShowMore(a,l))),c=l+=1}return ne.createElement("div",{className:"rbc-row"},f)}},{key:"canRenderSlotEvent",value:function(r,a){var o=this.props.segments;return dte(r,r+a).every(function(i){var l=m3(o,i).length;return l===1})}},{key:"renderShowMore",value:function(r,a){var o=this,i=this.props,l=i.localizer,c=i.slotMetrics,f=c.getEventsForSlot(a),h=m3(r,a),g=h.length;return g?ne.createElement("button",{type:"button",key:"sm_"+a,className:ca("rbc-button-link","rbc-show-more"),onClick:function(w){return o.showMore(a,w)}},l.messages.showMore(g,h,f)):!1}},{key:"showMore",value:function(r,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(r,a.target)}}]),t}(ne.Component);AF.defaultProps=tr({},Zl.defaultProps);var Jse=function(t){var n=t.children;return ne.createElement("div",{className:"rbc-row-content-scroll-container"},n)},Kse=function(t,n){return t.left<=n&&t.right>=n},Qse=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function FF(){return nF(function(e){for(var t=e.range,n=e.events,r=e.maxRows,a=e.minRows,o=e.accessors,i=e.localizer,l=MF({dateRange:t,localizer:i}),c=l.first,f=l.last,h=n.map(function(D){return Zse(D,t,o,i)}),g=kF(h,Math.max(r-1,1)),y=g.levels,w=g.extra,S=w.length>0?a-1:a;y.length1&&arguments[1]!==void 0?arguments[1]:0;if(o.lt(k,t,"minutes"))return y[0];if(o.gt(k,n,"minutes"))return y[y.length-1];var L=o.diff(t,k,"minutes");return y[(L-L%r)/r+B]},startsBeforeDay:function(k){return o.lt(k,t,"day")},startsAfterDay:function(k){return o.gt(k,n,"day")},startsBefore:function(k){return o.lt(o.merge(t,k),t,"minutes")},startsAfter:function(k){return o.gt(o.merge(n,k),n,"minutes")},getRange:function(k,B,L,R){L||(k=o.min(n,o.max(t,k))),R||(B=o.min(n,o.max(t,B)));var V=N(k),Y=N(B),Z=Y>r*h&&!o.eq(n,B)?(V-r)/(r*h)*100:V/(r*h)*100;return{top:Z,height:Y/(r*h)*100-Z,start:N(k),startDate:k,end:N(B),endDate:B}},getCurrentTimePosition:function(k){var B=N(k),L=B/(r*h)*100;return L}}}var nle=function(){function e(t,n){var r=n.accessors,a=n.slotMetrics;Ma(this,e);var o=a.getRange(r.start(t),r.end(t)),i=o.start,l=o.startDate,c=o.end,f=o.endDate,h=o.top,g=o.height;this.start=i,this.end=c,this.startMs=+l,this.endMs=+f,this.top=h,this.height=g,this.data=t}return ka(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(a,o){return Math.max(a,o.leaves.length+1)},0)+1;return 100/n}if(this.leaves){var r=100-this.container._width;return r/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var n=this._width,r=Math.min(100,this._width*1.7);if(this.rows)return r;if(this.leaves)return this.leaves.length>0?r:n;var a=this.row.leaves,o=a.indexOf(this);return o===a.length-1?n:r}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var n=this.row,r=n.leaves,a=n.xOffset,o=n._width,i=r.indexOf(this)+1;return a+i*o}}]),e}();function rle(e,t,n){return Math.abs(t.start-e.start)e.start&&t.start0;){var r=t.shift();n.push(r);for(var a=0;ao.startMs)){if(a>0){var i=t.splice(a,1)[0];n.push(i)}break}}}return n}function PF(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=t.map(function(h){return new nle(h,{slotMetrics:r,accessors:a})}),i=ale(o),l=[],c=function(){var g=i[f],y=l.find(function(D){return D.end>g.start||Math.abs(g.start-D.start)=0;S--)rle(y.rows[S],g,n)&&(w=y.rows[S]);w?(w.leaves.push(g),g.row=w):(g.leaves=[],y.rows.push(g))},f=0;f-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var a=jF(e.friends[r],t,n);t=t>a?t:a}return t}function ole(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=PF({events:t,minimumStartDifference:n,slotMetrics:r,accessors:a});o.sort(function(fe,$){return fe=fe.style,$=$.style,fe.top!==$.top?fe.top>$.top?1:-1:fe.height!==$.height?fe.top+fe.height<$.top+$.height?1:-1:0});for(var i=0;i=f&&S<=h||S>f&&S<=h||w>=f&&wle?Q:le}Q<=Z.idx&&(Z.size=100-Z.idx*Z.size);var se=Z.idx===0?0:3;Z.style.width="calc(".concat(Z.size,"% - ").concat(se,"px)"),Z.style.height="calc(".concat(Z.style.height,"% - 2px)"),Z.style.xOffset="calc(".concat(Z.style.left,"% + ").concat(se,"px)")}return o}var v3={overlap:PF,"no-overlap":ole};function ile(e){return!!(e&&e.constructor&&e.call&&e.apply)}function sle(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in v3&&(n=v3[t]),ile(n)?n.apply(this,arguments):[]}var LF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.renderSlot,o=r.resource,i=r.group,l=r.getters,c=r.components,f=c===void 0?{}:c,h=f.timeSlotWrapper,g=h===void 0?Ru:h,y=l?l.slotGroupProp(i):{};return ne.createElement("div",Object.assign({className:"rbc-timeslot-group"},y),i.map(function(w,S){var D=l?l.slotProp(w,o):{};return ne.createElement(g,{key:S,value:w,resource:o},ne.createElement("div",Object.assign({},D,{className:ca("rbc-time-slot",D.className)}),a&&a(w,S)))}))}}]),t}(P.Component);function P0(e){return typeof e=="string"?e:e+"%"}function lle(e){var t=e.style,n=e.className,r=e.event,a=e.accessors,o=e.rtl,i=e.selected,l=e.label,c=e.continuesPrior,f=e.continuesAfter,h=e.getters,g=e.onClick,y=e.onDoubleClick,w=e.isBackgroundEvent,S=e.onKeyPress,D=e.components,I=D.event,M=D.eventWrapper,N=a.title(r),_=a.tooltip(r),k=a.end(r),B=a.start(r),L=h.eventProp(r,B,k,i),R=[ne.createElement("div",{key:"1",className:"rbc-event-label"},l),ne.createElement("div",{key:"2",className:"rbc-event-content"},I?ne.createElement(I,{event:r,title:N}):N)],V=t.height,Y=t.top,Z=t.width,Q=t.xOffset,G=tr(tr({},L.style),{},lf({top:P0(Y),height:P0(V),width:P0(Z)},o?"right":"left",P0(Q)));return ne.createElement(M,Object.assign({type:"time"},e),ne.createElement("div",{role:"button",tabIndex:0,onClick:g,onDoubleClick:y,style:G,onKeyDown:S,title:_?(typeof l=="string"?l+": ":"")+_:void 0,className:ca(w?"rbc-background-event":"rbc-event",n,L.className,{"rbc-selected":i,"rbc-event-continues-earlier":c,"rbc-event-continues-later":f})},R))}var ule=function(t){var n=t.children,r=t.className,a=t.style,o=t.innerRef;return ne.createElement("div",{className:r,style:a,ref:o},n)},cle=ne.forwardRef(function(e,t){return ne.createElement(ule,Object.assign({},e,{innerRef:t}))}),dle=["dayProp"],fle=["eventContainerWrapper"],RF=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){r.intervalTriggered=!0,r.positionTimeIndicator(),r.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var r=this.props,a=r.min,o=r.max,i=r.getNow,l=i();if(l>=a&&l<=o){var c=this.slotMetrics.getCurrentTimePosition(l);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:c})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.max,i=r.rtl,l=r.isNow,c=r.resource,f=r.accessors,h=r.localizer,g=r.getters,y=g.dayProp,w=tu(g,dle),S=r.components,D=S.eventContainerWrapper,I=tu(S,fle),M=this.slotMetrics,N=this.state,_=N.selecting,k=N.top,B=N.height,L=N.startDate,R=N.endDate,V={start:L,end:R},Y=y(o),Z=Y.className,Q=Y.style,G=I.dayColumnWrapper||cle;return ne.createElement(G,{ref:this.containerRef,date:a,style:Q,className:ca(Z,"rbc-day-slot","rbc-time-column",l&&"rbc-now",l&&"rbc-today",_&&"rbc-slot-selecting"),slotMetrics:M},M.groups.map(function(le,se){return ne.createElement(LF,{key:se,group:le,resource:c,getters:w,components:I})}),ne.createElement(D,{localizer:h,resource:c,accessors:f,getters:w,components:I,slotMetrics:M},ne.createElement("div",{className:ca("rbc-events-container",i&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),_&&ne.createElement("div",{className:"rbc-slot-selection",style:{top:k,height:B}},ne.createElement("span",null,h.format(V,"selectRangeFormat"))),l&&this.intervalTriggered&&ne.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}(ne.Component);RF.defaultProps={dragThroughEvents:!0,timeslots:2};function hle(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}var ple=function(t){var n=t.min,r=t.max,a=t.timeslots,o=t.step,i=t.localizer,l=t.getNow,c=t.resource,f=t.components,h=t.getters,g=t.gutterRef,y=f.timeGutterWrapper,w=P.useMemo(function(){return hle({min:n,max:r,localizer:i})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),i]),S=w.start,D=w.end,I=P.useState(jI({min:S,max:D,timeslots:a,step:o,localizer:i})),M=_u(I,2),N=M[0],_=M[1];P.useEffect(function(){N&&_(N.update({min:S,max:D,timeslots:a,step:o,localizer:i}))},[S==null?void 0:S.toISOString(),D==null?void 0:D.toISOString(),a,o]);var k=P.useCallback(function(B,L){if(L)return null;var R=N.dateIsInGroup(l(),L);return ne.createElement("span",{className:ca("rbc-label",R&&"rbc-now")},i.format(B,"timeGutterFormat"))},[N,i,l]);return ne.createElement(y,{slotMetrics:N},ne.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:g},N.groups.map(function(B,L){return ne.createElement(LF,{key:L,group:B,resource:c,components:f,renderSlot:k,getters:h})})))},mle=ne.forwardRef(function(e,t){return ne.createElement(ple,Object.assign({gutterRef:t},e))}),gle=function(t){var n=t.label;return ne.createElement(ne.Fragment,null,n)},vle=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;oa.clientHeight;r.state.isOverflowing!==o&&(r._updatingOverflow=!0,r.setState({isOverflowing:o},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=nF(function(a,o){return yle(a,o)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=ne.createRef(),r.contentRef=ne.createRef(),r.containerRef=ne.createRef(),r._scrollRatio=null,r.gutterRef=P.createRef(),r}return ka(t,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),dM(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,a,o,i){var l=this,c=this.props,f=c.min,h=c.max,g=c.components,y=c.accessors,w=c.localizer,S=c.dayLayoutAlgorithm,D=this.memoizedResources(this.props.resources,y),I=D.groupEvents(a),M=D.groupEvents(o);return D.map(function(N,_){var k=_u(N,2),B=k[0],L=k[1];return r.map(function(R,V){var Y=(I.get(B)||[]).filter(function(Q){return w.inRange(R,y.start(Q),y.end(Q),"day")}),Z=(M.get(B)||[]).filter(function(Q){return w.inRange(R,y.start(Q),y.end(Q),"day")});return ne.createElement(RF,Object.assign({},l.props,{localizer:w,min:w.merge(R,f),max:w.merge(R,h),resource:L&&B,components:g,isNow:w.isSameDate(R,i),key:_+"-"+V,date:R,events:Y,backgroundEvents:Z,dayLayoutAlgorithm:S}))})})}},{key:"render",value:function(){var r,a=this.props,o=a.events,i=a.backgroundEvents,l=a.range,c=a.width,f=a.rtl,h=a.selected,g=a.getNow,y=a.resources,w=a.components,S=a.accessors,D=a.getters,I=a.localizer,M=a.min,N=a.max,_=a.showMultiDayTimes,k=a.longPressThreshold,B=a.resizable;c=c||this.state.gutterWidth;var L=l[0],R=l[l.length-1];this.slots=l.length;var V=[],Y=[],Z=[];return o.forEach(function(Q){if(mv(Q,L,R,S,I)){var G=S.start(Q),le=S.end(Q);S.allDay(Q)||I.startAndEndAreDateOnly(G,le)||!_&&!I.isSameDate(G,le)?V.push(Q):Y.push(Q)}}),i.forEach(function(Q){mv(Q,L,R,S,I)&&Z.push(Q)}),V.sort(function(Q,G){return UT(Q,G,S,I)}),ne.createElement("div",{className:ca("rbc-time-view",y&&"rbc-time-view-resources"),ref:this.containerRef},ne.createElement(vle,{range:l,events:V,width:c,rtl:f,getNow:g,localizer:I,selected:h,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(y,S),selectable:this.props.selectable,accessors:S,getters:D,components:w,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:k,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:B}),this.props.popup&&this.renderOverlay(),ne.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},ne.createElement(mle,{date:L,ref:this.gutterRef,localizer:I,min:I.merge(L,M),max:I.merge(L,N),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:w,className:"rbc-time-gutter",getters:D}),this.renderEvents(l,Y,Z,g())))}},{key:"renderOverlay",value:function(){var r,a,o=this,i=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},l=this.props,c=l.accessors,f=l.localizer,h=l.components,g=l.getters,y=l.selected,w=l.popupOffset,S=l.handleDragStart,D=function(){return o.setState({overlay:null})};return ne.createElement(PI,{overlay:i,accessors:c,localizer:f,components:h,getters:g,selected:y,popupOffset:w,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!i.position,overlayDisplay:this.overlayDisplay,onHide:D})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var r=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var a,o=(a=r.gutterRef)!==null&&a!==void 0&&a.current?HT(r.gutterRef.current):void 0;o&&r.state.gutterWidth!==o&&r.setState({gutterWidth:o})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var r=this.contentRef.current;r.scrollTop=r.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,a=r.min,o=r.max,i=r.scrollToTime,l=r.localizer,c=l.diff(l.merge(i,a),i,"milliseconds"),f=l.diff(a,o,"milliseconds");this._scrollRatio=c/f}}]),t}(P.Component);em.defaultProps={step:30,timeslots:2};var wle=["date","localizer","min","max","scrollToTime","enableAutoScroll"],Gb=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,wle),D=t.range(a,{localizer:o});return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:10,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);Gb.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};Gb.navigate=function(e,t,n){var r=n.localizer;switch(t){case ri.PREVIOUS:return r.add(e,-1,"day");case ri.NEXT:return r.add(e,1,"day");default:return e}};Gb.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var ble=["date","localizer","min","max","scrollToTime","enableAutoScroll"],ed=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,ble),D=t.range(a,this.props);return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:15,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);ed.defaultProps=em.defaultProps;ed.navigate=function(e,t,n){var r=n.localizer;switch(t){case ri.PREVIOUS:return r.add(e,-1,"week");case ri.NEXT:return r.add(e,1,"week");default:return e}};ed.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),a=n.startOf(e,"week",r),o=n.endOf(e,"week",r);return n.range(a,o)};ed.title=function(e,t){var n=t.localizer,r=ed.range(e,{localizer:n}),a=uF(r),o=a[0],i=a.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")};var Sle=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function LI(e,t){return ed.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var Xv=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,Sle),D=LI(a,this.props);return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:15,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);Xv.defaultProps=em.defaultProps;Xv.range=LI;Xv.navigate=ed.navigate;Xv.title=function(e,t){var n=t.localizer,r=LI(e,{localizer:n}),a=uF(r),o=a[0],i=a.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")};function td(e){var t=e.accessors,n=e.components,r=e.date,a=e.events,o=e.getters,i=e.length,l=e.localizer,c=e.onDoubleClickEvent,f=e.onSelectEvent,h=e.selected,g=P.useRef(null),y=P.useRef(null),w=P.useRef(null),S=P.useRef(null),D=P.useRef(null);P.useEffect(function(){N()});var I=function(R,V,Y){var Z=n.event,Q=n.date;return V=V.filter(function(G){return mv(G,l.startOf(R,"day"),l.endOf(R,"day"),t,l)}),V.map(function(G,le){var se=t.title(G),fe=t.end(G),$=t.start(G),he=o.eventProp(G,$,fe,Zb(G,h)),ie=le===0&&l.format(R,"agendaDateFormat"),ce=le===0?ne.createElement("td",{rowSpan:V.length,className:"rbc-agenda-date-cell"},Q?ne.createElement(Q,{day:R,label:ie}):ie):!1;return ne.createElement("tr",{key:Y+"_"+le,className:he.className,style:he.style},ce,ne.createElement("td",{className:"rbc-agenda-time-cell"},M(R,G)),ne.createElement("td",{className:"rbc-agenda-event-cell",onClick:function(ae){return f&&f(G,ae)},onDoubleClick:function(ae){return c&&c(G,ae)}},Z?ne.createElement(Z,{event:G,title:se}):se))},[])},M=function(R,V){var Y="",Z=n.time,Q=l.messages.allDay,G=t.end(V),le=t.start(V);return t.allDay(V)||(l.eq(le,G)?Q=l.format(le,"agendaTimeFormat"):l.isSameDate(le,G)?Q=l.format({start:le,end:G},"agendaTimeRangeFormat"):l.isSameDate(R,le)?Q=l.format(le,"agendaTimeFormat"):l.isSameDate(R,G)&&(Q=l.format(G,"agendaTimeFormat"))),l.gt(R,le,"day")&&(Y="rbc-continues-prior"),l.lt(R,G,"day")&&(Y+=" rbc-continues-after"),ne.createElement("span",{className:Y.trim()},Z?ne.createElement(Z,{event:V,day:R,label:Q}):Q)},N=function(){if(D.current){var R=g.current,V=D.current.firstChild;if(V){var Y=S.current.scrollHeight>S.current.clientHeight,Z=[],Q=Z;Z=[HT(V.children[0]),HT(V.children[1])],(Q[0]!==Z[0]||Q[1]!==Z[1])&&(y.current.style.width=Z[0]+"px",w.current.style.width=Z[1]+"px"),Y?(SZ(R,"rbc-header-overflowing"),R.style.marginRight=B9()+"px"):DZ(R,"rbc-header-overflowing")}}},_=l.messages,k=l.add(r,i,"day"),B=l.range(r,k,"day");return a=a.filter(function(L){return mv(L,l.startOf(r,"day"),l.endOf(k,"day"),t,l)}),a.sort(function(L,R){return+t.start(L)-+t.start(R)}),ne.createElement("div",{className:"rbc-agenda-view"},a.length!==0?ne.createElement(ne.Fragment,null,ne.createElement("table",{ref:g,className:"rbc-agenda-table"},ne.createElement("thead",null,ne.createElement("tr",null,ne.createElement("th",{className:"rbc-header",ref:y},_.date),ne.createElement("th",{className:"rbc-header",ref:w},_.time),ne.createElement("th",{className:"rbc-header"},_.event)))),ne.createElement("div",{className:"rbc-agenda-content",ref:S},ne.createElement("table",{className:"rbc-agenda-table"},ne.createElement("tbody",{ref:D},B.map(function(L,R){return I(L,a,R)}))))):ne.createElement("span",{className:"rbc-agenda-empty"},_.noEventsInRange))}td.defaultProps={length:30};td.range=function(e,t){var n=t.length,r=n===void 0?td.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return{start:e,end:o}};td.navigate=function(e,t,n){var r=n.length,a=r===void 0?td.defaultProps.length:r,o=n.localizer;switch(t){case ri.PREVIOUS:return o.add(e,-a,"day");case ri.NEXT:return o.add(e,a,"day");default:return e}};td.title=function(e,t){var n=t.length,r=n===void 0?td.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return a.format({start:e,end:o},"agendaHeaderFormat")};var pw=lf(lf(lf(lf(lf({},Mo.MONTH,qb),Mo.WEEK,ed),Mo.WORK_WEEK,Xv),Mo.DAY,Gb),Mo.AGENDA,td),Dle=["action","date","today"];function Tle(e,t){var n=t.action,r=t.date,a=t.today,o=tu(t,Dle);switch(e=typeof e=="string"?pw[e]:e,n){case ri.TODAY:r=a||new Date;break;case ri.DATE:break;default:ov(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,o)}return r}var Ile=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;o1)return o.map(function(l){return ne.createElement("button",{type:"button",key:l,className:ca({"rbc-active":i===l}),onClick:a.view.bind(null,l)},r[l])})}}]),t}(ne.Component);function Ele(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&Wu(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var Vc=function(t){return function(n){return Ele(n,t)}},Cle=["view","date","getNow","onNavigate"],xle=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function _F(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n0&&arguments[0]!==void 0?arguments[0]:null,De=arguments.length>1?arguments[1]:void 0,je=Wc(De);return je?e(ae).startOf(je).toDate():e(ae).toDate()}function l(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,De=arguments.length>1?arguments[1]:void 0,je=Wc(De);return je?e(ae).endOf(je).toDate():e(ae).toDate()}function c(ae,De,je){var Re=o(ae,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSame(Xe,Ze)}function f(ae,De,je){return!c(ae,De,je)}function h(ae,De,je){var Re=o(ae,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isAfter(Xe,Ze)}function g(ae,De,je){var Re=o(ae,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isBefore(Xe,Ze)}function y(ae,De,je){var Re=o(ae,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSameOrBefore(Xe,Ze)}function w(ae,De,je){var Re=o(ae,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSameOrBefore(Xe,Ze)}function S(ae,De,je){var Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",Fe=Wc(Re),Be=e(ae),Xe=e(De),Ze=e(je);return Be.isBetween(Xe,Ze,Fe,"[]")}function D(ae,De){var je=e(ae),Re=e(De),Fe=e.min(je,Re);return Fe.toDate()}function I(ae,De){var je=e(ae),Re=e(De),Fe=e.max(je,Re);return Fe.toDate()}function M(ae,De){if(!ae&&!De)return null;var je=e(De).format("HH:mm:ss"),Re=e(ae).startOf("day").format("MM/DD/YYYY");return e("".concat(Re," ").concat(je),"MM/DD/YYYY HH:mm:ss").toDate()}function N(ae,De,je){var Re=Wc(je);return e(ae).add(De,Re).toDate()}function _(ae,De){for(var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Re=Wc(je),Fe=e(ae).toDate(),Be=[];w(Fe,De);)Be.push(Fe),Fe=N(Fe,1,Re);return Be}function k(ae,De){var je=Wc(De),Re=i(ae,je);return c(Re,ae)?Re:N(Re,1,je)}function B(ae,De){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Re=Wc(je),Fe=e(ae),Be=e(De);return Be.diff(Fe,Re)}function L(ae){var De=e(ae);return De.minutes()}function R(ae){var De=ae?e.localeData(ae):e.localeData();return De?De.firstDayOfWeek():0}function V(ae){return e(ae).startOf("month").startOf("week").toDate()}function Y(ae){return e(ae).endOf("month").endOf("week").toDate()}function Z(ae){for(var De=V(ae),je=Y(ae),Re=[];w(De,je);)Re.push(De),De=N(De,1,"d");return Re}function Q(ae,De,je){return e(ae).startOf("day").minute(De+je).toDate()}function G(ae,De){return B(ae,De,"minutes")}function le(ae){var De=e(ae).startOf("day"),je=e(ae);return je.diff(De,"minutes")+a(ae)}function se(ae,De){var je=e(ae),Re=e(De);return je.isBefore(Re,"day")}function fe(ae,De,je){var Re=e(De),Fe=e(je);return Re.isSameOrAfter(Fe,"minutes")}function $(ae,De){var je=e(ae),Re=e(De),Fe=e.duration(Re.diff(je));return Fe.days()}function he(ae){var De=ae.evtA,je=De.start,Re=De.end,Fe=De.allDay,Be=ae.evtB,Xe=Be.start,Ze=Be.end,st=Be.allDay,Ct=+i(je,"day")-+i(Xe,"day"),tn=$(je,Re),_e=$(Xe,Ze);return Ct||_e-tn||!!st-!!Fe||+je-+Xe||+Re-+Ze}function ie(ae){var De=ae.event,je=De.start,Re=De.end,Fe=ae.range,Be=Fe.start,Xe=Fe.end,Ze=e(je).startOf("day"),st=e(Re),Ct=e(Be),tn=e(Xe),_e=Ze.isSameOrBefore(tn,"day"),et=!Ze.isSame(st,"minutes"),nt=et?st.isAfter(Ct,"minutes"):st.isSameOrAfter(Ct,"minutes");return _e&&nt}function ce(ae,De){var je=e(ae),Re=e(De);return je.isSame(Re,"day")}function X(){var ae=new Date,De=/-/.test(ae.toString())?"-":"",je=ae.getTimezoneOffset(),Re=Number("".concat(De).concat(Math.abs(je))),Fe=e().utcOffset();return Fe>Re?1:0}return new kse({formats:Ple,firstOfWeek:R,firstVisibleDay:V,lastVisibleDay:Y,visibleDays:Z,format:function(De,je,Re){return t(e(De),Re).format(je)},lt:g,lte:w,gt:h,gte:y,eq:c,neq:f,merge:M,inRange:S,startOf:i,endOf:l,range:_,add:N,diff:B,ceil:k,min:D,max:I,minutes:L,getSlotDate:Q,getTimezoneOffset:n,getDstOffset:r,getTotalMin:G,getMinutesFromMidnight:le,continuesPrior:se,continuesAfter:fe,sortEvents:he,inEventRange:ie,isSameDate:ce,daySpan:$,browserTZOffset:X})}function y3(e,t,n,r,a){const o={start:r.start(e),end:r.end(e)},i={start:t,end:n};return a.inEventRange({event:o,range:i})}function Lle(e,t){return!e||t==null?!1:vb.isEqual(e,t)}const pp={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function $u({accessors:e,components:t,date:n,events:r,getters:a,length:o,localizer:i,onDoubleClickEvent:l,onSelectEvent:c,selected:f}){P.useRef(null);const h=P.useRef(null),g=P.useRef(null),y=P.useRef(null),w=P.useRef(null),[S,D]=P.useState(!1),[I,M]=P.useState(!1),N=(Z,Q,G)=>{const{event:le,date:se}=t;return Q=Q.filter(fe=>y3(fe,i.startOf(Z,"day"),i.endOf(Z,"day"),e,i)),Q.map((fe,$)=>{const he=e.title(fe),ie=e.end(fe),ce=e.start(fe),X=a.eventProp(fe,ce,ie,Lle(fe,f)),ae=$===0&&i.format(Z,"agendaDateFormat"),De=$===0?v.jsx("td",{rowSpan:Q.length,className:"rbc-agenda-date-cell",children:se?v.jsx(se,{day:Z,label:ae}):ae}):!1;return v.jsxs("tr",{className:X.className,style:X.style,children:[De,v.jsx("td",{className:"rbc-agenda-time-cell",children:_(Z,fe)}),v.jsx("td",{className:"rbc-agenda-event-cell",onClick:je=>c&&c(fe,je),onDoubleClick:je=>l&&l(fe,je),children:le?v.jsx(le,{event:fe,title:he}):he})]},G+"_"+$)},[])},_=(Z,Q)=>{const G=t.time;let le="",se=i.messages.allDay;const fe=e.end(Q),$=e.start(Q);return e.allDay(Q)||(i.eq($,fe)?se=i.format($,"agendaTimeFormat"):i.isSameDate($,fe)?se=i.format({start:$,end:fe},"agendaTimeRangeFormat"):i.isSameDate(Z,$)?se=i.format($,"agendaTimeFormat"):i.isSameDate(Z,fe)&&(se=i.format(fe,"agendaTimeFormat"))),i.gt(Z,$,"day")&&(le="rbc-continues-prior"),i.lt(Z,fe,"day")&&(le+=" rbc-continues-after"),v.jsx("span",{className:le.trim(),children:G?v.jsx(G,{event:Q,day:Z,label:se}):se})},{messages:k}=i,B=i.add(n,-o/2,"day"),L=i.add(n,o/2,"day"),R=i.range(B,L,"day");S&&R.reverse(),r=r.filter(Z=>y3(Z,i.startOf(B,"day"),i.endOf(L,"day"),e,i)),r.sort((Z,Q)=>+e.start(Z)-+e.start(Q)),I&&r.reverse();const V=P.useCallback(()=>setTimeout(()=>{w.current&&kb(w.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(Z=>{new x.Notice(E("Image is generating..."));const Q=ft.getState().settings.AutoSaveWhenOnMobile,G=ft.getState().app.vault;if(Q&&x.Platform.isMobile){const le=Z.split("base64,")[1];gb(le,"image/png").arrayBuffer().then(async fe=>{let $;const he="png",ie=Ju();for(const ce in ie)if(ie[ce]instanceof x.TFile){$=ie[ce];break}$!==void 0&&await G.createBinary(await G.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,he,$),fe)})}Nb({imgUrl:Z})}).catch(Z=>{console.error(Z)})},0),[w.current,R]),Y=P.useCallback(Z=>{const Q=new x.Menu;Q.addItem(G=>{G.setIcon("share-2").setTitle(E("Share")).onClick(()=>{V()})}),Q.showAtMouseEvent(Z.nativeEvent)},[w.current,R,V]);return v.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?v.jsx(ne.Fragment,{children:v.jsxs("table",{ref:w,className:"rbc-agenda-table",children:[v.jsx("thead",{onContextMenu:Y,children:v.jsxs("tr",{children:[v.jsx("th",{className:"rbc-header",ref:h,onClick:()=>{D(!S)},children:k.date+(S?" 🔼":" 🔽")}),v.jsx("th",{className:"rbc-header",ref:g,onClick:()=>{M(!I)},children:k.time+(I?" 🔼":" 🔽")}),v.jsx("th",{className:"rbc-header",children:k.event})]})}),v.jsx("tbody",{ref:y,children:R.map((Z,Q)=>N(Z,r,Q))})]})}):v.jsx("span",{className:"rbc-agenda-empty",children:k.noEventsInRange})})}$u.propTypes={accessors:ke.object.isRequired,components:ke.object.isRequired,date:ke.instanceOf(Date),events:ke.array,getters:ke.object.isRequired,length:ke.number.isRequired,localizer:ke.object.isRequired,onSelectEvent:ke.func,onDoubleClickEvent:ke.func,selected:ke.object};$u.defaultProps={length:30};$u.range=(e,{length:t=$u.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return{customStart:r,customEnd:a}};$u.navigate=(e,t,{length:n=$u.defaultProps.length,localizer:r})=>{switch(t){case pp.PREVIOUS:return r.add(e,-n,"day");case pp.NEXT:return r.add(e,n,"day");default:return e}};$u.title=(e,{length:t=$u.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return n.format({start:r,end:a},"agendaHeaderFormat")};function Rle(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Rv(e.hoverEl);return n.render(v.jsx(is,{store:Le,context:Lt,children:v.jsx(ai,{memo:t})})),n}function _le({event:e}){const t=e.resource,n=t.content.split(` -`)[0].slice(0,20),r=ne.useRef(null),a=ne.useRef(null),o=ne.useRef(null);P.useEffect(()=>{if(a.current)return x.setIcon(a.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const i=P.useCallback(c=>{o.current&&(o.current.unmount(),o.current=null),o.current=c},[]),l=P.useCallback(c=>{if(!r.current||!x.Keymap.isModifier(c.nativeEvent,"Mod"))return;const f=new x.HoverPopover(ft.getState().view,r.current,100),h=Rle(f,t);i(h)},[r.current]);return v.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:l,children:[v.jsx(Ble,{event:e}),v.jsx("span",{children:n})]})}const Ble=({event:e})=>{const t=ne.useRef(null),n=e.resource;P.useEffect(()=>{t.current&&x.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=P.useCallback(async a=>{a.stopPropagation(),a.preventDefault(),await(async()=>{const i=await we.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");i&&we.editMemo(i)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return v.jsx(v.Fragment,{children:v.jsxs("span",{className:"rbc-event-icon-group",children:[v.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),v.jsx("span",{className:ar("rbc-event-time","hidden"),children:v.jsx("span",{className:"rbc-event-time-text",children:x.moment(e.start).format("HH:mm")})})]})})};function HF({views:e,view:t,messages:n,onView:r}){return e.map(a=>v.jsx("button",{type:"button",className:ar({"rbc-active":t===a}),onClick:()=>r(a),children:n[a]},a))}HF.propTypes={messages:ke.object,onView:ke.func,view:ke.string,views:ke.array};function YF({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:a,view:o,views:i}){const l={previous:P.useRef(null),today:P.useRef(null),next:P.useRef(null)};P.useEffect(()=>{l&&(x.setIcon(l.previous.current,"chevron-left"),x.setIcon(l.today.current,"dot"),x.setIcon(l.next.current,"chevron-right"))},[l]);const c=P.useMemo(()=>v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:l.previous,type:"button",onClick:()=>r(pp.PREVIOUS),"aria-label":n.previous,children:"<"}),v.jsx("button",{ref:l.today,type:"button",onClick:()=>r(pp.TODAY),"aria-label":n.today,children:"•"}),v.jsx("button",{ref:l.next,type:"button",onClick:()=>r(pp.NEXT),"aria-label":n.next,children:">"})]}),[n]);return v.jsxs("div",{className:"rbc-toolbar",children:[v.jsx("span",{className:ar("rbc-btn-group","thino-view-custom-toolbar"),children:c}),v.jsx("span",{className:"rbc-toolbar-label",children:v.jsx(Pw,{type:"text",handleValueChange:f=>{r(pp.DATE,x.moment(f,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(o==="week"?x.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:x.moment(e.valueOf(),"x").valueOf()})}),v.jsx("span",{className:"rbc-btn-group",children:v.jsx(HF,{view:o,views:i,messages:n,onView:a})})]})}YF.propTypes={date:ke.instanceOf(Date),label:ke.string,localizer:ke.object,messages:ke.object,onNavigate:ke.func,onView:ke.func,view:ke.string,views:ke.array};function Hle({event:e,children:t,showPopup:n,callRender:r,...a}){const o=P.useRef(null),i=P.useRef(null),l=P.useCallback(c=>{if(!c.isTrusted){r();return}i.current=c.nativeEvent.target,i.current&&(i.current.hasClass("rbc-event")||(i.current=i.current.closest(".rbc-event")),o.current!==null?(window.clearTimeout(o.current),o.current=null):o.current=window.setTimeout(()=>{n(e,i.current),o.current=null},250))},[e,n]);return v.jsx(v.Fragment,{children:v.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:l,children:t})})}const Yle=jle(x.moment),Ule=({event:e})=>{const t=e.resource;return v.jsx(v.Fragment,{children:v.jsx(ai,{memo:t})})},zle=e=>{var G;const{thinos:t}=e,[n,r]=ne.useState([]),[a,o]=ne.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[i,l]=ne.useState(null),c=ne.useRef(null),f=ne.useRef(null),[h,g]=ne.useState(!1),y=P.useRef(null),[w,S]=P.useState(new Date);P.useEffect(()=>()=>{c.current&&(c.current=null),f.current&&(f.current=null),y.current&&(y.current=null)},[]),P.useEffect(()=>{const le=t.map(se=>{const fe=x.moment(se.createdAt,"YYYY/MM/DD HH:mm:ss"),$=fe.clone().add(1,"minute");return{title:se.content,start:new Date(fe.format("YYYY-MM-DDTHH:mm:ss")),end:new Date($.format("YYYY-MM-DDTHH:mm:ss")),resource:se}});r(le)},[t]),P.useEffect(()=>{app==null||app.saveLocalStorage("thino-calendar-view",a)},[a]),P.useEffect(()=>{i&&h&&l(t.find(le=>le.id===i.id))},[t,i,h]),P.useEffect(()=>{i&&y.current.update()},[i]),y.current=Mb(c.current,f.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const D=P.useCallback(()=>{y.current.update(),y.current.update()},[]),I=P.useCallback((le,se)=>{l(null),k(),y.current.state.elements.reference=se,l(le.resource),B()},[]),M=P.useCallback(()=>{k(),l(null)},[]),N=P.useCallback((le,se,fe)=>{var $;if(_(le),se==="week"||se==="day"){const he=c.current.find(".rbc-event-wrapper");if(c.current.closest(".memolist-wrapper"),he){($=he.children[0])==null||$.click();return}else{setTimeout(()=>{var ce,X;const ie=c.current.find(".rbc-event-wrapper");(X=(ce=ie==null?void 0:ie.children)==null?void 0:ce[0])==null||X.click()},0);return}}},[]),_=P.useCallback(le=>{S(le)},[S]);Hv(f,M);const k=P.useCallback(()=>{g(!1)},[g]),B=P.useCallback(()=>{y.current.update(),g(!0)},[g]),L=P.useCallback(le=>{const se=le.resource;dt.setEditMemoId(se.id)},[]),R=P.useCallback(le=>{o(le)},[o]),{components:V,views:Y,messages:Z}=P.useMemo(()=>({components:{toolbar:YF,eventWrapper:le=>v.jsx(Hle,{...le,callRender:D,showPopup:I}),agenda:{event:Ule},event:_le},views:{month:!0,agenda:$u,week:!0,day:!0},messages:{month:E("Month"),day:E("Day"),next:E("Next"),previous:E("Previous"),today:E("Today"),agenda:E("Agenda"),week:E("Week"),yesterday:E("Yesterday"),tomorrow:E("Tomorrow"),noEventsInRange:E("No thinos in range"),date:E("date"),time:E("time"),event:E("event")}}),[]),Q=P.useMemo(()=>({timeGutterFormat:(le,se,fe)=>fe.format(le,"HH:mm",se),agendaTimeRangeFormat:({start:le,end:se},fe,$)=>$.format(le,"HH:mm",fe)+" — "+$.format(se,"HH:mm",fe),agendaHeaderFormat:({start:le,end:se},fe,$)=>$.format(le,"YYYY-MM-DD")+" — "+$.format(se,"YYYY-MM-DD")}),[]);return v.jsxs("div",{ref:c,className:"calendar-view",children:[v.jsx(kle,{date:w,messages:Z,components:V,localizer:Yle,events:n,views:Y,onView:R,onDoubleClickEvent:L,onNavigate:N,formats:Q,defaultView:a,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),v.jsx("div",{ref:f,style:(G=y.current)==null?void 0:G.styles.popper,className:ar("thino-popup-container",h?"":"hidden"),children:i&&v.jsx(ai,{memo:i})})]})};function Kc(e,t){return typeof e=="function"?e(t):e}function Ai(e,t){return n=>{t.setState(r=>({...r,[e]:Kc(n,r[e])}))}}function Jw(e){return e instanceof Function}function Vle(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Wle(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const i=t(o);i!=null&&i.length&&r(i)})};return r(e),n}function Bt(e,t,n){let r=[],a;return o=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(o);if(!(l.length!==r.length||l.some((h,g)=>r[g]!==h)))return a;r=l;let f;if(n.key&&n.debug&&(f=Date.now()),a=t(...l),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-i)*100)/100,y=Math.round((Date.now()-f)*100)/100/16,w=(S,D)=>{for(S=String(S);S.length{var a;return(a=e==null?void 0:e.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function $le(e,t,n,r){var a,o;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let f=(a=(o=l.id)!=null?o:c?c.replace(".","_"):void 0)!=null?a:typeof l.header=="string"?l.header:void 0,h;if(l.accessorFn?h=l.accessorFn:c&&(c.includes(".")?h=y=>{let w=y;for(const D of c.split(".")){var S;w=(S=w)==null?void 0:S[D]}return w}:h=y=>y[l.accessorKey]),!f)throw new Error;let g={id:`${String(f)}`,accessorFn:h,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:Bt(()=>[!0],()=>{var y;return[g,...(y=g.columns)==null?void 0:y.flatMap(w=>w.getFlatColumns())]},Ht(e.options,"debugColumns")),getLeafColumns:Bt(()=>[e._getOrderColumnsFn()],y=>{var w;if((w=g.columns)!=null&&w.length){let S=g.columns.flatMap(D=>D.getLeafColumns());return y(S)}return[g]},Ht(e.options,"debugColumns"))};for(const y of e._features)y.createColumn==null||y.createColumn(g,e);return g}const oo="debugHeaders";function w3(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(o),i},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(o,e)}),o}const Zle={createTable:e=>{e.getHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,i;const l=(o=r==null?void 0:r.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?o:[],c=(i=a==null?void 0:a.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?i:[],f=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(a!=null&&a.includes(g.id)));return j0(t,[...l,...f,...c],e)},Ht(e.options,oo)),e.getCenterHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),j0(t,n,e,"center")),Ht(e.options,oo)),e.getLeftHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?a:[];return j0(t,o,e,"left")},Ht(e.options,oo)),e.getRightHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?a:[];return j0(t,o,e,"right")},Ht(e.options,oo)),e.getFooterGroups=Bt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getLeftFooterGroups=Bt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getCenterFooterGroups=Bt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getRightFooterGroups=Bt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getFlatHeaders=Bt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getLeftFlatHeaders=Bt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getCenterFlatHeaders=Bt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getRightFlatHeaders=Bt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getCenterLeafHeaders=Bt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getLeftLeafHeaders=Bt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getRightLeafHeaders=Bt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getLeafHeaders=Bt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,i,l,c,f;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(i=(l=n[0])==null?void 0:l.headers)!=null?i:[],...(c=(f=r[0])==null?void 0:f.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},Ht(e.options,oo))}};function j0(e,t,n,r){var a,o;let i=0;const l=function(y,w){w===void 0&&(w=1),i=Math.max(i,w),y.filter(S=>S.getIsVisible()).forEach(S=>{var D;(D=S.columns)!=null&&D.length&&l(S.columns,w+1)},0)};l(e);let c=[];const f=(y,w)=>{const S={depth:w,id:[r,`${w}`].filter(Boolean).join("_"),headers:[]},D=[];y.forEach(I=>{const M=[...D].reverse()[0],N=I.column.depth===S.depth;let _,k=!1;if(N&&I.column.parent?_=I.column.parent:(_=I.column,k=!0),M&&(M==null?void 0:M.column)===_)M.subHeaders.push(I);else{const B=w3(n,_,{id:[r,w,_.id,I==null?void 0:I.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${D.filter(L=>L.column===_).length}`:void 0,depth:w,index:D.length});B.subHeaders.push(I),D.push(B)}S.headers.push(I),I.headerGroup=S}),c.push(S),w>0&&f(D,w-1)},h=t.map((y,w)=>w3(n,y,{depth:i,index:w}));f(h,i-1),c.reverse();const g=y=>y.filter(S=>S.column.getIsVisible()).map(S=>{let D=0,I=0,M=[0];S.subHeaders&&S.subHeaders.length?(M=[],g(S.subHeaders).forEach(_=>{let{colSpan:k,rowSpan:B}=_;D+=k,M.push(B)})):D=1;const N=Math.min(...M);return I+=N,S.colSpan=D,S.rowSpan=I,{colSpan:D,rowSpan:I}});return g((a=(o=c[0])==null?void 0:o.headers)!=null?a:[]),c}const L0={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},QS=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),qle={getDefaultColumnDef:()=>L0,getInitialState:e=>({columnSizing:{},columnSizingInfo:QS(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ai("columnSizing",e),onColumnSizingInfoChange:Ai("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:L0.minSize,(r=o??e.columnDef.size)!=null?r:L0.size),(a=e.columnDef.maxSize)!=null?a:L0.maxSize)},e.getStart=Bt(n=>[n,$g(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),Ht(t.options,"debugColumns")),e.getAfter=Bt(n=>[n,$g(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),Ht(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),a=r==null?void 0:r.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),XS(o)&&o.touches&&o.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[r.id,r.getSize()]],c=XS(o)?Math.round(o.touches[0].clientX):o.clientX,f={},h=(M,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(_=>{var k,B;const L=t.options.columnResizeDirection==="rtl"?-1:1,R=(N-((k=_==null?void 0:_.startOffset)!=null?k:0))*L,V=Math.max(R/((B=_==null?void 0:_.startSize)!=null?B:0),-.999999);return _.columnSizingStart.forEach(Y=>{let[Z,Q]=Y;f[Z]=Math.round(Math.max(Q+Q*V,0)*100)/100}),{..._,deltaOffset:R,deltaPercentage:V}}),(t.options.columnResizeMode==="onChange"||M==="end")&&t.setColumnSizing(_=>({..._,...f})))},g=M=>h("move",M),y=M=>{h("end",M),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},w=n||typeof document<"u"?document:null,S={moveHandler:M=>g(M.clientX),upHandler:M=>{w==null||w.removeEventListener("mousemove",S.moveHandler),w==null||w.removeEventListener("mouseup",S.upHandler),y(M.clientX)}},D={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),g(M.touches[0].clientX),!1),upHandler:M=>{var N;w==null||w.removeEventListener("touchmove",D.moveHandler),w==null||w.removeEventListener("touchend",D.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),y((N=M.touches[0])==null?void 0:N.clientX)}},I=Gle()?{passive:!1}:!1;XS(o)?(w==null||w.addEventListener("touchmove",D.moveHandler,I),w==null||w.addEventListener("touchend",D.upHandler,I)):(w==null||w.addEventListener("mousemove",S.moveHandler,I),w==null||w.addEventListener("mouseup",S.upHandler,I)),t.setColumnSizingInfo(M=>({...M,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?QS():(n=e.initialState.columnSizingInfo)!=null?n:QS())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let R0=null;function Gle(){if(typeof R0=="boolean")return R0;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return R0=e,R0}function XS(e){return e.type==="touchstart"}const Jle={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ai("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const i=o.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var a;const o=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=r,n=(a=n)!=null?a:!o,!o&&n)return{...i,[e.id]:!0};if(o&&!n){const{[e.id]:l,...c}=i;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},UF=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};UF.autoRemove=e=>Ys(e);const zF=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};zF.autoRemove=e=>Ys(e);const VF=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};VF.autoRemove=e=>Ys(e);const WF=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};WF.autoRemove=e=>Ys(e)||!(e!=null&&e.length);const $F=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});$F.autoRemove=e=>Ys(e)||!(e!=null&&e.length);const ZF=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});ZF.autoRemove=e=>Ys(e)||!(e!=null&&e.length);const qF=(e,t,n)=>e.getValue(t)===n;qF.autoRemove=e=>Ys(e);const GF=(e,t,n)=>e.getValue(t)==n;GF.autoRemove=e=>Ys(e);const RI=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};RI.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(a)?1/0:a;if(o>i){const l=o;o=i,i=l}return[o,i]};RI.autoRemove=e=>Ys(e)||Ys(e[0])&&Ys(e[1]);const ju={includesString:UF,includesStringSensitive:zF,equalsString:VF,arrIncludes:WF,arrIncludesAll:$F,arrIncludesSome:ZF,equals:qF,weakEquals:GF,inNumberRange:RI};function Ys(e){return e==null||e===""}const Kle={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ai("columnFilters",e),onGlobalFilterChange:Ai("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ju.includesString:typeof r=="number"?ju.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ju.equals:Array.isArray(r)?ju.arrIncludes:ju.weakEquals},e.getFilterFn=()=>{var n,r;return Jw(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ju[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r==null?void 0:r.find(h=>h.id===e.id),i=Kc(n,o?o.value:void 0);if(b3(a,i,e)){var l;return(l=r==null?void 0:r.filter(h=>h.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(o){var f;return(f=r==null?void 0:r.map(h=>h.id===e.id?c:h))!=null?f:[]}return r!=null&&r.length?[...r,c]:[c]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ju.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Jw(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ju[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=a=>{var o;return(o=Kc(t,a))==null?void 0:o.filter(i=>{const l=n.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(b3(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function b3(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Qle=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),Xle=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},eue=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r=o)&&(r=o)}),r},tue=(e,t,n)=>{let r,a;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r===void 0?i>=i&&(r=a=i):(r>i&&(r=i),a{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},rue=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Vle(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,i)=>o-i);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},aue=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),oue=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,iue=(e,t)=>t.length,eD={sum:Qle,min:Xle,max:eue,extent:tue,mean:nue,median:rue,unique:aue,uniqueCount:oue,count:iue},sue={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ai("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,a,o;return(n=(r=(a=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?a:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return eD.sum;if(Object.prototype.toString.call(r)==="[object Date]")return eD.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Jw(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:eD[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function lue(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(i=>i.id===o)).filter(Boolean),...r]}const uue={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ai("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Bt(n=>[$g(t,n)],n=>n.findIndex(r=>r.id===e.id),Ht(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$g(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=$g(t,n);return((r=a[a.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Bt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const i=[...t],l=[...a];for(;l.length&&i.length;){const c=i.shift(),f=l.findIndex(h=>h.id===c);f>-1&&o.push(l.splice(f,1)[0])}o=[...o,...l]}return lue(o,n,r)},Ht(e.options,"debugTable"))}},zT=0,VT=10,tD=()=>({pageIndex:zT,pageSize:VT}),cue={getInitialState:e=>({...e,pagination:{...tD(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ai("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>Kc(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?tD():(a=e.initialState.pagination)!=null?a:tD())},e.setPageIndex=r=>{e.setPagination(a=>{let o=Kc(r,a.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?zT:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:zT)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?VT:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:VT)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,Kc(r,a.pageSize)),i=a.pageSize*a.pageIndex,l=Math.floor(i/o);return{...a,pageIndex:l,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let i=Kc(r,(o=e.options.pageCount)!=null?o:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...a,pageCount:i}}),e.getPageOptions=Bt(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,i)=>i)),a},Ht(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},nD=()=>({left:[],right:[]}),rD=()=>({top:[],bottom:[]}),due={getInitialState:e=>({columnPinning:nD(),rowPinning:rD(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ai("columnPinning",e),onRowPinningChange:Ai("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,i;if(n==="right"){var l,c;return{left:((l=a==null?void 0:a.left)!=null?l:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((c=a==null?void 0:a.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var f,h;return{left:[...((f=a==null?void 0:a.left)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((h=a==null?void 0:a.right)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((o=a==null?void 0:a.left)!=null?o:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=a==null?void 0:a.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,i;return((a=r.columnDef.enablePinning)!=null?a:!0)&&((o=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:r,right:a}=t.getState().columnPinning,o=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>a==null?void 0:a.includes(l));return o?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(c=>{let{id:f}=c;return f}):[],i=a?e.getParentRows().map(c=>{let{id:f}=c;return f}):[],l=new Set([...i,e.id,...o]);t.setRowPinning(c=>{var f,h;if(n==="bottom"){var g,y;return{top:((g=c==null?void 0:c.top)!=null?g:[]).filter(D=>!(l!=null&&l.has(D))),bottom:[...((y=c==null?void 0:c.bottom)!=null?y:[]).filter(D=>!(l!=null&&l.has(D))),...Array.from(l)]}}if(n==="top"){var w,S;return{top:[...((w=c==null?void 0:c.top)!=null?w:[]).filter(D=>!(l!=null&&l.has(D))),...Array.from(l)],bottom:((S=c==null?void 0:c.bottom)!=null?S:[]).filter(D=>!(l!=null&&l.has(D)))}}return{top:((f=c==null?void 0:c.top)!=null?f:[]).filter(D=>!(l!=null&&l.has(D))),bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(D=>!(l!=null&&l.has(D)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>a==null?void 0:a.includes(l));return o?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=t._getPinnedRows(a))==null?void 0:n.map(i=>{let{id:l}=i;return l});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(i=>!o.includes(i.column.id))},Ht(t.options,"debugRows")),e.getLeftVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ht(t.options,"debugRows")),e.getRightVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ht(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?nD():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:nD())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),Ht(e.options,"debugColumns")),e.getRightLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),Ht(e.options,"debugColumns")),e.getCenterLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},Ht(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?rD():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:rD())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=Bt(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(n??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:r}))},Ht(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Bt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},Ht(e.options,"debugRows"))}},fue={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ai("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{WT(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getFilteredSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getGroupedSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const a=e.getIsSelected();t.setRowSelection(o=>{var i;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const l={...o};return WT(l,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _I(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $T(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $T(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},WT=(e,t,n,r,a)=>{var o;const i=a.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=i.subRows)!=null&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>WT(e,l.id,n,r,a))};function aD(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(i,l){return i.map(c=>{var f;const h=_I(c,n);if(h&&(r.push(c),a[c.id]=c),(f=c.subRows)!=null&&f.length&&(c={...c,subRows:o(c.subRows)}),h)return c}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function _I(e,t){var n;return(n=t[e.id])!=null?n:!1}function $T(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(i=>{if(!(o&&!a)&&(i.getCanSelect()&&(_I(i,t)?o=!0:a=!1),i.subRows&&i.subRows.length)){const l=$T(i,t);l==="all"?o=!0:(l==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const ZT=/([0-9]+)/gm,hue=(e,t,n)=>JF(nd(e.getValue(n)).toLowerCase(),nd(t.getValue(n)).toLowerCase()),pue=(e,t,n)=>JF(nd(e.getValue(n)),nd(t.getValue(n))),mue=(e,t,n)=>BI(nd(e.getValue(n)).toLowerCase(),nd(t.getValue(n)).toLowerCase()),gue=(e,t,n)=>BI(nd(e.getValue(n)),nd(t.getValue(n))),vue=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:rBI(e.getValue(n),t.getValue(n));function BI(e,t){return e===t?0:e>t?1:-1}function nd(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function JF(e,t){const n=e.split(ZT).filter(Boolean),r=t.split(ZT).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),i=parseInt(a,10),l=parseInt(o,10),c=[i,l].sort();if(isNaN(c[0])){if(a>o)return 1;if(o>a)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return n.length-r.length}const fp={alphanumeric:hue,alphanumericCaseSensitive:pue,text:mue,textCaseSensitive:gue,datetime:vue,basic:yue},wue={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ai("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a==null?void 0:a.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return fp.datetime;if(typeof o=="string"&&(r=!0,o.split(ZT).length>1))return fp.alphanumeric}return r?fp.text:fp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Jw(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:fp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(w=>w.id===e.id),c=i==null?void 0:i.findIndex(w=>w.id===e.id);let f=[],h,g=o?n:a==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?l?h="toggle":h="add":i!=null&&i.length&&c!==i.length-1?h="replace":l?h="toggle":h="replace",h==="toggle"&&(o||a||(h="remove")),h==="add"){var y;f=[...i,{id:e.id,desc:g}],f.splice(0,f.length-((y=t.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else h==="toggle"?f=i.map(w=>w.id===e.id?{...w,desc:g}:w):h==="remove"?f=i.filter(w=>w.id!==e.id):f=[{id:e.id,desc:g}];return f})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,a;const o=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!1:i==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(a=>a.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},bue={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ai("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const a=e.columns;return(n=a.length?a.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Bt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ht(t.options,"debugRows")),e.getVisibleCells=Bt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],Ht(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Bt(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ht(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((a,o)=>({...a,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $g(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const S3=[Zle,bue,uue,due,Kle,wue,sue,Jle,cue,fue,qle];function Sue(e){var t;e.debugAll||e.debugTable;let n={_features:S3};const r=n._features.reduce((h,g)=>Object.assign(h,g.getDefaultOptions==null?void 0:g.getDefaultOptions(n)),{}),a=h=>n.options.mergeOptions?n.options.mergeOptions(r,h):{...r,...h};let i={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(h=>{var g;i=(g=h.getInitialState==null?void 0:h.getInitialState(i))!=null?g:i});const l=[];let c=!1;const f={_features:S3,options:{...r,...e},initialState:i,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{n.setState(n.initialState)},setOptions:h=>{const g=Kc(h,n.options);n.options=a(g)},getState:()=>n.options.state,setState:h=>{n.options.onStateChange==null||n.options.onStateChange(h)},_getRowId:(h,g,y)=>{var w;return(w=n.options.getRowId==null?void 0:n.options.getRowId(h,g,y))!=null?w:`${y?[y.id,g].join("."):g}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(h,g)=>{let y=(g?n.getPrePaginationRowModel():n.getRowModel()).rowsById[h];if(!y&&(y=n.getCoreRowModel().rowsById[h],!y))throw new Error;return y},_getDefaultColumnDef:Bt(()=>[n.options.defaultColumn],h=>{var g;return h=(g=h)!=null?g:{},{header:y=>{const w=y.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:y=>{var w,S;return(w=(S=y.renderValue())==null||S.toString==null?void 0:S.toString())!=null?w:null},...n._features.reduce((y,w)=>Object.assign(y,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...h}},Ht(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:Bt(()=>[n._getColumnDefs()],h=>{const g=function(y,w,S){return S===void 0&&(S=0),y.map(D=>{const I=$le(n,D,S,w),M=D;return I.columns=M.columns?g(M.columns,I,S+1):[],I})};return g(h)},Ht(e,"debugColumns")),getAllFlatColumns:Bt(()=>[n.getAllColumns()],h=>h.flatMap(g=>g.getFlatColumns()),Ht(e,"debugColumns")),_getAllFlatColumnsById:Bt(()=>[n.getAllFlatColumns()],h=>h.reduce((g,y)=>(g[y.id]=y,g),{}),Ht(e,"debugColumns")),getAllLeafColumns:Bt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(h,g)=>{let y=h.flatMap(w=>w.getLeafColumns());return g(y)},Ht(e,"debugColumns")),getColumn:h=>n._getAllFlatColumnsById()[h]};Object.assign(n,f);for(let h=0;h{var i;return(i=o.getValue())!=null?i:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:a,getContext:Bt(()=>[e,n,t,o],(i,l,c,f)=>({table:i,column:l,row:c,cell:f,getValue:f.getValue,renderValue:f.renderValue}),Ht(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(o,n,t,e)},{}),o}const HI=(e,t,n,r,a,o,i)=>{let l={id:t,index:r,original:n,depth:a,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const f=e.getColumn(c);if(f!=null&&f.accessorFn)return l._valuesCache[c]=f.accessorFn(l.original,r),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const f=e.getColumn(c);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=f.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var f;return(f=l.getValue(c))!=null?f:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>Wle(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],f=l;for(;;){const h=f.getParentRow();if(!h)break;c.push(h),f=h}return c.reverse()},getAllCells:Bt(()=>[e.getAllLeafColumns()],c=>c.map(f=>Due(e,l,f,f.id)),Ht(e.options,"debugRows")),_getAllCellsByColumnId:Bt(()=>[l.getAllCells()],c=>c.reduce((f,h)=>(f[h.column.id]=h,f),{}),Ht(e.options,"debugRows"))};for(let c=0;cBt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,i){o===void 0&&(o=0);const l=[];for(let f=0;fe._autoResetPageIndex()))}function KF(e,t,n){return n.options.filterFromLeafRows?Iue(e,t,n):Eue(e,t,n)}function Iue(e,t,n){var r;const a=[],o={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,l=function(c,f){f===void 0&&(f=0);const h=[];for(let y=0;yBt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let y=0;y{var w;const S=e.getColumn(y.id);if(!S)return;const D=S.getFilterFn();D&&a.push({id:y.id,filterFn:D,resolvedValue:(w=D.resolveFilterValue==null?void 0:D.resolveFilterValue(y.value))!=null?w:y.value})});const i=n.map(y=>y.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());r&&l&&c.length&&(i.push("__global__"),c.forEach(y=>{var w;o.push({id:y.id,filterFn:l,resolvedValue:(w=l.resolveFilterValue==null?void 0:l.resolveFilterValue(r))!=null?w:r})}));let f,h;for(let y=0;y{w.columnFiltersMeta[D]=I})}if(o.length){for(let S=0;S{w.columnFiltersMeta[D]=I})){w.columnFilters.__global__=!0;break}}w.columnFilters.__global__!==!0&&(w.columnFilters.__global__=!1)}}const g=y=>{for(let w=0;we._autoResetPageIndex()))}function xue(){return(e,t)=>Bt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,a)=>{if(!n.rows.length||!(r!=null&&r.length)&&!a)return n;const o=[...r.map(l=>l.id).filter(l=>l!==t),a?"__global__":void 0].filter(Boolean),i=l=>{for(let c=0;cBt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oBt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const a=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof a>"u")return;let o=[a,a];for(let i=0;io[1]&&(o[1]=f)}}return o},Ht(e.options,"debugTable"))}function Nue(){return e=>Bt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],o=r.filter(c=>{var f;return(f=e.getColumn(c.id))==null?void 0:f.getCanSort()}),i={};o.forEach(c=>{const f=e.getColumn(c.id);f&&(i[c.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const l=c=>{const f=c.map(h=>({...h}));return f.sort((h,g)=>{for(let w=0;w{var g;a.push(h),(g=h.subRows)!=null&&g.length&&(h.subRows=l(h.subRows))}),f};return{rows:l(n.rows),flatRows:a,rowsById:n.rowsById}},Ht(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Aue(e){const t=[],n=r=>{var a;t.push(r),(a=r.subRows)!=null&&a.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Fue(e){return t=>Bt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:a,pageIndex:o}=n;let{rows:i,flatRows:l,rowsById:c}=r;const f=a*o,h=f+a;i=i.slice(f,h);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:l,rowsById:c}:g=Aue({rows:i,flatRows:l,rowsById:c}),g.flatRows=[];const y=w=>{g.flatRows.push(w),w.subRows.length&&w.subRows.forEach(y)};return g.rows.forEach(y),g},Ht(t.options,"debugTable"))}function D3(e,t){return e?Oue(e)?P.createElement(e,t):e:null}function Oue(e){return Pue(e)||typeof e=="function"||jue(e)}function Pue(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function jue(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Lue(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=P.useState(()=>({current:Sue(t)})),[r,a]=P.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:i=>{a(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const QF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Rue=Object.keys(QF).join("|"),_ue=new RegExp(Rue,"g");function Bue(e){return e.replace(_ue,t=>QF[t])}const Qo={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Hue(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Qo.MATCHES,!n.accessors){const i=T3(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}const a=Wue(e,n.accessors),o={rankedValue:e,rank:Qo.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let i=0;i=Qo.MATCHES?c=f:c>h&&(c=h),c=Math.min(c,h),c>=g&&c>o.rank&&(o.rank=c,o.passed=!0,o.accessorIndex=i,o.accessorThreshold=g,o.rankedValue=l.itemValue)}return o}function T3(e,t,n){return e=I3(e,n),t=I3(t,n),t.length>e.length?Qo.NO_MATCH:e===t?Qo.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Qo.EQUAL:e.startsWith(t)?Qo.STARTS_WITH:e.includes(` ${t}`)?Qo.WORD_STARTS_WITH:e.includes(t)?Qo.CONTAINS:t.length===1?Qo.NO_MATCH:Yue(e).includes(t)?Qo.ACRONYM:Uue(e,t))}function Yue(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function Uue(e,t){let n=0,r=0;function a(c,f,h){for(let g=h,y=f.length;g-1))return Qo.NO_MATCH}const l=r-i;return o(l)}function zue(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function I3(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Bue(e)),e}function Vue(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function Wue(e,t){const n=[];for(let r=0,a=t.length;rObject.assign({},Zue,e);let Jue=class extends Error{constructor(t){super(t),this.name="CsvGenerationError"}},Kue=class extends Error{constructor(t){super(t),this.name="EmptyHeadersError"}};var ey=e=>e,Us=e=>e,Jb=ey,Mp=ey,C3=ey,x3=ey,Que=function(e,t){return t=='"'&&e.indexOf('"')>-1?e.replace(/"/g,'""'):e},Xue=e=>C3(typeof e=="object"?e.key:e),ece=e=>x3(typeof e=="object"?e.displayLabel:e),tce=(e,...t)=>t.reduce((n,r)=>r(n),e),nce=e=>t=>e.useBom?Jb(Us(t)+Gue):t,rce=e=>t=>e.showTitle?YI(Jb(Us(t)+e.title))(Mp("")):t,YI=e=>t=>Jb(Us(e)+Us(t)+que),e8=e=>(t,n)=>ace(e)(Mp(t+n)),ace=e=>t=>ey(Us(t)+e.fieldSeparator),oce=(e,t)=>n=>{if(!e.showColumnHeaders)return n;if(t.length<1)throw new Kue("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");let r=Mp("");for(let a=0;ar=>{let a=r;for(var o=0;o"u"?e.replaceUndefinedWith:n[o][Us(c)];i=e8(e)(i,t8(e,f))}i=Mp(Us(i).slice(0,-1)),a=YI(a)(i)}return a},sce=Us,M3=e=>+e===e&&(!isFinite(e)||!!(e%1)),t8=(e,t)=>{if(e.decimalSeparator==="locale"&&M3(t))return t.toLocaleString();if(e.decimalSeparator!=="."&&M3(t))return t.toString().replace(".",e.decimalSeparator);if(typeof t=="string"){let n=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(` -`)>-1||t.indexOf("\r")>-1)&&(n=e.quoteCharacter+Que(t,e.quoteCharacter)+e.quoteCharacter),n}if(typeof t=="boolean"&&e.boolDisplay){const n=t?"true":"false";return e.boolDisplay[n]}return t},lce=e=>t=>{const n=XF(e),r=n.useKeysAsHeaders?Object.keys(t[0]):n.columnHeaders;let a=tce(Jb(""),nce(n),rce(n),oce(n,r),ice(n,r,t));if(Us(a).length<1)throw new Jue("Output is empty. Is your data formatted correctly?");return a};const uce=({thino:e})=>{const t=P.useRef(null);P.useEffect(()=>(t.current&&x.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=P.useCallback(async()=>{e.pinned?await we.unpinMemoById(e.id):await we.pinMemoById(e.id)},[e]);return v.jsx("span",{ref:t,className:ar("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},cce=({thino:e})=>{var r;const t=P.useRef(null);P.useEffect(()=>(t.current&&x.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=P.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const a=await we.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");a&&we.editMemo(a)},[e]);return v.jsx(v.Fragment,{children:e.thinoType!=="JOURNAL"?v.jsx("input",{className:ar("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":(r=e.thinoType)==null?void 0:r.slice(5),onClick:n}):v.jsx("span",{ref:t,className:"thino-type-status"})})},dce=({id:e,path:t})=>{const n=P.useRef(null);P.useEffect(()=>(n.current&&x.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=P.useCallback(()=>{!e||!t||we.openThinoByID(e)},[e,t]);return v.jsxs("span",{className:"source-thino",onClick:r,children:[v.jsx("span",{children:t}),v.jsx("span",{ref:n,className:"source-thino-icon"})]})},fce=({id:e,sourceType:t})=>{const n=P.useRef(null);P.useEffect(()=>{var a;return n.current&&x.setIcon(n.current,((a=Qg.find(o=>o.title===t))==null?void 0:a.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=P.useCallback(async()=>{e&&await we.openThinoByID(e)},[e]);return v.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},k3=(e,t,n,r)=>{const a=Hue(e.getValue(t),n);return r({itemRank:a}),a.passed},N3=(e,t,n)=>{var a,o;let r=0;return e.columnFiltersMeta[n]&&(r=zue((a=e.columnFiltersMeta[n])==null?void 0:a.itemRank,(o=t.columnFiltersMeta[n])==null?void 0:o.itemRank)),r===0?fp.alphanumeric(e,t,n):r},hce=XF({fieldSeparator:",",decimalSeparator:".",useKeysAsHeaders:!0}),pce=e=>e+` -`;function mce({thinos:e,isFiltering:t}){var w;ne.useReducer(()=>({}),{})[1];const[n,r]=ne.useState([]),[a,o]=ne.useState(""),i=ne.useMemo(()=>[{header:E("Basic Info"),footer:S=>S.column.id,columns:[{accessorKey:"createdAt",header:()=>v.jsx("span",{className:"create-at-header-cell",children:E("Created At")}),cell:S=>S.getValue(),footer:S=>S.column.id,enableColumnFilter:!1},{accessorFn:S=>S.content,id:"content",header:()=>v.jsx("span",{className:"thino-header-cell",children:E("Thino")}),cell:S=>v.jsx(ai,{memo:S.row.original,type:"table"}),footer:S=>S.column.id,filterFn:"fuzzy",sortingFn:N3},{accessorFn:S=>S.thinoType,id:"thinoType",cell:S=>v.jsx(cce,{thino:S.row.original}),header:()=>v.jsx("span",{children:E("Thino Type")}),footer:S=>S.column.id},{accessorFn:S=>S.sourceType,id:"sourceType",cell:S=>v.jsx(fce,{id:S.row.original.id,sourceType:S.getValue()}),header:()=>v.jsx("span",{children:E("Source Type")}),footer:S=>S.column.id}]},{header:E("Additional Info"),footer:S=>S.column.id,columns:[{accessorKey:"pinned",header:()=>v.jsx("span",{children:E("Pinned Status")}),cell:S=>v.jsx(uce,{thino:S.row.original}),footer:S=>S.column.id,filterFn:"fuzzy",sortingFn:N3},{accessorKey:"rowStatus",header:()=>v.jsx("span",{children:E("Row status")}),cell:S=>v.jsx("span",{children:S.getValue()==="NORMAL"?"":S.getValue()}),footer:S=>S.column.id},{accessorKey:"path",header:()=>E("Path"),cell:S=>v.jsx(dce,{id:S.row.original.id,path:S.getValue()}),footer:S=>S.column.id}]}],[]),[l,c]=ne.useState(()=>e),f=()=>c(S=>e);P.useEffect(()=>{f()},[e]);const h=Lue({data:l,columns:i,filterFns:{fuzzy:k3},initialState:{pagination:{pageSize:20}},state:{columnFilters:n,globalFilter:a},onColumnFiltersChange:r,onGlobalFilterChange:o,globalFilterFn:k3,getCoreRowModel:Tue(),getFilteredRowModel:Cue(),getSortedRowModel:Nue(),getPaginationRowModel:Fue(),getFacetedRowModel:xue(),getFacetedUniqueValues:Mue(),getFacetedMinMaxValues:kue(),debugTable:!1,debugHeaders:!1,debugColumns:!1});ne.useEffect(()=>{var S,D;((S=h.getState().columnFilters[0])==null?void 0:S.id)==="createdAt"&&((D=h.getState().sorting[0])==null?void 0:D.id)!=="createdAt"&&h.setSorting([{id:"createdAt",desc:!1}])},[(w=h.getState().columnFilters[0])==null?void 0:w.id]);async function g(S,D){const I=E("Created At"),M=E("Updated At"),N=E("Content"),_=E("Path"),k=S.map(Y=>({[I]:Y.createdAt,[M]:Y.updatedAt,[N]:Y.content,Thino:`=hyperlink("obsidian://thino?openId=${Y.id}","${Y.id}")`,[_]:`=hyperlink("obsidian://open?path=${x.normalizePath(Y.path)},"${Y.path}")`})),B=lce(hce)(k),L=ft.getState().app||window.app,R=pce(sce(B));return{file:await L.vault.create(`${D}-${ut.randomId(6)}.csv`,R),app:L}}async function y(S){const{file:D,app:I}=await g(S.map(_=>_.original),"thino-export"),M=document.createDocumentFragment(),N=M.createEl("div",{cls:"export-file-btn-group"});M.createEl("div",{cls:"open-file-button"}),new x.Setting(N).setName(E("Exported CSV file")).addButton(_=>{_.setButtonText(E("Open File")).onClick(()=>{const k=x.normalizePath(D.path);I.openWithDefaultApp(k)})}),new x.Notice(M)}return v.jsxs("div",{className:"table-view",children:[v.jsxs("div",{children:[v.jsx(mw,{value:a||"",onChange:S=>o(String(S)),className:"table-search-bar",placeholder:E("Search all columns...")}),x.Platform.isDesktop&&(a||n.length>0||t)&&v.jsx("button",{className:"mod-cta",disabled:h.getPrePaginationRowModel().rows.length===0,onClick:()=>y(h.getPrePaginationRowModel().rows),children:E("Export to CSV")})]}),v.jsxs("table",{className:"thino-table",children:[v.jsx("thead",{children:h.getHeaderGroups().map(S=>v.jsx("tr",{children:S.headers.map(D=>v.jsx("th",{colSpan:D.colSpan,children:D.isPlaceholder?null:v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ar(D.column.getCanSort()?"filter-header":"","table-header",D.column.id==="content"?"content-header":""),onClick:D.column.getToggleSortingHandler(),children:[D3(D.column.columnDef.header,D.getContext()),{asc:" 🔼",desc:" 🔽"}[D.column.getIsSorted()]??null]}),D.column.getCanFilter()?v.jsx(vce,{column:D.column,table:h}):null]})},D.id))},S.id))}),v.jsx("tbody",{children:h.getRowModel().rows.map(S=>v.jsx("tr",{className:ar(S.getValue("pinned")?"pinned":""),children:S.getVisibleCells().map(D=>v.jsx("td",{children:D3(D.column.columnDef.cell,D.getContext())},D.id))},S.id))})]}),v.jsxs("div",{className:"table-nav-bar",children:[v.jsx("button",{className:"prev-start-btn",onClick:()=>h.setPageIndex(0),disabled:!h.getCanPreviousPage(),children:"<<"}),v.jsx("button",{className:"prev-btn",onClick:()=>h.previousPage(),disabled:!h.getCanPreviousPage(),children:"<"}),v.jsx("button",{className:"next-btn",onClick:()=>h.nextPage(),disabled:!h.getCanNextPage(),children:">"}),v.jsx("button",{className:"next-end-btn",onClick:()=>h.setPageIndex(h.getPageCount()-1),disabled:!h.getCanNextPage(),children:">>"}),v.jsxs("span",{className:"table-page-info",children:[v.jsx("div",{children:E("Page")}),v.jsxs("strong",{children:[h.getState().pagination.pageIndex+1," of ",h.getPageCount()]})]}),v.jsxs("span",{className:"table-page-jump",children:["| ",E("Go to page"),":",v.jsx("input",{type:"number",defaultValue:h.getState().pagination.pageIndex+1,onChange:S=>{const D=S.target.value?Number(S.target.value)-1:0;h.setPageIndex(D)},className:"jump-inputer"})]}),v.jsx("select",{value:h.getState().pagination.pageSize,onChange:S=>{h.setPageSize(Number(S.target.value))},children:[10,20,30,40,50].map(S=>v.jsxs("option",{value:S,children:[E("Show")," ",S," ",E("rows")]},S))})]})]})}const gce=e=>e==="sourceType"?["ALL"]:["ALL","ALL-TASK"];function vce({column:e,table:t}){var o,i,l,c,f,h,g,y,w;const n=(o=t.getPreFilteredRowModel().flatRows[0])==null?void 0:o.getValue(e.id),r=e.getFilterValue(),a=ne.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?v.jsx("div",{children:v.jsxs("div",{className:"filter-input-group",children:[v.jsx(mw,{type:"number",min:Number(((i=e.getFacetedMinMaxValues())==null?void 0:i[0])??""),max:Number(((l=e.getFacetedMinMaxValues())==null?void 0:l[1])??""),value:(r==null?void 0:r[0])??"",onChange:S=>e.setFilterValue(D=>[S,D==null?void 0:D[1]]),placeholder:`Min ${(c=e.getFacetedMinMaxValues())!=null&&c[0]?`(${(f=e.getFacetedMinMaxValues())==null?void 0:f[0]})`:""}`,className:"filter-input-short"}),v.jsx(mw,{type:"number",min:Number(((h=e.getFacetedMinMaxValues())==null?void 0:h[0])??""),max:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[1])??""),value:(r==null?void 0:r[1])??"",onChange:S=>e.setFilterValue(D=>[D==null?void 0:D[0],S]),placeholder:`Max ${(y=e.getFacetedMinMaxValues())!=null&&y[1]?`(${(w=e.getFacetedMinMaxValues())==null?void 0:w[1]})`:""}`,className:"filter-input-short"})]})}):v.jsx(v.Fragment,{children:a.length>1?v.jsxs(v.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&e.id!=="thinoType"&&e.id!=="sourceType"&&v.jsx("datalist",{id:e.id+"list",children:a.slice(0,5e3).map(S=>v.jsx("option",{value:S},S))}),e.id==="thinoType"||e.id==="sourceType"?v.jsx("select",{id:e.id,onChange:S=>e.setFilterValue(S.target.value==="ALL"?"":S.target.value==="ALL-TASK"?"TASK":S.target.value),children:[...gce(e.id),...a].map(S=>v.jsx("option",{value:S,children:E(S)||S},S))}):"",e.id!=="thinoType"&&e.id!=="sourceType"?v.jsx(mw,{type:"text",value:r??"",onChange:S=>e.setFilterValue(S),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"}):""]}):""})}function mw({value:e,onChange:t,debounce:n=500,...r}){const[a,o]=ne.useState(e);return ne.useEffect(()=>{o(e)},[e]),ne.useEffect(()=>{const i=setTimeout(()=>{t(a)},n);return()=>clearTimeout(i)},[a]),v.jsx("input",{...r,value:a,onChange:i=>o(i.target.value)})}function yce(e,t){try{var n=global,r=n.document;if(typeof r<"u"&&r.createElement&&r.head&&r.head.appendChild){var a=r.querySelector('html meta[name="'.concat(encodeURI(e),'"]'))||r.createElement("meta");a.setAttribute("name",e),a.setAttribute("content",t),r.head.appendChild(a)}}catch{}}function wce(){yce("react-scroll-to-bottom:version","4.2.0")}var Eg=function(e){return e&&e.Math===Math&&e},Za=Eg(typeof globalThis=="object"&&globalThis)||Eg(typeof window=="object"&&window)||Eg(typeof self=="object"&&self)||Eg(typeof dr=="object"&&dr)||Eg(typeof dr=="object"&&dr)||function(){return this}()||Function("return this")(),da=function(e){try{return!!e()}catch{return!0}},bce=da,Kb=!bce(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Sce=Kb,n8=Function.prototype,A3=n8.apply,F3=n8.call,UI=typeof Reflect=="object"&&Reflect.apply||(Sce?F3.bind(A3):function(){return F3.apply(A3,arguments)}),r8=Kb,a8=Function.prototype,qT=a8.call,Dce=r8&&a8.bind.bind(qT,qT),fa=r8?Dce:function(e){return function(){return qT.apply(e,arguments)}},o8=fa,Tce=o8({}.toString),Ice=o8("".slice),tm=function(e){return Ice(Tce(e),8,-1)},Ece=tm,Cce=fa,zI=function(e){if(Ece(e)==="Function")return Cce(e)},oD=typeof document=="object"&&document.all,co=typeof oD>"u"&&oD!==void 0?function(e){return typeof e=="function"||e===oD}:function(e){return typeof e=="function"},ty={},xce=da,ii=!xce(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Mce=Kb,_0=Function.prototype.call,ru=Mce?_0.bind(_0):function(){return _0.apply(_0,arguments)},VI={},i8={}.propertyIsEnumerable,s8=Object.getOwnPropertyDescriptor,kce=s8&&!i8.call({1:2},1);VI.f=kce?function(t){var n=s8(this,t);return!!n&&n.enumerable}:i8;var ny=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Nce=fa,Ace=da,Fce=tm,iD=Object,Oce=Nce("".split),l8=Ace(function(){return!iD("z").propertyIsEnumerable(0)})?function(e){return Fce(e)==="String"?Oce(e,""):iD(e)}:iD,WI=function(e){return e==null},Pce=WI,jce=TypeError,$I=function(e){if(Pce(e))throw new jce("Can't call method on "+e);return e},Lce=l8,Rce=$I,au=function(e){return Lce(Rce(e))},_ce=co,Xu=function(e){return typeof e=="object"?e!==null:_ce(e)},qa={},sD=qa,lD=Za,Bce=co,O3=function(e){return Bce(e)?e:void 0},ou=function(e,t){return arguments.length<2?O3(sD[e])||O3(lD[e]):sD[e]&&sD[e][t]||lD[e]&&lD[e][t]},Hce=fa,ec=Hce({}.isPrototypeOf),u8=typeof navigator<"u"&&String(navigator.userAgent)||"",c8=Za,uD=u8,P3=c8.process,j3=c8.Deno,L3=P3&&P3.versions||j3&&j3.version,R3=L3&&L3.v8,Rs,Kw;R3&&(Rs=R3.split("."),Kw=Rs[0]>0&&Rs[0]<4?1:+(Rs[0]+Rs[1]));!Kw&&uD&&(Rs=uD.match(/Edge\/(\d+)/),(!Rs||Rs[1]>=74)&&(Rs=uD.match(/Chrome\/(\d+)/),Rs&&(Kw=+Rs[1])));var ZI=Kw,_3=ZI,Yce=da,Uce=Za,zce=Uce.String,nm=!!Object.getOwnPropertySymbols&&!Yce(function(){var e=Symbol("symbol detection");return!zce(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_3&&_3<41}),Vce=nm,d8=Vce&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Wce=ou,$ce=co,Zce=ec,qce=d8,Gce=Object,ry=qce?function(e){return typeof e=="symbol"}:function(e){var t=Wce("Symbol");return $ce(t)&&Zce(t.prototype,Gce(e))},Jce=String,Qb=function(e){try{return Jce(e)}catch{return"Object"}},Kce=co,Qce=Qb,Xce=TypeError,qI=function(e){if(Kce(e))return e;throw new Xce(Qce(e)+" is not a function")},ede=qI,tde=WI,GI=function(e,t){var n=e[t];return tde(n)?void 0:ede(n)},cD=ru,dD=co,fD=Xu,nde=TypeError,rde=function(e,t){var n,r;if(t==="string"&&dD(n=e.toString)&&!fD(r=cD(n,e))||dD(n=e.valueOf)&&!fD(r=cD(n,e))||t!=="string"&&dD(n=e.toString)&&!fD(r=cD(n,e)))return r;throw new nde("Can't convert object to primitive value")},f8={exports:{}},B3=Za,ade=Object.defineProperty,ode=function(e,t){try{ade(B3,e,{value:t,configurable:!0,writable:!0})}catch{B3[e]=t}return t},ide=Za,sde=ode,H3="__core-js_shared__",Y3=f8.exports=ide[H3]||sde(H3,{});(Y3.versions||(Y3.versions=[])).push({version:"3.37.0",mode:"pure",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var JI=f8.exports,U3=JI,rm=function(e,t){return U3[e]||(U3[e]=t||{})},lde=$I,ude=Object,tc=function(e){return ude(lde(e))},cde=fa,dde=tc,fde=cde({}.hasOwnProperty),Fi=Object.hasOwn||function(t,n){return fde(dde(t),n)},hde=fa,pde=0,mde=Math.random(),gde=hde(1 .toString),KI=function(e){return"Symbol("+(e===void 0?"":e)+")_"+gde(++pde+mde,36)},vde=Za,yde=rm,z3=Fi,wde=KI,bde=nm,Sde=d8,mp=vde.Symbol,hD=yde("wks"),Dde=Sde?mp.for||mp:mp&&mp.withoutSetter||wde,Na=function(e){return z3(hD,e)||(hD[e]=bde&&z3(mp,e)?mp[e]:Dde("Symbol."+e)),hD[e]},Tde=ru,V3=Xu,W3=ry,Ide=GI,Ede=rde,Cde=Na,xde=TypeError,Mde=Cde("toPrimitive"),kde=function(e,t){if(!V3(e)||W3(e))return e;var n=Ide(e,Mde),r;if(n){if(t===void 0&&(t="default"),r=Tde(n,e,t),!V3(r)||W3(r))return r;throw new xde("Can't convert object to primitive value")}return t===void 0&&(t="number"),Ede(e,t)},Nde=kde,Ade=ry,QI=function(e){var t=Nde(e,"string");return Ade(t)?t:t+""},Fde=Za,$3=Xu,GT=Fde.document,Ode=$3(GT)&&$3(GT.createElement),h8=function(e){return Ode?GT.createElement(e):{}},Pde=ii,jde=da,Lde=h8,p8=!Pde&&!jde(function(){return Object.defineProperty(Lde("div"),"a",{get:function(){return 7}}).a!==7}),Rde=ii,_de=ru,Bde=VI,Hde=ny,Yde=au,Ude=QI,zde=Fi,Vde=p8,Z3=Object.getOwnPropertyDescriptor;ty.f=Rde?Z3:function(t,n){if(t=Yde(t),n=Ude(n),Vde)try{return Z3(t,n)}catch{}if(zde(t,n))return Hde(!_de(Bde.f,t,n),t[n])};var Wde=da,$de=co,Zde=/#|\.prototype\./,ay=function(e,t){var n=Gde[qde(e)];return n===Kde?!0:n===Jde?!1:$de(t)?Wde(t):!!t},qde=ay.normalize=function(e){return String(e).replace(Zde,".").toLowerCase()},Gde=ay.data={},Jde=ay.NATIVE="N",Kde=ay.POLYFILL="P",Qde=ay,q3=zI,Xde=qI,efe=Kb,tfe=q3(q3.bind),XI=function(e,t){return Xde(e),t===void 0?e:efe?tfe(e,t):function(){return e.apply(t,arguments)}},$s={},nfe=ii,rfe=da,m8=nfe&&rfe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),afe=Xu,ofe=String,ife=TypeError,ld=function(e){if(afe(e))return e;throw new ife(ofe(e)+" is not an object")},sfe=ii,lfe=p8,ufe=m8,B0=ld,G3=QI,cfe=TypeError,pD=Object.defineProperty,dfe=Object.getOwnPropertyDescriptor,mD="enumerable",gD="configurable",vD="writable";$s.f=sfe?ufe?function(t,n,r){if(B0(t),n=G3(n),B0(r),typeof t=="function"&&n==="prototype"&&"value"in r&&vD in r&&!r[vD]){var a=dfe(t,n);a&&a[vD]&&(t[n]=r.value,r={configurable:gD in r?r[gD]:a[gD],enumerable:mD in r?r[mD]:a[mD],writable:!1})}return pD(t,n,r)}:pD:function(t,n,r){if(B0(t),n=G3(n),B0(r),lfe)try{return pD(t,n,r)}catch{}if("get"in r||"set"in r)throw new cfe("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var ffe=ii,hfe=$s,pfe=ny,Xb=ffe?function(e,t,n){return hfe.f(e,t,pfe(1,n))}:function(e,t,n){return e[t]=n,e},Cg=Za,mfe=UI,gfe=zI,vfe=co,yfe=ty.f,wfe=Qde,op=qa,bfe=XI,ip=Xb,J3=Fi,Sfe=function(e){var t=function(n,r,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,a)}return mfe(e,this,arguments)};return t.prototype=e.prototype,t},Gn=function(e,t){var n=e.target,r=e.global,a=e.stat,o=e.proto,i=r?Cg:a?Cg[n]:Cg[n]&&Cg[n].prototype,l=r?op:op[n]||ip(op,n,{})[n],c=l.prototype,f,h,g,y,w,S,D,I,M;for(y in t)f=wfe(r?y:n+(a?".":"#")+y,e.forced),h=!f&&i&&J3(i,y),S=l[y],h&&(e.dontCallGetSet?(M=yfe(i,y),D=M&&M.value):D=i[y]),w=h&&D?D:t[y],!(!f&&!o&&typeof S==typeof w)&&(e.bind&&h?I=bfe(w,Cg):e.wrap&&h?I=Sfe(w):o&&vfe(w)?I=gfe(w):I=w,(e.sham||w&&w.sham||S&&S.sham)&&ip(I,"sham",!0),ip(l,y,I),o&&(g=n+"Prototype",J3(op,g)||ip(op,g,{}),ip(op[g],y,w),e.real&&c&&(f||!c[y])&&ip(c,y,w)))},Dfe=tm,am=Array.isArray||function(t){return Dfe(t)==="Array"},Tfe=Gn,Ife=am;Tfe({target:"Array",stat:!0},{isArray:Ife});var Efe=qa,Cfe=Efe.Array.isArray,xfe=Cfe,g8=xfe,Mfe=g8,kfe=Mfe,Nfe=kfe,Afe=Nfe,Ffe=Afe;const v8=qt(Ffe);function Ofe(e){if(v8(e))return e}var Pfe=Math.ceil,jfe=Math.floor,Lfe=Math.trunc||function(t){var n=+t;return(n>0?jfe:Pfe)(n)},Rfe=Lfe,e1=function(e){var t=+e;return t!==t||t===0?0:Rfe(t)},_fe=e1,Bfe=Math.min,Hfe=function(e){var t=_fe(e);return t>0?Bfe(t,9007199254740991):0},Yfe=Hfe,jf=function(e){return Yfe(e.length)},Ufe=TypeError,zfe=9007199254740991,eE=function(e){if(e>zfe)throw Ufe("Maximum allowed index exceeded");return e},Vfe=ii,Wfe=$s,$fe=ny,oy=function(e,t,n){Vfe?Wfe.f(e,t,$fe(0,n)):e[t]=n},Zfe=Na,qfe=Zfe("toStringTag"),y8={};y8[qfe]="z";var tE=String(y8)==="[object z]",Gfe=tE,Jfe=co,gw=tm,Kfe=Na,Qfe=Kfe("toStringTag"),Xfe=Object,ehe=gw(function(){return arguments}())==="Arguments",the=function(e,t){try{return e[t]}catch{}},iy=Gfe?gw:function(e){var t,n,r;return e===void 0?"Undefined":e===null?"Null":typeof(n=the(t=Xfe(e),Qfe))=="string"?n:ehe?gw(t):(r=gw(t))==="Object"&&Jfe(t.callee)?"Arguments":r},nhe=fa,rhe=co,JT=JI,ahe=nhe(Function.toString);rhe(JT.inspectSource)||(JT.inspectSource=function(e){return ahe(e)});var ohe=JT.inspectSource,ihe=fa,she=da,w8=co,lhe=iy,uhe=ou,che=ohe,b8=function(){},S8=uhe("Reflect","construct"),nE=/^\s*(?:class|function)\b/,dhe=ihe(nE.exec),fhe=!nE.test(b8),xg=function(t){if(!w8(t))return!1;try{return S8(b8,[],t),!0}catch{return!1}},D8=function(t){if(!w8(t))return!1;switch(lhe(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return fhe||!!dhe(nE,che(t))}catch{return!0}};D8.sham=!0;var rE=!S8||she(function(){var e;return xg(xg.call)||!xg(Object)||!xg(function(){e=!0})||e})?D8:xg,K3=am,hhe=rE,phe=Xu,mhe=Na,ghe=mhe("species"),Q3=Array,vhe=function(e){var t;return K3(e)&&(t=e.constructor,hhe(t)&&(t===Q3||K3(t.prototype))?t=void 0:phe(t)&&(t=t[ghe],t===null&&(t=void 0))),t===void 0?Q3:t},yhe=vhe,aE=function(e,t){return new(yhe(e))(t===0?0:t)},whe=da,bhe=Na,She=ZI,Dhe=bhe("species"),t1=function(e){return She>=51||!whe(function(){var t=[],n=t.constructor={};return n[Dhe]=function(){return{foo:1}},t[e](Boolean).foo!==1})},The=Gn,Ihe=da,Ehe=am,Che=Xu,xhe=tc,Mhe=jf,X3=eE,ek=oy,khe=aE,Nhe=t1,Ahe=Na,Fhe=ZI,T8=Ahe("isConcatSpreadable"),Ohe=Fhe>=51||!Ihe(function(){var e=[];return e[T8]=!1,e.concat()[0]!==e}),Phe=function(e){if(!Che(e))return!1;var t=e[T8];return t!==void 0?!!t:Ehe(e)},jhe=!Ohe||!Nhe("concat");The({target:"Array",proto:!0,arity:1,forced:jhe},{concat:function(t){var n=xhe(this),r=khe(n,0),a=0,o,i,l,c,f;for(o=-1,l=arguments.length;oi;)if(l=a[i++],l!==l)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===n)return e||i||0;return!e&&-1}},I8={includes:tk(!0),indexOf:tk(!1)},r1={},Vhe=fa,yD=Fi,Whe=au,$he=I8.indexOf,Zhe=r1,nk=Vhe([].push),E8=function(e,t){var n=Whe(e),r=0,a=[],o;for(o in n)!yD(Zhe,o)&&yD(n,o)&&nk(a,o);for(;t.length>r;)yD(n,o=t[r++])&&(~$he(a,o)||nk(a,o));return a},iE=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qhe=E8,Ghe=iE,sE=Object.keys||function(t){return qhe(t,Ghe)},Jhe=ii,Khe=m8,Qhe=$s,Xhe=ld,epe=au,tpe=sE;n1.f=Jhe&&!Khe?Object.defineProperties:function(t,n){Xhe(t);for(var r=epe(n),a=tpe(n),o=a.length,i=0,l;o>i;)Qhe.f(t,l=a[i++],r[l]);return t};var npe=ou,rpe=npe("document","documentElement"),ape=rm,ope=KI,rk=ape("keys"),a1=function(e){return rk[e]||(rk[e]=ope(e))},ipe=ld,spe=n1,ak=iE,lpe=r1,upe=rpe,cpe=h8,dpe=a1,ok=">",ik="<",KT="prototype",QT="script",C8=dpe("IE_PROTO"),wD=function(){},x8=function(e){return ik+QT+ok+e+ik+"/"+QT+ok},sk=function(e){e.write(x8("")),e.close();var t=e.parentWindow.Object;return e=null,t},fpe=function(){var e=cpe("iframe"),t="java"+QT+":",n;return e.style.display="none",upe.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(x8("document.F=Object")),n.close(),n.F},H0,vw=function(){try{H0=new ActiveXObject("htmlfile")}catch{}vw=typeof document<"u"?document.domain&&H0?sk(H0):fpe():sk(H0);for(var e=ak.length;e--;)delete vw[KT][ak[e]];return vw()};lpe[C8]=!0;var lE=Object.create||function(t,n){var r;return t!==null?(wD[KT]=ipe(t),r=new wD,wD[KT]=null,r[C8]=t):r=vw(),n===void 0?r:spe.f(r,n)},o1={},hpe=E8,ppe=iE,mpe=ppe.concat("length","prototype");o1.f=Object.getOwnPropertyNames||function(t){return hpe(t,mpe)};var M8={},gpe=fa,i1=gpe([].slice),vpe=tm,ype=au,k8=o1.f,wpe=i1,N8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],bpe=function(e){try{return k8(e)}catch{return wpe(N8)}};M8.f=function(t){return N8&&vpe(t)==="Window"?bpe(t):k8(ype(t))};var s1={};s1.f=Object.getOwnPropertySymbols;var Spe=Xb,l1=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Spe(e,t,n),e},Dpe=$s,Tpe=function(e,t,n){return Dpe.f(e,t,n)},ly={},Ipe=Na;ly.f=Ipe;var lk=qa,Epe=Fi,Cpe=ly,xpe=$s.f,Ir=function(e){var t=lk.Symbol||(lk.Symbol={});Epe(t,e)||xpe(t,e,{value:Cpe.f(e)})},Mpe=ru,kpe=ou,Npe=Na,Ape=l1,A8=function(){var e=kpe("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=Npe("toPrimitive");t&&!t[r]&&Ape(t,r,function(a){return Mpe(n,this)},{arity:1})},Fpe=tE,Ope=iy,Ppe=Fpe?{}.toString:function(){return"[object "+Ope(this)+"]"},jpe=tE,Lpe=$s.f,Rpe=Xb,_pe=Fi,Bpe=Ppe,Hpe=Na,uk=Hpe("toStringTag"),om=function(e,t,n,r){var a=n?e:e&&e.prototype;a&&(_pe(a,uk)||Lpe(a,uk,{configurable:!0,value:t}),r&&!jpe&&Rpe(a,"toString",Bpe))},Ype=Za,Upe=co,ck=Ype.WeakMap,zpe=Upe(ck)&&/native code/.test(String(ck)),Vpe=zpe,F8=Za,Wpe=Xu,$pe=Xb,bD=Fi,SD=JI,Zpe=a1,qpe=r1,dk="Object already initialized",XT=F8.TypeError,Gpe=F8.WeakMap,Qw,gv,Xw,Jpe=function(e){return Xw(e)?gv(e):Qw(e,{})},Kpe=function(e){return function(t){var n;if(!Wpe(t)||(n=gv(t)).type!==e)throw new XT("Incompatible receiver, "+e+" required");return n}};if(Vpe||SD.state){var Fl=SD.state||(SD.state=new Gpe);Fl.get=Fl.get,Fl.has=Fl.has,Fl.set=Fl.set,Qw=function(e,t){if(Fl.has(e))throw new XT(dk);return t.facade=e,Fl.set(e,t),t},gv=function(e){return Fl.get(e)||{}},Xw=function(e){return Fl.has(e)}}else{var sp=Zpe("state");qpe[sp]=!0,Qw=function(e,t){if(bD(e,sp))throw new XT(dk);return t.facade=e,$pe(e,sp,t),t},gv=function(e){return bD(e,sp)?e[sp]:{}},Xw=function(e){return bD(e,sp)}}var uE={set:Qw,get:gv,has:Xw,enforce:Jpe,getterFor:Kpe},Qpe=XI,Xpe=fa,eme=l8,tme=tc,nme=jf,rme=aE,fk=Xpe([].push),$c=function(e){var t=e===1,n=e===2,r=e===3,a=e===4,o=e===6,i=e===7,l=e===5||o;return function(c,f,h,g){for(var y=tme(c),w=eme(y),S=nme(w),D=Qpe(f,h),I=0,M=g||rme,N=t?M(c,S):n||i?M(c,0):void 0,_,k;S>I;I++)if((l||I in w)&&(_=w[I],k=D(_,I,y),e))if(t)N[I]=k;else if(k)switch(e){case 3:return!0;case 5:return _;case 6:return I;case 2:fk(N,_)}else switch(e){case 4:return!1;case 7:fk(N,_)}return o?-1:r||a?a:N}},cE={forEach:$c(0),map:$c(1),filter:$c(2),some:$c(3),every:$c(4),find:$c(5),findIndex:$c(6),filterReject:$c(7)},u1=Gn,uy=Za,dE=ru,ame=fa,kp=ii,Np=nm,ome=da,xa=Fi,ime=ec,e2=ld,c1=au,fE=QI,sme=sy,t2=ny,Ap=lE,O8=sE,lme=o1,P8=M8,ume=s1,j8=ty,L8=$s,cme=n1,R8=VI,hk=l1,dme=Tpe,hE=rm,fme=a1,_8=r1,pk=KI,hme=Na,pme=ly,mme=Ir,gme=A8,vme=om,B8=uE,d1=cE.forEach,Xo=fme("hidden"),f1="Symbol",vv="prototype",yme=B8.set,mk=B8.getterFor(f1),Hs=Object[vv],vf=uy.Symbol,Bg=vf&&vf[vv],wme=uy.RangeError,bme=uy.TypeError,DD=uy.QObject,H8=j8.f,yf=L8.f,Y8=P8.f,Sme=R8.f,U8=ame([].push),Zu=hE("symbols"),cy=hE("op-symbols"),Dme=hE("wks"),n2=!DD||!DD[vv]||!DD[vv].findChild,z8=function(e,t,n){var r=H8(Hs,t);r&&delete Hs[t],yf(e,t,n),r&&e!==Hs&&yf(Hs,t,r)},r2=kp&&ome(function(){return Ap(yf({},"a",{get:function(){return yf(this,"a",{value:7}).a}})).a!==7})?z8:yf,TD=function(e,t){var n=Zu[e]=Ap(Bg);return yme(n,{type:f1,tag:e,description:t}),kp||(n.description=t),n},h1=function(t,n,r){t===Hs&&h1(cy,n,r),e2(t);var a=fE(n);return e2(r),xa(Zu,a)?(r.enumerable?(xa(t,Xo)&&t[Xo][a]&&(t[Xo][a]=!1),r=Ap(r,{enumerable:t2(0,!1)})):(xa(t,Xo)||yf(t,Xo,t2(1,Ap(null))),t[Xo][a]=!0),r2(t,a,r)):yf(t,a,r)},pE=function(t,n){e2(t);var r=c1(n),a=O8(r).concat(Z8(r));return d1(a,function(o){(!kp||dE(V8,r,o))&&h1(t,o,r[o])}),t},Tme=function(t,n){return n===void 0?Ap(t):pE(Ap(t),n)},V8=function(t){var n=fE(t),r=dE(Sme,this,n);return this===Hs&&xa(Zu,n)&&!xa(cy,n)?!1:r||!xa(this,n)||!xa(Zu,n)||xa(this,Xo)&&this[Xo][n]?r:!0},W8=function(t,n){var r=c1(t),a=fE(n);if(!(r===Hs&&xa(Zu,a)&&!xa(cy,a))){var o=H8(r,a);return o&&xa(Zu,a)&&!(xa(r,Xo)&&r[Xo][a])&&(o.enumerable=!0),o}},$8=function(t){var n=Y8(c1(t)),r=[];return d1(n,function(a){!xa(Zu,a)&&!xa(_8,a)&&U8(r,a)}),r},Z8=function(e){var t=e===Hs,n=Y8(t?cy:c1(e)),r=[];return d1(n,function(a){xa(Zu,a)&&(!t||xa(Hs,a))&&U8(r,Zu[a])}),r};Np||(vf=function(){if(ime(Bg,this))throw new bme("Symbol is not a constructor");var t=!arguments.length||arguments[0]===void 0?void 0:sme(arguments[0]),n=pk(t),r=function(a){var o=this===void 0?uy:this;o===Hs&&dE(r,cy,a),xa(o,Xo)&&xa(o[Xo],n)&&(o[Xo][n]=!1);var i=t2(1,a);try{r2(o,n,i)}catch(l){if(!(l instanceof wme))throw l;z8(o,n,i)}};return kp&&n2&&r2(Hs,n,{configurable:!0,set:r}),TD(n,t)},Bg=vf[vv],hk(Bg,"toString",function(){return mk(this).tag}),hk(vf,"withoutSetter",function(e){return TD(pk(e),e)}),R8.f=V8,L8.f=h1,cme.f=pE,j8.f=W8,lme.f=P8.f=$8,ume.f=Z8,pme.f=function(e){return TD(hme(e),e)},kp&&dme(Bg,"description",{configurable:!0,get:function(){return mk(this).description}}));u1({global:!0,constructor:!0,wrap:!0,forced:!Np,sham:!Np},{Symbol:vf});d1(O8(Dme),function(e){mme(e)});u1({target:f1,stat:!0,forced:!Np},{useSetter:function(){n2=!0},useSimple:function(){n2=!1}});u1({target:"Object",stat:!0,forced:!Np,sham:!kp},{create:Tme,defineProperty:h1,defineProperties:pE,getOwnPropertyDescriptor:W8});u1({target:"Object",stat:!0,forced:!Np},{getOwnPropertyNames:$8});gme();vme(vf,f1);_8[Xo]=!0;var Ime=nm,q8=Ime&&!!Symbol.for&&!!Symbol.keyFor,Eme=Gn,Cme=ou,xme=Fi,Mme=sy,G8=rm,kme=q8,ID=G8("string-to-symbol-registry"),Nme=G8("symbol-to-string-registry");Eme({target:"Symbol",stat:!0,forced:!kme},{for:function(e){var t=Mme(e);if(xme(ID,t))return ID[t];var n=Cme("Symbol")(t);return ID[t]=n,Nme[n]=t,n}});var Ame=Gn,Fme=Fi,Ome=ry,Pme=Qb,jme=rm,Lme=q8,gk=jme("symbol-to-string-registry");Ame({target:"Symbol",stat:!0,forced:!Lme},{keyFor:function(t){if(!Ome(t))throw new TypeError(Pme(t)+" is not a symbol");if(Fme(gk,t))return gk[t]}});var Rme=fa,vk=am,_me=co,yk=tm,Bme=sy,wk=Rme([].push),Hme=function(e){if(_me(e))return e;if(vk(e)){for(var t=e.length,n=[],r=0;r=t.length)return e.target=void 0,V0(void 0,!0);switch(e.kind){case"keys":return V0(n,!1);case"values":return V0(t[n],!1)}return V0([n,t[n]],!1)},"values");Ok.Arguments=Ok.Array;var lve={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},uve=lve,cve=Za,dve=om,Pk=im;for(var MD in uve)dve(cve[MD],MD),Pk[MD]=Pk.Array;var fve=Dge,hve=fve,pve=Na,mve=$s.f,jk=pve("metadata"),Lk=Function.prototype;Lk[jk]===void 0&&mve(Lk,jk,{value:null});var gve=Ir;gve("asyncDispose");var vve=Ir;vve("dispose");var yve=Ir;yve("metadata");var wve=hve,bve=wve,Sve=ou,Dve=fa,gE=Sve("Symbol"),Tve=gE.keyFor,Ive=Dve(gE.prototype.valueOf),d5=gE.isRegisteredSymbol||function(t){try{return Tve(Ive(t))!==void 0}catch{return!1}},Eve=Gn,Cve=d5;Eve({target:"Symbol",stat:!0},{isRegisteredSymbol:Cve});var xve=rm,f5=ou,Mve=fa,kve=ry,Nve=Na,eb=f5("Symbol"),Rk=eb.isWellKnownSymbol,h5=f5("Object","getOwnPropertyNames"),Ave=Mve(eb.prototype.valueOf),_k=xve("wks");for(var kD=0,Bk=h5(eb),Fve=Bk.length;kD=o?e?"":void 0:(i=Yk(r,a),i<55296||i>56319||a+1===o||(l=Yk(r,a+1))<56320||l>57343?e?Kve(r,a):i:e?Qve(r,a,a+2):(i-55296<<10)+(l-56320)+65536)}},Xve={codeAt:Uk(!1),charAt:Uk(!0)},eye=Xve.charAt,tye=sy,m5=uE,nye=s5,zk=l5,g5="String Iterator",rye=m5.set,aye=m5.getterFor(g5);nye(String,"String",function(e){rye(this,{type:g5,string:tye(e),index:0})},function(){var t=aye(this),n=t.string,r=t.index,a;return r>=n.length?zk(void 0,!0):(a=eye(n,r),t.index+=a.length,zk(a,!1))});var oye=iy,Vk=GI,iye=WI,sye=im,lye=Na,uye=lye("iterator"),yE=function(e){if(!iye(e))return Vk(e,uye)||Vk(e,"@@iterator")||sye[oye(e)]},cye=yE,dye=cye,fye=dye,hye=fye,pye=hye,mye=pye,gye=mye,vye=gye,yye=vye;const v5=qt(yye);var wye=ii,bye=am,Sye=TypeError,Dye=Object.getOwnPropertyDescriptor,Tye=wye&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),y5=Tye?function(e,t){if(bye(e)&&!Dye(e,"length").writable)throw new Sye("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Iye=Gn,Eye=tc,Cye=jf,xye=y5,Mye=eE,kye=da,Nye=kye(function(){return[].push.call({length:4294967296},1)!==4294967297}),Aye=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},Fye=Nye||!Aye();Iye({target:"Array",proto:!0,arity:1,forced:Fye},{push:function(t){var n=Eye(this),r=Cye(n),a=arguments.length;Mye(r+a);for(var o=0;o1?arguments[1]:void 0,i=o!==void 0;i&&(o=_0e(o,a>2?arguments[2]:void 0));var l=$0e(n),c=0,f,h,g,y,w,S;if(l&&!(this===Gk&&U0e(l)))for(h=r?new this:[],y=W0e(n,l),w=y.next;!(g=B0e(w,y)).done;c++)S=i?Y0e(y,o,[g.value,c],!0):g.value,qk(h,c,S);else for(f=V0e(n),h=r?new this(f):Gk(f);f>c;c++)S=i?o(n[c],c):n[c],qk(h,c,S);return h.length=c,h},q0e=Na,w5=q0e("iterator"),b5=!1;try{var G0e=0,Jk={next:function(){return{done:!!G0e++}},return:function(){b5=!0}};Jk[w5]=function(){return this},Array.from(Jk,function(){throw 2})}catch{}var J0e=function(e,t){try{if(!t&&!b5)return!1}catch{return!1}var n=!1;try{var r={};r[w5]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},K0e=Gn,Q0e=Z0e,X0e=J0e,ewe=!X0e(function(e){Array.from(e)});K0e({target:"Array",stat:!0,forced:ewe},{from:Q0e});var twe=qa,nwe=twe.Array.from,rwe=nwe,awe=rwe,owe=awe,iwe=owe,swe=iwe,lwe=swe,uwe=lwe;const S5=qt(uwe);function s2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=74)&&(Ol=LD.match(/Chrome\/(\d+)/),Ol&&(tb=Ol[1])));var ybe=tb&&+tb,o4=ybe,wbe=Zs,O5=!!Object.getOwnPropertySymbols&&!wbe(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&o4&&o4<41}),bbe=O5,P5=bbe&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Sbe=ls,Dbe=v1,Tbe=P5,j5=Tbe?function(e){return typeof e=="symbol"}:function(e){var t=Dbe("Symbol");return Sbe(t)&&Object(e)instanceof t},Ibe=function(e){try{return String(e)}catch{return"Object"}},Ebe=ls,Cbe=Ibe,xbe=function(e){if(Ebe(e))return e;throw TypeError(Cbe(e)+" is not a function")},Mbe=xbe,L5=function(e,t){var n=e[t];return n==null?void 0:Mbe(n)},RD=ls,_D=fy,kbe=function(e,t){var n,r;if(t==="string"&&RD(n=e.toString)&&!_D(r=n.call(e))||RD(n=e.valueOf)&&!_D(r=n.call(e))||t!=="string"&&RD(n=e.toString)&&!_D(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},R5={exports:{}},i4=Oi,kE=function(e,t){try{Object.defineProperty(i4,e,{value:t,configurable:!0,writable:!0})}catch{i4[e]=t}return t},Nbe=Oi,Abe=kE,s4="__core-js_shared__",Fbe=Nbe[s4]||Abe(s4,{}),NE=Fbe,l4=NE;(R5.exports=function(e,t){return l4[e]||(l4[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.18.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var AE=R5.exports,Obe=g1,_5=function(e){return Object(Obe(e))},Pbe=_5,jbe={}.hasOwnProperty,_f=Object.hasOwn||function(t,n){return jbe.call(Pbe(t),n)},Lbe=0,Rbe=Math.random(),B5=function(e){return"Symbol("+String(e===void 0?"":e)+")_"+(++Lbe+Rbe).toString(36)},_be=Oi,Bbe=AE,u4=_f,Hbe=B5,c4=O5,Ybe=P5,Mg=Bbe("wks"),Zg=_be.Symbol,Ube=Ybe?Zg:Zg&&Zg.withoutSetter||Hbe,hy=function(e){return(!u4(Mg,e)||!(c4||typeof Mg[e]=="string"))&&(c4&&u4(Zg,e)?Mg[e]=Zg[e]:Mg[e]=Ube("Symbol."+e)),Mg[e]},d4=fy,f4=j5,zbe=L5,Vbe=kbe,Wbe=hy,$be=Wbe("toPrimitive"),Zbe=function(e,t){if(!d4(e)||f4(e))return e;var n=zbe(e,$be),r;if(n){if(t===void 0&&(t="default"),r=n.call(e,t),!d4(r)||f4(r))return r;throw TypeError("Can't convert object to primitive value")}return t===void 0&&(t="number"),Vbe(e,t)},qbe=Zbe,Gbe=j5,H5=function(e){var t=qbe(e,"string");return Gbe(t)?t:String(t)},Jbe=Oi,h4=fy,l2=Jbe.document,Kbe=h4(l2)&&h4(l2.createElement),Y5=function(e){return Kbe?l2.createElement(e):{}},Qbe=Rf,Xbe=Zs,e1e=Y5,U5=!Qbe&&!Xbe(function(){return Object.defineProperty(e1e("div"),"a",{get:function(){return 7}}).a!=7}),t1e=Rf,n1e=M5,r1e=A5,a1e=ME,o1e=H5,i1e=_f,s1e=U5,p4=Object.getOwnPropertyDescriptor;CE.f=t1e?p4:function(t,n){if(t=a1e(t),n=o1e(n),s1e)try{return p4(t,n)}catch{}if(i1e(t,n))return r1e(!n1e.f.call(t,n),t[n])};var py={},l1e=fy,ud=function(e){if(l1e(e))return e;throw TypeError(String(e)+" is not an object")},u1e=Rf,c1e=U5,m4=ud,d1e=H5,g4=Object.defineProperty;py.f=u1e?g4:function(t,n,r){if(m4(t),n=d1e(n),m4(r),c1e)try{return g4(t,n,r)}catch{}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var f1e=Rf,h1e=py,p1e=A5,y1=f1e?function(e,t,n){return h1e.f(e,t,p1e(1,n))}:function(e,t,n){return e[t]=n,e},z5={exports:{}},m1e=ls,u2=NE,g1e=Function.toString;m1e(u2.inspectSource)||(u2.inspectSource=function(e){return g1e.call(e)});var V5=u2.inspectSource,v1e=Oi,y1e=ls,w1e=V5,v4=v1e.WeakMap,b1e=y1e(v4)&&/native code/.test(w1e(v4)),S1e=AE,D1e=B5,y4=S1e("keys"),W5=function(e){return y4[e]||(y4[e]=D1e(e))},FE={},T1e=b1e,I1e=Oi,E1e=fy,C1e=y1,BD=_f,HD=NE,x1e=W5,M1e=FE,w4="Object already initialized",k1e=I1e.WeakMap,nb,wv,rb,N1e=function(e){return rb(e)?wv(e):nb(e,{})},A1e=function(e){return function(t){var n;if(!E1e(t)||(n=wv(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(T1e||HD.state){var tf=HD.state||(HD.state=new k1e),F1e=tf.get,b4=tf.has,O1e=tf.set;nb=function(e,t){if(b4.call(tf,e))throw new TypeError(w4);return t.facade=e,O1e.call(tf,e,t),t},wv=function(e){return F1e.call(tf,e)||{}},rb=function(e){return b4.call(tf,e)}}else{var lp=x1e("state");M1e[lp]=!0,nb=function(e,t){if(BD(e,lp))throw new TypeError(w4);return t.facade=e,C1e(e,lp,t),t},wv=function(e){return BD(e,lp)?e[lp]:{}},rb=function(e){return BD(e,lp)}}var $5={set:nb,get:wv,has:rb,enforce:N1e,getterFor:A1e},c2=Rf,P1e=_f,Z5=Function.prototype,j1e=c2&&Object.getOwnPropertyDescriptor,OE=P1e(Z5,"name"),L1e=OE&&(function(){}).name==="something",R1e=OE&&(!c2||c2&&j1e(Z5,"name").configurable),PE={EXISTS:OE,PROPER:L1e,CONFIGURABLE:R1e},_1e=Oi,S4=ls,B1e=_f,D4=y1,H1e=kE,Y1e=V5,q5=$5,U1e=PE.CONFIGURABLE,z1e=q5.get,V1e=q5.enforce,W1e=String(String).split("String");(z5.exports=function(e,t,n,r){var a=r?!!r.unsafe:!1,o=r?!!r.enumerable:!1,i=r?!!r.noTargetGet:!1,l=r&&r.name!==void 0?r.name:t,c;if(S4(n)&&(String(l).slice(0,7)==="Symbol("&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!B1e(n,"name")||U1e&&n.name!==l)&&D4(n,"name",l),c=V1e(n),c.source||(c.source=W1e.join(typeof l=="string"?l:""))),e===_1e){o?e[t]=n:H1e(t,n);return}else a?!i&&e[t]&&(o=!0):delete e[t];o?e[t]=n:D4(e,t,n)})(Function.prototype,"toString",function(){return S4(this)&&z1e(this).source||Y1e(this)});var my=z5.exports,G5={},$1e=Math.ceil,Z1e=Math.floor,w1=function(e){var t=+e;return t!==t||t===0?0:(t>0?Z1e:$1e)(t)},q1e=w1,G1e=Math.max,J1e=Math.min,K1e=function(e,t){var n=q1e(e);return n<0?G1e(n+t,0):J1e(n,t)},Q1e=w1,X1e=Math.min,J5=function(e){return e>0?X1e(Q1e(e),9007199254740991):0},eSe=J5,tSe=function(e){return eSe(e.length)},nSe=ME,rSe=K1e,aSe=tSe,T4=function(e){return function(t,n,r){var a=nSe(t),o=aSe(a),i=rSe(r,o),l;if(e&&n!=n){for(;o>i;)if(l=a[i++],l!=l)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===n)return e||i||0;return!e&&-1}},oSe={includes:T4(!0),indexOf:T4(!1)},YD=_f,iSe=ME,sSe=oSe.indexOf,lSe=FE,K5=function(e,t){var n=iSe(e),r=0,a=[],o;for(o in n)!YD(lSe,o)&&YD(n,o)&&a.push(o);for(;t.length>r;)YD(n,o=t[r++])&&(~sSe(a,o)||a.push(o));return a},jE=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],uSe=K5,cSe=jE,dSe=cSe.concat("length","prototype");G5.f=Object.getOwnPropertyNames||function(t){return uSe(t,dSe)};var Q5={};Q5.f=Object.getOwnPropertySymbols;var fSe=v1,hSe=G5,pSe=Q5,mSe=ud,gSe=fSe("Reflect","ownKeys")||function(t){var n=hSe.f(mSe(t)),r=pSe.f;return r?n.concat(r(t)):n},vSe=_f,ySe=gSe,wSe=CE,bSe=py,SSe=function(e,t){for(var n=ySe(t),r=bSe.f,a=wSe.f,o=0;oo;)QSe.f(t,i=r[o++],n[i]);return t},nDe=v1,rDe=nDe("document","documentElement"),aDe=ud,oDe=tDe,I4=jE,iDe=FE,sDe=rDe,lDe=Y5,uDe=W5,E4=">",C4="<",d2="prototype",f2="script",aO=uDe("IE_PROTO"),zD=function(){},oO=function(e){return C4+f2+E4+e+C4+"/"+f2+E4},x4=function(e){e.write(oO("")),e.close();var t=e.parentWindow.Object;return e=null,t},cDe=function(){var e=lDe("iframe"),t="java"+f2+":",n;return e.style.display="none",sDe.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(oO("document.F=Object")),n.close(),n.F},$0,ww=function(){try{$0=new ActiveXObject("htmlfile")}catch{}ww=typeof document<"u"?document.domain&&$0?x4($0):cDe():x4($0);for(var e=I4.length;e--;)delete ww[d2][I4[e]];return ww()};iDe[aO]=!0;var dDe=Object.create||function(t,n){var r;return t!==null?(zD[d2]=aDe(t),r=new zD,zD[d2]=null,r[aO]=t):r=ww(),n===void 0?r:oDe(r,n)},fDe=Zs,hDe=Oi,pDe=hDe.RegExp,mDe=fDe(function(){var e=pDe(".","s");return!(e.dotAll&&e.exec(` -`)&&e.flags==="s")}),gDe=Zs,vDe=Oi,yDe=vDe.RegExp,wDe=gDe(function(){var e=yDe("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),bDe=b1,SDe=tO,M4=RE,DDe=AE,TDe=dDe,IDe=$5.get,EDe=mDe,CDe=wDe,ab=RegExp.prototype.exec,xDe=DDe("native-string-replace",String.prototype.replace),h2=ab,p2=function(){var e=/a/,t=/b*/g;return ab.call(e,"a"),ab.call(t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),iO=M4.UNSUPPORTED_Y||M4.BROKEN_CARET,m2=/()??/.exec("")[1]!==void 0,MDe=p2||m2||iO||EDe||CDe;MDe&&(h2=function(t){var n=this,r=IDe(n),a=bDe(t),o=r.raw,i,l,c,f,h,g,y;if(o)return o.lastIndex=n.lastIndex,i=h2.call(o,a),n.lastIndex=o.lastIndex,i;var w=r.groups,S=iO&&n.sticky,D=SDe.call(n),I=n.source,M=0,N=a;if(S&&(D=D.replace("y",""),D.indexOf("g")===-1&&(D+="g"),N=a.slice(n.lastIndex),n.lastIndex>0&&(!n.multiline||n.multiline&&a.charAt(n.lastIndex-1)!==` -`)&&(I="(?: "+I+")",N=" "+N,M++),l=new RegExp("^(?:"+I+")",D)),m2&&(l=new RegExp("^"+I+"$(?!\\s)",D)),p2&&(c=n.lastIndex),f=ab.call(S?l:n,N),S?f?(f.input=f.input.slice(M),f[0]=f[0].slice(M),f.index=n.lastIndex,n.lastIndex+=f[0].length):n.lastIndex=0:p2&&f&&(n.lastIndex=n.global?f.index+f[0].length:c),m2&&f&&f.length>1&&xDe.call(f[0],l,function(){for(h=1;h=o?e?"":void 0:(i=r.charCodeAt(a),i<55296||i>56319||a+1===o||(l=r.charCodeAt(a+1))<56320||l>57343?e?r.charAt(a):i:e?r.slice(a,a+2):(i-55296<<10)+(l-56320)+65536)}},RDe={codeAt:F4(!1),charAt:F4(!0)},_De=RDe.charAt,BDe=function(e,t,n){return t+(n?_De(e,t).length:1)},HDe=_5,YDe=Math.floor,UDe="".replace,zDe=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,VDe=/\$([$&'`]|\d{1,2})/g,WDe=function(e,t,n,r,a,o){var i=n+e.length,l=r.length,c=VDe;return a!==void 0&&(a=HDe(a),c=zDe),UDe.call(o,c,function(f,h){var g;switch(h.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(i);case"<":g=a[h.slice(1,-1)];break;default:var y=+h;if(y===0)return f;if(y>l){var w=YDe(y/10);return w===0?f:w<=l?r[w-1]===void 0?h.charAt(1):r[w-1]+h.charAt(1):f}g=r[y-1]}return g===void 0?"":g})},$De=ud,ZDe=ls,qDe=xE,GDe=_E,JDe=function(e,t){var n=e.exec;if(ZDe(n)){var r=n.call(e,t);return r!==null&&$De(r),r}if(qDe(e)==="RegExp")return GDe.call(e,t);throw TypeError("RegExp#exec called on incompatible receiver")},KDe=ODe,QDe=Zs,XDe=ud,eTe=ls,tTe=w1,nTe=J5,up=b1,rTe=g1,aTe=BDe,oTe=L5,iTe=WDe,sTe=JDe,lTe=hy,g2=lTe("replace"),uTe=Math.max,cTe=Math.min,dTe=function(e){return e===void 0?e:String(e)},fTe=function(){return"a".replace(/./,"$0")==="$0"}(),O4=function(){return/./[g2]?/./[g2]("a","$0")==="":!1}(),hTe=!QDe(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"});KDe("replace",function(e,t,n){var r=O4?"$":"$0";return[function(o,i){var l=rTe(this),c=o==null?void 0:oTe(o,g2);return c?c.call(o,l,i):t.call(up(l),o,i)},function(a,o){var i=XDe(this),l=up(a);if(typeof o=="string"&&o.indexOf(r)===-1&&o.indexOf("$<")===-1){var c=n(t,i,l,o);if(c.done)return c.value}var f=eTe(o);f||(o=up(o));var h=i.global;if(h){var g=i.unicode;i.lastIndex=0}for(var y=[];;){var w=sTe(i,l);if(w===null||(y.push(w),!h))break;var S=up(w[0]);S===""&&(i.lastIndex=aTe(l,nTe(i.lastIndex),g))}for(var D="",I=0,M=0;M=I&&(D+=l.slice(I,_)+V,I=_+N.length)}return D+l.slice(I)}]},!hTe||!fTe||O4);var pTe=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",mTe=TypeError,gTe=function(e,t){if(en,i=yTe(r)?r:TTe(r),l=o?STe(arguments,n):[],c=o?function(){vTe(i,this,l)}:i;return t?e(c,a):e(c)}:e},ETe=Gn,cO=Za,CTe=uO,P4=CTe(cO.setInterval,!0);ETe({global:!0,bind:!0,forced:cO.setInterval!==P4},{setInterval:P4});var xTe=Gn,dO=Za,MTe=uO,j4=MTe(dO.setTimeout,!0);xTe({global:!0,bind:!0,forced:dO.setTimeout!==j4},{setTimeout:j4});var kTe=qa,NTe=kTe.setInterval,ATe=NTe;const FTe=qt(ATe);var OTe=da,fO=function(e,t){var n=[][e];return!!n&&OTe(function(){n.call(null,t||function(){return 1},1)})},PTe=Gn,jTe=zI,LTe=I8.indexOf,RTe=fO,v2=jTe([].indexOf),hO=!!v2&&1/v2([1],1,-0)<0,_Te=hO||!RTe("indexOf");PTe({target:"Array",proto:!0,forced:_Te},{indexOf:function(t){var n=arguments.length>1?arguments[1]:void 0;return hO?v2(this,t,n)||0:LTe(this,t,n)}});var BTe=Lf,HTe=BTe("Array","indexOf"),YTe=ec,UTe=HTe,WD=Array.prototype,zTe=function(e){var t=e.indexOf;return e===WD||YTe(WD,e)&&t===WD.indexOf?UTe:t},VTe=zTe,WTe=VTe,$Te=WTe;const ZTe=qt($Te);var L4=Qb,qTe=TypeError,GTe=function(e,t){if(!delete e[t])throw new qTe("Cannot delete property "+L4(t)+" of "+L4(e))},JTe=Gn,KTe=tc,QTe=oE,XTe=e1,e2e=jf,t2e=y5,n2e=eE,r2e=aE,a2e=oy,$D=GTe,o2e=t1,i2e=o2e("splice"),s2e=Math.max,l2e=Math.min;JTe({target:"Array",proto:!0,forced:!i2e},{splice:function(t,n){var r=KTe(this),a=e2e(r),o=QTe(t,a),i=arguments.length,l,c,f,h,g,y;for(i===0?l=c=0:i===1?(l=0,c=a-o):(l=i-2,c=l2e(s2e(XTe(n),0),a-o)),n2e(a+l-c),f=r2e(r,c),h=0;ha-c+l;h--)$D(r,h-1)}else if(l>c)for(h=a-c;h>o;h--)g=h+c-1,y=h+l-1,g in r?r[y]=r[g]:$D(r,y);for(h=0;h1?arguments[1]:void 0)},_2e=Gn,R4=R2e;_2e({target:"Array",proto:!0,forced:[].forEach!==R4},{forEach:R4});var B2e=Lf,H2e=B2e("Array","forEach"),Y2e=H2e,U2e=Y2e,z2e=iy,V2e=Fi,W2e=ec,$2e=U2e,GD=Array.prototype,Z2e={DOMTokenList:!0,NodeList:!0},q2e=function(e){var t=e.forEach;return e===GD||W2e(GD,e)&&t===GD.forEach||V2e(Z2e,z2e(e))?$2e:t},G2e=q2e;const ob=qt(G2e);var J2e=Gn,K2e=tc,mO=sE,Q2e=da,X2e=Q2e(function(){mO(1)});J2e({target:"Object",stat:!0,forced:X2e},{keys:function(t){return mO(K2e(t))}});var eIe=qa,tIe=eIe.Object.keys,nIe=tIe,rIe=nIe,aIe=rIe;const oIe=qt(aIe);var iIe=qa,sIe=iIe.Object.getOwnPropertySymbols,lIe=sIe,uIe=lIe,cIe=uIe;const _4=qt(cIe);var dIe=Gn,fIe=cE.filter,hIe=t1,pIe=hIe("filter");dIe({target:"Array",proto:!0,forced:!pIe},{filter:function(t){return fIe(this,t,arguments.length>1?arguments[1]:void 0)}});var mIe=Lf,gIe=mIe("Array","filter"),vIe=ec,yIe=gIe,JD=Array.prototype,wIe=function(e){var t=e.filter;return e===JD||vIe(JD,e)&&t===JD.filter?yIe:t},bIe=wIe,SIe=bIe,DIe=SIe;const TIe=qt(DIe);var gO={exports:{}},IIe=Gn,EIe=da,CIe=au,vO=ty.f,yO=ii,xIe=!yO||EIe(function(){vO(1)});IIe({target:"Object",stat:!0,forced:xIe,sham:!yO},{getOwnPropertyDescriptor:function(t,n){return vO(CIe(t),n)}});var MIe=qa,wO=MIe.Object,kIe=gO.exports=function(t,n){return wO.getOwnPropertyDescriptor(t,n)};wO.getOwnPropertyDescriptor.sham&&(kIe.sham=!0);var NIe=gO.exports,AIe=NIe,FIe=AIe,OIe=FIe;const bO=qt(OIe);var PIe=ou,jIe=fa,LIe=o1,RIe=s1,_Ie=ld,BIe=jIe([].concat),HIe=PIe("Reflect","ownKeys")||function(t){var n=LIe.f(_Ie(t)),r=RIe.f;return r?BIe(n,r(t)):n},YIe=Gn,UIe=ii,zIe=HIe,VIe=au,WIe=ty,$Ie=oy;YIe({target:"Object",stat:!0,sham:!UIe},{getOwnPropertyDescriptors:function(t){for(var n=VIe(t),r=WIe.f,a=zIe(n),o={},i=0,l,c;a.length>i;)c=r(n,l=a[i++]),c!==void 0&&$Ie(o,l,c);return o}});var ZIe=qa,qIe=ZIe.Object.getOwnPropertyDescriptors,GIe=qIe,JIe=GIe,KIe=JIe;const B4=qt(KIe);var SO={exports:{}},QIe=Gn,XIe=ii,H4=n1.f;QIe({target:"Object",stat:!0,forced:Object.defineProperties!==H4,sham:!XIe},{defineProperties:H4});var eEe=qa,DO=eEe.Object,tEe=SO.exports=function(t,n){return DO.defineProperties(t,n)};DO.defineProperties.sham&&(tEe.sham=!0);var nEe=SO.exports,rEe=nEe,aEe=rEe,oEe=aEe;const iEe=qt(oEe);var sEe=x5;const lEe=qt(sEe);function uEe(e){if(e.sheet)return e.sheet;for(var t=0;t0?Va(sm,--oi):0,Fp--,ea===10&&(Fp=1,D1--),ea}function ki(){return ea=oi2||Sv(ea)>3?"":" "}function DEe(e,t){for(;--t&&ki()&&!(ea<48||ea>102||ea>57&&ea<65||ea>70&&ea<97););return vy(e,bw()+(t<6&&Kl()==32&&ki()==32))}function w2(e){for(;ki();)switch(ea){case e:return oi;case 34:case 39:e!==34&&e!==39&&w2(ea);break;case 40:e===41&&w2(e);break;case 92:ki();break}return oi}function TEe(e,t){for(;ki()&&e+ea!==57;)if(e+ea===84&&Kl()===47)break;return"/*"+vy(t,oi-1)+"*"+S1(e===47?e:ki())}function IEe(e){for(;!Sv(Kl());)ki();return vy(e,oi)}function EEe(e){return MO(Dw("",null,null,null,[""],e=xO(e),0,[0],e))}function Dw(e,t,n,r,a,o,i,l,c){for(var f=0,h=0,g=i,y=0,w=0,S=0,D=1,I=1,M=1,N=0,_="",k=a,B=o,L=r,R=_;I;)switch(S=N,N=ki()){case 40:if(S!=108&&Va(R,g-1)==58){y2(R+=_n(Sw(N),"&","&\f"),"&\f")!=-1&&(M=-1);break}case 34:case 39:case 91:R+=Sw(N);break;case 9:case 10:case 13:case 32:R+=SEe(S);break;case 92:R+=DEe(bw()-1,7);continue;case 47:switch(Kl()){case 42:case 47:Z0(CEe(TEe(ki(),bw()),t,n),c);break;default:R+="/"}break;case 123*D:l[f++]=Ul(R)*M;case 125*D:case 59:case 0:switch(N){case 0:case 125:I=0;case 59+h:M==-1&&(R=_n(R,/\f/g,"")),w>0&&Ul(R)-g&&Z0(w>32?U4(R+";",r,n,g-1):U4(_n(R," ","")+";",r,n,g-2),c);break;case 59:R+=";";default:if(Z0(L=Y4(R,t,n,f,h,a,l,_,k=[],B=[],g),o),N===123)if(h===0)Dw(R,t,L,L,k,o,g,l,B);else switch(y===99&&Va(R,3)===110?100:y){case 100:case 108:case 109:case 115:Dw(e,L,L,r&&Z0(Y4(e,L,L,0,0,a,l,_,a,k=[],g),B),a,B,g,l,r?k:B);break;default:Dw(R,L,L,L,[""],B,0,l,B)}}f=h=w=0,D=M=1,_=R="",g=i;break;case 58:g=1+Ul(R),w=S;default:if(D<1){if(N==123)--D;else if(N==125&&D++==0&&bEe()==125)continue}switch(R+=S1(N),N*D){case 38:M=h>0?1:(R+="\f",-1);break;case 44:l[f++]=(Ul(R)-1)*M,M=1;break;case 64:Kl()===45&&(R+=Sw(ki())),y=Kl(),h=g=Ul(_=R+=IEe(bw())),N++;break;case 45:S===45&&Ul(R)==2&&(D=0)}}return o}function Y4(e,t,n,r,a,o,i,l,c,f,h){for(var g=a-1,y=a===0?o:[""],w=YE(y),S=0,D=0,I=0;S0?y[M]+" "+N:_n(N,/&\f/g,y[M])))&&(c[I++]=_);return T1(e,t,n,a===0?BE:l,c,f,h)}function CEe(e,t,n){return T1(e,t,n,TO,S1(wEe()),bv(e,2,-2),0)}function U4(e,t,n,r){return T1(e,t,n,HE,bv(e,0,r),bv(e,r+1,-1),r)}function wp(e,t){for(var n="",r=YE(e),a=0;a6)switch(Va(e,t+1)){case 109:if(Va(e,t+4)!==45)break;case 102:return _n(e,/(.+:)(.+)-([^]+)/,"$1"+Rn+"$2-$3$1"+ib+(Va(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~y2(e,"stretch")?kO(_n(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Va(e,t+1)!==115)break;case 6444:switch(Va(e,Ul(e)-3-(~y2(e,"!important")&&10))){case 107:return _n(e,":",":"+Rn)+e;case 101:return _n(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Rn+(Va(e,14)===45?"inline-":"")+"box$3$1"+Rn+"$2$3$1"+io+"$2box$3")+e}break;case 5936:switch(Va(e,t+11)){case 114:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Rn+e+io+e+e}return e}var LEe=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case HE:t.return=kO(t.value,t.length);break;case IO:return wp([kg(t,{value:_n(t.value,"@","@"+Rn)})],a);case BE:if(t.length)return yEe(t.props,function(o){switch(vEe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wp([kg(t,{props:[_n(o,/:(read-\w+)/,":"+ib+"$1")]})],a);case"::placeholder":return wp([kg(t,{props:[_n(o,/:(plac\w+)/,":"+Rn+"input-$1")]}),kg(t,{props:[_n(o,/:(plac\w+)/,":"+ib+"$1")]}),kg(t,{props:[_n(o,/:(plac\w+)/,io+"input-$1")]})],a)}return""})}},REe=[LEe],_Ee=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(D){var I=D.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(D),D.setAttribute("data-s",""))})}var a=t.stylisPlugins||REe,o={},i,l=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(D){for(var I=D.getAttribute("data-emotion").split(" "),M=1;M=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var HEe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YEe=/[A-Z]|^ms/g,UEe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,NO=function(t){return t.charCodeAt(1)===45},V4=function(t){return t!=null&&typeof t!="boolean"},KD=NEe(function(e){return NO(e)?e:e.replace(YEe,"-$&").toLowerCase()}),W4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(UEe,function(r,a,o){return zl={name:a,styles:o,next:zl},a})}return HEe[t]!==1&&!NO(t)&&typeof n=="number"&&n!==0?n+"px":n};function Dv(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var a=n.styles+";";return a}return zEe(e,t,n);case"function":if(e!==void 0){var o=zl,i=n(e);return zl=o,Dv(e,t,i)}break}if(t==null)return n;var l=t[n];return l!==void 0?l:n}function zEe(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:"white",n="background-color: ".concat(e,"; border-radius: 4px; padding: 2px 4px;");return t&&(n+=" color: ".concat(t,";")),[n,""]}function X4(e,t){for(var n,r,a=arguments.length,o=new Array(a>2?a-2:0),i=2;i1&&arguments[1]!==void 0?arguments[1]:{},n=t.force,r=n===void 0?!1:n;return r?function(){for(var a=arguments.length,o=new Array(a),i=0;it?(e.apply(void 0,o),n=l):(clearTimeout(r),r=CCe(function(){e.apply(void 0,o),n=Xc()},Math.max(0,t-l+n)))}}var LO=function(t){var n=t.debounce,r=t.name,a=t.onEvent,o=t.target,i=P.useRef();i.current=a;var l=P.useMemo(function(){return xCe(function(f){var h=i.current;h&&h(f)},n)},[n,i]),c=P.useCallback(function(f){f.timeStampLow=Xc(),l(f)},[l]);return P.useLayoutEffect(function(){return o.addEventListener(r,c,{passive:!0}),c({target:o,type:r}),function(){return o.removeEventListener(r,c)}},[r,c,o]),!1};LO.defaultProps={debounce:200};var MCe=Math.sign||function(t){var n=+t;return n===0||n!==n?n:n<0?-1:1},kCe=Gn,NCe=MCe;kCe({target:"Math",stat:!0},{sign:NCe});var ACe=qa,FCe=ACe.Math.sign,OCe=FCe,PCe=OCe,jCe=PCe;const LCe=qt(jCe);function RCe(e,t){var n=LCe(t-e),r=Math.sqrt(Math.abs(t-e)),a=e+r*n;return n>0?Math.min(t,a):Math.max(t,a)}function _Ce(e,t,n,r){for(var a=e,o=0;o4&&arguments[4]!==void 0?arguments[4]:Xc();(g==="100%"||typeof g=="number")&&(cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){if(a){var S=g==="100%"?a.scrollHeight-a.offsetHeight:g,D=_Ce(h,S,RCe,(Xc()-w)/5);Math.abs(S-D)<1.5&&(D=S),a[f]=D,S===D?r&&r(!0):l(f,h,g,y+1,w)}}))},[i,r,a]),c=P.useCallback(function(){cancelAnimationFrame(i.current),r&&r(!1)},[r]);return P.useLayoutEffect(function(){return l(n,a[n],o,1),a?(a.addEventListener("pointerdown",c,{passive:!0}),a.addEventListener("wheel",c,{passive:!0}),function(){a.removeEventListener("pointerdown",c),a.removeEventListener("wheel",c),cancelAnimationFrame(i.current)}):function(){return cancelAnimationFrame(i.current)}},[l,i,c,n,a,o]),!1};RO.propTypes={name:Mn.string.isRequired,onEnd:Mn.func,target:Mn.any.isRequired,value:Mn.oneOfType([Mn.number,Mn.oneOf(["100%"])]).isRequired};function XD(e){var t=P.useState(e),n=Yl(t,2),r=n[0],a=n[1],o=P.useRef(),i=P.useCallback(function(l){typeof l=="function"?i(function(c){return l=l(c),o.current=l,l}):(o.current=l,i(l))},[o]);return o.current=r,[r,a,o]}function eN(e,t){var n=oIe(e);if(_4){var r=_4(e);t&&(r=TIe(r).call(r,function(a){return bO(e,a).enumerable})),n.push.apply(n,r)}return n}function tN(e){for(var t=1;t",{force:o})},[o]);l=l===Ls?Ls:HCe;var g=P.useRef(0),y=P.useRef(i),w=XD(l===Ls?0:"100%"),S=Yl(w,3),D=S[0],I=S[1],M=S[2],N=XD(null),_=Yl(N,3),k=_[0],B=_[1],L=_[2],R=P.useRef(0),V=P.useRef(0),Y=P.useRef(0),Z=P.useState(!0),Q=Yl(Z,2),G=Q[0],le=Q[1],se=P.useState(!0),fe=Yl(se,2),$=fe[0],he=fe[1],ie=P.useState(!0),ce=Yl(ie,2),X=ce[0],ae=ce[1],De=P.useState(!1),je=Yl(De,2),Re=je[0],Fe=je[1],Be=XD(!0),Xe=Yl(Be,3),Ze=Xe[0],st=Xe[1],Ct=Xe[2],tn=P.useRef([]),_e=P.useCallback(function(pt){var Mt=L.current;return tn.current.push(pt),Mt&&pt({scrollTop:Mt.scrollTop}),function(){var Jt=tn.current,sn=ZTe(Jt).call(Jt,pt);~sn&&v2e(Jt).call(Jt,sn,1)}},[tn,L]),et=P.useCallback(function(){var pt=M.current;h(function(){var Mt;return Dr(Mt=["%cSpineTo%c: %conEnd%c is fired."]).call(Mt,En(Vn("magenta")),En(Vn("orange")),[{animateTo:pt}])}),g.current=Xc(),Ng(pt,l)||st(!1),I(null)},[M,h,g,l,I,st]),nt=P.useCallback(function(pt){var Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Jt=Mt.behavior,sn=L.current;if(typeof pt!="number"&&pt!=="100%")return console.warn('react-scroll-to-bottom: Arguments passed to scrollTo() must be either number or "100%".');h(function(){var ln;return[Dr(ln=["%cscrollTo%c: Will scroll to %c".concat(typeof pt=="number"?pt+"px":pt.replace(/%/g,"%%"),"%c")]).call(ln,En(Vn("lime","")),En(Vn("purple"))),{behavior:Jt,nextAnimateTo:pt,target:sn}]}),Jt==="auto"?(et(),sn&&(sn.scrollTop=pt==="100%"?sn.scrollHeight-sn.offsetHeight:pt)):(Jt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollTo". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),I(pt)),Ng(pt,l)&&(h(function(){var ln;return[Dr(ln=["%cscrollTo%c: Scrolling to end, will set sticky to %ctrue%c."]).call(ln,En(Vn("lime","")),En(Vn("purple"))),[{mode:l,nextAnimateTo:pt}]]}),st(!0))},[h,et,l,I,st,L]),ht=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var Jt;return Dr(Jt=["%cscrollToBottom%c: Called"]).call(Jt,En(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToBottom". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),nt("100%",{behavior:Mt||"smooth"})},[h,nt]),St=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var Jt;return Dr(Jt=["%cscrollToTop%c: Called"]).call(Jt,En(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToTop". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),nt(0,{behavior:Mt||"smooth"})},[h,nt]),Tt=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var sn;return Dr(sn=["%cscrollToEnd%c: Called"]).call(sn,En(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToEnd". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.');var Jt={behavior:Mt||"smooth"};l===Ls?St(Jt):ht(Jt)},[h,l,ht,St]),Gt=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var sn;return Dr(sn=["%cscrollToStart%c: Called"]).call(sn,En(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToStart". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.');var Jt={behavior:Mt||"smooth"};l===Ls?ht(Jt):St(Jt)},[h,l,ht,St]),_t=P.useCallback(function(){var pt=L.current;if(pt){if(y.current==="auto"){h(function(){var Lr;return Dr(Lr=["%ctarget changed%c: Initial scroll"]).call(Lr,En(Vn("blue")))}),pt.scrollTop=l===Ls?0:pt.scrollHeight-pt.offsetHeight,y.current=!1;return}var Mt=R.current,Jt=pt.offsetHeight,sn=pt.scrollHeight,ln=pt.scrollTop,vr=l===Ls?0:Math.max(0,sn-Jt-ln),fr=Math.max(0,Mt-ln),ha=f({maxValue:vr,minValue:fr,offsetHeight:Jt,scrollHeight:sn,scrollTop:ln}),jr=Math.max(0,Math.min(vr,ha)),nr;l===Ls||jr!==vr?nr=ln+jr:nr="100%",h(function(){var Lr,te,me;return[Dr(Lr=[Dr(te=Dr(me="%cscrollToSticky%c: Will animate from %c".concat(Mt,"px%c to %c")).call(me,typeof nr=="number"?nr+"px":nr.replace(/%/g,"%%"),"%c (%c")).call(te,(nr==="100%"?vr:nr)+Mt,"px%c)")]).call(Lr,En(Vn("orange")),En(Vn("purple")),En(Vn("purple")),En(Vn("purple"))),{animateFrom:Mt,maxValue:vr,minValue:fr,nextAnimateTo:nr,nextValue:jr,offsetHeight:Jt,rawNextValue:ha,scrollHeight:sn,scrollTop:ln}]}),nt(nr,{behavior:"smooth"})}},[R,h,l,f,nt,L]),Vt=P.useCallback(function(pt){var Mt,Jt=pt.timeStampLow,sn=M.current,ln=L.current,vr=sn!==null;if(!(Jt<=g.current||!ln)){var fr=oN({mode:l,target:ln}),ha=fr.atBottom,jr=fr.atEnd,nr=fr.atStart,Lr=fr.atTop;le(ha),he(jr),Fe(nr),ae(Lr);var te=ln.offsetHeight,me=ln.scrollHeight,xe=V.current,Ye=Y.current,He=te!==xe,Qe=me!==Ye;if(He&&(V.current=te),Qe&&(Y.current=me),!He&&!Qe){var tt=vr&&Ng(sn,l)||jr;Ct.current!==tt&&(h(function(){var Yt,On,yn,Cr;return[Dr(Yt=["%conScroll%c: %csetSticky%c(%c".concat(tt,"%c)")]).call(Yt,En(Vn("red")),En(Vn("red")),En(Vn("purple"))),Dr(On=[Dr(yn=Dr(Cr="(animating = %c".concat(vr,"%c && isEnd = %c")).call(Cr,Ng(sn,l),"%c) || atEnd = %c")).call(yn,jr,"%c")]).call(On,En(Vn("purple")),En(Vn("purple")),En(Vn("purple")),[{animating:vr,animateTo:sn,atEnd:jr,mode:l,offsetHeight:ln.offsetHeight,scrollHeight:ln.scrollHeight,sticky:Ct.current,nextSticky:tt}])]}),st(tt))}else Ct.current&&(h(function(){var Yt;return[Dr(Yt=["%conScroll%c: Size changed while sticky, calling %cscrollToSticky()%c"]).call(Yt,En(Vn("red")),En(Vn("orange")),[{offsetHeightChanged:He,scrollHeightChanged:Qe}]),{nextOffsetHeight:te,prevOffsetHeight:xe,nextScrollHeight:me,prevScrollHeight:Ye}]}),_t());var kt=ln.scrollTop;ob(Mt=tn.current).call(Mt,function(Yt){return Yt({scrollTop:kt})})}},[M,h,g,l,V,Y,tn,_t,le,he,Fe,ae,st,Ct,L]);P.useEffect(function(){if(k){var pt=!1,Mt=UCe(function(){var Jt=L.current,sn=M.current!==null;Ct.current?oN({mode:l,target:Jt}).atEnd?pt=!1:pt?Xc()-pt>YCe&&(sn||(R.current=Jt.scrollTop,h(function(){var ln;return Dr(ln=["%cInterval check%c: Should sticky but not at end, calling %cscrollToSticky()%c to scroll"]).call(ln,En(Vn("navy")),En(Vn("orange")))}),_t()),pt=!1):pt=Xc():Jt.scrollHeight<=Jt.offsetHeight&&!Ct.current&&(h(function(){var ln;return[Dr(ln=["%cInterval check%c: Container is emptied, setting sticky back to %ctrue%c"]).call(ln,En(Vn("navy")),En(Vn("purple"))),[{offsetHeight:Jt.offsetHeight,scrollHeight:Jt.scrollHeight,sticky:Ct.current}]]}),st(!0))},Math.max(nN,n)||nN);return function(){return clearInterval(Mt)}}},[M,n,h,l,_t,st,Ct,k,L]);var Xt=P.useMemo(function(){var pt=aN[c]||(aN[c]=ZEe({key:"react-scroll-to-bottom--css-"+pCe(),nonce:c}));return function(Mt){return pt.css(Mt)+""}},[c]),dn=P.useMemo(function(){return{observeScrollPosition:_e,setTarget:B,styleToClassName:Xt}},[_e,B,Xt]),en=P.useMemo(function(){return{atBottom:G,atEnd:$,atStart:Re,atTop:X,mode:l}},[G,$,Re,X,l]),Zn=P.useMemo(function(){var pt=D!==null;return{animating:pt,animatingToEnd:pt&&Ng(D,l),sticky:Ze}},[D,l,Ze]),kn=P.useMemo(function(){return tN(tN({},en),Zn)},[en,Zn]),Er=P.useMemo(function(){return{scrollTo:nt,scrollToBottom:ht,scrollToEnd:Tt,scrollToStart:Gt,scrollToTop:St}},[nt,ht,Tt,Gt,St]);return P.useEffect(function(){if(k){var pt=function(){Y.current=k.scrollHeight};return k.addEventListener("focus",pt,{capture:!0,passive:!0}),function(){return k.removeEventListener("focus",pt)}}},[k]),h(function(){var pt;return[Dr(pt=["%cRender%c: Render"]).call(pt,En(Vn("cyan",""))),{animateTo:D,animating:D!==null,sticky:Ze,target:k}]}),ne.createElement(m1.Provider,{value:dn},ne.createElement(bE.Provider,{value:Er},ne.createElement(TE.Provider,{value:kn},ne.createElement(SE.Provider,{value:en},ne.createElement(DE.Provider,{value:Zn},r,k&&ne.createElement(LO,{debounce:a,name:"scroll",onEvent:Vt,target:k}),k&&D!==null&&ne.createElement(RO,{name:"scrollTop",onEnd:et,target:k,value:D}))))))};VE.defaultProps={checkInterval:100,children:void 0,debounce:17,debug:void 0,initialScrollBehavior:"smooth",mode:void 0,nonce:void 0,scroller:BCe};VE.propTypes={checkInterval:Mn.number,children:Mn.any,debounce:Mn.number,debug:Mn.bool,initialScrollBehavior:Mn.oneOf(["auto","smooth"]),mode:Mn.oneOf(["bottom","top"]),nonce:Mn.string,scroller:Mn.func};var zCe={height:"100%",overflowY:"auto",width:"100%"},WE=function(t){var n=t.children,r=t.className,a=P.useContext(m1),o=a.setTarget,i=IE()(zCe);return ne.createElement("div",{className:wE(i,(r||"")+""),ref:o},n)};WE.defaultProps={children:void 0,className:void 0};WE.propTypes={children:Mn.any,className:Mn.string};var VCe={position:"relative"},$E=function(t){var n=t.children,r=t.className,a=t.followButtonClassName,o=t.scrollViewClassName,i=IE()(VCe);return ne.createElement("div",{className:wE(i,(r||"")+"")},ne.createElement(WE,{className:(o||"")+""},n),ne.createElement(EE,{className:(a||"")+""}))};$E.defaultProps={children:void 0,className:void 0,followButtonClassName:void 0,scrollViewClassName:void 0};$E.propTypes={children:Mn.any,className:Mn.string,followButtonClassName:Mn.string,scrollViewClassName:Mn.string};var ZE=function(t){var n=t.checkInterval,r=t.children,a=t.className,o=t.debounce,i=t.debug,l=t.followButtonClassName,c=t.initialScrollBehavior,f=t.mode,h=t.nonce,g=t.scroller,y=t.scrollViewClassName;return ne.createElement(VE,{checkInterval:n,debounce:o,debug:i,initialScrollBehavior:c,mode:f,nonce:h,scroller:g},ne.createElement($E,{className:a,followButtonClassName:l,scrollViewClassName:y},r))};ZE.defaultProps={checkInterval:void 0,children:void 0,className:void 0,debounce:void 0,debug:void 0,followButtonClassName:void 0,initialScrollBehavior:"smooth",mode:void 0,nonce:void 0,scroller:void 0,scrollViewClassName:void 0};ZE.propTypes={checkInterval:Mn.number,children:Mn.any,className:Mn.string,debounce:Mn.number,debug:Mn.bool,followButtonClassName:Mn.string,initialScrollBehavior:Mn.oneOf(["auto","smooth"]),mode:Mn.oneOf(["bottom","top"]),nonce:Mn.string,scroller:Mn.func,scrollViewClassName:Mn.string};function WCe(){var e=p1(),t=e.scrollToBottom;return t}function $Ce(){var e=p1(),t=e.scrollToStart;return t}function ZCe(){var e=p1(),t=e.scrollToTop;return t}wce();const qCe=e=>{const{locationState:{query:t},globalState:{memoListView:n,manifest:r},dailyNotesState:{app:a,settings:o}}=P.useContext(Lt),{thinos:i}=e,[l,c]=ne.useState(Tv(i,"day")),f=ne.useRef(null),h=WCe(),g=P.useRef([]);P.useRef(0),P.useEffect(()=>{const S=Tv(i,"day");Cw.isEqual(S,l)||c(S)},[i]),P.useEffect(()=>{var N,_;if(Cw.isEqual(g.current,i))return;const S=i.filter(k=>k.pinned),D=i.filter(k=>!k.pinned),I=g.current.filter(k=>k.pinned)[0],M=g.current.filter(k=>!k.pinned)[0];(I&&I.id!==((N=S[0])==null?void 0:N.id)||M&&M.id!==((_=D[0])==null?void 0:_.id))&&h()},[i]),P.useEffect(()=>{f.current&&h()},[t]);const y=P.useCallback(()=>{a.setting.open(),a.setting.openTabById(r.id||"obsidian-memos")},[a]),w=P.useMemo(()=>v.jsx(v.Fragment,{children:Object.keys(l).map((S,D)=>v.jsx(v.Fragment,{children:v.jsx(GCe,{thinos:l[S],dayMark:S,handleOpenSettings:y},S+D)}))}),[l]);return v.jsx("div",{ref:f,className:ar("chat-view",`${o==null?void 0:o.chatViewStyle}-style`),children:w})},GCe=({thinos:e,dayMark:t,handleOpenSettings:n})=>{const{dailyNotesState:{settings:r,app:a}}=P.useContext(Lt),[o,i]=ne.useState(!0),l=ne.useRef(null),[c,f]=ne.useState(r==null?void 0:r.MomentsIcon);P.useEffect(()=>{if(!(r!=null&&r.MomentsIcon)||!a)return;const w=a.vault.adapter.getResourcePath(x.normalizePath(r.MomentsIcon));w&&!(r!=null&&r.MomentsIcon.startsWith("http"))?f(w):f(r==null?void 0:r.MomentsIcon)},[r==null?void 0:r.MomentsIcon]);const h=w=>{if(x.Keymap.isModifier(w.nativeEvent,"Mod")){const S=x.moment(t,"YYYY-MM-DD");at.setFromAndToQuery(S.startOf("day").valueOf(),S.endOf("day").valueOf());return}i(!o),l.current.scrollIntoView(!0)},g=w=>{Df(w)},y=P.useMemo(()=>e.map((w,S)=>v.jsxs("div",{className:"thino-bubble right",children:[v.jsx(JCe,{icon:c,handleOpenSettings:n}),v.jsx("div",{className:"wrap",children:v.jsx(KCe,{thino:w,handleClickTimeStamp:g},`${w.id}-${x.moment(w.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${S}`)})]},w.id+S)),[e,c]);return v.jsxs(v.Fragment,{children:[o&&y,v.jsx("div",{className:`thino-chat-day-mark day-mark ${o?"":"folded"}`,onClick:h,children:v.jsx("div",{className:"day-mark-bubble",children:(t==="PINNED"?t+" 📌":t)+(o?"":"...")})})]})},JCe=({icon:e,handleOpenSettings:t})=>v.jsx("div",{ref:n=>{if(e){n==null||n.empty();return}e||n&&x.setIcon(n,"Memos")},className:"icon-img",style:{backgroundImage:`url("${e}")`}}),KCe=({thino:e,handleClickTimeStamp:t})=>{const n=P.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const o=await we.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");o&&we.editMemo(o)},[e]),r=P.useMemo(()=>v.jsxs("div",{className:"content",children:[v.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),v.jsx(ai,{memo:e})]}),[e.content]),a=P.useMemo(()=>{var o;return v.jsxs("div",{className:"content task",children:[v.jsx("div",{className:"task-inputer",children:v.jsx("input",{className:ar("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":(o=e.thinoType)==null?void 0:o.slice(5),onClick:n})}),v.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),v.jsx(ai,{memo:e})]})},[e.content,e.thinoType]);return e.thinoType==="JOURNAL"?r:a},QCe=3e3;function XCe({statusRef:e,isComplete:t,handleFetchMoreClick:n,cachedMemos:r}){P.useEffect(()=>{const a=e.current;if(!a)return;const o=vb.throttle(async()=>{await n()},QCe,{trailing:!1}),i=new IntersectionObserver(([l])=>{l.isIntersecting&&!t&&o()});return i.observe(a),()=>{i.unobserve(a),o.cancel()}},[t,e,n]),P.useEffect(()=>{r.length<40&&!t&&n()},[r.length,t,n])}function Tv(e,t){const n={},r={day:"YYYY-MM-DD ddd",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"};return e.forEach(a=>{const o=a.pinned?"PINNED":x.moment(a.createdAt,"YYYY/MM/DD HH:mm:ss").format(r[t]);n[o]||(n[o]=[]),n[o].push(a)}),n}function _O(e){return e.slice().sort((t,n)=>t.pinned!==n.pinned?t.pinned?-1:1:new Date(n.createdAt).getTime()-new Date(t.createdAt).getTime())}function exe(e,t){if(e.length===0)return t;const n=new Map(t.map(i=>[i.id,i])),r=[],a=e==null?void 0:e.reduce((i,l)=>{if(n.has(l.id)){const c=n.get(l.id);Cw.isEqual(l,c)?i.push(l):i.push({...c}),n.delete(l.id)}return i},[]);n.forEach(i=>r.push(i));const o=a.concat(r);return _O(o)}function Ag(e){const{tag:t,duration:n,type:r,text:a,filter:o,path:i,metadata:l}=e,c=on.getQueryById(o),f=!l||Object.keys(l).length===0;return!(!!(t||n&&n.from((e.match(r)||[]).forEach(a=>{const i=(a==null?void 0:a.replace(r,"$1").trim()).split("/");let l="";i.forEach(c=>{l+=c,n.add(l),l+="/"})}),n),new Set)}function nxe(e){if(!Array.isArray(e)||e.length===0)return new Set;const t=e.filter(r=>!!r).map(r=>r.toString().trim());if(t.length===0)return new Set;const n=new Set;return t.forEach(r=>{const a=r.split("/");let o="";a.forEach((i,l)=>{o+=(l>0?"/":"")+i,n.add(o)})}),n}const rxe=({tempMemos:e,query:t,HideDoneTasks:n})=>{const r=e.filter(I=>I.rowStatus!=="ARCHIVED"&&!I.deletedAt),{tag:a,duration:o,type:i,text:l,filter:c,path:f,metadata:h}=t,g=on.getQueryById(c),y=l.toLowerCase(),w=!h||Object.keys(h).length===0,S=!!(a||o&&o.from{var M,N;if(I.content.contains("comment:")||n&&I.thinoType==="TASK-DONE")return!1;if(g){const _=JSON.parse(g.querystring);if(Array.isArray(_)&&!Vp(I,_))return!1}if(!w&&Object.keys(h).some(k=>{var B;return((B=I.fileInfo)==null?void 0:B.frontmatter[k])!==h[k]})||f&&!I.path.toLowerCase().includes(f.toLowerCase())||a&&((M=I==null?void 0:I.fileInfo)!=null&&M.tags)&&!txe(I.content).has(a)&&!nxe((N=I==null?void 0:I.fileInfo)==null?void 0:N.tags).has(a)||o&&o.from!==0&&o.to!==0&&(ut.getTimeStampByDate(I.createdAt)o.to))return!1;if(i)switch(i){case"NOT_TAGGED":if(I.content.match($r)||I.content.match(Wa)||I.content.match(ua))return!1;break;case"LINKED":if(!I.content.match(Af))return!1;break;case"IMAGED":if(!I.content.match(Ff))return!1;break;case"CONNECTED":if(!I.content.match(ad))return!1;break}return!(y&&!D(I.content.toLowerCase()))}):r},axe=({updateThinos:e,listView:t})=>{const{locationState:{query:n},memoState:{memos:r},dailyNotesState:{app:a,settings:o}}=P.useContext(Lt),i=ZCe(),l=$Ce(),[c,f]=P.useState(!1),[h,g]=P.useState(!1),[y,w,S]=xo([]),[D,I]=P.useState([]),[M,N]=P.useState({}),[_,k]=P.useState((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),[B,L]=P.useState((a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day"),[R,V,Y]=xo([]),Z=P.useRef(null),Q=P.useRef(null),G=P.useRef(null),le=P.useRef(!1);P.useEffect(()=>{l(),w(R.slice(0,y.length>20?Math.min(y.length,20):20))},[t]),P.useEffect(()=>()=>{Q.current&&(Q.current=null),G.current&&(G.current=null)},[]),P.useLayoutEffect(()=>{if(r.length!==0&&le.current===!0)return;const ie=oxe(a||window.app);!ie||ie.length===0||(V(ie),I(ie),k((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),a!=null&&a.loadLocalStorage("showDayMark")&&N(Tv(ie,(a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day")))},[]),P.useEffect(()=>{if(r.length===0&&!we.initialized)return;f(!1);const ie=_O(r),ce=rxe({tempMemos:ie,query:n,HideDoneTasks:(o==null?void 0:o.HideDoneTasks)||!1});return le.current=!0,e&&e(ce),V(ce),()=>{le.current=!1}},[r,n,o==null?void 0:o.HideDoneTasks]),P.useEffect(()=>{const ce=R.slice(0,y.length>20?Math.min(y.length,20):20);w(X=>exe(X,ce))},[R]),P.useEffect(()=>{var ie;y.length<20&&((ie=G.current)==null||ie.click())},[R]),P.useEffect(()=>{(Ag(n)&&y.length0||!Ag(n)&&y.length===R.length&&R.length>0)&&g(!0),ixe(y||[],a),I(y),a==null||a.saveLocalStorage("showDayMark",o==null?void 0:o.showDayMark),a==null||a.saveLocalStorage("dayMarkRange",o==null?void 0:o.dayMarkRange),k((o==null?void 0:o.showDayMark)||!1),L((o==null?void 0:o.dayMarkRange)||"day"),o!=null&&o.showDayMark&&N(Tv(y,(o==null?void 0:o.dayMarkRange)||"day"))},[y,o==null?void 0:o.showDayMark,o==null?void 0:o.dayMarkRange]),P.useEffect(()=>{i()},[n]);const se=async()=>{try{if(Y.current.length>S.current.length){f(!0);const ie=Math.min(S.current.length+20,Y.current.length)-S.current.length,ce=Y.current.slice(S.current.length,S.current.length+ie);w(X=>[...X,...ce]),f(!1),g(ce.length<20)}}catch(ie){console.error(ie),new x.Notice(ie.response.data.message)}};XCe({statusRef:Q,isComplete:h,handleFetchMoreClick:se,cachedMemos:y});const fe=P.useMemo(()=>v.jsx("div",{ref:Q,className:ar("status-text-container",t==="calendar"||t==="table"?"hidden":""),children:v.jsx("p",{className:"status-text",children:c?E("Fetching data..."):h?R.length===0?E("Noooop!"):E("All Data is Loaded 🎉"):v.jsx(v.Fragment,{children:v.jsx("span",{ref:G,className:"cursor-pointer hover:text-green-600",onClick:se,children:E("fetch more")})})})}),[t,se,R,c,h,Q]),$=ie=>{switch(ie){case"list":return v.jsx(_w,{breakpointCols:1,className:`${t}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:_?v.jsx(v.Fragment,{children:Object.keys(M).sort((ce,X)=>X-ce).map(ce=>v.jsx(kT,{type:"list",thinos:M[ce],dayMark:ce,dayMarkRange:B},ce))}):D.map((ce,X)=>v.jsx(ai,{memo:ce},`${ce.id}-${X}`))});case"waterfall":return v.jsx(v.Fragment,{children:_&&Object.keys(M).length>0?Object.keys(M).map(ce=>v.jsx(kT,{type:"waterfall",thinos:M[ce],dayMark:ce,dayMarkRange:B},ce)):v.jsx(_w,{breakpointCols:3,className:`${t}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:D.map((ce,X)=>v.jsx(ai,{memo:ce},`${ce.id}-${X}`))})});case"chat":return v.jsx(qCe,{thinos:D});case"calendar":return v.jsx(zle,{thinos:R});case"table":return v.jsx(mce,{thinos:R,isFiltering:!Ag(n)});case"moments":return v.jsx(lxe,{thinos:D})}},he=ie=>{switch(ie){case"top":return t==="chat"&&fe;case"bottom":return t!=="chat"&&fe}};return v.jsxs(ZE,{className:`memolist-wrapper ${h?"completed":""} `,mode:t==="chat"?"bottom":"top",initialScrollBehavior:"auto",checkInterval:30,followButtonClassName:ar("scroll-to-bottom-button",t==="chat"?"to-bottom":"to-top"),scrollViewClassName:"memolist-scrollview",children:[he("top"),v.jsx("div",{ref:Z,className:"memolist-container",children:$(t)}),he("bottom")]})};function BO(e){return`memosListCache:${e}`}function oxe(e){var t;try{const n=BO(e==null?void 0:e.appId),r=la.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)||[]:[]}catch(n){return console.error(n),[]}}function ixe(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=BO(t==null?void 0:t.appId);la.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const sxe=({userIcon:e})=>v.jsx("div",{className:"moments-view-user-icon",ref:t=>{if(e){t==null||t.empty();return}e||t&&x.setIcon(t,"Memos")},style:{backgroundImage:`url("${e}")`}}),b2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSIjMGUyYTQ3Ij48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODIiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4NiI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODMiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDg1Ij48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjE1MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMTUwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjIxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjI3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIzOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI0NTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjQ1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjQ1MCIgeT0iNDUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjUxMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI1NzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjYzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjYzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjY5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjkwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjY5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjY5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",Tw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSJyZ2JhKDIzMSwgMjM4LCAyNDUsIDEpIj48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODUiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4MyI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODYiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDgyIj48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjMwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjkwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMTUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIxNTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIxNTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjE1MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMjEwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjIxMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjI3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzOTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI0NTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNDUwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1MTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjUxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTcwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTcwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1NzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI1NzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2OTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",lxe=e=>{const{globalState:{memoListView:t,markMemoId:n,manifest:r,editMemoId:a},dailyNotesState:{app:o,settings:i}}=P.useContext(Lt),{thinos:l}=e,c=ne.useRef(null),f=ne.useRef(null),[h,g]=ne.useState(!1),[y,w]=P.useState({}),[S,D]=P.useState((o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day"),[I,M]=ne.useState(i==null?void 0:i.MomentsIcon);P.useEffect(()=>{if(!(i!=null&&i.MomentsIcon)||!o)return;const _=o.vault.adapter.getResourcePath(x.normalizePath(i.MomentsIcon));_&&!(i!=null&&i.MomentsIcon.startsWith("http"))?M(_):M(i==null?void 0:i.MomentsIcon)},[i==null?void 0:i.MomentsIcon,o]),P.useEffect(()=>{i!=null&&i.showDayMark&&w(Tv(l,(o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day"))},[l]),P.useEffect(()=>{c.current.closest(".workspace-window")&&g(!0)},[c.current]),P.useEffect(()=>{n&&g(!0)},[n]),P.useEffect(()=>{a?(g(!0),setTimeout(()=>{o.workspace.trigger("focus-on-textarea")},200)):g(!1)},[a]),P.useEffect(()=>{f.current&&(!h&&x.setIcon(f.current,"camera"),h&&x.setIcon(f.current,"camera-off"))},[f.current,h]);const N=P.useCallback(()=>{o.setting.open(),o.setting.openTabById(r.id||"obsidian-memos")},[o]);return v.jsxs("div",{ref:c,className:ar("moments-view",h?"show-editor":""),children:[v.jsxs("div",{className:"moments-view-background-wrapper",children:[v.jsx(uxe,{}),v.jsx("div",{ref:f,className:"moments-show-editor-btn",onClick:()=>{a&&h||((h||a)&&g(!h),!h&&!a&&new MT(o).open())}}),v.jsxs("div",{className:"moments-view-background-overlay",children:[v.jsxs("div",{className:"moments-view-user-info",children:[v.jsx("div",{className:"moments-view-user-name",children:i==null?void 0:i.UserName}),v.jsx(sxe,{userIcon:I})]}),v.jsx("div",{className:"moments-view-user-idea",children:i.MomentsQuote||" "})]})]}),i!=null&&i.showDayMark?y&&Object.keys(y).length>0&&Object.keys(y).map((_,k)=>v.jsx(kT,{type:"list",thinos:y[_],dayMark:_,dayMarkRange:S,thinoWrapper:B=>v.jsx(iN,{thino:B.thino,handleOpenSettings:N},B.thino.createdAt+k)},_)):l.map((_,k)=>v.jsx(iN,{thino:_,handleOpenSettings:N},_.createdAt+k))]})},uxe=()=>{const{dailyNotesState:{app:e,view:t,settings:n}}=P.useContext(Lt),[r,a]=P.useState((n==null?void 0:n.MomentsBackgroundImage)||Tw);return P.useEffect(()=>{if(!(n!=null&&n.MomentsBackgroundImage)||!e){a(document.body.hasClass("theme-dark")?b2:Tw);return}const o=e.vault.adapter.getResourcePath(x.normalizePath(n.MomentsBackgroundImage));o&&!(n!=null&&n.MomentsBackgroundImage.startsWith("http"))?a(o):a(n==null?void 0:n.MomentsBackgroundImage)},[n==null?void 0:n.MomentsBackgroundImage,e]),P.useEffect(()=>{t&&t.registerEvent(t.app.workspace.on("css-change",()=>{a(document.body.hasClass("theme-dark")&&!(n!=null&&n.MomentsBackgroundImage)?b2:!document.body.hasClass("theme-dark")&&!(n!=null&&n.MomentsBackgroundImage)?Tw:n==null?void 0:n.MomentsBackgroundImage)}))},[t]),v.jsx("div",{className:"moments-view-background",style:{backgroundImage:`url("${r}")`}})},cxe=e=>{const{icon:t}=e,n=P.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return v.jsx("div",{className:"thino-moment-icon",ref:r=>{if(t){r==null||r.empty();return}t||r&&x.setIcon(r,"Memos")},style:{backgroundImage:`url("${t}")`},onClick:n})},iN=e=>{const{dailyNotesState:{settings:t,app:n}}=P.useContext(Lt),r=P.useRef(null),a=P.useRef(null),{thino:o}=e,[i,l]=P.useState("");return P.useEffect(()=>{if(!(t!=null&&t.MomentsIcon)||!n)return;const c=n.vault.adapter.getResourcePath(x.normalizePath(t.MomentsIcon));c&&!(t!=null&&t.MomentsIcon.startsWith("http"))?l(c):l(t==null?void 0:t.MomentsIcon)},[t==null?void 0:t.MomentsIcon,n]),P.useEffect(()=>{r.current&&x.setIcon(r.current,"more-horizontal")},[r.current]),v.jsxs("div",{className:"thino-moment-wrapper",children:[v.jsx(cxe,{icon:i}),v.jsxs("div",{ref:a,className:"thino-moment-container",children:[v.jsx("div",{className:"thino-moment-user-name",children:t==null?void 0:t.UserName}),v.jsx("div",{className:"thino-moment-user-content",children:v.jsx(ai,{memo:o})})]})]})},dxe='',fxe='',sN=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o{const{vault:t}=ft.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),a=new Blob([r],{type:"image/png"});return new Promise(o=>{const i=new FileReader;i.onloadend=()=>{const l=i.result;o(l)},i.readAsDataURL(a)})},hxe=async e=>{var n,r;const t=e.find(".thino-user-icon");if(!(t&&!/(http|app|base64)/.test((n=t==null?void 0:t.style)==null?void 0:n.backgroundImage))&&t&&(r=t==null?void 0:t.style)!=null&&r.backgroundImage){const a=await Rg(t);t.style.backgroundImage=`url("${a}")`}},qE=async e=>{const t=e.findAll("img");for(const n of t)if(n.src.startsWith("http://localhost")){const r=await Sf(n.getAttribute("path")||x.normalizePath(n==null?void 0:n.parentElement.getAttribute("src")));n.src=r}else{const r=await Mz(n);n.src=r}},pxe=async e=>{const{app:t,settings:n}=ft.getState();let r,a;const o=document.body.hasClass("theme-light"),i=o?e==="modern"?n==null?void 0:n.DefaultLightBackgroundImage:n==null?void 0:n.DefaultLightBackgroundImageForClean:e==="modern"?n==null?void 0:n.DefaultDarkBackgroundImage:n==null?void 0:n.DefaultDarkBackgroundImageForClean,l=await t.vault.adapter.exists(i)&&/\.(png|svg|jpg|jpeg)/g.test(i),c=i==null?void 0:i.startsWith("http");switch(e){case"clean":l||c?(a=i,r=c?await Sf(i):await lN(a)):r=o?Tw:b2;break;case"minimal":break;case"modern":default:l||c?(a=i,r=c?await Sf(i):await lN(a)):r="data:image/svg+xml;base64,"+btoa(o?dxe:fxe);break}switch(e){case"modern":{const f=document.querySelector(".dialog-wrapper .memo-background .property-image");f.style.backgroundImage="url('"+r+"')";break}case"clean":{const f=document.querySelector(".dialog-wrapper .memo-container.clean .memo-background .property-image");f&&(f.style.backgroundImage="url('"+r+"')");break}case"minimal":break;default:{const f=document.querySelector(".dialog-wrapper .memo-background .property-image");f.style.backgroundImage="url('"+r+"')"}}return r},mxe=e=>{const{memo:t,destroy:n}=e,{memos:r}=Le.getState().memoState,{view:a,app:o,settings:i}=Le.getState().dailyNotesState,l={...t,createdAtStr:ut.getDateTimeString(t.createdAt)},[c,f]=P.useState(!1),[h,g]=P.useState(l.content),[y,w]=P.useState(!1),S=P.useRef(null),D=P.useRef(null),I=P.useRef(null),[M,N]=P.useState(e.style||(o||window.app).loadLocalStorage("memoShareDialogStyle")||"clean"),[_,k]=P.useState(""),B=P.useRef(null),L=P.useRef(null),[R,V]=ne.useState(i==null?void 0:i.MomentsIcon);P.useEffect(()=>{if(!(i!=null&&i.MomentsIcon)||!o)return;const he=o.vault.adapter.getResourcePath(x.normalizePath(i.MomentsIcon));he&&!(i!=null&&i.MomentsIcon.startsWith("http"))?V(he):V(i==null?void 0:i.MomentsIcon)},[i==null?void 0:i.MomentsIcon,o]);let Y,Z;r.length&&(Y=r.length>0?r[r.length-1]:null,Y?Z=r?Math.ceil((Date.now()-ut.getTimeStampByDate(Y==null?void 0:Y.createdAt))/1e3/3600/24)+1:0:Z=0),i==null||i.ShareFooterEnd.replace("{UserName}",i==null?void 0:i.UserName);const Q=i==null?void 0:i.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",Z.toString());P.useEffect(()=>{!S.current||!D.current||(x.setIcon(S.current,"copy"),x.setIcon(D.current,"x"))},[S,D]),P.useEffect(()=>{I.current&&x.setIcon(I.current,"file-down")},[I]),P.useEffect(()=>{x.setIcon(S.current,y?"loader":"copy"),S.current.disabled=y,S.current.toggleClass("copying",y)},[y]),P.useEffect(()=>{if(!L.current||!a&&!e.view||c)return;g(t.content),L.current.hasChildNodes()&&L.current.empty();async function he(){var ie;(ie=L.current)==null||ie.toggleClass(["markdown-rendered"],!0),await x.MarkdownRenderer.render(o,t.content+` -`,L.current,t.path,a||e.view)}he(),setTimeout(async()=>{await G()},cA)},[B,L,l,M]);const G=async()=>{B.current&&(await hxe(B.current),await qE(B.current),pxe(M).then(he=>{he&&setTimeout(()=>{kb(B.current,{pixelRatio:window.devicePixelRatio*2}).then(ie=>{k(ie),f(!0)}).catch(()=>{})},600)}))},le=()=>{n()},se=P.useCallback(he=>{w(he)},[y]),fe=async()=>{const{vault:he}=Le.getState().dailyNotesState.app,ie=B.current.querySelector(".memo-shortcut-img");if(!ie)return;const ce=ie==null?void 0:ie.getAttribute("src").split("base64,")[1],X=sN(ce,"image/png");let ae;X.arrayBuffer().then(async De=>{const je="png",Re=Ju();for(const Fe in Re)if(Re[Fe]instanceof x.TFile){ae=Re[Fe];break}if(ae!==void 0){const Fe=await he.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,je,ae);await he.createBinary(Fe,De),new x.Notice(E("Save image successfully"))}})},$=async()=>{se(!0);const he=B.current.querySelector(".memo-shortcut-img");if(!he)return;const ie=he==null?void 0:he.getAttribute("src").split("base64,")[1],ce=sN(ie,"image/png");if(!ce){new x.Notice(E("Copy to clipboard failed"));return}const X=new ClipboardItem({"image/png":ce});window.navigator.clipboard.write([X]).then(()=>{setTimeout(()=>{se(!1)},500)}),new x.Notice(E("Copy to clipboard successfully"))};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ar("dialog-header-container"),children:[v.jsxs("p",{className:"title-text",children:[v.jsx("span",{className:"icon-text",children:"🥰"}),E("Share Memo Image")]}),v.jsxs("div",{className:"btn-group",children:[x.Platform.isMobile&&v.jsx("button",{ref:I,className:"btn download-btn",onClick:fe}),v.jsx("button",{ref:S,className:"btn copy-btn",onClick:$}),v.jsx("button",{ref:D,className:"btn close-btn",onClick:le})]})]}),v.jsxs("div",{className:ar("dialog-content-container",M),children:[v.jsx("div",{className:`tip-words-container ${_?"finish":"loading"}`,children:v.jsx("p",{className:"tip-text",children:E(_?"↗Click the button to save":"Image is generating...")})}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Default sharing style")}),v.jsx("div",{className:"setting-item-description",children:E("Set the default style for sharing thino, 'Modern' by default.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:M,onChange:async he=>{he.currentTarget.value!==M&&(f(!1),k(""),N(he.currentTarget.value),(o||window.app).saveLocalStorage("memoShareDialogStyle",he.currentTarget.value),await G())},children:[v.jsx("option",{value:"modern",children:E("Modern")}),v.jsx("option",{value:"clean",children:E("Clean")}),v.jsx("option",{value:"minimal",children:E("Minimal")}),v.jsx("option",{value:"gradient",children:E("Gradient")})]})})]}),v.jsxs("div",{className:ar("memo-container",M),ref:B,children:[v.jsx(ts,{when:_!=="",children:v.jsx("img",{className:"memo-shortcut-img",onClick:$,src:_})}),v.jsxs("div",{className:"memo-background",children:[v.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}}),v.jsx("span",{className:"background-container"}),v.jsxs("div",{className:"thino-user-header",children:[v.jsx("div",{className:"thino-user-icon",ref:he=>{if(i!=null&&i.MomentsIcon){he==null||he.empty();return}i!=null&&i.MomentsIcon||he&&x.setIcon(he,"Memos")},style:{backgroundImage:`url("${R}")`}}),v.jsxs("div",{className:"thino-user-info",children:[v.jsx("div",{className:"thino-user-name",children:i==null?void 0:i.UserName}),(i==null?void 0:i.MomentsQuote)&&v.jsx("div",{className:"thino-user-quote",children:i==null?void 0:i.MomentsQuote})]})]}),v.jsx("div",{ref:L,className:"memo-content-text",style:{minHeight:i.MinHeightForShare||"200px"}}),v.jsx("div",{className:"thino-time-footer",children:l.createdAt}),v.jsxs("div",{className:"watermark-container",children:[v.jsxs("span",{className:"normal-text footer-start",children:[v.jsx("div",{className:"property-social-icons"}),v.jsx("span",{className:"name-text",children:Q})]}),v.jsx("span",{className:"normal-text footer-end",children:v.jsx("span",{className:"name-text",children:"THINO"})})]})]})]})]})]})};function uf(e,t,n){Db({className:"share-memo-image-dialog"},mxe,{memo:e,style:t,view:n})}function lm(e=!0){const[t,n]=P.useState({isLoading:e,isFailed:!1,isSucceed:!1,isPending:!1});return{...t,setLoading:()=>{n({...t,isLoading:!0,isFailed:!1,isPending:!1,isSucceed:!1})},setFinish:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!1,isSucceed:!0})},setError:()=>{n({...t,isLoading:!1,isFailed:!0,isPending:!1,isSucceed:!1})},setPending:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!0,isSucceed:!1})}}}const gxe=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=P.useContext(Lt),{memo:a,handleUnarchivedMemoAction:o}=e,i=ne.useRef(null),l=ne.useRef(null),[c,f]=ne.useState(""),h={...a,createdAtStr:ut.getDateTimeString(a.createdAt),deletedAtStr:ut.getDateTimeString(a.deletedAt||a.createdAt)},[g,y]=Xl(!1),w={restore:P.useRef(null),delete:P.useRef(null),source:P.useRef(null)};P.useEffect(()=>{l&&(x.setIcon(w.restore.current,"archive-restore"),x.setIcon(w.delete.current,"trash"),x.setIcon(w.source.current,"home"))},[l]),P.useEffect(()=>{if(!i.current||!l.current||i.current.hasChildNodes()&&a.content===c||!r)return;f(a.content),i.current.hasChildNodes()&&i.current.empty();async function N(){var k,B;(k=i.current)==null||k.toggleClass(["markdown-rendered"],!0),await x.MarkdownRenderer.render(t,a.content+` -`,i.current,a.path,r);const _=(B=i.current)==null?void 0:B.querySelectorAll(".internal-link");_==null||_.forEach(L=>{const R=L,V=R.getAttribute("data-href");if(!V)return;t.metadataCache.getFirstLinkpathDest(V,a.path)||L.classList.add("is-unresolved"),R.addEventListener("mouseover",Z=>{Z.stopPropagation(),t.workspace.trigger("hover-link",{event:Z,source:"thino",hoverParent:r.containerEl,targetEl:R,linktext:V,sourcePath:R.href})})})}N()},[a.content,l]);const S=async()=>{switch(h.sourceType){case"DAILY":await W2(h.id,h.path);break;case"CANVAS":await Z2(h.id,h.path);break;case"MULTI":await V2(h.path);break;case"FILE":await $2(h.id,h.path);break}},D=async()=>{if(g)try{if(n.DeleteThinoDirectly)await we.deleteMemoById(h.id);else{const N=await we.hideMemoById(h.id);N&&we.editMemo(N)}}catch(N){new x.Notice(N.message)}else y()},I=async()=>{try{const N=await we.unarchiveMemo(h);N&&we.editMemo(N),o(h.id),new x.Notice(E("RESTORE SUCCEED"))}catch(N){new x.Notice(N.message)}},M=()=>{g&&y(!1)};return v.jsxs("div",{ref:l,className:`memo-wrapper ${"memos-"+h.id}`,onMouseLeave:M,children:[v.jsxs("div",{className:"memo-top-wrapper",children:[v.jsxs("span",{className:"time-text",children:[E("ARCHIVED AT")," ",h.updatedAt]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:N=>{N&&x.setIcon(N,"more-horizontal")},className:"btn more-action-btn"}),v.jsx("div",{className:"more-action-btns-wrapper",children:v.jsxs("div",{className:"more-action-btns-container",children:[v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.restore,className:"more-action-item-icon"}),v.jsx("span",{className:"btn restore-btn",onClick:I,children:E("RESTORE")})]}),v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.source,className:"more-action-item-icon"}),v.jsx("span",{className:"btn",onClick:S,children:E("SOURCE")})]}),v.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[v.jsx("span",{ref:w.delete,className:"more-action-item-icon"}),v.jsx("span",{className:`btn delete-btn ${g?"final-confirm":""}`,onClick:D,children:E(g?"CONFIRM!":"DELETE")})]})]})})]})]}),v.jsx("div",{ref:i,className:"memo-content-text"})]})},Bu=e=>{var n;const t=new Map;for(const r of e){const a=r.path;t.has(a)||t.set(a,[]),(n=t.get(a))==null||n.push(r)}return Array.from(t).map(([r,a])=>({path:r,thinos:a}))},vxe=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:i,filter:l}=t,c=on.getQueryById(l);return!!(r||a&&a.from{let g=!0;if(h.thinoType!==void 0&&n&&h.thinoType==="TASK-DONE"&&(g=!1),h.content.contains("comment:")&&(g=!1),c){const y=JSON.parse(c.querystring);Array.isArray(y)&&(g=Vp(h,y))}if(r){const y=new Set;for(const w of Array.from(h.content.match($r)||[])){const D=w.replace($r,"$1").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}for(const w of Array.from(h.content.match(ua)||[])){const D=w.replace(ua,"$1").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}for(const w of Array.from(h.content.match(Wa)||[])){const D=w.replace(Wa,"$2").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}y.has(r)||(g=!1)}return a&&a.froma.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(h.content.match($r)!==null||h.content.match(Wa)!==null||h.content.match(ua)!==null)||o==="LINKED"&&h.content.match(Af)===null||o==="IMAGED"&&h.content.match(Ff)===null||o==="CONNECTED"&&h.content.match(ad)===null)&&(g=!1),i&&!h.content.toLowerCase().includes(i.toLowerCase())&&(g=!1),g}):e.filter(h=>!h.content.contains("comment:"))},yxe=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=P.useContext(Lt),r=lm(),[a,o]=P.useState([]),i=ne.useRef(null),l=ne.useRef(null);P.useEffect(()=>{l.current&&x.setIcon(l.current,"more-horizontal")},[l]),P.useEffect(()=>{const S=vxe({memos:n.filter(D=>D.rowStatus==="ARCHIVED"&&D.deletedAt===""),query:e,HideDoneTasks:!1});o(S),r.setFinish()},[n,i.current,e]);const c=P.useCallback(S=>{o(D=>D.filter(I=>I.id!==S))},[]),f=P.useCallback(S=>{o(D=>D.filter(I=>I.id!==S))},[]),h=P.useCallback(()=>{dt.setShowSiderbarInMobileView(!0)},[]),g=async()=>{if(!((a==null?void 0:a.length)>0))return;if(!await Vl()){fn();return}const S=[...a];try{const D=S.filter(_=>_.sourceType==="DAILY"),I=S.filter(_=>_.sourceType!=="DAILY"),M=await we.unarchiveThinoBulk(I);for(const _ of M)_&&we.editMemo(_);const N=Bu(D);for(const{path:_,thinos:k}of N)await we.dealWithDailyThinoBulk(_,k,"restoreFromArchive");new x.Notice(E("RESTORE SUCCEED")),at.clearQuery()}catch(D){console.error("error",D),new x.Notice(D.message)}},y=async()=>{if(!((a==null?void 0:a.length)>0))return;if(!await Vl()){fn();return}const S=[...a],D=ft.getState().settings.DeleteThinoDirectly;try{const I=S.filter(_=>_.sourceType==="DAILY"),M=S.filter(_=>_.sourceType!=="DAILY");for(const _ of M)if(D)await we.deleteMemoById(_.id);else{const k=await we.hideMemoById(_.id);k&&we.editMemo(k)}const N=Bu(I);for(const{path:_,thinos:k}of N)await we.dealWithDailyThinoBulk(_,k,D?"deleteForever":"delete");at.clearQuery()}catch(I){console.error("error",I),new x.Notice(I.message)}},w=S=>{const D=new x.Menu;D.addItem(I=>{I.setTitle(E("Bulk restore")).setIcon("archive").onClick(async()=>{new _s(app,E("RESTORE"),async M=>{M==="confirm"&&await g()}).open()})}).addItem(I=>{I.setTitle(E("Bulk delete")).setIcon("trash").onClick(async()=>{new _s(app,E("DELETE"),async M=>{M==="confirm"&&await y()}).open()})}),D.showAtMouseEvent(S.nativeEvent)};return v.jsxs("div",{className:"memo-trash-wrapper",ref:i,children:[v.jsxs("div",{className:"section-header-container",children:[v.jsxs("div",{className:"title-text",children:[v.jsx(ts,{when:t,children:v.jsx("button",{ref:S=>{S&&x.setIcon(S,"menu")},className:"btn action-btn clickable-icon",onClick:h})}),v.jsxs("span",{className:"go-home-btn",onClick:()=>{at.clearQuery(),at.setPathname("/")},children:["🏠 ",E("Return To Home Page")]}),v.jsx("span",{ref:l,className:"menu-popup-btn",onClick:w})]}),v.jsx(_v,{})]}),v.jsx(yy,{thinosCount:a.length,thinos:a}),r.isLoading?v.jsx("div",{className:"tip-text-container",children:v.jsx("p",{className:"tip-text",children:E("Fetching data...")})}):a.length===0?v.jsx("div",{className:"tip-text-container",children:v.jsx("p",{className:"tip-text",children:E("Here is No Memos.")})}):v.jsx("div",{className:"deleted-memos-container",children:a.map(S=>v.jsx(gxe,{memo:S,handleUnarchivedMemoAction:f,handleDeletedMemoAction:c},`${S.id}-${S.updatedAt}`))})]})},Vl=async()=>{var r;const{verifyState:e}=ft.getState(),t=!x.Platform.isDesktop&&await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId()),n=x.Platform.isDesktop?await cr():t.identifier||t.uuid;return e&&(e==null?void 0:e.appId)===n},wxe=async(e,t)=>{if(!(t!=="chat"&&t!=="moments")){if(t==="moments"){const n=e.querySelectorAll(".thino-moment-icon"),r=e.find(".moments-view-user-icon"),a=e.find(".moments-view-background");for(const o of n){const i=await Rg(o);o.style.backgroundImage=`url(${i})`}if(r){const o=await Rg(r);r.style.backgroundImage=`url(${o})`}if(a){const o=await Rg(a);a.style.backgroundImage=`url(${o})`}}else if(t==="chat"){const n=e.querySelectorAll(".icon-img");for(const r of n){const a=await Rg(r);r.style.backgroundImage=`url(${a})`}}}};class _s extends x.Modal{constructor(t,n,r){super(t),this.title=n,this.cb=r}onOpen(){super.onOpen(),this.containerEl.toggleClass("thino-bulk-action-dialog",!0),this.titleEl.setText(this.title+" "+E("Confirm?")),this.contentEl.createEl("button",{cls:"mod-warning",text:E("Confirm?").replace(/\?|?/,"")}).onclick=()=>{this.cb("confirm"),this.close()},this.contentEl.createEl("button",{text:E("Cancel")}).onclick=()=>{this.cb("cancel"),this.close()}}onClose(){super.onClose()}}class bxe extends x.Modal{constructor(n,r){super(n);Se(this,"root");this.thinos=r}onOpen(){super.onOpen(),this.containerEl.toggleClass(["thino-bulk-action-dialog","tag-actions"],!0),this.root=rs.createRoot(this.contentEl),this.root.render(v.jsx(is,{store:Le,context:Lt,children:v.jsx(Cz,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos})}))}onClose(){var n;super.onClose(),(n=this.root)==null||n.unmount()}}const yy=({thinosCount:e,thinos:t})=>{const{globalState:{memoListView:n},locationState:{query:r,pathname:a},dailyNotesState:{settings:o,app:i}}=P.useContext(Lt),{tag:l,duration:c,type:f,text:h,filter:g,path:y}=r,w=on.getQueryById(g),S=!!(l||c&&c.from{D&&x.setIcon(D.current,"more-horizontal")},[D]);const I=async()=>{if(!((t==null?void 0:t.length)>0))return;const Y=gz(t),Z=yz(Y);await ut.copyTextToClipboard(Z),new x.Notice(E("Copied to clipboard Successfully"))},M=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const Y=[...t],Z=o.DeleteThinoDirectly;try{const Q=Y.filter(se=>se.sourceType==="DAILY"),G=Y.filter(se=>se.sourceType!=="DAILY");for(const se of G)if(Z)await we.deleteMemoById(se.id);else{const fe=await we.hideMemoById(se.id);fe&&we.editMemo(fe)}const le=Bu(Q);for(const{path:se,thinos:fe}of le)await we.dealWithDailyThinoBulk(se,fe,Z?"deleteForever":"delete");we.updateTagsState(),at.clearQuery()}catch(Q){console.error("error",Q),new x.Notice(Q.message)}},N=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const Y=[...t],Z=ft.getState().settings.startSync,Q=ft.getState().app,G=Q==null?void 0:Q.loadLocalStorage("tokenForSync");try{const le=Y.filter($=>$.sourceType==="DAILY"),se=Y.filter($=>$.sourceType!=="DAILY");for(const $ of se)await we.deleteMemoById($.id);const fe=Bu(le);for(const{path:$,thinos:he}of fe){const ie=await we.dealWithDailyThinoBulk($,he,"deleteForever");if(!(!G||!Z))for(const ce of ie)ce&&ce.webId&&await A2(ce.webId)}we.updateTagsState(),at.clearQuery(),new x.Notice(E("DELETE SUCCEED"))}catch(le){console.error("error",le),new x.Notice(le.message)}},_=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const Y=[...t];try{const Z=Y.filter(se=>se.sourceType==="DAILY"),Q=Y.filter(se=>se.sourceType!=="DAILY"),G=await we.unarchiveThinoBulk(Q);for(const se of G)se&&we.editMemo(se);const le=Bu(Z);for(const{path:se,thinos:fe}of le)await we.dealWithDailyThinoBulk(se,fe,"restoreFromArchive");new x.Notice(E("RESTORE SUCCEED")),we.updateTagsState(),at.clearQuery()}catch(Z){console.error("error",Z),new x.Notice(Z.message)}},k=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const Y=[...t],Z=ft.getState().settings.startSync,Q=ft.getState().app,G=Q==null?void 0:Q.loadLocalStorage("tokenForSync");try{const le=Y.filter($=>$.sourceType==="DAILY"),se=Y.filter($=>$.sourceType!=="DAILY");for(const $ of se){const he=await we.restoreMemoById($.id);he&&he.webId&&G&&Z&&await Xg(he.webId),he&&we.editMemo(he)}const fe=Bu(le);for(const{path:$,thinos:he}of fe){const ie=await we.dealWithDailyThinoBulk($,he,"restoreFromDelete");for(const ce of ie)ce&&ce.webId&&G&&Z&&await Xg(ce.webId),ce&&we.editMemo(ce)}we.updateTagsState(),at.clearQuery(),new x.Notice(E("RESTORE SUCCEED"))}catch(le){new x.Notice(le.message)}},B=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const Y=[...t];try{const Z=Y.filter(se=>se.sourceType==="DAILY"),Q=Y.filter(se=>se.sourceType!=="DAILY"),G=await we.archiveThinoBulk(Q);for(const se of G)se&&we.editMemo(se);const le=Bu(Z);for(const{path:se,thinos:fe}of le)await we.dealWithDailyThinoBulk(se,fe,"archive");we.updateTagsState(),at.clearQuery()}catch(Z){console.error("error",Z),new x.Notice(Z.message)}},L=async()=>{if((t==null?void 0:t.length)>0){if(!await Vl()){fn();return}new bxe(i,t).open()}},R=async Y=>{document.body.toggleClass("thino-share-page",!0),setTimeout(async()=>{if(new x.Notice(E("Image is generating...")),!Y){new x.Notice(E("No content to generate."));return}await wxe(Y,n),await qE(Y);let Z;document.body.hasClass("theme-dark")?Z="#232323":Z="#eaeaea",kb(Y,{backgroundColor:Z,pixelRatio:window.devicePixelRatio*2}).then(Q=>{if(o!=null&&o.AutoSaveWhenOnMobile&&x.Platform.isMobile){const G=Q.split("base64,")[1];gb(G,"image/png").arrayBuffer().then(async se=>{let fe;const $="png",he=Ju();for(const ie in he)if(he[ie]instanceof x.TFile){fe=he[ie];break}fe!==void 0&&await i.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,$,fe),se)})}document.body.toggleClass("thino-share-page",!1),Nb({imgUrl:Q}),new x.Notice(E("Image generated successfully.")),Y.hasClass("share-image")?Y.toggleClass("share-image",!1):Y.closest(".share-image").toggleClass("share-image",!1)}).catch(Q=>{document.body.toggleClass("thino-share-page",!1),console.error(Q)})},0)},V=Y=>{const Z=new x.Menu;switch(Z.addItem(Q=>{Q.setTitle(E("Copy filtered thinos")).setIcon("copy").onClick(async()=>{await I()})}),Z.addItem(Q=>{Q.setTitle(E("Share filtered thinos as image")).setIcon("image").onClick(async()=>{const G=document.querySelector(".memolist-container");G.toggleClass("share-image",!0);try{if(n==="calendar"){if(G.find(".rbc-agenda-table")){const le=G.find(".rbc-agenda-table");await R(le)}if(G.find(".rbc-month-view")){const le=G.find(".rbc-month-view");await R(le)}}else if(n==="table"){if(G.find(".thino-table")){const le=G.find(".thino-table");await R(le)}}else await R(G)}catch(le){console.error(le),new x.Notice(E("Failed to generate image.")),G.toggleClass("share-image",!1)}})}),Z.addItem(Q=>{Q.setTitle(E("Merge thinos in to thino share image")).setIcon("image").onClick(async()=>{let G="";t.forEach((se,fe)=>{G+=`> [!thino] ${se.createdAt} -${se.content.split(` +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=g9,t.componentWillReceiveProps=v9),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=y9;var l=t.componentDidUpdate;t.componentDidUpdate=function(f,h,g){var y=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:g;l.call(this,f,h,y)}}return e}var aW="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function w9(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||"Component",a=tW(e),o=Object.keys(t),i=o.map(dw);a||!n.length||ov(!1);var l=function(f){nW(h,f);function h(){for(var y,w=arguments.length,S=new Array(w),D=0;D1?_-1:0),U=1;U<_;U++)V[U-1]=arguments[U];(L=y.props)[N].apply(L,[R].concat(V)),y._notifying=!1}y.unmounted||y.setState(function(Z){var Q,G=Z.values;return{values:Pr(Object.create(null),G,(Q={},Q[M]=R,Q))}})};y.handlers[N]=B}),n.length&&(y.attachRef=function(M){y.inner=M});var I=Object.create(null);return o.forEach(function(M){I[M]=y.props[dw(M)]}),y.state={values:I,prevProps:{}},y}var g=h.prototype;return g.shouldComponentUpdate=function(){return!this._notifying},h.getDerivedStateFromProps=function(w,S){var D=S.values,I=S.prevProps,M={values:Pr(Object.create(null),D),prevProps:{}};return o.forEach(function(N){M.prevProps[N]=w[N],!Xx(w,N)&&Xx(I,N)&&(M.values[N]=w[dw(N)])}),M},g.componentWillUnmount=function(){this.unmounted=!0},g.render=function(){var w=this,S=this.props,D=S.innerRef,I=Ab(S,["innerRef"]);i.forEach(function(N){delete I[N]});var M={};return o.forEach(function(N){var B=w.props[N];M[N]=B!==void 0?B:w.state.values[N]}),ne.createElement(e,Pr({},I,M,this.handlers,{ref:D||this.attachRef}))},h}(ne.Component);rW(l),l.displayName="Uncontrolled("+r+")",l.propTypes=Pr({innerRef:function(){}},eW(t)),n.forEach(function(f){l.prototype[f]=function(){var g;return(g=this.inner)[f].apply(g,arguments)}});var c=l;return ne.forwardRef&&(c=ne.forwardRef(function(f,h){return ne.createElement(l,Pr({},f,{innerRef:h,__source:{fileName:aW,lineNumber:128},__self:this}))}),c.propTypes=l.propTypes),c.ControlledComponent=e,c.deferControlTo=function(f,h,g){return h===void 0&&(h={}),w9(f,Pr({},t,h),g)},c}function b9(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt}),Wv=$p(function(e,t){return e>=t}),uI=$p(function(e,t){return e=t&&a.getHours()-n.getHours()a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r-1&&e%1==0&&e<=qW}var dI=GW,JW=cI,KW=dI;function QW(e){return e!=null&&KW(e.length)&&!JW(e)}var Zv=QW,XW=9007199254740991,e$=/^(?:0|[1-9]\d*)$/;function t$(e,t){var n=typeof e;return t=t??XW,!!t&&(n=="number"||n!="symbol"&&e$.test(e))&&e>-1&&e%1==0&&e{t.current=e},[e]),t}function fM(e){const t=rZ(e);return P.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function hM(){return P.useState(null)}function aZ(){const e=P.useRef(!0),t=P.useRef(()=>e.current);return P.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function oZ(e){const t=aZ();return[e[0],P.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var iZ=K6({defaultModifiers:[Z6,G6,Y6,z6,q6,$6,J6,U6]}),pM=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},sZ={name:"applyStyles",enabled:!1},lZ={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,a=r.reference,o=r.popper;if("removeAttribute"in a){var i=(a.getAttribute("aria-describedby")||"").split(",").filter(function(l){return l.trim()!==o.id});i.length?a.setAttribute("aria-describedby",i.join(",")):a.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,a=r.elements,o=a.popper,i=a.reference,l=(n=o.getAttribute("role"))==null?void 0:n.toLowerCase();if(o.id&&l==="tooltip"&&"setAttribute"in i){var c=i.getAttribute("aria-describedby");if(c&&c.split(",").indexOf(o.id)!==-1)return;i.setAttribute("aria-describedby",c?c+","+o.id:o.id)}}},uZ=[];function cZ(e,t,n){var r=n===void 0?{}:n,a=r.enabled,o=a===void 0?!0:a,i=r.placement,l=i===void 0?"bottom":i,c=r.strategy,f=c===void 0?"absolute":c,h=r.modifiers,g=h===void 0?uZ:h,y=Ab(r,["enabled","placement","strategy","modifiers"]),w=P.useRef(),S=P.useCallback(function(){var k;(k=w.current)==null||k.update()},[]),D=P.useCallback(function(){var k;(k=w.current)==null||k.forceUpdate()},[]),I=oZ(P.useState({placement:l,update:S,forceUpdate:D,attributes:{},styles:{popper:pM(f),arrow:{}}})),M=I[0],N=I[1],B=P.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(R){var L=R.state,_={},V={};Object.keys(L.elements).forEach(function(U){_[U]=L.styles[U],V[U]=L.attributes[U]}),N({state:L,styles:_,attributes:V,update:S,forceUpdate:D,placement:L.placement})}}},[S,D,N]);return P.useEffect(function(){!w.current||!o||w.current.setOptions({placement:l,strategy:f,modifiers:[].concat(g,[B,sZ])})},[f,l,B,o]),P.useEffect(function(){if(!(!o||e==null||t==null))return w.current=iZ(e,t,Pr({},y,{placement:l,strategy:f,modifiers:[].concat(g,[lZ,B])})),function(){w.current!=null&&(w.current.destroy(),w.current=void 0,N(function(k){return Pr({},k,{attributes:{},styles:{popper:pM(f)}})}))}},[o,e,t]),M}function dZ(e,t,n,r){var a=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,a),n.__once&&e.removeEventListener(t,n.__once,a)}function _g(e,t,n,r){return nZ(e,t,n,r),function(){dZ(e,t,n,r)}}function fZ(e){return e&&"setState"in e?J2.findDOMNode(e):e??null}const hZ=function(e){return Gv(fZ(e))};var pZ=27,mM=function(){};function mZ(e){return e.button===0}function gZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var gM=function(t){return t&&("current"in t?t.current:t)};function vZ(e,t,n){var r=n===void 0?{}:n,a=r.disabled,o=r.clickTrigger,i=o===void 0?"click":o,l=P.useRef(!1),c=t||mM,f=P.useCallback(function(y){var w,S=gM(e);dz(!!S,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),l.current=!S||gZ(y)||!mZ(y)||!!pv(S,(w=y.composedPath==null?void 0:y.composedPath()[0])!=null?w:y.target)},[e]),h=fM(function(y){l.current||c(y)}),g=fM(function(y){y.keyCode===pZ&&c(y)});P.useEffect(function(){if(!(a||e==null)){var y=window.event,w=hZ(gM(e)),S=_g(w,i,f,!0),D=_g(w,i,function(N){if(N===y){y=void 0;return}h(N)}),I=_g(w,"keyup",function(N){if(N===y){y=void 0;return}g(N)}),M=[];return"ontouchstart"in w.documentElement&&(M=[].slice.call(w.body.children).map(function(N){return _g(N,"mousemove",mM)})),function(){S(),D(),I(),M.forEach(function(N){return N()})}}},[e,a,i,f,h,g])}function yZ(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function wZ(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function bZ(e){var t,n,r,a,o=e.enabled,i=e.enableEvents,l=e.placement,c=e.flip,f=e.offset,h=e.fixed,g=e.containerPadding,y=e.arrowElement,w=e.popperConfig,S=w===void 0?{}:w,D=yZ(S.modifiers);return Pr({},S,{placement:l,enabled:o,strategy:h?"fixed":S.strategy,modifiers:wZ(Pr({},D,{eventListeners:{enabled:i},preventOverflow:Pr({},D.preventOverflow,{options:g?Pr({padding:g},(t=D.preventOverflow)==null?void 0:t.options):(n=D.preventOverflow)==null?void 0:n.options}),offset:{options:Pr({offset:f},(r=D.offset)==null?void 0:r.options)},arrow:Pr({},D.arrow,{enabled:!!y,options:Pr({},(a=D.arrow)==null?void 0:a.options,{element:y})}),flip:Pr({enabled:!!c},D.flip)}))})}function SZ(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function DZ(e,t){e.classList?e.classList.add(t):SZ(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function vM(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function TZ(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=vM(e.className,t):e.setAttribute("class",vM(e.className&&e.className.baseVal||"",t))}var F0;function H9(e){if((!F0&&F0!==0||e)&&pI){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),F0=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return F0}var zS=function(t){var n;return typeof document>"u"?null:t==null?Gv().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function yM(e,t){var n=P.useState(function(){return zS(e)}),r=n[0],a=n[1];if(!r){var o=zS(e);o&&a(o)}return P.useEffect(function(){t&&r&&t(r)},[t,r]),P.useEffect(function(){var i=zS(e);i!==r&&a(i)},[e,r]),r}const wM=e=>!e||typeof e=="function"?e:t=>{e.current=t};function IZ(e,t){const n=wM(e),r=wM(t);return a=>{n&&n(a),r&&r(a)}}function EZ(e,t){return P.useMemo(()=>IZ(e,t),[e,t])}var mI=ne.forwardRef(function(e,t){var n=e.flip,r=e.offset,a=e.placement,o=e.containerPadding,i=o===void 0?5:o,l=e.popperConfig,c=l===void 0?{}:l,f=e.transition,h=hM(),g=h[0],y=h[1],w=hM(),S=w[0],D=w[1],I=EZ(y,t),M=yM(e.container),N=yM(e.target),B=P.useState(!e.show),k=B[0],R=B[1],L=cZ(N,g,bZ({placement:a,enableEvents:!!e.show,containerPadding:i||5,flip:n,offset:r,arrowElement:S,popperConfig:c})),_=L.styles,V=L.attributes,U=Ab(L,["styles","attributes"]);e.show?k&&R(!1):!e.transition&&!k&&R(!0);var Z=function(){R(!0),e.onExited&&e.onExited.apply(e,arguments)},Q=e.show||f&&!k;if(vZ(g,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!Q)return null;var G=e.children(Pr({},U,{show:!!e.show,props:Pr({},V.popper,{style:_.popper,ref:I}),arrowProps:Pr({},V.arrow,{style:_.arrow,ref:D})}));if(f){var re=e.onExit,de=e.onExiting,fe=e.onEnter,$=e.onEntering,he=e.onEntered;G=ne.createElement(f,{in:e.show,appear:!0,onExit:re,onExiting:de,onExited:Z,onEnter:fe,onEntering:$,onEntered:he},G)}return M?J2.createPortal(G,M):null});mI.displayName="Overlay";mI.propTypes={show:ke.bool,placement:ke.oneOf(X2),target:ke.any,container:ke.any,flip:ke.bool,children:ke.func.isRequired,containerPadding:ke.number,popperConfig:ke.object,rootClose:ke.bool,rootCloseEvent:ke.oneOf(["click","mousedown"]),rootCloseDisabled:ke.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a-1}var UZ=HZ,YZ=Pb;function zZ(e,t){var n=this.__data__,r=YZ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var VZ=zZ,WZ=MZ,$Z=jZ,ZZ=_Z,qZ=UZ,GZ=VZ;function Gp(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var f=o.get(e),h=o.get(t);if(f&&h)return f==t&&h==e;var g=-1,y=!0,w=n&sJ?new rJ:void 0;for(o.set(e,t),o.set(t,e);++g0&&n(l)?t>1?aF(l,t-1,n,r,a):wte(a,l):r||(a[a.length]=l)}return a}var oF=aF;function Ste(e){return function(t,n,r){for(var a=-1,o=Object(t),i=r(t),l=i.length;l--;){var c=i[e?l:++a];if(n(o[c],c,o)===!1)break}return t}}var Dte=Ste,Tte=Dte,Ite=Tte(),Ete=Ite,Cte=Ete,xte=Jv;function Mte(e,t){return e&&Cte(e,t,xte)}var kI=Mte,kte=Zv;function Nte(e,t){return function(n,r){if(n==null)return n;if(!kte(n))return e(n,r);for(var a=n.length,o=t?a:-1,i=Object(n);(t?o--:++ot||o&&i&&c&&!l&&!f||r&&i&&c||!n&&c||!a)return 1;if(!r&&!o&&!f&&e=l)return c;var f=n[r];return c*(f=="desc"?-1:1)}}return e.index-t.index}var $te=Wte,GS=MI,Zte=Yb,qte=Vb,Gte=Bte,Jte=Ute,Kte=Bb,Qte=$te,Xte=zb,ene=ss;function tne(e,t,n){t.length?t=GS(t,function(o){return ene(o)?function(i){return Zte(i,o.length===1?o[0]:o)}:o}):t=[Xte];var r=-1;t=GS(t,Kte(qte));var a=Gte(e,function(o,i,l){var c=GS(t,function(f){return f(o)});return{criteria:c,index:++r,value:o}});return Jte(a,function(o,i){return Qte(o,i,n)})}var nne=tne;function rne(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var ane=rne,one=ane,JM=Math.max;function ine(e,t,n){return t=JM(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=JM(r.length-t,0),i=Array(o);++a0){if(++t>=mne)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var wne=yne,bne=pne,Sne=wne,Dne=Sne(bne),lF=Dne,Tne=zb,Ine=iF,Ene=lF;function Cne(e,t){return Ene(Ine(e,t,Tne),e+"")}var uF=Cne,xne=oF,Mne=nne,kne=uF,QM=Ob,Nne=kne(function(e,t){if(e==null)return[];var n=t.length;return n>1&&QM(e,t[0],t[1])?t=[]:n>2&&QM(t[0],t[1],t[2])&&(t=[t[0]]),Mne(e,xne(t,1),[])}),Ane=Nne;const Fne=qt(Ane);function HT(e,t){var n=hI(e);return n?n.innerWidth:t?e.clientWidth:gf(e).width}function cF(e){return p9(e)||k9(e)||sI(e)||m9()}function One(e,t){for(var n=-1,r=e==null?0:e.length;++n1),o}),Iie(e,xie(e),n),r&&(n=Sie(n,Mie|kie|Nie,Eie));for(var a=t.length;a--;)Die(n,t[a]);return n}),Fie=Aie;const Oie=qt(Fie);var Pie=uF,jie=$v,Lie=Ob,Rie=Wb,bF=Object.prototype,_ie=bF.hasOwnProperty,Bie=Pie(function(e,t){e=Object(e);var n=-1,r=t.length,a=r>2?t[2]:void 0;for(a&&Lie(t[0],t[1],a)&&(r=1);++n0&&(l=l[0]),c=(l=l.filter(function(h){return h}))[0];for(var f=1;f2?r-2:0),o=2;o2&&arguments[2]!==void 0?arguments[2]:"day",r=e,a=[];Wp(r,t,n);)a.push(r),r=Vs(r,1,n);return a}function vse(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=$a(e,"day"),e=hv(e,hv(t)),e=xp(e,xp(t)),e=fv(e,fv(t)),dv(e,dv(t)))}function d3(e){return hv(e)===0&&xp(e)===0&&fv(e)===0&&dv(e)===0}function yse(e,t,n,r){return n==="day"&&(n="date"),Math.abs(nM[n](e,void 0,r)-nM[n](t,void 0,r))}function FI(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+$a(e,n)/c3[n]-+$a(t,n)/c3[n]))}var wse=ke.oneOfType([ke.string,ke.func]);function bse(e,t,n,r,a){var o=typeof r=="function"?r(n,a,e):t.call(e,n,r,a);return ov(o==null||typeof o=="string","`localizer format(..)` must return a string, null, or undefined"),o}function Sse(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function OI(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function Dse(e,t){return FI(e,t,"minutes")+OI(e,t)}function Tse(e){var t=$a(e,"day");return FI(t,e,"minutes")+OI(t,e)}function Ise(e,t){return uI(e,t,"day")}function Ese(e,t,n){var r=Vv(e,t,"minutes");return r?Wv(t,n,"minutes"):Fb(t,n,"minutes")}function UT(e,t){return yse(e,t,"day")}function Cse(e){var t=e.evtA,n=t.start,r=t.end,a=t.allDay,o=e.evtB,i=o.start,l=o.end,c=o.allDay,f=+$a(n,"day")-+$a(i,"day"),h=UT(n,r),g=UT(i,l);return f||g-h||!!c-!!a||+n-+i||+r-+l}function xse(e){var t=e.event,n=t.start,r=t.end,a=e.range,o=a.start,i=a.end,l=$a(n,"day"),c=Wp(l,i,"day"),f=lI(l,r,"minutes"),h=f?Fb(r,o,"minutes"):Wv(r,o,"minutes");return c&&h}function Mse(e,t){return Vv(e,t,"day")}function kse(e,t){return d3(e)&&d3(t)}var Nse=ka(function e(t){var n=this;Ma(this,e),ov(typeof t.format=="function","date localizer `format(..)` must be a function"),ov(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||wse,this.formats=t.formats,this.format=function(){for(var r=arguments.length,a=new Array(r),o=0;o1,de=I.eventProp(i,Q,Z,l),fe=ne.createElement("div",{className:"rbc-event-content",title:U||void 0},B?ne.createElement(B,{event:i,continuesPrior:w,continuesAfter:S,title:V,isAllDay:G,localizer:y,slotStart:R,slotEnd:L}):V);return ne.createElement(k,Object.assign({},this.props,{type:"date"}),ne.createElement("div",Object.assign({},_,{style:tr(tr({},de.style),a),className:ca("rbc-event",o,de.className,{"rbc-selected":l,"rbc-event-allday":re,"rbc-event-continues-prior":w,"rbc-event-continues-after":S}),onClick:function(he){return f&&f(i,he)},onDoubleClick:function(he){return h&&h(i,he)},onKeyDown:function(he){return g&&g(i,he)}}),typeof M=="function"?M(fe):fe))}}]),t}(ne.Component);function Zb(e,t){return!e||t==null?!1:XQ(e,t)}function IF(e,t){var n=e.right-e.left,r=n/t;return r}function EF(e,t,n,r){var a=IF(e,r);return n?r-1-Math.floor((t-e.left)/a):Math.floor((t-e.left)/a)}function Lse(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function Rse(e,t,n,r,a){var o=-1,i=-1,l=r-1,c=IF(t,r),f=EF(t,n.x,a,r),h=t.topn.y,g=t.tope.y,y=e.y>t.bottom,w=t.top>e.y,S=n.topt.bottom;return S&&(o=0,i=l),h&&(w?(o=0,i=f):y&&(o=f,i=l)),g&&(o=i=a?l-Math.floor((e.x-t.left)/c):Math.floor((e.x-t.left)/c),h?fN?i-M-_:i+_+f,U=R>B?l+L-I+c:l+L;return{topOffset:V,leftOffset:U}}function Bse(e){var t=e.containerRef,n=e.accessors,r=e.getters,a=e.selected,o=e.components,i=e.localizer,l=e.position,c=e.show,f=e.events,h=e.slotStart,g=e.slotEnd,y=e.onSelect,w=e.onDoubleClick,S=e.onKeyPress,D=e.handleDragStart,I=e.popperRef,M=e.target,N=e.offset;Pse({ref:I,callback:c}),P.useLayoutEffect(function(){var R=_se({target:M,offset:N,container:t.current,box:I.current}),L=R.topOffset,_=R.leftOffset;I.current.style.top="".concat(L,"px"),I.current.style.left="".concat(_,"px")},[N.x,N.y,M]);var B=l.width,k={minWidth:B+B/2};return ne.createElement("div",{style:k,className:"rbc-overlay",ref:I},ne.createElement("div",{className:"rbc-overlay-header"},i.format(h,"dayHeaderFormat")),f.map(function(R,L){return ne.createElement(TF,{key:L,type:"popup",localizer:i,event:R,getters:r,onSelect:y,accessors:n,components:o,onDoubleClick:w,onKeyPress:S,continuesPrior:i.lt(n.end(R),h,"day"),continuesAfter:i.gte(n.start(R),g,"day"),slotStart:h,slotEnd:g,selected:Zb(R,a),draggable:!0,onDragStart:function(){return D(R)},onDragEnd:function(){return c()}})}))}var CF=ne.forwardRef(function(e,t){return ne.createElement(Bse,Object.assign({},e,{popperRef:t}))});CF.propTypes={accessors:ke.object.isRequired,getters:ke.object.isRequired,selected:ke.object,components:ke.object.isRequired,localizer:ke.object.isRequired,position:ke.object.isRequired,show:ke.func.isRequired,events:ke.array.isRequired,slotStart:ke.instanceOf(Date).isRequired,slotEnd:ke.instanceOf(Date),onSelect:ke.func,onDoubleClick:ke.func,onKeyPress:ke.func,handleDragStart:ke.func,style:ke.object,offset:ke.shape({x:ke.number,y:ke.number})};function Hse(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,a=e.overlay,o=e.accessors,i=e.localizer,l=e.components,c=e.getters,f=e.selected,h=e.handleSelectEvent,g=e.handleDoubleClickEvent,y=e.handleKeyPressEvent,w=e.handleDragStart,S=e.onHide,D=e.overlayDisplay,I=P.useRef(null);if(!a.position)return null;var M=r;isNaN(r)||(M={x:r,y:r});var N=a.position,B=a.events,k=a.date,R=a.end;return ne.createElement(CZ,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:S,target:a.target},function(L){var _=L.props;return ne.createElement(CF,Object.assign({},_,{containerRef:t,ref:I,target:a.target,offset:M,accessors:o,getters:c,selected:f,components:l,localizer:i,position:N,show:D,events:B,slotStart:k,slotEnd:R,onSelect:h,onDoubleClick:g,onKeyPress:y,handleDragStart:w}))})}var PI=ne.forwardRef(function(e,t){return ne.createElement(Hse,Object.assign({},e,{containerRef:t}))});PI.propTypes={popupOffset:ke.oneOfType([ke.number,ke.shape({x:ke.number,y:ke.number})]),overlay:ke.shape({position:ke.object,events:ke.array,date:ke.instanceOf(Date),end:ke.instanceOf(Date)}),accessors:ke.object.isRequired,localizer:ke.object.isRequired,components:ke.object.isRequired,getters:ke.object.isRequired,selected:ke.object,handleSelectEvent:ke.func,handleDoubleClickEvent:ke.func,handleKeyPressEvent:ke.func,handleDragStart:ke.func,onHide:ke.func,overlayDisplay:ke.func};function ao(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return _g(n,e,t,{passive:!1})}function Use(e,t,n){return!e||pv(e,document.elementFromPoint(t,n))}function Yse(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return Q9(a,".rbc-event",e)}function zse(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return Q9(a,".rbc-show-more",e)}function qw(e,t){return!!Yse(e,t)}function Vse(e,t){return!!zse(e,t)}function ap(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var f3=5,Wse=250,xF=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,a=r===void 0?!1:r,o=n.longPressThreshold,i=o===void 0?250:o,l=n.validContainers,c=l===void 0?[]:l;Ma(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||a,this.longPressThreshold=i,this.validContainers=c,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=ao("touchmove",function(){},window),this._removeKeyDownListener=ao("keydown",this._keyListener),this._removeKeyUpListener=ao("keyup",this._keyListener),this._removeDropFromOutsideListener=ao("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=ao("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return ka(e,[{key:"on",value:function(n,r){var a=this._listeners[n]||(this._listeners[n]=[]);return a.push(r),{remove:function(){var i=a.indexOf(r);i!==-1&&a.splice(i,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o0&&arguments[0]!==void 0?arguments[0]:0;return Wu(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function h3(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Mf(e),a=r.top,o=r.left,i=r.right,l=i===void 0?o:i,c=r.bottom,f=c===void 0?a:c,h=Mf(t),g=h.top,y=h.left,w=h.right,S=w===void 0?y:w,D=h.bottom,I=D===void 0?g:D;return!(f-nI||l-nS)}function Mf(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+p3("left"),r=t.top+p3("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function p3(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var Zse=function(e){Ao(t,e);function t(n,r){var a;return Ma(this,t),a=No(this,t,[n,r]),a.state={selecting:!1},a.containerRef=P.createRef(),a}return ka(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(r){!r.selectable&&this.props.selectable&&this._selectable(),r.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var r=this.props,a=r.range,o=r.getNow,i=r.getters,l=r.date,c=r.components.dateCellWrapper,f=r.localizer,h=this.state,g=h.selecting,y=h.startIdx,w=h.endIdx,S=o();return ne.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(D,I){var M=g&&I>=y&&I<=w,N=i.dayProp(D),B=N.className,k=N.style;return ne.createElement(c,{key:I,value:D,range:a},ne.createElement("div",{style:k,className:ca("rbc-day-bg",B,M&&"rbc-selected-cell",f.isSameDate(D,S)&&"rbc-today",l&&f.neq(l,D,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,a=this.containerRef.current,o=this._selector=new xF(this.props.container,{longPressThreshold:this.props.longPressThreshold}),i=function(c,f){if(!qw(a,c)&&!Vse(a,c)){var h=Mf(a),g=r.props,y=g.range,w=g.rtl;if(Lse(h,c)){var S=EF(h,c.x,w,y.length);r._selectSlot({startIdx:S,endIdx:S,action:f,box:c})}}r._initial={},r.setState({selecting:!1})};o.on("selecting",function(l){var c=r.props,f=c.range,h=c.rtl,g=-1,y=-1;if(r.state.selecting||(gr(r.props.onSelectStart,[l]),r._initial={x:l.x,y:l.y}),o.isSelected(a)){var w=Mf(a),S=Rse(r._initial,w,l,f.length,h);g=S.startIdx,y=S.endIdx}r.setState({selecting:!0,startIdx:g,endIdx:y})}),o.on("beforeSelect",function(l){if(r.props.selectable==="ignoreEvents")return!qw(r.containerRef.current,l)}),o.on("click",function(l){return i(l,"click")}),o.on("doubleClick",function(l){return i(l,"doubleClick")}),o.on("select",function(l){r._selectSlot(tr(tr({},r.state),{},{action:"select",bounds:l})),r._initial={},r.setState({selecting:!1}),gr(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var a=r.endIdx,o=r.startIdx,i=r.action,l=r.bounds,c=r.box;a!==-1&&o!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:o,end:a,action:i,bounds:l,box:c,resourceId:this.props.resourceId})}}]),t}(ne.Component),Zl={propTypes:{slotMetrics:ke.object.isRequired,selected:ke.object,isAllDay:ke.bool,accessors:ke.object.isRequired,localizer:ke.object.isRequired,components:ke.object.isRequired,getters:ke.object.isRequired,onSelect:ke.func,onDoubleClick:ke.func,onKeyPress:ke.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var a=t.accessors,o=t.getters,i=t.onSelect,l=t.onDoubleClick,c=t.onKeyPress,f=t.localizer,h=t.slotMetrics,g=t.components,y=t.resizable,w=h.continuesPrior(n),S=h.continuesAfter(n);return ne.createElement(TF,{event:n,getters:o,localizer:f,accessors:a,components:g,onSelect:i,onDoubleClick:l,onKeyPress:c,continuesPrior:w,continuesAfter:S,slotStart:h.first,slotEnd:h.last,selected:Zb(n,r),resizable:y})},renderSpan:function(t,n,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",o=Math.abs(n)/t*100+"%";return ne.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:o,flexBasis:o,maxWidth:o}},a)}},MF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.segments,i=a.slotMetrics.slots,l=a.className,c=1;return ne.createElement("div",{className:ca(l,"rbc-row")},o.reduce(function(f,h,g){var y=h.event,w=h.left,S=h.right,D=h.span,I="_lvl_"+g,M=w-c,N=Zl.renderEvent(r.props,y);return M&&f.push(Zl.renderSpan(i,M,"".concat(I,"_gap"))),f.push(Zl.renderSpan(i,D,I,N)),c=S+1,f},[]))}}]),t}(ne.Component);MF.defaultProps=tr({},Zl.defaultProps);function kF(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,a=e.localizer;return{first:t[0],last:a.add(t[t.length-1],1,r)}}function qse(e,t,n,r){var a=kF({dateRange:t,localizer:r}),o=a.first,i=a.last,l=r.diff(o,i,"day"),c=r.max(r.startOf(n.start(e),"day"),o),f=r.min(r.ceil(n.end(e),"day"),i),h=ete(t,function(y){return r.isSameDate(y,c)}),g=r.diff(c,f,"day");return g=Math.min(g,l),g=Math.max(g-r.segmentOffset,1),{event:e,span:g,left:h+1,right:Math.max(h+g,1)}}function NF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,a,o=[],i=[];for(n=0;n=t?i.push(a):(o[r]||(o[r]=[])).push(a)}for(n=0;n=e.left})}function Jse(e,t,n){var r=fw(e),a=[],o=[];r.forEach(function(c){var f=t.start(c),h=t.end(c);n.daySpan(f,h)>1?a.push(c):o.push(c)});var i=a.sort(function(c,f){return YT(c,f,t,n)}),l=o.sort(function(c,f){return YT(c,f,t,n)});return[].concat(fw(i),fw(l))}function YT(e,t,n,r){var a={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},o={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:a,evtB:o})}var AF=function(t,n){return t.left<=n&&t.right>=n},m3=function(t,n){return t.filter(function(r){return AF(r,n)}).map(function(r){return r.event})},FF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){for(var r=this.props,a=r.segments,o=r.slotMetrics.slots,i=NF(a).levels[0],l=1,c=1,f=[];l<=o;){var h="_lvl_"+l,g=i.filter(function(N){return AF(N,l)})[0]||{},y=g.event,w=g.left,S=g.right,D=g.span;if(!y){l++;continue}var I=Math.max(0,w-c);if(this.canRenderSlotEvent(w,D)){var M=Zl.renderEvent(this.props,y);I&&f.push(Zl.renderSpan(o,I,h+"_gap")),f.push(Zl.renderSpan(o,D,h,M)),c=l=S+1}else I&&f.push(Zl.renderSpan(o,I,h+"_gap")),f.push(Zl.renderSpan(o,1,h,this.renderShowMore(a,l))),c=l+=1}return ne.createElement("div",{className:"rbc-row"},f)}},{key:"canRenderSlotEvent",value:function(r,a){var o=this.props.segments;return fte(r,r+a).every(function(i){var l=m3(o,i).length;return l===1})}},{key:"renderShowMore",value:function(r,a){var o=this,i=this.props,l=i.localizer,c=i.slotMetrics,f=c.getEventsForSlot(a),h=m3(r,a),g=h.length;return g?ne.createElement("button",{type:"button",key:"sm_"+a,className:ca("rbc-button-link","rbc-show-more"),onClick:function(w){return o.showMore(a,w)}},l.messages.showMore(g,h,f)):!1}},{key:"showMore",value:function(r,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(r,a.target)}}]),t}(ne.Component);FF.defaultProps=tr({},Zl.defaultProps);var Kse=function(t){var n=t.children;return ne.createElement("div",{className:"rbc-row-content-scroll-container"},n)},Qse=function(t,n){return t.left<=n&&t.right>=n},Xse=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function OF(){return rF(function(e){for(var t=e.range,n=e.events,r=e.maxRows,a=e.minRows,o=e.accessors,i=e.localizer,l=kF({dateRange:t,localizer:i}),c=l.first,f=l.last,h=n.map(function(D){return qse(D,t,o,i)}),g=NF(h,Math.max(r-1,1)),y=g.levels,w=g.extra,S=w.length>0?a-1:a;y.length1&&arguments[1]!==void 0?arguments[1]:0;if(o.lt(k,t,"minutes"))return y[0];if(o.gt(k,n,"minutes"))return y[y.length-1];var L=o.diff(t,k,"minutes");return y[(L-L%r)/r+R]},startsBeforeDay:function(k){return o.lt(k,t,"day")},startsAfterDay:function(k){return o.gt(k,n,"day")},startsBefore:function(k){return o.lt(o.merge(t,k),t,"minutes")},startsAfter:function(k){return o.gt(o.merge(n,k),n,"minutes")},getRange:function(k,R,L,_){L||(k=o.min(n,o.max(t,k))),_||(R=o.min(n,o.max(t,R)));var V=N(k),U=N(R),Z=U>r*h&&!o.eq(n,R)?(V-r)/(r*h)*100:V/(r*h)*100;return{top:Z,height:U/(r*h)*100-Z,start:N(k),startDate:k,end:N(R),endDate:R}},getCurrentTimePosition:function(k){var R=N(k),L=R/(r*h)*100;return L}}}var rle=function(){function e(t,n){var r=n.accessors,a=n.slotMetrics;Ma(this,e);var o=a.getRange(r.start(t),r.end(t)),i=o.start,l=o.startDate,c=o.end,f=o.endDate,h=o.top,g=o.height;this.start=i,this.end=c,this.startMs=+l,this.endMs=+f,this.top=h,this.height=g,this.data=t}return ka(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(a,o){return Math.max(a,o.leaves.length+1)},0)+1;return 100/n}if(this.leaves){var r=100-this.container._width;return r/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var n=this._width,r=Math.min(100,this._width*1.7);if(this.rows)return r;if(this.leaves)return this.leaves.length>0?r:n;var a=this.row.leaves,o=a.indexOf(this);return o===a.length-1?n:r}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var n=this.row,r=n.leaves,a=n.xOffset,o=n._width,i=r.indexOf(this)+1;return a+i*o}}]),e}();function ale(e,t,n){return Math.abs(t.start-e.start)e.start&&t.start0;){var r=t.shift();n.push(r);for(var a=0;ao.startMs)){if(a>0){var i=t.splice(a,1)[0];n.push(i)}break}}}return n}function jF(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=t.map(function(h){return new rle(h,{slotMetrics:r,accessors:a})}),i=ole(o),l=[],c=function(){var g=i[f],y=l.find(function(D){return D.end>g.start||Math.abs(g.start-D.start)=0;S--)ale(y.rows[S],g,n)&&(w=y.rows[S]);w?(w.leaves.push(g),g.row=w):(g.leaves=[],y.rows.push(g))},f=0;f-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var a=LF(e.friends[r],t,n);t=t>a?t:a}return t}function ile(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=jF({events:t,minimumStartDifference:n,slotMetrics:r,accessors:a});o.sort(function(fe,$){return fe=fe.style,$=$.style,fe.top!==$.top?fe.top>$.top?1:-1:fe.height!==$.height?fe.top+fe.height<$.top+$.height?1:-1:0});for(var i=0;i=f&&S<=h||S>f&&S<=h||w>=f&&wre?Q:re}Q<=Z.idx&&(Z.size=100-Z.idx*Z.size);var de=Z.idx===0?0:3;Z.style.width="calc(".concat(Z.size,"% - ").concat(de,"px)"),Z.style.height="calc(".concat(Z.style.height,"% - 2px)"),Z.style.xOffset="calc(".concat(Z.style.left,"% + ").concat(de,"px)")}return o}var v3={overlap:jF,"no-overlap":ile};function sle(e){return!!(e&&e.constructor&&e.call&&e.apply)}function lle(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in v3&&(n=v3[t]),sle(n)?n.apply(this,arguments):[]}var RF=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.renderSlot,o=r.resource,i=r.group,l=r.getters,c=r.components,f=c===void 0?{}:c,h=f.timeSlotWrapper,g=h===void 0?Ru:h,y=l?l.slotGroupProp(i):{};return ne.createElement("div",Object.assign({className:"rbc-timeslot-group"},y),i.map(function(w,S){var D=l?l.slotProp(w,o):{};return ne.createElement(g,{key:S,value:w,resource:o},ne.createElement("div",Object.assign({},D,{className:ca("rbc-time-slot",D.className)}),a&&a(w,S)))}))}}]),t}(P.Component);function P0(e){return typeof e=="string"?e:e+"%"}function ule(e){var t=e.style,n=e.className,r=e.event,a=e.accessors,o=e.rtl,i=e.selected,l=e.label,c=e.continuesPrior,f=e.continuesAfter,h=e.getters,g=e.onClick,y=e.onDoubleClick,w=e.isBackgroundEvent,S=e.onKeyPress,D=e.components,I=D.event,M=D.eventWrapper,N=a.title(r),B=a.tooltip(r),k=a.end(r),R=a.start(r),L=h.eventProp(r,R,k,i),_=[ne.createElement("div",{key:"1",className:"rbc-event-label"},l),ne.createElement("div",{key:"2",className:"rbc-event-content"},I?ne.createElement(I,{event:r,title:N}):N)],V=t.height,U=t.top,Z=t.width,Q=t.xOffset,G=tr(tr({},L.style),{},lf({top:P0(U),height:P0(V),width:P0(Z)},o?"right":"left",P0(Q)));return ne.createElement(M,Object.assign({type:"time"},e),ne.createElement("div",{role:"button",tabIndex:0,onClick:g,onDoubleClick:y,style:G,onKeyDown:S,title:B?(typeof l=="string"?l+": ":"")+B:void 0,className:ca(w?"rbc-background-event":"rbc-event",n,L.className,{"rbc-selected":i,"rbc-event-continues-earlier":c,"rbc-event-continues-later":f})},_))}var cle=function(t){var n=t.children,r=t.className,a=t.style,o=t.innerRef;return ne.createElement("div",{className:r,style:a,ref:o},n)},dle=ne.forwardRef(function(e,t){return ne.createElement(cle,Object.assign({},e,{innerRef:t}))}),fle=["dayProp"],hle=["eventContainerWrapper"],_F=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){r.intervalTriggered=!0,r.positionTimeIndicator(),r.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var r=this.props,a=r.min,o=r.max,i=r.getNow,l=i();if(l>=a&&l<=o){var c=this.slotMetrics.getCurrentTimePosition(l);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:c})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.max,i=r.rtl,l=r.isNow,c=r.resource,f=r.accessors,h=r.localizer,g=r.getters,y=g.dayProp,w=tu(g,fle),S=r.components,D=S.eventContainerWrapper,I=tu(S,hle),M=this.slotMetrics,N=this.state,B=N.selecting,k=N.top,R=N.height,L=N.startDate,_=N.endDate,V={start:L,end:_},U=y(o),Z=U.className,Q=U.style,G=I.dayColumnWrapper||dle;return ne.createElement(G,{ref:this.containerRef,date:a,style:Q,className:ca(Z,"rbc-day-slot","rbc-time-column",l&&"rbc-now",l&&"rbc-today",B&&"rbc-slot-selecting"),slotMetrics:M},M.groups.map(function(re,de){return ne.createElement(RF,{key:de,group:re,resource:c,getters:w,components:I})}),ne.createElement(D,{localizer:h,resource:c,accessors:f,getters:w,components:I,slotMetrics:M},ne.createElement("div",{className:ca("rbc-events-container",i&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),B&&ne.createElement("div",{className:"rbc-slot-selection",style:{top:k,height:R}},ne.createElement("span",null,h.format(V,"selectRangeFormat"))),l&&this.intervalTriggered&&ne.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}(ne.Component);_F.defaultProps={dragThroughEvents:!0,timeslots:2};function ple(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}var mle=function(t){var n=t.min,r=t.max,a=t.timeslots,o=t.step,i=t.localizer,l=t.getNow,c=t.resource,f=t.components,h=t.getters,g=t.gutterRef,y=f.timeGutterWrapper,w=P.useMemo(function(){return ple({min:n,max:r,localizer:i})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),i]),S=w.start,D=w.end,I=P.useState(jI({min:S,max:D,timeslots:a,step:o,localizer:i})),M=_u(I,2),N=M[0],B=M[1];P.useEffect(function(){N&&B(N.update({min:S,max:D,timeslots:a,step:o,localizer:i}))},[S==null?void 0:S.toISOString(),D==null?void 0:D.toISOString(),a,o]);var k=P.useCallback(function(R,L){if(L)return null;var _=N.dateIsInGroup(l(),L);return ne.createElement("span",{className:ca("rbc-label",_&&"rbc-now")},i.format(R,"timeGutterFormat"))},[N,i,l]);return ne.createElement(y,{slotMetrics:N},ne.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:g},N.groups.map(function(R,L){return ne.createElement(RF,{key:L,group:R,resource:c,components:f,renderSlot:k,getters:h})})))},gle=ne.forwardRef(function(e,t){return ne.createElement(mle,Object.assign({gutterRef:t},e))}),vle=function(t){var n=t.label;return ne.createElement(ne.Fragment,null,n)},yle=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;oa.clientHeight;r.state.isOverflowing!==o&&(r._updatingOverflow=!0,r.setState({isOverflowing:o},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=rF(function(a,o){return wle(a,o)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=ne.createRef(),r.contentRef=ne.createRef(),r.containerRef=ne.createRef(),r._scrollRatio=null,r.gutterRef=P.createRef(),r}return ka(t,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),dM(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,a,o,i){var l=this,c=this.props,f=c.min,h=c.max,g=c.components,y=c.accessors,w=c.localizer,S=c.dayLayoutAlgorithm,D=this.memoizedResources(this.props.resources,y),I=D.groupEvents(a),M=D.groupEvents(o);return D.map(function(N,B){var k=_u(N,2),R=k[0],L=k[1];return r.map(function(_,V){var U=(I.get(R)||[]).filter(function(Q){return w.inRange(_,y.start(Q),y.end(Q),"day")}),Z=(M.get(R)||[]).filter(function(Q){return w.inRange(_,y.start(Q),y.end(Q),"day")});return ne.createElement(_F,Object.assign({},l.props,{localizer:w,min:w.merge(_,f),max:w.merge(_,h),resource:L&&R,components:g,isNow:w.isSameDate(_,i),key:B+"-"+V,date:_,events:U,backgroundEvents:Z,dayLayoutAlgorithm:S}))})})}},{key:"render",value:function(){var r,a=this.props,o=a.events,i=a.backgroundEvents,l=a.range,c=a.width,f=a.rtl,h=a.selected,g=a.getNow,y=a.resources,w=a.components,S=a.accessors,D=a.getters,I=a.localizer,M=a.min,N=a.max,B=a.showMultiDayTimes,k=a.longPressThreshold,R=a.resizable;c=c||this.state.gutterWidth;var L=l[0],_=l[l.length-1];this.slots=l.length;var V=[],U=[],Z=[];return o.forEach(function(Q){if(mv(Q,L,_,S,I)){var G=S.start(Q),re=S.end(Q);S.allDay(Q)||I.startAndEndAreDateOnly(G,re)||!B&&!I.isSameDate(G,re)?V.push(Q):U.push(Q)}}),i.forEach(function(Q){mv(Q,L,_,S,I)&&Z.push(Q)}),V.sort(function(Q,G){return YT(Q,G,S,I)}),ne.createElement("div",{className:ca("rbc-time-view",y&&"rbc-time-view-resources"),ref:this.containerRef},ne.createElement(yle,{range:l,events:V,width:c,rtl:f,getNow:g,localizer:I,selected:h,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(y,S),selectable:this.props.selectable,accessors:S,getters:D,components:w,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:k,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:R}),this.props.popup&&this.renderOverlay(),ne.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},ne.createElement(gle,{date:L,ref:this.gutterRef,localizer:I,min:I.merge(L,M),max:I.merge(L,N),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:w,className:"rbc-time-gutter",getters:D}),this.renderEvents(l,U,Z,g())))}},{key:"renderOverlay",value:function(){var r,a,o=this,i=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},l=this.props,c=l.accessors,f=l.localizer,h=l.components,g=l.getters,y=l.selected,w=l.popupOffset,S=l.handleDragStart,D=function(){return o.setState({overlay:null})};return ne.createElement(PI,{overlay:i,accessors:c,localizer:f,components:h,getters:g,selected:y,popupOffset:w,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!i.position,overlayDisplay:this.overlayDisplay,onHide:D})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var r=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var a,o=(a=r.gutterRef)!==null&&a!==void 0&&a.current?HT(r.gutterRef.current):void 0;o&&r.state.gutterWidth!==o&&r.setState({gutterWidth:o})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var r=this.contentRef.current;r.scrollTop=r.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,a=r.min,o=r.max,i=r.scrollToTime,l=r.localizer,c=l.diff(l.merge(i,a),i,"milliseconds"),f=l.diff(a,o,"milliseconds");this._scrollRatio=c/f}}]),t}(P.Component);em.defaultProps={step:30,timeslots:2};var ble=["date","localizer","min","max","scrollToTime","enableAutoScroll"],Gb=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,ble),D=t.range(a,{localizer:o});return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:10,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);Gb.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};Gb.navigate=function(e,t,n){var r=n.localizer;switch(t){case ri.PREVIOUS:return r.add(e,-1,"day");case ri.NEXT:return r.add(e,1,"day");default:return e}};Gb.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var Sle=["date","localizer","min","max","scrollToTime","enableAutoScroll"],ed=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,Sle),D=t.range(a,this.props);return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:15,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);ed.defaultProps=em.defaultProps;ed.navigate=function(e,t,n){var r=n.localizer;switch(t){case ri.PREVIOUS:return r.add(e,-1,"week");case ri.NEXT:return r.add(e,1,"week");default:return e}};ed.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),a=n.startOf(e,"week",r),o=n.endOf(e,"week",r);return n.range(a,o)};ed.title=function(e,t){var n=t.localizer,r=ed.range(e,{localizer:n}),a=cF(r),o=a[0],i=a.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")};var Dle=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function LI(e,t){return ed.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var Xv=function(e){Ao(t,e);function t(){return Ma(this,t),No(this,t,arguments)}return ka(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,i=r.min,l=i===void 0?o.startOf(new Date,"day"):i,c=r.max,f=c===void 0?o.endOf(new Date,"day"):c,h=r.scrollToTime,g=h===void 0?o.startOf(new Date,"day"):h,y=r.enableAutoScroll,w=y===void 0?!0:y,S=tu(r,Dle),D=LI(a,this.props);return ne.createElement(em,Object.assign({},S,{range:D,eventOffset:15,localizer:o,min:l,max:f,scrollToTime:g,enableAutoScroll:w}))}}]),t}(ne.Component);Xv.defaultProps=em.defaultProps;Xv.range=LI;Xv.navigate=ed.navigate;Xv.title=function(e,t){var n=t.localizer,r=LI(e,{localizer:n}),a=cF(r),o=a[0],i=a.slice(1);return n.format({start:o,end:i.pop()},"dayRangeHeaderFormat")};function td(e){var t=e.accessors,n=e.components,r=e.date,a=e.events,o=e.getters,i=e.length,l=e.localizer,c=e.onDoubleClickEvent,f=e.onSelectEvent,h=e.selected,g=P.useRef(null),y=P.useRef(null),w=P.useRef(null),S=P.useRef(null),D=P.useRef(null);P.useEffect(function(){N()});var I=function(_,V,U){var Z=n.event,Q=n.date;return V=V.filter(function(G){return mv(G,l.startOf(_,"day"),l.endOf(_,"day"),t,l)}),V.map(function(G,re){var de=t.title(G),fe=t.end(G),$=t.start(G),he=o.eventProp(G,$,fe,Zb(G,h)),se=re===0&&l.format(_,"agendaDateFormat"),ue=re===0?ne.createElement("td",{rowSpan:V.length,className:"rbc-agenda-date-cell"},Q?ne.createElement(Q,{day:_,label:se}):se):!1;return ne.createElement("tr",{key:U+"_"+re,className:he.className,style:he.style},ue,ne.createElement("td",{className:"rbc-agenda-time-cell"},M(_,G)),ne.createElement("td",{className:"rbc-agenda-event-cell",onClick:function(oe){return f&&f(G,oe)},onDoubleClick:function(oe){return c&&c(G,oe)}},Z?ne.createElement(Z,{event:G,title:de}):de))},[])},M=function(_,V){var U="",Z=n.time,Q=l.messages.allDay,G=t.end(V),re=t.start(V);return t.allDay(V)||(l.eq(re,G)?Q=l.format(re,"agendaTimeFormat"):l.isSameDate(re,G)?Q=l.format({start:re,end:G},"agendaTimeRangeFormat"):l.isSameDate(_,re)?Q=l.format(re,"agendaTimeFormat"):l.isSameDate(_,G)&&(Q=l.format(G,"agendaTimeFormat"))),l.gt(_,re,"day")&&(U="rbc-continues-prior"),l.lt(_,G,"day")&&(U+=" rbc-continues-after"),ne.createElement("span",{className:U.trim()},Z?ne.createElement(Z,{event:V,day:_,label:Q}):Q)},N=function(){if(D.current){var _=g.current,V=D.current.firstChild;if(V){var U=S.current.scrollHeight>S.current.clientHeight,Z=[],Q=Z;Z=[HT(V.children[0]),HT(V.children[1])],(Q[0]!==Z[0]||Q[1]!==Z[1])&&(y.current.style.width=Z[0]+"px",w.current.style.width=Z[1]+"px"),U?(DZ(_,"rbc-header-overflowing"),_.style.marginRight=H9()+"px"):TZ(_,"rbc-header-overflowing")}}},B=l.messages,k=l.add(r,i,"day"),R=l.range(r,k,"day");return a=a.filter(function(L){return mv(L,l.startOf(r,"day"),l.endOf(k,"day"),t,l)}),a.sort(function(L,_){return+t.start(L)-+t.start(_)}),ne.createElement("div",{className:"rbc-agenda-view"},a.length!==0?ne.createElement(ne.Fragment,null,ne.createElement("table",{ref:g,className:"rbc-agenda-table"},ne.createElement("thead",null,ne.createElement("tr",null,ne.createElement("th",{className:"rbc-header",ref:y},B.date),ne.createElement("th",{className:"rbc-header",ref:w},B.time),ne.createElement("th",{className:"rbc-header"},B.event)))),ne.createElement("div",{className:"rbc-agenda-content",ref:S},ne.createElement("table",{className:"rbc-agenda-table"},ne.createElement("tbody",{ref:D},R.map(function(L,_){return I(L,a,_)}))))):ne.createElement("span",{className:"rbc-agenda-empty"},B.noEventsInRange))}td.defaultProps={length:30};td.range=function(e,t){var n=t.length,r=n===void 0?td.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return{start:e,end:o}};td.navigate=function(e,t,n){var r=n.length,a=r===void 0?td.defaultProps.length:r,o=n.localizer;switch(t){case ri.PREVIOUS:return o.add(e,-a,"day");case ri.NEXT:return o.add(e,a,"day");default:return e}};td.title=function(e,t){var n=t.length,r=n===void 0?td.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return a.format({start:e,end:o},"agendaHeaderFormat")};var pw=lf(lf(lf(lf(lf({},Mo.MONTH,qb),Mo.WEEK,ed),Mo.WORK_WEEK,Xv),Mo.DAY,Gb),Mo.AGENDA,td),Tle=["action","date","today"];function Ile(e,t){var n=t.action,r=t.date,a=t.today,o=tu(t,Tle);switch(e=typeof e=="string"?pw[e]:e,n){case ri.TODAY:r=a||new Date;break;case ri.DATE:break;default:ov(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,o)}return r}var Ele=function(e){Ao(t,e);function t(){var n;Ma(this,t);for(var r=arguments.length,a=new Array(r),o=0;o1)return o.map(function(l){return ne.createElement("button",{type:"button",key:l,className:ca({"rbc-active":i===l}),onClick:a.view.bind(null,l)},r[l])})}}]),t}(ne.Component);function Cle(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&Wu(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var Vc=function(t){return function(n){return Cle(n,t)}},xle=["view","date","getNow","onNavigate"],Mle=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function BF(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n0&&arguments[0]!==void 0?arguments[0]:null,De=arguments.length>1?arguments[1]:void 0,je=Wc(De);return je?e(oe).startOf(je).toDate():e(oe).toDate()}function l(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,De=arguments.length>1?arguments[1]:void 0,je=Wc(De);return je?e(oe).endOf(je).toDate():e(oe).toDate()}function c(oe,De,je){var Re=o(oe,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSame(Xe,Ze)}function f(oe,De,je){return!c(oe,De,je)}function h(oe,De,je){var Re=o(oe,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isAfter(Xe,Ze)}function g(oe,De,je){var Re=o(oe,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isBefore(Xe,Ze)}function y(oe,De,je){var Re=o(oe,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSameOrBefore(Xe,Ze)}function w(oe,De,je){var Re=o(oe,De,je),Fe=_u(Re,3),Be=Fe[0],Xe=Fe[1],Ze=Fe[2];return Be.isSameOrBefore(Xe,Ze)}function S(oe,De,je){var Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",Fe=Wc(Re),Be=e(oe),Xe=e(De),Ze=e(je);return Be.isBetween(Xe,Ze,Fe,"[]")}function D(oe,De){var je=e(oe),Re=e(De),Fe=e.min(je,Re);return Fe.toDate()}function I(oe,De){var je=e(oe),Re=e(De),Fe=e.max(je,Re);return Fe.toDate()}function M(oe,De){if(!oe&&!De)return null;var je=e(De).format("HH:mm:ss"),Re=e(oe).startOf("day").format("MM/DD/YYYY");return e("".concat(Re," ").concat(je),"MM/DD/YYYY HH:mm:ss").toDate()}function N(oe,De,je){var Re=Wc(je);return e(oe).add(De,Re).toDate()}function B(oe,De){for(var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Re=Wc(je),Fe=e(oe).toDate(),Be=[];w(Fe,De);)Be.push(Fe),Fe=N(Fe,1,Re);return Be}function k(oe,De){var je=Wc(De),Re=i(oe,je);return c(Re,oe)?Re:N(Re,1,je)}function R(oe,De){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Re=Wc(je),Fe=e(oe),Be=e(De);return Be.diff(Fe,Re)}function L(oe){var De=e(oe);return De.minutes()}function _(oe){var De=oe?e.localeData(oe):e.localeData();return De?De.firstDayOfWeek():0}function V(oe){return e(oe).startOf("month").startOf("week").toDate()}function U(oe){return e(oe).endOf("month").endOf("week").toDate()}function Z(oe){for(var De=V(oe),je=U(oe),Re=[];w(De,je);)Re.push(De),De=N(De,1,"d");return Re}function Q(oe,De,je){return e(oe).startOf("day").minute(De+je).toDate()}function G(oe,De){return R(oe,De,"minutes")}function re(oe){var De=e(oe).startOf("day"),je=e(oe);return je.diff(De,"minutes")+a(oe)}function de(oe,De){var je=e(oe),Re=e(De);return je.isBefore(Re,"day")}function fe(oe,De,je){var Re=e(De),Fe=e(je);return Re.isSameOrAfter(Fe,"minutes")}function $(oe,De){var je=e(oe),Re=e(De),Fe=e.duration(Re.diff(je));return Fe.days()}function he(oe){var De=oe.evtA,je=De.start,Re=De.end,Fe=De.allDay,Be=oe.evtB,Xe=Be.start,Ze=Be.end,st=Be.allDay,Ct=+i(je,"day")-+i(Xe,"day"),tn=$(je,Re),_e=$(Xe,Ze);return Ct||_e-tn||!!st-!!Fe||+je-+Xe||+Re-+Ze}function se(oe){var De=oe.event,je=De.start,Re=De.end,Fe=oe.range,Be=Fe.start,Xe=Fe.end,Ze=e(je).startOf("day"),st=e(Re),Ct=e(Be),tn=e(Xe),_e=Ze.isSameOrBefore(tn,"day"),et=!Ze.isSame(st,"minutes"),nt=et?st.isAfter(Ct,"minutes"):st.isSameOrAfter(Ct,"minutes");return _e&&nt}function ue(oe,De){var je=e(oe),Re=e(De);return je.isSame(Re,"day")}function X(){var oe=new Date,De=/-/.test(oe.toString())?"-":"",je=oe.getTimezoneOffset(),Re=Number("".concat(De).concat(Math.abs(je))),Fe=e().utcOffset();return Fe>Re?1:0}return new Nse({formats:jle,firstOfWeek:_,firstVisibleDay:V,lastVisibleDay:U,visibleDays:Z,format:function(De,je,Re){return t(e(De),Re).format(je)},lt:g,lte:w,gt:h,gte:y,eq:c,neq:f,merge:M,inRange:S,startOf:i,endOf:l,range:B,add:N,diff:R,ceil:k,min:D,max:I,minutes:L,getSlotDate:Q,getTimezoneOffset:n,getDstOffset:r,getTotalMin:G,getMinutesFromMidnight:re,continuesPrior:de,continuesAfter:fe,sortEvents:he,inEventRange:se,isSameDate:ue,daySpan:$,browserTZOffset:X})}function y3(e,t,n,r,a){const o={start:r.start(e),end:r.end(e)},i={start:t,end:n};return a.inEventRange({event:o,range:i})}function Rle(e,t){return!e||t==null?!1:vb.isEqual(e,t)}const pp={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function $u({accessors:e,components:t,date:n,events:r,getters:a,length:o,localizer:i,onDoubleClickEvent:l,onSelectEvent:c,selected:f}){P.useRef(null);const h=P.useRef(null),g=P.useRef(null),y=P.useRef(null),w=P.useRef(null),[S,D]=P.useState(!1),[I,M]=P.useState(!1),N=(Z,Q,G)=>{const{event:re,date:de}=t;return Q=Q.filter(fe=>y3(fe,i.startOf(Z,"day"),i.endOf(Z,"day"),e,i)),Q.map((fe,$)=>{const he=e.title(fe),se=e.end(fe),ue=e.start(fe),X=a.eventProp(fe,ue,se,Rle(fe,f)),oe=$===0&&i.format(Z,"agendaDateFormat"),De=$===0?v.jsx("td",{rowSpan:Q.length,className:"rbc-agenda-date-cell",children:de?v.jsx(de,{day:Z,label:oe}):oe}):!1;return v.jsxs("tr",{className:X.className,style:X.style,children:[De,v.jsx("td",{className:"rbc-agenda-time-cell",children:B(Z,fe)}),v.jsx("td",{className:"rbc-agenda-event-cell",onClick:je=>c&&c(fe,je),onDoubleClick:je=>l&&l(fe,je),children:re?v.jsx(re,{event:fe,title:he}):he})]},G+"_"+$)},[])},B=(Z,Q)=>{const G=t.time;let re="",de=i.messages.allDay;const fe=e.end(Q),$=e.start(Q);return e.allDay(Q)||(i.eq($,fe)?de=i.format($,"agendaTimeFormat"):i.isSameDate($,fe)?de=i.format({start:$,end:fe},"agendaTimeRangeFormat"):i.isSameDate(Z,$)?de=i.format($,"agendaTimeFormat"):i.isSameDate(Z,fe)&&(de=i.format(fe,"agendaTimeFormat"))),i.gt(Z,$,"day")&&(re="rbc-continues-prior"),i.lt(Z,fe,"day")&&(re+=" rbc-continues-after"),v.jsx("span",{className:re.trim(),children:G?v.jsx(G,{event:Q,day:Z,label:de}):de})},{messages:k}=i,R=i.add(n,-o/2,"day"),L=i.add(n,o/2,"day"),_=i.range(R,L,"day");S&&_.reverse(),r=r.filter(Z=>y3(Z,i.startOf(R,"day"),i.endOf(L,"day"),e,i)),r.sort((Z,Q)=>+e.start(Z)-+e.start(Q)),I&&r.reverse();const V=P.useCallback(()=>setTimeout(()=>{w.current&&kb(w.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(Z=>{new x.Notice(E("Image is generating..."));const Q=ft.getState().settings.AutoSaveWhenOnMobile,G=ft.getState().app.vault;if(Q&&x.Platform.isMobile){const re=Z.split("base64,")[1];gb(re,"image/png").arrayBuffer().then(async fe=>{let $;const he="png",se=Ju();for(const ue in se)if(se[ue]instanceof x.TFile){$=se[ue];break}$!==void 0&&await G.createBinary(await G.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,he,$),fe)})}Nb({imgUrl:Z})}).catch(Z=>{console.error(Z)})},0),[w.current,_]),U=P.useCallback(Z=>{const Q=new x.Menu;Q.addItem(G=>{G.setIcon("share-2").setTitle(E("Share")).onClick(()=>{V()})}),Q.showAtMouseEvent(Z.nativeEvent)},[w.current,_,V]);return v.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?v.jsx(ne.Fragment,{children:v.jsxs("table",{ref:w,className:"rbc-agenda-table",children:[v.jsx("thead",{onContextMenu:U,children:v.jsxs("tr",{children:[v.jsx("th",{className:"rbc-header",ref:h,onClick:()=>{D(!S)},children:k.date+(S?" 🔼":" 🔽")}),v.jsx("th",{className:"rbc-header",ref:g,onClick:()=>{M(!I)},children:k.time+(I?" 🔼":" 🔽")}),v.jsx("th",{className:"rbc-header",children:k.event})]})}),v.jsx("tbody",{ref:y,children:_.map((Z,Q)=>N(Z,r,Q))})]})}):v.jsx("span",{className:"rbc-agenda-empty",children:k.noEventsInRange})})}$u.propTypes={accessors:ke.object.isRequired,components:ke.object.isRequired,date:ke.instanceOf(Date),events:ke.array,getters:ke.object.isRequired,length:ke.number.isRequired,localizer:ke.object.isRequired,onSelectEvent:ke.func,onDoubleClickEvent:ke.func,selected:ke.object};$u.defaultProps={length:30};$u.range=(e,{length:t=$u.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return{customStart:r,customEnd:a}};$u.navigate=(e,t,{length:n=$u.defaultProps.length,localizer:r})=>{switch(t){case pp.PREVIOUS:return r.add(e,-n,"day");case pp.NEXT:return r.add(e,n,"day");default:return e}};$u.title=(e,{length:t=$u.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return n.format({start:r,end:a},"agendaHeaderFormat")};function _le(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Rv(e.hoverEl);return n.render(v.jsx(is,{store:Le,context:Lt,children:v.jsx(ai,{memo:t})})),n}function Ble({event:e}){const t=e.resource,n=t.content.split(` +`)[0].slice(0,20),r=ne.useRef(null),a=ne.useRef(null),o=ne.useRef(null);P.useEffect(()=>{if(a.current)return x.setIcon(a.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const i=P.useCallback(c=>{o.current&&(o.current.unmount(),o.current=null),o.current=c},[]),l=P.useCallback(c=>{if(!r.current||!x.Keymap.isModifier(c.nativeEvent,"Mod"))return;const f=new x.HoverPopover(ft.getState().view,r.current,100),h=_le(f,t);i(h)},[r.current]);return v.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:l,children:[v.jsx(Hle,{event:e}),v.jsx("span",{children:n})]})}const Hle=({event:e})=>{const t=ne.useRef(null),n=e.resource;P.useEffect(()=>{t.current&&x.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=P.useCallback(async a=>{a.stopPropagation(),a.preventDefault(),await(async()=>{const i=await we.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");i&&we.editMemo(i)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return v.jsx(v.Fragment,{children:v.jsxs("span",{className:"rbc-event-icon-group",children:[v.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),v.jsx("span",{className:ar("rbc-event-time","thino-hidden"),children:v.jsx("span",{className:"rbc-event-time-text",children:x.moment(e.start).format("HH:mm")})})]})})};function UF({views:e,view:t,messages:n,onView:r}){return e.map(a=>v.jsx("button",{type:"button",className:ar({"rbc-active":t===a}),onClick:()=>r(a),children:n[a]},a))}UF.propTypes={messages:ke.object,onView:ke.func,view:ke.string,views:ke.array};function YF({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:a,view:o,views:i}){const l={previous:P.useRef(null),today:P.useRef(null),next:P.useRef(null)};P.useEffect(()=>{l&&(x.setIcon(l.previous.current,"chevron-left"),x.setIcon(l.today.current,"dot"),x.setIcon(l.next.current,"chevron-right"))},[l]);const c=P.useMemo(()=>v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:l.previous,type:"button",onClick:()=>r(pp.PREVIOUS),"aria-label":n.previous,children:"<"}),v.jsx("button",{ref:l.today,type:"button",onClick:()=>r(pp.TODAY),"aria-label":n.today,children:"•"}),v.jsx("button",{ref:l.next,type:"button",onClick:()=>r(pp.NEXT),"aria-label":n.next,children:">"})]}),[n]);return v.jsxs("div",{className:"rbc-toolbar",children:[v.jsx("span",{className:ar("rbc-btn-group","thino-view-custom-toolbar"),children:c}),v.jsx("span",{className:"rbc-toolbar-label",children:v.jsx(Pw,{type:"text",handleValueChange:f=>{r(pp.DATE,x.moment(f,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(o==="week"?x.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:x.moment(e.valueOf(),"x").valueOf()})}),v.jsx("span",{className:"rbc-btn-group",children:v.jsx(UF,{view:o,views:i,messages:n,onView:a})})]})}YF.propTypes={date:ke.instanceOf(Date),label:ke.string,localizer:ke.object,messages:ke.object,onNavigate:ke.func,onView:ke.func,view:ke.string,views:ke.array};function Ule({event:e,children:t,showPopup:n,callRender:r,...a}){const o=P.useRef(null),i=P.useRef(null),l=P.useCallback(c=>{if(!c.isTrusted){r();return}i.current=c.nativeEvent.target,i.current&&(i.current.hasClass("rbc-event")||(i.current=i.current.closest(".rbc-event")),o.current!==null?(window.clearTimeout(o.current),o.current=null):o.current=window.setTimeout(()=>{n(e,i.current),o.current=null},250))},[e,n]);return v.jsx(v.Fragment,{children:v.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:l,children:t})})}const Yle=Lle(x.moment),zle=({event:e})=>{const t=e.resource;return v.jsx(v.Fragment,{children:v.jsx(ai,{memo:t})})},Vle=e=>{var G;const{thinos:t}=e,[n,r]=ne.useState([]),[a,o]=ne.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[i,l]=ne.useState(null),c=ne.useRef(null),f=ne.useRef(null),[h,g]=ne.useState(!1),y=P.useRef(null),[w,S]=P.useState(new Date);P.useEffect(()=>()=>{c.current&&(c.current=null),f.current&&(f.current=null),y.current&&(y.current=null)},[]),P.useEffect(()=>{const re=t.map(de=>{const fe=x.moment(de.createdAt,"YYYY/MM/DD HH:mm:ss"),$=fe.clone().add(1,"minute");return{title:de.content,start:new Date(fe.format("YYYY-MM-DDTHH:mm:ss")),end:new Date($.format("YYYY-MM-DDTHH:mm:ss")),resource:de}});r(re)},[t]),P.useEffect(()=>{app==null||app.saveLocalStorage("thino-calendar-view",a)},[a]),P.useEffect(()=>{i&&h&&l(t.find(re=>re.id===i.id))},[t,i,h]),P.useEffect(()=>{i&&y.current.update()},[i]),y.current=Mb(c.current,f.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const D=P.useCallback(()=>{y.current.update(),y.current.update()},[]),I=P.useCallback((re,de)=>{l(null),k(),y.current.state.elements.reference=de,l(re.resource),R()},[]),M=P.useCallback(()=>{k(),l(null)},[]),N=P.useCallback((re,de,fe)=>{var $;if(B(re),de==="week"||de==="day"){const he=c.current.find(".rbc-event-wrapper");if(c.current.closest(".memolist-wrapper"),he){($=he.children[0])==null||$.click();return}else{setTimeout(()=>{var ue,X;const se=c.current.find(".rbc-event-wrapper");(X=(ue=se==null?void 0:se.children)==null?void 0:ue[0])==null||X.click()},0);return}}},[]),B=P.useCallback(re=>{S(re)},[S]);Hv(f,M);const k=P.useCallback(()=>{g(!1)},[g]),R=P.useCallback(()=>{y.current.update(),g(!0)},[g]),L=P.useCallback(re=>{const de=re.resource;dt.setEditMemoId(de.id)},[]),_=P.useCallback(re=>{o(re)},[o]),{components:V,views:U,messages:Z}=P.useMemo(()=>({components:{toolbar:YF,eventWrapper:re=>v.jsx(Ule,{...re,callRender:D,showPopup:I}),agenda:{event:zle},event:Ble},views:{month:!0,agenda:$u,week:!0,day:!0},messages:{month:E("Month"),day:E("Day"),next:E("Next"),previous:E("Previous"),today:E("Today"),agenda:E("Agenda"),week:E("Week"),yesterday:E("Yesterday"),tomorrow:E("Tomorrow"),noEventsInRange:E("No thinos in range"),date:E("date"),time:E("time"),event:E("event")}}),[]),Q=P.useMemo(()=>({timeGutterFormat:(re,de,fe)=>fe.format(re,"HH:mm",de),agendaTimeRangeFormat:({start:re,end:de},fe,$)=>$.format(re,"HH:mm",fe)+" — "+$.format(de,"HH:mm",fe),agendaHeaderFormat:({start:re,end:de},fe,$)=>$.format(re,"YYYY-MM-DD")+" — "+$.format(de,"YYYY-MM-DD")}),[]);return v.jsxs("div",{ref:c,className:"calendar-view",children:[v.jsx(Nle,{date:w,messages:Z,components:V,localizer:Yle,events:n,views:U,onView:_,onDoubleClickEvent:L,onNavigate:N,formats:Q,defaultView:a,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),v.jsx("div",{ref:f,style:(G=y.current)==null?void 0:G.styles.popper,className:ar("thino-popup-container",h?"":"thino-hidden"),children:i&&v.jsx(ai,{memo:i})})]})};function Kc(e,t){return typeof e=="function"?e(t):e}function Ai(e,t){return n=>{t.setState(r=>({...r,[e]:Kc(n,r[e])}))}}function Jw(e){return e instanceof Function}function Wle(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function $le(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const i=t(o);i!=null&&i.length&&r(i)})};return r(e),n}function Bt(e,t,n){let r=[],a;return o=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(o);if(!(l.length!==r.length||l.some((h,g)=>r[g]!==h)))return a;r=l;let f;if(n.key&&n.debug&&(f=Date.now()),a=t(...l),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-i)*100)/100,y=Math.round((Date.now()-f)*100)/100/16,w=(S,D)=>{for(S=String(S);S.length{var a;return(a=e==null?void 0:e.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function Zle(e,t,n,r){var a,o;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let f=(a=(o=l.id)!=null?o:c?c.replace(".","_"):void 0)!=null?a:typeof l.header=="string"?l.header:void 0,h;if(l.accessorFn?h=l.accessorFn:c&&(c.includes(".")?h=y=>{let w=y;for(const D of c.split(".")){var S;w=(S=w)==null?void 0:S[D]}return w}:h=y=>y[l.accessorKey]),!f)throw new Error;let g={id:`${String(f)}`,accessorFn:h,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:Bt(()=>[!0],()=>{var y;return[g,...(y=g.columns)==null?void 0:y.flatMap(w=>w.getFlatColumns())]},Ht(e.options,"debugColumns")),getLeafColumns:Bt(()=>[e._getOrderColumnsFn()],y=>{var w;if((w=g.columns)!=null&&w.length){let S=g.columns.flatMap(D=>D.getLeafColumns());return y(S)}return[g]},Ht(e.options,"debugColumns"))};for(const y of e._features)y.createColumn==null||y.createColumn(g,e);return g}const oo="debugHeaders";function w3(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(o),i},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(o,e)}),o}const qle={createTable:e=>{e.getHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,i;const l=(o=r==null?void 0:r.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?o:[],c=(i=a==null?void 0:a.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?i:[],f=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(a!=null&&a.includes(g.id)));return j0(t,[...l,...f,...c],e)},Ht(e.options,oo)),e.getCenterHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),j0(t,n,e,"center")),Ht(e.options,oo)),e.getLeftHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?a:[];return j0(t,o,e,"left")},Ht(e.options,oo)),e.getRightHeaderGroups=Bt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?a:[];return j0(t,o,e,"right")},Ht(e.options,oo)),e.getFooterGroups=Bt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getLeftFooterGroups=Bt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getCenterFooterGroups=Bt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getRightFooterGroups=Bt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ht(e.options,oo)),e.getFlatHeaders=Bt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getLeftFlatHeaders=Bt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getCenterFlatHeaders=Bt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getRightFlatHeaders=Bt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ht(e.options,oo)),e.getCenterLeafHeaders=Bt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getLeftLeafHeaders=Bt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getRightLeafHeaders=Bt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ht(e.options,oo)),e.getLeafHeaders=Bt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,i,l,c,f;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(i=(l=n[0])==null?void 0:l.headers)!=null?i:[],...(c=(f=r[0])==null?void 0:f.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},Ht(e.options,oo))}};function j0(e,t,n,r){var a,o;let i=0;const l=function(y,w){w===void 0&&(w=1),i=Math.max(i,w),y.filter(S=>S.getIsVisible()).forEach(S=>{var D;(D=S.columns)!=null&&D.length&&l(S.columns,w+1)},0)};l(e);let c=[];const f=(y,w)=>{const S={depth:w,id:[r,`${w}`].filter(Boolean).join("_"),headers:[]},D=[];y.forEach(I=>{const M=[...D].reverse()[0],N=I.column.depth===S.depth;let B,k=!1;if(N&&I.column.parent?B=I.column.parent:(B=I.column,k=!0),M&&(M==null?void 0:M.column)===B)M.subHeaders.push(I);else{const R=w3(n,B,{id:[r,w,B.id,I==null?void 0:I.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${D.filter(L=>L.column===B).length}`:void 0,depth:w,index:D.length});R.subHeaders.push(I),D.push(R)}S.headers.push(I),I.headerGroup=S}),c.push(S),w>0&&f(D,w-1)},h=t.map((y,w)=>w3(n,y,{depth:i,index:w}));f(h,i-1),c.reverse();const g=y=>y.filter(S=>S.column.getIsVisible()).map(S=>{let D=0,I=0,M=[0];S.subHeaders&&S.subHeaders.length?(M=[],g(S.subHeaders).forEach(B=>{let{colSpan:k,rowSpan:R}=B;D+=k,M.push(R)})):D=1;const N=Math.min(...M);return I+=N,S.colSpan=D,S.rowSpan=I,{colSpan:D,rowSpan:I}});return g((a=(o=c[0])==null?void 0:o.headers)!=null?a:[]),c}const L0={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},QS=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gle={getDefaultColumnDef:()=>L0,getInitialState:e=>({columnSizing:{},columnSizingInfo:QS(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ai("columnSizing",e),onColumnSizingInfoChange:Ai("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:L0.minSize,(r=o??e.columnDef.size)!=null?r:L0.size),(a=e.columnDef.maxSize)!=null?a:L0.maxSize)},e.getStart=Bt(n=>[n,$g(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),Ht(t.options,"debugColumns")),e.getAfter=Bt(n=>[n,$g(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),Ht(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),a=r==null?void 0:r.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),XS(o)&&o.touches&&o.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[r.id,r.getSize()]],c=XS(o)?Math.round(o.touches[0].clientX):o.clientX,f={},h=(M,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(B=>{var k,R;const L=t.options.columnResizeDirection==="rtl"?-1:1,_=(N-((k=B==null?void 0:B.startOffset)!=null?k:0))*L,V=Math.max(_/((R=B==null?void 0:B.startSize)!=null?R:0),-.999999);return B.columnSizingStart.forEach(U=>{let[Z,Q]=U;f[Z]=Math.round(Math.max(Q+Q*V,0)*100)/100}),{...B,deltaOffset:_,deltaPercentage:V}}),(t.options.columnResizeMode==="onChange"||M==="end")&&t.setColumnSizing(B=>({...B,...f})))},g=M=>h("move",M),y=M=>{h("end",M),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},w=n||typeof document<"u"?document:null,S={moveHandler:M=>g(M.clientX),upHandler:M=>{w==null||w.removeEventListener("mousemove",S.moveHandler),w==null||w.removeEventListener("mouseup",S.upHandler),y(M.clientX)}},D={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),g(M.touches[0].clientX),!1),upHandler:M=>{var N;w==null||w.removeEventListener("touchmove",D.moveHandler),w==null||w.removeEventListener("touchend",D.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),y((N=M.touches[0])==null?void 0:N.clientX)}},I=Jle()?{passive:!1}:!1;XS(o)?(w==null||w.addEventListener("touchmove",D.moveHandler,I),w==null||w.addEventListener("touchend",D.upHandler,I)):(w==null||w.addEventListener("mousemove",S.moveHandler,I),w==null||w.addEventListener("mouseup",S.upHandler,I)),t.setColumnSizingInfo(M=>({...M,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?QS():(n=e.initialState.columnSizingInfo)!=null?n:QS())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let R0=null;function Jle(){if(typeof R0=="boolean")return R0;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return R0=e,R0}function XS(e){return e.type==="touchstart"}const Kle={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ai("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const i=o.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var a;const o=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=r,n=(a=n)!=null?a:!o,!o&&n)return{...i,[e.id]:!0};if(o&&!n){const{[e.id]:l,...c}=i;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},zF=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};zF.autoRemove=e=>Us(e);const VF=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};VF.autoRemove=e=>Us(e);const WF=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};WF.autoRemove=e=>Us(e);const $F=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};$F.autoRemove=e=>Us(e)||!(e!=null&&e.length);const ZF=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});ZF.autoRemove=e=>Us(e)||!(e!=null&&e.length);const qF=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});qF.autoRemove=e=>Us(e)||!(e!=null&&e.length);const GF=(e,t,n)=>e.getValue(t)===n;GF.autoRemove=e=>Us(e);const JF=(e,t,n)=>e.getValue(t)==n;JF.autoRemove=e=>Us(e);const RI=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};RI.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(a)?1/0:a;if(o>i){const l=o;o=i,i=l}return[o,i]};RI.autoRemove=e=>Us(e)||Us(e[0])&&Us(e[1]);const ju={includesString:zF,includesStringSensitive:VF,equalsString:WF,arrIncludes:$F,arrIncludesAll:ZF,arrIncludesSome:qF,equals:GF,weakEquals:JF,inNumberRange:RI};function Us(e){return e==null||e===""}const Qle={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ai("columnFilters",e),onGlobalFilterChange:Ai("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ju.includesString:typeof r=="number"?ju.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ju.equals:Array.isArray(r)?ju.arrIncludes:ju.weakEquals},e.getFilterFn=()=>{var n,r;return Jw(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ju[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r==null?void 0:r.find(h=>h.id===e.id),i=Kc(n,o?o.value:void 0);if(b3(a,i,e)){var l;return(l=r==null?void 0:r.filter(h=>h.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(o){var f;return(f=r==null?void 0:r.map(h=>h.id===e.id?c:h))!=null?f:[]}return r!=null&&r.length?[...r,c]:[c]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ju.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Jw(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ju[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=a=>{var o;return(o=Kc(t,a))==null?void 0:o.filter(i=>{const l=n.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(b3(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function b3(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Xle=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),eue=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},tue=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r=o)&&(r=o)}),r},nue=(e,t,n)=>{let r,a;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r===void 0?i>=i&&(r=a=i):(r>i&&(r=i),a{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},aue=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!Wle(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,i)=>o-i);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},oue=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iue=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sue=(e,t)=>t.length,eD={sum:Xle,min:eue,max:tue,extent:nue,mean:rue,median:aue,unique:oue,uniqueCount:iue,count:sue},lue={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ai("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,a,o;return(n=(r=(a=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?a:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return eD.sum;if(Object.prototype.toString.call(r)==="[object Date]")return eD.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Jw(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:eD[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function uue(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(i=>i.id===o)).filter(Boolean),...r]}const cue={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ai("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Bt(n=>[$g(t,n)],n=>n.findIndex(r=>r.id===e.id),Ht(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$g(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=$g(t,n);return((r=a[a.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Bt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const i=[...t],l=[...a];for(;l.length&&i.length;){const c=i.shift(),f=l.findIndex(h=>h.id===c);f>-1&&o.push(l.splice(f,1)[0])}o=[...o,...l]}return uue(o,n,r)},Ht(e.options,"debugTable"))}},zT=0,VT=10,tD=()=>({pageIndex:zT,pageSize:VT}),due={getInitialState:e=>({...e,pagination:{...tD(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ai("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>Kc(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?tD():(a=e.initialState.pagination)!=null?a:tD())},e.setPageIndex=r=>{e.setPagination(a=>{let o=Kc(r,a.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?zT:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:zT)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?VT:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:VT)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,Kc(r,a.pageSize)),i=a.pageSize*a.pageIndex,l=Math.floor(i/o);return{...a,pageIndex:l,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let i=Kc(r,(o=e.options.pageCount)!=null?o:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...a,pageCount:i}}),e.getPageOptions=Bt(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,i)=>i)),a},Ht(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},nD=()=>({left:[],right:[]}),rD=()=>({top:[],bottom:[]}),fue={getInitialState:e=>({columnPinning:nD(),rowPinning:rD(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ai("columnPinning",e),onRowPinningChange:Ai("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,i;if(n==="right"){var l,c;return{left:((l=a==null?void 0:a.left)!=null?l:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((c=a==null?void 0:a.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var f,h;return{left:[...((f=a==null?void 0:a.left)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((h=a==null?void 0:a.right)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((o=a==null?void 0:a.left)!=null?o:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=a==null?void 0:a.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,i;return((a=r.columnDef.enablePinning)!=null?a:!0)&&((o=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:r,right:a}=t.getState().columnPinning,o=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>a==null?void 0:a.includes(l));return o?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(c=>{let{id:f}=c;return f}):[],i=a?e.getParentRows().map(c=>{let{id:f}=c;return f}):[],l=new Set([...i,e.id,...o]);t.setRowPinning(c=>{var f,h;if(n==="bottom"){var g,y;return{top:((g=c==null?void 0:c.top)!=null?g:[]).filter(D=>!(l!=null&&l.has(D))),bottom:[...((y=c==null?void 0:c.bottom)!=null?y:[]).filter(D=>!(l!=null&&l.has(D))),...Array.from(l)]}}if(n==="top"){var w,S;return{top:[...((w=c==null?void 0:c.top)!=null?w:[]).filter(D=>!(l!=null&&l.has(D))),...Array.from(l)],bottom:((S=c==null?void 0:c.bottom)!=null?S:[]).filter(D=>!(l!=null&&l.has(D)))}}return{top:((f=c==null?void 0:c.top)!=null?f:[]).filter(D=>!(l!=null&&l.has(D))),bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(D=>!(l!=null&&l.has(D)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>a==null?void 0:a.includes(l));return o?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=t._getPinnedRows(a))==null?void 0:n.map(i=>{let{id:l}=i;return l});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(i=>!o.includes(i.column.id))},Ht(t.options,"debugRows")),e.getLeftVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ht(t.options,"debugRows")),e.getRightVisibleCells=Bt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(i=>i.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ht(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?nD():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:nD())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),Ht(e.options,"debugColumns")),e.getRightLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),Ht(e.options,"debugColumns")),e.getCenterLeafColumns=Bt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},Ht(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?rD():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:rD())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=Bt(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(n??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:r}))},Ht(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Bt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},Ht(e.options,"debugRows"))}},hue={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ai("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{WT(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getFilteredSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getGroupedSelectedRowModel=Bt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?aD(e,n):{rows:[],flatRows:[],rowsById:{}},Ht(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const a=e.getIsSelected();t.setRowSelection(o=>{var i;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const l={...o};return WT(l,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _I(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $T(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $T(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},WT=(e,t,n,r,a)=>{var o;const i=a.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=i.subRows)!=null&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>WT(e,l.id,n,r,a))};function aD(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(i,l){return i.map(c=>{var f;const h=_I(c,n);if(h&&(r.push(c),a[c.id]=c),(f=c.subRows)!=null&&f.length&&(c={...c,subRows:o(c.subRows)}),h)return c}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function _I(e,t){var n;return(n=t[e.id])!=null?n:!1}function $T(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(i=>{if(!(o&&!a)&&(i.getCanSelect()&&(_I(i,t)?o=!0:a=!1),i.subRows&&i.subRows.length)){const l=$T(i,t);l==="all"?o=!0:(l==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const ZT=/([0-9]+)/gm,pue=(e,t,n)=>KF(nd(e.getValue(n)).toLowerCase(),nd(t.getValue(n)).toLowerCase()),mue=(e,t,n)=>KF(nd(e.getValue(n)),nd(t.getValue(n))),gue=(e,t,n)=>BI(nd(e.getValue(n)).toLowerCase(),nd(t.getValue(n)).toLowerCase()),vue=(e,t,n)=>BI(nd(e.getValue(n)),nd(t.getValue(n))),yue=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:rBI(e.getValue(n),t.getValue(n));function BI(e,t){return e===t?0:e>t?1:-1}function nd(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function KF(e,t){const n=e.split(ZT).filter(Boolean),r=t.split(ZT).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),i=parseInt(a,10),l=parseInt(o,10),c=[i,l].sort();if(isNaN(c[0])){if(a>o)return 1;if(o>a)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return n.length-r.length}const fp={alphanumeric:pue,alphanumericCaseSensitive:mue,text:gue,textCaseSensitive:vue,datetime:yue,basic:wue},bue={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ai("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a==null?void 0:a.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return fp.datetime;if(typeof o=="string"&&(r=!0,o.split(ZT).length>1))return fp.alphanumeric}return r?fp.text:fp.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Jw(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:fp[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(w=>w.id===e.id),c=i==null?void 0:i.findIndex(w=>w.id===e.id);let f=[],h,g=o?n:a==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?l?h="toggle":h="add":i!=null&&i.length&&c!==i.length-1?h="replace":l?h="toggle":h="replace",h==="toggle"&&(o||a||(h="remove")),h==="add"){var y;f=[...i,{id:e.id,desc:g}],f.splice(0,f.length-((y=t.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else h==="toggle"?f=i.map(w=>w.id===e.id?{...w,desc:g}:w):h==="remove"?f=i.filter(w=>w.id!==e.id):f=[{id:e.id,desc:g}];return f})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,a;const o=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!1:i==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(a=>a.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Sue={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ai("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const a=e.columns;return(n=a.length?a.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Bt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ht(t.options,"debugRows")),e.getVisibleCells=Bt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],Ht(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Bt(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ht(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((a,o)=>({...a,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $g(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const S3=[qle,Sue,cue,fue,Qle,bue,lue,Kle,due,hue,Gle];function Due(e){var t;e.debugAll||e.debugTable;let n={_features:S3};const r=n._features.reduce((h,g)=>Object.assign(h,g.getDefaultOptions==null?void 0:g.getDefaultOptions(n)),{}),a=h=>n.options.mergeOptions?n.options.mergeOptions(r,h):{...r,...h};let i={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(h=>{var g;i=(g=h.getInitialState==null?void 0:h.getInitialState(i))!=null?g:i});const l=[];let c=!1;const f={_features:S3,options:{...r,...e},initialState:i,_queue:h=>{l.push(h),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{n.setState(n.initialState)},setOptions:h=>{const g=Kc(h,n.options);n.options=a(g)},getState:()=>n.options.state,setState:h=>{n.options.onStateChange==null||n.options.onStateChange(h)},_getRowId:(h,g,y)=>{var w;return(w=n.options.getRowId==null?void 0:n.options.getRowId(h,g,y))!=null?w:`${y?[y.id,g].join("."):g}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(h,g)=>{let y=(g?n.getPrePaginationRowModel():n.getRowModel()).rowsById[h];if(!y&&(y=n.getCoreRowModel().rowsById[h],!y))throw new Error;return y},_getDefaultColumnDef:Bt(()=>[n.options.defaultColumn],h=>{var g;return h=(g=h)!=null?g:{},{header:y=>{const w=y.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:y=>{var w,S;return(w=(S=y.renderValue())==null||S.toString==null?void 0:S.toString())!=null?w:null},...n._features.reduce((y,w)=>Object.assign(y,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...h}},Ht(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:Bt(()=>[n._getColumnDefs()],h=>{const g=function(y,w,S){return S===void 0&&(S=0),y.map(D=>{const I=Zle(n,D,S,w),M=D;return I.columns=M.columns?g(M.columns,I,S+1):[],I})};return g(h)},Ht(e,"debugColumns")),getAllFlatColumns:Bt(()=>[n.getAllColumns()],h=>h.flatMap(g=>g.getFlatColumns()),Ht(e,"debugColumns")),_getAllFlatColumnsById:Bt(()=>[n.getAllFlatColumns()],h=>h.reduce((g,y)=>(g[y.id]=y,g),{}),Ht(e,"debugColumns")),getAllLeafColumns:Bt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(h,g)=>{let y=h.flatMap(w=>w.getLeafColumns());return g(y)},Ht(e,"debugColumns")),getColumn:h=>n._getAllFlatColumnsById()[h]};Object.assign(n,f);for(let h=0;h{var i;return(i=o.getValue())!=null?i:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:a,getContext:Bt(()=>[e,n,t,o],(i,l,c,f)=>({table:i,column:l,row:c,cell:f,getValue:f.getValue,renderValue:f.renderValue}),Ht(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(o,n,t,e)},{}),o}const HI=(e,t,n,r,a,o,i)=>{let l={id:t,index:r,original:n,depth:a,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const f=e.getColumn(c);if(f!=null&&f.accessorFn)return l._valuesCache[c]=f.accessorFn(l.original,r),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const f=e.getColumn(c);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=f.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var f;return(f=l.getValue(c))!=null?f:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>$le(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],f=l;for(;;){const h=f.getParentRow();if(!h)break;c.push(h),f=h}return c.reverse()},getAllCells:Bt(()=>[e.getAllLeafColumns()],c=>c.map(f=>Tue(e,l,f,f.id)),Ht(e.options,"debugRows")),_getAllCellsByColumnId:Bt(()=>[l.getAllCells()],c=>c.reduce((f,h)=>(f[h.column.id]=h,f),{}),Ht(e.options,"debugRows"))};for(let c=0;cBt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,i){o===void 0&&(o=0);const l=[];for(let f=0;fe._autoResetPageIndex()))}function QF(e,t,n){return n.options.filterFromLeafRows?Eue(e,t,n):Cue(e,t,n)}function Eue(e,t,n){var r;const a=[],o={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,l=function(c,f){f===void 0&&(f=0);const h=[];for(let y=0;yBt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let y=0;y{var w;const S=e.getColumn(y.id);if(!S)return;const D=S.getFilterFn();D&&a.push({id:y.id,filterFn:D,resolvedValue:(w=D.resolveFilterValue==null?void 0:D.resolveFilterValue(y.value))!=null?w:y.value})});const i=n.map(y=>y.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());r&&l&&c.length&&(i.push("__global__"),c.forEach(y=>{var w;o.push({id:y.id,filterFn:l,resolvedValue:(w=l.resolveFilterValue==null?void 0:l.resolveFilterValue(r))!=null?w:r})}));let f,h;for(let y=0;y{w.columnFiltersMeta[D]=I})}if(o.length){for(let S=0;S{w.columnFiltersMeta[D]=I})){w.columnFilters.__global__=!0;break}}w.columnFilters.__global__!==!0&&(w.columnFilters.__global__=!1)}}const g=y=>{for(let w=0;we._autoResetPageIndex()))}function Mue(){return(e,t)=>Bt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,a)=>{if(!n.rows.length||!(r!=null&&r.length)&&!a)return n;const o=[...r.map(l=>l.id).filter(l=>l!==t),a?"__global__":void 0].filter(Boolean),i=l=>{for(let c=0;cBt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oBt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const a=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof a>"u")return;let o=[a,a];for(let i=0;io[1]&&(o[1]=f)}}return o},Ht(e.options,"debugTable"))}function Aue(){return e=>Bt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],o=r.filter(c=>{var f;return(f=e.getColumn(c.id))==null?void 0:f.getCanSort()}),i={};o.forEach(c=>{const f=e.getColumn(c.id);f&&(i[c.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const l=c=>{const f=c.map(h=>({...h}));return f.sort((h,g)=>{for(let w=0;w{var g;a.push(h),(g=h.subRows)!=null&&g.length&&(h.subRows=l(h.subRows))}),f};return{rows:l(n.rows),flatRows:a,rowsById:n.rowsById}},Ht(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Fue(e){const t=[],n=r=>{var a;t.push(r),(a=r.subRows)!=null&&a.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Oue(e){return t=>Bt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:a,pageIndex:o}=n;let{rows:i,flatRows:l,rowsById:c}=r;const f=a*o,h=f+a;i=i.slice(f,h);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:l,rowsById:c}:g=Fue({rows:i,flatRows:l,rowsById:c}),g.flatRows=[];const y=w=>{g.flatRows.push(w),w.subRows.length&&w.subRows.forEach(y)};return g.rows.forEach(y),g},Ht(t.options,"debugTable"))}function D3(e,t){return e?Pue(e)?P.createElement(e,t):e:null}function Pue(e){return jue(e)||typeof e=="function"||Lue(e)}function jue(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Lue(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Rue(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=P.useState(()=>({current:Due(t)})),[r,a]=P.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:i=>{a(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const XF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},_ue=Object.keys(XF).join("|"),Bue=new RegExp(_ue,"g");function Hue(e){return e.replace(Bue,t=>XF[t])}const Qo={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Uue(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:Qo.MATCHES,!n.accessors){const i=T3(e,t,n);return{rankedValue:e,rank:i,accessorIndex:-1,accessorThreshold:n.threshold,passed:i>=n.threshold}}const a=$ue(e,n.accessors),o={rankedValue:e,rank:Qo.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let i=0;i=Qo.MATCHES?c=f:c>h&&(c=h),c=Math.min(c,h),c>=g&&c>o.rank&&(o.rank=c,o.passed=!0,o.accessorIndex=i,o.accessorThreshold=g,o.rankedValue=l.itemValue)}return o}function T3(e,t,n){return e=I3(e,n),t=I3(t,n),t.length>e.length?Qo.NO_MATCH:e===t?Qo.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?Qo.EQUAL:e.startsWith(t)?Qo.STARTS_WITH:e.includes(` ${t}`)?Qo.WORD_STARTS_WITH:e.includes(t)?Qo.CONTAINS:t.length===1?Qo.NO_MATCH:Yue(e).includes(t)?Qo.ACRONYM:zue(e,t))}function Yue(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function zue(e,t){let n=0,r=0;function a(c,f,h){for(let g=h,y=f.length;g-1))return Qo.NO_MATCH}const l=r-i;return o(l)}function Vue(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function I3(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Hue(e)),e}function Wue(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function $ue(e,t){const n=[];for(let r=0,a=t.length;rObject.assign({},que,e);let Kue=class extends Error{constructor(t){super(t),this.name="CsvGenerationError"}},Que=class extends Error{constructor(t){super(t),this.name="EmptyHeadersError"}};var ey=e=>e,Ys=e=>e,Jb=ey,Mp=ey,C3=ey,x3=ey,Xue=function(e,t){return t=='"'&&e.indexOf('"')>-1?e.replace(/"/g,'""'):e},ece=e=>C3(typeof e=="object"?e.key:e),tce=e=>x3(typeof e=="object"?e.displayLabel:e),nce=(e,...t)=>t.reduce((n,r)=>r(n),e),rce=e=>t=>e.useBom?Jb(Ys(t)+Jue):t,ace=e=>t=>e.showTitle?UI(Jb(Ys(t)+e.title))(Mp("")):t,UI=e=>t=>Jb(Ys(e)+Ys(t)+Gue),t8=e=>(t,n)=>oce(e)(Mp(t+n)),oce=e=>t=>ey(Ys(t)+e.fieldSeparator),ice=(e,t)=>n=>{if(!e.showColumnHeaders)return n;if(t.length<1)throw new Que("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");let r=Mp("");for(let a=0;ar=>{let a=r;for(var o=0;o"u"?e.replaceUndefinedWith:n[o][Ys(c)];i=t8(e)(i,n8(e,f))}i=Mp(Ys(i).slice(0,-1)),a=UI(a)(i)}return a},lce=Ys,M3=e=>+e===e&&(!isFinite(e)||!!(e%1)),n8=(e,t)=>{if(e.decimalSeparator==="locale"&&M3(t))return t.toLocaleString();if(e.decimalSeparator!=="."&&M3(t))return t.toString().replace(".",e.decimalSeparator);if(typeof t=="string"){let n=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(` +`)>-1||t.indexOf("\r")>-1)&&(n=e.quoteCharacter+Xue(t,e.quoteCharacter)+e.quoteCharacter),n}if(typeof t=="boolean"&&e.boolDisplay){const n=t?"true":"false";return e.boolDisplay[n]}return t},uce=e=>t=>{const n=e8(e),r=n.useKeysAsHeaders?Object.keys(t[0]):n.columnHeaders;let a=nce(Jb(""),rce(n),ace(n),ice(n,r),sce(n,r,t));if(Ys(a).length<1)throw new Kue("Output is empty. Is your data formatted correctly?");return a};const cce=({thino:e})=>{const t=P.useRef(null);P.useEffect(()=>(t.current&&x.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=P.useCallback(async()=>{e.pinned?await we.unpinMemoById(e.id):await we.pinMemoById(e.id)},[e]);return v.jsx("span",{ref:t,className:ar("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},dce=({thino:e})=>{var r;const t=P.useRef(null);P.useEffect(()=>(t.current&&x.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=P.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const a=await we.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");a&&we.editMemo(a)},[e]);return v.jsx(v.Fragment,{children:e.thinoType!=="JOURNAL"?v.jsx("input",{className:ar("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":(r=e.thinoType)==null?void 0:r.slice(5),onClick:n}):v.jsx("span",{ref:t,className:"thino-type-status"})})},fce=({id:e,path:t})=>{const n=P.useRef(null);P.useEffect(()=>(n.current&&x.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=P.useCallback(()=>{!e||!t||we.openThinoByID(e)},[e,t]);return v.jsxs("span",{className:"source-thino",onClick:r,children:[v.jsx("span",{children:t}),v.jsx("span",{ref:n,className:"source-thino-icon"})]})},hce=({id:e,sourceType:t})=>{const n=P.useRef(null);P.useEffect(()=>{var a;return n.current&&x.setIcon(n.current,((a=Qg.find(o=>o.title===t))==null?void 0:a.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=P.useCallback(async()=>{e&&await we.openThinoByID(e)},[e]);return v.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},k3=(e,t,n,r)=>{const a=Uue(e.getValue(t),n);return r({itemRank:a}),a.passed},N3=(e,t,n)=>{var a,o;let r=0;return e.columnFiltersMeta[n]&&(r=Vue((a=e.columnFiltersMeta[n])==null?void 0:a.itemRank,(o=t.columnFiltersMeta[n])==null?void 0:o.itemRank)),r===0?fp.alphanumeric(e,t,n):r},pce=e8({fieldSeparator:",",decimalSeparator:".",useKeysAsHeaders:!0}),mce=e=>e+` +`;function gce({thinos:e,isFiltering:t}){var w;ne.useReducer(()=>({}),{})[1];const[n,r]=ne.useState([]),[a,o]=ne.useState(""),i=ne.useMemo(()=>[{header:E("Basic Info"),footer:S=>S.column.id,columns:[{accessorKey:"createdAt",header:()=>v.jsx("span",{className:"create-at-header-cell",children:E("Created At")}),cell:S=>S.getValue(),footer:S=>S.column.id,enableColumnFilter:!1},{accessorFn:S=>S.content,id:"content",header:()=>v.jsx("span",{className:"thino-header-cell",children:E("Thino")}),cell:S=>v.jsx(ai,{memo:S.row.original,type:"table"}),footer:S=>S.column.id,filterFn:"fuzzy",sortingFn:N3},{accessorFn:S=>S.thinoType,id:"thinoType",cell:S=>v.jsx(dce,{thino:S.row.original}),header:()=>v.jsx("span",{children:E("Thino Type")}),footer:S=>S.column.id},{accessorFn:S=>S.sourceType,id:"sourceType",cell:S=>v.jsx(hce,{id:S.row.original.id,sourceType:S.getValue()}),header:()=>v.jsx("span",{children:E("Source Type")}),footer:S=>S.column.id}]},{header:E("Additional Info"),footer:S=>S.column.id,columns:[{accessorKey:"pinned",header:()=>v.jsx("span",{children:E("Pinned Status")}),cell:S=>v.jsx(cce,{thino:S.row.original}),footer:S=>S.column.id,filterFn:"fuzzy",sortingFn:N3},{accessorKey:"rowStatus",header:()=>v.jsx("span",{children:E("Row status")}),cell:S=>v.jsx("span",{children:S.getValue()==="NORMAL"?"":S.getValue()}),footer:S=>S.column.id},{accessorKey:"path",header:()=>E("Path"),cell:S=>v.jsx(fce,{id:S.row.original.id,path:S.getValue()}),footer:S=>S.column.id}]}],[]),[l,c]=ne.useState(()=>e),f=()=>c(S=>e);P.useEffect(()=>{f()},[e]);const h=Rue({data:l,columns:i,filterFns:{fuzzy:k3},initialState:{pagination:{pageSize:20}},state:{columnFilters:n,globalFilter:a},onColumnFiltersChange:r,onGlobalFilterChange:o,globalFilterFn:k3,getCoreRowModel:Iue(),getFilteredRowModel:xue(),getSortedRowModel:Aue(),getPaginationRowModel:Oue(),getFacetedRowModel:Mue(),getFacetedUniqueValues:kue(),getFacetedMinMaxValues:Nue(),debugTable:!1,debugHeaders:!1,debugColumns:!1});ne.useEffect(()=>{var S,D;((S=h.getState().columnFilters[0])==null?void 0:S.id)==="createdAt"&&((D=h.getState().sorting[0])==null?void 0:D.id)!=="createdAt"&&h.setSorting([{id:"createdAt",desc:!1}])},[(w=h.getState().columnFilters[0])==null?void 0:w.id]);async function g(S,D){const I=E("Created At"),M=E("Updated At"),N=E("Content"),B=E("Path"),k=S.map(U=>({[I]:U.createdAt,[M]:U.updatedAt,[N]:U.content,Thino:`=hyperlink("obsidian://thino?openId=${U.id}","${U.id}")`,[B]:`=hyperlink("obsidian://open?path=${x.normalizePath(U.path)},"${U.path}")`})),R=uce(pce)(k),L=ft.getState().app||window.app,_=mce(lce(R));return{file:await L.vault.create(`${D}-${ut.randomId(6)}.csv`,_),app:L}}async function y(S){const{file:D,app:I}=await g(S.map(B=>B.original),"thino-export"),M=document.createDocumentFragment(),N=M.createEl("div",{cls:"export-file-btn-group"});M.createEl("div",{cls:"open-file-button"}),new x.Setting(N).setName(E("Exported CSV file")).addButton(B=>{B.setButtonText(E("Open File")).onClick(()=>{const k=x.normalizePath(D.path);I.openWithDefaultApp(k)})}),new x.Notice(M)}return v.jsxs("div",{className:"table-view",children:[v.jsxs("div",{children:[v.jsx(mw,{value:a||"",onChange:S=>o(String(S)),className:"table-search-bar",placeholder:E("Search all columns...")}),x.Platform.isDesktop&&(a||n.length>0||t)&&v.jsx("button",{className:"mod-cta",disabled:h.getPrePaginationRowModel().rows.length===0,onClick:()=>y(h.getPrePaginationRowModel().rows),children:E("Export to CSV")})]}),v.jsxs("table",{className:"thino-table",children:[v.jsx("thead",{children:h.getHeaderGroups().map(S=>v.jsx("tr",{children:S.headers.map(D=>v.jsx("th",{colSpan:D.colSpan,children:D.isPlaceholder?null:v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ar(D.column.getCanSort()?"filter-header":"","table-header",D.column.id==="content"?"content-header":""),onClick:D.column.getToggleSortingHandler(),children:[D3(D.column.columnDef.header,D.getContext()),{asc:" 🔼",desc:" 🔽"}[D.column.getIsSorted()]??null]}),D.column.getCanFilter()?v.jsx(yce,{column:D.column,table:h}):null]})},D.id))},S.id))}),v.jsx("tbody",{children:h.getRowModel().rows.map(S=>v.jsx("tr",{className:ar(S.getValue("pinned")?"pinned":""),children:S.getVisibleCells().map(D=>v.jsx("td",{children:D3(D.column.columnDef.cell,D.getContext())},D.id))},S.id))})]}),v.jsxs("div",{className:"table-nav-bar",children:[v.jsx("button",{className:"prev-start-btn",onClick:()=>h.setPageIndex(0),disabled:!h.getCanPreviousPage(),children:"<<"}),v.jsx("button",{className:"prev-btn",onClick:()=>h.previousPage(),disabled:!h.getCanPreviousPage(),children:"<"}),v.jsx("button",{className:"next-btn",onClick:()=>h.nextPage(),disabled:!h.getCanNextPage(),children:">"}),v.jsx("button",{className:"next-end-btn",onClick:()=>h.setPageIndex(h.getPageCount()-1),disabled:!h.getCanNextPage(),children:">>"}),v.jsxs("span",{className:"table-page-info",children:[v.jsx("div",{children:E("Page")}),v.jsxs("strong",{children:[h.getState().pagination.pageIndex+1," of ",h.getPageCount()]})]}),v.jsxs("span",{className:"table-page-jump",children:["| ",E("Go to page"),":",v.jsx("input",{type:"number",defaultValue:h.getState().pagination.pageIndex+1,onChange:S=>{const D=S.target.value?Number(S.target.value)-1:0;h.setPageIndex(D)},className:"jump-inputer"})]}),v.jsx("select",{value:h.getState().pagination.pageSize,onChange:S=>{h.setPageSize(Number(S.target.value))},children:[10,20,30,40,50].map(S=>v.jsxs("option",{value:S,children:[E("Show")," ",S," ",E("rows")]},S))})]})]})}const vce=e=>e==="sourceType"?["ALL"]:["ALL","ALL-TASK"];function yce({column:e,table:t}){var o,i,l,c,f,h,g,y,w;const n=(o=t.getPreFilteredRowModel().flatRows[0])==null?void 0:o.getValue(e.id),r=e.getFilterValue(),a=ne.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?v.jsx("div",{children:v.jsxs("div",{className:"filter-input-group",children:[v.jsx(mw,{type:"number",min:Number(((i=e.getFacetedMinMaxValues())==null?void 0:i[0])??""),max:Number(((l=e.getFacetedMinMaxValues())==null?void 0:l[1])??""),value:(r==null?void 0:r[0])??"",onChange:S=>e.setFilterValue(D=>[S,D==null?void 0:D[1]]),placeholder:`Min ${(c=e.getFacetedMinMaxValues())!=null&&c[0]?`(${(f=e.getFacetedMinMaxValues())==null?void 0:f[0]})`:""}`,className:"filter-input-short"}),v.jsx(mw,{type:"number",min:Number(((h=e.getFacetedMinMaxValues())==null?void 0:h[0])??""),max:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[1])??""),value:(r==null?void 0:r[1])??"",onChange:S=>e.setFilterValue(D=>[D==null?void 0:D[0],S]),placeholder:`Max ${(y=e.getFacetedMinMaxValues())!=null&&y[1]?`(${(w=e.getFacetedMinMaxValues())==null?void 0:w[1]})`:""}`,className:"filter-input-short"})]})}):v.jsx(v.Fragment,{children:a.length>1?v.jsxs(v.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&e.id!=="thinoType"&&e.id!=="sourceType"&&v.jsx("datalist",{id:e.id+"list",children:a.slice(0,5e3).map(S=>v.jsx("option",{value:S},S))}),e.id==="thinoType"||e.id==="sourceType"?v.jsx("select",{id:e.id,onChange:S=>e.setFilterValue(S.target.value==="ALL"?"":S.target.value==="ALL-TASK"?"TASK":S.target.value),children:[...vce(e.id),...a].map(S=>v.jsx("option",{value:S,children:E(S)||S},S))}):"",e.id!=="thinoType"&&e.id!=="sourceType"?v.jsx(mw,{type:"text",value:r??"",onChange:S=>e.setFilterValue(S),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"}):""]}):""})}function mw({value:e,onChange:t,debounce:n=500,...r}){const[a,o]=ne.useState(e);return ne.useEffect(()=>{o(e)},[e]),ne.useEffect(()=>{const i=setTimeout(()=>{t(a)},n);return()=>clearTimeout(i)},[a]),v.jsx("input",{...r,value:a,onChange:i=>o(i.target.value)})}function wce(e,t){try{var n=global,r=n.document;if(typeof r<"u"&&r.createElement&&r.head&&r.head.appendChild){var a=r.querySelector('html meta[name="'.concat(encodeURI(e),'"]'))||r.createElement("meta");a.setAttribute("name",e),a.setAttribute("content",t),r.head.appendChild(a)}}catch{}}function bce(){wce("react-scroll-to-bottom:version","4.2.0")}var Eg=function(e){return e&&e.Math===Math&&e},Za=Eg(typeof globalThis=="object"&&globalThis)||Eg(typeof window=="object"&&window)||Eg(typeof self=="object"&&self)||Eg(typeof dr=="object"&&dr)||Eg(typeof dr=="object"&&dr)||function(){return this}()||Function("return this")(),da=function(e){try{return!!e()}catch{return!0}},Sce=da,Kb=!Sce(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Dce=Kb,r8=Function.prototype,A3=r8.apply,F3=r8.call,YI=typeof Reflect=="object"&&Reflect.apply||(Dce?F3.bind(A3):function(){return F3.apply(A3,arguments)}),a8=Kb,o8=Function.prototype,qT=o8.call,Tce=a8&&o8.bind.bind(qT,qT),fa=a8?Tce:function(e){return function(){return qT.apply(e,arguments)}},i8=fa,Ice=i8({}.toString),Ece=i8("".slice),tm=function(e){return Ece(Ice(e),8,-1)},Cce=tm,xce=fa,zI=function(e){if(Cce(e)==="Function")return xce(e)},oD=typeof document=="object"&&document.all,co=typeof oD>"u"&&oD!==void 0?function(e){return typeof e=="function"||e===oD}:function(e){return typeof e=="function"},ty={},Mce=da,ii=!Mce(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),kce=Kb,_0=Function.prototype.call,ru=kce?_0.bind(_0):function(){return _0.apply(_0,arguments)},VI={},s8={}.propertyIsEnumerable,l8=Object.getOwnPropertyDescriptor,Nce=l8&&!s8.call({1:2},1);VI.f=Nce?function(t){var n=l8(this,t);return!!n&&n.enumerable}:s8;var ny=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Ace=fa,Fce=da,Oce=tm,iD=Object,Pce=Ace("".split),u8=Fce(function(){return!iD("z").propertyIsEnumerable(0)})?function(e){return Oce(e)==="String"?Pce(e,""):iD(e)}:iD,WI=function(e){return e==null},jce=WI,Lce=TypeError,$I=function(e){if(jce(e))throw new Lce("Can't call method on "+e);return e},Rce=u8,_ce=$I,au=function(e){return Rce(_ce(e))},Bce=co,Xu=function(e){return typeof e=="object"?e!==null:Bce(e)},qa={},sD=qa,lD=Za,Hce=co,O3=function(e){return Hce(e)?e:void 0},ou=function(e,t){return arguments.length<2?O3(sD[e])||O3(lD[e]):sD[e]&&sD[e][t]||lD[e]&&lD[e][t]},Uce=fa,ec=Uce({}.isPrototypeOf),c8=typeof navigator<"u"&&String(navigator.userAgent)||"",d8=Za,uD=c8,P3=d8.process,j3=d8.Deno,L3=P3&&P3.versions||j3&&j3.version,R3=L3&&L3.v8,Rs,Kw;R3&&(Rs=R3.split("."),Kw=Rs[0]>0&&Rs[0]<4?1:+(Rs[0]+Rs[1]));!Kw&&uD&&(Rs=uD.match(/Edge\/(\d+)/),(!Rs||Rs[1]>=74)&&(Rs=uD.match(/Chrome\/(\d+)/),Rs&&(Kw=+Rs[1])));var ZI=Kw,_3=ZI,Yce=da,zce=Za,Vce=zce.String,nm=!!Object.getOwnPropertySymbols&&!Yce(function(){var e=Symbol("symbol detection");return!Vce(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&_3&&_3<41}),Wce=nm,f8=Wce&&!Symbol.sham&&typeof Symbol.iterator=="symbol",$ce=ou,Zce=co,qce=ec,Gce=f8,Jce=Object,ry=Gce?function(e){return typeof e=="symbol"}:function(e){var t=$ce("Symbol");return Zce(t)&&qce(t.prototype,Jce(e))},Kce=String,Qb=function(e){try{return Kce(e)}catch{return"Object"}},Qce=co,Xce=Qb,ede=TypeError,qI=function(e){if(Qce(e))return e;throw new ede(Xce(e)+" is not a function")},tde=qI,nde=WI,GI=function(e,t){var n=e[t];return nde(n)?void 0:tde(n)},cD=ru,dD=co,fD=Xu,rde=TypeError,ade=function(e,t){var n,r;if(t==="string"&&dD(n=e.toString)&&!fD(r=cD(n,e))||dD(n=e.valueOf)&&!fD(r=cD(n,e))||t!=="string"&&dD(n=e.toString)&&!fD(r=cD(n,e)))return r;throw new rde("Can't convert object to primitive value")},h8={exports:{}},B3=Za,ode=Object.defineProperty,ide=function(e,t){try{ode(B3,e,{value:t,configurable:!0,writable:!0})}catch{B3[e]=t}return t},sde=Za,lde=ide,H3="__core-js_shared__",U3=h8.exports=sde[H3]||lde(H3,{});(U3.versions||(U3.versions=[])).push({version:"3.37.0",mode:"pure",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var JI=h8.exports,Y3=JI,rm=function(e,t){return Y3[e]||(Y3[e]=t||{})},ude=$I,cde=Object,tc=function(e){return cde(ude(e))},dde=fa,fde=tc,hde=dde({}.hasOwnProperty),Fi=Object.hasOwn||function(t,n){return hde(fde(t),n)},pde=fa,mde=0,gde=Math.random(),vde=pde(1 .toString),KI=function(e){return"Symbol("+(e===void 0?"":e)+")_"+vde(++mde+gde,36)},yde=Za,wde=rm,z3=Fi,bde=KI,Sde=nm,Dde=f8,mp=yde.Symbol,hD=wde("wks"),Tde=Dde?mp.for||mp:mp&&mp.withoutSetter||bde,Na=function(e){return z3(hD,e)||(hD[e]=Sde&&z3(mp,e)?mp[e]:Tde("Symbol."+e)),hD[e]},Ide=ru,V3=Xu,W3=ry,Ede=GI,Cde=ade,xde=Na,Mde=TypeError,kde=xde("toPrimitive"),Nde=function(e,t){if(!V3(e)||W3(e))return e;var n=Ede(e,kde),r;if(n){if(t===void 0&&(t="default"),r=Ide(n,e,t),!V3(r)||W3(r))return r;throw new Mde("Can't convert object to primitive value")}return t===void 0&&(t="number"),Cde(e,t)},Ade=Nde,Fde=ry,QI=function(e){var t=Ade(e,"string");return Fde(t)?t:t+""},Ode=Za,$3=Xu,GT=Ode.document,Pde=$3(GT)&&$3(GT.createElement),p8=function(e){return Pde?GT.createElement(e):{}},jde=ii,Lde=da,Rde=p8,m8=!jde&&!Lde(function(){return Object.defineProperty(Rde("div"),"a",{get:function(){return 7}}).a!==7}),_de=ii,Bde=ru,Hde=VI,Ude=ny,Yde=au,zde=QI,Vde=Fi,Wde=m8,Z3=Object.getOwnPropertyDescriptor;ty.f=_de?Z3:function(t,n){if(t=Yde(t),n=zde(n),Wde)try{return Z3(t,n)}catch{}if(Vde(t,n))return Ude(!Bde(Hde.f,t,n),t[n])};var $de=da,Zde=co,qde=/#|\.prototype\./,ay=function(e,t){var n=Jde[Gde(e)];return n===Qde?!0:n===Kde?!1:Zde(t)?$de(t):!!t},Gde=ay.normalize=function(e){return String(e).replace(qde,".").toLowerCase()},Jde=ay.data={},Kde=ay.NATIVE="N",Qde=ay.POLYFILL="P",Xde=ay,q3=zI,efe=qI,tfe=Kb,nfe=q3(q3.bind),XI=function(e,t){return efe(e),t===void 0?e:tfe?nfe(e,t):function(){return e.apply(t,arguments)}},$s={},rfe=ii,afe=da,g8=rfe&&afe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ofe=Xu,ife=String,sfe=TypeError,ld=function(e){if(ofe(e))return e;throw new sfe(ife(e)+" is not an object")},lfe=ii,ufe=m8,cfe=g8,B0=ld,G3=QI,dfe=TypeError,pD=Object.defineProperty,ffe=Object.getOwnPropertyDescriptor,mD="enumerable",gD="configurable",vD="writable";$s.f=lfe?cfe?function(t,n,r){if(B0(t),n=G3(n),B0(r),typeof t=="function"&&n==="prototype"&&"value"in r&&vD in r&&!r[vD]){var a=ffe(t,n);a&&a[vD]&&(t[n]=r.value,r={configurable:gD in r?r[gD]:a[gD],enumerable:mD in r?r[mD]:a[mD],writable:!1})}return pD(t,n,r)}:pD:function(t,n,r){if(B0(t),n=G3(n),B0(r),ufe)try{return pD(t,n,r)}catch{}if("get"in r||"set"in r)throw new dfe("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var hfe=ii,pfe=$s,mfe=ny,Xb=hfe?function(e,t,n){return pfe.f(e,t,mfe(1,n))}:function(e,t,n){return e[t]=n,e},Cg=Za,gfe=YI,vfe=zI,yfe=co,wfe=ty.f,bfe=Xde,op=qa,Sfe=XI,ip=Xb,J3=Fi,Dfe=function(e){var t=function(n,r,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,a)}return gfe(e,this,arguments)};return t.prototype=e.prototype,t},Gn=function(e,t){var n=e.target,r=e.global,a=e.stat,o=e.proto,i=r?Cg:a?Cg[n]:Cg[n]&&Cg[n].prototype,l=r?op:op[n]||ip(op,n,{})[n],c=l.prototype,f,h,g,y,w,S,D,I,M;for(y in t)f=bfe(r?y:n+(a?".":"#")+y,e.forced),h=!f&&i&&J3(i,y),S=l[y],h&&(e.dontCallGetSet?(M=wfe(i,y),D=M&&M.value):D=i[y]),w=h&&D?D:t[y],!(!f&&!o&&typeof S==typeof w)&&(e.bind&&h?I=Sfe(w,Cg):e.wrap&&h?I=Dfe(w):o&&yfe(w)?I=vfe(w):I=w,(e.sham||w&&w.sham||S&&S.sham)&&ip(I,"sham",!0),ip(l,y,I),o&&(g=n+"Prototype",J3(op,g)||ip(op,g,{}),ip(op[g],y,w),e.real&&c&&(f||!c[y])&&ip(c,y,w)))},Tfe=tm,am=Array.isArray||function(t){return Tfe(t)==="Array"},Ife=Gn,Efe=am;Ife({target:"Array",stat:!0},{isArray:Efe});var Cfe=qa,xfe=Cfe.Array.isArray,Mfe=xfe,v8=Mfe,kfe=v8,Nfe=kfe,Afe=Nfe,Ffe=Afe,Ofe=Ffe;const y8=qt(Ofe);function Pfe(e){if(y8(e))return e}var jfe=Math.ceil,Lfe=Math.floor,Rfe=Math.trunc||function(t){var n=+t;return(n>0?Lfe:jfe)(n)},_fe=Rfe,e1=function(e){var t=+e;return t!==t||t===0?0:_fe(t)},Bfe=e1,Hfe=Math.min,Ufe=function(e){var t=Bfe(e);return t>0?Hfe(t,9007199254740991):0},Yfe=Ufe,jf=function(e){return Yfe(e.length)},zfe=TypeError,Vfe=9007199254740991,eE=function(e){if(e>Vfe)throw zfe("Maximum allowed index exceeded");return e},Wfe=ii,$fe=$s,Zfe=ny,oy=function(e,t,n){Wfe?$fe.f(e,t,Zfe(0,n)):e[t]=n},qfe=Na,Gfe=qfe("toStringTag"),w8={};w8[Gfe]="z";var tE=String(w8)==="[object z]",Jfe=tE,Kfe=co,gw=tm,Qfe=Na,Xfe=Qfe("toStringTag"),ehe=Object,the=gw(function(){return arguments}())==="Arguments",nhe=function(e,t){try{return e[t]}catch{}},iy=Jfe?gw:function(e){var t,n,r;return e===void 0?"Undefined":e===null?"Null":typeof(n=nhe(t=ehe(e),Xfe))=="string"?n:the?gw(t):(r=gw(t))==="Object"&&Kfe(t.callee)?"Arguments":r},rhe=fa,ahe=co,JT=JI,ohe=rhe(Function.toString);ahe(JT.inspectSource)||(JT.inspectSource=function(e){return ohe(e)});var ihe=JT.inspectSource,she=fa,lhe=da,b8=co,uhe=iy,che=ou,dhe=ihe,S8=function(){},D8=che("Reflect","construct"),nE=/^\s*(?:class|function)\b/,fhe=she(nE.exec),hhe=!nE.test(S8),xg=function(t){if(!b8(t))return!1;try{return D8(S8,[],t),!0}catch{return!1}},T8=function(t){if(!b8(t))return!1;switch(uhe(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return hhe||!!fhe(nE,dhe(t))}catch{return!0}};T8.sham=!0;var rE=!D8||lhe(function(){var e;return xg(xg.call)||!xg(Object)||!xg(function(){e=!0})||e})?T8:xg,K3=am,phe=rE,mhe=Xu,ghe=Na,vhe=ghe("species"),Q3=Array,yhe=function(e){var t;return K3(e)&&(t=e.constructor,phe(t)&&(t===Q3||K3(t.prototype))?t=void 0:mhe(t)&&(t=t[vhe],t===null&&(t=void 0))),t===void 0?Q3:t},whe=yhe,aE=function(e,t){return new(whe(e))(t===0?0:t)},bhe=da,She=Na,Dhe=ZI,The=She("species"),t1=function(e){return Dhe>=51||!bhe(function(){var t=[],n=t.constructor={};return n[The]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Ihe=Gn,Ehe=da,Che=am,xhe=Xu,Mhe=tc,khe=jf,X3=eE,ek=oy,Nhe=aE,Ahe=t1,Fhe=Na,Ohe=ZI,I8=Fhe("isConcatSpreadable"),Phe=Ohe>=51||!Ehe(function(){var e=[];return e[I8]=!1,e.concat()[0]!==e}),jhe=function(e){if(!xhe(e))return!1;var t=e[I8];return t!==void 0?!!t:Che(e)},Lhe=!Phe||!Ahe("concat");Ihe({target:"Array",proto:!0,arity:1,forced:Lhe},{concat:function(t){var n=Mhe(this),r=Nhe(n,0),a=0,o,i,l,c,f;for(o=-1,l=arguments.length;oi;)if(l=a[i++],l!==l)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===n)return e||i||0;return!e&&-1}},E8={includes:tk(!0),indexOf:tk(!1)},r1={},Whe=fa,yD=Fi,$he=au,Zhe=E8.indexOf,qhe=r1,nk=Whe([].push),C8=function(e,t){var n=$he(e),r=0,a=[],o;for(o in n)!yD(qhe,o)&&yD(n,o)&&nk(a,o);for(;t.length>r;)yD(n,o=t[r++])&&(~Zhe(a,o)||nk(a,o));return a},iE=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ghe=C8,Jhe=iE,sE=Object.keys||function(t){return Ghe(t,Jhe)},Khe=ii,Qhe=g8,Xhe=$s,epe=ld,tpe=au,npe=sE;n1.f=Khe&&!Qhe?Object.defineProperties:function(t,n){epe(t);for(var r=tpe(n),a=npe(n),o=a.length,i=0,l;o>i;)Xhe.f(t,l=a[i++],r[l]);return t};var rpe=ou,ape=rpe("document","documentElement"),ope=rm,ipe=KI,rk=ope("keys"),a1=function(e){return rk[e]||(rk[e]=ipe(e))},spe=ld,lpe=n1,ak=iE,upe=r1,cpe=ape,dpe=p8,fpe=a1,ok=">",ik="<",KT="prototype",QT="script",x8=fpe("IE_PROTO"),wD=function(){},M8=function(e){return ik+QT+ok+e+ik+"/"+QT+ok},sk=function(e){e.write(M8("")),e.close();var t=e.parentWindow.Object;return e=null,t},hpe=function(){var e=dpe("iframe"),t="java"+QT+":",n;return e.style.display="none",cpe.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(M8("document.F=Object")),n.close(),n.F},H0,vw=function(){try{H0=new ActiveXObject("htmlfile")}catch{}vw=typeof document<"u"?document.domain&&H0?sk(H0):hpe():sk(H0);for(var e=ak.length;e--;)delete vw[KT][ak[e]];return vw()};upe[x8]=!0;var lE=Object.create||function(t,n){var r;return t!==null?(wD[KT]=spe(t),r=new wD,wD[KT]=null,r[x8]=t):r=vw(),n===void 0?r:lpe.f(r,n)},o1={},ppe=C8,mpe=iE,gpe=mpe.concat("length","prototype");o1.f=Object.getOwnPropertyNames||function(t){return ppe(t,gpe)};var k8={},vpe=fa,i1=vpe([].slice),ype=tm,wpe=au,N8=o1.f,bpe=i1,A8=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Spe=function(e){try{return N8(e)}catch{return bpe(A8)}};k8.f=function(t){return A8&&ype(t)==="Window"?Spe(t):N8(wpe(t))};var s1={};s1.f=Object.getOwnPropertySymbols;var Dpe=Xb,l1=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Dpe(e,t,n),e},Tpe=$s,Ipe=function(e,t,n){return Tpe.f(e,t,n)},ly={},Epe=Na;ly.f=Epe;var lk=qa,Cpe=Fi,xpe=ly,Mpe=$s.f,Ir=function(e){var t=lk.Symbol||(lk.Symbol={});Cpe(t,e)||Mpe(t,e,{value:xpe.f(e)})},kpe=ru,Npe=ou,Ape=Na,Fpe=l1,F8=function(){var e=Npe("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,r=Ape("toPrimitive");t&&!t[r]&&Fpe(t,r,function(a){return kpe(n,this)},{arity:1})},Ope=tE,Ppe=iy,jpe=Ope?{}.toString:function(){return"[object "+Ppe(this)+"]"},Lpe=tE,Rpe=$s.f,_pe=Xb,Bpe=Fi,Hpe=jpe,Upe=Na,uk=Upe("toStringTag"),om=function(e,t,n,r){var a=n?e:e&&e.prototype;a&&(Bpe(a,uk)||Rpe(a,uk,{configurable:!0,value:t}),r&&!Lpe&&_pe(a,"toString",Hpe))},Ype=Za,zpe=co,ck=Ype.WeakMap,Vpe=zpe(ck)&&/native code/.test(String(ck)),Wpe=Vpe,O8=Za,$pe=Xu,Zpe=Xb,bD=Fi,SD=JI,qpe=a1,Gpe=r1,dk="Object already initialized",XT=O8.TypeError,Jpe=O8.WeakMap,Qw,gv,Xw,Kpe=function(e){return Xw(e)?gv(e):Qw(e,{})},Qpe=function(e){return function(t){var n;if(!$pe(t)||(n=gv(t)).type!==e)throw new XT("Incompatible receiver, "+e+" required");return n}};if(Wpe||SD.state){var Fl=SD.state||(SD.state=new Jpe);Fl.get=Fl.get,Fl.has=Fl.has,Fl.set=Fl.set,Qw=function(e,t){if(Fl.has(e))throw new XT(dk);return t.facade=e,Fl.set(e,t),t},gv=function(e){return Fl.get(e)||{}},Xw=function(e){return Fl.has(e)}}else{var sp=qpe("state");Gpe[sp]=!0,Qw=function(e,t){if(bD(e,sp))throw new XT(dk);return t.facade=e,Zpe(e,sp,t),t},gv=function(e){return bD(e,sp)?e[sp]:{}},Xw=function(e){return bD(e,sp)}}var uE={set:Qw,get:gv,has:Xw,enforce:Kpe,getterFor:Qpe},Xpe=XI,eme=fa,tme=u8,nme=tc,rme=jf,ame=aE,fk=eme([].push),$c=function(e){var t=e===1,n=e===2,r=e===3,a=e===4,o=e===6,i=e===7,l=e===5||o;return function(c,f,h,g){for(var y=nme(c),w=tme(y),S=rme(w),D=Xpe(f,h),I=0,M=g||ame,N=t?M(c,S):n||i?M(c,0):void 0,B,k;S>I;I++)if((l||I in w)&&(B=w[I],k=D(B,I,y),e))if(t)N[I]=k;else if(k)switch(e){case 3:return!0;case 5:return B;case 6:return I;case 2:fk(N,B)}else switch(e){case 4:return!1;case 7:fk(N,B)}return o?-1:r||a?a:N}},cE={forEach:$c(0),map:$c(1),filter:$c(2),some:$c(3),every:$c(4),find:$c(5),findIndex:$c(6),filterReject:$c(7)},u1=Gn,uy=Za,dE=ru,ome=fa,kp=ii,Np=nm,ime=da,xa=Fi,sme=ec,e2=ld,c1=au,fE=QI,lme=sy,t2=ny,Ap=lE,P8=sE,ume=o1,j8=k8,cme=s1,L8=ty,R8=$s,dme=n1,_8=VI,hk=l1,fme=Ipe,hE=rm,hme=a1,B8=r1,pk=KI,pme=Na,mme=ly,gme=Ir,vme=F8,yme=om,H8=uE,d1=cE.forEach,Xo=hme("hidden"),f1="Symbol",vv="prototype",wme=H8.set,mk=H8.getterFor(f1),Hs=Object[vv],vf=uy.Symbol,Bg=vf&&vf[vv],bme=uy.RangeError,Sme=uy.TypeError,DD=uy.QObject,U8=L8.f,yf=R8.f,Y8=j8.f,Dme=_8.f,z8=ome([].push),Zu=hE("symbols"),cy=hE("op-symbols"),Tme=hE("wks"),n2=!DD||!DD[vv]||!DD[vv].findChild,V8=function(e,t,n){var r=U8(Hs,t);r&&delete Hs[t],yf(e,t,n),r&&e!==Hs&&yf(Hs,t,r)},r2=kp&&ime(function(){return Ap(yf({},"a",{get:function(){return yf(this,"a",{value:7}).a}})).a!==7})?V8:yf,TD=function(e,t){var n=Zu[e]=Ap(Bg);return wme(n,{type:f1,tag:e,description:t}),kp||(n.description=t),n},h1=function(t,n,r){t===Hs&&h1(cy,n,r),e2(t);var a=fE(n);return e2(r),xa(Zu,a)?(r.enumerable?(xa(t,Xo)&&t[Xo][a]&&(t[Xo][a]=!1),r=Ap(r,{enumerable:t2(0,!1)})):(xa(t,Xo)||yf(t,Xo,t2(1,Ap(null))),t[Xo][a]=!0),r2(t,a,r)):yf(t,a,r)},pE=function(t,n){e2(t);var r=c1(n),a=P8(r).concat(q8(r));return d1(a,function(o){(!kp||dE(W8,r,o))&&h1(t,o,r[o])}),t},Ime=function(t,n){return n===void 0?Ap(t):pE(Ap(t),n)},W8=function(t){var n=fE(t),r=dE(Dme,this,n);return this===Hs&&xa(Zu,n)&&!xa(cy,n)?!1:r||!xa(this,n)||!xa(Zu,n)||xa(this,Xo)&&this[Xo][n]?r:!0},$8=function(t,n){var r=c1(t),a=fE(n);if(!(r===Hs&&xa(Zu,a)&&!xa(cy,a))){var o=U8(r,a);return o&&xa(Zu,a)&&!(xa(r,Xo)&&r[Xo][a])&&(o.enumerable=!0),o}},Z8=function(t){var n=Y8(c1(t)),r=[];return d1(n,function(a){!xa(Zu,a)&&!xa(B8,a)&&z8(r,a)}),r},q8=function(e){var t=e===Hs,n=Y8(t?cy:c1(e)),r=[];return d1(n,function(a){xa(Zu,a)&&(!t||xa(Hs,a))&&z8(r,Zu[a])}),r};Np||(vf=function(){if(sme(Bg,this))throw new Sme("Symbol is not a constructor");var t=!arguments.length||arguments[0]===void 0?void 0:lme(arguments[0]),n=pk(t),r=function(a){var o=this===void 0?uy:this;o===Hs&&dE(r,cy,a),xa(o,Xo)&&xa(o[Xo],n)&&(o[Xo][n]=!1);var i=t2(1,a);try{r2(o,n,i)}catch(l){if(!(l instanceof bme))throw l;V8(o,n,i)}};return kp&&n2&&r2(Hs,n,{configurable:!0,set:r}),TD(n,t)},Bg=vf[vv],hk(Bg,"toString",function(){return mk(this).tag}),hk(vf,"withoutSetter",function(e){return TD(pk(e),e)}),_8.f=W8,R8.f=h1,dme.f=pE,L8.f=$8,ume.f=j8.f=Z8,cme.f=q8,mme.f=function(e){return TD(pme(e),e)},kp&&fme(Bg,"description",{configurable:!0,get:function(){return mk(this).description}}));u1({global:!0,constructor:!0,wrap:!0,forced:!Np,sham:!Np},{Symbol:vf});d1(P8(Tme),function(e){gme(e)});u1({target:f1,stat:!0,forced:!Np},{useSetter:function(){n2=!0},useSimple:function(){n2=!1}});u1({target:"Object",stat:!0,forced:!Np,sham:!kp},{create:Ime,defineProperty:h1,defineProperties:pE,getOwnPropertyDescriptor:$8});u1({target:"Object",stat:!0,forced:!Np},{getOwnPropertyNames:Z8});vme();yme(vf,f1);B8[Xo]=!0;var Eme=nm,G8=Eme&&!!Symbol.for&&!!Symbol.keyFor,Cme=Gn,xme=ou,Mme=Fi,kme=sy,J8=rm,Nme=G8,ID=J8("string-to-symbol-registry"),Ame=J8("symbol-to-string-registry");Cme({target:"Symbol",stat:!0,forced:!Nme},{for:function(e){var t=kme(e);if(Mme(ID,t))return ID[t];var n=xme("Symbol")(t);return ID[t]=n,Ame[n]=t,n}});var Fme=Gn,Ome=Fi,Pme=ry,jme=Qb,Lme=rm,Rme=G8,gk=Lme("symbol-to-string-registry");Fme({target:"Symbol",stat:!0,forced:!Rme},{keyFor:function(t){if(!Pme(t))throw new TypeError(jme(t)+" is not a symbol");if(Ome(gk,t))return gk[t]}});var _me=fa,vk=am,Bme=co,yk=tm,Hme=sy,wk=_me([].push),Ume=function(e){if(Bme(e))return e;if(vk(e)){for(var t=e.length,n=[],r=0;r=t.length)return e.target=void 0,V0(void 0,!0);switch(e.kind){case"keys":return V0(n,!1);case"values":return V0(t[n],!1)}return V0([n,t[n]],!1)},"values");Ok.Arguments=Ok.Array;var uve={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},cve=uve,dve=Za,fve=om,Pk=im;for(var MD in cve)fve(dve[MD],MD),Pk[MD]=Pk.Array;var hve=Tge,pve=hve,mve=Na,gve=$s.f,jk=mve("metadata"),Lk=Function.prototype;Lk[jk]===void 0&&gve(Lk,jk,{value:null});var vve=Ir;vve("asyncDispose");var yve=Ir;yve("dispose");var wve=Ir;wve("metadata");var bve=pve,Sve=bve,Dve=ou,Tve=fa,gE=Dve("Symbol"),Ive=gE.keyFor,Eve=Tve(gE.prototype.valueOf),f5=gE.isRegisteredSymbol||function(t){try{return Ive(Eve(t))!==void 0}catch{return!1}},Cve=Gn,xve=f5;Cve({target:"Symbol",stat:!0},{isRegisteredSymbol:xve});var Mve=rm,h5=ou,kve=fa,Nve=ry,Ave=Na,eb=h5("Symbol"),Rk=eb.isWellKnownSymbol,p5=h5("Object","getOwnPropertyNames"),Fve=kve(eb.prototype.valueOf),_k=Mve("wks");for(var kD=0,Bk=p5(eb),Ove=Bk.length;kD=o?e?"":void 0:(i=Uk(r,a),i<55296||i>56319||a+1===o||(l=Uk(r,a+1))<56320||l>57343?e?Qve(r,a):i:e?Xve(r,a,a+2):(i-55296<<10)+(l-56320)+65536)}},eye={codeAt:Yk(!1),charAt:Yk(!0)},tye=eye.charAt,nye=sy,g5=uE,rye=l5,zk=u5,v5="String Iterator",aye=g5.set,oye=g5.getterFor(v5);rye(String,"String",function(e){aye(this,{type:v5,string:nye(e),index:0})},function(){var t=oye(this),n=t.string,r=t.index,a;return r>=n.length?zk(void 0,!0):(a=tye(n,r),t.index+=a.length,zk(a,!1))});var iye=iy,Vk=GI,sye=WI,lye=im,uye=Na,cye=uye("iterator"),yE=function(e){if(!sye(e))return Vk(e,cye)||Vk(e,"@@iterator")||lye[iye(e)]},dye=yE,fye=dye,hye=fye,pye=hye,mye=pye,gye=mye,vye=gye,yye=vye,wye=yye;const y5=qt(wye);var bye=ii,Sye=am,Dye=TypeError,Tye=Object.getOwnPropertyDescriptor,Iye=bye&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),w5=Iye?function(e,t){if(Sye(e)&&!Tye(e,"length").writable)throw new Dye("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Eye=Gn,Cye=tc,xye=jf,Mye=w5,kye=eE,Nye=da,Aye=Nye(function(){return[].push.call({length:4294967296},1)!==4294967297}),Fye=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},Oye=Aye||!Fye();Eye({target:"Array",proto:!0,arity:1,forced:Oye},{push:function(t){var n=Cye(this),r=xye(n),a=arguments.length;kye(r+a);for(var o=0;o1?arguments[1]:void 0,i=o!==void 0;i&&(o=B0e(o,a>2?arguments[2]:void 0));var l=Z0e(n),c=0,f,h,g,y,w,S;if(l&&!(this===Gk&&z0e(l)))for(h=r?new this:[],y=$0e(n,l),w=y.next;!(g=H0e(w,y)).done;c++)S=i?Y0e(y,o,[g.value,c],!0):g.value,qk(h,c,S);else for(f=W0e(n),h=r?new this(f):Gk(f);f>c;c++)S=i?o(n[c],c):n[c],qk(h,c,S);return h.length=c,h},G0e=Na,b5=G0e("iterator"),S5=!1;try{var J0e=0,Jk={next:function(){return{done:!!J0e++}},return:function(){S5=!0}};Jk[b5]=function(){return this},Array.from(Jk,function(){throw 2})}catch{}var K0e=function(e,t){try{if(!t&&!S5)return!1}catch{return!1}var n=!1;try{var r={};r[b5]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},Q0e=Gn,X0e=q0e,ewe=K0e,twe=!ewe(function(e){Array.from(e)});Q0e({target:"Array",stat:!0,forced:twe},{from:X0e});var nwe=qa,rwe=nwe.Array.from,awe=rwe,owe=awe,iwe=owe,swe=iwe,lwe=swe,uwe=lwe,cwe=uwe;const D5=qt(cwe);function s2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=74)&&(Ol=LD.match(/Chrome\/(\d+)/),Ol&&(tb=Ol[1])));var wbe=tb&&+tb,o4=wbe,bbe=Zs,P5=!!Object.getOwnPropertySymbols&&!bbe(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&o4&&o4<41}),Sbe=P5,j5=Sbe&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Dbe=ls,Tbe=v1,Ibe=j5,L5=Ibe?function(e){return typeof e=="symbol"}:function(e){var t=Tbe("Symbol");return Dbe(t)&&Object(e)instanceof t},Ebe=function(e){try{return String(e)}catch{return"Object"}},Cbe=ls,xbe=Ebe,Mbe=function(e){if(Cbe(e))return e;throw TypeError(xbe(e)+" is not a function")},kbe=Mbe,R5=function(e,t){var n=e[t];return n==null?void 0:kbe(n)},RD=ls,_D=fy,Nbe=function(e,t){var n,r;if(t==="string"&&RD(n=e.toString)&&!_D(r=n.call(e))||RD(n=e.valueOf)&&!_D(r=n.call(e))||t!=="string"&&RD(n=e.toString)&&!_D(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},_5={exports:{}},i4=Oi,kE=function(e,t){try{Object.defineProperty(i4,e,{value:t,configurable:!0,writable:!0})}catch{i4[e]=t}return t},Abe=Oi,Fbe=kE,s4="__core-js_shared__",Obe=Abe[s4]||Fbe(s4,{}),NE=Obe,l4=NE;(_5.exports=function(e,t){return l4[e]||(l4[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.18.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var AE=_5.exports,Pbe=g1,B5=function(e){return Object(Pbe(e))},jbe=B5,Lbe={}.hasOwnProperty,_f=Object.hasOwn||function(t,n){return Lbe.call(jbe(t),n)},Rbe=0,_be=Math.random(),H5=function(e){return"Symbol("+String(e===void 0?"":e)+")_"+(++Rbe+_be).toString(36)},Bbe=Oi,Hbe=AE,u4=_f,Ube=H5,c4=P5,Ybe=j5,Mg=Hbe("wks"),Zg=Bbe.Symbol,zbe=Ybe?Zg:Zg&&Zg.withoutSetter||Ube,hy=function(e){return(!u4(Mg,e)||!(c4||typeof Mg[e]=="string"))&&(c4&&u4(Zg,e)?Mg[e]=Zg[e]:Mg[e]=zbe("Symbol."+e)),Mg[e]},d4=fy,f4=L5,Vbe=R5,Wbe=Nbe,$be=hy,Zbe=$be("toPrimitive"),qbe=function(e,t){if(!d4(e)||f4(e))return e;var n=Vbe(e,Zbe),r;if(n){if(t===void 0&&(t="default"),r=n.call(e,t),!d4(r)||f4(r))return r;throw TypeError("Can't convert object to primitive value")}return t===void 0&&(t="number"),Wbe(e,t)},Gbe=qbe,Jbe=L5,U5=function(e){var t=Gbe(e,"string");return Jbe(t)?t:String(t)},Kbe=Oi,h4=fy,l2=Kbe.document,Qbe=h4(l2)&&h4(l2.createElement),Y5=function(e){return Qbe?l2.createElement(e):{}},Xbe=Rf,e1e=Zs,t1e=Y5,z5=!Xbe&&!e1e(function(){return Object.defineProperty(t1e("div"),"a",{get:function(){return 7}}).a!=7}),n1e=Rf,r1e=k5,a1e=F5,o1e=ME,i1e=U5,s1e=_f,l1e=z5,p4=Object.getOwnPropertyDescriptor;CE.f=n1e?p4:function(t,n){if(t=o1e(t),n=i1e(n),l1e)try{return p4(t,n)}catch{}if(s1e(t,n))return a1e(!r1e.f.call(t,n),t[n])};var py={},u1e=fy,ud=function(e){if(u1e(e))return e;throw TypeError(String(e)+" is not an object")},c1e=Rf,d1e=z5,m4=ud,f1e=U5,g4=Object.defineProperty;py.f=c1e?g4:function(t,n,r){if(m4(t),n=f1e(n),m4(r),d1e)try{return g4(t,n,r)}catch{}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var h1e=Rf,p1e=py,m1e=F5,y1=h1e?function(e,t,n){return p1e.f(e,t,m1e(1,n))}:function(e,t,n){return e[t]=n,e},V5={exports:{}},g1e=ls,u2=NE,v1e=Function.toString;g1e(u2.inspectSource)||(u2.inspectSource=function(e){return v1e.call(e)});var W5=u2.inspectSource,y1e=Oi,w1e=ls,b1e=W5,v4=y1e.WeakMap,S1e=w1e(v4)&&/native code/.test(b1e(v4)),D1e=AE,T1e=H5,y4=D1e("keys"),$5=function(e){return y4[e]||(y4[e]=T1e(e))},FE={},I1e=S1e,E1e=Oi,C1e=fy,x1e=y1,BD=_f,HD=NE,M1e=$5,k1e=FE,w4="Object already initialized",N1e=E1e.WeakMap,nb,wv,rb,A1e=function(e){return rb(e)?wv(e):nb(e,{})},F1e=function(e){return function(t){var n;if(!C1e(t)||(n=wv(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(I1e||HD.state){var tf=HD.state||(HD.state=new N1e),O1e=tf.get,b4=tf.has,P1e=tf.set;nb=function(e,t){if(b4.call(tf,e))throw new TypeError(w4);return t.facade=e,P1e.call(tf,e,t),t},wv=function(e){return O1e.call(tf,e)||{}},rb=function(e){return b4.call(tf,e)}}else{var lp=M1e("state");k1e[lp]=!0,nb=function(e,t){if(BD(e,lp))throw new TypeError(w4);return t.facade=e,x1e(e,lp,t),t},wv=function(e){return BD(e,lp)?e[lp]:{}},rb=function(e){return BD(e,lp)}}var Z5={set:nb,get:wv,has:rb,enforce:A1e,getterFor:F1e},c2=Rf,j1e=_f,q5=Function.prototype,L1e=c2&&Object.getOwnPropertyDescriptor,OE=j1e(q5,"name"),R1e=OE&&(function(){}).name==="something",_1e=OE&&(!c2||c2&&L1e(q5,"name").configurable),PE={EXISTS:OE,PROPER:R1e,CONFIGURABLE:_1e},B1e=Oi,S4=ls,H1e=_f,D4=y1,U1e=kE,Y1e=W5,G5=Z5,z1e=PE.CONFIGURABLE,V1e=G5.get,W1e=G5.enforce,$1e=String(String).split("String");(V5.exports=function(e,t,n,r){var a=r?!!r.unsafe:!1,o=r?!!r.enumerable:!1,i=r?!!r.noTargetGet:!1,l=r&&r.name!==void 0?r.name:t,c;if(S4(n)&&(String(l).slice(0,7)==="Symbol("&&(l="["+String(l).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!H1e(n,"name")||z1e&&n.name!==l)&&D4(n,"name",l),c=W1e(n),c.source||(c.source=$1e.join(typeof l=="string"?l:""))),e===B1e){o?e[t]=n:U1e(t,n);return}else a?!i&&e[t]&&(o=!0):delete e[t];o?e[t]=n:D4(e,t,n)})(Function.prototype,"toString",function(){return S4(this)&&V1e(this).source||Y1e(this)});var my=V5.exports,J5={},Z1e=Math.ceil,q1e=Math.floor,w1=function(e){var t=+e;return t!==t||t===0?0:(t>0?q1e:Z1e)(t)},G1e=w1,J1e=Math.max,K1e=Math.min,Q1e=function(e,t){var n=G1e(e);return n<0?J1e(n+t,0):K1e(n,t)},X1e=w1,eSe=Math.min,K5=function(e){return e>0?eSe(X1e(e),9007199254740991):0},tSe=K5,nSe=function(e){return tSe(e.length)},rSe=ME,aSe=Q1e,oSe=nSe,T4=function(e){return function(t,n,r){var a=rSe(t),o=oSe(a),i=aSe(r,o),l;if(e&&n!=n){for(;o>i;)if(l=a[i++],l!=l)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===n)return e||i||0;return!e&&-1}},iSe={includes:T4(!0),indexOf:T4(!1)},UD=_f,sSe=ME,lSe=iSe.indexOf,uSe=FE,Q5=function(e,t){var n=sSe(e),r=0,a=[],o;for(o in n)!UD(uSe,o)&&UD(n,o)&&a.push(o);for(;t.length>r;)UD(n,o=t[r++])&&(~lSe(a,o)||a.push(o));return a},jE=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],cSe=Q5,dSe=jE,fSe=dSe.concat("length","prototype");J5.f=Object.getOwnPropertyNames||function(t){return cSe(t,fSe)};var X5={};X5.f=Object.getOwnPropertySymbols;var hSe=v1,pSe=J5,mSe=X5,gSe=ud,vSe=hSe("Reflect","ownKeys")||function(t){var n=pSe.f(gSe(t)),r=mSe.f;return r?n.concat(r(t)):n},ySe=_f,wSe=vSe,bSe=CE,SSe=py,DSe=function(e,t){for(var n=wSe(t),r=SSe.f,a=bSe.f,o=0;oo;)XSe.f(t,i=r[o++],n[i]);return t},rDe=v1,aDe=rDe("document","documentElement"),oDe=ud,iDe=nDe,I4=jE,sDe=FE,lDe=aDe,uDe=Y5,cDe=$5,E4=">",C4="<",d2="prototype",f2="script",oO=cDe("IE_PROTO"),zD=function(){},iO=function(e){return C4+f2+E4+e+C4+"/"+f2+E4},x4=function(e){e.write(iO("")),e.close();var t=e.parentWindow.Object;return e=null,t},dDe=function(){var e=uDe("iframe"),t="java"+f2+":",n;return e.style.display="none",lDe.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(iO("document.F=Object")),n.close(),n.F},$0,ww=function(){try{$0=new ActiveXObject("htmlfile")}catch{}ww=typeof document<"u"?document.domain&&$0?x4($0):dDe():x4($0);for(var e=I4.length;e--;)delete ww[d2][I4[e]];return ww()};sDe[oO]=!0;var fDe=Object.create||function(t,n){var r;return t!==null?(zD[d2]=oDe(t),r=new zD,zD[d2]=null,r[oO]=t):r=ww(),n===void 0?r:iDe(r,n)},hDe=Zs,pDe=Oi,mDe=pDe.RegExp,gDe=hDe(function(){var e=mDe(".","s");return!(e.dotAll&&e.exec(` +`)&&e.flags==="s")}),vDe=Zs,yDe=Oi,wDe=yDe.RegExp,bDe=vDe(function(){var e=wDe("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),SDe=b1,DDe=nO,M4=RE,TDe=AE,IDe=fDe,EDe=Z5.get,CDe=gDe,xDe=bDe,ab=RegExp.prototype.exec,MDe=TDe("native-string-replace",String.prototype.replace),h2=ab,p2=function(){var e=/a/,t=/b*/g;return ab.call(e,"a"),ab.call(t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),sO=M4.UNSUPPORTED_Y||M4.BROKEN_CARET,m2=/()??/.exec("")[1]!==void 0,kDe=p2||m2||sO||CDe||xDe;kDe&&(h2=function(t){var n=this,r=EDe(n),a=SDe(t),o=r.raw,i,l,c,f,h,g,y;if(o)return o.lastIndex=n.lastIndex,i=h2.call(o,a),n.lastIndex=o.lastIndex,i;var w=r.groups,S=sO&&n.sticky,D=DDe.call(n),I=n.source,M=0,N=a;if(S&&(D=D.replace("y",""),D.indexOf("g")===-1&&(D+="g"),N=a.slice(n.lastIndex),n.lastIndex>0&&(!n.multiline||n.multiline&&a.charAt(n.lastIndex-1)!==` +`)&&(I="(?: "+I+")",N=" "+N,M++),l=new RegExp("^(?:"+I+")",D)),m2&&(l=new RegExp("^"+I+"$(?!\\s)",D)),p2&&(c=n.lastIndex),f=ab.call(S?l:n,N),S?f?(f.input=f.input.slice(M),f[0]=f[0].slice(M),f.index=n.lastIndex,n.lastIndex+=f[0].length):n.lastIndex=0:p2&&f&&(n.lastIndex=n.global?f.index+f[0].length:c),m2&&f&&f.length>1&&MDe.call(f[0],l,function(){for(h=1;h=o?e?"":void 0:(i=r.charCodeAt(a),i<55296||i>56319||a+1===o||(l=r.charCodeAt(a+1))<56320||l>57343?e?r.charAt(a):i:e?r.slice(a,a+2):(i-55296<<10)+(l-56320)+65536)}},_De={codeAt:F4(!1),charAt:F4(!0)},BDe=_De.charAt,HDe=function(e,t,n){return t+(n?BDe(e,t).length:1)},UDe=B5,YDe=Math.floor,zDe="".replace,VDe=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,WDe=/\$([$&'`]|\d{1,2})/g,$De=function(e,t,n,r,a,o){var i=n+e.length,l=r.length,c=WDe;return a!==void 0&&(a=UDe(a),c=VDe),zDe.call(o,c,function(f,h){var g;switch(h.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(i);case"<":g=a[h.slice(1,-1)];break;default:var y=+h;if(y===0)return f;if(y>l){var w=YDe(y/10);return w===0?f:w<=l?r[w-1]===void 0?h.charAt(1):r[w-1]+h.charAt(1):f}g=r[y-1]}return g===void 0?"":g})},ZDe=ud,qDe=ls,GDe=xE,JDe=_E,KDe=function(e,t){var n=e.exec;if(qDe(n)){var r=n.call(e,t);return r!==null&&ZDe(r),r}if(GDe(e)==="RegExp")return JDe.call(e,t);throw TypeError("RegExp#exec called on incompatible receiver")},QDe=PDe,XDe=Zs,eTe=ud,tTe=ls,nTe=w1,rTe=K5,up=b1,aTe=g1,oTe=HDe,iTe=R5,sTe=$De,lTe=KDe,uTe=hy,g2=uTe("replace"),cTe=Math.max,dTe=Math.min,fTe=function(e){return e===void 0?e:String(e)},hTe=function(){return"a".replace(/./,"$0")==="$0"}(),O4=function(){return/./[g2]?/./[g2]("a","$0")==="":!1}(),pTe=!XDe(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"});QDe("replace",function(e,t,n){var r=O4?"$":"$0";return[function(o,i){var l=aTe(this),c=o==null?void 0:iTe(o,g2);return c?c.call(o,l,i):t.call(up(l),o,i)},function(a,o){var i=eTe(this),l=up(a);if(typeof o=="string"&&o.indexOf(r)===-1&&o.indexOf("$<")===-1){var c=n(t,i,l,o);if(c.done)return c.value}var f=tTe(o);f||(o=up(o));var h=i.global;if(h){var g=i.unicode;i.lastIndex=0}for(var y=[];;){var w=lTe(i,l);if(w===null||(y.push(w),!h))break;var S=up(w[0]);S===""&&(i.lastIndex=oTe(l,rTe(i.lastIndex),g))}for(var D="",I=0,M=0;M=I&&(D+=l.slice(I,B)+V,I=B+N.length)}return D+l.slice(I)}]},!pTe||!hTe||O4);var mTe=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",gTe=TypeError,vTe=function(e,t){if(en,i=wTe(r)?r:ITe(r),l=o?DTe(arguments,n):[],c=o?function(){yTe(i,this,l)}:i;return t?e(c,a):e(c)}:e},CTe=Gn,dO=Za,xTe=cO,P4=xTe(dO.setInterval,!0);CTe({global:!0,bind:!0,forced:dO.setInterval!==P4},{setInterval:P4});var MTe=Gn,fO=Za,kTe=cO,j4=kTe(fO.setTimeout,!0);MTe({global:!0,bind:!0,forced:fO.setTimeout!==j4},{setTimeout:j4});var NTe=qa,ATe=NTe.setInterval,FTe=ATe;const OTe=qt(FTe);var PTe=da,hO=function(e,t){var n=[][e];return!!n&&PTe(function(){n.call(null,t||function(){return 1},1)})},jTe=Gn,LTe=zI,RTe=E8.indexOf,_Te=hO,v2=LTe([].indexOf),pO=!!v2&&1/v2([1],1,-0)<0,BTe=pO||!_Te("indexOf");jTe({target:"Array",proto:!0,forced:BTe},{indexOf:function(t){var n=arguments.length>1?arguments[1]:void 0;return pO?v2(this,t,n)||0:RTe(this,t,n)}});var HTe=Lf,UTe=HTe("Array","indexOf"),YTe=ec,zTe=UTe,WD=Array.prototype,VTe=function(e){var t=e.indexOf;return e===WD||YTe(WD,e)&&t===WD.indexOf?zTe:t},WTe=VTe,$Te=WTe,ZTe=$Te;const qTe=qt(ZTe);var L4=Qb,GTe=TypeError,JTe=function(e,t){if(!delete e[t])throw new GTe("Cannot delete property "+L4(t)+" of "+L4(e))},KTe=Gn,QTe=tc,XTe=oE,e2e=e1,t2e=jf,n2e=w5,r2e=eE,a2e=aE,o2e=oy,$D=JTe,i2e=t1,s2e=i2e("splice"),l2e=Math.max,u2e=Math.min;KTe({target:"Array",proto:!0,forced:!s2e},{splice:function(t,n){var r=QTe(this),a=t2e(r),o=XTe(t,a),i=arguments.length,l,c,f,h,g,y;for(i===0?l=c=0:i===1?(l=0,c=a-o):(l=i-2,c=u2e(l2e(e2e(n),0),a-o)),r2e(a+l-c),f=a2e(r,c),h=0;ha-c+l;h--)$D(r,h-1)}else if(l>c)for(h=a-c;h>o;h--)g=h+c-1,y=h+l-1,g in r?r[y]=r[g]:$D(r,y);for(h=0;h1?arguments[1]:void 0)},B2e=Gn,R4=_2e;B2e({target:"Array",proto:!0,forced:[].forEach!==R4},{forEach:R4});var H2e=Lf,U2e=H2e("Array","forEach"),Y2e=U2e,z2e=Y2e,V2e=iy,W2e=Fi,$2e=ec,Z2e=z2e,GD=Array.prototype,q2e={DOMTokenList:!0,NodeList:!0},G2e=function(e){var t=e.forEach;return e===GD||$2e(GD,e)&&t===GD.forEach||W2e(q2e,V2e(e))?Z2e:t},J2e=G2e;const ob=qt(J2e);var K2e=Gn,Q2e=tc,gO=sE,X2e=da,eIe=X2e(function(){gO(1)});K2e({target:"Object",stat:!0,forced:eIe},{keys:function(t){return gO(Q2e(t))}});var tIe=qa,nIe=tIe.Object.keys,rIe=nIe,aIe=rIe,oIe=aIe;const iIe=qt(oIe);var sIe=qa,lIe=sIe.Object.getOwnPropertySymbols,uIe=lIe,cIe=uIe,dIe=cIe;const _4=qt(dIe);var fIe=Gn,hIe=cE.filter,pIe=t1,mIe=pIe("filter");fIe({target:"Array",proto:!0,forced:!mIe},{filter:function(t){return hIe(this,t,arguments.length>1?arguments[1]:void 0)}});var gIe=Lf,vIe=gIe("Array","filter"),yIe=ec,wIe=vIe,JD=Array.prototype,bIe=function(e){var t=e.filter;return e===JD||yIe(JD,e)&&t===JD.filter?wIe:t},SIe=bIe,DIe=SIe,TIe=DIe;const IIe=qt(TIe);var vO={exports:{}},EIe=Gn,CIe=da,xIe=au,yO=ty.f,wO=ii,MIe=!wO||CIe(function(){yO(1)});EIe({target:"Object",stat:!0,forced:MIe,sham:!wO},{getOwnPropertyDescriptor:function(t,n){return yO(xIe(t),n)}});var kIe=qa,bO=kIe.Object,NIe=vO.exports=function(t,n){return bO.getOwnPropertyDescriptor(t,n)};bO.getOwnPropertyDescriptor.sham&&(NIe.sham=!0);var AIe=vO.exports,FIe=AIe,OIe=FIe,PIe=OIe;const SO=qt(PIe);var jIe=ou,LIe=fa,RIe=o1,_Ie=s1,BIe=ld,HIe=LIe([].concat),UIe=jIe("Reflect","ownKeys")||function(t){var n=RIe.f(BIe(t)),r=_Ie.f;return r?HIe(n,r(t)):n},YIe=Gn,zIe=ii,VIe=UIe,WIe=au,$Ie=ty,ZIe=oy;YIe({target:"Object",stat:!0,sham:!zIe},{getOwnPropertyDescriptors:function(t){for(var n=WIe(t),r=$Ie.f,a=VIe(n),o={},i=0,l,c;a.length>i;)c=r(n,l=a[i++]),c!==void 0&&ZIe(o,l,c);return o}});var qIe=qa,GIe=qIe.Object.getOwnPropertyDescriptors,JIe=GIe,KIe=JIe,QIe=KIe;const B4=qt(QIe);var DO={exports:{}},XIe=Gn,eEe=ii,H4=n1.f;XIe({target:"Object",stat:!0,forced:Object.defineProperties!==H4,sham:!eEe},{defineProperties:H4});var tEe=qa,TO=tEe.Object,nEe=DO.exports=function(t,n){return TO.defineProperties(t,n)};TO.defineProperties.sham&&(nEe.sham=!0);var rEe=DO.exports,aEe=rEe,oEe=aEe,iEe=oEe;const sEe=qt(iEe);var lEe=M5;const uEe=qt(lEe);function cEe(e){if(e.sheet)return e.sheet;for(var t=0;t0?Va(sm,--oi):0,Fp--,ea===10&&(Fp=1,D1--),ea}function ki(){return ea=oi2||Sv(ea)>3?"":" "}function TEe(e,t){for(;--t&&ki()&&!(ea<48||ea>102||ea>57&&ea<65||ea>70&&ea<97););return vy(e,bw()+(t<6&&Kl()==32&&ki()==32))}function w2(e){for(;ki();)switch(ea){case e:return oi;case 34:case 39:e!==34&&e!==39&&w2(ea);break;case 40:e===41&&w2(e);break;case 92:ki();break}return oi}function IEe(e,t){for(;ki()&&e+ea!==57;)if(e+ea===84&&Kl()===47)break;return"/*"+vy(t,oi-1)+"*"+S1(e===47?e:ki())}function EEe(e){for(;!Sv(Kl());)ki();return vy(e,oi)}function CEe(e){return kO(Dw("",null,null,null,[""],e=MO(e),0,[0],e))}function Dw(e,t,n,r,a,o,i,l,c){for(var f=0,h=0,g=i,y=0,w=0,S=0,D=1,I=1,M=1,N=0,B="",k=a,R=o,L=r,_=B;I;)switch(S=N,N=ki()){case 40:if(S!=108&&Va(_,g-1)==58){y2(_+=_n(Sw(N),"&","&\f"),"&\f")!=-1&&(M=-1);break}case 34:case 39:case 91:_+=Sw(N);break;case 9:case 10:case 13:case 32:_+=DEe(S);break;case 92:_+=TEe(bw()-1,7);continue;case 47:switch(Kl()){case 42:case 47:Z0(xEe(IEe(ki(),bw()),t,n),c);break;default:_+="/"}break;case 123*D:l[f++]=Yl(_)*M;case 125*D:case 59:case 0:switch(N){case 0:case 125:I=0;case 59+h:M==-1&&(_=_n(_,/\f/g,"")),w>0&&Yl(_)-g&&Z0(w>32?Y4(_+";",r,n,g-1):Y4(_n(_," ","")+";",r,n,g-2),c);break;case 59:_+=";";default:if(Z0(L=U4(_,t,n,f,h,a,l,B,k=[],R=[],g),o),N===123)if(h===0)Dw(_,t,L,L,k,o,g,l,R);else switch(y===99&&Va(_,3)===110?100:y){case 100:case 108:case 109:case 115:Dw(e,L,L,r&&Z0(U4(e,L,L,0,0,a,l,B,a,k=[],g),R),a,R,g,l,r?k:R);break;default:Dw(_,L,L,L,[""],R,0,l,R)}}f=h=w=0,D=M=1,B=_="",g=i;break;case 58:g=1+Yl(_),w=S;default:if(D<1){if(N==123)--D;else if(N==125&&D++==0&&SEe()==125)continue}switch(_+=S1(N),N*D){case 38:M=h>0?1:(_+="\f",-1);break;case 44:l[f++]=(Yl(_)-1)*M,M=1;break;case 64:Kl()===45&&(_+=Sw(ki())),y=Kl(),h=g=Yl(B=_+=EEe(bw())),N++;break;case 45:S===45&&Yl(_)==2&&(D=0)}}return o}function U4(e,t,n,r,a,o,i,l,c,f,h){for(var g=a-1,y=a===0?o:[""],w=UE(y),S=0,D=0,I=0;S0?y[M]+" "+N:_n(N,/&\f/g,y[M])))&&(c[I++]=B);return T1(e,t,n,a===0?BE:l,c,f,h)}function xEe(e,t,n){return T1(e,t,n,IO,S1(bEe()),bv(e,2,-2),0)}function Y4(e,t,n,r){return T1(e,t,n,HE,bv(e,0,r),bv(e,r+1,-1),r)}function wp(e,t){for(var n="",r=UE(e),a=0;a6)switch(Va(e,t+1)){case 109:if(Va(e,t+4)!==45)break;case 102:return _n(e,/(.+:)(.+)-([^]+)/,"$1"+Rn+"$2-$3$1"+ib+(Va(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~y2(e,"stretch")?NO(_n(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Va(e,t+1)!==115)break;case 6444:switch(Va(e,Yl(e)-3-(~y2(e,"!important")&&10))){case 107:return _n(e,":",":"+Rn)+e;case 101:return _n(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Rn+(Va(e,14)===45?"inline-":"")+"box$3$1"+Rn+"$2$3$1"+io+"$2box$3")+e}break;case 5936:switch(Va(e,t+11)){case 114:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Rn+e+io+_n(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Rn+e+io+e+e}return e}var REe=function(t,n,r,a){if(t.length>-1&&!t.return)switch(t.type){case HE:t.return=NO(t.value,t.length);break;case EO:return wp([kg(t,{value:_n(t.value,"@","@"+Rn)})],a);case BE:if(t.length)return wEe(t.props,function(o){switch(yEe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wp([kg(t,{props:[_n(o,/:(read-\w+)/,":"+ib+"$1")]})],a);case"::placeholder":return wp([kg(t,{props:[_n(o,/:(plac\w+)/,":"+Rn+"input-$1")]}),kg(t,{props:[_n(o,/:(plac\w+)/,":"+ib+"$1")]}),kg(t,{props:[_n(o,/:(plac\w+)/,io+"input-$1")]})],a)}return""})}},_Ee=[REe],BEe=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(D){var I=D.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(D),D.setAttribute("data-s",""))})}var a=t.stylisPlugins||_Ee,o={},i,l=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(D){for(var I=D.getAttribute("data-emotion").split(" "),M=1;M=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var UEe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YEe=/[A-Z]|^ms/g,zEe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,AO=function(t){return t.charCodeAt(1)===45},V4=function(t){return t!=null&&typeof t!="boolean"},KD=AEe(function(e){return AO(e)?e:e.replace(YEe,"-$&").toLowerCase()}),W4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(zEe,function(r,a,o){return zl={name:a,styles:o,next:zl},a})}return UEe[t]!==1&&!AO(t)&&typeof n=="number"&&n!==0?n+"px":n};function Dv(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":if(n.anim===1)return zl={name:n.name,styles:n.styles,next:zl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)zl={name:r.name,styles:r.styles,next:zl},r=r.next;var a=n.styles+";";return a}return VEe(e,t,n);case"function":if(e!==void 0){var o=zl,i=n(e);return zl=o,Dv(e,t,i)}break}if(t==null)return n;var l=t[n];return l!==void 0?l:n}function VEe(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:"white",n="background-color: ".concat(e,"; border-radius: 4px; padding: 2px 4px;");return t&&(n+=" color: ".concat(t,";")),[n,""]}function X4(e,t){for(var n,r,a=arguments.length,o=new Array(a>2?a-2:0),i=2;i1&&arguments[1]!==void 0?arguments[1]:{},n=t.force,r=n===void 0?!1:n;return r?function(){for(var a=arguments.length,o=new Array(a),i=0;it?(e.apply(void 0,o),n=l):(clearTimeout(r),r=xCe(function(){e.apply(void 0,o),n=Xc()},Math.max(0,t-l+n)))}}var RO=function(t){var n=t.debounce,r=t.name,a=t.onEvent,o=t.target,i=P.useRef();i.current=a;var l=P.useMemo(function(){return MCe(function(f){var h=i.current;h&&h(f)},n)},[n,i]),c=P.useCallback(function(f){f.timeStampLow=Xc(),l(f)},[l]);return P.useLayoutEffect(function(){return o.addEventListener(r,c,{passive:!0}),c({target:o,type:r}),function(){return o.removeEventListener(r,c)}},[r,c,o]),!1};RO.defaultProps={debounce:200};var kCe=Math.sign||function(t){var n=+t;return n===0||n!==n?n:n<0?-1:1},NCe=Gn,ACe=kCe;NCe({target:"Math",stat:!0},{sign:ACe});var FCe=qa,OCe=FCe.Math.sign,PCe=OCe,jCe=PCe,LCe=jCe;const RCe=qt(LCe);function _Ce(e,t){var n=RCe(t-e),r=Math.sqrt(Math.abs(t-e)),a=e+r*n;return n>0?Math.min(t,a):Math.max(t,a)}function BCe(e,t,n,r){for(var a=e,o=0;o4&&arguments[4]!==void 0?arguments[4]:Xc();(g==="100%"||typeof g=="number")&&(cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){if(a){var S=g==="100%"?a.scrollHeight-a.offsetHeight:g,D=BCe(h,S,_Ce,(Xc()-w)/5);Math.abs(S-D)<1.5&&(D=S),a[f]=D,S===D?r&&r(!0):l(f,h,g,y+1,w)}}))},[i,r,a]),c=P.useCallback(function(){cancelAnimationFrame(i.current),r&&r(!1)},[r]);return P.useLayoutEffect(function(){return l(n,a[n],o,1),a?(a.addEventListener("pointerdown",c,{passive:!0}),a.addEventListener("wheel",c,{passive:!0}),function(){a.removeEventListener("pointerdown",c),a.removeEventListener("wheel",c),cancelAnimationFrame(i.current)}):function(){return cancelAnimationFrame(i.current)}},[l,i,c,n,a,o]),!1};_O.propTypes={name:kn.string.isRequired,onEnd:kn.func,target:kn.any.isRequired,value:kn.oneOfType([kn.number,kn.oneOf(["100%"])]).isRequired};function XD(e){var t=P.useState(e),n=Ul(t,2),r=n[0],a=n[1],o=P.useRef(),i=P.useCallback(function(l){typeof l=="function"?i(function(c){return l=l(c),o.current=l,l}):(o.current=l,i(l))},[o]);return o.current=r,[r,a,o]}function eN(e,t){var n=iIe(e);if(_4){var r=_4(e);t&&(r=IIe(r).call(r,function(a){return SO(e,a).enumerable})),n.push.apply(n,r)}return n}function tN(e){for(var t=1;t",{force:o})},[o]);l=l===Ls?Ls:UCe;var g=P.useRef(0),y=P.useRef(i),w=XD(l===Ls?0:"100%"),S=Ul(w,3),D=S[0],I=S[1],M=S[2],N=XD(null),B=Ul(N,3),k=B[0],R=B[1],L=B[2],_=P.useRef(0),V=P.useRef(0),U=P.useRef(0),Z=P.useState(!0),Q=Ul(Z,2),G=Q[0],re=Q[1],de=P.useState(!0),fe=Ul(de,2),$=fe[0],he=fe[1],se=P.useState(!0),ue=Ul(se,2),X=ue[0],oe=ue[1],De=P.useState(!1),je=Ul(De,2),Re=je[0],Fe=je[1],Be=XD(!0),Xe=Ul(Be,3),Ze=Xe[0],st=Xe[1],Ct=Xe[2],tn=P.useRef([]),_e=P.useCallback(function(pt){var Mt=L.current;return tn.current.push(pt),Mt&&pt({scrollTop:Mt.scrollTop}),function(){var Jt=tn.current,sn=qTe(Jt).call(Jt,pt);~sn&&y2e(Jt).call(Jt,sn,1)}},[tn,L]),et=P.useCallback(function(){var pt=M.current;h(function(){var Mt;return Dr(Mt=["%cSpineTo%c: %conEnd%c is fired."]).call(Mt,Cn(Vn("magenta")),Cn(Vn("orange")),[{animateTo:pt}])}),g.current=Xc(),Ng(pt,l)||st(!1),I(null)},[M,h,g,l,I,st]),nt=P.useCallback(function(pt){var Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Jt=Mt.behavior,sn=L.current;if(typeof pt!="number"&&pt!=="100%")return console.warn('react-scroll-to-bottom: Arguments passed to scrollTo() must be either number or "100%".');h(function(){var ln;return[Dr(ln=["%cscrollTo%c: Will scroll to %c".concat(typeof pt=="number"?pt+"px":pt.replace(/%/g,"%%"),"%c")]).call(ln,Cn(Vn("lime","")),Cn(Vn("purple"))),{behavior:Jt,nextAnimateTo:pt,target:sn}]}),Jt==="auto"?(et(),sn&&(sn.scrollTop=pt==="100%"?sn.scrollHeight-sn.offsetHeight:pt)):(Jt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollTo". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),I(pt)),Ng(pt,l)&&(h(function(){var ln;return[Dr(ln=["%cscrollTo%c: Scrolling to end, will set sticky to %ctrue%c."]).call(ln,Cn(Vn("lime","")),Cn(Vn("purple"))),[{mode:l,nextAnimateTo:pt}]]}),st(!0))},[h,et,l,I,st,L]),ht=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var Jt;return Dr(Jt=["%cscrollToBottom%c: Called"]).call(Jt,Cn(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToBottom". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),nt("100%",{behavior:Mt||"smooth"})},[h,nt]),St=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var Jt;return Dr(Jt=["%cscrollToTop%c: Called"]).call(Jt,Cn(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToTop". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.'),nt(0,{behavior:Mt||"smooth"})},[h,nt]),Tt=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var sn;return Dr(sn=["%cscrollToEnd%c: Called"]).call(sn,Cn(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToEnd". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.');var Jt={behavior:Mt||"smooth"};l===Ls?St(Jt):ht(Jt)},[h,l,ht,St]),Gt=P.useCallback(function(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Mt=pt.behavior;h(function(){var sn;return Dr(sn=["%cscrollToStart%c: Called"]).call(sn,Cn(Vn("yellow","")))}),Mt!=="smooth"&&console.warn('react-scroll-to-bottom: Please set "behavior" when calling "scrollToStart". In future versions, the default behavior will be changed from smooth scrolling to discrete scrolling to align with HTML Standard.');var Jt={behavior:Mt||"smooth"};l===Ls?ht(Jt):St(Jt)},[h,l,ht,St]),_t=P.useCallback(function(){var pt=L.current;if(pt){if(y.current==="auto"){h(function(){var Lr;return Dr(Lr=["%ctarget changed%c: Initial scroll"]).call(Lr,Cn(Vn("blue")))}),pt.scrollTop=l===Ls?0:pt.scrollHeight-pt.offsetHeight,y.current=!1;return}var Mt=_.current,Jt=pt.offsetHeight,sn=pt.scrollHeight,ln=pt.scrollTop,vr=l===Ls?0:Math.max(0,sn-Jt-ln),fr=Math.max(0,Mt-ln),ha=f({maxValue:vr,minValue:fr,offsetHeight:Jt,scrollHeight:sn,scrollTop:ln}),jr=Math.max(0,Math.min(vr,ha)),nr;l===Ls||jr!==vr?nr=ln+jr:nr="100%",h(function(){var Lr,te,me;return[Dr(Lr=[Dr(te=Dr(me="%cscrollToSticky%c: Will animate from %c".concat(Mt,"px%c to %c")).call(me,typeof nr=="number"?nr+"px":nr.replace(/%/g,"%%"),"%c (%c")).call(te,(nr==="100%"?vr:nr)+Mt,"px%c)")]).call(Lr,Cn(Vn("orange")),Cn(Vn("purple")),Cn(Vn("purple")),Cn(Vn("purple"))),{animateFrom:Mt,maxValue:vr,minValue:fr,nextAnimateTo:nr,nextValue:jr,offsetHeight:Jt,rawNextValue:ha,scrollHeight:sn,scrollTop:ln}]}),nt(nr,{behavior:"smooth"})}},[_,h,l,f,nt,L]),Vt=P.useCallback(function(pt){var Mt,Jt=pt.timeStampLow,sn=M.current,ln=L.current,vr=sn!==null;if(!(Jt<=g.current||!ln)){var fr=oN({mode:l,target:ln}),ha=fr.atBottom,jr=fr.atEnd,nr=fr.atStart,Lr=fr.atTop;re(ha),he(jr),Fe(nr),oe(Lr);var te=ln.offsetHeight,me=ln.scrollHeight,xe=V.current,Ue=U.current,He=te!==xe,Qe=me!==Ue;if(He&&(V.current=te),Qe&&(U.current=me),!He&&!Qe){var tt=vr&&Ng(sn,l)||jr;Ct.current!==tt&&(h(function(){var Ut,On,yn,Cr;return[Dr(Ut=["%conScroll%c: %csetSticky%c(%c".concat(tt,"%c)")]).call(Ut,Cn(Vn("red")),Cn(Vn("red")),Cn(Vn("purple"))),Dr(On=[Dr(yn=Dr(Cr="(animating = %c".concat(vr,"%c && isEnd = %c")).call(Cr,Ng(sn,l),"%c) || atEnd = %c")).call(yn,jr,"%c")]).call(On,Cn(Vn("purple")),Cn(Vn("purple")),Cn(Vn("purple")),[{animating:vr,animateTo:sn,atEnd:jr,mode:l,offsetHeight:ln.offsetHeight,scrollHeight:ln.scrollHeight,sticky:Ct.current,nextSticky:tt}])]}),st(tt))}else Ct.current&&(h(function(){var Ut;return[Dr(Ut=["%conScroll%c: Size changed while sticky, calling %cscrollToSticky()%c"]).call(Ut,Cn(Vn("red")),Cn(Vn("orange")),[{offsetHeightChanged:He,scrollHeightChanged:Qe}]),{nextOffsetHeight:te,prevOffsetHeight:xe,nextScrollHeight:me,prevScrollHeight:Ue}]}),_t());var kt=ln.scrollTop;ob(Mt=tn.current).call(Mt,function(Ut){return Ut({scrollTop:kt})})}},[M,h,g,l,V,U,tn,_t,re,he,Fe,oe,st,Ct,L]);P.useEffect(function(){if(k){var pt=!1,Mt=zCe(function(){var Jt=L.current,sn=M.current!==null;Ct.current?oN({mode:l,target:Jt}).atEnd?pt=!1:pt?Xc()-pt>YCe&&(sn||(_.current=Jt.scrollTop,h(function(){var ln;return Dr(ln=["%cInterval check%c: Should sticky but not at end, calling %cscrollToSticky()%c to scroll"]).call(ln,Cn(Vn("navy")),Cn(Vn("orange")))}),_t()),pt=!1):pt=Xc():Jt.scrollHeight<=Jt.offsetHeight&&!Ct.current&&(h(function(){var ln;return[Dr(ln=["%cInterval check%c: Container is emptied, setting sticky back to %ctrue%c"]).call(ln,Cn(Vn("navy")),Cn(Vn("purple"))),[{offsetHeight:Jt.offsetHeight,scrollHeight:Jt.scrollHeight,sticky:Ct.current}]]}),st(!0))},Math.max(nN,n)||nN);return function(){return clearInterval(Mt)}}},[M,n,h,l,_t,st,Ct,k,L]);var Xt=P.useMemo(function(){var pt=aN[c]||(aN[c]=qEe({key:"react-scroll-to-bottom--css-"+mCe(),nonce:c}));return function(Mt){return pt.css(Mt)+""}},[c]),dn=P.useMemo(function(){return{observeScrollPosition:_e,setTarget:R,styleToClassName:Xt}},[_e,R,Xt]),en=P.useMemo(function(){return{atBottom:G,atEnd:$,atStart:Re,atTop:X,mode:l}},[G,$,Re,X,l]),Zn=P.useMemo(function(){var pt=D!==null;return{animating:pt,animatingToEnd:pt&&Ng(D,l),sticky:Ze}},[D,l,Ze]),Dn=P.useMemo(function(){return tN(tN({},en),Zn)},[en,Zn]),Er=P.useMemo(function(){return{scrollTo:nt,scrollToBottom:ht,scrollToEnd:Tt,scrollToStart:Gt,scrollToTop:St}},[nt,ht,Tt,Gt,St]);return P.useEffect(function(){if(k){var pt=function(){U.current=k.scrollHeight};return k.addEventListener("focus",pt,{capture:!0,passive:!0}),function(){return k.removeEventListener("focus",pt)}}},[k]),h(function(){var pt;return[Dr(pt=["%cRender%c: Render"]).call(pt,Cn(Vn("cyan",""))),{animateTo:D,animating:D!==null,sticky:Ze,target:k}]}),ne.createElement(m1.Provider,{value:dn},ne.createElement(bE.Provider,{value:Er},ne.createElement(TE.Provider,{value:Dn},ne.createElement(SE.Provider,{value:en},ne.createElement(DE.Provider,{value:Zn},r,k&&ne.createElement(RO,{debounce:a,name:"scroll",onEvent:Vt,target:k}),k&&D!==null&&ne.createElement(_O,{name:"scrollTop",onEnd:et,target:k,value:D}))))))};VE.defaultProps={checkInterval:100,children:void 0,debounce:17,debug:void 0,initialScrollBehavior:"smooth",mode:void 0,nonce:void 0,scroller:HCe};VE.propTypes={checkInterval:kn.number,children:kn.any,debounce:kn.number,debug:kn.bool,initialScrollBehavior:kn.oneOf(["auto","smooth"]),mode:kn.oneOf(["bottom","top"]),nonce:kn.string,scroller:kn.func};var VCe={height:"100%",overflowY:"auto",width:"100%"},WE=function(t){var n=t.children,r=t.className,a=P.useContext(m1),o=a.setTarget,i=IE()(VCe);return ne.createElement("div",{className:wE(i,(r||"")+""),ref:o},n)};WE.defaultProps={children:void 0,className:void 0};WE.propTypes={children:kn.any,className:kn.string};var WCe={position:"relative"},$E=function(t){var n=t.children,r=t.className,a=t.followButtonClassName,o=t.scrollViewClassName,i=IE()(WCe);return ne.createElement("div",{className:wE(i,(r||"")+"")},ne.createElement(WE,{className:(o||"")+""},n),ne.createElement(EE,{className:(a||"")+""}))};$E.defaultProps={children:void 0,className:void 0,followButtonClassName:void 0,scrollViewClassName:void 0};$E.propTypes={children:kn.any,className:kn.string,followButtonClassName:kn.string,scrollViewClassName:kn.string};var ZE=function(t){var n=t.checkInterval,r=t.children,a=t.className,o=t.debounce,i=t.debug,l=t.followButtonClassName,c=t.initialScrollBehavior,f=t.mode,h=t.nonce,g=t.scroller,y=t.scrollViewClassName;return ne.createElement(VE,{checkInterval:n,debounce:o,debug:i,initialScrollBehavior:c,mode:f,nonce:h,scroller:g},ne.createElement($E,{className:a,followButtonClassName:l,scrollViewClassName:y},r))};ZE.defaultProps={checkInterval:void 0,children:void 0,className:void 0,debounce:void 0,debug:void 0,followButtonClassName:void 0,initialScrollBehavior:"smooth",mode:void 0,nonce:void 0,scroller:void 0,scrollViewClassName:void 0};ZE.propTypes={checkInterval:kn.number,children:kn.any,className:kn.string,debounce:kn.number,debug:kn.bool,followButtonClassName:kn.string,initialScrollBehavior:kn.oneOf(["auto","smooth"]),mode:kn.oneOf(["bottom","top"]),nonce:kn.string,scroller:kn.func,scrollViewClassName:kn.string};function $Ce(){var e=p1(),t=e.scrollToBottom;return t}function ZCe(){var e=p1(),t=e.scrollToStart;return t}function qCe(){var e=p1(),t=e.scrollToTop;return t}bce();const GCe=e=>{const{locationState:{query:t},globalState:{memoListView:n,manifest:r},dailyNotesState:{app:a,settings:o}}=P.useContext(Lt),{thinos:i}=e,[l,c]=ne.useState(Tv(i,"day")),f=ne.useRef(null),h=$Ce(),g=P.useRef([]);P.useRef(0),P.useEffect(()=>{const S=Tv(i,"day");Cw.isEqual(S,l)||c(S)},[i]),P.useEffect(()=>{var N,B;if(Cw.isEqual(g.current,i))return;const S=i.filter(k=>k.pinned),D=i.filter(k=>!k.pinned),I=g.current.filter(k=>k.pinned)[0],M=g.current.filter(k=>!k.pinned)[0];(I&&I.id!==((N=S[0])==null?void 0:N.id)||M&&M.id!==((B=D[0])==null?void 0:B.id))&&h()},[i]),P.useEffect(()=>{f.current&&h()},[t]);const y=P.useCallback(()=>{a.setting.open(),a.setting.openTabById(r.id||"obsidian-memos")},[a]),w=P.useMemo(()=>v.jsx(v.Fragment,{children:Object.keys(l).map((S,D)=>v.jsx(v.Fragment,{children:v.jsx(JCe,{thinos:l[S],dayMark:S,handleOpenSettings:y},S+D)}))}),[l]);return v.jsx("div",{ref:f,className:ar("chat-view",`${o==null?void 0:o.chatViewStyle}-style`),children:w})},JCe=({thinos:e,dayMark:t,handleOpenSettings:n})=>{const{dailyNotesState:{settings:r,app:a}}=P.useContext(Lt),[o,i]=ne.useState(!0),l=ne.useRef(null),[c,f]=ne.useState(r==null?void 0:r.MomentsIcon);P.useEffect(()=>{if(!(r!=null&&r.MomentsIcon)||!a)return;const w=a.vault.adapter.getResourcePath(x.normalizePath(r.MomentsIcon));w&&!(r!=null&&r.MomentsIcon.startsWith("http"))?f(w):f(r==null?void 0:r.MomentsIcon)},[r==null?void 0:r.MomentsIcon]);const h=w=>{if(x.Keymap.isModifier(w.nativeEvent,"Mod")){const S=x.moment(t,"YYYY-MM-DD");at.setFromAndToQuery(S.startOf("day").valueOf(),S.endOf("day").valueOf());return}i(!o),l.current.scrollIntoView(!0)},g=w=>{Df(w)},y=P.useMemo(()=>e.map((w,S)=>v.jsxs("div",{className:"thino-bubble right",children:[v.jsx(KCe,{icon:c,handleOpenSettings:n}),v.jsx("div",{className:"wrap",children:v.jsx(QCe,{thino:w,handleClickTimeStamp:g},`${w.id}-${x.moment(w.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${S}`)})]},w.id+S)),[e,c]);return v.jsxs(v.Fragment,{children:[o&&y,v.jsx("div",{className:`thino-chat-day-mark day-mark ${o?"":"folded"}`,onClick:h,children:v.jsx("div",{className:"day-mark-bubble",children:(t==="PINNED"?t+" 📌":t)+(o?"":"...")})})]})},KCe=({icon:e,handleOpenSettings:t})=>v.jsx("div",{ref:n=>{if(e){n==null||n.empty();return}e||n&&x.setIcon(n,"Memos")},className:"icon-img",style:{backgroundImage:`url("${e}")`}}),QCe=({thino:e,handleClickTimeStamp:t})=>{const n=P.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const o=await we.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");o&&we.editMemo(o)},[e]),r=P.useMemo(()=>v.jsxs("div",{className:"content",children:[v.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),v.jsx(ai,{memo:e})]}),[e.content]),a=P.useMemo(()=>{var o;return v.jsxs("div",{className:"content task",children:[v.jsx("div",{className:"task-inputer",children:v.jsx("input",{className:ar("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":(o=e.thinoType)==null?void 0:o.slice(5),onClick:n})}),v.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),v.jsx(ai,{memo:e})]})},[e.content,e.thinoType]);return e.thinoType==="JOURNAL"?r:a},XCe=3e3;function exe({statusRef:e,isComplete:t,handleFetchMoreClick:n,cachedMemos:r}){P.useEffect(()=>{const a=e.current;if(!a)return;const o=vb.throttle(async()=>{await n()},XCe,{trailing:!1}),i=new IntersectionObserver(([l])=>{l.isIntersecting&&!t&&o()});return i.observe(a),()=>{i.unobserve(a),o.cancel()}},[t,e,n]),P.useEffect(()=>{r.length<40&&!t&&n()},[r.length,t,n])}function Tv(e,t){const n={},r={day:"YYYY-MM-DD ddd",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"};return e.forEach(a=>{const o=a.pinned?"PINNED":x.moment(a.createdAt,"YYYY/MM/DD HH:mm:ss").format(r[t]);n[o]||(n[o]=[]),n[o].push(a)}),n}function BO(e){return e.slice().sort((t,n)=>t.pinned!==n.pinned?t.pinned?-1:1:new Date(n.createdAt).getTime()-new Date(t.createdAt).getTime())}function txe(e,t){if(e.length===0)return t;const n=new Map(t.map(i=>[i.id,i])),r=[],a=e==null?void 0:e.reduce((i,l)=>{if(n.has(l.id)){const c=n.get(l.id);Cw.isEqual(l,c)?i.push(l):i.push({...c}),n.delete(l.id)}return i},[]);n.forEach(i=>r.push(i));const o=a.concat(r);return BO(o)}function Ag(e){const{tag:t,duration:n,type:r,text:a,filter:o,path:i,metadata:l}=e,c=on.getQueryById(o),f=!l||Object.keys(l).length===0;return!(!!(t||n&&n.from((e.match(r)||[]).forEach(a=>{const i=(a==null?void 0:a.replace(r,"$1").trim()).split("/");let l="";i.forEach(c=>{l+=c,n.add(l),l+="/"})}),n),new Set)}function rxe(e){if(!Array.isArray(e)||e.length===0)return new Set;const t=e.filter(r=>!!r).map(r=>r.toString().trim());if(t.length===0)return new Set;const n=new Set;return t.forEach(r=>{const a=r.split("/");let o="";a.forEach((i,l)=>{o+=(l>0?"/":"")+i,n.add(o)})}),n}const axe=({tempMemos:e,query:t,HideDoneTasks:n})=>{const r=e.filter(I=>I.rowStatus!=="ARCHIVED"&&!I.deletedAt),{tag:a,duration:o,type:i,text:l,filter:c,path:f,metadata:h}=t,g=on.getQueryById(c),y=l.toLowerCase(),w=!h||Object.keys(h).length===0,S=!!(a||o&&o.from{var M,N;if(I.content.contains("comment:")||n&&I.thinoType==="TASK-DONE")return!1;if(g){const B=JSON.parse(g.querystring);if(Array.isArray(B)&&!Vp(I,B))return!1}if(!w&&Object.keys(h).some(k=>{var R;return((R=I.fileInfo)==null?void 0:R.frontmatter[k])!==h[k]})||f&&!I.path.toLowerCase().includes(f.toLowerCase())||a&&((M=I==null?void 0:I.fileInfo)!=null&&M.tags)&&!nxe(I.content).has(a)&&!rxe((N=I==null?void 0:I.fileInfo)==null?void 0:N.tags).has(a)||o&&o.from!==0&&o.to!==0&&(ut.getTimeStampByDate(I.createdAt)o.to))return!1;if(i)switch(i){case"NOT_TAGGED":if(I.content.match($r)||I.content.match(Wa)||I.content.match(ua))return!1;break;case"LINKED":if(!I.content.match(Af))return!1;break;case"IMAGED":if(!I.content.match(Ff))return!1;break;case"CONNECTED":if(!I.content.match(ad))return!1;break}return!(y&&!D(I.content.toLowerCase()))}):r},oxe=({updateThinos:e,listView:t})=>{const{locationState:{query:n},memoState:{memos:r},dailyNotesState:{app:a,settings:o}}=P.useContext(Lt),i=qCe(),l=ZCe(),[c,f]=P.useState(!1),[h,g]=P.useState(!1),[y,w,S]=xo([]),[D,I]=P.useState([]),[M,N]=P.useState({}),[B,k]=P.useState((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),[R,L]=P.useState((a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day"),[_,V,U]=xo([]),Z=P.useRef(null),Q=P.useRef(null),G=P.useRef(null),re=P.useRef(!1);P.useEffect(()=>{l(),w(_.slice(0,y.length>20?Math.min(y.length,20):20))},[t]),P.useEffect(()=>()=>{Q.current&&(Q.current=null),G.current&&(G.current=null)},[]),P.useLayoutEffect(()=>{if(r.length!==0&&re.current===!0)return;const se=ixe(a||window.app);!se||se.length===0||(V(se),I(se),k((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),a!=null&&a.loadLocalStorage("showDayMark")&&N(Tv(se,(a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day")))},[]),P.useEffect(()=>{if(r.length===0&&!we.initialized)return;f(!1);const se=BO(r),ue=axe({tempMemos:se,query:n,HideDoneTasks:(o==null?void 0:o.HideDoneTasks)||!1});return re.current=!0,e&&e(ue),V(ue),()=>{re.current=!1}},[r,n,o==null?void 0:o.HideDoneTasks]),P.useEffect(()=>{const ue=_.slice(0,y.length>20?Math.min(y.length,20):20);w(X=>txe(X,ue))},[_]),P.useEffect(()=>{var se;y.length<20&&((se=G.current)==null||se.click())},[_]),P.useEffect(()=>{(Ag(n)&&y.length<_.length||y.length<_.length&&!Ag(n))&&g(!1),(Ag(n)&&y.length===r.length&&r.length>0||!Ag(n)&&y.length===_.length&&_.length>0)&&g(!0),sxe(y||[],a),I(y),a==null||a.saveLocalStorage("showDayMark",o==null?void 0:o.showDayMark),a==null||a.saveLocalStorage("dayMarkRange",o==null?void 0:o.dayMarkRange),k((o==null?void 0:o.showDayMark)||!1),L((o==null?void 0:o.dayMarkRange)||"day"),o!=null&&o.showDayMark&&N(Tv(y,(o==null?void 0:o.dayMarkRange)||"day"))},[y,o==null?void 0:o.showDayMark,o==null?void 0:o.dayMarkRange]),P.useEffect(()=>{i()},[n]);const de=async()=>{try{if(U.current.length>S.current.length){f(!0);const se=Math.min(S.current.length+20,U.current.length)-S.current.length,ue=U.current.slice(S.current.length,S.current.length+se);w(X=>[...X,...ue]),f(!1),g(ue.length<20)}}catch(se){console.error(se),new x.Notice(se.response.data.message)}};exe({statusRef:Q,isComplete:h,handleFetchMoreClick:de,cachedMemos:y});const fe=P.useMemo(()=>v.jsx("div",{ref:Q,className:ar("status-text-container",t==="calendar"||t==="table"?"thino-hidden":""),children:v.jsx("p",{className:"status-text",children:c?E("Fetching data..."):h?_.length===0?E("Noooop!"):E("All Data is Loaded 🎉"):v.jsx(v.Fragment,{children:v.jsx("span",{ref:G,className:"cursor-pointer hover:text-green-600",onClick:de,children:E("fetch more")})})})}),[t,de,_,c,h,Q]),$=se=>{switch(se){case"list":return v.jsx(_w,{breakpointCols:1,className:`${t}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:B?v.jsx(v.Fragment,{children:Object.keys(M).sort((ue,X)=>X-ue).map(ue=>v.jsx(kT,{type:"list",thinos:M[ue],dayMark:ue,dayMarkRange:R},ue))}):D.map((ue,X)=>v.jsx(ai,{memo:ue},`${ue.id}-${X}`))});case"waterfall":return v.jsx(v.Fragment,{children:B&&Object.keys(M).length>0?Object.keys(M).map(ue=>v.jsx(kT,{type:"waterfall",thinos:M[ue],dayMark:ue,dayMarkRange:R},ue)):v.jsx(_w,{breakpointCols:3,className:`${t}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:D.map((ue,X)=>v.jsx(ai,{memo:ue},`${ue.id}-${X}`))})});case"chat":return v.jsx(GCe,{thinos:D});case"calendar":return v.jsx(Vle,{thinos:_});case"table":return v.jsx(gce,{thinos:_,isFiltering:!Ag(n)});case"moments":return v.jsx(uxe,{thinos:D})}},he=se=>{switch(se){case"top":return t==="chat"&&fe;case"bottom":return t!=="chat"&&fe}};return v.jsxs(ZE,{className:`memolist-wrapper ${h?"completed":""} `,mode:t==="chat"?"bottom":"top",initialScrollBehavior:"auto",checkInterval:30,followButtonClassName:ar("scroll-to-bottom-button",t==="chat"?"to-bottom":"to-top"),scrollViewClassName:"memolist-scrollview",children:[he("top"),v.jsx("div",{ref:Z,className:"memolist-container",children:$(t)}),he("bottom")]})};function HO(e){return`memosListCache:${e}`}function ixe(e){var t;try{const n=HO(e==null?void 0:e.appId),r=la.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)||[]:[]}catch(n){return console.error(n),[]}}function sxe(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=HO(t==null?void 0:t.appId);la.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const lxe=({userIcon:e})=>v.jsx("div",{className:"moments-view-user-icon",ref:t=>{if(e){t==null||t.empty();return}e||t&&x.setIcon(t,"Memos")},style:{backgroundImage:`url("${e}")`}}),b2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSIjMGUyYTQ3Ij48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODIiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4NiI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODMiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDg1Ij48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjE1MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMTUwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjIxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjI3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIzOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI0NTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjQ1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjQ1MCIgeT0iNDUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjUxMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI1NzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjYzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjYzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjY5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjkwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjY5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjY5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",Tw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSJyZ2JhKDIzMSwgMjM4LCAyNDUsIDEpIj48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODUiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4MyI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODYiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDgyIj48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjMwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjkwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMTUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIxNTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIxNTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjE1MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMjEwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjIxMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjI3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzOTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI0NTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNDUwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1MTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjUxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTcwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTcwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1NzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI1NzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2OTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",uxe=e=>{const{globalState:{memoListView:t,markMemoId:n,manifest:r,editMemoId:a},dailyNotesState:{app:o,settings:i}}=P.useContext(Lt),{thinos:l}=e,c=ne.useRef(null),f=ne.useRef(null),[h,g]=ne.useState(!1),[y,w]=P.useState({}),[S,D]=P.useState((o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day"),[I,M]=ne.useState(i==null?void 0:i.MomentsIcon);P.useEffect(()=>{if(!(i!=null&&i.MomentsIcon)||!o)return;const B=o.vault.adapter.getResourcePath(x.normalizePath(i.MomentsIcon));B&&!(i!=null&&i.MomentsIcon.startsWith("http"))?M(B):M(i==null?void 0:i.MomentsIcon)},[i==null?void 0:i.MomentsIcon,o]),P.useEffect(()=>{i!=null&&i.showDayMark&&w(Tv(l,(o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day"))},[l]),P.useEffect(()=>{c.current.closest(".workspace-window")&&g(!0)},[c.current]),P.useEffect(()=>{n&&g(!0)},[n]),P.useEffect(()=>{a?(g(!0),setTimeout(()=>{o.workspace.trigger("focus-on-textarea")},200)):g(!1)},[a]),P.useEffect(()=>{f.current&&(!h&&x.setIcon(f.current,"camera"),h&&x.setIcon(f.current,"camera-off"))},[f.current,h]);const N=P.useCallback(()=>{o.setting.open(),o.setting.openTabById(r.id||"obsidian-memos")},[o]);return v.jsxs("div",{ref:c,className:ar("moments-view",h?"show-editor":""),children:[v.jsxs("div",{className:"moments-view-background-wrapper",children:[v.jsx(cxe,{}),v.jsx("div",{ref:f,className:"moments-show-editor-btn",onClick:()=>{a&&h||((h||a)&&g(!h),!h&&!a&&new MT(o).open())}}),v.jsxs("div",{className:"moments-view-background-overlay",children:[v.jsxs("div",{className:"moments-view-user-info",children:[v.jsx("div",{className:"moments-view-user-name",children:i==null?void 0:i.UserName}),v.jsx(lxe,{userIcon:I})]}),v.jsx("div",{className:"moments-view-user-idea",children:i.MomentsQuote||" "})]})]}),i!=null&&i.showDayMark?y&&Object.keys(y).length>0&&Object.keys(y).map((B,k)=>v.jsx(kT,{type:"list",thinos:y[B],dayMark:B,dayMarkRange:S,thinoWrapper:R=>v.jsx(iN,{thino:R.thino,handleOpenSettings:N},R.thino.createdAt+k)},B)):l.map((B,k)=>v.jsx(iN,{thino:B,handleOpenSettings:N},B.createdAt+k))]})},cxe=()=>{const{dailyNotesState:{app:e,view:t,settings:n}}=P.useContext(Lt),[r,a]=P.useState((n==null?void 0:n.MomentsBackgroundImage)||Tw);return P.useEffect(()=>{if(!(n!=null&&n.MomentsBackgroundImage)||!e){a(document.body.hasClass("theme-dark")?b2:Tw);return}const o=e.vault.adapter.getResourcePath(x.normalizePath(n.MomentsBackgroundImage));o&&!(n!=null&&n.MomentsBackgroundImage.startsWith("http"))?a(o):a(n==null?void 0:n.MomentsBackgroundImage)},[n==null?void 0:n.MomentsBackgroundImage,e]),P.useEffect(()=>{t&&t.registerEvent(t.app.workspace.on("css-change",()=>{a(document.body.hasClass("theme-dark")&&!(n!=null&&n.MomentsBackgroundImage)?b2:!document.body.hasClass("theme-dark")&&!(n!=null&&n.MomentsBackgroundImage)?Tw:n==null?void 0:n.MomentsBackgroundImage)}))},[t]),v.jsx("div",{className:"moments-view-background",style:{backgroundImage:`url("${r}")`}})},dxe=e=>{const{icon:t}=e,n=P.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return v.jsx("div",{className:"thino-moment-icon",ref:r=>{if(t){r==null||r.empty();return}t||r&&x.setIcon(r,"Memos")},style:{backgroundImage:`url("${t}")`},onClick:n})},iN=e=>{const{dailyNotesState:{settings:t,app:n}}=P.useContext(Lt),r=P.useRef(null),a=P.useRef(null),{thino:o}=e,[i,l]=P.useState("");return P.useEffect(()=>{if(!(t!=null&&t.MomentsIcon)||!n)return;const c=n.vault.adapter.getResourcePath(x.normalizePath(t.MomentsIcon));c&&!(t!=null&&t.MomentsIcon.startsWith("http"))?l(c):l(t==null?void 0:t.MomentsIcon)},[t==null?void 0:t.MomentsIcon,n]),P.useEffect(()=>{r.current&&x.setIcon(r.current,"more-horizontal")},[r.current]),v.jsxs("div",{className:"thino-moment-wrapper",children:[v.jsx(dxe,{icon:i}),v.jsxs("div",{ref:a,className:"thino-moment-container",children:[v.jsx("div",{className:"thino-moment-user-name",children:t==null?void 0:t.UserName}),v.jsx("div",{className:"thino-moment-user-content",children:v.jsx(ai,{memo:o})})]})]})},fxe='',hxe='',sN=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o{const{vault:t}=ft.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),a=new Blob([r],{type:"image/png"});return new Promise(o=>{const i=new FileReader;i.onloadend=()=>{const l=i.result;o(l)},i.readAsDataURL(a)})},pxe=async e=>{var n,r;const t=e.find(".thino-user-icon");if(!(t&&!/(http|app|base64)/.test((n=t==null?void 0:t.style)==null?void 0:n.backgroundImage))&&t&&(r=t==null?void 0:t.style)!=null&&r.backgroundImage){const a=await Rg(t);t.style.backgroundImage=`url("${a}")`}},qE=async e=>{const t=e.findAll("img");for(const n of t)if(n.src.startsWith("http://localhost")){const r=await Sf(n.getAttribute("path")||x.normalizePath(n==null?void 0:n.parentElement.getAttribute("src")));n.src=r}else{const r=await kz(n);n.src=r}},mxe=async e=>{const{app:t,settings:n}=ft.getState();let r,a;const o=document.body.hasClass("theme-light"),i=o?e==="modern"?n==null?void 0:n.DefaultLightBackgroundImage:n==null?void 0:n.DefaultLightBackgroundImageForClean:e==="modern"?n==null?void 0:n.DefaultDarkBackgroundImage:n==null?void 0:n.DefaultDarkBackgroundImageForClean,l=await t.vault.adapter.exists(i)&&/\.(png|svg|jpg|jpeg)/g.test(i),c=i==null?void 0:i.startsWith("http");switch(e){case"clean":l||c?(a=i,r=c?await Sf(i):await lN(a)):r=o?Tw:b2;break;case"minimal":break;case"modern":default:l||c?(a=i,r=c?await Sf(i):await lN(a)):r="data:image/svg+xml;base64,"+btoa(o?fxe:hxe);break}switch(e){case"modern":{const f=document.querySelector(".dialog-wrapper .memo-background .property-image");f.style.backgroundImage="url('"+r+"')";break}case"clean":{const f=document.querySelector(".dialog-wrapper .memo-container.clean .memo-background .property-image");f&&(f.style.backgroundImage="url('"+r+"')");break}case"minimal":break;default:{const f=document.querySelector(".dialog-wrapper .memo-background .property-image");f.style.backgroundImage="url('"+r+"')"}}return r},gxe=e=>{const{memo:t,destroy:n}=e,{memos:r}=Le.getState().memoState,{view:a,app:o,settings:i}=Le.getState().dailyNotesState,l={...t,createdAtStr:ut.getDateTimeString(t.createdAt)},[c,f]=P.useState(!1),[h,g]=P.useState(l.content),[y,w]=P.useState(!1),S=P.useRef(null),D=P.useRef(null),I=P.useRef(null),[M,N]=P.useState(e.style||(o||window.app).loadLocalStorage("memoShareDialogStyle")||"clean"),[B,k]=P.useState(""),R=P.useRef(null),L=P.useRef(null),[_,V]=ne.useState(i==null?void 0:i.MomentsIcon);P.useEffect(()=>{if(!(i!=null&&i.MomentsIcon)||!o)return;const he=o.vault.adapter.getResourcePath(x.normalizePath(i.MomentsIcon));he&&!(i!=null&&i.MomentsIcon.startsWith("http"))?V(he):V(i==null?void 0:i.MomentsIcon)},[i==null?void 0:i.MomentsIcon,o]);let U,Z;r.length&&(U=r.length>0?r[r.length-1]:null,U?Z=r?Math.ceil((Date.now()-ut.getTimeStampByDate(U==null?void 0:U.createdAt))/1e3/3600/24)+1:0:Z=0),i==null||i.ShareFooterEnd.replace("{UserName}",i==null?void 0:i.UserName);const Q=i==null?void 0:i.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",Z.toString());P.useEffect(()=>{!S.current||!D.current||(x.setIcon(S.current,"copy"),x.setIcon(D.current,"x"))},[S,D]),P.useEffect(()=>{I.current&&x.setIcon(I.current,"file-down")},[I]),P.useEffect(()=>{x.setIcon(S.current,y?"loader":"copy"),S.current.disabled=y,S.current.toggleClass("copying",y)},[y]),P.useEffect(()=>{if(!L.current||!a&&!e.view||c)return;g(t.content),L.current.hasChildNodes()&&L.current.empty();async function he(){var se;(se=L.current)==null||se.toggleClass(["markdown-rendered"],!0),await x.MarkdownRenderer.render(o,t.content+` +`,L.current,t.path,a||e.view)}he(),setTimeout(async()=>{await G()},cA)},[R,L,l,M]);const G=async()=>{R.current&&(await pxe(R.current),await qE(R.current),mxe(M).then(he=>{he&&setTimeout(()=>{kb(R.current,{pixelRatio:window.devicePixelRatio*2}).then(se=>{k(se),f(!0)}).catch(()=>{})},600)}))},re=()=>{n()},de=P.useCallback(he=>{w(he)},[y]),fe=async()=>{const{vault:he}=Le.getState().dailyNotesState.app,se=R.current.querySelector(".memo-shortcut-img");if(!se)return;const ue=se==null?void 0:se.getAttribute("src").split("base64,")[1],X=sN(ue,"image/png");let oe;X.arrayBuffer().then(async De=>{const je="png",Re=Ju();for(const Fe in Re)if(Re[Fe]instanceof x.TFile){oe=Re[Fe];break}if(oe!==void 0){const Fe=await he.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,je,oe);await he.createBinary(Fe,De),new x.Notice(E("Save image successfully"))}})},$=async()=>{de(!0);const he=R.current.querySelector(".memo-shortcut-img");if(!he)return;const se=he==null?void 0:he.getAttribute("src").split("base64,")[1],ue=sN(se,"image/png");if(!ue){new x.Notice(E("Copy to clipboard failed"));return}const X=new ClipboardItem({"image/png":ue});window.navigator.clipboard.write([X]).then(()=>{setTimeout(()=>{de(!1)},500)}),new x.Notice(E("Copy to clipboard successfully"))};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:ar("dialog-header-container"),children:[v.jsxs("p",{className:"title-text",children:[v.jsx("span",{className:"icon-text",children:"🥰"}),E("Share Memo Image")]}),v.jsxs("div",{className:"btn-group",children:[x.Platform.isMobile&&v.jsx("button",{ref:I,className:"btn download-btn",onClick:fe}),v.jsx("button",{ref:S,className:"btn copy-btn",onClick:$}),v.jsx("button",{ref:D,className:"btn close-btn",onClick:re})]})]}),v.jsxs("div",{className:ar("dialog-content-container",M),children:[v.jsx("div",{className:`tip-words-container ${B?"finish":"loading"}`,children:v.jsx("p",{className:"tip-text",children:E(B?"↗Click the button to save":"Image is generating...")})}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Default sharing style")}),v.jsx("div",{className:"setting-item-description",children:E("Set the default style for sharing thino, 'Modern' by default.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:M,onChange:async he=>{he.currentTarget.value!==M&&(f(!1),k(""),N(he.currentTarget.value),(o||window.app).saveLocalStorage("memoShareDialogStyle",he.currentTarget.value),await G())},children:[v.jsx("option",{value:"modern",children:E("Modern")}),v.jsx("option",{value:"clean",children:E("Clean")}),v.jsx("option",{value:"minimal",children:E("Minimal")}),v.jsx("option",{value:"gradient",children:E("Gradient")})]})})]}),v.jsxs("div",{className:ar("memo-container",M),ref:R,children:[v.jsx(ts,{when:B!=="",children:v.jsx("img",{className:"memo-shortcut-img",onClick:$,src:B})}),v.jsxs("div",{className:"memo-background",children:[v.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}}),v.jsx("span",{className:"background-container"}),v.jsxs("div",{className:"thino-user-header",children:[v.jsx("div",{className:"thino-user-icon",ref:he=>{if(i!=null&&i.MomentsIcon){he==null||he.empty();return}i!=null&&i.MomentsIcon||he&&x.setIcon(he,"Memos")},style:{backgroundImage:`url("${_}")`}}),v.jsxs("div",{className:"thino-user-info",children:[v.jsx("div",{className:"thino-user-name",children:i==null?void 0:i.UserName}),(i==null?void 0:i.MomentsQuote)&&v.jsx("div",{className:"thino-user-quote",children:i==null?void 0:i.MomentsQuote})]})]}),v.jsx("div",{ref:L,className:"memo-content-text",style:{minHeight:i.MinHeightForShare||"200px"}}),v.jsx("div",{className:"thino-time-footer",children:l.createdAt}),v.jsxs("div",{className:"watermark-container",children:[v.jsxs("span",{className:"normal-text footer-start",children:[v.jsx("div",{className:"property-social-icons"}),v.jsx("span",{className:"name-text",children:Q})]}),v.jsx("span",{className:"normal-text footer-end",children:v.jsx("span",{className:"name-text",children:"THINO"})})]})]})]})]})]})};function uf(e,t,n){Db({className:"share-memo-image-dialog"},gxe,{memo:e,style:t,view:n})}function lm(e=!0){const[t,n]=P.useState({isLoading:e,isFailed:!1,isSucceed:!1,isPending:!1});return{...t,setLoading:()=>{n({...t,isLoading:!0,isFailed:!1,isPending:!1,isSucceed:!1})},setFinish:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!1,isSucceed:!0})},setError:()=>{n({...t,isLoading:!1,isFailed:!0,isPending:!1,isSucceed:!1})},setPending:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!0,isSucceed:!1})}}}const vxe=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=P.useContext(Lt),{memo:a,handleUnarchivedMemoAction:o}=e,i=ne.useRef(null),l=ne.useRef(null),[c,f]=ne.useState(""),h={...a,createdAtStr:ut.getDateTimeString(a.createdAt),deletedAtStr:ut.getDateTimeString(a.deletedAt||a.createdAt)},[g,y]=Xl(!1),w={restore:P.useRef(null),delete:P.useRef(null),source:P.useRef(null)};P.useEffect(()=>{l&&(x.setIcon(w.restore.current,"archive-restore"),x.setIcon(w.delete.current,"trash"),x.setIcon(w.source.current,"home"))},[l]),P.useEffect(()=>{if(!i.current||!l.current||i.current.hasChildNodes()&&a.content===c||!r)return;f(a.content),i.current.hasChildNodes()&&i.current.empty();async function N(){var k,R;(k=i.current)==null||k.toggleClass(["markdown-rendered"],!0),await x.MarkdownRenderer.render(t,a.content+` +`,i.current,a.path,r);const B=(R=i.current)==null?void 0:R.querySelectorAll(".internal-link");B==null||B.forEach(L=>{const _=L,V=_.getAttribute("data-href");if(!V)return;t.metadataCache.getFirstLinkpathDest(V,a.path)||L.classList.add("is-unresolved"),_.addEventListener("mouseover",Z=>{Z.stopPropagation(),t.workspace.trigger("hover-link",{event:Z,source:"thino",hoverParent:r.containerEl,targetEl:_,linktext:V,sourcePath:_.href})})})}N()},[a.content,l]);const S=async()=>{switch(h.sourceType){case"DAILY":await W2(h.id,h.path);break;case"CANVAS":await Z2(h.id,h.path);break;case"MULTI":await V2(h.path);break;case"FILE":await $2(h.id,h.path);break}},D=async()=>{if(g)try{if(n.DeleteThinoDirectly)await we.deleteMemoById(h.id);else{const N=await we.hideMemoById(h.id);N&&we.editMemo(N)}}catch(N){new x.Notice(N.message)}else y()},I=async()=>{try{const N=await we.unarchiveMemo(h);N&&we.editMemo(N),o(h.id),new x.Notice(E("RESTORE SUCCEED"))}catch(N){new x.Notice(N.message)}},M=()=>{g&&y(!1)};return v.jsxs("div",{ref:l,className:`memo-wrapper ${"memos-"+h.id}`,onMouseLeave:M,children:[v.jsxs("div",{className:"memo-top-wrapper",children:[v.jsxs("span",{className:"time-text",children:[E("ARCHIVED AT")," ",h.updatedAt]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:N=>{N&&x.setIcon(N,"more-horizontal")},className:"btn more-action-btn"}),v.jsx("div",{className:"more-action-btns-wrapper",children:v.jsxs("div",{className:"more-action-btns-container",children:[v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.restore,className:"more-action-item-icon"}),v.jsx("span",{className:"btn restore-btn",onClick:I,children:E("RESTORE")})]}),v.jsxs("div",{className:"more-action-menu-item",children:[v.jsx("span",{ref:w.source,className:"more-action-item-icon"}),v.jsx("span",{className:"btn",onClick:S,children:E("SOURCE")})]}),v.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[v.jsx("span",{ref:w.delete,className:"more-action-item-icon"}),v.jsx("span",{className:`btn delete-btn ${g?"final-confirm":""}`,onClick:D,children:E(g?"CONFIRM!":"DELETE")})]})]})})]})]}),v.jsx("div",{ref:i,className:"memo-content-text"})]})},Bu=e=>{var n;const t=new Map;for(const r of e){const a=r.path;t.has(a)||t.set(a,[]),(n=t.get(a))==null||n.push(r)}return Array.from(t).map(([r,a])=>({path:r,thinos:a}))},yxe=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:i,filter:l}=t,c=on.getQueryById(l);return!!(r||a&&a.from{let g=!0;if(h.thinoType!==void 0&&n&&h.thinoType==="TASK-DONE"&&(g=!1),h.content.contains("comment:")&&(g=!1),c){const y=JSON.parse(c.querystring);Array.isArray(y)&&(g=Vp(h,y))}if(r){const y=new Set;for(const w of Array.from(h.content.match($r)||[])){const D=w.replace($r,"$1").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}for(const w of Array.from(h.content.match(ua)||[])){const D=w.replace(ua,"$1").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}for(const w of Array.from(h.content.match(Wa)||[])){const D=w.replace(Wa,"$2").trim().split("/");let I="";for(const M of D)I+=M,y.add(I),I+="/"}y.has(r)||(g=!1)}return a&&a.froma.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(h.content.match($r)!==null||h.content.match(Wa)!==null||h.content.match(ua)!==null)||o==="LINKED"&&h.content.match(Af)===null||o==="IMAGED"&&h.content.match(Ff)===null||o==="CONNECTED"&&h.content.match(ad)===null)&&(g=!1),i&&!h.content.toLowerCase().includes(i.toLowerCase())&&(g=!1),g}):e.filter(h=>!h.content.contains("comment:"))},wxe=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=P.useContext(Lt),r=lm(),[a,o]=P.useState([]),i=ne.useRef(null),l=ne.useRef(null);P.useEffect(()=>{l.current&&x.setIcon(l.current,"more-horizontal")},[l]),P.useEffect(()=>{const S=yxe({memos:n.filter(D=>D.rowStatus==="ARCHIVED"&&D.deletedAt===""),query:e,HideDoneTasks:!1});o(S),r.setFinish()},[n,i.current,e]);const c=P.useCallback(S=>{o(D=>D.filter(I=>I.id!==S))},[]),f=P.useCallback(S=>{o(D=>D.filter(I=>I.id!==S))},[]),h=P.useCallback(()=>{dt.setShowSiderbarInMobileView(!0)},[]),g=async()=>{if(!((a==null?void 0:a.length)>0))return;if(!await Vl()){fn();return}const S=[...a];try{const D=S.filter(B=>B.sourceType==="DAILY"),I=S.filter(B=>B.sourceType!=="DAILY"),M=await we.unarchiveThinoBulk(I);for(const B of M)B&&we.editMemo(B);const N=Bu(D);for(const{path:B,thinos:k}of N)await we.dealWithDailyThinoBulk(B,k,"restoreFromArchive");new x.Notice(E("RESTORE SUCCEED")),at.clearQuery()}catch(D){console.error("error",D),new x.Notice(D.message)}},y=async()=>{if(!((a==null?void 0:a.length)>0))return;if(!await Vl()){fn();return}const S=[...a],D=ft.getState().settings.DeleteThinoDirectly;try{const I=S.filter(B=>B.sourceType==="DAILY"),M=S.filter(B=>B.sourceType!=="DAILY");for(const B of M)if(D)await we.deleteMemoById(B.id);else{const k=await we.hideMemoById(B.id);k&&we.editMemo(k)}const N=Bu(I);for(const{path:B,thinos:k}of N)await we.dealWithDailyThinoBulk(B,k,D?"deleteForever":"delete");at.clearQuery()}catch(I){console.error("error",I),new x.Notice(I.message)}},w=S=>{const D=new x.Menu;D.addItem(I=>{I.setTitle(E("Bulk restore")).setIcon("archive").onClick(async()=>{new _s(app,E("RESTORE"),async M=>{M==="confirm"&&await g()}).open()})}).addItem(I=>{I.setTitle(E("Bulk delete")).setIcon("trash").onClick(async()=>{new _s(app,E("DELETE"),async M=>{M==="confirm"&&await y()}).open()})}),D.showAtMouseEvent(S.nativeEvent)};return v.jsxs("div",{className:"memo-trash-wrapper",ref:i,children:[v.jsxs("div",{className:"section-header-container",children:[v.jsxs("div",{className:"title-text",children:[v.jsx(ts,{when:t,children:v.jsx("button",{ref:S=>{S&&x.setIcon(S,"menu")},className:"btn action-btn clickable-icon",onClick:h})}),v.jsxs("span",{className:"go-home-btn",onClick:()=>{at.clearQuery(),at.setPathname("/")},children:["🏠 ",E("Return To Home Page")]}),v.jsx("span",{ref:l,className:"menu-popup-btn",onClick:w})]}),v.jsx(_v,{})]}),v.jsx(yy,{thinosCount:a.length,thinos:a}),r.isLoading?v.jsx("div",{className:"tip-text-container",children:v.jsx("p",{className:"tip-text",children:E("Fetching data...")})}):a.length===0?v.jsx("div",{className:"tip-text-container",children:v.jsx("p",{className:"tip-text",children:E("Here is No Memos.")})}):v.jsx("div",{className:"deleted-memos-container",children:a.map(S=>v.jsx(vxe,{memo:S,handleUnarchivedMemoAction:f,handleDeletedMemoAction:c},`${S.id}-${S.updatedAt}`))})]})},Vl=async()=>{var r;const{verifyState:e}=ft.getState(),t=!x.Platform.isDesktop&&await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId()),n=x.Platform.isDesktop?await cr():t.identifier||t.uuid;return e&&(e==null?void 0:e.appId)===n},bxe=async(e,t)=>{if(!(t!=="chat"&&t!=="moments")){if(t==="moments"){const n=e.querySelectorAll(".thino-moment-icon"),r=e.find(".moments-view-user-icon"),a=e.find(".moments-view-background");for(const o of n){const i=await Rg(o);o.style.backgroundImage=`url(${i})`}if(r){const o=await Rg(r);r.style.backgroundImage=`url(${o})`}if(a){const o=await Rg(a);a.style.backgroundImage=`url(${o})`}}else if(t==="chat"){const n=e.querySelectorAll(".icon-img");for(const r of n){const a=await Rg(r);r.style.backgroundImage=`url(${a})`}}}};class _s extends x.Modal{constructor(t,n,r){super(t),this.title=n,this.cb=r}onOpen(){super.onOpen(),this.containerEl.toggleClass("thino-bulk-action-dialog",!0),this.titleEl.setText(this.title+" "+E("Confirm?")),this.contentEl.createEl("button",{cls:"mod-warning",text:E("Confirm?").replace(/\?|?/,"")}).onclick=()=>{this.cb("confirm"),this.close()},this.contentEl.createEl("button",{text:E("Cancel")}).onclick=()=>{this.cb("cancel"),this.close()}}onClose(){super.onClose()}}class Sxe extends x.Modal{constructor(n,r){super(n);Se(this,"root");this.thinos=r}onOpen(){super.onOpen(),this.containerEl.toggleClass(["thino-bulk-action-dialog","tag-actions"],!0),this.root=rs.createRoot(this.contentEl),this.root.render(v.jsx(is,{store:Le,context:Lt,children:v.jsx(xz,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos})}))}onClose(){var n;super.onClose(),(n=this.root)==null||n.unmount()}}const yy=({thinosCount:e,thinos:t})=>{const{globalState:{memoListView:n},locationState:{query:r,pathname:a},dailyNotesState:{settings:o,app:i}}=P.useContext(Lt),{tag:l,duration:c,type:f,text:h,filter:g,path:y}=r,w=on.getQueryById(g),S=!!(l||c&&c.from{D&&x.setIcon(D.current,"more-horizontal")},[D]);const I=async()=>{if(!((t==null?void 0:t.length)>0))return;const U=vz(t),Z=wz(U);await ut.copyTextToClipboard(Z),new x.Notice(E("Copied to clipboard Successfully"))},M=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const U=[...t],Z=o.DeleteThinoDirectly;try{const Q=U.filter(de=>de.sourceType==="DAILY"),G=U.filter(de=>de.sourceType!=="DAILY");for(const de of G)if(Z)await we.deleteMemoById(de.id);else{const fe=await we.hideMemoById(de.id);fe&&we.editMemo(fe)}const re=Bu(Q);for(const{path:de,thinos:fe}of re)await we.dealWithDailyThinoBulk(de,fe,Z?"deleteForever":"delete");we.updateTagsState(),at.clearQuery()}catch(Q){console.error("error",Q),new x.Notice(Q.message)}},N=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const U=[...t],Z=ft.getState().settings.startSync,Q=ft.getState().app,G=Q==null?void 0:Q.loadLocalStorage("tokenForSync");try{const re=U.filter($=>$.sourceType==="DAILY"),de=U.filter($=>$.sourceType!=="DAILY");for(const $ of de)await we.deleteMemoById($.id);const fe=Bu(re);for(const{path:$,thinos:he}of fe){const se=await we.dealWithDailyThinoBulk($,he,"deleteForever");if(!(!G||!Z))for(const ue of se)ue&&ue.webId&&await A2(ue.webId)}we.updateTagsState(),at.clearQuery(),new x.Notice(E("DELETE SUCCEED"))}catch(re){console.error("error",re),new x.Notice(re.message)}},B=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const U=[...t];try{const Z=U.filter(de=>de.sourceType==="DAILY"),Q=U.filter(de=>de.sourceType!=="DAILY"),G=await we.unarchiveThinoBulk(Q);for(const de of G)de&&we.editMemo(de);const re=Bu(Z);for(const{path:de,thinos:fe}of re)await we.dealWithDailyThinoBulk(de,fe,"restoreFromArchive");new x.Notice(E("RESTORE SUCCEED")),we.updateTagsState(),at.clearQuery()}catch(Z){console.error("error",Z),new x.Notice(Z.message)}},k=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const U=[...t],Z=ft.getState().settings.startSync,Q=ft.getState().app,G=Q==null?void 0:Q.loadLocalStorage("tokenForSync");try{const re=U.filter($=>$.sourceType==="DAILY"),de=U.filter($=>$.sourceType!=="DAILY");for(const $ of de){const he=await we.restoreMemoById($.id);he&&he.webId&&G&&Z&&await Xg(he.webId),he&&we.editMemo(he)}const fe=Bu(re);for(const{path:$,thinos:he}of fe){const se=await we.dealWithDailyThinoBulk($,he,"restoreFromDelete");for(const ue of se)ue&&ue.webId&&G&&Z&&await Xg(ue.webId),ue&&we.editMemo(ue)}we.updateTagsState(),at.clearQuery(),new x.Notice(E("RESTORE SUCCEED"))}catch(re){new x.Notice(re.message)}},R=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await Vl()){fn();return}const U=[...t];try{const Z=U.filter(de=>de.sourceType==="DAILY"),Q=U.filter(de=>de.sourceType!=="DAILY"),G=await we.archiveThinoBulk(Q);for(const de of G)de&&we.editMemo(de);const re=Bu(Z);for(const{path:de,thinos:fe}of re)await we.dealWithDailyThinoBulk(de,fe,"archive");we.updateTagsState(),at.clearQuery()}catch(Z){console.error("error",Z),new x.Notice(Z.message)}},L=async()=>{if((t==null?void 0:t.length)>0){if(!await Vl()){fn();return}new Sxe(i,t).open()}},_=async U=>{document.body.toggleClass("thino-share-page",!0),setTimeout(async()=>{if(new x.Notice(E("Image is generating...")),!U){new x.Notice(E("No content to generate."));return}await bxe(U,n),await qE(U);let Z;document.body.hasClass("theme-dark")?Z="#232323":Z="#eaeaea",kb(U,{backgroundColor:Z,pixelRatio:window.devicePixelRatio*2}).then(Q=>{if(o!=null&&o.AutoSaveWhenOnMobile&&x.Platform.isMobile){const G=Q.split("base64,")[1];gb(G,"image/png").arrayBuffer().then(async de=>{let fe;const $="png",he=Ju();for(const se in he)if(he[se]instanceof x.TFile){fe=he[se];break}fe!==void 0&&await i.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,$,fe),de)})}document.body.toggleClass("thino-share-page",!1),Nb({imgUrl:Q}),new x.Notice(E("Image generated successfully.")),U.hasClass("share-image")?U.toggleClass("share-image",!1):U.closest(".share-image").toggleClass("share-image",!1)}).catch(Q=>{document.body.toggleClass("thino-share-page",!1),console.error(Q)})},0)},V=U=>{const Z=new x.Menu;switch(Z.addItem(Q=>{Q.setTitle(E("Copy filtered thinos")).setIcon("copy").onClick(async()=>{await I()})}),Z.addItem(Q=>{Q.setTitle(E("Share filtered thinos as image")).setIcon("image").onClick(async()=>{const G=document.querySelector(".memolist-container");G.toggleClass("share-image",!0);try{if(n==="calendar"){if(G.find(".rbc-agenda-table")){const re=G.find(".rbc-agenda-table");await _(re)}if(G.find(".rbc-month-view")){const re=G.find(".rbc-month-view");await _(re)}}else if(n==="table"){if(G.find(".thino-table")){const re=G.find(".thino-table");await _(re)}}else await _(G)}catch(re){console.error(re),new x.Notice(E("Failed to generate image.")),G.toggleClass("share-image",!1)}})}),Z.addItem(Q=>{Q.setTitle(E("Merge thinos in to thino share image")).setIcon("image").onClick(async()=>{let G="";t.forEach((de,fe)=>{G+=`> [!thino] ${de.createdAt} +${de.content.split(` `).map($=>$.trim()?`> ${$} `:`> `)} @@ -236,29 +236,29 @@ ${se.content.split(` ------ -`)});const le={createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),content:G.replace(/(^|\n),>/g,` ->`),id:"temp-"+Math.random().toString(36).substr(2,9),thinoType:"JOURNAL",sourceType:"DAILY",rowStatus:"NORMAL",visibility:"PRIVATE",pinned:!1,creatorName:"thino",deletedAt:"",path:"",resourceList:[]};uf(le,"clean")})}),Z.addSeparator(),a){case"/":Z.addItem(Q=>{Q.setTitle(E("Bulk tag operation")).setIcon("hash").onClick(async()=>{await L()})}).addItem(Q=>{Q.setTitle(E("Bulk archive")).setIcon("archive").onClick(async()=>{new _s(i,E("ARCHIVE"),async G=>{G==="confirm"&&await B()}).open()})}).addItem(Q=>{Q.setTitle(E("Bulk delete")).setIcon("trash").onClick(async()=>{new _s(i,E("DELETE"),async G=>{G==="confirm"&&await M()}).open()})});break;case"/archive":Z.addItem(Q=>{Q.setTitle(E("Bulk restore")).setIcon("archive").onClick(async()=>{new _s(i,E("RESTORE"),async G=>{G==="confirm"&&await _()}).open()})}).addItem(Q=>{Q.setTitle(E("Bulk delete")).setIcon("trash").onClick(async()=>{new _s(i,E("DELETE"),async G=>{G==="confirm"&&await M()}).open()})});break;case"/recycle":Z.addItem(Q=>{Q.setTitle(E("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new _s(i,E("RESTORE"),async G=>{G==="confirm"&&await k()}).open()})}).addItem(Q=>{Q.setTitle(E("Bulk delete")).setIcon("trash").onClick(async()=>{new _s(i,E("DELETE"),async G=>{G==="confirm"&&await N()}).open()})});break}Z.showAtMouseEvent(Y.nativeEvent)};return v.jsxs("div",{className:`filter-query-container ${S?"":"hidden"}`,children:[v.jsxs("div",{className:"filter-query",children:[v.jsx("span",{className:"tip-text",children:E("FILTER")}),v.jsxs("div",{"data-filter-type":"query",className:"filter-item-container "+(w?"":"hidden"),onClick:()=>{at.setMemoFilter("")},children:[v.jsx("span",{className:"icon-text",children:"🔖"})," ",w==null?void 0:w.title]}),v.jsxs("div",{"data-filter-type":"tag",className:"filter-item-container "+(l?"":"hidden"),onClick:()=>{at.setTagQuery("")},children:[v.jsx("span",{className:"icon-text",children:"🏷️"})," ",l]}),v.jsxs("div",{"data-filter-type":"type",className:"filter-item-container "+(f?"":"hidden"),onClick:()=>{at.setMemoTypeQuery("")},children:[v.jsx("span",{className:"icon-text",children:"📦"})," ",cY(f)]}),c&&c.from{const Z=x.moment(c.to,"x"),Q=x.moment(Y,"x"),G=Q.isAfter(Z)||Q.isSame(Z);at.setFromAndToQuery(G?Z.startOf("day").valueOf():x.moment(Y,"x").startOf("day").valueOf(),c.to)}}),v.jsx("span",{children:E("to")}),v.jsx(Pw,{type:"text",startOrEnd:"end",defaultValue:x.moment(c.to,"x").add(1,"days").valueOf(),handleValueChange:Y=>{const Z=x.moment(c.from,"x"),Q=x.moment(Y,"x"),G=Q.isBefore(Z)||Q.isSame(Z),le=x.moment(Y,"x").endOf("day").valueOf();at.setFromAndToQuery(c.from,G?Z.endOf("day").valueOf():le)}})]}),v.jsx("div",{ref:Y=>Y&&x.setIcon(Y,"x"),className:"btn close-btn",onClick:()=>{at.setFromAndToQuery(0,0)}})]}),v.jsxs("div",{className:"filter-item-container "+(h?"":"hidden"),onClick:()=>{at.setTextQuery("")},children:[v.jsx("span",{className:"icon-text",children:"🔍"})," ",h]}),v.jsxs("div",{className:"filter-item-container "+(y?"":"hidden"),onClick:()=>{at.setPathQuery("")},children:[v.jsx("span",{className:"icon-text"})," ",h]})]}),v.jsxs("div",{className:"thino-filter-items",children:[e&&v.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),v.jsx("div",{ref:D,className:"btn memo-action-menu",onClick:V})]})]})},cf=async e=>{const{app:t,settings:n}=ft.getState();if(!n.startSync||!(t!=null&&t.loadLocalStorage("tokenForSync")))return;const r=await t_(e);if(!r||r.length===0)return;r.sort((i,l)=>x.moment(i.createdAt,"YYYY/MM/DD HH:mm:ss").isAfter(x.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss"))?1:-1);const a=r.filter(i=>!i.deleted),o=r.filter(i=>i.deleted);for(let i=0;i{a===f||!a||(h(a),t&&(t==null||t.saveLocalStorage("thinoListView",a)))},[a]),P.useEffect(()=>{if(e.SyncManually||!t||!r||!n||!(t==null?void 0:t.loadLocalStorage("tokenForSync"))||!e.startSync)return;i.current=window.setInterval(async()=>{const S=S2(t);await cf(S)},3e4),n.registerInterval(i.current);const w=S2(t);return cf(w),()=>{i.current&&window.clearInterval(i.current)}},[n,t,r,e.startSync]);const g=[v.jsx(yy,{thinosCount:l.length,thinos:l},"filter"),v.jsx(axe,{listView:f,updateThinos:y=>{c(y)}},"list")];return v.jsx(v.Fragment,{children:a==="chat"?v.jsx(v.Fragment,{children:[v.jsx(Iw,{syncThino:cf},"header"),...g.reverse(),v.jsx(mf,{className:"mod-editor-bottom",editorType:"inline"},"editor")]}):v.jsx(v.Fragment,{children:o?[v.jsx(Iw,{syncThino:cf},"header"),...g,v.jsx(mf,{className:"mod-editor-bottom",editorType:"block"},"editor")]:[v.jsx(Iw,{syncThino:cf},"header"),v.jsx(mf,{editorType:"block"},"editor"),...g]})})}function Dxe(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")))}catch(t){console.error(t)}}function S2(e){try{const t=(e==null?void 0:e.loadLocalStorage)&&(e==null?void 0:e.loadLocalStorage("thinoLastUpdated"));return t||x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")}catch(t){return console.error(t),x.moment().format("x")}}function Txe(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment().format("x")))}catch(t){console.error(t)}}const Ixe={text:E("SELECT"),value:""},Exe=e=>{const{className:t,dataSource:n,handleValueChanged:r,value:a}=e,[o,i]=Xl(!1),l=P.useRef(null);let c=Ixe;for(const g of n)if(g.value===a){c=g;break}P.useEffect(()=>{if(o){const g=y=>{var w;(w=l.current)!=null&&w.contains(y.target)||i(!1)};window.addEventListener("click",g,{capture:!0,once:!0})}},[o]);const f=g=>{r&&r(g.value),i(!1)},h=g=>{g.stopPropagation(),i()};return v.jsxs("div",{className:`selector-wrapper ${t||""}`,ref:l,children:[v.jsxs("div",{className:`current-value-container ${o?"active":""}`,onClick:h,children:[v.jsx("span",{className:"value-text",children:c.text}),v.jsx("span",{ref:g=>{g&&x.setIcon(g,"chevron-right")},className:"btn arrow-text"})]}),v.jsx("div",{className:`items-wrapper ${o?"":"hidden"}`,children:n.map(g=>v.jsx("div",{className:`item-container ${g.value===a?"selected":""}`,onClick:()=>{f(g)},children:g.text},g.value))})]})},nf=P.memo(Exe),GE=e=>{const{destroy:t,queryId:n,type:r="dialog"}=e,[a,o]=P.useState(""),[i,l]=P.useState(r!=="dialog"?[Sx()]:[]),c=lm(!1),[f,h]=P.useState(!1),[g,y]=Xl(!1),w=we.getState().memos.filter(L=>!(L.deletedAt!==""&&L.deletedAt)).filter(L=>Vp(L,i)).length;P.useEffect(()=>{S()},[n]);const S=()=>{const L=on.getQueryById(n??"");if(L){o(L.title);const R=JSON.parse(L.querystring);return Array.isArray(R)&&l(R),L}},D=L=>{const R=L.target.value;o(R)},I=async()=>{if(!a)return new x.Notice(E("TITLE CANNOT BE NULL!")),null;if(i.length===0)return new x.Notice(E("FILTER CANNOT BE NULL!")),null;if(i.length===1&&i[i.length-1].value.value==="")return new x.Notice(E("Please finish the last filter setting first")),null;let L;const R=on.getQueryById(n||"");try{n&&!n.startsWith("Filter [Temp] ")&&R.title===a?(L=await on.updateQuery(n,a,JSON.stringify(i)),on.editQuery(L),await on.getMyAllQueries()):(L=await on.createQuery(a,JSON.stringify(i)),on.pushQuery(L),await on.getMyAllQueries())}catch(V){new x.Notice(V.message)}return L},M=async()=>{switch(r){case"modal":case"inline":if(i.length===0){new x.Notice(E("FILTER CANNOT BE NULL!"));return}if(i.length===1&&i[i.length-1].value.value===""){new x.Notice(E("Please finish the last filter setting first"));return}try{const L=on.getQueryById(n??"");if(L&&JSON.stringify(i)===L.querystring){at.setMemoFilter(L.id),t();return}const R=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(i));on.pushQuery(R),at.setMemoFilter(R.id)}catch(L){new x.Notice(L.message)}t();break;case"dialog":try{if(!await I())return}catch(L){console.error(L),new x.Notice(L.message)}t();break}},N=()=>{if(i.length===0){new x.Notice(E("FILTER CANNOT BE NULL!"));return}if(f){at.setMemoFilter(""),h(!1);return}const L=on.getQueryById(n??"");if(L&&JSON.stringify(i)===L.querystring){at.setMemoFilter(L.id);return}const R=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(i));on.pushQuery(R),at.setMemoFilter(R.id),e.setPreview&&e.setPreview(R.id),h(!0)},_=()=>{if(i.length>0&&i[i.length-1].value.value===""){new x.Notice(E("Please finish the last filter setting first"));return}l([...i,Sx()])},k=P.useCallback((L,R)=>{l(V=>{const Y=[...V];return Y[L]=R,Y})},[]),B=P.useCallback(L=>{l(R=>R.filter((Y,Z)=>Z!==L))},[]);return v.jsxs(v.Fragment,{children:[r==="dialog"&&v.jsxs("div",{className:"dialog-header-container",children:[v.jsxs("span",{className:"title-text",children:[v.jsx("span",{className:"icon-text",children:"🔖"}),E(n?"EDIT QUERY":"CREATE QUERY")]}),v.jsx("button",{ref:L=>{L&&x.setIcon(L,"x")},className:"btn close-btn",onClick:t})]}),v.jsxs("div",{className:"dialog-content-container",children:[(r==="dialog"||g)&&v.jsxs("div",{className:"form-item-container input-form-container",children:[v.jsx("span",{className:"normal-text",children:E("TITLE")}),v.jsx("input",{className:"title-input",type:"text",value:a,onChange:D})]}),v.jsxs("div",{className:"form-item-container filter-form-container",children:[v.jsx("span",{className:"normal-text",children:E("FILTER")}),v.jsxs("div",{className:"filters-wrapper",children:[i.map((L,R)=>v.jsx(xxe,{index:R,filter:L,handleFilterChange:k,handleFilterRemove:B},R)),v.jsx("div",{className:"create-filter-btn",onClick:_,children:E("ADD FILTER TERMS")})]})]})]}),v.jsx("div",{className:"dialog-footer-container",children:v.jsxs("div",{className:"btns-container",children:[(r==="inline"||r==="modal")&&v.jsx("button",{className:`btn ${g?"mod-cta":"save-btn"}`,onClick:async()=>{if(!g)y();else{const L=await I();y(!1),t(),L&&at.setMemoFilter(L.id)}},children:E(g?"Set and save":"Save")}),v.jsxs("div",{className:"btns-group-container",children:[v.jsxs("span",{className:`tip-text ${i.length===0&&"hidden"}`,children:[E("MATCH")," Thino ",v.jsx("strong",{children:w})," ",E("TIMES")]}),v.jsx(v.Fragment,{children:r==="inline"&&v.jsx("button",{className:"btn mod-cta",onClick:N,children:E("Preview")})}),v.jsx("button",{className:`btn save-btn ${c.isLoading?"requesting":""}`,onClick:M,children:E(r==="inline"||r==="modal"?"Filter":n?"EDIT":"Save")})]})]})})]})},Cxe=e=>{const{index:t,filter:n,handleFilterChange:r,handleFilterRemove:a}=e,{type:o}=n,i=P.useRef(null),l=P.useRef(null),c=P.useRef(n),f=P.useRef(o);P.useEffect(()=>{c.current=e.filter},[n]),P.useEffect(()=>{if(i.current)return o!=="TAG"&&l.current&&(l.current.destroy(),l.current=null,i.current.detach()),o==="TAG"&&!l.current&&(f.current=o,l.current=new rv(i.current,w)),()=>{l.current&&(l.current.destroy(),l.current=null)}},[i,o]);const h=P.useCallback(I=>{["AND","OR"].includes(I)&&r(t,{...n,relation:I})},[n]),g=P.useCallback(async I=>{var M;if(n.type!==I){const{verifyState:N}=ft.getState(),_=!x.Platform.isDesktop&&await((M=window.Capacitor)==null?void 0:M.Plugins.Device.getId()),k=x.Platform.isDesktop?await cr():_.identifier||_.uuid,B=N&&(N==null?void 0:N.appId)===k;if((I==="SOURCE"||I==="PATH"||I==="METADATA"||I==="TIME_RANGE")&&!B){fn();return}const L=Object.values(jl[I].operators);r(t,{...n,type:I,value:{operator:L[0].value,value:I==="METADATA"?{name:"",value:""}:I==="TIME_RANGE"?jl.TIME_RANGE.values[0].value:""}})}},[n]),y=P.useCallback(I=>{r(t,{...n,value:{...n.value,operator:I}})},[n]),w=P.useCallback((I,M="OTHERS")=>{if(M==="OTHERS")r(t,{...c.current,value:{...c.current.value,value:I}});else{const N={...c.current,value:{...c.current.value,value:{...c.current.value.value,[M==="METADATA_NAME"?"name":"value"]:I}}};r(t,N)}},[n]),S=()=>{a(t)},D={TYPE:v.jsx(nf,{className:"value-selector",dataSource:jl.TYPE.values,value:n.value.value,handleValueChanged:w}),LIST:v.jsx(nf,{className:"value-selector",dataSource:jl.LIST.values,value:n.value.value,handleValueChanged:w}),SOURCE:v.jsx(nf,{className:"value-selector",dataSource:jl.SOURCE.values,value:n.value.value,handleValueChanged:w}),PATH:v.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:I=>{w(I.target.value)}}),METADATA:v.jsxs(v.Fragment,{children:[v.jsx("input",{type:"text",className:"value-inputer",value:n.value.value.name,onChange:I=>{w(I.target.value,"METADATA_NAME")}}),v.jsx("input",{type:"text",className:"value-inputer",value:n.value.value.value,onChange:I=>{w(I.target.value,"METADATA_VALUE")}})]}),TAG:v.jsx("input",{type:"text",id:Math.random().toString(36).substring(7),className:"value-inputer",ref:i,value:n.value.value,onChange:I=>{w(I.target.value)}}),TEXT:v.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:I=>{w(I.target.value)}}),DATE:v.jsxs("div",{className:"date-inputer",children:[v.jsx(Pw,{type:"icon",handleValueChange:w}),v.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:I=>{w(I.target.value)}})]}),TIME_RANGE:v.jsx(nf,{className:"value-selector",dataSource:jl.TIME_RANGE.values,value:n.value.value,handleValueChanged:w})};return v.jsxs("div",{className:"memo-filter-input-wrapper",children:[t>0&&v.jsx(nf,{className:"relation-selector",dataSource:uY,value:n.relation,handleValueChanged:h}),v.jsx(nf,{className:"type-selector",dataSource:Object.values(jl),value:n.type,handleValueChanged:g}),v.jsxs(v.Fragment,{children:[Object.keys(jl).includes(o)&&v.jsx(nf,{className:"operator-selector",dataSource:Object.values(jl[o].operators),value:n.value.operator,handleValueChanged:y}),D[o]]}),v.jsx("div",{ref:I=>{I&&x.setIcon(I,"x")},className:"btn remove-btn",onClick:S})]})},xxe=P.memo(Cxe);function D2(e){Db({className:"create-query-dialog"},GE,{queryId:e})}const JE=e=>{var w,S;const{dailyNotesState:{app:t,verifyState:n},locationState:{query:r}}=P.useContext(Lt),a=ne.useRef(null),[o,i]=ne.useState(!1),l=ne.useRef(null),[c,f]=ne.useState(""),h=Mb(a.current,l.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]});P.useEffect(()=>{o&&h.update&&(h==null||h.update())},[o]),P.useEffect(()=>{a&&x.setIcon(a.current,"filter")},[a]);const g=async()=>{var M;const D=!x.Platform.isDesktop&&await((M=window.Capacitor)==null?void 0:M.Plugins.Device.getId()),I=x.Platform.isDesktop?await cr():D.identifier||D.uuid;return!n||(n==null?void 0:n.appId)!==I?(fn(),!1):!0};return Hv(l,()=>{i(!1),c&&at.getState().query.filter===c&&at.setMemoFilter("")}),v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"thino-inline-filter-wrapper pro",ref:a,onClick:async()=>{await g()&&(x.Platform.isDesktop?(i(!o),await(h==null?void 0:h.update())):new Mxe(ft.getState().app,r.filter,I=>{f(I)}).open())}}),v.jsx("div",{ref:l,className:`thino-inline-filter-container ${o?"":"hidden"}`,style:h.styles.popper,children:o&&v.jsx(GE,{type:"inline",queryId:(w=r.filter)!=null&&w.startsWith("Filter [Temp] ")&&!((S=r.filter)!=null&&S.includes("Filter [Temp]"))?"":r.filter,destroy:()=>{i(!1)},setPreview:D=>{f(D)}})})]})};class Mxe extends x.Modal{constructor(n,r,a){super(n);Se(this,"root");Se(this,"setPreview");this.filter=r,this.setPreview=a}onOpen(){var r,a;const{contentEl:n}=this;this.root=Rv(n),this.root.render(v.jsx(is,{store:Le,context:Lt,children:v.jsx("div",{className:"thino-inline-filter-container",children:v.jsx(GE,{type:"modal",queryId:(r=this.filter)!=null&&r.startsWith("Filter [Temp] ")&&!((a=this.filter)!=null&&a.includes("Filter [Temp]"))?"":this.filter,destroy:()=>{this.close()},setPreview:o=>{this.setPreview(o)}})})}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const HO=()=>{const{dailyNotesState:{app:e},globalState:{isMobileView:t,showSiderbarInMobileView:n}}=P.useContext(Lt),[r]=P.useState(ne.createRef());P.useEffect(()=>{if(!r.current)return;const o=r.current;x.setIcon(o,"refresh-cw")},[r.current]);const a=P.useCallback(async()=>{if(!(t&&n)){if(cf){const o=S2(e);await cf(o)}await we.fetchAllMemos()}},[]);return v.jsx("span",{className:"refresh-icon",ref:r,onClick:()=>{a(),r&&r.current.firstElementChild.toggleClass("rotate-hidden",!0),setTimeout(()=>{r&&r.current.firstElementChild.toggleClass("rotate-hidden",!1)},1e3)}})},Iw=()=>{const{locationState:{query:{filter:e}},globalState:{isMobileView:t},queryState:{queries:n}}=P.useContext(Lt),[r,a]=P.useState("THINO");P.useEffect(()=>{const i=on.getQueryById(e);a(i?i.title:"THINO")},[e,n]);const o=P.useCallback(i=>{i.stopPropagation(),dt.setShowSiderbarInMobileView(!0)},[]);return v.jsxs("div",{className:"section-header-container memos-header-container",children:[v.jsxs("div",{className:"title-text",children:[v.jsx(ts,{when:t,children:v.jsx("button",{ref:i=>{i&&x.setIcon(i,"menu")},className:"btn action-btn clickable-icon",onClick:o})}),v.jsx("span",{className:"normal-text",children:r}),v.jsx(HO,{})]}),v.jsxs("div",{className:"memos-header-search-section",children:[v.jsx(SY,{}),v.jsx(bY,{}),v.jsx(JE,{}),v.jsx(_v,{})]})]})},kxe=()=>{const{dailyNotesState:{settings:e,plugin:t,app:n,verifyState:r},globalState:{manifest:a,showSiderbarInMobileView:o,isMobileView:i}}=P.useContext(Lt),[l,c]=P.useState("Memos");P.useState(!1);const[f,h]=P.useState("");P.useEffect(()=>{if(!(e!=null&&e.MomentsIcon)||!n)return;const k=n.vault.adapter.getResourcePath(x.normalizePath(e.MomentsIcon));k&&!(e!=null&&e.MomentsIcon.startsWith("http"))?h(k):h(e==null?void 0:e.MomentsIcon)},[e==null?void 0:e.MomentsIcon,n]),P.useEffect(()=>{e&&c(e.UserName)},[e]);const g=P.useCallback(()=>{at.pushHistory("/"),at.clearQuery()},[]),y=()=>{n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},w=()=>{if(e!=null&&e.needVerify){dt.setLocked(!0);return}else new x.Notice(E("You have not set a password or enable this feature yet")),n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},S=()=>{new lC(n,a.version).open()},D=()=>{dt.setShowSiderbarInMobileView(!1),t.settingTab.updateSettings("FirstLoaded",!0)},I=()=>{new QH(n,t,a.version).open()},M=P.useCallback(async k=>{const{type:B}=k;if(B.startsWith("text"))try{return`${await q2.parseHtml(k)}`}catch(L){new x.Notice(L)}},[]),N=P.useCallback(()=>{const k=document.createElement("input");document.body.appendChild(k),k.type="file",k.multiple=!1,k.accept="text/html",k.onchange=async()=>{if(!k.files||k.files.length===0)return;const B=k.files[0];await M(B),document.body.removeChild(k)},k.click()},[]),_=k=>{const B=new x.Menu;B.addItem(L=>{L.setIcon("user").setTitle(E("Settings")).onClick(y)}),e!=null&&e.needVerify&&B.addItem(L=>{L.setIcon("lock").setTitle(E("Lock")).onClick(w)}),B.addItem(L=>{L.setIcon("import").setTitle(E("Import")).onClick(N)}),B.addSeparator(),B.addItem(L=>{L.setIcon("file-text").setTitle(E("ChangeLog")).onClick(S)}),B.addItem(L=>{L.setIcon("settings").setTitle(E("Setting guide")).onClick(D)}),B.addItem(L=>{L.setIcon("alert-circle").setTitle(E("Submit issue")).onClick(I)}),B.showAtMouseEvent(k.nativeEvent)};return v.jsxs("div",{className:"user-banner-container",children:[v.jsxs("div",{className:"userinfo-header-container",children:[v.jsxs("div",{className:"userinfo-container",onClick:()=>{n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},children:[v.jsx("div",{ref:k=>{if(f){k==null||k.empty();return}f||k&&x.setIcon(k,"Memos")},className:"thino-user-icon",style:{backgroundImage:`url("${f}")`}}),v.jsxs("div",{className:"thino-user-info",children:[v.jsxs("span",{className:"username-container",children:[v.jsx("span",{"aria-label":l==="MEMO 😉"?"THINO 😉":l||"THINO",className:"username-text",onClick:g,children:l==="MEMO 😉"?"THINO 😉":l||"THINO"}),v.jsx("span",{className:`user-pro-badge ${r?"activated":""}`,onClick:()=>{n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},children:"PRO"})]}),(e==null?void 0:e.MomentsQuote)&&v.jsx("span",{className:"thino-user-quote",children:e==null?void 0:e.MomentsQuote})]})]}),v.jsxs("span",{className:"btn-group",children:[(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!i&&v.jsx(HO,{}),v.jsx("span",{ref:k=>{k&&k.hasChildNodes()||k&&x.setIcon(k,"more-horizontal")},className:"btn action-btn menu-popup-btn",onClick:_}),o&&v.jsx("span",{ref:k=>{k&&k.hasChildNodes()||k&&x.setIcon(k,"x")},className:"btn action-btn",onClick:()=>{dt.setShowSiderbarInMobileView(!1)}})]})]}),v.jsx(K2,{statusType:"banner"})]})},uN=()=>{const{queryState:{queries:e},dailyNotesState:{app:t},locationState:{query:{filter:n}}}=P.useContext(Lt),r=lm(),[a,o]=P.useState([]);return P.useEffect(()=>{const i=e.filter(l=>{var c,f;return!((c=l.id)!=null&&c.toString().startsWith("Filter [Temp]"))&&!((f=l.id)!=null&&f.toString().includes("Filter [Temp]"))}).sort((l,c)=>{if(c.pinnedAt&&!l.pinnedAt)return 1;if(l.pinnedAt&&!c.pinnedAt)return-1;const f=ut.getTimeStampByDate(l.pinnedAt||l.createdAt);return ut.getTimeStampByDate(c.pinnedAt||c.createdAt)-f});o(i)},[e]),P.useEffect(()=>{on.getMyAllQueries().catch(()=>{}).finally(()=>{r.setFinish()})},[t]),v.jsxs("div",{className:"queries-wrapper",children:[v.jsxs("span",{className:"title-text",children:[v.jsx("span",{className:"normal-text",children:E("QUERY")}),v.jsx("span",{ref:i=>{i&&x.setIcon(i,"plus")},className:"btn create-query-btn",onClick:()=>D2()})]}),v.jsx(ts,{when:r.isSucceed&&a.length===0,children:v.jsx("div",{className:"create-query-btn-container",children:v.jsx("span",{className:"btn",onClick:()=>D2(),children:E("CREATE FILTER")})})}),v.jsx("div",{className:"queries-container",children:a.map(i=>v.jsx(Nxe,{query:i,isActive:i.id===n},`${i.id}-${x.moment(i.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}`))})]})},Nxe=e=>{const{query:t,isActive:n}=e,[r,a]=Xl(!1),[o,i]=Xl(!1),l=()=>{at.setMemoFilter(n?"":t.id)},c=D=>{D.stopPropagation(),a()},f=()=>{a(!1)},h=async D=>{if(D.stopPropagation(),o)try{await on.deleteQuery(t.id)}catch(I){new x.Notice(I.message)}else i()},g=D=>{D.stopPropagation(),D2(t.id)},y=async D=>{D.stopPropagation();try{t.pinnedAt?await on.unpinQuery(t.id):await on.pinQuery(t.id),on.editQuery({...t,pinnedAt:t.pinnedAt?"":ut.getDateTimeString(Date.now())})}catch(I){console.error(I)}},w=()=>{i(!1)},S=P.useMemo(()=>v.jsxs("div",{className:"action-btns-container",children:[v.jsxs("span",{className:"btn",onClick:y,children:[v.jsx("span",{ref:D=>{D&&x.setIcon(D,t.pinnedAt?"pin-off":"pin")},className:"icon-text"}),v.jsx("span",{className:"normal-text",children:t.pinnedAt?E("UNPIN"):E("PIN")})]}),v.jsxs("span",{className:"btn",onClick:g,children:[v.jsx("span",{ref:D=>{D&&!D.hasChildNodes()&&x.setIcon(D,"edit")},className:"icon-text"}),v.jsx("span",{className:"normal-text",children:E("EDIT")})]}),v.jsxs("span",{className:`btn delete-btn ${o?"final-confirm":""}`,onClick:h,onMouseLeave:w,children:[v.jsx("span",{ref:D=>{D&&!D.hasChildNodes()&&x.setIcon(D,"trash-2")},className:"icon-text"}),v.jsx("span",{className:"normal-text",children:E(o?"CONFIRM!":"DELETE")})]})]}),[t.pinnedAt,o]);return v.jsx(v.Fragment,{children:v.jsxs("div",{className:`query-item-container ${n?"active":""}`,onClick:l,children:[v.jsxs("div",{className:"query-text-container",children:[v.jsx("span",{ref:D=>{D&&!D.hasChildNodes()&&x.setIcon(D,"filter")},className:"icon-text"}),v.jsxs("span",{className:"query-text",children:[t.title,t.pinnedAt&&" 📌"]})]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{ref:D=>{D&&!D.hasChildNodes()&&x.setIcon(D,"more-horizontal")},className:"btn action-btn toggle-btn",onClick:c}),v.jsx("div",{className:`action-btns-wrapper ${r?"":"hidden"}`,onMouseLeave:f,children:S})]})]})})},cN=()=>{var y,w;const{locationState:{query:{tag:e,filter:t}},dailyNotesState:{app:n},memoState:{tags:r,tagsNum:a,memos:o}}=P.useContext(Lt),i=t&&((y=t==null?void 0:t.toString())==null?void 0:y.startsWith("Filter [Temp] "))&&on.getQueryById(t),[l,c]=P.useState([]),[f,h]=P.useState(((w=n||app)==null?void 0:w.loadLocalStorage("thino-tag-sort-order"))||"alphabetical");P.useEffect(()=>{var D;const S=(D=n||app)==null?void 0:D.loadLocalStorage("thino-temp-tags");c(S||[])},[]),P.useEffect(()=>{we.updateTagsState()},[o]),P.useEffect(()=>{const S=Array.from(r).sort(),D={subTags:[]};for(const I of S){const M=I.split("/");let N=D,_="";for(let k=0;kR.text===_);if(L||(L={key:B,text:_,count:a[_]||0,subTags:[],parent:N},N.subTags.push(L)),k===M.length-1){let R=L.parent;for(;R;)R.count||(R.count=0),R.count+=a[_]||0,R=R.parent}N=L}}c(D.subTags)},[r]),P.useEffect(()=>{var S;we.initialized&&((S=n||app)==null||S.saveLocalStorage("thino-temp-tags",l))},[l]);const g=S=>{S.stopPropagation();const D=new x.Menu;for(const I of["alphabetical","alphabeticalReverse","byCount","byCountReverse"])D.addItem(M=>{M.setTitle(E(I)).onClick(()=>{h(I),n==null||n.saveLocalStorage("thino-tag-sort-order",I)}).setChecked(f===I)}),I==="alphabeticalReverse"&&D.addSeparator();D.showAtMouseEvent(S.nativeEvent)};return v.jsxs("div",{className:"tags-wrapper",children:[v.jsxs("div",{className:"tags-header title-text",children:[v.jsx("span",{className:"normal-text",children:E("Frequently Used Tags")}),v.jsx("span",{ref:S=>{S&&x.setIcon(S,"arrow-down-narrow-wide")},className:"tags-sort-btn",onClick:g})]}),v.jsxs("div",{className:"tags-container",children:[l.sort(Axe(f)).map((S,D)=>v.jsx(YO,{tag:S,tagQuery:e,filterQuery:i},S.text+"-"+D)),v.jsx(ts,{when:l.length<5&&we.initialized,children:v.jsxs("span",{className:"tag-tip-container",children:[E("Input")," ",v.jsxs("span",{className:"code-text",children:[E("#Tag")," "]}),E("to create tag"),"..."]})})]})]})},YO=e=>{const{tag:t,tagQuery:n,filterQuery:r}=e,a=n===t.text||r&&JSON.parse(r.querystring).find(h=>h.type==="TAG"&&h.value.value===t.text),o=t.subTags.length>0,[i,l]=Xl(!1),c=async h=>{var g;if(h.ctrlKey||h.metaKey){const{verifyState:y}=ft.getState(),w=!x.Platform.isDesktop&&await((g=window.Capacitor)==null?void 0:g.Plugins.Device.getId()),S=x.Platform.isDesktop?await cr():w.identifier||w.uuid;if(!(y&&(y==null?void 0:y.appId)===S)){fn();return}const I=at.getState().query.filter;if(I&&(I!=null&&I.startsWith("Filter [Temp] "))){const N=on.getQueryById(I).querystring,_=JSON.parse(N);let k;if(_.some(B=>B.type==="TAG"&&B.value.value===t.text)){if(k=_.filter(L=>L.value.value!==t.text),k.length===0){at.setMemoFilter("");return}const B=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...k[0],relation:"AND"},...k.slice(1)]));on.pushQuery(B),at.setMemoFilter(B.id)}else{k=[..._,{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"OR"}];const B=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(k));on.pushQuery(B),at.setMemoFilter(B.id)}}else if(n){at.setTagQuery("");const M=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:"TAG",value:{value:n,operator:"CONTAIN"},relation:"AND"},{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"OR"}]));on.pushQuery(M),at.setMemoFilter(M.id)}else if(!n){const M=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"AND"}]));on.pushQuery(M),at.setMemoFilter(M.id)}ut.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(at.getState().pathname)||at.setPathname("/");return}if(a){if(at.setTagQuery(""),r){const w=JSON.parse(r.querystring).filter(D=>D.value.value!==t.text);if(w.length===0){at.setMemoFilter("");return}const S=on.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...w[0],relation:"AND"},...w.slice(1)]));on.pushQuery(S),at.setMemoFilter(S.id)}}else await ut.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(at.getState().pathname)||at.setPathname("/"),at.setTagQuery(t.text)},f=h=>{h.stopPropagation(),l()};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:`tag-item-container ${a?"active":""}`,onClick:c,children:[v.jsxs("div",{className:"tag-text-container",children:[v.jsx("span",{ref:h=>{h&&x.setIcon(h,"hash")},className:"btn tag-btn"}),v.jsx("span",{className:"tag-text",children:t.key})]}),v.jsxs("div",{className:"btns-container",children:[v.jsx("span",{className:"tag-count",children:t.count}),o?v.jsx("span",{ref:h=>{h&&x.setIcon(h,"chevron-right")},className:`btn action-btn toggle-btn ${i?"shown":""}`,onClick:f}):null]})]}),o?v.jsx("div",{className:`subtags-container ${i?"":"hidden"}`,children:t.subTags.map((h,g)=>v.jsx(YO,{tag:h,tagQuery:n},h.text+"-"+g))}):null]})},dN=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare,eT={alphabetical:(e,t)=>dN(e.text,t.text),alphabeticalReverse:(e,t)=>-dN(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},Axe=(e="byCount")=>eT.hasOwnProperty(e)?eT[e]:eT.alphabetical,fN=()=>{const{dailyNotesState:{app:e,settings:t,verifyState:n}}=P.useContext(Lt),r=[{name:E("Random Review"),path:"/review",iconID:"star"},{name:E("ARCHIVE"),path:"/archive",iconID:"archive"},{name:E("Recycle bin"),path:"/recycle",iconID:"recycle"}],a=P.useRef([]);return P.useEffect(()=>{a.current.forEach((o,i)=>{o&&x.setIcon(o,r[i].iconID)})},[t,a]),v.jsx(v.Fragment,{children:v.jsx("div",{className:"path-entry-wrapper",children:r.map((o,i)=>v.jsx(v.Fragment,{children:v.jsxs("div",{className:`path-entry-container ${at.getState().pathname===o.path?"active":""} ${t.DeleteThinoDirectly&&o.path==="/recycle"?"hidden":""} ${o.path==="/review"&&"pro"}`,onClick:async()=>{var f;const l=!x.Platform.isDesktop&&await((f=window.Capacitor)==null?void 0:f.Plugins.Device.getId()),c=x.Platform.isDesktop?await cr():l.identifier||l.uuid;if(!n&&(n==null?void 0:n.appId)!==c&&o.path==="/review"){fn();return}if(at.setPathname(o.path),o.path==="/review"&&at.getState().pathname==="/review"){e.workspace.trigger("refresh-review-memos");return}at.clearQuery()},children:[v.jsx("span",{ref:l=>a.current[i]=l,className:"path-entry-icon"}),v.jsx("span",{className:"path-entry-text",children:o.name})]},i)}))})})},hN=e=>{const{dailyNotesState:{settings:t},locationState:n,globalState:{isMobileView:r,showSiderbarInMobileView:a}}=P.useContext(Lt),o=P.useRef(null),i=P.useMemo(()=>l=>{var f,h,g;const c=dt.getState().showSiderbarInMobileView;if(!c){window.removeEventListener("click",i,{capture:!0});return}(f=o.current)!=null&&f.contains(l.target)||(g=(h=o.current)==null?void 0:h.parentNode)!=null&&g.contains(l.target)&&(c&&l.stopPropagation(),dt.setShowSiderbarInMobileView(!1),window.removeEventListener("click",i,{capture:!0}))},[]);return P.useEffect(()=>{dt.setShowSiderbarInMobileView(!1)},[n]),P.useEffect(()=>{a?document.body.classList.add(FC):document.body.classList.remove(FC)},[a]),P.useEffect(()=>{r&&a&&window.addEventListener("click",i,{capture:!0})},[r,a]),v.jsxs("aside",{className:ar("memos-sidebar-wrapper",e.className),ref:o,children:[e.children,v.jsx(kxe,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?v.jsx(av,{}):null:v.jsx(av,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="left"?v.jsxs(v.Fragment,{children:[v.jsx(fN,{}),v.jsx(uN,{}),v.jsx(K2,{statusType:"sidebar"})]}):null:v.jsxs(v.Fragment,{children:[v.jsx(fN,{}),v.jsx(uN,{})]}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?v.jsx(v.Fragment,{children:v.jsx(cN,{})}):null:v.jsx(v.Fragment,{children:v.jsx(cN,{})})]})},Fxe=()=>{const{dailyNotesState:{settings:e}}=P.useContext(Lt),[t,n]=ne.useState(""),r=a=>{n(a.target.value)};return v.jsx("div",{className:"locked-screen-wrapper",children:v.jsxs("div",{className:"locked-screen-content",children:[v.jsx("div",{className:"locked-screen-header",children:v.jsx("div",{className:"locked-screen-header-title",children:E("Locked")})}),v.jsx("div",{className:"locked-screen-body",children:v.jsxs("div",{className:"locked-screen-body-content",children:[v.jsxs("div",{className:"locked-screen-body-content-text",children:[v.jsx("div",{className:"locked-screen-body-content-text-title",children:E("Thino is locked")}),v.jsx("div",{className:"locked-screen-body-content-text-desc",children:E("Please unlock Thino by input password")})]}),v.jsxs("div",{className:"locked-screen-body-content-inputer",children:[v.jsx("input",{onKeyDown:a=>{a.key==="Enter"&&((e==null?void 0:e.password)===t?dt.setLocked(!1):new x.Notice(E("Password is incorrect")))},onChange:r,value:t,type:"password",className:"locked-screen-body-content-input"}),v.jsx("button",{className:"locked-screen-body-content-btn",onClick:()=>{(e==null?void 0:e.password)===t?dt.setLocked(!1):new x.Notice(E("Password is incorrect"))},children:E("Unlock")})]})]})})]})})};class sf extends e9{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a.path);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const r=app.vault.getFiles().filter(o=>["png","jpg","jpeg","gif"].includes(o.extension)),a=t.toLowerCase();return this.fuzzySearchItemsOptimized(a,r).map(o=>o.item)}renderSuggestion(t,n){var o;const r=t.basename,a=((o=t.parent)==null?void 0:o.path)||"";n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:r}),n.createSpan({cls:"suggestion-path",text:a})}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}}const Oxe=e=>{const{dailyNotesState:{settings:t,app:n,plugin:r},globalState:{manifest:a}}=P.useContext(Lt),[o,i]=ne.useState(0),[l,c]=ne.useState(""),f=ne.useRef(null),h=ne.useRef(null),[g,y]=ne.useState({enabled:!1,path:"",format:""});P.useEffect(()=>{if(o===2&&(t!=null&&t.EnabledLocationList.find(I=>I.value==="DAILY")))if(!Kg())y({enabled:!1,path:"",format:""});else{const I=Jc().folder,M=Jc().format;y({enabled:!0,path:I,format:M})}},[o]),P.useEffect(()=>{if(!(t!=null&&t.MomentsIcon)||!n){c("");return}const I=n.vault.adapter.getResourcePath(x.normalizePath(t.MomentsIcon));I&&!(t!=null&&t.MomentsIcon.startsWith("http"))?c(I):c(t==null?void 0:t.MomentsIcon)},[t==null?void 0:t.MomentsIcon,n]),P.useEffect(()=>{h&&(h.current=null)},[o]),P.useEffect(()=>{f.current&&(h.current||(h.current=new sf(f.current)))},[f.current]);const w=(I,M)=>{let N=r;N||(N=n.plugins.getPlugin("obsidian-memos")),N.settingTab.updateSettings(I,M)},S=P.useMemo(()=>{switch(o){case 0:return v.jsxs(v.Fragment,{children:[v.jsx("h1",{children:E("Get started with Thino")}),v.jsx("p",{children:E("Set up your user info for Thino.")})]});case 1:return v.jsxs(v.Fragment,{children:[v.jsx("h1",{children:E("Set theme for Thino")}),v.jsx("p",{children:E("Choose a theme for Thino.")})]});case 2:return v.jsxs(v.Fragment,{children:[v.jsx("h1",{children:E("Go with daily note plugin")}),v.jsx("p",{children:E("If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.")})]});case 3:return v.jsxs(v.Fragment,{children:[v.jsx("h1",{children:E("Set preferences for using Thino")}),v.jsx("p",{children:E("Adjust settings that influence your user experience with Thino.")})]});case 4:return v.jsxs(v.Fragment,{children:[v.jsx("h1",{children:E("Congrats! All settings done")}),v.jsx("p",{children:E("Go and enjoy Thino")})]})}},[o]),D=()=>{switch(o){case 0:return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"thino-user-preview-wrapper",children:v.jsxs("div",{className:"userinfo-container",onClick:()=>{n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},children:[v.jsx("div",{ref:I=>{if(t!=null&&t.MomentsIcon){I==null||I.empty();return}t!=null&&t.MomentsIcon||I&&x.setIcon(I,"Memos")},className:"thino-user-icon",style:{backgroundImage:`url("${l}")`}}),v.jsxs("div",{className:"thino-user-info",children:[v.jsx("span",{className:"username-container",children:v.jsx("span",{"aria-label":(t==null?void 0:t.UserName)==="MEMO 😉"?"THINO 😉":(t==null?void 0:t.UserName)||"THINO",className:"username-text",children:(t==null?void 0:t.UserName)==="MEMO 😉"?"THINO 😉":(t==null?void 0:t.UserName)||"THINO"})}),(t==null?void 0:t.MomentsQuote)&&v.jsx("span",{className:"thino-user-quote",children:t==null?void 0:t.MomentsQuote})]})]})}),v.jsxs("div",{className:"thino-user-info-wrapper",children:[v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("User name")}),v.jsx("div",{className:"setting-item-description",children:E("Set your user name here. 'Memos 😏' By default")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"Thino 😏",defaultValue:t==null?void 0:t.UserName,onInput:I=>w("UserName",I.currentTarget.value)})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("User quote")}),v.jsx("div",{className:"setting-item-description",children:E("Set user quote for thino")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"Share thino with the world",defaultValue:t==null?void 0:t.MomentsQuote,onInput:I=>w("MomentsQuote",I.currentTarget.value)})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("User icon")}),v.jsx("div",{className:"setting-item-description",children:E("Set user icon for thino. You can input http/https link or file path in vault.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",ref:f,placeholder:"Input url or file path",defaultValue:t==null?void 0:t.MomentsIcon,onInput:I=>w("MomentsIcon",I.currentTarget.value)})})]})]})]});case 1:return v.jsx(v.Fragment,{children:v.jsxs("div",{className:ar("theme-selector-group","selected"),children:[v.jsxs("div",{className:ar("theme-selector",(t==null?void 0:t.DefaultThemeForThino)==="modern"?"selected":""),onClick:()=>w("DefaultThemeForThino","modern"),children:[v.jsxs("div",{className:"theme-selector-header-component",children:[v.jsx("div",{className:"theme-selector-header",children:E("Modern")}),v.jsx("div",{className:"theme-selector-description",children:E("A modern theme for Thino with a three-column layout and some unique features.")})]}),v.jsxs("div",{className:"theme-selector-content",children:[v.jsx("div",{className:"left-column column-component"}),v.jsx("div",{className:"center-column column-component"}),v.jsx("div",{className:"right-column column-component"})]}),v.jsx("div",{className:"theme-selector-footer",children:v.jsx("button",{className:"mod-cta",disabled:(t==null?void 0:t.DefaultThemeForThino)==="modern",onClick:()=>w("DefaultThemeForThino","modern"),children:(t==null?void 0:t.DefaultThemeForThino)==="modern"?E("Selected"):E("Select")})})]}),v.jsxs("div",{className:ar("theme-selector",(t==null?void 0:t.DefaultThemeForThino)==="classic"?"selected":""),onClick:()=>w("DefaultThemeForThino","classic"),children:[v.jsxs("div",{className:"theme-selector-header-component",children:[v.jsx("div",{className:"theme-selector-header",children:E("Classic")}),v.jsx("div",{className:"theme-selector-description",children:E("A classic theme for Thino with a two-column layout")})]}),v.jsxs("div",{className:"theme-selector-content",children:[v.jsx("div",{className:"left-column column-component"}),v.jsx("div",{className:"center-column column-component"})]}),v.jsx("div",{className:"theme-selector-footer",children:v.jsx("button",{className:"mod-cta",disabled:(t==null?void 0:t.DefaultThemeForThino)==="classic",onClick:()=>w("DefaultThemeForThino","classic"),children:(t==null?void 0:t.DefaultThemeForThino)==="classic"?E("Selected"):E("Select")})})]})]})});case 2:return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"daily-note-plugin-status",children:[v.jsxs("div",{className:"daily-note-plugin-status-header",children:[v.jsx("div",{className:"plugin-status-header",children:E("Daily note plugin")}),v.jsx("div",{className:"plugin-status-description",children:E("Enable daily note plugin")})]}),v.jsx("div",{className:"daily-note-plugin-status-content",children:g.enabled&&v.jsx(v.Fragment,{children:v.jsxs("div",{className:"daily-note-format",children:[v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Daily note name format")}),v.jsx("div",{className:"setting-item-description",children:E("Set daily note name format")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"YYYY-MM-DD",defaultValue:g.format,onInput:I=>{y({...g,format:I.currentTarget.value.trim()});try{const M=n.internalPlugins.getPluginById("daily-notes");M.instance.options={...M.instance.options,format:I.currentTarget.value.trim()},M.saveData({...M.instance.options,format:I.currentTarget.value.trim()})}catch(M){console.error(M)}}})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Daily notes folder")}),v.jsx("div",{className:"setting-item-description",children:E("Set daily notes folder")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"YYYY-MM-DD",defaultValue:g.path,onInput:I=>{y({...g,path:I.currentTarget.value.trim()});try{const M=n.internalPlugins.getPluginById("daily-notes");M.instance.options={...M.instance.options,folder:I.currentTarget.value.trim()},M.saveData({...M.instance.options,folder:I.currentTarget.value.trim()})}catch(M){console.error(M)}}})})]})]})})}),v.jsxs("div",{className:"daily-note-plugin-status-footer",children:[!g.enabled&&v.jsx("div",{className:"notice-click",children:E("Click to enable =>")}),v.jsx("button",{className:"mod-cta",disabled:g.enabled,onClick:()=>{if(!g.enabled){n.internalPlugins.getPluginById("daily-notes").enable();const I=Jc().folder,M=Jc().format;y({enabled:!0,format:M,path:I})}},children:g.enabled?E("Enabled"):E("Enable")})]})]}),v.jsxs("div",{className:"thino-daily-settings-wrapper",children:[v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Default time prefix")}),v.jsx("div",{className:"setting-item-description",children:E("Set default time prefix for thino in daily notes.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:t==null?void 0:t.DefaultTimePrefix,onChange:I=>w("DefaultTimePrefix",I.currentTarget.value),children:[v.jsx("option",{value:"HH:mm",children:"HH:mm"}),v.jsx("option",{value:"HH:mm:ss",children:"HH:mm:ss"})]})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Set thino insert place")}),v.jsx("div",{className:"setting-item-description",children:E("Set where to insert thino content")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:t==null?void 0:t.InsertType,onChange:I=>w("InsertType",I.currentTarget.value),children:[v.jsx("option",{value:"end",children:E("End of the diary")}),v.jsx("option",{value:"custom",children:E("Custom location")})]})})]}),(t==null?void 0:t.InsertType)==="custom"&&v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Insert after heading")}),v.jsx("div",{className:"setting-item-description",children:E("If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"# Heading",defaultValue:t==null?void 0:t.InsertAfter,onInput:I=>w("InsertAfter",I.currentTarget.value)})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Set process target")}),v.jsx("div",{className:"setting-item-description",children:E("You can set whole diary or only part of it")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:t==null?void 0:t.ProcessContentTarget,onChange:I=>w("ProcessContentTarget",I.currentTarget.value),children:[v.jsx("option",{value:"custom",children:E("Custom")}),v.jsx("option",{value:"whole",children:E("Whole diary")})]})})]}),(t==null?void 0:t.ProcessContentTarget)==="custom"&&v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Process Memos below")}),v.jsx("div",{className:"setting-item-description",children:E("If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsx("input",{type:"text",placeholder:"# Heading",defaultValue:t==null?void 0:t.ProcessEntriesBelow,onInput:I=>w("ProcessEntriesBelow",I.currentTarget.value)})})]})]})]});case 3:return v.jsx(v.Fragment,{children:v.jsxs("div",{className:"thino-custom-settings-wrapper",children:[v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Default prefix when save thino")}),v.jsx("div",{className:"setting-item-description",children:E("Set the default prefix when create memo, 'List' by default.")})]}),v.jsx("div",{className:"setting-item-control",children:v.jsxs("select",{className:"dropdown",defaultValue:t==null?void 0:t.DefaultPrefix,onChange:I=>w("DefaultPrefix",I.currentTarget.value),children:[v.jsx("option",{value:"List",children:E("List")}),v.jsx("option",{value:"Task",children:E("Task")})]})})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Use Tags In Vault")}),v.jsx("div",{className:"setting-item-description",children:E("Use tags in vault rather than only in Memos. False by default.")})]}),v.jsx("div",{className:"setting-item-control",ref:I=>{I&&(I.hasChildNodes()||new x.ToggleComponent(I).setValue((t==null?void 0:t.UseVaultTags)===void 0?!1:t==null?void 0:t.UseVaultTags).onChange(M=>{w("UseVaultTags",M)}))}})]}),v.jsxs("div",{className:"setting-item",children:[v.jsxs("div",{className:"setting-item-info",children:[v.jsx("div",{className:"setting-item-name",children:E("Delete Thino Directly")}),v.jsx("div",{className:"setting-item-description",children:E("When delete thino directly, it will not be moved to trash. False by default.")})]}),v.jsx("div",{className:"setting-item-control",ref:I=>{I&&(I.hasChildNodes()||new x.ToggleComponent(I).setValue((t==null?void 0:t.DeleteThinoDirectly)===void 0?!1:t==null?void 0:t.DeleteThinoDirectly).onChange(M=>{w("DeleteThinoDirectly",M)}))}})]})]})});case 4:return v.jsx(v.Fragment,{children:v.jsxs("div",{className:"thino-congrats",children:[v.jsxs("div",{className:"final-congrats-text",children:[v.jsx("p",{className:"ready-use",children:E("Thino is ready to use. ")}),v.jsx("p",{className:"start-to-use",children:E("You can start using Thino now. If you want to know more about Thino Pro, click the button below.")})]}),v.jsxs("div",{className:"next-btns-group",children:[v.jsx("button",{onClick:()=>{const I=localStorage.getItem("language");I&&(I==="zh"||I==="zh-TW")?window.open("https://pkmer.cn/products/thino","_blank"):window.open("https://thino.pkmer.net/en/#price","_blank")},children:E("About Thino Pro")}),v.jsx("button",{className:"mod-cta",onClick:()=>{w("FirstLoaded",!1),dt.getState().isMobileView?(setTimeout(()=>{dt.setShowSiderbarInMobileView(!0)},500),setTimeout(()=>{dt.setExitSteps(!0)},1e3)):setTimeout(()=>{dt.setExitSteps(!0)},800)},children:E("Start Thino")})]})]})})}};return v.jsx(v.Fragment,{children:v.jsx("div",{className:"onboarding-view-container",children:v.jsx("div",{className:"onboarding-view-wrapper",children:v.jsxs("div",{"data-onboarding-step":o,className:"onboarding-view-content",children:[v.jsxs("div",{className:"onboarding-step-count",children:[o+1,"/5"]}),v.jsxs("div",{className:"onboarding-view-details",children:[v.jsxs("div",{className:"details-content",children:[v.jsx("div",{className:"onboarding-header-group",children:S}),v.jsx(v.Fragment,{children:v.jsx("div",{className:"onboarding-form",children:D()})})]}),v.jsxs("div",{className:"details-footer",children:[v.jsx("div",{className:"skip-btn",children:o!==4&&v.jsx("button",{onClick:()=>{w("FirstLoaded",!1)},children:E("Skip and start Thino")})}),v.jsxs("div",{className:"navigate-btns-group",children:[o!==0&&v.jsx("button",{onClick:()=>i(o-1),children:E("Back to previous step")}),o!==4&&v.jsx("button",{className:"mod-cta",onClick:()=>i(o+1),children:E("Next step")}),o===4&&v.jsx("button",{className:"details-settings-btn",onClick:()=>{n.setting.open(),n.setting.openTabById(a.id||"obsidian-memos")},children:E("Details settings")})]})]})]})]})})})})};function sb(e){return sb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sb(e)}function Wn(e,t,n,r){return new(n||(n=Promise))(function(a,o){function i(f){try{c(r.next(f))}catch(h){o(h)}}function l(f){try{c(r.throw(f))}catch(h){o(h)}}function c(f){var h;f.done?a(f.value):(h=f.value,h instanceof n?h:new n(function(g){g(h)})).then(i,l)}c((r=r.apply(e,t||[])).next())})}function $n(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&h[0]?r.return:h[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,h[1])).done)return a;switch(r=0,a&&(h=[2&h[0],a.value]),h[0]){case 0:case 1:a=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,r=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(a=i.trys,!((a=a.length>0&&a[a.length-1])||h[0]!==6&&h[0]!==2)){i=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]=0&&c.left>=0&&c.bottom+80<=window.innerHeight&&c.right<=window.innerWidth}(r))){var i=QE().height;o.bottom-(o.bottom-o.top)<0||r.clientHeight>i?window.scrollBy(0,o.top-(i/2-o.height/2)-n):window.scrollBy(0,o.top-(i/2-o.height/2)+n)}}function qg(e){e.setAttribute("role","button"),e.tabIndex=0}function I1(e){var t=e.parentElement;return!(!t||t.nodeName==="HTML")&&(KE(e,"position")==="fixed"||I1(t))}function Op(e,t){var n=document.body,r=document.documentElement,a=window.pageYOffset||r.scrollTop||n.scrollTop,o=window.pageXOffset||r.scrollLeft||n.scrollLeft;t=t||n;var i=e.getBoundingClientRect(),l=t.getBoundingClientRect(),c=KE(t,"position"),f={width:i.width,height:i.height};return t.tagName.toLowerCase()!=="body"&&c==="relative"||c==="sticky"?Object.assign(f,{top:i.top-l.top,left:i.left-l.left}):I1(e)?Object.assign(f,{top:i.top,left:i.left}):Object.assign(f,{top:i.top+a,left:i.left+o})}function XE(e,t){if(e instanceof SVGElement){var n=e.getAttribute("class")||"";e.setAttribute("class",n.replace(t,"").replace(/^\s+|\s+$/g,""))}else e.className=e.className.replace(t,"").replace(/^\s+|\s+$/g,"")}function rd(e,t){var n="";if(e.style.cssText&&(n+=e.style.cssText),typeof t=="string")n+=t;else for(var r in t)n+="".concat(r,":").concat(t[r],";");e.style.cssText=n}function Hu(e,t,n){if(n&&t){var r=Op(t.element,e._targetElement),a=e._options.helperElementPadding;t.element instanceof Element&&I1(t.element)?ql(n,"introjs-fixedTooltip"):XE(n,"introjs-fixedTooltip"),t.position==="floating"&&(a=0),rd(n,{width:"".concat(r.width+a,"px"),height:"".concat(r.height+a,"px"),top:"".concat(r.top-a/2,"px"),left:"".concat(r.left-a/2,"px")})}}function G0(e,t,n,r,a){return e.left+t+n.width>r.width?(a.style.left="".concat(r.width-n.width-e.left,"px"),!1):(a.style.left="".concat(t,"px"),!0)}function J0(e,t,n,r){return e.left+e.width-t-n.width<0?(r.style.left="".concat(-e.left,"px"),!1):(r.style.right="".concat(t,"px"),!0)}function Pl(e,t){e.includes(t)&&e.splice(e.indexOf(t),1)}function jxe(e,t,n,r){var a=e.slice(),o=QE(),i=Op(n).height+10,l=Op(n).width+20,c=t.getBoundingClientRect(),f="floating";if(c.bottom+i>o.height&&Pl(a,"bottom"),c.top-i<0&&Pl(a,"top"),c.right+l>o.width&&Pl(a,"right"),c.left-l<0&&Pl(a,"left"),r&&(r=r.split("-")[0]),a.length&&(f=a[0],a.includes(r)&&(f=r)),f==="top"||f==="bottom"){var h=void 0,g=[];f==="top"?(h="top-middle-aligned",g=["top-left-aligned","top-middle-aligned","top-right-aligned"]):(h="bottom-middle-aligned",g=["bottom-left-aligned","bottom-middle-aligned","bottom-right-aligned"]),f=function(y,w,S,D){var I=w/2,M=Math.min(S,window.screen.width);return M-yl.height?(r.className="introjs-arrow left-bottom",n.style.top="-".concat(o.height-i.height-20,"px")):r.className="introjs-arrow left";break;case"left":a||e._options.showStepNumbers!==!0||(n.style.top="15px"),i.top+o.height>l.height?(n.style.top="-".concat(o.height-i.height-20,"px"),r.className="introjs-arrow right-bottom"):r.className="introjs-arrow right",n.style.right="".concat(i.width+20,"px");break;case"floating":r.style.display="none",n.style.left="50%",n.style.top="50%",n.style.marginLeft="-".concat(o.width/2,"px"),n.style.marginTop="-".concat(o.height/2,"px");break;case"bottom-right-aligned":r.className="introjs-arrow top-right",J0(i,g=0,o,n),n.style.top="".concat(i.height+20,"px");break;case"bottom-middle-aligned":r.className="introjs-arrow top-middle",a&&(h+=5),J0(i,h,o,n)&&(n.style.right="",G0(i,h,o,l,n)),n.style.top="".concat(i.height+20,"px");break;default:r.className="introjs-arrow top",G0(i,0,o,l,n),n.style.top="".concat(i.height+20,"px")}}}function zO(){for(var e=0,t=Array.from(document.querySelectorAll(".introjs-showElement"));e a.active"),$=le.querySelector('.introjs-bullets li > a[data-step-number="'.concat(se.step,'"]'));fe&&$&&(fe.className="",$.className="active")}}(e._options.showBullets,r,t),$O(r,e._currentStep,e._introItems.length),y.style.opacity="1",(o!=null&&/introjs-donebutton/gi.test(o.className)||o!=null)&&o.focus(),gN(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,f)},350)):(w=xn("div",{className:a}),S=xn("div",{className:"introjs-tooltipReferenceLayer"}),D=xn("div",{className:"introjs-arrow"}),I=xn("div",{className:"introjs-tooltip"}),M=xn("div",{className:"introjs-tooltiptext"}),N=xn("div",{className:"introjs-tooltip-header"}),_=xn("h1",{className:"introjs-tooltip-title"}),k=xn("div"),rd(w,{"box-shadow":"0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, ".concat(e._options.overlayOpacity.toString(),") 0 0 0 5000px")}),mN(e._options.scrollToElement,t.element),Hu(e,t,w),Hu(e,t,S),vN(e._targetElement,w,!0),vN(e._targetElement,S),M.innerHTML=t.intro,_.innerHTML=t.title,k.className="introjs-tooltipbuttons",e._options.showButtons===!1&&(k.style.display="none"),N.appendChild(_),I.appendChild(N),I.appendChild(M),e._options.dontShowAgain&&(B=xn("div",{className:"introjs-dontShowAgain"}),(L=xn("input",{type:"checkbox",id:"introjs-dontShowAgain",name:"introjs-dontShowAgain"})).onchange=function(G){e.setDontShowAgain(G.target.checked)},(R=xn("label",{htmlFor:"introjs-dontShowAgain"})).innerText=e._options.dontShowAgainLabel,B.appendChild(L),B.appendChild(R),I.appendChild(B)),I.appendChild(WO(e,t)),I.appendChild(function(G){var le=xn("div");le.className="introjs-progress",G._options.showProgress===!1&&(le.style.display="none");var se=xn("div",{className:"introjs-progressbar"});G._options.progressBarAdditionalClass&&(se.className+=" "+G._options.progressBarAdditionalClass);var fe=VO(G._currentStep,G._introItems.length);return se.setAttribute("role","progress"),se.setAttribute("aria-valuemin","0"),se.setAttribute("aria-valuemax","100"),se.setAttribute("aria-valuenow",fe.toString()),se.style.cssText="width:".concat(fe,"%;"),le.appendChild(se),le}(e)),V=xn("div"),e._options.showStepNumbers===!0&&(V.className="introjs-helperNumberLayer",V.innerHTML="".concat(t.step," ").concat(e._options.stepNumbersOfLabel," ").concat(e._introItems.length),I.appendChild(V)),I.appendChild(D),S.appendChild(I),(o=xn("a")).onclick=function(){return Wn(Z,void 0,void 0,function(){return $n(this,function(G){switch(G.label){case 0:return e._introItems.length-1===e._currentStep?[3,2]:[4,kf(e)];case 1:return G.sent(),[3,6];case 2:return/introjs-donebutton/gi.test(o.className)?lr(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,"done")]:[3,4]:[3,6];case 3:G.sent(),G.label=4;case 4:return[4,Nf(e,e._targetElement)];case 5:G.sent(),G.label=6;case 6:return[2]}})})},qg(o),o.innerHTML=e._options.nextLabel,(i=xn("a")).onclick=function(){return Wn(Z,void 0,void 0,function(){return $n(this,function(G){switch(G.label){case 0:return e._currentStep>0?[4,ub(e)]:[3,2];case 1:G.sent(),G.label=2;case 2:return[2]}})})},qg(i),i.innerHTML=e._options.prevLabel,qg(l=xn("a",{className:"introjs-skipbutton"})),l.innerHTML=e._options.skipLabel,l.onclick=function(){return Wn(Z,void 0,void 0,function(){return $n(this,function(G){switch(G.label){case 0:return e._introItems.length-1===e._currentStep&&lr(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,"skip")]:[3,2];case 1:G.sent(),G.label=2;case 2:return lr(e._introSkipCallback)?[4,e._introSkipCallback.call(e,e._currentStep)]:[3,4];case 3:G.sent(),G.label=4;case 4:return[4,Nf(e,e._targetElement)];case 5:return G.sent(),[2]}})})},N.appendChild(l),e._introItems.length>1&&k.appendChild(i),k.appendChild(o),I.appendChild(k),lb(e,t,I,D),gN(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,I)),(Y=e._targetElement.querySelector(".introjs-disableInteraction"))&&Y.parentNode&&Y.parentNode.removeChild(Y),t.disableInteraction&&function(G,le){var se=document.querySelector(".introjs-disableInteraction");se===null&&(se=xn("div",{className:"introjs-disableInteraction"}),G._targetElement.appendChild(se)),Hu(G,le,se)}(e,t),e._currentStep===0&&e._introItems.length>1?(o!=null&&(o.className="".concat(e._options.buttonClass," introjs-nextbutton"),o.innerHTML=e._options.nextLabel),e._options.hidePrev===!0?(i!=null&&(i.className="".concat(e._options.buttonClass," introjs-prevbutton introjs-hidden")),o!=null&&ql(o,"introjs-fullbutton")):i!=null&&(i.className="".concat(e._options.buttonClass," introjs-prevbutton introjs-disabled"))):e._introItems.length-1===e._currentStep||e._introItems.length===1?(i!=null&&(i.className="".concat(e._options.buttonClass," introjs-prevbutton")),e._options.hideNext===!0?(o!=null&&(o.className="".concat(e._options.buttonClass," introjs-nextbutton introjs-hidden")),i!=null&&ql(i,"introjs-fullbutton")):o!=null&&(e._options.nextToDone===!0?(o.innerHTML=e._options.doneLabel,ql(o,"".concat(e._options.buttonClass," introjs-nextbutton introjs-donebutton"))):o.className="".concat(e._options.buttonClass," introjs-nextbutton introjs-disabled"))):(i!=null&&(i.className="".concat(e._options.buttonClass," introjs-prevbutton")),o!=null&&(o.className="".concat(e._options.buttonClass," introjs-nextbutton"),o.innerHTML=e._options.nextLabel)),i!=null&&i.setAttribute("role","button"),o!=null&&o.setAttribute("role","button"),l!=null&&l.setAttribute("role","button"),o!=null&&o.focus(),function(G){ql(G,"introjs-showElement");var le=KE(G,"position");le!=="absolute"&&le!=="relative"&&le!=="sticky"&&le!=="fixed"&&ql(G,"introjs-relativePosition")}(t.element),lr(e._introAfterChangeCallback)?[4,e._introAfterChangeCallback.call(e,t.element)]:[3,4];case 3:Q.sent(),Q.label=4;case 4:return[2]}})})}function Lxe(e,t){return Wn(this,void 0,void 0,function(){return $n(this,function(n){switch(n.label){case 0:return e._currentStep=t-2,e._introItems===void 0?[3,2]:[4,kf(e)];case 1:n.sent(),n.label=2;case 2:return[2]}})})}function Rxe(e,t){return Wn(this,void 0,void 0,function(){return $n(this,function(n){switch(n.label){case 0:return e._currentStepNumber=t,e._introItems===void 0?[3,2]:[4,kf(e)];case 1:n.sent(),n.label=2;case 2:return[2]}})})}function kf(e){return Wn(this,void 0,void 0,function(){var t,n,r;return $n(this,function(a){switch(a.label){case 0:if(e._direction="forward",e._currentStepNumber!==void 0)for(t=0;t=0&&(e._hintsAutoRefreshFunction=(f=function(){return C1(e)},h=e._options.hintAutoRefreshInterval,function(){for(var y=[],w=0;w0)for(n=0,r=e._options.hints;n0&&(r[y-1]={step:y,element:g,title:g.getAttribute("data-title")||"",intro:g.getAttribute("data-intro")||"",tooltipClass:g.getAttribute("data-tooltip-class")||void 0,highlightClass:g.getAttribute("data-highlight-class")||void 0,position:g.getAttribute("data-position")||e._options.tooltipPosition,scrollTo:g.getAttribute("data-scroll-to")||e._options.scrollTo,disableInteraction:c})}}for(var w=0,S=0,D=n;S