MediaWiki:Gadget-CurrencyConverter.js: различия между версиями
Hloth (обсуждение | вклад) Новая страница: «(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function e(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPoli...» |
Hloth (обсуждение | вклад) demovio.lol -> demovio.love |
||
| (не показано 5 промежуточных версий этого же участника) | |||
| Строка 1: | Строка 1: | ||
/* CSS: https://wiki.demovio.lovel/MediaWiki:Gadget-CurrencyConverter.css */ | |||
var _a, _b, _c; | |||
const DEV = false; | |||
var is_array = Array.isArray; | |||
var index_of = Array.prototype.indexOf; | |||
var array_from = Array.from; | |||
var define_property = Object.defineProperty; | |||
var get_descriptor = Object.getOwnPropertyDescriptor; | |||
var get_descriptors = Object.getOwnPropertyDescriptors; | |||
var object_prototype = Object.prototype; | |||
var array_prototype = Array.prototype; | |||
var get_prototype_of = Object.getPrototypeOf; | |||
const noop = () => { | |||
}; | |||
const DERIVED = 1 << 1; | |||
const EFFECT = 1 << 2; | |||
const RENDER_EFFECT = 1 << 3; | |||
const BLOCK_EFFECT = 1 << 4; | |||
const BRANCH_EFFECT = 1 << 5; | |||
const ROOT_EFFECT = 1 << 6; | |||
const BOUNDARY_EFFECT = 1 << 7; | |||
const UNOWNED = 1 << 8; | |||
const DISCONNECTED = 1 << 9; | |||
const CLEAN = 1 << 10; | |||
const DIRTY = 1 << 11; | |||
const MAYBE_DIRTY = 1 << 12; | |||
const INERT = 1 << 13; | |||
const DESTROYED = 1 << 14; | |||
const EFFECT_RAN = 1 << 15; | |||
const EFFECT_TRANSPARENT = 1 << 16; | |||
const HEAD_EFFECT = 1 << 19; | |||
const EFFECT_HAS_DERIVED = 1 << 20; | |||
const STATE_SYMBOL = Symbol("$state"); | |||
const LOADING_ATTR_SYMBOL = Symbol(""); | |||
function equals(value) { | |||
return value === this.v; | |||
} | |||
function effect_update_depth_exceeded() { | |||
{ | |||
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`); | |||
} | |||
} | |||
function state_descriptors_fixed() { | |||
{ | |||
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`); | |||
} | |||
} | |||
function state_prototype_fixed() { | |||
{ | |||
throw new Error(`https://svelte.dev/e/state_prototype_fixed`); | |||
} | |||
} | |||
function state_unsafe_local_read() { | |||
{ | |||
throw new Error(`https://svelte.dev/e/state_unsafe_local_read`); | |||
} | |||
} | |||
function state_unsafe_mutation() { | |||
{ | |||
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`); | |||
} | |||
} | |||
let legacy_mode_flag = false; | |||
let tracing_mode_flag = false; | |||
function enable_legacy_mode_flag() { | |||
legacy_mode_flag = true; | |||
} | |||
const TEMPLATE_FRAGMENT = 1; | |||
const TEMPLATE_USE_IMPORT_NODE = 1 << 1; | |||
const UNINITIALIZED = Symbol(); | |||
const NAMESPACE_HTML = "http://www.w3.org/1999/xhtml"; | |||
let component_context = null; | |||
function set_component_context(context) { | |||
component_context = context; | |||
} | |||
function push(props, runes = false, fn) { | |||
var ctx = component_context = { | |||
p: component_context, | |||
c: null, | |||
d: false, | |||
e: null, | |||
m: false, | |||
s: props, | |||
x: null, | |||
l: null | |||
}; | |||
if (legacy_mode_flag && !runes) { | |||
component_context.l = { | |||
s: null, | |||
u: null, | |||
r1: [], | |||
r2: source(false) | |||
}; | |||
} | |||
teardown(() => { | |||
ctx.d = true; | |||
}); | |||
} | |||
function pop(component) { | |||
const context_stack_item = component_context; | |||
if (context_stack_item !== null) { | |||
const component_effects = context_stack_item.e; | |||
if (component_effects !== null) { | |||
var previous_effect = active_effect; | |||
var previous_reaction = active_reaction; | |||
context_stack_item.e = null; | |||
try { | |||
for (var i = 0; i < component_effects.length; i++) { | |||
var component_effect = component_effects[i]; | |||
set_active_effect(component_effect.effect); | |||
set_active_reaction(component_effect.reaction); | |||
effect(component_effect.fn); | |||
} | |||
} finally { | |||
set_active_effect(previous_effect); | |||
set_active_reaction(previous_reaction); | |||
} | |||
} | |||
component_context = context_stack_item.p; | |||
context_stack_item.m = true; | |||
} | |||
return ( | |||
/** @type {T} */ | |||
{} | |||
); | |||
} | |||
function is_runes() { | |||
return !legacy_mode_flag || component_context !== null && component_context.l === null; | |||
} | |||
const old_values = /* @__PURE__ */ new Map(); | |||
function source(v, stack) { | |||
var signal = { | |||
f: 0, | |||
// TODO ideally we could skip this altogether, but it causes type errors | |||
v, | |||
reactions: null, | |||
equals, | |||
rv: 0, | |||
wv: 0 | |||
}; | |||
return signal; | |||
} | |||
function state(v) { | |||
return /* @__PURE__ */ push_derived_source(source(v)); | |||
} | |||
// @__NO_SIDE_EFFECTS__ | |||
function push_derived_source(source2) { | |||
if (active_reaction !== null && !untracking && (active_reaction.f & DERIVED) !== 0) { | |||
if (derived_sources === null) { | |||
set_derived_sources([source2]); | |||
} else { | |||
derived_sources.push(source2); | |||
} | |||
} | |||
return source2; | |||
} | |||
function set(source2, value) { | |||
if (active_reaction !== null && !untracking && is_runes() && (active_reaction.f & (DERIVED | BLOCK_EFFECT)) !== 0 && // If the source was created locally within the current derived, then | |||
// we allow the mutation. | |||
(derived_sources === null || !derived_sources.includes(source2))) { | |||
state_unsafe_mutation(); | |||
} | |||
return internal_set(source2, value); | |||
} | |||
function internal_set(source2, value) { | |||
if (!source2.equals(value)) { | |||
var old_value = source2.v; | |||
if (is_destroying_effect) { | |||
old_values.set(source2, value); | |||
} else { | |||
old_values.set(source2, old_value); | |||
} | |||
source2.v = value; | |||
source2.wv = increment_write_version(); | |||
mark_reactions(source2, DIRTY); | |||
if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) { | |||
if (untracked_writes === null) { | |||
set_untracked_writes([source2]); | |||
} else { | |||
untracked_writes.push(source2); | |||
} | |||
} | |||
} | |||
return value; | |||
} | |||
function mark_reactions(signal, status) { | |||
var reactions = signal.reactions; | |||
if (reactions === null) return; | |||
var runes = is_runes(); | |||
var length = reactions.length; | |||
for (var i = 0; i < length; i++) { | |||
var reaction = reactions[i]; | |||
var flags = reaction.f; | |||
if ((flags & DIRTY) !== 0) continue; | |||
if (!runes && reaction === active_effect) continue; | |||
set_signal_status(reaction, status); | |||
if ((flags & (CLEAN | UNOWNED)) !== 0) { | |||
if ((flags & DERIVED) !== 0) { | |||
mark_reactions( | |||
/** @type {Derived} */ | |||
reaction, | |||
MAYBE_DIRTY | |||
); | |||
} else { | |||
schedule_effect( | |||
/** @type {Effect} */ | |||
reaction | |||
); | |||
} | |||
} | |||
} | |||
} | |||
function proxy(value, parent = null, prev) { | |||
if (typeof value !== "object" || value === null || STATE_SYMBOL in value) { | |||
return value; | |||
} | |||
const prototype = get_prototype_of(value); | |||
if (prototype !== object_prototype && prototype !== array_prototype) { | |||
return value; | |||
} | |||
var sources = /* @__PURE__ */ new Map(); | |||
var is_proxied_array = is_array(value); | |||
var version = source(0); | |||
if (is_proxied_array) { | |||
sources.set("length", source( | |||
/** @type {any[]} */ | |||
value.length | |||