From 72dad7270328494c063080c887c5650f35c781a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EA=B2=BD=EC=A2=85?= ${txt} ${n} Error loading banner image! Is the
`;
+
+ attr$1(div1, "class", "footer svelte-1kza10w");
+ },
+ m(target, anchor) {
+ insert$1(target, div1, anchor);
+ },
+ p: noop$1,
+ i: noop$1,
+ o: noop$1,
+ d(detaching) {
+ if (detaching) detach$1(div1);
+ }
+ };
+}
+
+class Footer extends SvelteComponent$1 {
+ constructor(options) {
+ super();
+ if (!document.getElementById("svelte-1kza10w-style")) add_css$5();
+ init$1(this, options, null, create_fragment$a, safe_not_equal$1, {});
+ }
+}
+
+/* src/ui/settings/SettingItem.svelte generated by Svelte v3.37.0 */
+
+const get_control_slot_changes = dirty => ({});
+const get_control_slot_context = ctx => ({});
+
+// (18:4) {#if description}
+function create_if_block$1(ctx) {
+ let div;
+ let t;
+
+ return {
+ c() {
+ div = element$1("div");
+ t = text$1(/*description*/ ctx[1]);
+ attr$1(div, "class", "setting-item-description");
+ },
+ m(target, anchor) {
+ insert$1(target, div, anchor);
+ append$1(div, t);
+ },
+ p(ctx, dirty) {
+ if (dirty & /*description*/ 2) set_data$1(t, /*description*/ ctx[1]);
+ },
+ d(detaching) {
+ if (detaching) detach$1(div);
+ }
+ };
+}
+
+function create_fragment$9(ctx) {
+ let div4;
+ let div2;
+ let div1;
+ let div0;
+ let t0;
+ let t1;
+ let t2;
+ let div3;
+ let current;
+ let if_block = /*description*/ ctx[1] && create_if_block$1(ctx);
+ const control_slot_template = /*#slots*/ ctx[5].control;
+ const control_slot = create_slot$1(control_slot_template, ctx, /*$$scope*/ ctx[4], get_control_slot_context);
+
+ return {
+ c() {
+ div4 = element$1("div");
+ div2 = element$1("div");
+ div1 = element$1("div");
+ div0 = element$1("div");
+ t0 = text$1(/*name*/ ctx[0]);
+ t1 = space$1();
+ if (if_block) if_block.c();
+ t2 = space$1();
+ div3 = element$1("div");
+ if (control_slot) control_slot.c();
+ attr$1(div1, "class", "setting-item-name");
+ attr$1(div2, "class", "setting-item-info");
+ attr$1(div3, "class", "setting-item-control");
+ attr$1(div4, "class", "setting-item");
+ toggle_class$1(div4, "setting-item-heading", /*isHeading*/ ctx[2]);
+ toggle_class$1(div4, "mod-dropdown", /*type*/ ctx[3] === "dropdown");
+ },
+ m(target, anchor) {
+ insert$1(target, div4, anchor);
+ append$1(div4, div2);
+ append$1(div2, div1);
+ append$1(div1, div0);
+ append$1(div0, t0);
+ append$1(div2, t1);
+ if (if_block) if_block.m(div2, null);
+ append$1(div4, t2);
+ append$1(div4, div3);
+
+ if (control_slot) {
+ control_slot.m(div3, null);
+ }
+
+ current = true;
+ },
+ p(ctx, [dirty]) {
+ if (!current || dirty & /*name*/ 1) set_data$1(t0, /*name*/ ctx[0]);
+
+ if (/*description*/ ctx[1]) {
+ if (if_block) {
+ if_block.p(ctx, dirty);
+ } else {
+ if_block = create_if_block$1(ctx);
+ if_block.c();
+ if_block.m(div2, null);
+ }
+ } else if (if_block) {
+ if_block.d(1);
+ if_block = null;
+ }
+
+ if (control_slot) {
+ if (control_slot.p && dirty & /*$$scope*/ 16) {
+ update_slot$1(control_slot, control_slot_template, ctx, /*$$scope*/ ctx[4], dirty, get_control_slot_changes, get_control_slot_context);
+ }
+ }
+
+ if (dirty & /*isHeading*/ 4) {
+ toggle_class$1(div4, "setting-item-heading", /*isHeading*/ ctx[2]);
+ }
+
+ if (dirty & /*type*/ 8) {
+ toggle_class$1(div4, "mod-dropdown", /*type*/ ctx[3] === "dropdown");
+ }
+ },
+ i(local) {
+ if (current) return;
+ transition_in$1(control_slot, local);
+ current = true;
+ },
+ o(local) {
+ transition_out$1(control_slot, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching) detach$1(div4);
+ if (if_block) if_block.d();
+ if (control_slot) control_slot.d(detaching);
+ }
+ };
+}
+
+function instance$9($$self, $$props, $$invalidate) {
+ let { $$slots: slots = {}, $$scope } = $$props;
+ let { name } = $$props;
+ let { description } = $$props;
+ let { isHeading } = $$props;
+ let { type } = $$props;
+
+ $$self.$$set = $$props => {
+ if ("name" in $$props) $$invalidate(0, name = $$props.name);
+ if ("description" in $$props) $$invalidate(1, description = $$props.description);
+ if ("isHeading" in $$props) $$invalidate(2, isHeading = $$props.isHeading);
+ if ("type" in $$props) $$invalidate(3, type = $$props.type);
+ if ("$$scope" in $$props) $$invalidate(4, $$scope = $$props.$$scope);
+ };
+
+ return [name, description, isHeading, type, $$scope, slots];
+}
+
+class SettingItem extends SvelteComponent$1 {
+ constructor(options) {
+ super();
+
+ init$1(this, options, instance$9, create_fragment$9, safe_not_equal$1, {
+ name: 0,
+ description: 1,
+ isHeading: 2,
+ type: 3
+ });
+ }
+}
+
+// external events
+const FINALIZE_EVENT_NAME = "finalize";
+const CONSIDER_EVENT_NAME = "consider";
+
+/**
+ * @typedef {Object} Info
+ * @property {string} trigger
+ * @property {string} id
+ * @property {string} source
+ * @param {Node} el
+ * @param {Array} items
+ * @param {Info} info
+ */
+function dispatchFinalizeEvent(el, items, info) {
+ el.dispatchEvent(
+ new CustomEvent(FINALIZE_EVENT_NAME, {
+ detail: {items, info}
+ })
+ );
+}
+
+/**
+ * Dispatches a consider event
+ * @param {Node} el
+ * @param {Array} items
+ * @param {Info} info
+ */
+function dispatchConsiderEvent(el, items, info) {
+ el.dispatchEvent(
+ new CustomEvent(CONSIDER_EVENT_NAME, {
+ detail: {items, info}
+ })
+ );
+}
+
+// internal events
+const DRAGGED_ENTERED_EVENT_NAME = "draggedEntered";
+const DRAGGED_LEFT_EVENT_NAME = "draggedLeft";
+const DRAGGED_OVER_INDEX_EVENT_NAME = "draggedOverIndex";
+const DRAGGED_LEFT_DOCUMENT_EVENT_NAME = "draggedLeftDocument";
+
+const DRAGGED_LEFT_TYPES = {
+ LEFT_FOR_ANOTHER: "leftForAnother",
+ OUTSIDE_OF_ANY: "outsideOfAny"
+};
+
+function dispatchDraggedElementEnteredContainer(containerEl, indexObj, draggedEl) {
+ containerEl.dispatchEvent(
+ new CustomEvent(DRAGGED_ENTERED_EVENT_NAME, {
+ detail: {indexObj, draggedEl}
+ })
+ );
+}
+
+/**
+ * @param containerEl - the dropzone the element left
+ * @param draggedEl - the dragged element
+ * @param theOtherDz - the new dropzone the element entered
+ */
+function dispatchDraggedElementLeftContainerForAnother(containerEl, draggedEl, theOtherDz) {
+ containerEl.dispatchEvent(
+ new CustomEvent(DRAGGED_LEFT_EVENT_NAME, {
+ detail: {draggedEl, type: DRAGGED_LEFT_TYPES.LEFT_FOR_ANOTHER, theOtherDz}
+ })
+ );
+}
+
+function dispatchDraggedElementLeftContainerForNone(containerEl, draggedEl) {
+ containerEl.dispatchEvent(
+ new CustomEvent(DRAGGED_LEFT_EVENT_NAME, {
+ detail: {draggedEl, type: DRAGGED_LEFT_TYPES.OUTSIDE_OF_ANY}
+ })
+ );
+}
+function dispatchDraggedElementIsOverIndex(containerEl, indexObj, draggedEl) {
+ containerEl.dispatchEvent(
+ new CustomEvent(DRAGGED_OVER_INDEX_EVENT_NAME, {
+ detail: {indexObj, draggedEl}
+ })
+ );
+}
+function dispatchDraggedLeftDocument(draggedEl) {
+ window.dispatchEvent(
+ new CustomEvent(DRAGGED_LEFT_DOCUMENT_EVENT_NAME, {
+ detail: {draggedEl}
+ })
+ );
+}
+
+const TRIGGERS = {
+ DRAG_STARTED: "dragStarted",
+ DRAGGED_ENTERED: DRAGGED_ENTERED_EVENT_NAME,
+ DRAGGED_ENTERED_ANOTHER: "dragEnteredAnother",
+ DRAGGED_OVER_INDEX: DRAGGED_OVER_INDEX_EVENT_NAME,
+ DRAGGED_LEFT: DRAGGED_LEFT_EVENT_NAME,
+ DRAGGED_LEFT_ALL: "draggedLeftAll",
+ DROPPED_INTO_ZONE: "droppedIntoZone",
+ DROPPED_INTO_ANOTHER: "droppedIntoAnother",
+ DROPPED_OUTSIDE_OF_ANY: "droppedOutsideOfAny",
+ DRAG_STOPPED: "dragStopped"
+};
+
+const SOURCES = {
+ POINTER: "pointer",
+ KEYBOARD: "keyboard"
+};
+
+const SHADOW_ITEM_MARKER_PROPERTY_NAME = "isDndShadowItem";
+const SHADOW_ELEMENT_ATTRIBUTE_NAME = "data-is-dnd-shadow-item";
+const SHADOW_PLACEHOLDER_ITEM_ID = "id:dnd-shadow-placeholder-0000";
+const DRAGGED_ELEMENT_ID = "dnd-action-dragged-el";
+
+let ITEM_ID_KEY = "id";
+let activeDndZoneCount = 0;
+function incrementActiveDropZoneCount() {
+ activeDndZoneCount++;
+}
+function decrementActiveDropZoneCount() {
+ if (activeDndZoneCount === 0) {
+ throw new Error("Bug! trying to decrement when there are no dropzones");
+ }
+ activeDndZoneCount--;
+}
+
+const isOnServer = typeof window === "undefined";
+
+// This is based off https://stackoverflow.com/questions/27745438/how-to-compute-getboundingclientrect-without-considering-transforms/57876601#57876601
+// It removes the transforms that are potentially applied by the flip animations
+/**
+ * Gets the bounding rect but removes transforms (ex: flip animation)
+ * @param {HTMLElement} el
+ * @return {{top: number, left: number, bottom: number, right: number}}
+ */
+function getBoundingRectNoTransforms(el) {
+ let ta;
+ const rect = el.getBoundingClientRect();
+ const style = getComputedStyle(el);
+ const tx = style.transform;
+
+ if (tx) {
+ let sx, sy, dx, dy;
+ if (tx.startsWith("matrix3d(")) {
+ ta = tx.slice(9, -1).split(/, /);
+ sx = +ta[0];
+ sy = +ta[5];
+ dx = +ta[12];
+ dy = +ta[13];
+ } else if (tx.startsWith("matrix(")) {
+ ta = tx.slice(7, -1).split(/, /);
+ sx = +ta[0];
+ sy = +ta[3];
+ dx = +ta[4];
+ dy = +ta[5];
+ } else {
+ return rect;
+ }
+
+ const to = style.transformOrigin;
+ const x = rect.x - dx - (1 - sx) * parseFloat(to);
+ const y = rect.y - dy - (1 - sy) * parseFloat(to.slice(to.indexOf(" ") + 1));
+ const w = sx ? rect.width / sx : el.offsetWidth;
+ const h = sy ? rect.height / sy : el.offsetHeight;
+ return {
+ x: x,
+ y: y,
+ width: w,
+ height: h,
+ top: y,
+ right: x + w,
+ bottom: y + h,
+ left: x
+ };
+ } else {
+ return rect;
+ }
+}
+
+/**
+ * Gets the absolute bounding rect (accounts for the window's scroll position and removes transforms)
+ * @param {HTMLElement} el
+ * @return {{top: number, left: number, bottom: number, right: number}}
+ */
+function getAbsoluteRectNoTransforms(el) {
+ const rect = getBoundingRectNoTransforms(el);
+ return {
+ top: rect.top + window.scrollY,
+ bottom: rect.bottom + window.scrollY,
+ left: rect.left + window.scrollX,
+ right: rect.right + window.scrollX
+ };
+}
+
+/**
+ * Gets the absolute bounding rect (accounts for the window's scroll position)
+ * @param {HTMLElement} el
+ * @return {{top: number, left: number, bottom: number, right: number}}
+ */
+function getAbsoluteRect(el) {
+ const rect = el.getBoundingClientRect();
+ return {
+ top: rect.top + window.scrollY,
+ bottom: rect.bottom + window.scrollY,
+ left: rect.left + window.scrollX,
+ right: rect.right + window.scrollX
+ };
+}
+
+/**
+ * finds the center :)
+ * @typedef {Object} Rect
+ * @property {number} top
+ * @property {number} bottom
+ * @property {number} left
+ * @property {number} right
+ * @param {Rect} rect
+ * @return {{x: number, y: number}}
+ */
+function findCenter(rect) {
+ return {
+ x: (rect.left + rect.right) / 2,
+ y: (rect.top + rect.bottom) / 2
+ };
+}
+
+/**
+ * @typedef {Object} Point
+ * @property {number} x
+ * @property {number} y
+ * @param {Point} pointA
+ * @param {Point} pointB
+ * @return {number}
+ */
+function calcDistance(pointA, pointB) {
+ return Math.sqrt(Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2));
+}
+
+/**
+ * @param {Point} point
+ * @param {Rect} rect
+ * @return {boolean|boolean}
+ */
+function isPointInsideRect(point, rect) {
+ return point.y <= rect.bottom && point.y >= rect.top && point.x >= rect.left && point.x <= rect.right;
+}
+
+/**
+ * find the absolute coordinates of the center of a dom element
+ * @param el {HTMLElement}
+ * @returns {{x: number, y: number}}
+ */
+function findCenterOfElement(el) {
+ return findCenter(getAbsoluteRect(el));
+}
+
+/**
+ * @param {HTMLElement} elA
+ * @param {HTMLElement} elB
+ * @return {boolean}
+ */
+function isCenterOfAInsideB(elA, elB) {
+ const centerOfA = findCenterOfElement(elA);
+ const rectOfB = getAbsoluteRectNoTransforms(elB);
+ return isPointInsideRect(centerOfA, rectOfB);
+}
+
+/**
+ * @param {HTMLElement|ChildNode} elA
+ * @param {HTMLElement|ChildNode} elB
+ * @return {number}
+ */
+function calcDistanceBetweenCenters(elA, elB) {
+ const centerOfA = findCenterOfElement(elA);
+ const centerOfB = findCenterOfElement(elB);
+ return calcDistance(centerOfA, centerOfB);
+}
+
+/**
+ * @param {HTMLElement} el - the element to check
+ * @returns {boolean} - true if the element in its entirety is off screen including the scrollable area (the normal dom events look at the mouse rather than the element)
+ */
+function isElementOffDocument(el) {
+ const rect = getAbsoluteRect(el);
+ return rect.right < 0 || rect.left > document.documentElement.scrollWidth || rect.bottom < 0 || rect.top > document.documentElement.scrollHeight;
+}
+
+/**
+ * If the point is inside the element returns its distances from the sides, otherwise returns null
+ * @param {Point} point
+ * @param {HTMLElement} el
+ * @return {null|{top: number, left: number, bottom: number, right: number}}
+ */
+function calcInnerDistancesBetweenPointAndSidesOfElement(point, el) {
+ const rect = getAbsoluteRect(el);
+ if (!isPointInsideRect(point, rect)) {
+ return null;
+ }
+ return {
+ top: point.y - rect.top,
+ bottom: rect.bottom - point.y,
+ left: point.x - rect.left,
+ // TODO - figure out what is so special about right (why the rect is too big)
+ right: Math.min(rect.right, document.documentElement.clientWidth) - point.x
+ };
+}
+
+let dzToShadowIndexToRect;
+
+/**
+ * Resets the cache that allows for smarter "would be index" resolution. Should be called after every drag operation
+ */
+function resetIndexesCache() {
+ dzToShadowIndexToRect = new Map();
+}
+resetIndexesCache();
+
+/**
+ * Caches the coordinates of the shadow element when it's in a certain index in a certain dropzone.
+ * Helpful in order to determine "would be index" more effectively
+ * @param {HTMLElement} dz
+ * @return {number} - the shadow element index
+ */
+function cacheShadowRect(dz) {
+ const shadowElIndex = Array.from(dz.children).findIndex(child => child.getAttribute(SHADOW_ELEMENT_ATTRIBUTE_NAME));
+ if (shadowElIndex >= 0) {
+ if (!dzToShadowIndexToRect.has(dz)) {
+ dzToShadowIndexToRect.set(dz, new Map());
+ }
+ dzToShadowIndexToRect.get(dz).set(shadowElIndex, getAbsoluteRectNoTransforms(dz.children[shadowElIndex]));
+ return shadowElIndex;
+ }
+ return undefined;
+}
+
+/**
+ * @typedef {Object} Index
+ * @property {number} index - the would be index
+ * @property {boolean} isProximityBased - false if the element is actually over the index, true if it is not over it but this index is the closest
+ */
+/**
+ * Find the index for the dragged element in the list it is dragged over
+ * @param {HTMLElement} floatingAboveEl
+ * @param {HTMLElement} collectionBelowEl
+ * @returns {Index|null} - if the element is over the container the Index object otherwise null
+ */
+function findWouldBeIndex(floatingAboveEl, collectionBelowEl) {
+ if (!isCenterOfAInsideB(floatingAboveEl, collectionBelowEl)) {
+ return null;
+ }
+ const children = collectionBelowEl.children;
+ // the container is empty, floating element should be the first
+ if (children.length === 0) {
+ return {index: 0, isProximityBased: true};
+ }
+ const shadowElIndex = cacheShadowRect(collectionBelowEl);
+
+ // the search could be more efficient but keeping it simple for now
+ // a possible improvement: pass in the lastIndex it was found in and check there first, then expand from there
+ for (let i = 0; i < children.length; i++) {
+ if (isCenterOfAInsideB(floatingAboveEl, children[i])) {
+ const cachedShadowRect = dzToShadowIndexToRect.has(collectionBelowEl) && dzToShadowIndexToRect.get(collectionBelowEl).get(i);
+ if (cachedShadowRect) {
+ if (!isPointInsideRect(findCenterOfElement(floatingAboveEl), cachedShadowRect)) {
+ return {index: shadowElIndex, isProximityBased: false};
+ }
+ }
+ return {index: i, isProximityBased: false};
+ }
+ }
+ // this can happen if there is space around the children so the floating element has
+ //entered the container but not any of the children, in this case we will find the nearest child
+ let minDistanceSoFar = Number.MAX_VALUE;
+ let indexOfMin = undefined;
+ // we are checking all of them because we don't know whether we are dealing with a horizontal or vertical container and where the floating element entered from
+ for (let i = 0; i < children.length; i++) {
+ const distance = calcDistanceBetweenCenters(floatingAboveEl, children[i]);
+ if (distance < minDistanceSoFar) {
+ minDistanceSoFar = distance;
+ indexOfMin = i;
+ }
+ }
+ return {index: indexOfMin, isProximityBased: true};
+}
+
+const SCROLL_ZONE_PX = 25;
+
+function makeScroller() {
+ let scrollingInfo;
+ function resetScrolling() {
+ scrollingInfo = {directionObj: undefined, stepPx: 0};
+ }
+ resetScrolling();
+ // directionObj {x: 0|1|-1, y:0|1|-1} - 1 means down in y and right in x
+ function scrollContainer(containerEl) {
+ const {directionObj, stepPx} = scrollingInfo;
+ if (directionObj) {
+ containerEl.scrollBy(directionObj.x * stepPx, directionObj.y * stepPx);
+ window.requestAnimationFrame(() => scrollContainer(containerEl));
+ }
+ }
+ function calcScrollStepPx(distancePx) {
+ return SCROLL_ZONE_PX - distancePx;
+ }
+
+ /**
+ * If the pointer is next to the sides of the element to scroll, will trigger scrolling
+ * Can be called repeatedly with updated pointer and elementToScroll values without issues
+ * @return {boolean} - true if scrolling was needed
+ */
+ function scrollIfNeeded(pointer, elementToScroll) {
+ if (!elementToScroll) {
+ return false;
+ }
+ const distances = calcInnerDistancesBetweenPointAndSidesOfElement(pointer, elementToScroll);
+ if (distances === null) {
+ resetScrolling();
+ return false;
+ }
+ const isAlreadyScrolling = !!scrollingInfo.directionObj;
+ let [scrollingVertically, scrollingHorizontally] = [false, false];
+ // vertical
+ if (elementToScroll.scrollHeight > elementToScroll.clientHeight) {
+ if (distances.bottom < SCROLL_ZONE_PX) {
+ scrollingVertically = true;
+ scrollingInfo.directionObj = {x: 0, y: 1};
+ scrollingInfo.stepPx = calcScrollStepPx(distances.bottom);
+ } else if (distances.top < SCROLL_ZONE_PX) {
+ scrollingVertically = true;
+ scrollingInfo.directionObj = {x: 0, y: -1};
+ scrollingInfo.stepPx = calcScrollStepPx(distances.top);
+ }
+ if (!isAlreadyScrolling && scrollingVertically) {
+ scrollContainer(elementToScroll);
+ return true;
+ }
+ }
+ // horizontal
+ if (elementToScroll.scrollWidth > elementToScroll.clientWidth) {
+ if (distances.right < SCROLL_ZONE_PX) {
+ scrollingHorizontally = true;
+ scrollingInfo.directionObj = {x: 1, y: 0};
+ scrollingInfo.stepPx = calcScrollStepPx(distances.right);
+ } else if (distances.left < SCROLL_ZONE_PX) {
+ scrollingHorizontally = true;
+ scrollingInfo.directionObj = {x: -1, y: 0};
+ scrollingInfo.stepPx = calcScrollStepPx(distances.left);
+ }
+ if (!isAlreadyScrolling && scrollingHorizontally) {
+ scrollContainer(elementToScroll);
+ return true;
+ }
+ }
+ resetScrolling();
+ return false;
+ }
+
+ return {
+ scrollIfNeeded,
+ resetScrolling
+ };
+}
+
+/**
+ * @param {Object} object
+ * @return {string}
+ */
+function toString(object) {
+ return JSON.stringify(object, null, 2);
+}
+
+/**
+ * Finds the depth of the given node in the DOM tree
+ * @param {HTMLElement} node
+ * @return {number} - the depth of the node
+ */
+function getDepth(node) {
+ if (!node) {
+ throw new Error("cannot get depth of a falsy node");
+ }
+ return _getDepth(node, 0);
+}
+function _getDepth(node, countSoFar = 0) {
+ if (!node.parentElement) {
+ return countSoFar - 1;
+ }
+ return _getDepth(node.parentElement, countSoFar + 1);
+}
+
+/**
+ * A simple util to shallow compare objects quickly, it doesn't validate the arguments so pass objects in
+ * @param {Object} objA
+ * @param {Object} objB
+ * @return {boolean} - true if objA and objB are shallow equal
+ */
+function areObjectsShallowEqual(objA, objB) {
+ if (Object.keys(objA).length !== Object.keys(objB).length) {
+ return false;
+ }
+ for (const keyA in objA) {
+ if (!{}.hasOwnProperty.call(objB, keyA) || objB[keyA] !== objA[keyA]) {
+ return false;
+ }
+ }
+ return true;
+}
+
+/**
+ * Shallow compares two arrays
+ * @param arrA
+ * @param arrB
+ * @return {boolean} - whether the arrays are shallow equal
+ */
+function areArraysShallowEqualSameOrder(arrA, arrB) {
+ if (arrA.length !== arrB.length) {
+ return false;
+ }
+ for (let i = 0; i < arrA.length; i++) {
+ if (arrA[i] !== arrB[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+
+const INTERVAL_MS$1 = 200;
+const TOLERANCE_PX = 10;
+const {scrollIfNeeded: scrollIfNeeded$1, resetScrolling: resetScrolling$1} = makeScroller();
+let next$1;
+
+/**
+ * Tracks the dragged elements and performs the side effects when it is dragged over a drop zone (basically dispatching custom-events scrolling)
+ * @param {Set0&&Array.isArray(a[0])&&(a=a[0]),this.transformers=a.map(function(i){return typeof i=="function"?i():i}),this.tag}return gI(t,[{key:"interimTag",value:function(r,a){for(var n=arguments.length,i=Array(n>2?n-2:0),s=2;s
+
${t.getSettingValue("frontmatterField")} field valid?$1
`).replace(gr,`•`).replace(_r,`$1.`).replace(mr,`⬜`).replace(hr,`✅`).replace(fr,`$1`).replace(pr,`$1`).replace(/<br>/g,`
`).replace(/&/g,`&`),r=n;if(t){if(vr.test(n)){let e=n.match(vr);for(let t=0;t | ${e===``?` #$2`).replace(Pr,`$1$2`).replace(Fr,`$1`).replace(Br,`$1`).replace(/\^\S{6}/g,``);let n=document.createElement(`div`);n.innerHTML=e;for(let e=0;e
`),Dr=e=>{let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}})),kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr=o((()=>{kr=`mobile-show-sidebar`,Ar=3600*24*1e3,jr=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Mr=/(
)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Nr=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Pr=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,Fr=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Ir=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Lr=/(\s|:|^)(http[s]?:\/\/)([^\/\s]+\/)(\S*?)(jpeg|jpg|gif|png|svg|bmp|webp)(?!\))/g,Rr=/!\[\[(([^|\]]+?)\.(jpeg|jpg|gif|png|svg|bmp|webp))?(\|)?([^\]]*)?\]\]/gi,zr=/(!\[([^\]]*)\]\(([^)"\s]*\.(jpg|jpeg|png|gif|svg|bmp|webp))(?:\s*"[^"]*")?\s*\))/gi,Br=/\[@(.+?)\]\((.+?)\)/g,Vr=/[#*"\/\\<>:|\[\]\?]/gim,Hr=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)(-\d{1,2}:\d{2}(:\d{2})?)?\s(.*)/g,Ur=[{title:`DAILY`,icon:`list`},{title:`CANVAS`,icon:`layout-dashboard`},{title:`MULTI`,icon:`file-text`},{title:`FILE`,icon:`edit`},{title:`JOURNAL`,icon:`book-open`}]}));function Gr(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.format;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=C().format||`YYYY-MM-DD`;break;case`Periodic`:e=n||`YYYY-MM-DD`;break;default:e=C().format||`YYYY-MM-DD`;break}return e===void 0&&new f.Notice(M(`You didn't set format for daily notes in both periodic-notes and daily-notes plugins.`)),e}function Kr(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.folder;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=C().folder||``;break;case`Periodic`:e=n||``;break;default:e=C().folder||``;break}return e===void 0&&new f.Notice(M(`You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.`)),e}function qr(){let e=Kr();return!(e!==void 0&&!app.vault.getFolderByPath(e))}function Jr(e,t){e=Dr(e),e=Er(e).split(`
`).map(e=>`
`:e}0&&console.log(`✅ File cache refresh successful, found ${m.length} list items`)),m.length===0)){console.warn(`⚠️ No list items found for memo ${e.id.slice(-6)} even after cache refresh. This might be a newly created memo.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let h=parseInt(e.id.slice(14)),g=h;Ui(m);let _=m.find(e=>e.position.start.line===h);if(!_&&e.content&&(console.log(`🔍 Memo not found at original line ${h}, searching by content...`),_=await $i(m,d,e.content,e.id)),!_&&e.hasId&&(console.log(`🔍 Searching by block ID: ${e.hasId}`),_=m.find(t=>t.position?d.slice(t.position.start.line,t.position.end.line+1).join(`
+`).includes(`^${e.hasId}`):!1)),!_){console.warn(`⚠️ List item not found after all search strategies for memo ${e.id.slice(-6)}. Original line: ${h}. This might indicate a line number mismatch.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let v=_.position.start.line;v!==h&&console.log(`📍 Memo location corrected: ${h} → ${v} for memo ${e.id.slice(-6)}`),g=v+e.content.split(`
+`).length,g>=d.length&&(g=d.length-1);let y=m.find(e=>{let t=e.position.start.line;if(t<=v)return!1;let n=d[t]||``;return/^(\s*)- (\[.\] )?\d{2}:\d{2}/.test(n)});y&&g>=y.position.start.line&&(console.warn(`⚠️ Limiting endLine to prevent including next memo. Original: ${g}, Limited: ${y.position.start.line-1}`),g=y.position.start.line-1);let b=d.slice(v,g+1),x=b.join(`
+`),S=x;console.log(`Original content:`,x);let C=i.vault.getConfig(`useTab`)===void 0||app.vault.getConfig(`useTab`)===!0,w=C?1:i.vault.getConfig(`tabSize`),T=(C?` `:` `).repeat(w),E=x.match(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/),D=t.hasId===void 0?E?E[1]:e.hasId||null:t.hasId,O=ya(b[0]||``),k;k=O.fullTimeMatch?O.fullTimeMatch:c?(0,f.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);let A=k;!O.fullTimeMatch&&a.DefaultTimePrefix!==`HH:mm`&&(A=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(a.DefaultTimePrefix));let j={pinned:x.includes(`[pinned::true]`),deleted:x.match(/\[deleted::([^\]]+)\]/)?.[1]||``,archived:x.includes(`[archived::true]`),webId:x.match(/\[webId::([^\]]+)\]/)?.[1]||``,visibility:x.match(/\[visibility::"([^"]+)"\]/)?.[1]||``};if(x.match(/^(- \[.\] |- |(\*|\d{1,2}\.) )/)?.[0],t.content){let n=t.thinoType?t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `:e.thinoType===`TASK-TODO`?`- [ ] `:e.thinoType===`TASK-DONE`?`- [x] `:e.thinoType.startsWith(`TASK`)?`- [${e.thinoType.slice(5)}] `:`- `,r=[];if((t.pinned===void 0?j.pinned:t.pinned)&&r.push(`[pinned::true]`),t.deleted||t.deleted!==!1&&j.deleted){let e=t.deleted?(0,f.moment)().format(`YYYYMMDDHHmmss`):j.deleted;r.push(`[deleted::${e}]`)}(t.rowStatus===`ARCHIVED`||t.rowStatus!==`NORMAL`&&j.archived)&&r.push(`[archived::true]`),(t.webId===void 0?j.webId:t.webId)&&r.push(`[webId::${t.webId===void 0?j.webId:t.webId}]`),(t.visibility||j.visibility)&&r.push(`[visibility::"${t.visibility||j.visibility}"]`);let i=D?`^${D}`:``,a=t.content.trim().split(`
+`).length>1;/^((-|\*|\d\.|>)\s|```)/g.test(t.content);let o=t.content.trim().split(`
+`);if(/(^(-|\*|\d\.|>)\s)/g.test(o[o.length-1]),a){let e=o.map(e=>T+e),t=!1;for(let n=e.length-1;n>=0;n--)if(!/(^(-|\*|\d\.|>)\s)/g.test(e[n].trim())){e[n]=e[n]+(D?` ${i}`:``),t=!0;break}!t&&D&&(e[e.length-1]+=` ${i}`),S=`${n}${A}\n${e.join(`
+`)} ${r.join(` `)}`.trim()}else S=`${n}${A} ${t.content.trim()} ${r.join(` `)}`.trim()+(i?` ${i}`:``)}else{if(t.thinoType){let e=t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `;S=S.replace(/^((- \[.\] )|((-|\*) ))/,e)}if(t.rowStatus&&(t.rowStatus===`ARCHIVED`?S.includes(`[archived::`)?S=S.replace(/\[archived::(true|false)\]/,`[archived::true]`):S+=(S.endsWith(` `)?``:` `)+`[archived::true]`:t.rowStatus===`NORMAL`&&(S=S.replace(/\s?\[archived::(true|false)\]/,``))),t.visibility){let e=`[visibility::"${t.visibility}"]`;S.includes(`[visibility::`)?S=S.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/,e):S+=(S.endsWith(` `)?``:` `)+e}if(t.pinned!==void 0&&(t.pinned?S.includes(`[pinned::`)?S=S.replace(/\[pinned::(true|false)\]/,`[pinned::true]`):S+=(S.endsWith(` `)?``:` `)+`[pinned::true]`:S=S.replace(/\s?\[pinned::(true|false)\]/,``)),t.webId!==void 0&&(S.includes(`[webId::`)?S=t.webId===``?S.replace(/\s?\[webId::([^\]]+)\]/,``):S.replace(/\[webId::([^\]]+)\]/,`[webId::${t.webId}]`):t.webId!==``&&(S+=(S.endsWith(` `)?``:` `)+`[webId::${t.webId}]`)),t.deleted!==void 0){let e=(0,f.moment)();if(t.deleted){let t=`[deleted::${e.format(`YYYYMMDDHHmmss`)}]`;S.includes(`[deleted::`)?S=S.replace(/\[deleted::([^\]]+)\]/,t):S+=(S.endsWith(` `)?``:` `)+t}else S=S.replace(/\s?\[deleted::([^\]]+)\]/,``)}if(t.hasId!==void 0||D){let e=t.hasId===void 0?D:t.hasId;S=S.replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,``),e&&(S=S.trimEnd(),S+=` ^${e}`)}}if(S!==x){let r=g-v+1,i=S.trim().split(`
+`);r>10&&i.length