// ==UserScript== // @name 延河课堂视频下载 // @namespace xioneko // @version 1.0.2 // @description 一个开箱即用的延河课堂视频下载脚本,用户界面友好,傻瓜式操作 // @license MIT // @match https://www.yanhekt.cn/course/* // @icon https://www.yanhekt.cn/yhkt.ico // @supportURL https://github.com/xioneko/yanhekt-downloader/issues // @homepageURL https://github.com/xioneko/yanhekt-downloader#readme // @inject-into content // @unwrap true // @noframes true // @downloadURL https://update.greasyfork.icu/scripts/496320/%E5%BB%B6%E6%B2%B3%E8%AF%BE%E5%A0%82%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD.user.js // @updateURL https://update.greasyfork.icu/scripts/496320/%E5%BB%B6%E6%B2%B3%E8%AF%BE%E5%A0%82%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD.meta.js // ==/UserScript== (function() { const style = document.createElement("style"); document.head.appendChild(style); style.textContent = ` #--unocss-layer-start--__ALL__-- { start: __ALL__; } *, :before, :after { --un-rotate:0; --un-rotate-x:0; --un-rotate-y:0; --un-rotate-z:0; --un-scale-x:1; --un-scale-y:1; --un-scale-z:1; --un-skew-x:0; --un-skew-y:0; --un-translate-x:0; --un-translate-y:0; --un-translate-z:0; --un-pan-x: ; --un-pan-y: ; --un-pinch-zoom: ; --un-scroll-snap-strictness:proximity; --un-ordinal: ; --un-slashed-zero: ; --un-numeric-figure: ; --un-numeric-spacing: ; --un-numeric-fraction: ; --un-border-spacing-x:0; --un-border-spacing-y:0; --un-ring-offset-shadow:0 0 rgb(0 0 0 / 0); --un-ring-shadow:0 0 rgb(0 0 0 / 0); --un-shadow-inset: ; --un-shadow:0 0 rgb(0 0 0 / 0); --un-ring-inset: ; --un-ring-offset-width:0px; --un-ring-offset-color:#fff; --un-ring-width:0px; --un-ring-color:rgb(147 197 253 / .5); --un-blur: ; --un-brightness: ; --un-contrast: ; --un-drop-shadow: ; --un-grayscale: ; --un-hue-rotate: ; --un-invert: ; --un-saturate: ; --un-sepia: ; --un-backdrop-blur: ; --un-backdrop-brightness: ; --un-backdrop-contrast: ; --un-backdrop-grayscale: ; --un-backdrop-hue-rotate: ; --un-backdrop-invert: ; --un-backdrop-opacity: ; --un-backdrop-saturate: ; --un-backdrop-sepia: ; } ::backdrop { --un-rotate:0; --un-rotate-x:0; --un-rotate-y:0; --un-rotate-z:0; --un-scale-x:1; --un-scale-y:1; --un-scale-z:1; --un-skew-x:0; --un-skew-y:0; --un-translate-x:0; --un-translate-y:0; --un-translate-z:0; --un-pan-x: ; --un-pan-y: ; --un-pinch-zoom: ; --un-scroll-snap-strictness:proximity; --un-ordinal: ; --un-slashed-zero: ; --un-numeric-figure: ; --un-numeric-spacing: ; --un-numeric-fraction: ; --un-border-spacing-x:0; --un-border-spacing-y:0; --un-ring-offset-shadow:0 0 rgb(0 0 0 / 0); --un-ring-shadow:0 0 rgb(0 0 0 / 0); --un-shadow-inset: ; --un-shadow:0 0 rgb(0 0 0 / 0); --un-ring-inset: ; --un-ring-offset-width:0px; --un-ring-offset-color:#fff; --un-ring-width:0px; --un-ring-color:rgb(147 197 253 / .5); --un-blur: ; --un-brightness: ; --un-contrast: ; --un-drop-shadow: ; --un-grayscale: ; --un-hue-rotate: ; --un-invert: ; --un-saturate: ; --un-sepia: ; --un-backdrop-blur: ; --un-backdrop-brightness: ; --un-backdrop-contrast: ; --un-backdrop-grayscale: ; --un-backdrop-hue-rotate: ; --un-backdrop-invert: ; --un-backdrop-opacity: ; --un-backdrop-saturate: ; --un-backdrop-sepia: ; } .visible { visibility: visible; } .absolute { position: absolute; } .fixed { position: fixed; } .relative { position: relative; } .bottom-\\[24px\\] { bottom: 24px; } .bottom-0 { bottom: 0; } .left-0 { left: 0; } .right-\\[10px\\] { right: 10px; } .right-\\[24px\\] { right: 24px; } .top-\\[10px\\] { top: 10px; } .top-0 { top: 0; } .z-24 { z-index: 24; } .mb-\\[16px\\] { margin-bottom: 16px; } .mt-\\[4px\\] { margin-top: 4px; } .hidden\\! { display: none !important; } .h-\\[20px\\] { height: 20px; } .h-\\[3px\\] { height: 3px; } .h-\\[64px\\] { height: 64px; } .h-3\\/5 { height: 60%; } .h-full { height: 100%; } .h4 { height: 1rem; } .w-\\[288px\\] { width: 288px; } .w-full { width: 100%; } .flex { display: flex; } .inline-flex { display: inline-flex; } .flex-1 { flex: 1 1 0%; } .flex-shrink-0 { flex-shrink: 0; } .flex-basis-\\[72px\\] { flex-basis: 72px; } .flex-row { flex-direction: row; } .flex-col { flex-direction: column; } .flex-col-reverse { flex-direction: column-reverse; } .scale-90 { --un-scale-x:.9; --un-scale-y:.9; transform: translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)); } .cursor-pointer { cursor: pointer; } .select-none { -webkit-user-select: none; user-select: none; } .items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; } .gap-\\[12px\\] { gap: 12px; } .gap-\\[16px\\] { gap: 16px; } .gap-\\[6px\\] { gap: 6px; } .overflow-hidden { overflow: hidden; } .text-ellipsis { text-overflow: ellipsis; } .whitespace-nowrap { white-space: nowrap; } .break-keep { word-break: keep-all; } .rounded-\\[2px\\] { border-radius: 2px; } .rounded-\\[6px\\] { border-radius: 6px; } .border-none { border-style: none; } .bg-black { --un-bg-opacity:1; background-color: rgb(0 0 0 / var(--un-bg-opacity)); } .bg-transparent { background-color: transparent; } .bg-white { --un-bg-opacity:1; background-color: rgb(255 255 255 / var(--un-bg-opacity)); } .bg-opacity-50 { --un-bg-opacity:.5; } .p-0 { padding: 0; } .px { padding-left: 1rem; padding-right: 1rem; } .px-\\[12px\\] { padding-left: 12px; padding-right: 12px; } .px-\\[15px\\] { padding-left: 15px; padding-right: 15px; } .py-\\[16px\\] { padding-top: 16px; padding-bottom: 16px; } .py-\\[20px\\] { padding-top: 20px; padding-bottom: 20px; } .text-right { text-align: right; } .text-\\[0\\.8em\\] { font-size: .8em; } .text-\\[0\\.9em\\] { font-size: .9em; } .text-\\[1\\.2em\\] { font-size: 1.2em; } .text-\\[\\#0f86ff\\] { --un-text-opacity:1; color: rgb(15 134 255 / var(--un-text-opacity)); } .text-\\[\\#333\\] { --un-text-opacity:1; color: rgb(51 51 51 / var(--un-text-opacity)); } .text-\\[\\#666\\] { --un-text-opacity:1; color: rgb(102 102 102 / var(--un-text-opacity)); } .opacity-0 { opacity: 0; } .opacity-75 { opacity: .75; } .shadow-md { --un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1)); box-shadow: var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow); } .hover\\:brightness-110:hover { --un-brightness:brightness(1.1); filter: var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia); } .active\\:brightness-90:active { --un-brightness:brightness(.9); filter: var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia); } .transition { transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(.4, 0, .2, 1); transition-duration: .15s; } .transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(.4, 0, .2, 1); transition-duration: .15s; } .transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(.4, 0, .2, 1); transition-duration: .15s; } .duration-300 { transition-duration: .3s; } .ease-out { transition-timing-function: cubic-bezier(0, 0, .2, 1); } @media (min-width: 768px) { .md\\:inline\\! { display: inline !important; } } #--unocss-layer-end--__ALL__-- { end: __ALL__; } `; })() var __defProp = Object.defineProperty; var __typeError = (msg) => { throw TypeError(msg); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); (function() { "use strict"; var _worker, _resolves, _rejects, _logEventCallbacks, _progressEventCallbacks, _registerHandlers, _send; var _documentCurrentScript = typeof document < "u" ? document.currentScript : null; const sharedConfig = { context: void 0, registry: void 0, getContextId() { return getContextId(this.context.count); }, getNextContextId() { return getContextId(this.context.count++); } }; function getContextId(count) { const num = String(count), len = num.length - 1; return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num; } const equalFn = (a, b) => a === b, $PROXY = Symbol("solid-proxy"), $TRACK = Symbol("solid-track"), signalOptions = { equals: equalFn }; let runEffects = runQueue; const STALE = 1, PENDING = 2, UNOWNED = { owned: null, cleanups: null, context: null, owner: null }; var Owner = null; let Transition = null, ExternalSourceConfig = null, Listener = null, Updates = null, Effects = null, ExecCount = 0; function createRoot(fn, detachedOwner) { const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root2 = unowned ? UNOWNED : { owned: null, cleanups: null, context: current ? current.context : null, owner: current }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root2))); Owner = root2, Listener = null; try { return runUpdates(updateFn, !0); } finally { Listener = listener, Owner = owner; } } function createSignal(value, options) { options = options ? Object.assign({}, signalOptions, options) : signalOptions; const s = { value, observers: null, observerSlots: null, comparator: options.equals || void 0 }, setter = (value2) => (typeof value2 == "function" && (value2 = value2(s.value)), writeSignal(s, value2)); return [readSignal.bind(s), setter]; } function createRenderEffect(fn, value, options) { const c = createComputation(fn, value, !1, STALE); updateComputation(c); } function createEffect(fn, value, options) { runEffects = runUserEffects; const c = createComputation(fn, value, !1, STALE); (!options || !options.render) && (c.user = !0), Effects ? Effects.push(c) : updateComputation(c); } function createMemo(fn, value, options) { options = options ? Object.assign({}, signalOptions, options) : signalOptions; const c = createComputation(fn, value, !0, 0); return c.observers = null, c.observerSlots = null, c.comparator = options.equals || void 0, updateComputation(c), readSignal.bind(c); } function batch(fn) { return runUpdates(fn, !1); } function untrack(fn) { if (Listener === null) return fn(); const listener = Listener; Listener = null; try { return fn(); } finally { Listener = listener; } } function onMount(fn) { createEffect(() => untrack(fn)); } function onCleanup(fn) { return Owner === null || (Owner.cleanups === null ? Owner.cleanups = [fn] : Owner.cleanups.push(fn)), fn; } function getListener() { return Listener; } function getOwner() { return Owner; } function runWithOwner(o, fn) { const prev = Owner, prevListener = Listener; Owner = o, Listener = null; try { return runUpdates(fn, !0); } catch (err) { handleError(err); } finally { Owner = prev, Listener = prevListener; } } function startTransition(fn) { const l = Listener, o = Owner; return Promise.resolve().then(() => { Listener = l, Owner = o; let t; return runUpdates(fn, !1), Listener = Owner = null, t ? t.done : void 0; }); } const [transPending, setTransPending] = /* @__PURE__ */ createSignal(!1); function useTransition() { return [transPending, startTransition]; } function createContext(defaultValue, options) { const id = Symbol("context"); return { id, Provider: createProvider(id), defaultValue }; } function useContext(context) { let value; return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue; } function children(fn) { const children2 = createMemo(fn), memo = createMemo(() => resolveChildren(children2())); return memo.toArray = () => { const c = memo(); return Array.isArray(c) ? c : c != null ? [c] : []; }, memo; } function readSignal() { if (this.sources && this.state) if (this.state === STALE) updateComputation(this); else { const updates = Updates; Updates = null, runUpdates(() => lookUpstream(this), !1), Updates = updates; } if (Listener) { const sSlot = this.observers ? this.observers.length : 0; Listener.sources ? (Listener.sources.push(this), Listener.sourceSlots.push(sSlot)) : (Listener.sources = [this], Listener.sourceSlots = [sSlot]), this.observers ? (this.observers.push(Listener), this.observerSlots.push(Listener.sources.length - 1)) : (this.observers = [Listener], this.observerSlots = [Listener.sources.length - 1]); } return this.value; } function writeSignal(node, value, isComp) { let current = node.value; return (!node.comparator || !node.comparator(current, value)) && (node.value = value, node.observers && node.observers.length && runUpdates(() => { for (let i = 0; i < node.observers.length; i += 1) { const o = node.observers[i], TransitionRunning = Transition && Transition.running; TransitionRunning && Transition.disposed.has(o), (TransitionRunning ? !o.tState : !o.state) && (o.pure ? Updates.push(o) : Effects.push(o), o.observers && markDownstream(o)), TransitionRunning || (o.state = STALE); } if (Updates.length > 1e6) throw Updates = [], new Error(); }, !1)), value; } function updateComputation(node) { if (!node.fn) return; cleanNode(node); const time = ExecCount; runComputation(node, node.value, time); } function runComputation(node, value, time) { let nextValue; const owner = Owner, listener = Listener; Listener = Owner = node; try { nextValue = node.fn(value); } catch (err) { return node.pure && (node.state = STALE, node.owned && node.owned.forEach(cleanNode), node.owned = null), node.updatedAt = time + 1, handleError(err); } finally { Listener = listener, Owner = owner; } (!node.updatedAt || node.updatedAt <= time) && (node.updatedAt != null && "observers" in node ? writeSignal(node, nextValue) : node.value = nextValue, node.updatedAt = time); } function createComputation(fn, init, pure, state = STALE, options) { const c = { fn, state, updatedAt: null, owned: null, sources: null, sourceSlots: null, cleanups: null, value: init, owner: Owner, context: Owner ? Owner.context : null, pure }; return Owner === null || Owner !== UNOWNED && (Owner.owned ? Owner.owned.push(c) : Owner.owned = [c]), c; } function runTop(node) { if (node.state === 0) return; if (node.state === PENDING) return lookUpstream(node); if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node); const ancestors = [node]; for (; (node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount); ) node.state && ancestors.push(node); for (let i = ancestors.length - 1; i >= 0; i--) if (node = ancestors[i], node.state === STALE) updateComputation(node); else if (node.state === PENDING) { const updates = Updates; Updates = null, runUpdates(() => lookUpstream(node, ancestors[0]), !1), Updates = updates; } } function runUpdates(fn, init) { if (Updates) return fn(); let wait = !1; init || (Updates = []), Effects ? wait = !0 : Effects = [], ExecCount++; try { const res = fn(); return completeUpdates(wait), res; } catch (err) { wait || (Effects = null), Updates = null, handleError(err); } } function completeUpdates(wait) { if (Updates && (runQueue(Updates), Updates = null), wait) return; const e = Effects; Effects = null, e.length && runUpdates(() => runEffects(e), !1); } function runQueue(queue) { for (let i = 0; i < queue.length; i++) runTop(queue[i]); } function runUserEffects(queue) { let i, userLength = 0; for (i = 0; i < queue.length; i++) { const e = queue[i]; e.user ? queue[userLength++] = e : runTop(e); } for (i = 0; i < userLength; i++) runTop(queue[i]); } function lookUpstream(node, ignore) { node.state = 0; for (let i = 0; i < node.sources.length; i += 1) { const source = node.sources[i]; if (source.sources) { const state = source.state; state === STALE ? source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount) && runTop(source) : state === PENDING && lookUpstream(source, ignore); } } } function markDownstream(node) { for (let i = 0; i < node.observers.length; i += 1) { const o = node.observers[i]; o.state || (o.state = PENDING, o.pure ? Updates.push(o) : Effects.push(o), o.observers && markDownstream(o)); } } function cleanNode(node) { let i; if (node.sources) for (; node.sources.length; ) { const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers; if (obs && obs.length) { const n = obs.pop(), s = source.observerSlots.pop(); index < obs.length && (n.sourceSlots[s] = index, obs[index] = n, source.observerSlots[index] = s); } } if (node.owned) { for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); node.owned = null; } if (node.cleanups) { for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); node.cleanups = null; } node.state = 0; } function castError(err) { return err instanceof Error ? err : new Error(typeof err == "string" ? err : "Unknown error", { cause: err }); } function handleError(err, owner = Owner) { throw castError(err); } function resolveChildren(children2) { if (typeof children2 == "function" && !children2.length) return resolveChildren(children2()); if (Array.isArray(children2)) { const results = []; for (let i = 0; i < children2.length; i++) { const result = resolveChildren(children2[i]); Array.isArray(result) ? results.push.apply(results, result) : results.push(result); } return results; } return children2; } function createProvider(id, options) { return function(props) { let res; return createRenderEffect(() => res = untrack(() => (Owner.context = { ...Owner.context, [id]: props.value }, children(() => props.children))), void 0), res; }; } const FALLBACK = Symbol("fallback"); function dispose(d) { for (let i = 0; i < d.length; i++) d[i](); } function mapArray(list, mapFn, options = {}) { let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null; return onCleanup(() => dispose(disposers)), () => { let newItems = list() || [], newLen = newItems.length, i, j2; return newItems[$TRACK], untrack(() => { let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item; if (newLen === 0) len !== 0 && (dispose(disposers), disposers = [], items = [], mapped = [], len = 0, indexes && (indexes = [])), options.fallback && (items = [FALLBACK], mapped[0] = createRoot((disposer) => (disposers[0] = disposer, options.fallback())), len = 1); else if (len === 0) { for (mapped = new Array(newLen), j2 = 0; j2 < newLen; j2++) items[j2] = newItems[j2], mapped[j2] = createRoot(mapper); len = newLen; } else { for (temp = new Array(newLen), tempdisposers = new Array(newLen), indexes && (tempIndexes = new Array(newLen)), start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++) ; for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) temp[newEnd] = mapped[end], tempdisposers[newEnd] = disposers[end], indexes && (tempIndexes[newEnd] = indexes[end]); for (newIndices = /* @__PURE__ */ new Map(), newIndicesNext = new Array(newEnd + 1), j2 = newEnd; j2 >= start; j2--) item = newItems[j2], i = newIndices.get(item), newIndicesNext[j2] = i === void 0 ? -1 : i, newIndices.set(item, j2); for (i = start; i <= end; i++) item = items[i], j2 = newIndices.get(item), j2 !== void 0 && j2 !== -1 ? (temp[j2] = mapped[i], tempdisposers[j2] = disposers[i], indexes && (tempIndexes[j2] = indexes[i]), j2 = newIndicesNext[j2], newIndices.set(item, j2)) : disposers[i](); for (j2 = start; j2 < newLen; j2++) j2 in temp ? (mapped[j2] = temp[j2], disposers[j2] = tempdisposers[j2], indexes && (indexes[j2] = tempIndexes[j2], indexes[j2](j2))) : mapped[j2] = createRoot(mapper); mapped = mapped.slice(0, len = newLen), items = newItems.slice(0); } return mapped; }); function mapper(disposer) { if (disposers[j2] = disposer, indexes) { const [s, set] = createSignal(j2); return indexes[j2] = set, mapFn(newItems[j2], s); } return mapFn(newItems[j2]); } }; } let hydrationEnabled = !1; function createComponent(Comp, props) { return untrack(() => Comp(props || {})); } const narrowedError = (name) => `Stale read from <${name}>.`; function For(props) { const fallback = "fallback" in props && { fallback: () => props.fallback }; return createMemo(mapArray(() => props.each, props.children, fallback || void 0)); } function Show(props) { const keyed = props.keyed, condition = createMemo(() => props.when, void 0, { equals: (a, b) => keyed ? a === b : !a == !b }); return createMemo(() => { const c = condition(); if (c) { const child = props.children; return typeof child == "function" && child.length > 0 ? untrack(() => child(keyed ? c : () => { if (!untrack(condition)) throw narrowedError("Show"); return props.when; })) : child; } return props.fallback; }, void 0, void 0); } function Switch(props) { let keyed = !1; const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] == !b[1]) && a[2] === b[2], conditions = children(() => props.children), evalConditions = createMemo(() => { let conds = conditions(); Array.isArray(conds) || (conds = [conds]); for (let i = 0; i < conds.length; i++) { const c = conds[i].when; if (c) return keyed = !!conds[i].keyed, [i, c, conds[i]]; } return [-1]; }, void 0, { equals }); return createMemo(() => { const [index, when, cond] = evalConditions(); if (index < 0) return props.fallback; const c = cond.children; return typeof c == "function" && c.length > 0 ? untrack(() => c(keyed ? when : () => { if (untrack(evalConditions)[0] !== index) throw narrowedError("Match"); return cond.when; })) : c; }, void 0, void 0); } function Match(props) { return props; } function reconcileArrays(parentNode, a, b) { let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null; for (; aStart < aEnd || bStart < bEnd; ) { if (a[aStart] === b[bStart]) { aStart++, bStart++; continue; } for (; a[aEnd - 1] === b[bEnd - 1]; ) aEnd--, bEnd--; if (aEnd === aStart) { const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after; for (; bStart < bEnd; ) parentNode.insertBefore(b[bStart++], node); } else if (bEnd === bStart) for (; aStart < aEnd; ) (!map || !map.has(a[aStart])) && a[aStart].remove(), aStart++; else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) { const node = a[--aEnd].nextSibling; parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling), parentNode.insertBefore(b[--bEnd], node), a[aEnd] = b[bEnd]; } else { if (!map) { map = /* @__PURE__ */ new Map(); let i = bStart; for (; i < bEnd; ) map.set(b[i], i++); } const index = map.get(a[aStart]); if (index != null) if (bStart < index && index < bEnd) { let i = aStart, sequence = 1, t; for (; ++i < aEnd && i < bEnd && !((t = map.get(a[i])) == null || t !== index + sequence); ) sequence++; if (sequence > index - bStart) { const node = a[aStart]; for (; bStart < index; ) parentNode.insertBefore(b[bStart++], node); } else parentNode.replaceChild(b[bStart++], a[aStart++]); } else aStart++; else a[aStart++].remove(); } } } const $$EVENTS = "_$DX_DELEGATE"; function render(code, element, init, options = {}) { let disposer; return createRoot((dispose2) => { disposer = dispose2, element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init); }, options.owner), () => { disposer(), element.textContent = ""; }; } function template(html, isCE, isSVG) { let node; const create = () => { const t = document.createElement("template"); return t.innerHTML = html, t.content.firstChild; }, fn = () => (node || (node = create())).cloneNode(!0); return fn.cloneNode = fn, fn; } function delegateEvents(eventNames, document2 = window.document) { const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set()); for (let i = 0, l = eventNames.length; i < l; i++) { const name = eventNames[i]; e.has(name) || (e.add(name), document2.addEventListener(name, eventHandler)); } } function setAttribute(node, name, value) { value == null ? node.removeAttribute(name) : node.setAttribute(name, value); } function className(node, value) { value == null ? node.removeAttribute("class") : node.className = value; } function use(fn, element, arg) { return untrack(() => fn(element, arg)); } function insert(parent, accessor, marker, initial) { if (marker !== void 0 && !initial && (initial = []), typeof accessor != "function") return insertExpression(parent, accessor, initial, marker); createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial); } function eventHandler(e) { const key = `$$${e.type}`; let node = e.composedPath && e.composedPath()[0] || e.target; for (e.target !== node && Object.defineProperty(e, "target", { configurable: !0, value: node }), Object.defineProperty(e, "currentTarget", { configurable: !0, get() { return node || document; } }); node; ) { const handler = node[key]; if (handler && !node.disabled) { const data = node[`${key}Data`]; if (data !== void 0 ? handler.call(node, data, e) : handler.call(node, e), e.cancelBubble) return; } node = node._$host || node.parentNode || node.host; } } function insertExpression(parent, value, current, marker, unwrapArray) { for (; typeof current == "function"; ) current = current(); if (value === current) return current; const t = typeof value, multi = marker !== void 0; if (parent = multi && current[0] && current[0].parentNode || parent, t === "string" || t === "number") { if (t === "number" && (value = value.toString(), value === current)) return current; if (multi) { let node = current[0]; node && node.nodeType === 3 ? node.data !== value && (node.data = value) : node = document.createTextNode(value), current = cleanChildren(parent, current, marker, node); } else current !== "" && typeof current == "string" ? current = parent.firstChild.data = value : current = parent.textContent = value; } else if (value == null || t === "boolean") current = cleanChildren(parent, current, marker); else { if (t === "function") return createRenderEffect(() => { let v = value(); for (; typeof v == "function"; ) v = v(); current = insertExpression(parent, v, current, marker); }), () => current; if (Array.isArray(value)) { const array = [], currentArray = current && Array.isArray(current); if (normalizeIncomingArray(array, value, current, unwrapArray)) return createRenderEffect(() => current = insertExpression(parent, array, current, marker, !0)), () => current; if (array.length === 0) { if (current = cleanChildren(parent, current, marker), multi) return current; } else currentArray ? current.length === 0 ? appendNodes(parent, array, marker) : reconcileArrays(parent, current, array) : (current && cleanChildren(parent), appendNodes(parent, array)); current = array; } else if (value.nodeType) { if (Array.isArray(current)) { if (multi) return current = cleanChildren(parent, current, marker, value); cleanChildren(parent, current, null, value); } else current == null || current === "" || !parent.firstChild ? parent.appendChild(value) : parent.replaceChild(value, parent.firstChild); current = value; } } return current; } function normalizeIncomingArray(normalized, array, current, unwrap2) { let dynamic = !1; for (let i = 0, len = array.length; i < len; i++) { let item = array[i], prev = current && current[normalized.length], t; if (!(item == null || item === !0 || item === !1)) if ((t = typeof item) == "object" && item.nodeType) normalized.push(item); else if (Array.isArray(item)) dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic; else if (t === "function") if (unwrap2) { for (; typeof item == "function"; ) item = item(); dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic; } else normalized.push(item), dynamic = !0; else { const value = String(item); prev && prev.nodeType === 3 && prev.data === value ? normalized.push(prev) : normalized.push(document.createTextNode(value)); } } return dynamic; } function appendNodes(parent, array, marker = null) { for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker); } function cleanChildren(parent, current, marker, replacement) { if (marker === void 0) return parent.textContent = ""; const node = replacement || document.createTextNode(""); if (current.length) { let inserted = !1; for (let i = current.length - 1; i >= 0; i--) { const el = current[i]; if (node !== el) { const isParent = el.parentNode === parent; !inserted && !i ? isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker) : isParent && el.remove(); } else inserted = !0; } } else parent.insertBefore(node, marker); return [node]; } const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; function createElement(tagName, isSVG = !1) { return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName); } function Portal(props) { const { useShadow } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner(); let content, hydrating = !!sharedConfig.context; return createEffect(() => { content || (content = runWithOwner(owner, () => createMemo(() => props.children))); const el = mount(); if (el instanceof HTMLHeadElement) { const [clean, setClean] = createSignal(!1), cleanup = () => setClean(!0); createRoot((dispose2) => insert(el, () => clean() ? dispose2() : content(), null)), onCleanup(cleanup); } else { const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({ mode: "open" }) : container; Object.defineProperty(container, "_$host", { get() { return marker.parentNode; }, configurable: !0 }), insert(renderRoot, content), el.appendChild(container), props.ref && props.ref(container), onCleanup(() => el.removeChild(container)); } }, void 0, { render: !hydrating }), marker; } const $RAW = Symbol("store-raw"), $NODE = Symbol("store-node"), $HAS = Symbol("store-has"), $SELF = Symbol("store-self"); function wrap$1(value) { let p = value[$PROXY]; if (!p && (Object.defineProperty(value, $PROXY, { value: p = new Proxy(value, proxyTraps$1) }), !Array.isArray(value))) { const keys = Object.keys(value), desc = Object.getOwnPropertyDescriptors(value); for (let i = 0, l = keys.length; i < l; i++) { const prop = keys[i]; desc[prop].get && Object.defineProperty(value, prop, { enumerable: desc[prop].enumerable, get: desc[prop].get.bind(p) }); } } return p; } function isWrappable(obj) { let proto; return obj != null && typeof obj == "object" && (obj[$PROXY] || !(proto = Object.getPrototypeOf(obj)) || proto === Object.prototype || Array.isArray(obj)); } function unwrap(item, set = /* @__PURE__ */ new Set()) { let result, unwrapped, v, prop; if (result = item != null && item[$RAW]) return result; if (!isWrappable(item) || set.has(item)) return item; if (Array.isArray(item)) { Object.isFrozen(item) ? item = item.slice(0) : set.add(item); for (let i = 0, l = item.length; i < l; i++) v = item[i], (unwrapped = unwrap(v, set)) !== v && (item[i] = unwrapped); } else { Object.isFrozen(item) ? item = Object.assign({}, item) : set.add(item); const keys = Object.keys(item), desc = Object.getOwnPropertyDescriptors(item); for (let i = 0, l = keys.length; i < l; i++) prop = keys[i], !desc[prop].get && (v = item[prop], (unwrapped = unwrap(v, set)) !== v && (item[prop] = unwrapped)); } return item; } function getNodes(target, symbol) { let nodes = target[symbol]; return nodes || Object.defineProperty(target, symbol, { value: nodes = /* @__PURE__ */ Object.create(null) }), nodes; } function getNode(nodes, property, value) { if (nodes[property]) return nodes[property]; const [s, set] = createSignal(value, { equals: !1, internal: !0 }); return s.$ = set, nodes[property] = s; } function proxyDescriptor$1(target, property) { const desc = Reflect.getOwnPropertyDescriptor(target, property); return !desc || desc.get || !desc.configurable || property === $PROXY || property === $NODE || (delete desc.value, delete desc.writable, desc.get = () => target[$PROXY][property]), desc; } function trackSelf(target) { getListener() && getNode(getNodes(target, $NODE), $SELF)(); } function ownKeys(target) { return trackSelf(target), Reflect.ownKeys(target); } const proxyTraps$1 = { get(target, property, receiver) { if (property === $RAW) return target; if (property === $PROXY) return receiver; if (property === $TRACK) return trackSelf(target), receiver; const nodes = getNodes(target, $NODE), tracked = nodes[property]; let value = tracked ? tracked() : target[property]; if (property === $NODE || property === $HAS || property === "__proto__") return value; if (!tracked) { const desc = Object.getOwnPropertyDescriptor(target, property); getListener() && (typeof value != "function" || target.hasOwnProperty(property)) && !(desc && desc.get) && (value = getNode(nodes, property, value)()); } return isWrappable(value) ? wrap$1(value) : value; }, has(target, property) { return property === $RAW || property === $PROXY || property === $TRACK || property === $NODE || property === $HAS || property === "__proto__" ? !0 : (getListener() && getNode(getNodes(target, $HAS), property)(), property in target); }, set() { return !0; }, deleteProperty() { return !0; }, ownKeys, getOwnPropertyDescriptor: proxyDescriptor$1 }; function setProperty(state, property, value, deleting = !1) { if (!deleting && state[property] === value) return; const prev = state[property], len = state.length; value === void 0 ? (delete state[property], state[$HAS] && state[$HAS][property] && prev !== void 0 && state[$HAS][property].$()) : (state[property] = value, state[$HAS] && state[$HAS][property] && prev === void 0 && state[$HAS][property].$()); let nodes = getNodes(state, $NODE), node; if ((node = getNode(nodes, property, prev)) && node.$(() => value), Array.isArray(state) && state.length !== len) { for (let i = state.length; i < len; i++) (node = nodes[i]) && node.$(); (node = getNode(nodes, "length", len)) && node.$(state.length); } (node = nodes[$SELF]) && node.$(); } function mergeStoreNode(state, value) { const keys = Object.keys(value); for (let i = 0; i < keys.length; i += 1) { const key = keys[i]; setProperty(state, key, value[key]); } } function updateArray(current, next) { if (typeof next == "function" && (next = next(current)), next = unwrap(next), Array.isArray(next)) { if (current === next) return; let i = 0, len = next.length; for (; i < len; i++) { const value = next[i]; current[i] !== value && setProperty(current, i, value); } setProperty(current, "length", len); } else mergeStoreNode(current, next); } function updatePath(current, path, traversed = []) { let part, prev = current; if (path.length > 1) { part = path.shift(); const partType = typeof part, isArray = Array.isArray(current); if (Array.isArray(part)) { for (let i = 0; i < part.length; i++) updatePath(current, [part[i]].concat(path), traversed); return; } else if (isArray && partType === "function") { for (let i = 0; i < current.length; i++) part(current[i], i) && updatePath(current, [i].concat(path), traversed); return; } else if (isArray && partType === "object") { const { from = 0, to = current.length - 1, by = 1 } = part; for (let i = from; i <= to; i += by) updatePath(current, [i].concat(path), traversed); return; } else if (path.length > 1) { updatePath(current[part], path, [part].concat(traversed)); return; } prev = current[part], traversed = [part].concat(traversed); } let value = path[0]; typeof value == "function" && (value = value(prev, traversed), value === prev) || part === void 0 && value == null || (value = unwrap(value), part === void 0 || isWrappable(prev) && isWrappable(value) && !Array.isArray(value) ? mergeStoreNode(prev, value) : setProperty(current, part, value)); } function createStore(...[store, options]) { const unwrappedStore = unwrap(store || {}), isArray = Array.isArray(unwrappedStore), wrappedStore = wrap$1(unwrappedStore); function setStore(...args) { batch(() => { isArray && args.length === 1 ? updateArray(unwrappedStore, args[0]) : updatePath(unwrappedStore, args); }); } return [wrappedStore, setStore]; } const producers = /* @__PURE__ */ new WeakMap(), setterTraps = { get(target, property) { if (property === $RAW) return target; const value = target[property]; let proxy; return isWrappable(value) ? producers.get(value) || (producers.set(value, proxy = new Proxy(value, setterTraps)), proxy) : value; }, set(target, property, value) { return setProperty(target, property, unwrap(value)), !0; }, deleteProperty(target, property) { return setProperty(target, property, void 0, !0), !0; } }; function produce(fn) { return (state) => { if (isWrappable(state)) { let proxy; (proxy = producers.get(state)) || producers.set(state, proxy = new Proxy(state, setterTraps)), fn(proxy); } return state; }; } const downloadSVG = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1em'%20height='1em'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23ffffff'%20d='m12%2016l-5-5l1.4-1.45l2.6%202.6V4h2v8.15l2.6-2.6L17%2011zm-6%204q-.825%200-1.412-.587T4%2018v-3h2v3h12v-3h2v3q0%20.825-.587%201.413T18%2020z'%20/%3e%3c/svg%3e"; var _tmpl$$2 = /* @__PURE__ */ template("