MediaWiki:Gadget-CurrencyConverter.js: различия между версиями

Нет описания правки
Нет описания правки
Строка 1: Строка 1:
var _a;
var _a, _b, _c;
const DEV = false;
const DEV = false;
var is_array = Array.isArray;
var is_array = Array.isArray;
Строка 475: Строка 475:
     ),
     ),
     wv: 0,
     wv: 0,
     parent: parent_derived ?? active_effect
     parent: parent_derived != null ? parent_derived : active_effect
   };
   };
   return signal;
   return signal;
Строка 538: Строка 538:
}
}
function create_effect(type, fn, sync, push2 = true) {
function create_effect(type, fn, sync, push2 = true) {
  var _a2;
   var parent = active_effect;
   var parent = active_effect;
   var effect2 = {
   var effect2 = {
Строка 576: Строка 577:
         active_reaction
         active_reaction
       );
       );
       (derived2.effects ?? (derived2.effects = [])).push(effect2);
       ((_a2 = derived2.effects) != null ? _a2 : derived2.effects = []).push(effect2);
     }
     }
   }
   }
Строка 773: Строка 774:
}
}
function check_dirtiness(reaction) {
function check_dirtiness(reaction) {
   var _a2;
   var _a2, _b2;
   var flags = reaction.f;
   var flags = reaction.f;
   if ((flags & DIRTY) !== 0) {
   if ((flags & DIRTY) !== 0) {
Строка 796: Строка 797:
           dependency = dependencies[i];
           dependency = dependencies[i];
           if (is_disconnected || !((_a2 = dependency == null ? void 0 : dependency.reactions) == null ? void 0 : _a2.includes(derived2))) {
           if (is_disconnected || !((_a2 = dependency == null ? void 0 : dependency.reactions) == null ? void 0 : _a2.includes(derived2))) {
             (dependency.reactions ?? (dependency.reactions = [])).push(derived2);
             ((_b2 = dependency.reactions) != null ? _b2 : dependency.reactions = []).push(derived2);
           }
           }
         }
         }
Строка 835: Строка 836:
         current.fn(error);
         current.fn(error);
         return;
         return;
       } catch {
       } catch (e) {
         current.f ^= BOUNDARY_EFFECT;
         current.f ^= BOUNDARY_EFFECT;
       }
       }
Строка 891: Строка 892:
}
}
function update_reaction(reaction) {
function update_reaction(reaction) {
   var _a2;
   var _a2, _b2;
   var previous_deps = new_deps;
   var previous_deps = new_deps;
   var previous_skipped_deps = skipped_deps;
   var previous_skipped_deps = skipped_deps;
Строка 930: Строка 931:
       if (!skip_reaction) {
       if (!skip_reaction) {
         for (i = skipped_deps; i < deps.length; i++) {
         for (i = skipped_deps; i < deps.length; i++) {
           ((_a2 = deps[i]).reactions ?? (_a2.reactions = [])).push(reaction);
           ((_b2 = (_a2 = deps[i]).reactions) != null ? _b2 : _a2.reactions = []).push(reaction);
         }
         }
       }
       }
Строка 1407: Строка 1408:
}
}
function set_text(text, value) {
function set_text(text, value) {
  var _a2;
   var str = value == null ? "" : typeof value === "object" ? value + "" : value;
   var str = value == null ? "" : typeof value === "object" ? value + "" : value;
   if (str !== (text.__t ?? (text.__t = text.nodeValue))) {
   if (str !== ((_a2 = text.__t) != null ? _a2 : text.__t = text.nodeValue)) {
     text.__t = str;
     text.__t = str;
     text.nodeValue = str + "";
     text.nodeValue = str + "";
Строка 1440: Строка 1442:
   var component = void 0;
   var component = void 0;
   var unmount = component_root(() => {
   var unmount = component_root(() => {
     var anchor_node = anchor ?? target.appendChild(create_text());
     var anchor_node = anchor != null ? anchor : target.appendChild(create_text());
     branch(() => {
     branch(() => {
       if (context) {
       if (context) {
Строка 1500: Строка 1502:
     return clsx$1(value);
     return clsx$1(value);
   } else {
   } else {
     return value ?? "";
     return value != null ? value : "";
   }
   }
}
}
Строка 1568: Строка 1570:
}
}
function get_attributes(element) {
function get_attributes(element) {
  var _a2;
   return (
   return (
     /** @type {Record<string | symbol, unknown>} **/
     /** @type {Record<string | symbol, unknown>} **/
     // @ts-expect-error
     // @ts-expect-error
     element.__attributes ?? (element.__attributes = {
     (_a2 = element.__attributes) != null ? _a2 : element.__attributes = {
       [IS_CUSTOM_ELEMENT]: element.nodeName.includes("-"),
       [IS_CUSTOM_ELEMENT]: element.nodeName.includes("-"),
       [IS_HTML]: element.namespaceURI === NAMESPACE_HTML
       [IS_HTML]: element.namespaceURI === NAMESPACE_HTML
     })
     }
   );
   );
}
}
Строка 1605: Строка 1608:
       var start = input.selectionStart;
       var start = input.selectionStart;
       var end = input.selectionEnd;
       var end = input.selectionEnd;
       input.value = value ?? "";
       input.value = value != null ? value : "";
       if (end !== null) {
       if (end !== null) {
         input.selectionStart = start;
         input.selectionStart = start;
Строка 1630: Строка 1633:
     }
     }
     if (value !== input.value) {
     if (value !== input.value) {
       input.value = value ?? "";
       input.value = value != null ? value : "";
     }
     }
   });
   });
Строка 1643: Строка 1646:
const PUBLIC_VERSION = "5";
const PUBLIC_VERSION = "5";
if (typeof window !== "undefined") {
if (typeof window !== "undefined") {
   ((_a = window.__svelte ?? (window.__svelte = {})).v ?? (_a.v = /* @__PURE__ */ new Set())).add(PUBLIC_VERSION);
   ((_c = (_b = (_a = window.__svelte) != null ? _a : window.__svelte = {}).v) != null ? _c : _b.v = /* @__PURE__ */ new Set()).add(PUBLIC_VERSION);
}
}
enable_legacy_mode_flag();
enable_legacy_mode_flag();
Строка 1742: Строка 1745:
   set_attribute(img_1, "src", diamondIcon);
   set_attribute(img_1, "src", diamondIcon);
   template_effect(() => {
   template_effect(() => {
    var _a2;
     set_text(text, get(sum));
     set_text(text, get(sum));
     set_text(text_1, `(~ ${get(diamonds) ?? ""} `);
     set_text(text_1, `(~ ${(_a2 = get(diamonds)) != null ? _a2 : ""} `);
   });
   });
   append($$anchor, div);
   append($$anchor, div);
Строка 1823: Строка 1827:
   template_effect(
   template_effect(
     ($0) => {
     ($0) => {
      var _a2;
       classes = set_class(input, 1, "svelte-mzgtwq", null, classes, $0);
       classes = set_class(input, 1, "svelte-mzgtwq", null, classes, $0);
       set_text(text, `(${get(sum) ?? ""})`);
       set_text(text, `(${(_a2 = get(sum)) != null ? _a2 : ""})`);
     },
     },
     [
     [