// ==UserScript== // @name Dollchan Extension Tools // @version 24.9.16.0 // @namespace http://www.freedollchan.org/scripts/* // @author Sthephan Shinkufag @ FreeDollChan // @copyright © Dollchan Extension Team. See the LICENSE file for license rights and limitations (MIT). // @description Doing some profit for imageboards // @icon https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/master/Icon.png // @updateURL https://raw.github.com/SthephanShinkufag/Dollchan-Extension-Tools/master/Dollchan_Extension_Tools.meta.js // @nocompat Chrome // @run-at document-start // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_openInTab // @grant GM_xmlhttpRequest // @grant GM.getValue // @grant GM.setValue // @grant GM.deleteValue // @grant GM.xmlHttpRequest // @grant unsafeWindow // @include * // ==/UserScript== /* eslint-disable */ (function deMainFuncOuter(localData) { (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined); var iteratorMethod = getIteratorMethod(O); var index = 0; var length, result, step, iterator, next, value; if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { result = IS_CONSTRUCTOR ? new this() : []; iterator = getIterator(O, iteratorMethod); next = iterator.next; for (;!(step = call(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); } } else { length = lengthOfArrayLike(O); result = IS_CONSTRUCTOR ? new this(length) : $Array(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } setArrayLength(result, index); return result; }; },{"../internals/array-set-length":71,"../internals/call-with-safe-iteration-closing":75,"../internals/create-property":89,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-iterator":126,"../internals/get-iterator-method":125,"../internals/is-array-iterator-method":142,"../internals/is-constructor":145,"../internals/length-of-array-like":162,"../internals/to-object":242}],68:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); if (length === 0) return !IS_INCLUDES && -1; 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) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { includes: createMethod(true), indexOf: createMethod(false) }; },{"../internals/length-of-array-like":162,"../internals/to-absolute-index":238,"../internals/to-indexed-object":239}],69:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var IndexedObject = require('../internals/indexed-object'); var toObject = require('../internals/to-object'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var arraySpeciesCreate = require('../internals/array-species-create'); var createProperty = require('../internals/create-property'); var createMethod = function (TYPE) { var IS_MAP = TYPE === 1; var IS_FILTER = TYPE === 2; var IS_SOME = TYPE === 3; var IS_EVERY = TYPE === 4; var IS_FIND_INDEX = TYPE === 6; var IS_FILTER_REJECT = TYPE === 7; var NO_HOLES = TYPE === 5 || IS_FIND_INDEX; return function ($this, callbackfn, that) { var O = toObject($this); var self = IndexedObject(O); var length = lengthOfArrayLike(self); var boundFunction = bind(callbackfn, that); var index = 0; var resIndex = 0; var target = IS_MAP ? arraySpeciesCreate($this, length) : IS_FILTER || IS_FILTER_REJECT ? arraySpeciesCreate($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) createProperty(target, index, result); else if (result) switch (TYPE) { case 3: return true; case 5: return value; case 6: return index; case 2: createProperty(target, resIndex++, value); } else switch (TYPE) { case 4: return false; case 7: createProperty(target, resIndex++, value); } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; module.exports = { forEach: createMethod(0), map: createMethod(1), filter: createMethod(2), some: createMethod(3), every: createMethod(4), find: createMethod(5), findIndex: createMethod(6), filterReject: createMethod(7) }; },{"../internals/array-species-create":74,"../internals/create-property":89,"../internals/function-bind-context":116,"../internals/indexed-object":136,"../internals/length-of-array-like":162,"../internals/to-object":242}],70:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/environment-v8-version'); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { return V8_VERSION >= 51 || !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; },{"../internals/environment-v8-version":106,"../internals/fails":112,"../internals/well-known-symbol":256}],71:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var isArray = require('../internals/is-array'); var $TypeError = TypeError; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () { if (this !== undefined) return true; try { Object.defineProperty([], 'length', { writable: false }).length = 1; } catch (error) { return error instanceof TypeError; } }(); module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { throw new $TypeError('Cannot set read only .length'); } return O.length = length; } : function (O, length) { return O.length = length; }; },{"../internals/descriptors":94,"../internals/is-array":143}],72:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis([].slice); },{"../internals/function-uncurry-this":122}],73:[function(require,module,exports){ 'use strict'; var isArray = require('../internals/is-array'); var isConstructor = require('../internals/is-constructor'); var isObject = require('../internals/is-object'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); var $Array = Array; module.exports = function (originalArray) { var C; if (isArray(originalArray)) { C = originalArray.constructor; if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? $Array : C; }; },{"../internals/is-array":143,"../internals/is-constructor":145,"../internals/is-object":149,"../internals/well-known-symbol":256}],74:[function(require,module,exports){ 'use strict'; var arraySpeciesConstructor = require('../internals/array-species-constructor'); module.exports = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; },{"../internals/array-species-constructor":73}],75:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var iteratorClose = require('../internals/iterator-close'); module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose(iterator, 'throw', error); } }; },{"../internals/an-object":65,"../internals/iterator-close":157}],76:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); 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) { } module.exports = function (exec, SKIP_CLOSING) { try { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; } catch (error) { 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; }; },{"../internals/well-known-symbol":256}],77:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; },{"../internals/function-uncurry-this":122}],78:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var isCallable = require('../internals/is-callable'); var classofRaw = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; var tryGet = function (it, key) { try { return it[key]; } catch (error) { } }; module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; },{"../internals/classof-raw":77,"../internals/is-callable":144,"../internals/to-string-tag-support":246,"../internals/well-known-symbol":256}],79:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var anObject = require('../internals/an-object'); var toObject = require('../internals/to-object'); var iterate = require('../internals/iterate'); module.exports = function (C, adder, ENTRY) { return function from(source ) { var O = toObject(source); var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping = mapFn !== undefined; var boundFunction = mapping ? bind(mapFn, length > 2 ? arguments[2] : undefined) : undefined; var result = new C(); var n = 0; iterate(O, function (nextItem) { var entry = mapping ? boundFunction(nextItem, n++) : nextItem; if (ENTRY) adder(result, anObject(entry)[0], entry[1]); else adder(result, entry); }); return result; }; }; },{"../internals/an-object":65,"../internals/function-bind-context":116,"../internals/iterate":156,"../internals/to-object":242}],80:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); module.exports = function (C, adder, ENTRY) { return function of() { var result = new C(); var length = arguments.length; for (var index = 0; index < length; index++) { var entry = arguments[index]; if (ENTRY) adder(result, anObject(entry)[0], entry[1]); else adder(result, entry); } return result; }; }; },{"../internals/an-object":65}],81:[function(require,module,exports){ 'use strict'; var create = require('../internals/object-create'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var defineBuiltIns = require('../internals/define-built-ins'); var bind = require('../internals/function-bind-context'); var anInstance = require('../internals/an-instance'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var iterate = require('../internals/iterate'); var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); var setSpecies = require('../internals/set-species'); var DESCRIPTORS = require('../internals/descriptors'); var fastKey = require('../internals/internal-metadata').fastKey; var InternalStateModule = require('../internals/internal-state'); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; module.exports = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance(that, Prototype); setInternalState(that, { type: CONSTRUCTOR_NAME, index: create(null), first: null, last: null, size: 0 }); if (!DESCRIPTORS) that.size = 0; if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var entry = getEntry(that, key); var previous, index; if (entry) { entry.value = value; } else { state.last = entry = { index: index = fastKey(key, true), key: key, value: value, previous: previous = state.last, next: null, removed: false }; if (!state.first) state.first = entry; if (previous) previous.next = entry; if (DESCRIPTORS) state.size++; else that.size++; if (index !== 'F') state.index[index] = entry; } return that; }; var getEntry = function (that, key) { var state = getInternalState(that); var index = fastKey(key); var entry; if (index !== 'F') return state.index[index]; for (entry = state.first; entry; entry = entry.next) { if (entry.key === key) return entry; } }; defineBuiltIns(Prototype, { clear: function clear() { var that = this; var state = getInternalState(that); var entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = null; entry = entry.next; } state.first = state.last = null; state.index = create(null); if (DESCRIPTORS) state.size = 0; else that.size = 0; }, 'delete': function (key) { var that = this; var state = getInternalState(that); var entry = getEntry(that, key); if (entry) { var next = entry.next; var prev = entry.previous; delete state.index[entry.index]; entry.removed = true; if (prev) prev.next = next; if (next) next.previous = prev; if (state.first === entry) state.first = next; if (state.last === entry) state.last = prev; if (DESCRIPTORS) state.size--; else that.size--; } return !!entry; }, forEach: function forEach(callbackfn ) { var state = getInternalState(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var entry; while (entry = entry ? entry.next : state.first) { boundFunction(entry.value, entry.key, this); while (entry && entry.removed) entry = entry.previous; } }, has: function has(key) { return !!getEntry(this, key); } }); defineBuiltIns(Prototype, IS_MAP ? { get: function get(key) { var entry = getEntry(this, key); return entry && entry.value; }, set: function set(key, value) { return define(this, key === 0 ? 0 : key, value); } } : { add: function add(value) { return define(this, value = value === 0 ? 0 : value, value); } }); if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { configurable: true, get: function () { return getInternalState(this).size; } }); return Constructor; }, setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState(this, { type: ITERATOR_NAME, target: iterated, state: getInternalCollectionState(iterated), kind: kind, last: null }); }, function () { var state = getInternalIteratorState(this); var kind = state.kind; var entry = state.last; while (entry && entry.removed) entry = entry.previous; if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { state.target = null; return createIterResultObject(undefined, true); } if (kind === 'keys') return createIterResultObject(entry.key, false); if (kind === 'values') return createIterResultObject(entry.value, false); return createIterResultObject([entry.key, entry.value], false); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); setSpecies(CONSTRUCTOR_NAME); } }; },{"../internals/an-instance":64,"../internals/create-iter-result-object":86,"../internals/define-built-in-accessor":90,"../internals/define-built-ins":92,"../internals/descriptors":94,"../internals/function-bind-context":116,"../internals/internal-metadata":140,"../internals/internal-state":141,"../internals/is-null-or-undefined":148,"../internals/iterate":156,"../internals/iterator-define":159,"../internals/object-create":174,"../internals/set-species":222}],82:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var uncurryThis = require('../internals/function-uncurry-this'); var isForced = require('../internals/is-forced'); var defineBuiltIn = require('../internals/define-built-in'); var InternalMetadataModule = require('../internals/internal-metadata'); var iterate = require('../internals/iterate'); var anInstance = require('../internals/an-instance'); var isCallable = require('../internals/is-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var isObject = require('../internals/is-object'); var fails = require('../internals/fails'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var setToStringTag = require('../internals/set-to-string-tag'); var inheritIfRequired = require('../internals/inherit-if-required'); module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = globalThis[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; var fixMethod = function (KEY) { var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); defineBuiltIn(NativePrototype, KEY, KEY === 'add' ? function add(value) { uncurriedNativeMethod(this, value === 0 ? 0 : value); return this; } : KEY === 'delete' ? function (key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'get' ? function get(key) { return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'has' ? function has(key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : function set(key, value) { uncurriedNativeMethod(this, key === 0 ? 0 : key, value); return this; } ); }; var REPLACE = isForced( CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); })) ); if (REPLACE) { Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); InternalMetadataModule.enable(); } else if (isForced(CONSTRUCTOR_NAME, true)) { var instance = new Constructor(); var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); var BUGGY_ZERO = !IS_WEAK && fails(function () { var $instance = new NativeConstructor(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype); var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); return that; }); Constructor.prototype = NativePrototype; NativePrototype.constructor = Constructor; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; } exported[CONSTRUCTOR_NAME] = Constructor; $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); setToStringTag(Constructor, CONSTRUCTOR_NAME); if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); return Constructor; }; },{"../internals/an-instance":64,"../internals/check-correctness-of-iteration":76,"../internals/define-built-in":91,"../internals/export":111,"../internals/fails":112,"../internals/function-uncurry-this":122,"../internals/global-this":130,"../internals/inherit-if-required":137,"../internals/internal-metadata":140,"../internals/is-callable":144,"../internals/is-forced":146,"../internals/is-null-or-undefined":148,"../internals/is-object":149,"../internals/iterate":156,"../internals/set-to-string-tag":224}],83:[function(require,module,exports){ 'use strict'; var hasOwn = require('../internals/has-own-property'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); module.exports = function (target, source, exceptions) { 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 (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; },{"../internals/has-own-property":131,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/own-keys":191}],84:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); module.exports = function (METHOD_NAME) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); } catch (error1) { try { regexp[MATCH] = false; return '/./'[METHOD_NAME](regexp); } catch (error2) { } } return false; }; },{"../internals/well-known-symbol":256}],85:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); },{"../internals/fails":112}],86:[function(require,module,exports){ 'use strict'; module.exports = function (value, done) { return { value: value, done: done }; }; },{}],87:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"../internals/create-property-descriptor":88,"../internals/descriptors":94,"../internals/object-define-property":176}],88:[function(require,module,exports){ 'use strict'; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],89:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; },{"../internals/create-property-descriptor":88,"../internals/descriptors":94,"../internals/object-define-property":176}],90:[function(require,module,exports){ 'use strict'; var makeBuiltIn = require('../internals/make-built-in'); var defineProperty = require('../internals/object-define-property'); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; },{"../internals/make-built-in":163,"../internals/object-define-property":176}],91:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var definePropertyModule = require('../internals/object-define-property'); var makeBuiltIn = require('../internals/make-built-in'); var defineGlobalProperty = require('../internals/define-global-property'); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; },{"../internals/define-global-property":93,"../internals/is-callable":144,"../internals/make-built-in":163,"../internals/object-define-property":176}],92:[function(require,module,exports){ 'use strict'; var defineBuiltIn = require('../internals/define-built-in'); module.exports = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); return target; }; },{"../internals/define-built-in":91}],93:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis[key] = value; } return value; }; },{"../internals/global-this":130}],94:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); },{"../internals/fails":112}],95:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var isObject = require('../internals/is-object'); var document = globalThis.document; var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global-this":130,"../internals/is-object":149}],96:[function(require,module,exports){ 'use strict'; var $TypeError = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; module.exports = function (it) { if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); return it; }; },{}],97:[function(require,module,exports){ 'use strict'; module.exports = { 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 }; },{}],98:[function(require,module,exports){ 'use strict'; var documentCreateElement = require('../internals/document-create-element'); var classList = documentCreateElement('span').classList; var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; },{"../internals/document-create-element":95}],99:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (CONSTRUCTOR, METHOD) { return uncurryThis(globalThis[CONSTRUCTOR].prototype[METHOD]); }; },{"../internals/function-uncurry-this":122,"../internals/global-this":130}],100:[function(require,module,exports){ 'use strict'; module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],101:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; },{"../internals/environment-user-agent":105}],102:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); },{"../internals/environment-user-agent":105}],103:[function(require,module,exports){ 'use strict'; var ENVIRONMENT = require('../internals/environment'); module.exports = ENVIRONMENT === 'NODE'; },{"../internals/environment":107}],104:[function(require,module,exports){ 'use strict'; var userAgent = require('../internals/environment-user-agent'); module.exports = /web0s(?!.*chrome)/i.test(userAgent); },{"../internals/environment-user-agent":105}],105:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var navigator = globalThis.navigator; var userAgent = navigator && navigator.userAgent; module.exports = userAgent ? String(userAgent) : ''; },{"../internals/global-this":130}],106:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var userAgent = require('../internals/environment-user-agent'); var process = globalThis.process; var Deno = globalThis.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; },{"../internals/environment-user-agent":105,"../internals/global-this":130}],107:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var userAgent = require('../internals/environment-user-agent'); var classof = require('../internals/classof-raw'); var userAgentStartsWith = function (string) { return userAgent.slice(0, string.length) === string; }; module.exports = (function () { if (userAgentStartsWith('Bun/')) return 'BUN'; if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE'; if (userAgentStartsWith('Deno/')) return 'DENO'; if (userAgentStartsWith('Node.js/')) return 'NODE'; if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN'; if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO'; if (classof(globalThis.process) === 'process') return 'NODE'; if (globalThis.window && globalThis.document) return 'BROWSER'; return 'REST'; })(); },{"../internals/classof-raw":77,"../internals/environment-user-agent":105,"../internals/global-this":130}],108:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; },{"../internals/function-uncurry-this":122}],109:[function(require,module,exports){ 'use strict'; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var clearErrorStack = require('../internals/error-stack-clear'); var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable'); var captureStackTrace = Error.captureStackTrace; module.exports = function (error, C, stack, dropEntries) { if (ERROR_STACK_INSTALLABLE) { if (captureStackTrace) captureStackTrace(error, C); else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries)); } }; },{"../internals/create-non-enumerable-property":87,"../internals/error-stack-clear":108,"../internals/error-stack-installable":110}],110:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = !fails(function () { var error = new Error('a'); if (!('stack' in error)) return true; Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); },{"../internals/create-property-descriptor":88,"../internals/fails":112}],111:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var defineBuiltIn = require('../internals/define-built-in'); var defineGlobalProperty = require('../internals/define-global-property'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); module.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 = globalThis; } else if (STATIC) { target = globalThis[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = globalThis[TARGET] && globalThis[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; },{"../internals/copy-constructor-properties":83,"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/define-global-property":93,"../internals/global-this":130,"../internals/is-forced":146,"../internals/object-get-own-property-descriptor":177}],112:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],113:[function(require,module,exports){ 'use strict'; require('../modules/es.regexp.exec'); var call = require('../internals/function-call'); var defineBuiltIn = require('../internals/define-built-in'); var regexpExec = require('../internals/regexp-exec'); var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var SPECIES = wellKnownSymbol('species'); var RegExpPrototype = RegExp.prototype; module.exports = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) !== 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { var execCalled = false; var re = /a/; if (KEY === 'split') { var constructor = {}; constructor[SPECIES] = function () { return re; }; re = { constructor: constructor, flags: '' }; re[SYMBOL] = /./[SYMBOL]; } re.exec = function () { execCalled = true; return null; }; re[SYMBOL](''); return !execCalled; }); if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED ) { var nativeRegExpMethod = /./[SYMBOL]; var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var $exec = regexp.exec; if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) }; } return { done: true, value: call(nativeMethod, str, regexp, arg2) }; } return { done: false }; }); defineBuiltIn(String.prototype, KEY, methods[0]); defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); } if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); }; },{"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/fails":112,"../internals/function-call":118,"../internals/regexp-exec":201,"../internals/well-known-symbol":256,"../modules/es.regexp.exec":288}],114:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { return Object.isExtensible(Object.preventExtensions({})); }); },{"../internals/fails":112}],115:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); },{"../internals/function-bind-native":117}],116:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this-clause'); var aCallable = require('../internals/a-callable'); var NATIVE_BIND = require('../internals/function-bind-native'); var bind = uncurryThis(uncurryThis.bind); module.exports = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function () { return fn.apply(that, arguments); }; }; },{"../internals/a-callable":57,"../internals/function-bind-native":117,"../internals/function-uncurry-this-clause":121}],117:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { var test = (function () { }).bind(); return typeof test != 'function' || test.hasOwnProperty('prototype'); }); },{"../internals/fails":112}],118:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; },{"../internals/function-bind-native":117}],119:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var hasOwn = require('../internals/has-own-property'); var FunctionPrototype = Function.prototype; var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); var PROPER = EXISTS && (function something() { }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; },{"../internals/descriptors":94,"../internals/has-own-property":131}],120:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var aCallable = require('../internals/a-callable'); module.exports = function (object, key, method) { try { return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { } }; },{"../internals/a-callable":57,"../internals/function-uncurry-this":122}],121:[function(require,module,exports){ 'use strict'; var classofRaw = require('../internals/classof-raw'); var uncurryThis = require('../internals/function-uncurry-this'); module.exports = function (fn) { if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; },{"../internals/classof-raw":77,"../internals/function-uncurry-this":122}],122:[function(require,module,exports){ 'use strict'; var NATIVE_BIND = require('../internals/function-bind-native'); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; },{"../internals/function-bind-native":117}],123:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var isCallable = require('../internals/is-callable'); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; },{"../internals/global-this":130,"../internals/is-callable":144}],124:[function(require,module,exports){ 'use strict'; module.exports = function (obj) { return { iterator: obj, next: obj.next, done: false }; }; },{}],125:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var getMethod = require('../internals/get-method'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; },{"../internals/classof":78,"../internals/get-method":127,"../internals/is-null-or-undefined":148,"../internals/iterators":161,"../internals/well-known-symbol":256}],126:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var tryToString = require('../internals/try-to-string'); var getIteratorMethod = require('../internals/get-iterator-method'); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":118,"../internals/get-iterator-method":125,"../internals/try-to-string":248}],127:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; },{"../internals/a-callable":57,"../internals/is-null-or-undefined":148}],128:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var anObject = require('../internals/an-object'); var call = require('../internals/function-call'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var getIteratorDirect = require('../internals/get-iterator-direct'); var INVALID_SIZE = 'Invalid size'; var $RangeError = RangeError; var $TypeError = TypeError; var max = Math.max; var SetRecord = function (set, intSize) { this.set = set; this.size = max(intSize, 0); this.has = aCallable(set.has); this.keys = aCallable(set.keys); }; SetRecord.prototype = { getIterator: function () { return getIteratorDirect(anObject(call(this.keys, this.set))); }, includes: function (it) { return call(this.has, this.set, it); } }; module.exports = function (obj) { anObject(obj); var numSize = +obj.size; if (numSize !== numSize) throw new $TypeError(INVALID_SIZE); var intSize = toIntegerOrInfinity(numSize); if (intSize < 0) throw new $RangeError(INVALID_SIZE); return new SetRecord(obj, intSize); }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":118,"../internals/get-iterator-direct":124,"../internals/to-integer-or-infinity":240}],129:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); var floor = Math.floor; var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; module.exports = function (matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return replace(replacement, symbols, function (match, ch) { var capture; switch (charAt(ch, 0)) { case '$': return '$'; case '&': return matched; case '`': return stringSlice(str, 0, position); case "'": return stringSlice(str, tailPos); case '<': capture = namedCaptures[stringSlice(ch, 1, -1)]; break; default: var n = +ch; if (n === 0) return match; if (n > m) { var f = floor(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); }; },{"../internals/function-uncurry-this":122,"../internals/to-object":242}],130:[function(require,module,exports){ (function (global){(function (){ 'use strict'; var check = function (it) { return it && it.Math === Math && it; }; module.exports = check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || check(typeof this == 'object' && this) || (function () { return this; })() || Function('return this')(); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],131:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toObject = require('../internals/to-object'); var hasOwnProperty = uncurryThis({}.hasOwnProperty); module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; },{"../internals/function-uncurry-this":122,"../internals/to-object":242}],132:[function(require,module,exports){ 'use strict'; module.exports = {}; },{}],133:[function(require,module,exports){ 'use strict'; module.exports = function (a, b) { try { arguments.length === 1 ? console.error(a) : console.error(a, b); } catch (error) { } }; },{}],134:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":123}],135:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); },{"../internals/descriptors":94,"../internals/document-create-element":95,"../internals/fails":112}],136:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); var $Object = Object; var split = uncurryThis(''.split); module.exports = fails(function () { return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; },{"../internals/classof-raw":77,"../internals/fails":112,"../internals/function-uncurry-this":122}],137:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var setPrototypeOf = require('../internals/object-set-prototype-of'); module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( setPrototypeOf && isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; },{"../internals/is-callable":144,"../internals/is-object":149,"../internals/object-set-prototype-of":187}],138:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var isCallable = require('../internals/is-callable'); var store = require('../internals/shared-store'); var functionToString = uncurryThis(Function.toString); if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; },{"../internals/function-uncurry-this":122,"../internals/is-callable":144,"../internals/shared-store":227}],139:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); module.exports = function (O, options) { if (isObject(options) && 'cause' in options) { createNonEnumerableProperty(O, 'cause', options.cause); } }; },{"../internals/create-non-enumerable-property":87,"../internals/is-object":149}],140:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var hiddenKeys = require('../internals/hidden-keys'); var isObject = require('../internals/is-object'); var hasOwn = require('../internals/has-own-property'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external'); var isExtensible = require('../internals/object-is-extensible'); var uid = require('../internals/uid'); var FREEZING = require('../internals/freezing'); var REQUIRED = false; var METADATA = uid('meta'); var id = 0; var setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, weakData: {} } }); }; var fastKey = function (it, create) { if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn(it, METADATA)) { if (!isExtensible(it)) return 'F'; if (!create) return 'E'; setMetadata(it); } return it[METADATA].objectID; }; var getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { if (!isExtensible(it)) return true; if (!create) return false; setMetadata(it); } return it[METADATA].weakData; }; var onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis([].splice); var test = {}; test[METADATA] = 1; if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1); break; } } return result; }; $({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } }; var meta = module.exports = { enable: enable, fastKey: fastKey, getWeakData: getWeakData, onFreeze: onFreeze }; hiddenKeys[METADATA] = true; },{"../internals/export":111,"../internals/freezing":114,"../internals/function-uncurry-this":122,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/is-object":149,"../internals/object-define-property":176,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-names-external":178,"../internals/object-is-extensible":182,"../internals/uid":249}],141:[function(require,module,exports){ 'use strict'; var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); var globalThis = require('../internals/global-this'); var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var hasOwn = require('../internals/has-own-property'); var shared = require('../internals/shared-store'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = globalThis.TypeError; var WeakMap = globalThis.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 new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); store.get = store.get; store.has = store.has; store.set = store.set; set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; },{"../internals/create-non-enumerable-property":87,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/is-object":149,"../internals/shared-key":226,"../internals/shared-store":227,"../internals/weak-map-basic-detection":253}],142:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; },{"../internals/iterators":161,"../internals/well-known-symbol":256}],143:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof-raw'); module.exports = Array.isArray || function isArray(argument) { return classof(argument) === 'Array'; }; },{"../internals/classof-raw":77}],144:[function(require,module,exports){ 'use strict'; var documentAll = typeof document == 'object' && document.all; module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; },{}],145:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var classof = require('../internals/classof'); var getBuiltIn = require('../internals/get-built-in'); var inspectSource = require('../internals/inspect-source'); var noop = function () { }; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { construct(noop, [], argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable(argument)) return false; switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; module.exports = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; },{"../internals/classof":78,"../internals/fails":112,"../internals/function-uncurry-this":122,"../internals/get-built-in":123,"../internals/inspect-source":138,"../internals/is-callable":144}],146:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? 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'; module.exports = isForced; },{"../internals/fails":112,"../internals/is-callable":144}],147:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var hasOwn = require('../internals/has-own-property'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var $Object = Object; module.exports = function (it) { if (isNullOrUndefined(it)) return false; var O = $Object(it); return O[ITERATOR] !== undefined || '@@iterator' in O || hasOwn(Iterators, classof(O)); }; },{"../internals/classof":78,"../internals/has-own-property":131,"../internals/is-null-or-undefined":148,"../internals/iterators":161,"../internals/well-known-symbol":256}],148:[function(require,module,exports){ 'use strict'; module.exports = function (it) { return it === null || it === undefined; }; },{}],149:[function(require,module,exports){ 'use strict'; var isCallable = require('../internals/is-callable'); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; },{"../internals/is-callable":144}],150:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); module.exports = function (argument) { return isObject(argument) || argument === null; }; },{"../internals/is-object":149}],151:[function(require,module,exports){ 'use strict'; module.exports = false; },{}],152:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var getInternalState = require('../internals/internal-state').get; module.exports = function isRawJSON(O) { if (!isObject(O)) return false; var state = getInternalState(O); return !!state && state.type === 'RawJSON'; }; },{"../internals/internal-state":141,"../internals/is-object":149}],153:[function(require,module,exports){ 'use strict'; var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp'); }; },{"../internals/classof-raw":77,"../internals/is-object":149,"../internals/well-known-symbol":256}],154:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; },{"../internals/get-built-in":123,"../internals/is-callable":144,"../internals/object-is-prototype-of":183,"../internals/use-symbol-as-uid":250}],155:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; },{"../internals/function-call":118}],156:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var tryToString = require('../internals/try-to-string'); var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var iteratorClose = require('../internals/iterator-close'); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal'); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; },{"../internals/an-object":65,"../internals/function-bind-context":116,"../internals/function-call":118,"../internals/get-iterator":126,"../internals/get-iterator-method":125,"../internals/is-array-iterator-method":142,"../internals/iterator-close":157,"../internals/length-of-array-like":162,"../internals/object-is-prototype-of":183,"../internals/try-to-string":248}],157:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var getMethod = require('../internals/get-method'); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); try { innerResult = getMethod(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); return value; }; },{"../internals/an-object":65,"../internals/function-call":118,"../internals/get-method":127}],158:[function(require,module,exports){ 'use strict'; var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var setToStringTag = require('../internals/set-to-string-tag'); var Iterators = require('../internals/iterators'); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; },{"../internals/create-property-descriptor":88,"../internals/iterators":161,"../internals/iterators-core":160,"../internals/object-create":174,"../internals/set-to-string-tag":224}],159:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var IS_PURE = require('../internals/is-pure'); var FunctionName = require('../internals/function-name'); var isCallable = require('../internals/is-callable'); var createIteratorConstructor = require('../internals/iterator-create-constructor'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var defineBuiltIn = require('../internals/define-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var IteratorsCore = require('../internals/iterators-core'); var PROPER_FUNCTION_NAME = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; 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; }; module.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 && 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 (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); } } setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return call(nativeIterator, this); }; } } 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)) { defineBuiltIn(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); } Iterators[NAME] = defaultIterator; return methods; }; },{"../internals/create-non-enumerable-property":87,"../internals/define-built-in":91,"../internals/export":111,"../internals/function-call":118,"../internals/function-name":119,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/iterator-create-constructor":158,"../internals/iterators":161,"../internals/iterators-core":160,"../internals/object-get-prototype-of":181,"../internals/object-set-prototype-of":187,"../internals/set-to-string-tag":224,"../internals/well-known-symbol":256}],160:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var create = require('../internals/object-create'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var defineBuiltIn = require('../internals/define-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; 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; } } var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { var test = {}; return IteratorPrototype[ITERATOR].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); if (!isCallable(IteratorPrototype[ITERATOR])) { defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; },{"../internals/define-built-in":91,"../internals/fails":112,"../internals/is-callable":144,"../internals/is-object":149,"../internals/is-pure":151,"../internals/object-create":174,"../internals/object-get-prototype-of":181,"../internals/well-known-symbol":256}],161:[function(require,module,exports){ arguments[4][132][0].apply(exports,arguments) },{"dup":132}],162:[function(require,module,exports){ 'use strict'; var toLength = require('../internals/to-length'); module.exports = function (obj) { return toLength(obj.length); }; },{"../internals/to-length":241}],163:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isCallable = require('../internals/is-callable'); var hasOwn = require('../internals/has-own-property'); var DESCRIPTORS = require('../internals/descriptors'); var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE; var inspectSource = require('../internals/inspect-source'); var InternalStateModule = require('../internals/internal-state'); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); } else if (value.prototype) value.prototype = undefined; } catch (error) { } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); },{"../internals/descriptors":94,"../internals/fails":112,"../internals/function-name":119,"../internals/function-uncurry-this":122,"../internals/has-own-property":131,"../internals/inspect-source":138,"../internals/internal-state":141,"../internals/is-callable":144}],164:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var MapPrototype = Map.prototype; module.exports = { Map: Map, set: uncurryThis(MapPrototype.set), get: uncurryThis(MapPrototype.get), has: uncurryThis(MapPrototype.has), remove: uncurryThis(MapPrototype['delete']), proto: MapPrototype }; },{"../internals/function-uncurry-this":122}],165:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var iterateSimple = require('../internals/iterate-simple'); var MapHelpers = require('../internals/map-helpers'); var Map = MapHelpers.Map; var MapPrototype = MapHelpers.proto; var forEach = uncurryThis(MapPrototype.forEach); var entries = uncurryThis(MapPrototype.entries); var next = entries(new Map()).next; module.exports = function (map, fn, interruptible) { return interruptible ? iterateSimple({ iterator: entries(map), next: next }, function (entry) { return fn(entry[1], entry[0]); }) : forEach(map, fn); }; },{"../internals/function-uncurry-this":122,"../internals/iterate-simple":155,"../internals/map-helpers":164}],166:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var isCallable = require('../internals/is-callable'); var anObject = require('../internals/an-object'); var $TypeError = TypeError; module.exports = function upsert(key, updateFn ) { var map = anObject(this); var get = aCallable(map.get); var has = aCallable(map.has); var set = aCallable(map.set); var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; if (!isCallable(updateFn) && !isCallable(insertFn)) { throw new $TypeError('At least one callback required'); } if (call(has, map, key)) { value = call(get, map, key); if (isCallable(updateFn)) { value = updateFn(value); call(set, map, key, value); } } else if (isCallable(insertFn)) { value = insertFn(); call(set, map, key, value); } return value; }; },{"../internals/a-callable":57,"../internals/an-object":65,"../internals/function-call":118,"../internals/is-callable":144}],167:[function(require,module,exports){ 'use strict'; var ceil = Math.ceil; var floor = Math.floor; module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; },{}],168:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var safeGetBuiltIn = require('../internals/safe-get-built-in'); var bind = require('../internals/function-bind-context'); var macrotask = require('../internals/task').set; var Queue = require('../internals/queue'); var IS_IOS = require('../internals/environment-is-ios'); var IS_IOS_PEBBLE = require('../internals/environment-is-ios-pebble'); var IS_WEBOS_WEBKIT = require('../internals/environment-is-webos-webkit'); var IS_NODE = require('../internals/environment-is-node'); var MutationObserver = globalThis.MutationObserver || globalThis.WebKitMutationObserver; var document = globalThis.document; var process = globalThis.process; var Promise = globalThis.Promise; var microtask = safeGetBuiltIn('queueMicrotask'); var notify, toggle, node, promise, then; if (!microtask) { var queue = new Queue(); var flush = function () { var parent, fn; if (IS_NODE && (parent = process.domain)) parent.exit(); while (fn = queue.get()) try { fn(); } catch (error) { if (queue.head) notify(); throw error; } if (parent) parent.enter(); }; if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { toggle = true; node = document.createTextNode(''); new MutationObserver(flush).observe(node, { characterData: true }); notify = function () { node.data = toggle = !toggle; }; } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { promise = Promise.resolve(undefined); promise.constructor = Promise; then = bind(promise.then, promise); notify = function () { then(flush); }; } else if (IS_NODE) { notify = function () { process.nextTick(flush); }; } else { macrotask = bind(macrotask, globalThis); notify = function () { macrotask(flush); }; } microtask = function (fn) { if (!queue.head) notify(); queue.add(fn); }; } module.exports = microtask; },{"../internals/environment-is-ios":102,"../internals/environment-is-ios-pebble":101,"../internals/environment-is-node":103,"../internals/environment-is-webos-webkit":104,"../internals/function-bind-context":116,"../internals/global-this":130,"../internals/queue":199,"../internals/safe-get-built-in":209,"../internals/task":237}],169:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = !fails(function () { var unsafeInt = '9007199254740993'; var raw = JSON.rawJSON(unsafeInt); return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt; }); },{"../internals/fails":112}],170:[function(require,module,exports){ 'use strict'; var aCallable = require('../internals/a-callable'); var $TypeError = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); }; module.exports.f = function (C) { return new PromiseCapability(C); }; },{"../internals/a-callable":57}],171:[function(require,module,exports){ 'use strict'; var toString = require('../internals/to-string'); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; },{"../internals/to-string":247}],172:[function(require,module,exports){ 'use strict'; var isRegExp = require('../internals/is-regexp'); var $TypeError = TypeError; module.exports = function (it) { if (isRegExp(it)) { throw new $TypeError("The method doesn't accept regular expressions"); } return it; }; },{"../internals/is-regexp":153}],173:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var uncurryThis = require('../internals/function-uncurry-this'); var call = require('../internals/function-call'); var fails = require('../internals/fails'); var objectKeys = require('../internals/object-keys'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); var $assign = Object.assign; var defineProperty = Object.defineProperty; var concat = uncurryThis([].concat); module.exports = !$assign || fails(function () { if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; var A = {}; var B = {}; var symbol = Symbol('assign detection'); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet; }) ? function assign(target, source) { var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; } } return T; } : $assign; },{"../internals/descriptors":94,"../internals/fails":112,"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/indexed-object":136,"../internals/object-get-own-property-symbols":180,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/to-object":242}],174:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var definePropertiesModule = require('../internals/object-define-properties'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = require('../internals/hidden-keys'); var html = require('../internals/html'); var documentCreateElement = require('../internals/document-create-element'); var sharedKey = require('../internals/shared-key'); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; return temp; }; var NullProtoObjectViaIFrame = function () { var iframe = documentCreateElement('iframe'); 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(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; },{"../internals/an-object":65,"../internals/document-create-element":95,"../internals/enum-bug-keys":100,"../internals/hidden-keys":132,"../internals/html":134,"../internals/object-define-properties":175,"../internals/shared-key":226}],175:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); var definePropertyModule = require('../internals/object-define-property'); var anObject = require('../internals/an-object'); var toIndexedObject = require('../internals/to-indexed-object'); var objectKeys = require('../internals/object-keys'); exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; },{"../internals/an-object":65,"../internals/descriptors":94,"../internals/object-define-property":176,"../internals/object-keys":185,"../internals/to-indexed-object":239,"../internals/v8-prototype-define-bug":251}],176:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); var anObject = require('../internals/an-object'); var toPropertyKey = require('../internals/to-property-key'); var $TypeError = TypeError; var $defineProperty = Object.defineProperty; var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":65,"../internals/descriptors":94,"../internals/ie8-dom-define":135,"../internals/to-property-key":244,"../internals/v8-prototype-define-bug":251}],177:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var call = require('../internals/function-call'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var toIndexedObject = require('../internals/to-indexed-object'); var toPropertyKey = require('../internals/to-property-key'); var hasOwn = require('../internals/has-own-property'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; },{"../internals/create-property-descriptor":88,"../internals/descriptors":94,"../internals/function-call":118,"../internals/has-own-property":131,"../internals/ie8-dom-define":135,"../internals/object-property-is-enumerable":186,"../internals/to-indexed-object":239,"../internals/to-property-key":244}],178:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof-raw'); var toIndexedObject = require('../internals/to-indexed-object'); var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f; var arraySlice = require('../internals/array-slice'); var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return $getOwnPropertyNames(it); } catch (error) { return arraySlice(windowNames); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && classof(it) === 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; },{"../internals/array-slice":72,"../internals/classof-raw":77,"../internals/object-get-own-property-names":179,"../internals/to-indexed-object":239}],179:[function(require,module,exports){ 'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; },{"../internals/enum-bug-keys":100,"../internals/object-keys-internal":184}],180:[function(require,module,exports){ 'use strict'; exports.f = Object.getOwnPropertySymbols; },{}],181:[function(require,module,exports){ 'use strict'; var hasOwn = require('../internals/has-own-property'); var isCallable = require('../internals/is-callable'); var toObject = require('../internals/to-object'); var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; var ObjectPrototype = $Object.prototype; module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object ? ObjectPrototype : null; }; },{"../internals/correct-prototype-getter":85,"../internals/has-own-property":131,"../internals/is-callable":144,"../internals/shared-key":226,"../internals/to-object":242}],182:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible'); var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); }); module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { if (!isObject(it)) return false; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false; return $isExtensible ? $isExtensible(it) : true; } : $isExtensible; },{"../internals/array-buffer-non-extensible":66,"../internals/classof-raw":77,"../internals/fails":112,"../internals/is-object":149}],183:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); module.exports = uncurryThis({}.isPrototypeOf); },{"../internals/function-uncurry-this":122}],184:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var toIndexedObject = require('../internals/to-indexed-object'); var indexOf = require('../internals/array-includes').indexOf; var hiddenKeys = require('../internals/hidden-keys'); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; },{"../internals/array-includes":68,"../internals/function-uncurry-this":122,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/to-indexed-object":239}],185:[function(require,module,exports){ 'use strict'; var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; },{"../internals/enum-bug-keys":100,"../internals/object-keys-internal":184}],186:[function(require,module,exports){ 'use strict'; var $propertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; },{}],187:[function(require,module,exports){ 'use strict'; var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var isObject = require('../internals/is-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); var aPossiblePrototype = require('../internals/a-possible-prototype'); module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { } return function setPrototypeOf(O, proto) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":60,"../internals/function-uncurry-this-accessor":120,"../internals/is-object":149,"../internals/require-object-coercible":208}],188:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var uncurryThis = require('../internals/function-uncurry-this'); var objectGetPrototypeOf = require('../internals/object-get-prototype-of'); var objectKeys = require('../internals/object-keys'); var toIndexedObject = require('../internals/to-indexed-object'); var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); var push = uncurryThis([].push); var IE_BUG = DESCRIPTORS && fails(function () { var O = Object.create(null); O[2] = 2; return !propertyIsEnumerable(O, 2); }); var createMethod = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null; var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; module.exports = { entries: createMethod(true), values: createMethod(false) }; },{"../internals/descriptors":94,"../internals/fails":112,"../internals/function-uncurry-this":122,"../internals/object-get-prototype-of":181,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/to-indexed-object":239}],189:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var classof = require('../internals/classof'); module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; },{"../internals/classof":78,"../internals/to-string-tag-support":246}],190:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var $TypeError = TypeError; module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; },{"../internals/function-call":118,"../internals/is-callable":144,"../internals/is-object":149}],191:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var anObject = require('../internals/an-object'); var concat = uncurryThis([].concat); module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; },{"../internals/an-object":65,"../internals/function-uncurry-this":122,"../internals/get-built-in":123,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-symbols":180}],192:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var $SyntaxError = SyntaxError; var $parseInt = parseInt; var fromCharCode = String.fromCharCode; var at = uncurryThis(''.charAt); var slice = uncurryThis(''.slice); var exec = uncurryThis(/./.exec); var codePoints = { '\\"': '"', '\\\\': '\\', '\\/': '/', '\\b': '\b', '\\f': '\f', '\\n': '\n', '\\r': '\r', '\\t': '\t' }; var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i; var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/; module.exports = function (source, i) { var unterminated = true; var value = ''; while (i < source.length) { var chr = at(source, i); if (chr === '\\') { var twoChars = slice(source, i, i + 2); if (hasOwn(codePoints, twoChars)) { value += codePoints[twoChars]; i += 2; } else if (twoChars === '\\u') { i += 2; var fourHexDigits = slice(source, i, i + 4); if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i); value += fromCharCode($parseInt(fourHexDigits, 16)); i += 4; } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"'); } else if (chr === '"') { unterminated = false; i++; break; } else { if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i); value += chr; i++; } } if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i); return { value: value, end: i }; }; },{"../internals/function-uncurry-this":122,"../internals/has-own-property":131}],193:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); module.exports = globalThis; },{"../internals/global-this":130}],194:[function(require,module,exports){ 'use strict'; module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; },{}],195:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var isCallable = require('../internals/is-callable'); var isForced = require('../internals/is-forced'); var inspectSource = require('../internals/inspect-source'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ENVIRONMENT = require('../internals/environment'); var IS_PURE = require('../internals/is-pure'); var V8_VERSION = require('../internals/environment-v8-version'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var SPECIES = wellKnownSymbol('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT = isCallable(globalThis.PromiseRejectionEvent); var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor); var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { var promise = new NativePromiseConstructor(function (resolve) { resolve(1); }); var FakePromise = function (exec) { exec(function () { }, function () { }); }; var constructor = promise.constructor = {}; constructor[SPECIES] = FakePromise; SUBCLASSING = promise.then(function () { }) instanceof FakePromise; if (!SUBCLASSING) return true; } return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === 'BROWSER' || ENVIRONMENT === 'DENO') && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, SUBCLASSING: SUBCLASSING }; },{"../internals/environment":107,"../internals/environment-v8-version":106,"../internals/global-this":130,"../internals/inspect-source":138,"../internals/is-callable":144,"../internals/is-forced":146,"../internals/is-pure":151,"../internals/promise-native-constructor":196,"../internals/well-known-symbol":256}],196:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); module.exports = globalThis.Promise; },{"../internals/global-this":130}],197:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var isObject = require('../internals/is-object'); var newPromiseCapability = require('../internals/new-promise-capability'); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; },{"../internals/an-object":65,"../internals/is-object":149,"../internals/new-promise-capability":170}],198:[function(require,module,exports){ 'use strict'; var NativePromiseConstructor = require('../internals/promise-native-constructor'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { NativePromiseConstructor.all(iterable).then(undefined, function () { }); }); },{"../internals/check-correctness-of-iteration":76,"../internals/promise-constructor-detection":195,"../internals/promise-native-constructor":196}],199:[function(require,module,exports){ 'use strict'; var Queue = function () { this.head = null; this.tail = null; }; Queue.prototype = { add: function (item) { var entry = { item: item, next: null }; var tail = this.tail; if (tail) tail.next = entry; else this.head = entry; this.tail = entry; }, get: function () { var entry = this.head; if (entry) { var next = this.head = entry.next; if (next === null) this.tail = null; return entry.item; } } }; module.exports = Queue; },{}],200:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var anObject = require('../internals/an-object'); var isCallable = require('../internals/is-callable'); var classof = require('../internals/classof-raw'); var regexpExec = require('../internals/regexp-exec'); var $TypeError = TypeError; module.exports = function (R, S) { var exec = R.exec; if (isCallable(exec)) { var result = call(exec, R, S); if (result !== null) anObject(result); return result; } if (classof(R) === 'RegExp') return call(regexpExec, R, S); throw new $TypeError('RegExp#exec called on incompatible receiver'); }; },{"../internals/an-object":65,"../internals/classof-raw":77,"../internals/function-call":118,"../internals/is-callable":144,"../internals/regexp-exec":201}],201:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var toString = require('../internals/to-string'); var regexpFlags = require('../internals/regexp-flags'); var stickyHelpers = require('../internals/regexp-sticky-helpers'); var shared = require('../internals/shared'); var create = require('../internals/object-create'); var getInternalState = require('../internals/internal-state').get; var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); var nativeReplace = shared('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; var charAt = uncurryThis(''.charAt); var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; call(nativeExec, re1, 'a'); call(nativeExec, re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; if (PATCH) { patchedExec = function exec(string) { var re = this; var state = getInternalState(re); var str = toString(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; if (raw) { raw.lastIndex = re.lastIndex; result = call(patchedExec, raw, str); re.lastIndex = raw.lastIndex; return result; } var groups = state.groups; var sticky = UNSUPPORTED_Y && re.sticky; var flags = call(regexpFlags, re); var source = re.source; var charsAdded = 0; var strCopy = str; if (sticky) { flags = replace(flags, 'y', ''); if (indexOf(flags, 'g') === -1) { flags += 'g'; } strCopy = stringSlice(str, re.lastIndex); if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; } reCopy = new RegExp('^(?:' + source + ')', flags); } if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = call(nativeExec, sticky ? reCopy : re, strCopy); if (sticky) { if (match) { match.input = stringSlice(match.input, charsAdded); match[0] = stringSlice(match[0], charsAdded); match.index = re.lastIndex; re.lastIndex += match[0].length; } else re.lastIndex = 0; } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { call(nativeReplace, match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } if (match && groups) { match.groups = object = create(null); for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } return match; }; } module.exports = patchedExec; },{"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/internal-state":141,"../internals/object-create":174,"../internals/regexp-flags":203,"../internals/regexp-sticky-helpers":205,"../internals/regexp-unsupported-dot-all":206,"../internals/regexp-unsupported-ncg":207,"../internals/shared":228,"../internals/to-string":247}],202:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var fails = require('../internals/fails'); var RegExp = globalThis.RegExp; var FLAGS_GETTER_IS_CORRECT = !fails(function () { var INDICES_SUPPORT = true; try { RegExp('.', 'd'); } catch (error) { INDICES_SUPPORT = false; } var O = {}; var calls = ''; var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy'; var addGetter = function (key, chr) { Object.defineProperty(O, key, { get: function () { calls += chr; return true; } }); }; var pairs = { dotAll: 's', global: 'g', ignoreCase: 'i', multiline: 'm', sticky: 'y' }; if (INDICES_SUPPORT) pairs.hasIndices = 'd'; for (var key in pairs) addGetter(key, pairs[key]); var result = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get.call(O); return result !== expected || calls !== expected; }); module.exports = { correct: FLAGS_GETTER_IS_CORRECT }; },{"../internals/fails":112,"../internals/global-this":130}],203:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); module.exports = function () { var that = anObject(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; },{"../internals/an-object":65}],204:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var regExpFlagsDetection = require('../internals/regexp-flags-detection'); var regExpFlagsGetterImplementation = require('../internals/regexp-flags'); var RegExpPrototype = RegExp.prototype; module.exports = regExpFlagsDetection.correct ? function (it) { return it.flags; } : function (it) { return (!regExpFlagsDetection.correct && isPrototypeOf(RegExpPrototype, it) && !hasOwn(it, 'flags')) ? call(regExpFlagsGetterImplementation, it) : it.flags; }; },{"../internals/function-call":118,"../internals/has-own-property":131,"../internals/object-is-prototype-of":183,"../internals/regexp-flags":203,"../internals/regexp-flags-detection":202}],205:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.RegExp; var UNSUPPORTED_Y = fails(function () { var re = $RegExp('a', 'y'); re.lastIndex = 2; return re.exec('abcd') !== null; }); var MISSED_STICKY = UNSUPPORTED_Y || fails(function () { return !$RegExp('a', 'y').sticky; }); var BROKEN_CARET = UNSUPPORTED_Y || fails(function () { var re = $RegExp('^r', 'gy'); re.lastIndex = 2; return re.exec('str') !== null; }); module.exports = { BROKEN_CARET: BROKEN_CARET, MISSED_STICKY: MISSED_STICKY, UNSUPPORTED_Y: UNSUPPORTED_Y }; },{"../internals/fails":112,"../internals/global-this":130}],206:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); return !(re.dotAll && re.test('\n') && re.flags === 's'); }); },{"../internals/fails":112,"../internals/global-this":130}],207:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $RegExp = globalThis.RegExp; module.exports = fails(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; }); },{"../internals/fails":112,"../internals/global-this":130}],208:[function(require,module,exports){ 'use strict'; var isNullOrUndefined = require('../internals/is-null-or-undefined'); var $TypeError = TypeError; module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; },{"../internals/is-null-or-undefined":148}],209:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var DESCRIPTORS = require('../internals/descriptors'); var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; module.exports = function (name) { if (!DESCRIPTORS) return globalThis[name]; var descriptor = getOwnPropertyDescriptor(globalThis, name); return descriptor && descriptor.value; }; },{"../internals/descriptors":94,"../internals/global-this":130}],210:[function(require,module,exports){ 'use strict'; module.exports = function (x, y) { return x === y || x !== x && y !== y; }; },{}],211:[function(require,module,exports){ 'use strict'; var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; module.exports = function (set) { var result = new Set(); iterate(set, function (it) { add(result, it); }); return result; }; },{"../internals/set-helpers":213,"../internals/set-iterate":218}],212:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var clone = require('../internals/set-clone'); var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var has = SetHelpers.has; var remove = SetHelpers.remove; module.exports = function difference(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = clone(O); if (size(O) <= otherRec.size) iterateSet(O, function (e) { if (otherRec.includes(e)) remove(result, e); }); else iterateSimple(otherRec.getIterator(), function (e) { if (has(result, e)) remove(result, e); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/set-clone":211,"../internals/set-helpers":213,"../internals/set-iterate":218,"../internals/set-size":221}],213:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var SetPrototype = Set.prototype; module.exports = { Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; },{"../internals/function-uncurry-this":122}],214:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var Set = SetHelpers.Set; var add = SetHelpers.add; var has = SetHelpers.has; module.exports = function intersection(other) { var O = aSet(this); var otherRec = getSetRecord(other); var result = new Set(); if (size(O) > otherRec.size) { iterateSimple(otherRec.getIterator(), function (e) { if (has(O, e)) add(result, e); }); } else { iterateSet(O, function (e) { if (otherRec.includes(e)) add(result, e); }); } return result; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/set-helpers":213,"../internals/set-iterate":218,"../internals/set-size":221}],215:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var has = require('../internals/set-helpers').has; var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSet = require('../internals/set-iterate'); var iterateSimple = require('../internals/iterate-simple'); var iteratorClose = require('../internals/iterator-close'); module.exports = function isDisjointFrom(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) <= otherRec.size) return iterateSet(O, function (e) { if (otherRec.includes(e)) return false; }, true) !== false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/iterator-close":157,"../internals/set-helpers":213,"../internals/set-iterate":218,"../internals/set-size":221}],216:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var size = require('../internals/set-size'); var iterate = require('../internals/set-iterate'); var getSetRecord = require('../internals/get-set-record'); module.exports = function isSubsetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) > otherRec.size) return false; return iterate(O, function (e) { if (!otherRec.includes(e)) return false; }, true) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/set-iterate":218,"../internals/set-size":221}],217:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var has = require('../internals/set-helpers').has; var size = require('../internals/set-size'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); var iteratorClose = require('../internals/iterator-close'); module.exports = function isSupersetOf(other) { var O = aSet(this); var otherRec = getSetRecord(other); if (size(O) < otherRec.size) return false; var iterator = otherRec.getIterator(); return iterateSimple(iterator, function (e) { if (!has(O, e)) return iteratorClose(iterator, 'normal', false); }) !== false; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/iterator-close":157,"../internals/set-helpers":213,"../internals/set-size":221}],218:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var iterateSimple = require('../internals/iterate-simple'); var SetHelpers = require('../internals/set-helpers'); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; module.exports = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; },{"../internals/function-uncurry-this":122,"../internals/iterate-simple":155,"../internals/set-helpers":213}],219:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var createSetLike = function (size) { return { size: size, has: function () { return false; }, keys: function () { return { next: function () { return { done: true }; } }; } }; }; var createSetLikeWithInfinitySize = function (size) { return { size: size, has: function () { return true; }, keys: function () { throw new Error('e'); } }; }; module.exports = function (name, callback) { var Set = getBuiltIn('Set'); try { new Set()[name](createSetLike(0)); try { new Set()[name](createSetLike(-1)); return false; } catch (error2) { if (!callback) return true; try { new Set()[name](createSetLikeWithInfinitySize(-Infinity)); return false; } catch (error) { var set = new Set([1, 2]); return callback(set[name](createSetLikeWithInfinitySize(Infinity))); } } } catch (error) { return false; } }; },{"../internals/get-built-in":123}],220:[function(require,module,exports){ 'use strict'; module.exports = function (METHOD_NAME) { try { var baseSet = new Set(); var setLike = { size: 0, has: function () { return true; }, keys: function () { return Object.defineProperty({}, 'next', { get: function () { baseSet.clear(); baseSet.add(4); return function () { return { done: true }; }; } }); } }; var result = baseSet[METHOD_NAME](setLike); return result.size === 1 && result.values().next().value === 4; } catch (error) { return false; } }; },{}],221:[function(require,module,exports){ 'use strict'; var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); var SetHelpers = require('../internals/set-helpers'); module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) { return set.size; }; },{"../internals/function-uncurry-this-accessor":120,"../internals/set-helpers":213}],222:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var wellKnownSymbol = require('../internals/well-known-symbol'); var DESCRIPTORS = require('../internals/descriptors'); var SPECIES = wellKnownSymbol('species'); module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineBuiltInAccessor(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; },{"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/get-built-in":123,"../internals/well-known-symbol":256}],223:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var clone = require('../internals/set-clone'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); var add = SetHelpers.add; var has = SetHelpers.has; var remove = SetHelpers.remove; module.exports = function symmetricDifference(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (e) { if (has(O, e)) remove(result, e); else add(result, e); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/set-clone":211,"../internals/set-helpers":213}],224:[function(require,module,exports){ 'use strict'; var defineProperty = require('../internals/object-define-property').f; var hasOwn = require('../internals/has-own-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; if (target && !hasOwn(target, TO_STRING_TAG)) { defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); } }; },{"../internals/has-own-property":131,"../internals/object-define-property":176,"../internals/well-known-symbol":256}],225:[function(require,module,exports){ 'use strict'; var aSet = require('../internals/a-set'); var add = require('../internals/set-helpers').add; var clone = require('../internals/set-clone'); var getSetRecord = require('../internals/get-set-record'); var iterateSimple = require('../internals/iterate-simple'); module.exports = function union(other) { var O = aSet(this); var keysIter = getSetRecord(other).getIterator(); var result = clone(O); iterateSimple(keysIter, function (it) { add(result, it); }); return result; }; },{"../internals/a-set":61,"../internals/get-set-record":128,"../internals/iterate-simple":155,"../internals/set-clone":211,"../internals/set-helpers":213}],226:[function(require,module,exports){ 'use strict'; var shared = require('../internals/shared'); var uid = require('../internals/uid'); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; },{"../internals/shared":228,"../internals/uid":249}],227:[function(require,module,exports){ 'use strict'; var IS_PURE = require('../internals/is-pure'); var globalThis = require('../internals/global-this'); var defineGlobalProperty = require('../internals/define-global-property'); var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.48.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.', license: 'https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); },{"../internals/define-global-property":93,"../internals/global-this":130,"../internals/is-pure":151}],228:[function(require,module,exports){ 'use strict'; var store = require('../internals/shared-store'); module.exports = function (key, value) { return store[key] || (store[key] = value || {}); }; },{"../internals/shared-store":227}],229:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); var aConstructor = require('../internals/a-constructor'); var isNullOrUndefined = require('../internals/is-null-or-undefined'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); module.exports = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S); }; },{"../internals/a-constructor":58,"../internals/an-object":65,"../internals/is-null-or-undefined":148,"../internals/well-known-symbol":256}],230:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var stringSlice = uncurryThis(''.slice); var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString(requireObjectCoercible($this)); var position = toIntegerOrInfinity(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = charCodeAt(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { codeAt: createMethod(false), charAt: createMethod(true) }; },{"../internals/function-uncurry-this":122,"../internals/require-object-coercible":208,"../internals/to-integer-or-infinity":240,"../internals/to-string":247}],231:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var $RangeError = RangeError; module.exports = function repeat(count) { var str = toString(requireObjectCoercible(this)); var result = ''; var n = toIntegerOrInfinity(count); if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions'); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; return result; }; },{"../internals/require-object-coercible":208,"../internals/to-integer-or-infinity":240,"../internals/to-string":247}],232:[function(require,module,exports){ 'use strict'; var V8_VERSION = require('../internals/environment-v8-version'); var fails = require('../internals/fails'); var globalThis = require('../internals/global-this'); var $String = globalThis.String; module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); },{"../internals/environment-v8-version":106,"../internals/fails":112,"../internals/global-this":130}],233:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var getBuiltIn = require('../internals/get-built-in'); var wellKnownSymbol = require('../internals/well-known-symbol'); var defineBuiltIn = require('../internals/define-built-in'); module.exports = function () { var Symbol = getBuiltIn('Symbol'); var SymbolPrototype = Symbol && Symbol.prototype; var valueOf = SymbolPrototype && SymbolPrototype.valueOf; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) { return call(valueOf, this); }, { arity: 1 }); } }; },{"../internals/define-built-in":91,"../internals/function-call":118,"../internals/get-built-in":123,"../internals/well-known-symbol":256}],234:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var Symbol = getBuiltIn('Symbol'); var keyFor = Symbol.keyFor; var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf); module.exports = Symbol.isRegisteredSymbol || function isRegisteredSymbol(value) { try { return keyFor(thisSymbolValue(value)) !== undefined; } catch (error) { return false; } }; },{"../internals/function-uncurry-this":122,"../internals/get-built-in":123}],235:[function(require,module,exports){ 'use strict'; var shared = require('../internals/shared'); var getBuiltIn = require('../internals/get-built-in'); var uncurryThis = require('../internals/function-uncurry-this'); var isSymbol = require('../internals/is-symbol'); var wellKnownSymbol = require('../internals/well-known-symbol'); var Symbol = getBuiltIn('Symbol'); var $isWellKnownSymbol = Symbol.isWellKnownSymbol; var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames'); var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf); var WellKnownSymbolsStore = shared('wks'); for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) { try { var symbolKey = symbolKeys[i]; if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey); } catch (error) { } } module.exports = function isWellKnownSymbol(value) { if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true; try { var symbol = thisSymbolValue(value); for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) { if (WellKnownSymbolsStore[keys[j]] == symbol) return true; } } catch (error) { } return false; }; },{"../internals/function-uncurry-this":122,"../internals/get-built-in":123,"../internals/is-symbol":154,"../internals/shared":228,"../internals/well-known-symbol":256}],236:[function(require,module,exports){ 'use strict'; var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; },{"../internals/symbol-constructor-detection":232}],237:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var apply = require('../internals/function-apply'); var bind = require('../internals/function-bind-context'); var isCallable = require('../internals/is-callable'); var hasOwn = require('../internals/has-own-property'); var fails = require('../internals/fails'); var html = require('../internals/html'); var arraySlice = require('../internals/array-slice'); var createElement = require('../internals/document-create-element'); var validateArgumentsLength = require('../internals/validate-arguments-length'); var IS_IOS = require('../internals/environment-is-ios'); var IS_NODE = require('../internals/environment-is-node'); var set = globalThis.setImmediate; var clear = globalThis.clearImmediate; var process = globalThis.process; var Dispatch = globalThis.Dispatch; var Function = globalThis.Function; var MessageChannel = globalThis.MessageChannel; var String = globalThis.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var $location, defer, channel, port; fails(function () { $location = globalThis.location; }); var run = function (id) { if (hasOwn(queue, id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var runner = function (id) { return function () { run(id); }; }; var eventListener = function (event) { run(event.data); }; var globalPostMessageDefer = function (id) { globalThis.postMessage(String(id), $location.protocol + '//' + $location.host); }; if (!set || !clear) { set = function setImmediate(handler) { validateArgumentsLength(arguments.length, 1); var fn = isCallable(handler) ? handler : Function(handler); var args = arraySlice(arguments, 1); queue[++counter] = function () { apply(fn, undefined, args); }; defer(counter); return counter; }; clear = function clearImmediate(id) { delete queue[id]; }; if (IS_NODE) { defer = function (id) { process.nextTick(runner(id)); }; } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(runner(id)); }; } else if (MessageChannel && !IS_IOS) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = eventListener; defer = bind(port.postMessage, port); } else if ( globalThis.addEventListener && isCallable(globalThis.postMessage) && !globalThis.importScripts && $location && $location.protocol !== 'file:' && !fails(globalPostMessageDefer) ) { defer = globalPostMessageDefer; globalThis.addEventListener('message', eventListener, false); } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run(id); }; }; } else { defer = function (id) { setTimeout(runner(id), 0); }; } } module.exports = { set: set, clear: clear }; },{"../internals/array-slice":72,"../internals/document-create-element":95,"../internals/environment-is-ios":102,"../internals/environment-is-node":103,"../internals/fails":112,"../internals/function-apply":115,"../internals/function-bind-context":116,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/html":134,"../internals/is-callable":144,"../internals/validate-arguments-length":252}],238:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var max = Math.max; var min = Math.min; module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; },{"../internals/to-integer-or-infinity":240}],239:[function(require,module,exports){ 'use strict'; var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":136,"../internals/require-object-coercible":208}],240:[function(require,module,exports){ 'use strict'; var trunc = require('../internals/math-trunc'); module.exports = function (argument) { var number = +argument; return number !== number || number === 0 ? 0 : trunc(number); }; },{"../internals/math-trunc":167}],241:[function(require,module,exports){ 'use strict'; var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var min = Math.min; module.exports = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; }; },{"../internals/to-integer-or-infinity":240}],242:[function(require,module,exports){ 'use strict'; var requireObjectCoercible = require('../internals/require-object-coercible'); var $Object = Object; module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":208}],243:[function(require,module,exports){ 'use strict'; var call = require('../internals/function-call'); var isObject = require('../internals/is-object'); var isSymbol = require('../internals/is-symbol'); var getMethod = require('../internals/get-method'); var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); var wellKnownSymbol = require('../internals/well-known-symbol'); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; },{"../internals/function-call":118,"../internals/get-method":127,"../internals/is-object":149,"../internals/is-symbol":154,"../internals/ordinary-to-primitive":190,"../internals/well-known-symbol":256}],244:[function(require,module,exports){ 'use strict'; var toPrimitive = require('../internals/to-primitive'); var isSymbol = require('../internals/is-symbol'); module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; },{"../internals/is-symbol":154,"../internals/to-primitive":243}],245:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var isIterable = require('../internals/is-iterable'); var isObject = require('../internals/is-object'); var Set = getBuiltIn('Set'); var isSetLike = function (it) { return isObject(it) && typeof it.size == 'number' && isCallable(it.has) && isCallable(it.keys); }; module.exports = function (it) { if (isSetLike(it)) return it; return isIterable(it) ? new Set(it) : it; }; },{"../internals/get-built-in":123,"../internals/is-callable":144,"../internals/is-iterable":147,"../internals/is-object":149}],246:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; },{"../internals/well-known-symbol":256}],247:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; },{"../internals/classof":78}],248:[function(require,module,exports){ 'use strict'; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; },{}],249:[function(require,module,exports){ 'use strict'; var uncurryThis = require('../internals/function-uncurry-this'); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.1.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; },{"../internals/function-uncurry-this":122}],250:[function(require,module,exports){ 'use strict'; var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; },{"../internals/symbol-constructor-detection":232}],251:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); module.exports = DESCRIPTORS && fails(function () { return Object.defineProperty(function () { }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); },{"../internals/descriptors":94,"../internals/fails":112}],252:[function(require,module,exports){ 'use strict'; var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; },{}],253:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var isCallable = require('../internals/is-callable'); var WeakMap = globalThis.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); },{"../internals/global-this":130,"../internals/is-callable":144}],254:[function(require,module,exports){ 'use strict'; var path = require('../internals/path'); var hasOwn = require('../internals/has-own-property'); var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); var defineProperty = require('../internals/object-define-property').f; module.exports = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) }); }; },{"../internals/has-own-property":131,"../internals/object-define-property":176,"../internals/path":193,"../internals/well-known-symbol-wrapped":255}],255:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); exports.f = wellKnownSymbol; },{"../internals/well-known-symbol":256}],256:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var shared = require('../internals/shared'); var hasOwn = require('../internals/has-own-property'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var Symbol = globalThis.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; },{"../internals/global-this":130,"../internals/has-own-property":131,"../internals/shared":228,"../internals/symbol-constructor-detection":232,"../internals/uid":249,"../internals/use-symbol-as-uid":250}],257:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var create = require('../internals/object-create'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var installErrorCause = require('../internals/install-error-cause'); var installErrorStack = require('../internals/error-stack-install'); var iterate = require('../internals/iterate'); var normalizeStringArgument = require('../internals/normalize-string-argument'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Error = Error; var push = [].push; var $AggregateError = function AggregateError(errors, message ) { var isInstance = isPrototypeOf(AggregateErrorPrototype, this); var that; if (setPrototypeOf) { that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype); } else { that = isInstance ? this : create(AggregateErrorPrototype); createNonEnumerableProperty(that, TO_STRING_TAG, 'Error'); } if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message)); installErrorStack(that, $AggregateError, that.stack, 1); if (arguments.length > 2) installErrorCause(that, arguments[2]); var errorsArray = []; iterate(errors, push, { that: errorsArray }); createNonEnumerableProperty(that, 'errors', errorsArray); return that; }; if (setPrototypeOf) setPrototypeOf($AggregateError, $Error); else copyConstructorProperties($AggregateError, $Error, { name: true }); var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, { constructor: createPropertyDescriptor(1, $AggregateError), message: createPropertyDescriptor(1, ''), name: createPropertyDescriptor(1, 'AggregateError') }); $({ global: true, constructor: true, arity: 2 }, { AggregateError: $AggregateError }); },{"../internals/copy-constructor-properties":83,"../internals/create-non-enumerable-property":87,"../internals/create-property-descriptor":88,"../internals/error-stack-install":109,"../internals/export":111,"../internals/install-error-cause":139,"../internals/iterate":156,"../internals/normalize-string-argument":171,"../internals/object-create":174,"../internals/object-get-prototype-of":181,"../internals/object-is-prototype-of":183,"../internals/object-set-prototype-of":187,"../internals/well-known-symbol":256}],258:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error.constructor'); },{"../modules/es.aggregate-error.constructor":257}],259:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var fails = require('../internals/fails'); var isArray = require('../internals/is-array'); var isObject = require('../internals/is-object'); var toObject = require('../internals/to-object'); var lengthOfArrayLike = require('../internals/length-of-array-like'); var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); var createProperty = require('../internals/create-property'); var setArrayLength = require('../internals/array-set-length'); var arraySpeciesCreate = require('../internals/array-species-create'); var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); var wellKnownSymbol = require('../internals/well-known-symbol'); var V8_VERSION = require('../internals/environment-v8-version'); var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var isConcatSpreadable = function (O) { if (!isObject(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray(O); }; var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat'); $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { concat: function concat(arg) { var O = toObject(this); var A = arraySpeciesCreate(O, 0); var n = 0; var i, k, length, len, E; for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = lengthOfArrayLike(E); doesNotExceedSafeInteger(n + len); for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); } else { doesNotExceedSafeInteger(n + 1); createProperty(A, n++, E); } } setArrayLength(A, n); return A; } }); },{"../internals/array-method-has-species-support":70,"../internals/array-set-length":71,"../internals/array-species-create":74,"../internals/create-property":89,"../internals/does-not-exceed-safe-integer":96,"../internals/environment-v8-version":106,"../internals/export":111,"../internals/fails":112,"../internals/is-array":143,"../internals/is-object":149,"../internals/length-of-array-like":162,"../internals/to-object":242,"../internals/well-known-symbol":256}],260:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var from = require('../internals/array-from'); var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { Array.from(iterable); }); $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: from }); },{"../internals/array-from":67,"../internals/check-correctness-of-iteration":76,"../internals/export":111}],261:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var addToUnscopables = require('../internals/add-to-unscopables'); var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); var defineProperty = require('../internals/object-define-property').f; var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), index: 0, kind: kind }); }, function () { var state = getInternalState(this); var target = state.target; var index = state.index++; if (!target || index >= target.length) { state.target = null; return createIterResultObject(undefined, true); } switch (state.kind) { case 'keys': return createIterResultObject(index, false); case 'values': return createIterResultObject(target[index], false); } return createIterResultObject([index, target[index]], false); }, 'values'); var values = Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { defineProperty(values, 'name', { value: 'values' }); } catch (error) { } },{"../internals/add-to-unscopables":62,"../internals/create-iter-result-object":86,"../internals/descriptors":94,"../internals/internal-state":141,"../internals/is-pure":151,"../internals/iterator-define":159,"../internals/iterators":161,"../internals/object-define-property":176,"../internals/to-indexed-object":239}],262:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var apply = require('../internals/function-apply'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var fails = require('../internals/fails'); var isArray = require('../internals/is-array'); var isCallable = require('../internals/is-callable'); var isRawJSON = require('../internals/is-raw-json'); var isSymbol = require('../internals/is-symbol'); var classof = require('../internals/classof-raw'); var toString = require('../internals/to-string'); var arraySlice = require('../internals/array-slice'); var parseJSONString = require('../internals/parse-json-string'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var NATIVE_RAW_JSON = require('../internals/native-raw-json'); var $String = String; var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var replace = uncurryThis(''.replace); var slice = uncurryThis(''.slice); var push = uncurryThis([].push); var numberToString = uncurryThis(1.1.toString); var surrogates = /[\uD800-\uDFFF]/g; var lowSurrogates = /^[\uD800-\uDBFF]$/; var hiSurrogates = /^[\uDC00-\uDFFF]$/; var MARK = uid(); var MARK_LENGTH = MARK.length; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { var symbol = getBuiltIn('Symbol')('stringify detection'); return $stringify([symbol]) !== '[null]' || $stringify({ a: symbol }) !== '{}' || $stringify(Object(symbol)) !== '{}'; }); var ILL_FORMED_UNICODE = fails(function () { return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"'; }); var stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function (it, replacer) { var args = arraySlice(arguments); var $replacer = getReplacerFunction(replacer); if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; args[1] = function (key, value) { if (isCallable($replacer)) value = call($replacer, this, $String(key), value); if (!isSymbol(value)) return value; }; return apply($stringify, null, args); } : $stringify; var fixIllFormedJSON = function (match, offset, string) { var prev = charAt(string, offset - 1); var next = charAt(string, offset + 1); if ((exec(lowSurrogates, match) && !exec(hiSurrogates, next)) || (exec(hiSurrogates, match) && !exec(lowSurrogates, prev))) { return '\\u' + numberToString(charCodeAt(match, 0), 16); } return match; }; var getReplacerFunction = function (replacer) { if (isCallable(replacer)) return replacer; if (!isArray(replacer)) return; var rawLength = replacer.length; var keys = []; for (var i = 0; i < rawLength; i++) { var element = replacer[i]; if (typeof element == 'string') push(keys, element); else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element)); } var keysLength = keys.length; var root = true; return function (key, value) { if (root) { root = false; return value; } if (isArray(this)) return value; for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; }; }; if ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, { stringify: function stringify(text, replacer, space) { var replacerFunction = getReplacerFunction(replacer); var rawStrings = []; var json = stringifyWithProperSymbolsConversion(text, function (key, value) { var v = isCallable(replacerFunction) ? call(replacerFunction, this, $String(key), value) : value; return !NATIVE_RAW_JSON && isRawJSON(v) ? MARK + (push(rawStrings, v.rawJSON) - 1) : v; }, space); if (typeof json != 'string') return json; if (ILL_FORMED_UNICODE) json = replace(json, surrogates, fixIllFormedJSON); if (NATIVE_RAW_JSON) return json; var result = ''; var length = json.length; for (var i = 0; i < length; i++) { var chr = charAt(json, i); if (chr === '"') { var end = parseJSONString(json, ++i).end - 1; var string = slice(json, i, end); result += slice(string, 0, MARK_LENGTH) === MARK ? rawStrings[slice(string, MARK_LENGTH)] : '"' + string + '"'; i = end; } else result += chr; } return result; } }); },{"../internals/array-slice":72,"../internals/classof-raw":77,"../internals/export":111,"../internals/fails":112,"../internals/function-apply":115,"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/get-built-in":123,"../internals/is-array":143,"../internals/is-callable":144,"../internals/is-raw-json":152,"../internals/is-symbol":154,"../internals/native-raw-json":169,"../internals/parse-json-string":192,"../internals/symbol-constructor-detection":232,"../internals/to-string":247,"../internals/uid":249}],263:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(globalThis.JSON, 'JSON', true); },{"../internals/global-this":130,"../internals/set-to-string-tag":224}],264:[function(require,module,exports){ 'use strict'; var collection = require('../internals/collection'); var collectionStrong = require('../internals/collection-strong'); collection('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); },{"../internals/collection":82,"../internals/collection-strong":81}],265:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var IS_PURE = require('../internals/is-pure'); var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { getOrInsertComputed: function getOrInsertComputed(key, callbackfn) { aMap(this); aCallable(callbackfn); if (has(this, key)) return get(this, key); if (key === 0 && 1 / key === -Infinity) key = 0; var value = callbackfn(key); set(this, key, value); return value; } }); },{"../internals/a-callable":57,"../internals/a-map":59,"../internals/export":111,"../internals/is-pure":151,"../internals/map-helpers":164}],266:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var IS_PURE = require('../internals/is-pure'); var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { getOrInsert: function getOrInsert(key, value) { if (has(aMap(this), key)) return get(this, key); set(this, key, value); return value; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/is-pure":151,"../internals/map-helpers":164}],267:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var aCallable = require('../internals/a-callable'); var requireObjectCoercible = require('../internals/require-object-coercible'); var iterate = require('../internals/iterate'); var MapHelpers = require('../internals/map-helpers'); var IS_PURE = require('../internals/is-pure'); var fails = require('../internals/fails'); var Map = MapHelpers.Map; var has = MapHelpers.has; var get = MapHelpers.get; var set = MapHelpers.set; var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function () { return Map.groupBy('ab', function (it) { return it; }).get('a').length !== 1; }); $({ target: 'Map', stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var map = new Map(); var k = 0; iterate(items, function (value) { var key = callbackfn(value, k++); if (!has(map, key)) set(map, key, [value]); else push(get(map, key), value); }); return map; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/fails":112,"../internals/function-uncurry-this":122,"../internals/is-pure":151,"../internals/iterate":156,"../internals/map-helpers":164,"../internals/require-object-coercible":208}],268:[function(require,module,exports){ 'use strict'; require('../modules/es.map.constructor'); },{"../modules/es.map.constructor":264}],269:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var floor = Math.floor; var log = Math.log; var LOG2E = Math.LOG2E; $({ target: 'Math', stat: true }, { clz32: function clz32(x) { var n = x >>> 0; return n ? 31 - floor(log(n + 0.5) * LOG2E) : 32; } }); },{"../internals/export":111}],270:[function(require,module,exports){ 'use strict'; var setToStringTag = require('../internals/set-to-string-tag'); setToStringTag(Math, 'Math', true); },{"../internals/set-to-string-tag":224}],271:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var assign = require('../internals/object-assign'); $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { assign: assign }); },{"../internals/export":111,"../internals/object-assign":173}],272:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $entries = require('../internals/object-to-array').entries; $({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); },{"../internals/export":111,"../internals/object-to-array":188}],273:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var fails = require('../internals/fails'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var toObject = require('../internals/to-object'); var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); }); $({ target: 'Object', stat: true, forced: FORCED }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : []; } }); },{"../internals/export":111,"../internals/fails":112,"../internals/object-get-own-property-symbols":180,"../internals/symbol-constructor-detection":232,"../internals/to-object":242}],274:[function(require,module,exports){ 'use strict'; var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var defineBuiltIn = require('../internals/define-built-in'); var toString = require('../internals/object-to-string'); if (!TO_STRING_TAG_SUPPORT) { defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); } },{"../internals/define-built-in":91,"../internals/object-to-string":189,"../internals/to-string-tag-support":246}],275:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var promiseResolve = aCallable(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call(promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'fulfilled', value: value }; --remaining || resolve(values); }, function (error) { if (alreadyCalled) return; alreadyCalled = true; values[index] = { status: 'rejected', reason: error }; --remaining || resolve(values); }); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/iterate":156,"../internals/new-promise-capability":170,"../internals/perform":194,"../internals/promise-statics-incorrect-iteration":198}],276:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { all: function all(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var $promiseResolve = aCallable(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate(iterable, function (promise) { var index = counter++; var alreadyCalled = false; remaining++; call($promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/iterate":156,"../internals/new-promise-capability":170,"../internals/perform":194,"../internals/promise-statics-incorrect-iteration":198}],277:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var getBuiltIn = require('../internals/get-built-in'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); var PROMISE_ANY_ERROR = 'No one promise resolved'; $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; var AggregateError = getBuiltIn('AggregateError'); var capability = newPromiseCapabilityModule.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var promiseResolve = aCallable(C.resolve); var errors = []; var counter = 0; var remaining = 1; var alreadyResolved = false; iterate(iterable, function (promise) { var index = counter++; var alreadyRejected = false; remaining++; call(promiseResolve, C, promise).then(function (value) { if (alreadyRejected || alreadyResolved) return; alreadyResolved = true; resolve(value); }, function (error) { if (alreadyRejected || alreadyResolved) return; alreadyRejected = true; errors[index] = error; --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); }); --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/get-built-in":123,"../internals/iterate":156,"../internals/new-promise-capability":170,"../internals/perform":194,"../internals/promise-statics-incorrect-iteration":198}],278:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; var NativePromiseConstructor = require('../internals/promise-native-constructor'); var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var defineBuiltIn = require('../internals/define-built-in'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, { 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['catch']; if (NativePromisePrototype['catch'] !== method) { defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true }); } } },{"../internals/define-built-in":91,"../internals/export":111,"../internals/get-built-in":123,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/promise-constructor-detection":195,"../internals/promise-native-constructor":196}],279:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var IS_NODE = require('../internals/environment-is-node'); var globalThis = require('../internals/global-this'); var path = require('../internals/path'); var call = require('../internals/function-call'); var defineBuiltIn = require('../internals/define-built-in'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var setSpecies = require('../internals/set-species'); var aCallable = require('../internals/a-callable'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var anInstance = require('../internals/an-instance'); var speciesConstructor = require('../internals/species-constructor'); var task = require('../internals/task').set; var microtask = require('../internals/microtask'); var hostReportErrors = require('../internals/host-report-errors'); var perform = require('../internals/perform'); var Queue = require('../internals/queue'); var InternalStateModule = require('../internals/internal-state'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var PromiseConstructorDetection = require('../internals/promise-constructor-detection'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var PROMISE = 'Promise'; var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR; var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING; var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); var setInternalState = InternalStateModule.set; var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var PromiseConstructor = NativePromiseConstructor; var PromisePrototype = NativePromisePrototype; var TypeError = globalThis.TypeError; var document = globalThis.document; var process = globalThis.process; var newPromiseCapability = newPromiseCapabilityModule.f; var newGenericPromiseCapability = newPromiseCapability; var DISPATCH_EVENT = !!(document && document.createEvent && globalThis.dispatchEvent); var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING = 0; var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; var isThenable = function (it) { var then; return isObject(it) && isCallable(then = it.then) ? then : false; }; var callReaction = function (reaction, state) { var value = state.value; var ok = state.state === FULFILLED; var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(state); state.rejection = HANDLED; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(new TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { call(then, result, resolve, reject); } else resolve(result); } else reject(value); } catch (error) { if (domain && !exited) domain.exit(); reject(error); } }; var notify = function (state, isReject) { if (state.notified) return; state.notified = true; microtask(function () { var reactions = state.reactions; var reaction; while (reaction = reactions.get()) { callReaction(reaction, state); } state.notified = false; if (isReject && !state.rejection) onUnhandled(state); }); }; var dispatchEvent = function (name, promise, reason) { var event, handler; if (DISPATCH_EVENT) { event = document.createEvent('Event'); event.promise = promise; event.reason = reason; event.initEvent(name, false, true); globalThis.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { call(task, globalThis, function () { var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform(function () { if (IS_NODE) { process.emit('unhandledRejection', value, promise); } else dispatchEvent(UNHANDLED_REJECTION, promise, value); }); state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; var onHandleUnhandled = function (state) { call(task, globalThis, function () { var promise = state.facade; if (IS_NODE) { process.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; var bind = function (fn, state, unwrap) { return function (value) { fn(state, value, unwrap); }; }; var internalReject = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; state.value = value; state.state = REJECTED; notify(state, true); }; var internalResolve = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; try { if (state.facade === value) throw new TypeError("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask(function () { var wrapper = { done: false }; try { call(then, value, bind(internalResolve, wrapper, state), bind(internalReject, wrapper, state) ); } catch (error) { internalReject(wrapper, error, state); } }); } else { state.value = value; state.state = FULFILLED; notify(state, false); } } catch (error) { internalReject({ done: false }, error, state); } }; if (FORCED_PROMISE_CONSTRUCTOR) { PromiseConstructor = function Promise(executor) { anInstance(this, PromisePrototype); aCallable(executor); call(Internal, this); var state = getInternalPromiseState(this); try { executor(bind(internalResolve, state), bind(internalReject, state)); } catch (error) { internalReject(state, error); } }; PromisePrototype = PromiseConstructor.prototype; Internal = function Promise(executor) { setInternalState(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: new Queue(), rejection: false, state: PENDING, value: null }); }; Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); state.parent = true; reaction.ok = isCallable(onFulfilled) ? onFulfilled : true; reaction.fail = isCallable(onRejected) && onRejected; reaction.domain = IS_NODE ? process.domain : undefined; if (state.state === PENDING) state.reactions.add(reaction); else microtask(function () { callReaction(reaction, state); }); return reaction.promise; }); OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalPromiseState(promise); this.promise = promise; this.resolve = bind(internalResolve, state); this.reject = bind(internalReject, state); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) { nativeThen = NativePromisePrototype.then; if (!NATIVE_PROMISE_SUBCLASSING) { defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { call(nativeThen, that, resolve, reject); }).then(onFulfilled, onRejected); }, { unsafe: true }); } try { delete NativePromisePrototype.constructor; } catch (error) { } if (setPrototypeOf) { setPrototypeOf(NativePromisePrototype, PromisePrototype); } } } $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { Promise: PromiseConstructor }); PromiseWrapper = path.Promise; setToStringTag(PromiseConstructor, PROMISE, false, true); setSpecies(PROMISE); },{"../internals/a-callable":57,"../internals/an-instance":64,"../internals/define-built-in":91,"../internals/environment-is-node":103,"../internals/export":111,"../internals/function-call":118,"../internals/global-this":130,"../internals/host-report-errors":133,"../internals/internal-state":141,"../internals/is-callable":144,"../internals/is-object":149,"../internals/is-pure":151,"../internals/microtask":168,"../internals/new-promise-capability":170,"../internals/object-set-prototype-of":187,"../internals/path":193,"../internals/perform":194,"../internals/promise-constructor-detection":195,"../internals/promise-native-constructor":196,"../internals/queue":199,"../internals/set-species":222,"../internals/set-to-string-tag":224,"../internals/species-constructor":229,"../internals/task":237}],280:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IS_PURE = require('../internals/is-pure'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var fails = require('../internals/fails'); var getBuiltIn = require('../internals/get-built-in'); var isCallable = require('../internals/is-callable'); var speciesConstructor = require('../internals/species-constructor'); var promiseResolve = require('../internals/promise-resolve'); var defineBuiltIn = require('../internals/define-built-in'); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var NON_GENERIC = !!NativePromiseConstructor && fails(function () { NativePromisePrototype['finally'].call({ then: function () { } }, function () { }); }); $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor(this, getBuiltIn('Promise')); var isFunction = isCallable(onFinally); return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['finally']; if (NativePromisePrototype['finally'] !== method) { defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true }); } } },{"../internals/define-built-in":91,"../internals/export":111,"../internals/fails":112,"../internals/get-built-in":123,"../internals/is-callable":144,"../internals/is-pure":151,"../internals/promise-native-constructor":196,"../internals/promise-resolve":197,"../internals/species-constructor":229}],281:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.constructor'); require('../modules/es.promise.all'); require('../modules/es.promise.catch'); require('../modules/es.promise.race'); require('../modules/es.promise.reject'); require('../modules/es.promise.resolve'); },{"../modules/es.promise.all":276,"../modules/es.promise.catch":278,"../modules/es.promise.constructor":279,"../modules/es.promise.race":282,"../modules/es.promise.reject":283,"../modules/es.promise.resolve":284}],282:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var aCallable = require('../internals/a-callable'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var perform = require('../internals/perform'); var iterate = require('../internals/iterate'); var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { race: function race(iterable) { var C = this; var capability = newPromiseCapabilityModule.f(C); var reject = capability.reject; var result = perform(function () { var $promiseResolve = aCallable(C.resolve); iterate(iterable, function (promise) { call($promiseResolve, C, promise).then(capability.resolve, reject); }); }); if (result.error) reject(result.value); return capability.promise; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/iterate":156,"../internals/new-promise-capability":170,"../internals/perform":194,"../internals/promise-statics-incorrect-iteration":198}],283:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { reject: function reject(r) { var capability = newPromiseCapabilityModule.f(this); var capabilityReject = capability.reject; capabilityReject(r); return capability.promise; } }); },{"../internals/export":111,"../internals/new-promise-capability":170,"../internals/promise-constructor-detection":195}],284:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var IS_PURE = require('../internals/is-pure'); var NativePromiseConstructor = require('../internals/promise-native-constructor'); var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; var promiseResolve = require('../internals/promise-resolve'); var PromiseConstructorWrapper = getBuiltIn('Promise'); var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, { resolve: function resolve(x) { return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x); } }); },{"../internals/export":111,"../internals/get-built-in":123,"../internals/is-pure":151,"../internals/promise-constructor-detection":195,"../internals/promise-native-constructor":196,"../internals/promise-resolve":197}],285:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var apply = require('../internals/function-apply'); var slice = require('../internals/array-slice'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); var aCallable = require('../internals/a-callable'); var perform = require('../internals/perform'); var Promise = globalThis.Promise; var ACCEPT_ARGUMENTS = false; var FORCED = !Promise || !Promise['try'] || perform(function () { Promise['try'](function (argument) { ACCEPT_ARGUMENTS = argument === 8; }, 8); }).error || !ACCEPT_ARGUMENTS; $({ target: 'Promise', stat: true, forced: FORCED }, { 'try': function (callbackfn ) { var args = arguments.length > 1 ? slice(arguments, 1) : []; var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(function () { return apply(aCallable(callbackfn), undefined, args); }); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); },{"../internals/a-callable":57,"../internals/array-slice":72,"../internals/export":111,"../internals/function-apply":115,"../internals/global-this":130,"../internals/new-promise-capability":170,"../internals/perform":194}],286:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var newPromiseCapabilityModule = require('../internals/new-promise-capability'); $({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); },{"../internals/export":111,"../internals/new-promise-capability":170}],287:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var setToStringTag = require('../internals/set-to-string-tag'); $({ global: true }, { Reflect: {} }); setToStringTag(globalThis.Reflect, 'Reflect', true); },{"../internals/export":111,"../internals/global-this":130,"../internals/set-to-string-tag":224}],288:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var exec = require('../internals/regexp-exec'); $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { exec: exec }); },{"../internals/export":111,"../internals/regexp-exec":201}],289:[function(require,module,exports){ 'use strict'; var collection = require('../internals/collection'); var collectionStrong = require('../internals/collection-strong'); collection('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); },{"../internals/collection":82,"../internals/collection-strong":81}],290:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var difference = require('../internals/set-difference'); var fails = require('../internals/fails'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var SET_LIKE_INCORRECT_BEHAVIOR = !setMethodAcceptSetLike('difference', function (result) { return result.size === 0; }); var FORCED = SET_LIKE_INCORRECT_BEHAVIOR || fails(function () { var setLike = { size: 1, has: function () { return true; }, keys: function () { var index = 0; return { next: function () { var done = index++ > 1; if (baseSet.has(1)) baseSet.clear(); return { done: done, value: 2 }; } }; } }; var baseSet = new Set([1, 2, 3, 4]); return baseSet.difference(setLike).size !== 3; }); $({ target: 'Set', proto: true, real: true, forced: FORCED }, { difference: difference }); },{"../internals/export":111,"../internals/fails":112,"../internals/set-difference":212,"../internals/set-method-accept-set-like":219}],291:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var fails = require('../internals/fails'); var intersection = require('../internals/set-intersection'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var INCORRECT = !setMethodAcceptSetLike('intersection', function (result) { return result.size === 2 && result.has(1) && result.has(2); }) || fails(function () { return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2'; }); $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { intersection: intersection }); },{"../internals/export":111,"../internals/fails":112,"../internals/set-intersection":214,"../internals/set-method-accept-set-like":219}],292:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isDisjointFrom = require('../internals/set-is-disjoint-from'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var INCORRECT = !setMethodAcceptSetLike('isDisjointFrom', function (result) { return !result; }); $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { isDisjointFrom: isDisjointFrom }); },{"../internals/export":111,"../internals/set-is-disjoint-from":215,"../internals/set-method-accept-set-like":219}],293:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isSubsetOf = require('../internals/set-is-subset-of'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var INCORRECT = !setMethodAcceptSetLike('isSubsetOf', function (result) { return result; }); $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { isSubsetOf: isSubsetOf }); },{"../internals/export":111,"../internals/set-is-subset-of":216,"../internals/set-method-accept-set-like":219}],294:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isSupersetOf = require('../internals/set-is-superset-of'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var INCORRECT = !setMethodAcceptSetLike('isSupersetOf', function (result) { return !result; }); $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, { isSupersetOf: isSupersetOf }); },{"../internals/export":111,"../internals/set-is-superset-of":217,"../internals/set-method-accept-set-like":219}],295:[function(require,module,exports){ 'use strict'; require('../modules/es.set.constructor'); },{"../modules/es.set.constructor":289}],296:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var symmetricDifference = require('../internals/set-symmetric-difference'); var setMethodGetKeysBeforeCloning = require('../internals/set-method-get-keys-before-cloning-detection'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference'); $({ target: 'Set', proto: true, real: true, forced: FORCED }, { symmetricDifference: symmetricDifference }); },{"../internals/export":111,"../internals/set-method-accept-set-like":219,"../internals/set-method-get-keys-before-cloning-detection":220,"../internals/set-symmetric-difference":223}],297:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var union = require('../internals/set-union'); var setMethodGetKeysBeforeCloning = require('../internals/set-method-get-keys-before-cloning-detection'); var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like'); var FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union'); $({ target: 'Set', proto: true, real: true, forced: FORCED }, { union: union }); },{"../internals/export":111,"../internals/set-method-accept-set-like":219,"../internals/set-method-get-keys-before-cloning-detection":220,"../internals/set-union":225}],298:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this-clause'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); var slice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { endsWith: function endsWith(searchString ) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min(toLength(endPosition), len); var search = toString(searchString); return slice(that, end - search.length, end) === search; } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":111,"../internals/function-uncurry-this-clause":121,"../internals/is-pure":151,"../internals/not-a-regexp":172,"../internals/object-get-own-property-descriptor":177,"../internals/require-object-coercible":208,"../internals/to-length":241,"../internals/to-string":247}],299:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var toString = require('../internals/to-string'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var stringIndexOf = uncurryThis(''.indexOf); $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { includes: function includes(searchString ) { return !!~stringIndexOf( toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined ); } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":111,"../internals/function-uncurry-this":122,"../internals/not-a-regexp":172,"../internals/require-object-coercible":208,"../internals/to-string":247}],300:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; var toString = require('../internals/to-string'); var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/iterator-define'); var createIterResultObject = require('../internals/create-iter-result-object'); 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: toString(iterated), index: 0 }); }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return createIterResultObject(undefined, true); point = charAt(string, index); state.index += point.length; return createIterResultObject(point, false); }); },{"../internals/create-iter-result-object":86,"../internals/internal-state":141,"../internals/iterator-define":159,"../internals/string-multibyte":230,"../internals/to-string":247}],301:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var repeat = require('../internals/string-repeat'); $({ target: 'String', proto: true }, { repeat: repeat }); },{"../internals/export":111,"../internals/string-repeat":231}],302:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var requireObjectCoercible = require('../internals/require-object-coercible'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var isRegExp = require('../internals/is-regexp'); var toString = require('../internals/to-string'); var getMethod = require('../internals/get-method'); var getRegExpFlags = require('../internals/regexp-get-flags'); var getSubstitution = require('../internals/get-substitution'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var REPLACE = wellKnownSymbol('replace'); var $TypeError = TypeError; var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var max = Math.max; $({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, position, replacement; var endOfLastMatch = 0; var result = ''; if (isObject(searchValue)) { IS_REG_EXP = isRegExp(searchValue); if (IS_REG_EXP) { flags = toString(requireObjectCoercible(getRegExpFlags(searchValue))); if (!~indexOf(flags, 'g')) throw new $TypeError('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod(searchValue, REPLACE); if (replacer) return call(replacer, searchValue, O, replaceValue); if (IS_PURE && IS_REG_EXP) return replace(toString(O), searchValue, replaceValue); } string = toString(O); searchString = toString(searchValue); functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); searchLength = searchString.length; advanceBy = max(1, searchLength); position = indexOf(string, searchString); while (position !== -1) { replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += stringSlice(string, endOfLastMatch); } return result; } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/get-method":127,"../internals/get-substitution":129,"../internals/is-callable":144,"../internals/is-object":149,"../internals/is-pure":151,"../internals/is-regexp":153,"../internals/regexp-get-flags":204,"../internals/require-object-coercible":208,"../internals/to-string":247,"../internals/well-known-symbol":256}],303:[function(require,module,exports){ 'use strict'; var apply = require('../internals/function-apply'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var fails = require('../internals/fails'); var anObject = require('../internals/an-object'); var isCallable = require('../internals/is-callable'); var isObject = require('../internals/is-object'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var requireObjectCoercible = require('../internals/require-object-coercible'); var advanceStringIndex = require('../internals/advance-string-index'); var getMethod = require('../internals/get-method'); var getSubstitution = require('../internals/get-substitution'); var getRegExpFlags = require('../internals/regexp-get-flags'); var regExpExec = require('../internals/regexp-exec-abstract'); var wellKnownSymbol = require('../internals/well-known-symbol'); var REPLACE = wellKnownSymbol('replace'); var max = Math.max; var min = Math.min; var concat = uncurryThis([].concat); var push = uncurryThis([].push); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); var maybeToString = function (it) { return it === undefined ? it : String(it); }; var REPLACE_KEEPS_$0 = (function () { return 'a'.replace(/./, '$0') === '$0'; })(); var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { if (/./[REPLACE]) { return /./[REPLACE]('a', '$0') === ''; } return false; })(); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; return ''.replace(re, '$') !== '7'; }); fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; return [ function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = isObject(searchValue) ? getMethod(searchValue, REPLACE) : undefined; return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue); }, function (string, replaceValue) { var rx = anObject(this); var S = toString(string); if ( typeof replaceValue == 'string' && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, '$<') === -1 ) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } var functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); var flags = toString(getRegExpFlags(rx)); var global = stringIndexOf(flags, 'g') !== -1; var fullUnicode; if (global) { fullUnicode = stringIndexOf(flags, 'u') !== -1; rx.lastIndex = 0; } var results = []; var result; while (true) { result = regExpExec(rx, S); if (result === null) break; push(results, result); if (!global) break; var matchStr = toString(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = toString(result[0]); var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); var captures = []; var replacement; for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = concat([matched], captures, position, S); if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); replacement = toString(apply(replaceValue, undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + stringSlice(S, nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); },{"../internals/advance-string-index":63,"../internals/an-object":65,"../internals/fails":112,"../internals/fix-regexp-well-known-symbol-logic":113,"../internals/function-apply":115,"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/get-method":127,"../internals/get-substitution":129,"../internals/is-callable":144,"../internals/is-object":149,"../internals/regexp-exec-abstract":200,"../internals/regexp-get-flags":204,"../internals/require-object-coercible":208,"../internals/to-integer-or-infinity":240,"../internals/to-length":241,"../internals/to-string":247,"../internals/well-known-symbol":256}],304:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this-clause'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var toLength = require('../internals/to-length'); var toString = require('../internals/to-string'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); var IS_PURE = require('../internals/is-pure'); var stringSlice = uncurryThis(''.slice); var min = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString ) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString(searchString); return stringSlice(that, index, index + search.length) === search; } }); },{"../internals/correct-is-regexp-logic":84,"../internals/export":111,"../internals/function-uncurry-this-clause":121,"../internals/is-pure":151,"../internals/not-a-regexp":172,"../internals/object-get-own-property-descriptor":177,"../internals/require-object-coercible":208,"../internals/to-length":241,"../internals/to-string":247}],305:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var Symbol = globalThis.Symbol; defineWellKnownSymbol('asyncDispose'); if (Symbol) { var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose'); if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); } } },{"../internals/global-this":130,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/well-known-symbol-define":254}],306:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('asyncIterator'); },{"../internals/well-known-symbol-define":254}],307:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var globalThis = require('../internals/global-this'); var call = require('../internals/function-call'); var uncurryThis = require('../internals/function-uncurry-this'); var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); var fails = require('../internals/fails'); var hasOwn = require('../internals/has-own-property'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var anObject = require('../internals/an-object'); var toIndexedObject = require('../internals/to-indexed-object'); var toPropertyKey = require('../internals/to-property-key'); var $toString = require('../internals/to-string'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var nativeObjectCreate = require('../internals/object-create'); var objectKeys = require('../internals/object-keys'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); var definePropertiesModule = require('../internals/object-define-properties'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var defineBuiltIn = require('../internals/define-built-in'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var shared = require('../internals/shared'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var uid = require('../internals/uid'); var wellKnownSymbol = require('../internals/well-known-symbol'); var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); var setToStringTag = require('../internals/set-to-string-tag'); var InternalStateModule = require('../internals/internal-state'); var $forEach = require('../internals/array-iteration').forEach; var HIDDEN = sharedKey('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE = 'prototype'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(SYMBOL); var ObjectPrototype = Object[PROTOTYPE]; var $Symbol = globalThis.Symbol; var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; var RangeError = globalThis.RangeError; var TypeError = globalThis.TypeError; var QObject = globalThis.QObject; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var nativeDefineProperty = definePropertyModule.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; var push = uncurryThis([].push); var AllSymbols = shared('symbols'); var ObjectPrototypeSymbols = shared('op-symbols'); var WellKnownSymbolsStore = shared('wks'); var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; var fallbackDefineProperty = function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; nativeDefineProperty(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); } }; var setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } })).a !== 7; }) ? fallbackDefineProperty : nativeDefineProperty; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); setInternalState(symbol, { type: SYMBOL, tag: tag, description: description }); if (!DESCRIPTORS) symbol.description = description; return symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); var key = toPropertyKey(P); anObject(Attributes); if (hasOwn(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null))); O[HIDDEN][key] = true; } else { if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); $forEach(keys, function (key) { if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]); }); return O; }; var $create = function create(O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); }; var $propertyIsEnumerable = function propertyIsEnumerable(V) { var P = toPropertyKey(V); var enumerable = call(nativePropertyIsEnumerable, this, P); if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false; return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPropertyKey(P); if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor(it, key); if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key); }); return result; }; var $getOwnPropertySymbols = function (O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { push(result, AllSymbols[key]); } }); return result; }; if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (isPrototypeOf(SymbolPrototype, this)) throw new TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); var tag = uid(description); var setter = function (value) { var $this = this === undefined ? globalThis : this; if ($this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag)) $this[HIDDEN][tag] = false; var descriptor = createPropertyDescriptor(1, value); try { setSymbolDescriptor($this, tag, descriptor); } catch (error) { if (!(error instanceof RangeError)) throw error; fallbackDefineProperty($this, tag, descriptor); } }; if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); return wrap(tag, description); }; SymbolPrototype = $Symbol[PROTOTYPE]; defineBuiltIn(SymbolPrototype, 'toString', function toString() { return getInternalState(this).tag; }); defineBuiltIn($Symbol, 'withoutSetter', function (description) { return wrap(uid(description), description); }); propertyIsEnumerableModule.f = $propertyIsEnumerable; definePropertyModule.f = $defineProperty; definePropertiesModule.f = $defineProperties; getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol(name), name); }; if (DESCRIPTORS) { defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { return getInternalState(this).description; } }); if (!IS_PURE) { defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); } } } $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }); $forEach(objectKeys(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol(name); }); $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { create: $create, defineProperty: $defineProperty, defineProperties: $defineProperties, getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { getOwnPropertyNames: $getOwnPropertyNames }); defineSymbolToPrimitive(); setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; },{"../internals/an-object":65,"../internals/array-iteration":69,"../internals/create-property-descriptor":88,"../internals/define-built-in":91,"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/export":111,"../internals/fails":112,"../internals/function-call":118,"../internals/function-uncurry-this":122,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/hidden-keys":132,"../internals/internal-state":141,"../internals/is-pure":151,"../internals/object-create":174,"../internals/object-define-properties":175,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/object-get-own-property-names":179,"../internals/object-get-own-property-names-external":178,"../internals/object-get-own-property-symbols":180,"../internals/object-is-prototype-of":183,"../internals/object-keys":185,"../internals/object-property-is-enumerable":186,"../internals/set-to-string-tag":224,"../internals/shared":228,"../internals/shared-key":226,"../internals/symbol-constructor-detection":232,"../internals/symbol-define-to-primitive":233,"../internals/to-indexed-object":239,"../internals/to-property-key":244,"../internals/to-string":247,"../internals/uid":249,"../internals/well-known-symbol":256,"../internals/well-known-symbol-define":254,"../internals/well-known-symbol-wrapped":255}],308:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var globalThis = require('../internals/global-this'); var uncurryThis = require('../internals/function-uncurry-this'); var hasOwn = require('../internals/has-own-property'); var isCallable = require('../internals/is-callable'); var isPrototypeOf = require('../internals/object-is-prototype-of'); var toString = require('../internals/to-string'); var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var NativeSymbol = globalThis.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue(this); if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); return desc === '' ? undefined : desc; } }); $({ global: true, constructor: true, forced: true }, { Symbol: SymbolWrapper }); } },{"../internals/copy-constructor-properties":83,"../internals/define-built-in-accessor":90,"../internals/descriptors":94,"../internals/export":111,"../internals/function-uncurry-this":122,"../internals/global-this":130,"../internals/has-own-property":131,"../internals/is-callable":144,"../internals/object-is-prototype-of":183,"../internals/to-string":247}],309:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var Symbol = globalThis.Symbol; defineWellKnownSymbol('dispose'); if (Symbol) { var descriptor = getOwnPropertyDescriptor(Symbol, 'dispose'); if (descriptor.enumerable && descriptor.configurable && descriptor.writable) { defineProperty(Symbol, 'dispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false }); } } },{"../internals/global-this":130,"../internals/object-define-property":176,"../internals/object-get-own-property-descriptor":177,"../internals/well-known-symbol-define":254}],310:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var hasOwn = require('../internals/has-own-property'); var toString = require('../internals/to-string'); var shared = require('../internals/shared'); var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { 'for': function (key) { var string = toString(key); if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = getBuiltIn('Symbol')(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry[symbol] = string; return symbol; } }); },{"../internals/export":111,"../internals/get-built-in":123,"../internals/has-own-property":131,"../internals/shared":228,"../internals/symbol-registry-detection":236,"../internals/to-string":247}],311:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('hasInstance'); },{"../internals/well-known-symbol-define":254}],312:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('isConcatSpreadable'); },{"../internals/well-known-symbol-define":254}],313:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('iterator'); },{"../internals/well-known-symbol-define":254}],314:[function(require,module,exports){ 'use strict'; require('../modules/es.symbol.constructor'); require('../modules/es.symbol.for'); require('../modules/es.symbol.key-for'); require('../modules/es.json.stringify'); require('../modules/es.object.get-own-property-symbols'); },{"../modules/es.json.stringify":262,"../modules/es.object.get-own-property-symbols":273,"../modules/es.symbol.constructor":307,"../modules/es.symbol.for":310,"../modules/es.symbol.key-for":315}],315:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var hasOwn = require('../internals/has-own-property'); var isSymbol = require('../internals/is-symbol'); var tryToString = require('../internals/try-to-string'); var shared = require('../internals/shared'); var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw new TypeError(tryToString(sym) + ' is not a symbol'); if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; } }); },{"../internals/export":111,"../internals/has-own-property":131,"../internals/is-symbol":154,"../internals/shared":228,"../internals/symbol-registry-detection":236,"../internals/try-to-string":248}],316:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matchAll'); },{"../internals/well-known-symbol-define":254}],317:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('match'); },{"../internals/well-known-symbol-define":254}],318:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replace'); },{"../internals/well-known-symbol-define":254}],319:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('search'); },{"../internals/well-known-symbol-define":254}],320:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('species'); },{"../internals/well-known-symbol-define":254}],321:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('split'); },{"../internals/well-known-symbol-define":254}],322:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); defineWellKnownSymbol('toPrimitive'); defineSymbolToPrimitive(); },{"../internals/symbol-define-to-primitive":233,"../internals/well-known-symbol-define":254}],323:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); var setToStringTag = require('../internals/set-to-string-tag'); defineWellKnownSymbol('toStringTag'); setToStringTag(getBuiltIn('Symbol'), 'Symbol'); },{"../internals/get-built-in":123,"../internals/set-to-string-tag":224,"../internals/well-known-symbol-define":254}],324:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('unscopables'); },{"../internals/well-known-symbol-define":254}],325:[function(require,module,exports){ 'use strict'; require('../modules/es.aggregate-error'); },{"../modules/es.aggregate-error":258}],326:[function(require,module,exports){ 'use strict'; var wellKnownSymbol = require('../internals/well-known-symbol'); var defineProperty = require('../internals/object-define-property').f; var METADATA = wellKnownSymbol('metadata'); var FunctionPrototype = Function.prototype; if (FunctionPrototype[METADATA] === undefined) { defineProperty(FunctionPrototype, METADATA, { value: null }); } },{"../internals/object-define-property":176,"../internals/well-known-symbol":256}],327:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var remove = require('../internals/map-helpers').remove; $({ target: 'Map', proto: true, real: true, forced: true }, { deleteAll: function deleteAll() { var collection = aMap(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/map-helpers":164}],328:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { emplace: function emplace(key, handler) { var map = aMap(this); var value, inserted; if (has(map, key)) { value = get(map, key); if ('update' in handler) { value = handler.update(value, key, map); set(map, key, value); } return value; } inserted = handler.insert(key, map); set(map, key, inserted); return inserted; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/map-helpers":164}],329:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(map, function (value, key) { if (!boundFunction(value, key, map)) return false; }, true) !== false; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-iterate":165}],330:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { if (boundFunction(value, key, map)) set(newMap, key, value); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-helpers":164,"../internals/map-iterate":165}],331:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { findKey: function findKey(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(map, function (value, key) { if (boundFunction(value, key, map)) return { key: key }; }, true); return result && result.key; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-iterate":165}],332:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(map, function (value, key) { if (boundFunction(value, key, map)) return { value: value }; }, true); return result && result.value; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-iterate":165}],333:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var MapHelpers = require('../internals/map-helpers'); var createCollectionFrom = require('../internals/collection-from'); $({ target: 'Map', stat: true, forced: true }, { from: createCollectionFrom(MapHelpers.Map, MapHelpers.set, true) }); },{"../internals/collection-from":79,"../internals/export":111,"../internals/map-helpers":164}],334:[function(require,module,exports){ 'use strict'; require('../modules/es.map.get-or-insert-computed'); },{"../modules/es.map.get-or-insert-computed":265}],335:[function(require,module,exports){ 'use strict'; require('../modules/es.map.get-or-insert'); },{"../modules/es.map.get-or-insert":266}],336:[function(require,module,exports){ 'use strict'; require('../modules/es.map.group-by'); },{"../modules/es.map.group-by":267}],337:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var sameValueZero = require('../internals/same-value-zero'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { includes: function includes(searchElement) { return iterate(aMap(this), function (value) { if (sameValueZero(value, searchElement)) return true; }, true) === true; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/map-iterate":165,"../internals/same-value-zero":210}],338:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var iterate = require('../internals/iterate'); var isCallable = require('../internals/is-callable'); var aCallable = require('../internals/a-callable'); var Map = require('../internals/map-helpers').Map; $({ target: 'Map', stat: true, forced: true }, { keyBy: function keyBy(iterable, keyDerivative) { var C = isCallable(this) ? this : Map; var newMap = new C(); aCallable(keyDerivative); var setter = aCallable(newMap.set); iterate(iterable, function (element) { call(setter, newMap, keyDerivative(element), element); }); return newMap; } }); },{"../internals/a-callable":57,"../internals/export":111,"../internals/function-call":118,"../internals/is-callable":144,"../internals/iterate":156,"../internals/map-helpers":164}],339:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { keyOf: function keyOf(searchElement) { var result = iterate(aMap(this), function (value, key) { if (value === searchElement) return { key: key }; }, true); return result && result.key; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/map-iterate":165}],340:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { mapKeys: function mapKeys(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { set(newMap, boundFunction(value, key, map), value); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-helpers":164,"../internals/map-iterate":165}],341:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var iterate = require('../internals/map-iterate'); var Map = MapHelpers.Map; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { mapValues: function mapValues(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newMap = new Map(); iterate(map, function (value, key) { set(newMap, key, boundFunction(value, key, map)); }); return newMap; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-helpers":164,"../internals/map-iterate":165}],342:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aMap = require('../internals/a-map'); var iterate = require('../internals/iterate'); var set = require('../internals/map-helpers').set; $({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, { merge: function merge(iterable ) { var map = aMap(this); var argumentsLength = arguments.length; var i = 0; while (i < argumentsLength) { iterate(arguments[i++], function (key, value) { set(map, key, value); }, { AS_ENTRIES: true }); } return map; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/iterate":156,"../internals/map-helpers":164}],343:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var MapHelpers = require('../internals/map-helpers'); var createCollectionOf = require('../internals/collection-of'); $({ target: 'Map', stat: true, forced: true }, { of: createCollectionOf(MapHelpers.Map, MapHelpers.set, true) }); },{"../internals/collection-of":80,"../internals/export":111,"../internals/map-helpers":164}],344:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); var $TypeError = TypeError; $({ target: 'Map', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var map = aMap(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(map, function (value, key) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } }); if (noInitial) throw new $TypeError('Reduce of empty map with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/a-map":59,"../internals/export":111,"../internals/map-iterate":165}],345:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aMap = require('../internals/a-map'); var iterate = require('../internals/map-iterate'); $({ target: 'Map', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var map = aMap(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(map, function (value, key) { if (boundFunction(value, key, map)) return true; }, true) === true; } }); },{"../internals/a-map":59,"../internals/export":111,"../internals/function-bind-context":116,"../internals/map-iterate":165}],346:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var upsert = require('../internals/map-upsert'); $({ target: 'Map', proto: true, real: true, name: 'upsert', forced: true }, { updateOrInsert: upsert }); },{"../internals/export":111,"../internals/map-upsert":166}],347:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aMap = require('../internals/a-map'); var MapHelpers = require('../internals/map-helpers'); var $TypeError = TypeError; var get = MapHelpers.get; var has = MapHelpers.has; var set = MapHelpers.set; $({ target: 'Map', proto: true, real: true, forced: true }, { update: function update(key, callback ) { var map = aMap(this); var length = arguments.length; aCallable(callback); var isPresentInMap = has(map, key); if (!isPresentInMap && length < 3) { throw new $TypeError('Updating absent value'); } var value = isPresentInMap ? get(map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); set(map, key, callback(value, key, map)); return map; } }); },{"../internals/a-callable":57,"../internals/a-map":59,"../internals/export":111,"../internals/map-helpers":164}],348:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var upsert = require('../internals/map-upsert'); $({ target: 'Map', proto: true, real: true, forced: true }, { upsert: upsert }); },{"../internals/export":111,"../internals/map-upsert":166}],349:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.all-settled.js'); },{"../modules/es.promise.all-settled.js":275}],350:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.any'); },{"../modules/es.promise.any":277}],351:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.try.js'); },{"../modules/es.promise.try.js":285}],352:[function(require,module,exports){ 'use strict'; require('../modules/es.promise.with-resolvers'); },{"../modules/es.promise.with-resolvers":286}],353:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aSet = require('../internals/a-set'); var add = require('../internals/set-helpers').add; $({ target: 'Set', proto: true, real: true, forced: true }, { addAll: function addAll() { var set = aSet(this); for (var k = 0, len = arguments.length; k < len; k++) { add(set, arguments[k]); } return set; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/set-helpers":213}],354:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aSet = require('../internals/a-set'); var remove = require('../internals/set-helpers').remove; $({ target: 'Set', proto: true, real: true, forced: true }, { deleteAll: function deleteAll() { var collection = aSet(this); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remove(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/set-helpers":213}],355:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $difference = require('../internals/set-difference'); $({ target: 'Set', proto: true, real: true, forced: true }, { difference: function difference(other) { return call($difference, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-difference":212,"../internals/to-set-like":245}],356:[function(require,module,exports){ 'use strict'; require('../modules/es.set.difference.v2'); },{"../modules/es.set.difference.v2":290}],357:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { every: function every(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(set, function (value) { if (!boundFunction(value, value, set)) return false; }, true) !== false; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-bind-context":116,"../internals/set-iterate":218}],358:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; $({ target: 'Set', proto: true, real: true, forced: true }, { filter: function filter(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set(); iterate(set, function (value) { if (boundFunction(value, value, set)) add(newSet, value); }); return newSet; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-bind-context":116,"../internals/set-helpers":213,"../internals/set-iterate":218}],359:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { find: function find(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var result = iterate(set, function (value) { if (boundFunction(value, value, set)) return { value: value }; }, true); return result && result.value; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-bind-context":116,"../internals/set-iterate":218}],360:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var SetHelpers = require('../internals/set-helpers'); var createCollectionFrom = require('../internals/collection-from'); $({ target: 'Set', stat: true, forced: true }, { from: createCollectionFrom(SetHelpers.Set, SetHelpers.add, false) }); },{"../internals/collection-from":79,"../internals/export":111,"../internals/set-helpers":213}],361:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $intersection = require('../internals/set-intersection'); $({ target: 'Set', proto: true, real: true, forced: true }, { intersection: function intersection(other) { return call($intersection, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-intersection":214,"../internals/to-set-like":245}],362:[function(require,module,exports){ 'use strict'; require('../modules/es.set.intersection.v2'); },{"../modules/es.set.intersection.v2":291}],363:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isDisjointFrom = require('../internals/set-is-disjoint-from'); $({ target: 'Set', proto: true, real: true, forced: true }, { isDisjointFrom: function isDisjointFrom(other) { return call($isDisjointFrom, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-is-disjoint-from":215,"../internals/to-set-like":245}],364:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-disjoint-from.v2'); },{"../modules/es.set.is-disjoint-from.v2":292}],365:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isSubsetOf = require('../internals/set-is-subset-of'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSubsetOf: function isSubsetOf(other) { return call($isSubsetOf, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-is-subset-of":216,"../internals/to-set-like":245}],366:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-subset-of.v2'); },{"../modules/es.set.is-subset-of.v2":293}],367:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $isSupersetOf = require('../internals/set-is-superset-of'); $({ target: 'Set', proto: true, real: true, forced: true }, { isSupersetOf: function isSupersetOf(other) { return call($isSupersetOf, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-is-superset-of":217,"../internals/to-set-like":245}],368:[function(require,module,exports){ 'use strict'; require('../modules/es.set.is-superset-of.v2'); },{"../modules/es.set.is-superset-of.v2":294}],369:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var uncurryThis = require('../internals/function-uncurry-this'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); var toString = require('../internals/to-string'); var arrayJoin = uncurryThis([].join); var push = uncurryThis([].push); $({ target: 'Set', proto: true, real: true, forced: true }, { join: function join(separator) { var set = aSet(this); var sep = separator === undefined ? ',' : toString(separator); var array = []; iterate(set, function (value) { push(array, value); }); return arrayJoin(array, sep); } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-uncurry-this":122,"../internals/set-iterate":218,"../internals/to-string":247}],370:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var SetHelpers = require('../internals/set-helpers'); var iterate = require('../internals/set-iterate'); var Set = SetHelpers.Set; var add = SetHelpers.add; $({ target: 'Set', proto: true, real: true, forced: true }, { map: function map(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var newSet = new Set(); iterate(set, function (value) { add(newSet, boundFunction(value, value, set)); }); return newSet; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-bind-context":116,"../internals/set-helpers":213,"../internals/set-iterate":218}],371:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var SetHelpers = require('../internals/set-helpers'); var createCollectionOf = require('../internals/collection-of'); $({ target: 'Set', stat: true, forced: true }, { of: createCollectionOf(SetHelpers.Set, SetHelpers.add, false) }); },{"../internals/collection-of":80,"../internals/export":111,"../internals/set-helpers":213}],372:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var aCallable = require('../internals/a-callable'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); var $TypeError = TypeError; $({ target: 'Set', proto: true, real: true, forced: true }, { reduce: function reduce(callbackfn ) { var set = aSet(this); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable(callbackfn); iterate(set, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } }); if (noInitial) throw new $TypeError('Reduce of empty set with no initial value'); return accumulator; } }); },{"../internals/a-callable":57,"../internals/a-set":61,"../internals/export":111,"../internals/set-iterate":218}],373:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var bind = require('../internals/function-bind-context'); var aSet = require('../internals/a-set'); var iterate = require('../internals/set-iterate'); $({ target: 'Set', proto: true, real: true, forced: true }, { some: function some(callbackfn ) { var set = aSet(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); return iterate(set, function (value) { if (boundFunction(value, value, set)) return true; }, true) === true; } }); },{"../internals/a-set":61,"../internals/export":111,"../internals/function-bind-context":116,"../internals/set-iterate":218}],374:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $symmetricDifference = require('../internals/set-symmetric-difference'); $({ target: 'Set', proto: true, real: true, forced: true }, { symmetricDifference: function symmetricDifference(other) { return call($symmetricDifference, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-symmetric-difference":223,"../internals/to-set-like":245}],375:[function(require,module,exports){ 'use strict'; require('../modules/es.set.symmetric-difference.v2'); },{"../modules/es.set.symmetric-difference.v2":296}],376:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var call = require('../internals/function-call'); var toSetLike = require('../internals/to-set-like'); var $union = require('../internals/set-union'); $({ target: 'Set', proto: true, real: true, forced: true }, { union: function union(other) { return call($union, this, toSetLike(other)); } }); },{"../internals/export":111,"../internals/function-call":118,"../internals/set-union":225,"../internals/to-set-like":245}],377:[function(require,module,exports){ 'use strict'; require('../modules/es.set.union.v2'); },{"../modules/es.set.union.v2":297}],378:[function(require,module,exports){ 'use strict'; require('../modules/es.string.replace-all'); },{"../modules/es.string.replace-all":302}],379:[function(require,module,exports){ 'use strict'; require('../modules/es.symbol.async-dispose'); },{"../modules/es.symbol.async-dispose":305}],380:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('customMatcher'); },{"../internals/well-known-symbol-define":254}],381:[function(require,module,exports){ 'use strict'; require('../modules/es.symbol.dispose'); },{"../modules/es.symbol.dispose":309}],382:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isRegisteredSymbol = require('../internals/symbol-is-registered'); $({ target: 'Symbol', stat: true }, { isRegisteredSymbol: isRegisteredSymbol }); },{"../internals/export":111,"../internals/symbol-is-registered":234}],383:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isRegisteredSymbol = require('../internals/symbol-is-registered'); $({ target: 'Symbol', stat: true, name: 'isRegisteredSymbol' }, { isRegistered: isRegisteredSymbol }); },{"../internals/export":111,"../internals/symbol-is-registered":234}],384:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isWellKnownSymbol = require('../internals/symbol-is-well-known'); $({ target: 'Symbol', stat: true, forced: true }, { isWellKnownSymbol: isWellKnownSymbol }); },{"../internals/export":111,"../internals/symbol-is-well-known":235}],385:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var isWellKnownSymbol = require('../internals/symbol-is-well-known'); $({ target: 'Symbol', stat: true, name: 'isWellKnownSymbol', forced: true }, { isWellKnown: isWellKnownSymbol }); },{"../internals/export":111,"../internals/symbol-is-well-known":235}],386:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('matcher'); },{"../internals/well-known-symbol-define":254}],387:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadataKey'); },{"../internals/well-known-symbol-define":254}],388:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('metadata'); },{"../internals/well-known-symbol-define":254}],389:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('observable'); },{"../internals/well-known-symbol-define":254}],390:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('patternMatch'); },{"../internals/well-known-symbol-define":254}],391:[function(require,module,exports){ 'use strict'; var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); defineWellKnownSymbol('replaceAll'); },{"../internals/well-known-symbol-define":254}],392:[function(require,module,exports){ 'use strict'; var globalThis = require('../internals/global-this'); var DOMIterables = require('../internals/dom-iterables'); var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); var ArrayIteratorMethods = require('../modules/es.array.iterator'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var setToStringTag = require('../internals/set-to-string-tag'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); var ArrayValues = ArrayIteratorMethods.values; var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { if (CollectionPrototype[ITERATOR] !== ArrayValues) try { createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } setToStringTag(CollectionPrototype, COLLECTION_NAME, true); if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(globalThis[COLLECTION_NAME] && globalThis[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); },{"../internals/create-non-enumerable-property":87,"../internals/dom-iterables":97,"../internals/dom-token-list-prototype":98,"../internals/global-this":130,"../internals/set-to-string-tag":224,"../internals/well-known-symbol":256,"../modules/es.array.iterator":261}],393:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/from'); module.exports = parent; },{"../../es/array/from":15}],394:[function(require,module,exports){ 'use strict'; var parent = require('../../es/array/iterator'); module.exports = parent; },{"../../es/array/iterator":16}],395:[function(require,module,exports){ 'use strict'; var parent = require('../../es/map'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/map":17,"../../modules/web.dom-collections.iterator":392}],396:[function(require,module,exports){ 'use strict'; var parent = require('../../es/math/clz32'); module.exports = parent; },{"../../es/math/clz32":18}],397:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/assign'); module.exports = parent; },{"../../es/object/assign":19}],398:[function(require,module,exports){ 'use strict'; var parent = require('../../es/object/entries'); module.exports = parent; },{"../../es/object/entries":20}],399:[function(require,module,exports){ 'use strict'; var parent = require('../../es/promise'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/promise":21,"../../modules/web.dom-collections.iterator":392}],400:[function(require,module,exports){ 'use strict'; var parent = require('../../es/set'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/set":22,"../../modules/web.dom-collections.iterator":392}],401:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/ends-with'); module.exports = parent; },{"../../es/string/ends-with":23}],402:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/includes'); module.exports = parent; },{"../../es/string/includes":24}],403:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/repeat'); module.exports = parent; },{"../../es/string/repeat":25}],404:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/replace-all'); module.exports = parent; },{"../../es/string/replace-all":26}],405:[function(require,module,exports){ 'use strict'; var parent = require('../../es/string/starts-with'); module.exports = parent; },{"../../es/string/starts-with":27}],406:[function(require,module,exports){ 'use strict'; var parent = require('../../es/symbol'); require('../../modules/web.dom-collections.iterator'); module.exports = parent; },{"../../es/symbol":28,"../../modules/web.dom-collections.iterator":392}],407:[function(require,module,exports){ require("./polyfills/element.child-node.after"); require("./polyfills/element.child-node.before"); require("./polyfills/element.child-node.closest"); require("./polyfills/element.child-node.remove"); require("./polyfills/element.child-node.replace-with"); require("./polyfills/element.parent-node.append"); require("./polyfills/element.parent-node.prepend"); require("./polyfills/element.node-list.for-each"); },{"./polyfills/element.child-node.after":408,"./polyfills/element.child-node.before":409,"./polyfills/element.child-node.closest":410,"./polyfills/element.child-node.remove":411,"./polyfills/element.child-node.replace-with":412,"./polyfills/element.node-list.for-each":413,"./polyfills/element.parent-node.append":414,"./polyfills/element.parent-node.prepend":415}],408:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("after")) { return; } Object.defineProperty(item, "after", { configurable: true, enumerable: true, writable: true, value: function after() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.parentNode.insertBefore(docFrag, this.nextSibling); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],409:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("before")) { return; } Object.defineProperty(item, "before", { configurable: true, enumerable: true, writable: true, value: function before() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.parentNode.insertBefore(docFrag, this); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],410:[function(require,module,exports){ if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; } if (!Element.prototype.closest) { Element.prototype.closest = function (s) { var el = this; do { if (Element.prototype.matches.call(el, s)) return el; el = el.parentElement || el.parentNode; } while (el !== null && el.nodeType === 1); return null; }; } },{}],411:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("remove")) { return; } Object.defineProperty(item, "remove", { configurable: true, enumerable: true, writable: true, value: function remove() { if (this.parentNode === null) { return; } this.parentNode.removeChild(this); }, }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); },{}],412:[function(require,module,exports){ function ReplaceWithPolyfill() { "use-strict"; var parent = this.parentNode, i = arguments.length, currentNode; if (!parent) return; if (!i) parent.removeChild(this); while (i--) { currentNode = arguments[i]; if (typeof currentNode !== "object") { currentNode = this.ownerDocument.createTextNode(currentNode); } else if (currentNode.parentNode) { currentNode.parentNode.removeChild(currentNode); } if (!i) parent.replaceChild(currentNode, this); else parent.insertBefore(currentNode, this.previousSibling); } } if (!Element.prototype.replaceWith) Element.prototype.replaceWith = ReplaceWithPolyfill; if (!CharacterData.prototype.replaceWith) CharacterData.prototype.replaceWith = ReplaceWithPolyfill; if (!DocumentType.prototype.replaceWith) DocumentType.prototype.replaceWith = ReplaceWithPolyfill; },{}],413:[function(require,module,exports){ if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = function (callback, thisArg) { thisArg = thisArg || window; for (var i = 0; i < this.length; i++) { callback.call(thisArg, this[i], i, this); } }; } },{}],414:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("append")) { return; } Object.defineProperty(item, "append", { configurable: true, enumerable: true, writable: true, value: function append() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.appendChild(docFrag); }, }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); },{}],415:[function(require,module,exports){ (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty("prepend")) { return; } Object.defineProperty(item, "prepend", { configurable: true, enumerable: true, writable: true, value: function prepend() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild( isNode ? argItem : document.createTextNode(String(argItem)) ); }); this.insertBefore(docFrag, this.firstChild); }, }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); },{}],416:[function(require,module,exports){ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; var undefined; var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); return generator; } exports.wrap = wrap; function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); defineProperty( GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true } ); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { result.value = unwrapped; resolve(result); }, function(error) { return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } defineProperty(this, "_invoke", { value: enqueue }); } defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); exports.AsyncIterator = AsyncIterator; exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; context.method = "throw"; context.arg = record.arg; } } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (method === undefined) { context.delegate = null; if (methodName === "throw" && delegate.iterator["return"]) { context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { return ContinueSentinel; } } if (methodName !== "return") { context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a '" + methodName + "' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { context[delegate.resultName] = info.value; context.next = delegate.nextLoc; if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { return info; } context.delegate = null; return ContinueSentinel; } defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); define(Gp, iteratorSymbol, function() { return this; }); define(Gp, "toString", function() { return "[object Generator]"; }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(val) { var object = Object(val); var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } next.done = true; return next; }; }; function values(iterable) { if (iterable != null) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } throw new TypeError(typeof iterable + " is not iterable"); } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { this.arg = undefined; } return ContinueSentinel; } }; return exports; }( typeof module === "object" ? module.exports : {} )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } },{}],417:[function(require,module,exports){ "use strict"; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _regenerator() { var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); } function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } (function deMainFuncInner(deWindow, FormData, scrollTo, localData) { 'use strict'; var _this24 = this; var _marked = _regenerator().m(getFormElements); var version = '24.9.16.0'; var commit = '83cc239'; var doc = deWindow.document; var gitWiki = 'https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/wiki/'; var gitRaw = 'https://raw.githubusercontent.com/SthephanShinkufag/Dollchan-Extension-Tools/master/'; var aib, Cfg, dTime, dummy, isExpImg, isPreImg, lang, locStorage, nav, needScroll, pByEl, pByNum, postform, sesStorage, updater; var topWinZ = 10; var defaultCfg = { disabled: 0, language: 1, hideBySpell: 1, spells: null, sortSpells: 0, hideRefPsts: 0, nextPageThr: 0, delHiddPost: 0, ajaxUpdThr: 1, updThrDelay: 20, updCount: 1, favIcoBlink: 1, desktNotif: 0, markNewPosts: 1, markMyPosts: 1, expandTrunc: 0, widePosts: 0, limitPostMsg: 2000, showHideBtn: 1, showRepBtn: 1, postBtnsCSS: 2, postBtnsBack: '#8c8c8c', thrBtns: 1, noSpoilers: 1, noPostNames: 0, correctTime: 0, timeOffset: '+0', timePattern: '', timeRPattern: '', expandImgs: 2, imgNavBtns: 1, imgInfoLink: 1, resizeDPI: 0, resizeImgs: 1, minImgSize: 100, maxImgSize: 2000, zoomFactor: 20, webmControl: 1, webmTitles: 1, webmVolume: 100, minWebmWidth: 320, preLoadImgs: 0, findImgFile: 0, openImgs: 0, imgSrcBtns: 1, imgNames: 0, maskImgs: 0, maskVisib: 7, linksNavig: 1, linksOver: 100, linksOut: 1500, markViewed: 0, strikeHidd: 0, removeHidd: 0, noNavigHidd: 0, markMyLinks: 1, crossLinks: 1, decodeLinks: 1, insertNum: 1, addOPLink: 1, addImgs: 0, addMP3: 1, addVocaroo: 1, embedYTube: 1, YTubeWidth: 360, YTubeHeigh: 270, YTubeTitles: 1, ytApiKey: '', addVimeo: 1, ajaxPosting: 1, postSameImg: 1, removeEXIF: 0, removeFName: 0, sendErrNotif: 1, scrAfterRep: 0, fileInputs: 2, addPostForm: 2, spacedQuote: 1, favOnReply: 1, warnSubjTrip: 0, addSageBtn: 1, saveSage: 1, sageReply: 0, capUpdTime: 300, captchaLang: 1, addTextBtns: 1, txtBtnsLoc: 1, userPassw: 1, passwValue: '', userName: 0, nameValue: '', noBoardRule: 0, noPassword: 1, noName: 0, noSubj: 0, scriptStyle: 0, userCSS: 0, userCSSTxt: '', expandPanel: 0, animation: 1, hotKeys: 1, loadPages: 1, panelCounter: 1, rePageTitle: 1, inftyScroll: 1, hideReplies: 0, scrollToTop: 0, saveScroll: 1, favFolders: 1, favThrOrder: 0, favWinOn: 0, closePopups: 0, updDollchan: 2, textaWidth: 300, textaHeight: 115, replyWinDrag: 0, replyWinX: 'right: 0', replyWinY: 'top: 0', cfgTab: 'filters', cfgWinDrag: 0, cfgWinX: 'right: 0', cfgWinY: 'top: 0', hidWinDrag: 0, hidWinX: 'right: 0', hidWinY: 'top: 0', favWinDrag: 0, favWinX: 'right: 0', favWinY: 'top: 0', favWinWidth: 500, vidWinDrag: 0, vidWinX: 'right: 0', vidWinY: 'top: 0' }; var Lng = { cfgNeedReload: ['Для применения необходима перезагрузка', 'Reboot required to apply', 'Для застосування необхідне перезавантаження'], cfgTab: { filters: ['Фильтры', 'Filters', 'Фільтри'], posts: ['Посты', 'Posts', 'Дописи'], images: ['Картинки', 'Images', 'Зображ.'], links: ['Ссылки', 'Links', 'Посил.'], form: ['Форма', 'Form', 'Форма'], common: ['Общее', 'Common', 'Спільне'], info: ['Инфо', 'Info', 'Інфо'] }, cfg: { language: { sel: [['Ru', 'En', 'Ua'], ['Ru', 'En', 'Ua'], ['Ru', 'En', 'Ua']], txt: ['', '', ''] }, hideBySpell: ['Спеллы: ', 'Magic spells: ', 'Спелли: '], sortSpells: ['Сортировать спеллы и удалять дубликаты', 'Sort spells and remove duplicates', 'Сортувати спелли та видаляти дублікати'], hideRefPsts: ['Скрывать ответы на скрытые посты', 'Hide replies to hidden posts', 'Ховати відповіді на сховані дописи'], nextPageThr: ['Скрытые треды - загружать со следующих страниц', 'Load threads from next pages instead of hidden', 'Сховані треди - брати з наступних сторінок'], delHiddPost: { sel: [['Откл.', 'Всё', 'Только посты', 'Только треды'], ['Disable', 'All', 'Posts only', 'Threads only'], ['Вимк.', 'Все', 'Лише дописи', 'Лише треди']], txt: ['Удалять скрытое', 'Remove placeholders', 'Видаляти сховане'] }, ajaxUpdThr: ['Апдейтер тредов ', 'Threads updater ', 'Оновлювач тредів '], updThrDelay: ['(сек)', '(sec)', '(сек)'], updCount: ['Обратный счетчик обновления треда', 'Show countdown to thread update', 'Зворотній відлік оновлення треду'], favIcoBlink: ['Мигать фавиконом при новых постах', 'Blink the favicon on new posts', 'Блимати фавіконом при нових дописах'], desktNotif: ['Уведомлять о новых постах на рабочем столе', 'Desktop notifications for new posts', 'Повідомляти про нові дописи на стільниці'], markNewPosts: ['Выделять цветом новые посты', 'Highlight new posts with color', 'Виділяти кольором нові дописи'], markMyPosts: ['Выделять цветом мои посты', 'Highlight my own posts', 'Виділяти кольором мої дописи'], expandTrunc: ['Авторазворот сокращенных постов', 'Autoexpand truncated posts', 'Авторозгортання скорочених дописів'], widePosts: ['Растягивать посты по ширине экрана', 'Stretch posts to page width', 'Розтягувати дописи на ширину екрану'], limitPostMsg: ['Ограничение ширины текста в постах (px)', 'Limit text width in posts messages (px)', 'Обмеження ширини тексту в дописах (px)'], thrBtns: { sel: [['Откл.', 'Все', 'Все (на доске)', '"Новые посты" на доске'], ['Disable', 'All', 'All (on board)', '"New posts" on board'], ['Вимк.', 'Всі', 'Всі (на дошці)', '"Нові дописи" на дошці']], txt: ['Кнопки под тредами', 'Buttons under threads', 'Кнопки під тредами'] }, showHideBtn: { sel: [['Откл.', 'С меню', 'Без меню'], ['Disable', 'With menu', 'No menu'], ['Вимк.', 'Із меню', 'Без меню']], txt: ['Кнопки "Скрыть пост/тред"', '"Hide post/thread" buttons', 'Кнопки "Сховати допис/тред"'] }, showRepBtn: { sel: [['Откл.', 'С меню', 'Без меню'], ['Disable', 'With menu', 'No menu'], ['Вимк.', 'Із меню', 'Без меню']], txt: ['Кнопки "Ответить на пост/тред"', '"Reply to post/thread" buttons', 'Кнопки "Відповісти на допис/тред"'] }, postBtnsCSS: { sel: [['Упрощенные', 'Серый градиент', 'Настраиваемые'], ['Simple', 'Gradient grey', 'Custom'], ['Спрощені', 'Сірий градієнт', 'Користувацькі']], txt: ['Кнопки постов ', 'Post buttons ', 'Кнопки дописів '] }, noSpoilers: { sel: [['Откл.', 'Серое', 'Родное'], ['Disable', 'Grey', 'Native'], ['Вимк.', 'Сіре', 'Рідне']], txt: ['Раскрытие текстовых спойлеров', 'Text spoilers expansion', 'Розкриття текстових спойлерів'] }, noPostNames: ['Скрывать имена в постах', 'Hide poster names', 'Ховати імена в дописах'], correctTime: ['Коррекция времени', 'Time correction', 'Корекція часу'], timeOffset: ['разница (ч) ', 'time offset (h) ', 'різниця (год) '], timePattern: ['Шаблон поиска', 'Search pattern', 'Шаблон пошуку'], timeRPattern: ['Шаблон замены', 'Replace pattern', 'Шаблон заміни'], expandImgs: { sel: [['Откл.', 'В посте', 'По центру'], ['Disable', 'In post', 'By center'], ['Вимк.', 'В дописі', 'По центру']], txt: ['Раскрывать картинки по клику', 'Expand images on click', 'Розгортати зображення по кліку'] }, imgNavBtns: ['Добавлять кнопки навигации по картинкам', 'Add buttons to navigate images', 'Додавати кнопки навігації по зображеннях'], imgInfoLink: ['Имя файла под раскрытой картинкой', 'Show file name under expanded image', 'Ім\'я файлу під розкритим зображенням'], resizeDPI: ['Не растягивать на дисплеях с высоким DPI', 'Don\'t upscale images on high DPI displays', 'Не розтягувати на дисплеях з високим DPI'], resizeImgs: { sel: [['Откл.', 'По ширине', 'Шир.+выс.'], ['Disable', 'By width', 'Width+Height'], ['Вимк.', 'По ширині', 'Шир.+выс.']], txt: ['Уменьшать при раскрытии в посте', 'Fit to screen for expanding in post', 'Зменшувати при розкритті в дописі'] }, minImgSize: ['мин.', 'min', 'мін.'], maxImgSize: ['макс. размер раскрытия (px)', 'max expansion size (px)', 'макс. розмір (px)'], zoomFactor: ['Чувствительность зума картинок [1-100%]', 'Images zoom sensibility [1-100%]', 'Чутливість зуму зображень [1-100%]'], webmControl: ['Показывать контрол-бар для WebM', 'Show control bar for WebM', 'Показувати смугу керування для WebM'], webmTitles: ['Получать названия WebM из метаданных', 'Load titles from WebM metadata', 'Отримувати назви WebM з метаданих'], webmVolume: ['Громкость WebM по умолчанию [0-100%]', 'Default volume for WebM [0-100%]', 'Гучність WebM по замовчуванню [0-100%]'], minWebmWidth: ['Минимальная ширина WebM (px)', 'Minimal width for WebM (px)', 'Мінімальна ширина WebM (px)'], preLoadImgs: { sel: [['Откл.', 'Все', 'Без WebM'], ['Disable', 'All', 'Non-WebM'], ['Вимк.', 'Всі', 'Крім WebM']], txt: ['Предварительно загружать картинки', 'Preload images', 'Наперед завантажувати зображення'] }, findImgFile: ['Распознавать файлы, встроенные в картинках', 'Detect embedded files in images', 'Розпізнавати файли, вбудовані в зображення'], openImgs: { sel: [['Откл.', 'Все подряд', 'Только GIF', 'Кроме GIF'], ['Disable', 'All types', 'Only GIF', 'Non-GIF'], ['Вимк.', 'Всі', 'Лише GIF', 'Крім GIF']], txt: ['Заменять тамбнейлы на оригиналы', 'Replace thumbnails with original images', 'Замінювати зображення на оригінали'] }, imgSrcBtns: ['Добавлять кнопки "Поиск" для картинок', 'Add "Search" buttons for images', 'Додавати кнопки "Пошук" для зображень'], imgNames: { sel: [['Не изменять', 'Настоящие (сокр.)', 'Скрывать', 'Настоящие (полные)'], ['Don\'t change', 'Original (trunc.)', 'Hide', 'Original (full)'], ['Не змінювати', 'Справжні (скороч.)', 'Ховати', 'Справжні (повні)']], txt: ['имена картинок', 'filenames', 'імена зображень'] }, maskVisib: ['Видимость для NSFW-картинок [0-100%]', 'Visibility for NSFW images [0-100%]', 'Видимість для NSFW-зображень [0-100%]'], linksNavig: ['Навигация постов по >>ссылкам', 'Posts navigation by >>links', 'Навігація дописів по >>посиланнях'], linksOver: ['Появление ', 'Appearance ', 'Поява '], linksOut: ['Пропадание (мс)', 'Disappearance (ms)', 'Зникнення (мс)'], markViewed: ['Помечать просмотренные посты', 'Mark viewed posts', 'Позначати переглянуті дописи'], strikeHidd: ['Зачеркивать >>ссылки на скрытые посты', 'Strike >>links to hidden posts', 'Закреслювати >>посилання на сховані дописи'], removeHidd: ['Также удалять из обратных >>ссылок', 'Also remove from >>backlinks', 'Також видаляти із зворотніх >>посилань'], noNavigHidd: ['Не отображать превью для скрытых постов', 'Don\'t show previews for hidden posts', 'Не показувати прев\'ю до cхованих дописів'], markMyLinks: ['Помечать ссылки на мои посты как (You)', 'Mark links to my posts with (You)', 'Позначати посилання на мої дописи як (You)'], crossLinks: ['Заменять http:// на >>/b/ссылки', 'Replace http:// with >>/b/links', 'Замінювати https:// на >>/b/посилання'], decodeLinks: ['Декодировать %D0%A5%D1 в ссылках', 'Decode %D0%A5%D1 in links', 'Декодувати %D0%A5%D1 в посиланнях'], insertNum: ['Вставлять >>ссылку по клику на №поста', 'Insert >>link on №postnumber click', 'Вставляти >>посилання на клік по №допису'], addOPLink: ['>>ссылка при ответе на OP в списке тредов', 'Insert >>link when replying to OP on threads list', '>>посилання при відповіді на OP у списці тредів'], addImgs: ['Загружать картинки к jpg/png/gif ссылкам', 'Load images for jpg/png/gif links', 'Додавати зображення до jpg/png/gif посилань'], addMP3: ['Плеер к mp3 ссылкам', 'Player for mp3 links', 'Плеєр до mp3 посилань'], addVocaroo: ['к Vocaroo ссылкам', 'for Vocaroo links', 'до Vocaroo посилань'], addVimeo: ['Добавлять плеер к Vimeo ссылкам', 'Add player for Vimeo links', 'Додавати плеєр до Vimeo посилань'], embedYTube: { sel: [['Ничего', 'Превью+плеер', 'Плеер по клику'], ['Nothing', 'Preview+player', 'On click player'], ['Нічого', 'Прев\'ю+плеєр', 'Плеєр по кліку']], txt: ['к YouTube ссылкам', 'for YouTube links', 'до YouTube посилань'] }, YTubeTitles: ['Загружать названия к YouTube ссылкам', 'Load titles for YouTube links', 'Отримувати назви до YouTube посилань'], ytApiKey: ['Ключ YT API*', 'YT API Key*', 'Ключ YT API*'], ajaxPosting: ['Отправка постов без перезагрузки', 'Posting without page refresh', 'Дописування без оновлення сторінки'], postSameImg: ['Возможность отправки одинаковых картинок', 'Ability to post duplicate images', 'Можливість надсилання однакових зображень'], removeEXIF: ['Удалять EXIF из JPEG ', 'Remove EXIF from JPEG ', 'Видаляти EXIF з JPEG '], removeFName: { sel: [['Не изменять', 'Удалять', 'Unixtime', 'Unixtime-random'], ['Don\'t change', 'Clear', 'Unixtime', 'Unixtime-random'], ['Не змінювати', 'Видаляти', 'Unixtime', 'Unixtime-random']], txt: ['имена файлов', 'file names', 'імена файлів'] }, sendErrNotif: ['Оповещать в заголовке об ошибке отправки', 'Inform in title about post send error', 'Сповіщати в заголовку про помилку надсилання'], scrAfterRep: ['Перемещаться в конец треда после отправки', 'Scroll to bottom after reply', 'Гортати в кінець треду після надсилання'], fileInputs: { sel: [['Откл.', 'Упрощ.', 'Превью'], ['Disable', 'Simple', 'Preview'], ['Вимкн.', 'Спрощене', 'Прев\'ю']], txt: ['Улучшенное поле добавления файлов', 'Enhanced file attachment field', 'Покращене поле додавання файлів'] }, addPostForm: { sel: [['Сверху', 'Внизу', 'Скрытая'], ['At top', 'At bottom', 'Hidden'], ['Вгорі', 'Знизу', 'Прихована']], txt: ['Форма ответа в треде', 'Reply form display in thread', 'Форма відповіді в треді'] }, spacedQuote: ['Вставлять пробел при цитировании "> "', 'Insert a space when quoting "> "', 'Вставляти пробіл при цитуванні "> "'], favOnReply: ['Добавлять тред в Избранное после ответа', 'Add thread to Favorites after reply', 'Додавати тред в Вибране після відповіді'], warnSubjTrip: ['Оповещать о трипкоде в поле "Тема"', 'Warn about a tripcode in "Subject" field', 'Сповіщувати про трипкод в полі "Тема"'], addSageBtn: ['Кнопка Sage вместо поля "Email" ', 'Replace "Email" with Sage button ', 'Кнопка Sage замість "E-mail" '], saveSage: ['Помнить сажу', 'Remember sage', 'Пам\'ятати сажу'], capUpdTime: ['Интервал обновления капчи (сек)', 'Captcha update interval (sec)', 'Інтервал оновлення капчі (сек)'], captchaLang: { sel: [['Откл.', 'Eng', 'Rus'], ['Disable', 'Eng', 'Rus'], ['Вимк.', 'Eng', 'Ukr']], txt: ['Принудительный язык ввода капчи', 'Forced captcha input language', 'Примусова мова вводу капчі'] }, addTextBtns: { sel: [['Откл.', 'Графические', 'Упрощённые', 'Стандартные'], ['Disable', 'As images', 'As text', 'Standard'], ['Вимк.', 'Графічні', 'Спрощені', 'Стандартні']], txt: ['Кнопки разметки текста ', 'Text markup buttons ', 'Кнопки розмітки тексту '] }, txtBtnsLoc: ['Внизу', 'At bottom', 'Знизу'], userPassw: ['Постоянный пароль', 'Fixed password', 'Постійний пароль'], userName: ['Постоянное имя', 'Fixed name', 'Постійне ім\'я'], noBoardRule: ['Правила ', 'Rules ', 'Правила '], noPassword: ['Пароль ', 'Password ', 'Пароль '], noName: ['Имя ', 'Name ', 'Ім\'я '], noSubj: ['Тему', 'Subject', 'Тему'], scriptStyle: { sel: [['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink'], ['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink'], ['Gradient darkblue', 'Gradient blue', 'Solid grey', 'Transparent blue', 'Square dark', 'Gradient pink']], txt: ['Стиль Dollchan', 'Dollchan style', 'Стиль Dollchan'] }, userCSS: ['Пользовательский CSS', 'User CSS', 'Користувацький CSS'], animation: ['CSS3 анимация', 'CSS3 animation', 'CSS3 анімація'], hotKeys: ['Горячие клавиши', 'Hotkeys', 'Гарячі клавіші'], loadPages: ['Количество страниц, загружаемых по F5', 'Number of pages that are loaded on F5 ', 'Кількість сторінок, оновлюваних по F5'], panelCounter: { sel: [['Откл.', 'Все посты', 'Без скрытых'], ['Disabled', 'All posts', 'Except hidden'], ['Вимкн.', 'Всі дописи', 'Крім схованих']], txt: ['Счетчик постов/картинок в треде', 'Сounter for posts/images in thread', 'Лічильник дописів/зображ. в треді'] }, rePageTitle: ['Название треда в заголовке вкладки', 'Show thread title in the page tab', 'Назва треду в заголовку вкладки'], inftyScroll: ['Бесконечная прокрутка страниц', 'Infinite scrolling for pages', 'Нескінченна прокрутка сторінок'], hideReplies: ['Показывать только OP в списке тредов', 'Show only OP in threads list', 'Показувати лише OP в списку тредів'], scrollToTop: ['Всегда перемещаться вверх в списке тредов', 'Always scroll to top in the threads list', 'Завжди гортати догори в списку тредів'], saveScroll: ['Запоминать позицию скролла в тредах', 'Remember the scroll position in threads', 'Пам`ятати позицію скролла в тредах'], favFolders: ['Папки досок в окне Избранного', 'Boards folders in the Favorites window', 'Папки дошок в вікні Вибраного'], favThrOrder: { sel: [['По номеру', 'По номеру (убыв)', 'По добавлению', 'По добавлению (убыв)'], ['By number', 'By number (desc)', 'By adding', 'By adding (desc)'], ['За номером', 'За номером (зменш)', 'По додаванню', 'По додаванню (зменш)']], txt: ['Сортировка в Избранном', 'Sorting in Favorites', 'Сортування в Вибраному'] }, favWinOn: ['Всегда открывать окно Избранное', 'Always open the Favorites window', 'Завжди відкривати вікно Вибране'], closePopups: ['Автоматически закрывать уведомления', 'Close popups automatically', 'Автоматично закривати сповіщення'], updDollchan: { sel: [['Откл.', 'Каждый день', 'Каждые 2 дня', 'Каждую неделю', 'Каждые 2 недели', 'Каждый месяц'], ['Disable', 'Every day', 'Every 2 days', 'Every week', 'Every 2 weeks', 'Every month'], ['Вимкн.', 'Щодня', 'Кожні 2 дні', 'Щотижня', 'Кожні 2 тижні', 'Щомісяця']], txt: ['Проверять обновления Dollchan', 'Check for Dollchan updates', 'Перевіряти оновлення Dollchan'] } }, panelBtn: { attach: ['Прикрепить/Открепить панель', 'Attach/Detach panel', 'Закріпити/відкріпити панель'], cfg: ['Настройки', 'Settings', 'Налаштування'], hid: ['Скрытое', 'Hidden', 'Сховане'], fav: ['Избранное', 'Favorites', 'Вибране'], vid: ['Ссылки на видео', 'Video links', 'Посилання на відео'], refresh: ['Обновить', 'Refresh', 'Оновити'], goback: ['Назад на доску', 'Return to board', 'Назад до дошки'], gonext: ['На %s страницу', 'Go to page %s', 'До %s сторінки'], goup: ['В начало страницы', 'Scroll to top', 'Прогорнути догори'], godown: ['В конец страницы', 'Scroll to bottom', 'Прогорнути донизу'], expimg: ['Раскрыть все картинки', 'Expand all images', 'Розгорнути всі зображення'], maskimg: ['Режим NSFW', 'NSFW mode', 'Режим NSFW'], preimg: ['Предзагрузить картинки\r\n([Ctrl+Click] только для новых постов)', 'Preload images\r\n([Ctrl+Click] for new posts only)', 'Наперед завантажити зображення\r\n([Ctrl+Click] лише для нових дописів)'], savethr: ['Сохранить на диск', 'Save to disk', 'Зберегти на диск'], 'upd-on': ['Выключить автообновление треда', 'Disable thread updater', 'Вимкнути оновлювач треду'], 'upd-off': ['Включить автообновление треда', 'Enable thread updater', 'Увімкнути оновлювач треду'], 'audio-off': ['Звуковое оповещение о новых постах', 'Sound notification about new posts', 'Звукове сповіщення про нові дописи'], catalog: ['Перейти в каталог', 'Go to catalog', 'Перейти до каталогу'], enable: ['Включить/выключить Dollchan', 'Turn on/off the Dollchan', 'Увімкнути/вимкнути Dollchan'], postsCount: ['Постов в треде', 'Posts in thread', 'Дописів у треді'], postsNotHid: ['Постов в треде (без скрытых)', 'Posts in thread (without hidden)', 'Дописів у треді (крім схованих)'], filesCount: ['Картинок и видео в треде', 'Images and videos in thread', 'Зображень та відео у треді'], postersCount: ['Постящих в треде', 'Posters in thread', 'Дописувачів у треді'] }, togglePost: ['Скрыть/Раскрыть пост', 'Hide/Unhide post', 'Сховати/показати допис'], toggleThr: ['Скрыть/Раскрыть тред', 'Hide/Unhide thread', 'Сховати/показати тред'], replyToPost: ['Ответить на пост', 'Reply to post', 'Відповісти на допис'], replyToThr: ['Ответить в тред', 'Reply to thread', 'Відповісти в тред'], expandThr: ['Развернуть тред', 'Expand thread', 'Розгорнути тред'], addFav: ['Добавить тред в Избранное', 'Add thread to Favorites', 'Додати тред в Вибране'], delFav: ['Убрать тред из Избранного', 'Remove thread from Favorites', 'Прибрати тред з Вибраного'], attachPview: ['Закрепить превью', 'Attach preview', 'Закріпити прев\'ю'], goToThr: ['В тред', 'To thread', 'До треду'], closeWindow: ['Закрыть окно', 'Close window', 'Закрити вікно'], closeReply: ['Закрыть форму', 'Close form', 'Закрити форму'], toPanel: ['Закрепить на панели', 'Attach to panel', 'Закріпити на панелі'], makeDrag: ['Сделать перетаскиваемым окном', 'Make draggable window', 'Зробити перетягуваним вікном'], underPost: ['Разместить форму после поста', 'Move form under post', 'Розмістити форму після допису'], clearForm: ['Очистить форму', 'Clear form', 'Очистити форму'], txtBtn: [['Жирный', 'Bold', 'Жирний'], ['Курсив', 'Italic', 'Курсив'], ['Подчеркнутый', 'Underlined', 'Підкреслений'], ['Зачеркнутый', 'Strike', 'Закреслений'], ['Спойлер', 'Spoiler', 'Спойлер'], ['Код', 'Code', 'Код'], ['Верхний индекс', 'Superscript', 'Верхній індекс'], ['Нижний индекс', 'Subscript', 'Нижній індекс'], ['Цитировать выделенное', 'Quote selected', 'Цитувати виділене']], selHiderMenu: { sel: ['Скрывать выделенное', 'Hide selected text', 'Ховати виділене'], name: ['Скрывать по имени', 'Hide by name', 'Ховати по імені'], uid: ['Скрывать по id постера', 'Hide by poster id', 'Ховати по id постера'], trip: ['Скрывать по трипкоду', 'Hide by tripcode', 'Ховати по тріпкоду'], img: ['Скрывать по размеру картинки', 'Hide by image size', 'Ховати по розміру зображення'], imgn: ['Скрывать по имени картинки', 'Hide by image name', 'Ховати по імені зображення'], ihash: ['Скрывать схожие картинки', 'Hide by similar images', 'Ховати подібні зображення'], noimg: ['Скрывать без картинок', 'Hide without images', 'Ховати без зображень'], notext: ['Скрывать без текста', 'Hide without text', 'Ховати без тексту'], text: ['Скрыть схожий текст', 'Hide similar text', 'Сховати схожий текст'], refs: ['Скрыть с ответами', 'Hide with replies', 'Сховати з відповідями'], refsonly: ['Скрывать ответы', 'Hide replies', 'Ховати відповіді'] }, selExpandThr: [ ['+10 постов', 'Последние 30', 'Последние 50', 'Последние 100', 'Весь тред'], ['+10 posts', 'Last 30 posts', 'Last 50 posts', 'Last 100 posts', 'Entire thread'], ['+10 дописів', 'Останні 30', 'Останні 50', 'Останні 100', 'Весь тред']], selAjaxPages: [ ['1 страница', '2 страницы', '3 страницы', '4 страницы', '5 страниц'], ['1 page', '2 pages', '3 pages', '4 pages', '5 pages'], ['1 сторінка', '2 сторінки', '3 сторінки', '4 сторінки', '5 сторінок']], selSaveThr: [ ['Скачать весь тред', 'Скачать картинки'], ['Download thread', 'Download images'], ['Завантажити весь тред', 'Завантажити зображення']], selAudioNotif: [ ['Каждые 30 сек.', 'Каждую минуту', 'Каждые 2 мин.', 'Каждые 5 мин.'], ['Every 30 sec.', 'Every minute', 'Every 2 min.', 'Every 5 min.'], ['Кожні 30 сек.', 'Щохвилини', 'Кожні 2 хв.', 'Кожні 5 хв.']], reportPost: ['Жалоба на пост', 'Report a post', 'Скарга на допис'], reportThr: ['Жалоба на тред', 'Report a thread', 'Скарга на тред'], markMyPost: ['Пометить как мой пост', 'Mark as my post', 'Відмітити як мій допис'], deleteMyPost: ['Убрать из моих постов', 'Delete from my posts', 'Прибрати з моїх дописів'], saveAs: ['Сохр. как ', 'Save as ', 'Збер. як '], origName: ['Оригинальное имя', 'Original name', 'Оригінальне ім\'я'], metaName: ['Имя из метаданных', 'Name from metadata', 'Ім\'я з метаданих'], boardName: ['Имя, присвоенное доской', 'Name assigned by the board', 'Ім\'я, присвоєне дошкою'], searchIn: ['Искать в ', 'Search in ', 'Шукати в '], frameSearch: ['Поиск кадра в ', 'Frame search in ', 'Пошук кадру в '], gotoResults: ['Перейти к результатам поиска', 'Go to search results', 'Перейти до результатів пошуку'], getFrameLinks: ['Получить ссылки для поиска этого кадра', 'Get links to search this frame', 'Отримати посилання для пошуку цього кадру'], saveFrame: ['Сохранить полученный кадр', 'Save the received frame', 'Зберегти отриманий кадр'], errSaucenao: ['Ошибка: не могу загрузить на saucenao.com', 'Error: can\'t load to saucenao.com', 'Помилка: не можу завантажити на saucenao.com'], hotKeyEdit: [[ '%l%i24 – предыдущая страница/картинка%/l', '%l%i217 – следующая страница/картинка%/l', '%l%i21 – тред (на доске)/пост (в треде) ниже%/l', '%l%i20 – тред (на доске)/пост (в треде) выше%/l', '%l%i31 – пост (на доске) ниже%/l', '%l%i30 – пост (на доске) выше%/l', '%l%i23 – скрыть пост/тред%/l', '%l%i32 – перейти в тред%/l', '%l%i33 – развернуть тред%/l', '%l%i211 – раскрыть картинку в посте%/l', '%l%i22 – быстрый ответ%/l', '%l%i25t – отправить пост%/l', '%l%i210 – открыть/закрыть "Настройки"%/l', '%l%i26 – открыть/закрыть "Избранное"%/l', '%l%i27 – открыть/закрыть "Скрытое"%/l', '%l%i218 – открыть/закрыть "Видео"%/l', '%l%i28 – открыть/закрыть панель%/l', '%l%i29 – вкл./выкл. режим NSFW%/l', '%l%i40 – обновить тред (в треде)%/l', '%l%i212t – жирный%/l', '%l%i213t – курсив%/l', '%l%i214t – зачеркнутый%/l', '%l%i215t – спойлер%/l', '%l%i216t – код%/l'], [ '%l%i24 – previous page/image%/l', '%l%i217 – next page/image%/l', '%l%i21 – thread (on board)/post (in thread) below%/l', '%l%i20 – thread (on board)/post (in thread) above%/l', '%l%i31 – on board post below%/l', '%l%i30 – on board post above%/l', '%l%i23 – hide post/thread%/l', '%l%i32 – go to thread%/l', '%l%i33 – expand thread%/l', '%l%i211 – expand post\'s images%/l', '%l%i22 – quick reply%/l', '%l%i25t – send post%/l', '%l%i210 – open/close "Settings"%/l', '%l%i26 – open/close "Favorites"%/l', '%l%i27 – open/close "Hidden"%/l', '%l%i218 – open/close "Videos"%/l', '%l%i28 – open/close main panel%/l', '%l%i29 – toggle NSFW mode%/l', '%l%i40 – update thread%/l', '%l%i212t – bold%/l', '%l%i213t – italic%/l', '%l%i214t – strike%/l', '%l%i215t – spoiler%/l', '%l%i216t – code%/l'], [ '%l%i24 – попередня сторінка/зображення%/l', '%l%i217 – наступна сторінка/зображення%/l', '%l%i21 – тред (на дошці)/допис (в треді) нижче%/l', '%l%i20 – тред (на дошці)/допис (в треді) вище%/l', '%l%i31 – допис (на дошці) нижче%/l', '%l%i30 – допис (на дошці) вище%/l', '%l%i23 – приховати допис/тред%/l', '%l%i32 – перейти в тред%/l', '%l%i33 – розгорнути тред%/l', '%l%i211 – розгорнути зображення в дописі%/l', '%l%i22 – швидка відповідь%/l', '%l%i25t – відправити допис%/l', '%l%i210 – відкрити/закрити "Налаштування"%/l', '%l%i26 – відкрити/закрити "Вибране"%/l', '%l%i27 – відкрити/закрити "Сховане"%/l', '%l%i218 – відкрити/закрити "Посилання на відео"%/l', '%l%i28 – відкрити/закрити панель%/l', '%l%i29 – увімкнути/вимкнути режим NSFW%/l', '%l%i40 – оновити тред (в треді)%/l', '%l%i212t – жирний%/l', '%l%i213t – курсив%/l', '%l%i214t – закреслений%/l', '%l%i215t – спойлер%/l', '%l%i216t – код%/l']], cTimeError: ['Неправильные настройки времени', 'Invalid time settings', 'Неправильні налаштування часу'], month: [['янв', 'фев', 'мар', 'апр', 'мая', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру']], fullMonth: [['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня']], week: [['Вск', 'Пнд', 'Втр', 'Срд', 'Чтв', 'Птн', 'Сбт'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], ['Нед', 'Пон', 'Вів', 'Сер', 'Чет', 'Птн', 'Сбт']], monthDict: { янв: 0, фев: 1, мар: 2, апр: 3, май: 4, мая: 4, июн: 5, июл: 6, авг: 7, сен: 8, окт: 9, ноя: 10, дек: 11, jan: 0, feb: 1, mar: 2, apr: 3, may: 4, jun: 5, jul: 6, aug: 7, sep: 8, oct: 9, nov: 10, dec: 11, січ: 0, лют: 1, бер: 2, кві: 3, тра: 4, чер: 5, лип: 6, сер: 7, вер: 8, жов: 9, лис: 10, гру: 11 }, seSyntaxErr: ['синтаксическая ошибка в аргументе спелла: #%s', 'syntax error in argument of spell: #%s', 'синтаксична помилка в аргументі спеллу: #%s'], seUnknown: ['неизвестный спелл: #%s', 'unknown spell: #%s', 'невідомий спелл: #%s'], seMissOp: ['пропущен оператор', 'missing operator', 'пропущено оператор'], seMissArg: ['пропущен аргумент спелла: #%s', 'missing argument of spell: #%s', 'пропущено аргумент спеллу: #%s'], seMissSpell: ['пропущен спелл', 'missing spell', 'пропущено спелл'], seErrRegex: ['синтаксическая ошибка в регулярном выражении: %s', 'syntax error in regular expression: %s', 'синтаксична помилка в регулярному виразі: %s'], seUnexpChar: ['неожиданный символ: %s', 'unexpected character: %s', 'неочікуваний символ: %s'], seMissClBkt: ['пропущена закрывающая скобка', 'missing \')\' in expression', 'пропущено закривну дужку'], seRepsInParens: ['спелл #%s не должен располагаться в скобках', 'spell #%s shouldn\'t be inside parentheses', 'спелл #%s не може бути в дужках'], seOpInReps: ['недопустимо использовать оператор %s со спеллами #rep и #outrep', 'don\'t use operator %s with spells #rep & #outrep', 'неприпустимо використовувати оператор %s зі спеллами #rep и #outrep'], seRow: [' (строка ', ' (row ', ' (рядок '], seCol: [', столбец ', ', column ', ', стовпчик '], editInTxt: ['Правка в текстовом формате', 'Edit in text format', 'Правка в текстовому форматі'], editor: { cfg: ['Редактирование настроек', 'Edit settings', 'Редагування налаштувань'], hidden: ['Редактирование скрытых тредов', 'Edit hidden threads', 'Редагування схованих тредів'], favor: ['Редактирование избранного', 'Edit favorites', 'Редагування вибраного'], css: ['Редактирование CSS', 'Edit CSS', 'Редагування CSS'] }, fileImpExp: ['Импорт/экспорт настроек в файл', 'Import/export config to file', 'Імпорт/експорт налаштувань до файлу'], fileToData: ['Загрузить данные из файла', 'Load data from a file', 'Завантажити дані з файла'], dataToFile: ['Получить файл с данными', 'Get the file with data', 'Отримати файл з даними'], globalCfg: ['Глобальные настройки', 'Global config', 'Глобальні налаштування'], loadGlobal: ['и применить к этому домену', 'and apply to this domain', 'і застосувати до цього домену'], saveGlobal: ['текущие настройки как глобальные', 'current config as global', 'поточні налаштування як глобальні'], descrGlobal: ['Глобальные настройки применяются по умолчанию
при первом посещении других доменов', 'Global config is applied by default
on the first visit of other domains', 'Глобальні налаштування застосовуються по замовчуванню
під час першого відвідання інших доменів'], resetCfg: ['Сбросить в настройки по умолчанию', 'Reset config to defaults', 'Скинути в налаштування по замовчуванню'], resetData: ['Очистить выбранные данные', 'Reset selected data', 'Очистити обрані дані'], allDomains: ['для всех доменов', 'for all domains', 'для всіх доменів'], delEntries: ['Удалить выбранные записи', 'Delete selected entries', 'Видалити обрані записи'], saveChanges: ['Сохранить внесенные изменения', 'Save your changes', 'Зберегти внесені зміни'], hidPostThr: ['Скрытые посты и треды', 'Hidden posts and threads', 'Сховані дописи та треди'], myPosts: ['Мои посты', 'My posts', 'Мої дописи'], checkNow: ['Проверить сейчас', 'Check now', 'Перевірити зараз'], updAvail: ['Доступно обновление Dollchan: %s', 'Dollchan update available: %s!', 'Доступне оновлення Dollchan: %s'], newCommitsAvail: ['Обнаружены новые исправления: %s', 'New fixes detected: %s', 'Виявлено нові виправлення: %s'], changeLog: ['Список изменений', 'List of changes', 'Список змін'], haveLatestStable: ['Ваша версия %s является последней из стабильных.', 'Your %s version is the latest from stable versions.', 'Ваша версія %s є останньою зі стабільних.'], haveLatestCommit: ['Ваша версия %s содержит последние исправления.', 'Your %s version contains all the latest fixes.', 'Ваша версія %s містить всі останні виправлення.'], thrViewed: ['Тредов посещено', 'Threads visited', 'Тредів відвідано'], thrCreated: ['Тредов создано', 'Threads created', 'Тредів створено'], thrHidden: ['Тредов скрыто', 'Threads hidden', 'Тредів сховано'], postsSent: ['Постов отправлено', 'Posts sent', 'дописів надіслано'], total: ['Всего', 'Total', 'Всього'], debug: ['Отладка', 'Debug', 'Відлагодження'], infoDebug: ['Информация для отладки', 'Information for debugging', 'Інформація для відлагодження'], refreshCounters: ['Обновить счетчики постов', 'Refresh posts counters', 'Оновити лічильники дописів'], refreshClear404: ['Обновить счетчики и очистить недоступные (404) треды', 'Refresh counters and clear inaccessible (404) threads', 'Оновити лічильники та очистити недоступні (404) треди'], clear404: ['Очистить недоступные (404) треды', 'Clear inaccessible (404) threads', 'Очистити недоступні (404) треди'], infoPage: ['Проверить положение тредов (до 10-й страницы)', 'Check for threads position (up to 10th page)', 'Перевірити актуальність тредів (до 10 сторінки)'], totalPosts: ['Всего постов в треде', 'Total posts in thread', 'Всього дописів в треді'], newPosts: ['Количество новых постов', 'Number of new posts', 'Кількість нових дописів'], myPostsRep: ['Ответов на ваши посты', 'Replies to your posts', 'Відповідей на ваші дописи'], thrPage: ['На какой странице сейчас тред', 'What page is the thread on now', 'На якій сторінці зараз тред'], goToThread: ['Перейти к треду', 'Go to the thread', 'Перейти до треду'], goToBoard: ['Перейти к доске', 'Go to the board', 'Перейти до дошки'], toggleEntries: ['Скрыть/раскрыть записи', 'Hide/expand entries', 'Сховати/розкрити записи'], hideLnkList: ['Скрыть/Показать список ссылок', 'Hide/Unhide list of links', 'Сховати/показати перелік посилань'], expandVideo: ['Развернуть/Свернуть видео', 'Expand/Collapse video', 'Розгорнути/згорнути відео'], prevVideo: ['Предыдущее видео', 'Previous video', 'Попереднє відео'], nextVideo: ['Следующее видео', 'Next video', 'Наступне відео'], duration: ['Продолжительность: ', 'Duration: ', 'Тривалість: '], published: ['опубликовано: ', 'published: ', 'опубліковано: '], author: ['Автор: ', 'Author: ', 'Автор: '], views: ['просмотров: ', 'views: ', 'переглядів: '], dropFileHere: ['Бросьте сюда файл(ы) или ссылку', 'Drop file(s) or link here', 'Киньте сюди файл(и) чи посилання'], youCanDrag: ['Можно перетаскивать картинки и ссылки на файлы\r\nпрямо со страницы или других сайтов', 'You can drag images and file links\r\ndirectly from the page or other sites', 'Можна перетягувати зображення чи посилання на файли\r\nбезпосередньо зі сторінки чи інших сайтів'], removeFile: ['Удалить файл', 'Remove file', 'Видалити файл'], renameFile: ['Переименовать файл', 'Rename file', 'Перейменувати файл'], spoilFile: ['Спойлер', 'Spoiler', 'Спойлер'], addManually: ['Ввести ссылку на файл вручную', 'Enter a link to the file manually', 'Ввести посилання на файл вручну'], enterTheLink: ['Введите ссылку и нажмите \'+\'', 'Enter the link and click \'+\'', 'Введіть посилання та натисніть \'+\''], helpAddFile: ['Встроить ogg/rar/zip/7z в картинку', 'Embed ogg/rar/zip/7z into the image', 'Вбудувати ogg/rar/zip/7z в зображення'], expImgInline: ['[Click] открыть в посте, [Ctrl+Click] по центру', '[Click] expand in post, [Ctrl+Click] by center', '[Click] розгорнути в дописі, [Ctrl+Click] в центрі'], expImgFull: ['[Click] открыть по центру, [Ctrl+Click] в посте', '[Click] expand by center, [Ctrl+Click] in post', '[Click] розгорнути в центрі, [Ctrl+Click] в дописі'], nextImg: ['Следующая картинка', 'Next image', 'Наступне зображення'], prevImg: ['Предыдущая картинка', 'Previous image', 'Попереднє зображення'], rotateImg: ['Повернуть вправо', 'Rotate right', 'Повернути вправо'], autoPlayOn: ['Автоматически воспроизводить следующее видео', 'Automatically play the next video', 'Автоматично відтворювати наступне відео'], autoPlayOff: ['Отключить автовоспроизведение', 'Disable autoplay', 'Відключити автовідтворення'], downloadFile: ['Скачать содержащийся в картинке файл', 'Download embedded file from the image', 'Завантажити файл, що міститься в зображенні'], openOriginal: ['Открыть оригинал в новой вкладке', 'Open the original image in new tab', 'Відкрити оригінал в новій вкладці'], loadImage: ['Загружаются картинки', 'Loading images', 'Завантажуються зображення'], loadFile: ['Загружаются файлы', 'Loading files', 'Завантажуються файли'], cantLoad: ['Не могу загрузить', 'Can\'t load', 'Не можу завантажити'], willSavePview: ['Будет сохранено превью', 'Thumbnail will be saved', 'Буде збережено прев\'ю'], loadErrors: ['Во время загрузки произошли ошибки:', 'An error occurred during the loading:', 'Під час завантаження сталися помилки:'], succDeleted: ['Успешно удалено!', 'Succesfully deleted!', 'Успішно видалено!'], succReported: ['Жалоба успешно отправлена', 'Succesfully reported', 'Скарга успішно відправлена'], errDelete: ['Не могу удалить', 'Can\'t delete', 'Не можу видалити'], fileCorrupt: ['Файл повреждён', 'File is corrupt', 'Файл пошкоджено'], errCorruptData: ['Ошибка: сервер отправил повреждённые данные', 'Error: server sent corrupted data', 'Помилка: сервер надіслав пошкоджені дані'], noConnect: ['Ошибка подключения', 'Connection failed', 'Помилка з\'єднання'], thrNotFound: ['Тред недоступен', 'Thread is unavailable', 'Тред недоступний'], thrClosed: ['Тред закрыт', 'Thread is closed', 'Тред закрито'], thrArchived: ['Тред в архиве', 'Thread is archived', 'Тред заархівовано'], internalError: ['Внутренняя ошибка:\n', 'Internal error:\n', 'Внутрішня помилка:\n'], postNotFound: ['Пост не найден', 'Post not found', 'Допис не знайдено'], noHidThr: ['Нет скрытых тредов…', 'No hidden threads…', 'Немає схованих дописів…'], noFavThr: ['Нет избранных тредов…', 'Favorites is empty…', 'Немає вибраних тредів…'], noVideoLinks: ['Нет ссылок на видео…', 'No video links…', 'Немає посилань на відео…'], invalidData: ['Некорректный формат данных', 'Incorrect data format', 'Некоректний формат даних'], noGlobalCfg: ['Глобальные настройки не найдены', 'Global config not found', 'Глобальні налаштування не знайдено'], subjHasTrip: ['Поле "Тема" содержит трипкод!', '"Subject" field contains a tripcode!', 'Поле "Тема" містить трипкод!'], errMsEdgeWebm: ['Загрузите скрипт для воспроизведения WebM (VP9/Opus)', 'Please load a script to play WebM (VP9/Opus)', 'Завантажте скрипт для відтворення WebM (VP9/Opus)'], errFormLoad: ['Не удаётся загрузить форму ответа', 'Can\'t load the reply form', 'Не вдалося завантажити форму відповіді'], second: ['с', 's', 'с'], sizeByte: [' Байт', ' Byte', ' Байт'], sizeKByte: [' КБ', ' KB', ' КБ'], sizeMByte: [' МБ', ' MB', ' МБ'], sizeGByte: [' ГБ', ' GB', ' ГБ'], name: ['Имя', 'Name', 'Ім\'я'], subj: ['Тема', 'Subject', 'Тема'], mail: ['Почта', 'Email', 'Пошта'], video: ['Видео', 'Video', 'Відео'], captcha: ['Капча', 'Captcha', 'Капча'], add: ['Добавить', 'Add', 'Додати'], apply: ['Применить', 'Apply', 'Застосувати'], cancel: ['Отмена', 'Cancel', 'Скасувати'], clear: ['Очистить', 'Clear', 'Очистити'], refresh: ['Обновить', 'Refresh', 'Оновити'], save: ['Сохранить', 'Save', 'Зберегти'], load: ['Загрузить', 'Load', 'Завантажити'], edit: ['Правка', 'Edit', 'Правка'], file: ['Файл', 'File', 'Файл'], global: ['Глобальные', 'Global', 'Глобальні'], reset: ['Сброс', 'Reset', 'Скинути'], remove: ['Удалить', 'Remove', 'Видалити'], change: ['Сменить', 'Change', 'Змінити'], page: ['Страница', 'Page', 'Сторінка'], reply: ['Ответ', 'Reply', 'Відповідь'], replies: ['Ответы:', 'Replies:', 'Відповіді:'], makeReply: ['Ответить', 'Reply', 'Відповісти'], error: ['Ошибка', 'Error', 'Помилка'], loading: ['Загрузка…', 'Loading…', 'Завантаження…'], sending: ['Отправка…', 'Sending…', 'Надсилання…'], checking: ['Проверка…', 'Checking…', 'Перевірка…'], updating: ['Обновление…', 'Updating…', 'Оновлення…'], deleting: ['Удаление…', 'Deleting…', 'Видалення…'], deleted: ['удалён', 'deleted', 'видалено'], hide: ['Скрыть: ', 'Hide: ', 'Сховати: '], hidePosts: ['Скрыть посты', 'Hide posts', 'Сховати дописи'], showPosts: ['Показать посты', 'Show posts', 'Показати дописи'], getNewPosts: ['Получить новые посты', 'Get new posts', 'Отримати нові дописи'], makeThr: ['Создать тред', 'Create thread', 'Створити тред'], collapseThr: ['Свернуть тред', 'Collapse thread', 'Згорнути тред'], hiddenThr: ['Скрытый тред', 'Hidden thread', 'Схований тред'], hideForm: ['Скрыть форму', 'Hide form', 'Сховати форму'], enableSage: ['Нажмите, чтобы включить сажу', 'Click to enable sage', 'Натисніть, щоб увімкнути сажу'], disableSage: ['САЖА включена! Нажмите, чтобы отключить', 'SAGE enabled! Click to disable', 'САЖА ввімкнена! Натисніть, щоб вимкнути'], postsOmitted: ['Пропущено ответов: ', 'Posts omitted: ', 'Пропущено відповідей: '], newPost: [['новый пост', 'новых поста', 'новых постов'], ['new post', 'new posts', 'new posts'], ['новий допис', 'нових дописи', 'нових дописів']], youReplies: [['ответ Вам', 'ответа Вам', 'ответов Вам'], ['reply to You', 'replies to You', 'replies to You'], ['відповідь Вам', 'відповіді Вам', 'відповідей Вам']], latestPost: ['Последний пост', 'Latest post', 'Останній допис'], donateMsg: ['Спасибо за использование Dollchan Extension!
Вы можете поддержать проект пожертвованием', 'Thank You for using Dollchan Extension!
You can support the project by donating', 'Дякуємо за використання Dollchan Extension!
Ви можете підтримати проект пожертвою'], donateOnline: ['Онлайн донат (грн)', 'Donate online (UAH)', 'Онлайн донат (грн)'], firefoxAddon: ['Firefox аддон доступен!', 'Firefox add-on is available!', 'Firefox аддон доступний!'] }; function $id(id) { return doc.getElementById(id); } function $q(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; return rootEl.querySelector(path); } function $Q(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; return rootEl.querySelectorAll(path); } function $match(parentStr) { for (var _len = arguments.length, rules = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rules[_key - 1] = arguments[_key]; } return parentStr.split(', ').map(function (val) { return val + rules.join(', ' + val); }).join(', '); } function $contains(containerEl, el) { var _el; el = ((_el = el) === null || _el === void 0 ? void 0 : _el.farthestViewportElement ) || el; return el && (el === containerEl || containerEl.contains(el)); } function $bBegin(siblingEl, html) { siblingEl.insertAdjacentHTML('beforebegin', html); return siblingEl.previousSibling; } function $aBegin(parentEl, html) { parentEl.insertAdjacentHTML('afterbegin', html); return parentEl.firstChild; } function $bEnd(parentEl, html) { parentEl.insertAdjacentHTML('beforeend', html); return parentEl.lastChild; } function $aEnd(siblingEl, html) { siblingEl.insertAdjacentHTML('afterend', html); return siblingEl.nextSibling; } function $delAll(path) { var rootEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : doc.body; rootEl.querySelectorAll(path, rootEl).forEach(function (el) { return el.remove(); }); } function $add(html) { dummy.innerHTML = html; return dummy.firstElementChild; } function $button(value, title, fn) { var className = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'de-button'; var el = $add("")); el.addEventListener('click', fn); return el; } function $script(text) { try { var el = doc.createElement('script'); el.type = 'text/javascript'; el.textContent = text; doc.head.append(el); el.remove(); } catch (err) {} } function $css(text) { return $bEnd(doc.head, "")); } function $createDoc(html) { var myDoc = doc.implementation.createHTMLDocument(''); myDoc.documentElement.innerHTML = html; return myDoc; } function $show(el) { el.style.removeProperty('display'); } function $hide(el) { el.style.display = 'none'; } function $toggle(el) { var needToShow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : el.style.display; if (needToShow) { el.style.removeProperty('display'); } else { el.style.display = 'none'; } } function $animate(el, cName) { var isRemove = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; el.addEventListener('animationend', function aEvent() { el.removeEventListener('animationend', aEvent); if (isRemove) { el.remove(); } else { el.classList.remove(cName); } }); el.classList.add(cName); } function $hasProp(obj, i) { return Object.prototype.hasOwnProperty.call(obj, i); } function $isEmpty(obj) { for (var i in obj) { if ($hasProp(obj, i)) { return false; } } return true; } function escapeRegExp(str) { return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); } function strToRegExp(str, notGlobal) { var l = str.lastIndexOf('/'); var flags = str.substr(l + 1); return new RegExp(str.substr(1, l - 1), notGlobal ? flags.replace('g', '') : flags); } function pad2(i) { return i < 10 ? '0' + i : i; } function arrTags(arr, start, end) { return start + arr.join(end + start) + end; } function fixBoardName(board) { return "/".concat(board ? board + '/' : ''); } function getFileName(url) { return url.substring(url.lastIndexOf('/') + 1); } function getFileExt(url) { return url.substring(url.lastIndexOf('.') + 1); } function cutFileExt(fileName) { return fileName.substring(0, fileName.lastIndexOf('.')); } function prettifySize(val) { return val > 512 * 1024 * 1024 ? (val / Math.pow(1024, 3)).toFixed(2) + Lng.sizeGByte[lang] : val > 512 * 1024 ? (val / Math.pow(1024, 2)).toFixed(2) + Lng.sizeMByte[lang] : val > 512 ? (val / 1024).toFixed(2) + Lng.sizeKByte[lang] : val.toFixed(2) + Lng.sizeByte[lang]; } function insertText(el, txt) { var scrollTop = el.scrollTop, start = el.selectionStart, value = el.value; el.value = value.substr(0, start) + txt + value.substr(el.selectionEnd); el.setSelectionRange(start + txt.length, start + txt.length); el.focus(); el.scrollTop = scrollTop; } function getErrorMessage(err) { if (err instanceof AjaxError) { return err.toString(); } if (typeof err === 'string') { return err; } var stack = err.stack, name = err.name, message = err.message; return Lng.internalError[lang] + (!stack ? "".concat(name, ": ").concat(message) : nav.isWebkit ? stack : "".concat(name, ": ").concat(message, "\n").concat(!nav.isFirefox ? stack : stack.replace(/^([^@]*).*\/(.+)$/gm, function (str, fName, line) { return " at ".concat(fName ? "".concat(fName, " (").concat(line, ")") : line); }))); } function getCookies() { var obj = {}; var cookies = doc.cookie.split(';'); for (var i = 0, len = cookies.length; i < len; ++i) { var parts = cookies[i].split('='); obj[parts.shift().trim()] = decodeURI(parts.join('=')); } return obj; } function readFile(_x, _x2) { return _readFile.apply(this, arguments); } function _readFile() { _readFile = _asyncToGenerator(_regenerator().m(function _callee48(file, asText) { return _regenerator().w(function (_context56) { while (1) switch (_context56.n) { case 0: return _context56.a(2, new Promise(function (resolve) { var fr = new FileReader(); fr.onload = function (e) { return resolve({ data: e.target.result }); }; if (asText) { fr.readAsText(file); } else { fr.readAsArrayBuffer(file); } })); } }, _callee48); })); return _readFile.apply(this, arguments); } function getFileMime(url) { var dotIdx = url.lastIndexOf('.') + 1; switch (dotIdx && url.substr(dotIdx).toLowerCase()) { case 'avif': return 'image/avif'; case 'gif': return 'image/gif'; case 'jfif': case 'jpeg': case 'jpg': return 'image/jpeg'; case 'mov': return 'video/quicktime'; case 'mp4': case 'm4v': return 'video/mp4'; case 'ogv': return 'video/ogv'; case 'png': return 'image/png'; case 'webm': return 'video/webm'; case 'webp': return 'image/webp'; default: return ''; } } function downloadBlob(blob, name) { var url = nav.isMsEdge ? navigator.msSaveOrOpenBlob(blob, name) : deWindow.URL.createObjectURL(blob); var link = $bEnd(doc.body, "")); link.click(); setTimeout(function () { deWindow.URL.revokeObjectURL(url); link.remove(); }, 2e5); } var Logger = { finish: function finish() { this._finished = true; this._marks.push(['LoggerFinish', Date.now()]); }, getLogData: function getLogData(isFull) { var marks = this._marks; var timeLog = []; var duration; var i = 1; var lastExtra = 0; for (var len = marks.length - 1; i < len; ++i) { duration = marks[i][1] - marks[i - 1][1] + lastExtra; if (isFull || duration > 1) { lastExtra = 0; timeLog.push([marks[i][0], duration]); } else { lastExtra = duration; } } timeLog.push([Lng.total[lang], marks[i][1] - marks[0][1]]); return timeLog; }, initLogger: function initLogger() { this._marks.push(['LoggerInit', Date.now()]); }, log: function log(text) { if (!this._finished) { this._marks.push([text, Date.now()]); } }, _finished: false, _marks: [] }; function CancelError() {} var CancelablePromise = function () { function CancelablePromise(resolver, cancelFn) { var _this = this; _classCallCheck(this, CancelablePromise); this._promise = new Promise(function (resolve, reject) { _this._reject = reject; resolver(function (value) { resolve(value); _this._isResolved = true; }, function (reason) { reject(reason); _this._isResolved = true; }); }); this._cancelFn = cancelFn; this._isResolved = false; } return _createClass(CancelablePromise, [{ key: "cancelPromise", value: function cancelPromise() { this._reject(new CancelError()); if (!this._isResolved && this._cancelFn) { this._cancelFn(); } } }, { key: "catch", value: function _catch(eb) { return this.then(undefined, eb); } }, { key: "then", value: function then(cb, eb) { var _this2 = this; var children = []; var wrap = function wrap(fn) { return function () { var child = fn.apply(void 0, arguments); if (child instanceof CancelablePromise) { children.push(child); } return child; }; }; return new CancelablePromise(function (resolve) { return resolve(_this2._promise.then(cb && wrap(cb), eb && wrap(eb))); }, function () { for (var _i = 0, _children = children; _i < _children.length; _i++) { var child = _children[_i]; child.cancelPromise(); } _this2.cancelPromise(); }); } }], [{ key: "reject", value: function reject(val) { return new CancelablePromise(function (res, rej) { return rej(val); }); } }, { key: "resolve", value: function resolve(val) { return new CancelablePromise(function (res) { return res(val); }); } }]); }(); var Maybe = function () { function Maybe(Ctor ) { _classCallCheck(this, Maybe); this._ctor = Ctor; this.hasValue = false; } return _createClass(Maybe, [{ key: "value", get: function get() { var Ctor = this._ctor; this.hasValue = !!Ctor; var value = Ctor ? new Ctor() : null; Object.defineProperty(this, 'value', { value: value }); return value; } }]); }(); var TemporaryContent = function () { function TemporaryContent(key) { _classCallCheck(this, TemporaryContent); var oClass = this.constructor; if (oClass.purgeTO) { clearTimeout(oClass.purgeTO); } oClass.purgeTO = setTimeout(function () { return oClass.purge(); }, oClass.purgeSecs); if (oClass.data) { var rv = oClass.data.get(key); if (rv) { return rv; } } else { oClass.data = new Map(); } oClass.data.set(key, this); } return _createClass(TemporaryContent, null, [{ key: "get", value: function get(key) { return this.data ? this.data.get(key) : null; } }, { key: "has", value: function has(key) { return this.data ? this.data.has(key) : false; } }, { key: "purge", value: function purge() { if (this.purgeTO) { clearTimeout(this.purgeTO); this.purgeTO = null; } this.data = null; } }, { key: "removeTempData", value: function removeTempData(key) { var _this$data; (_this$data = this.data) === null || _this$data === void 0 || _this$data["delete"](key); } }]); }(); TemporaryContent.purgeSecs = 6e4; var TasksPool = function () { function TasksPool(tasksCount, taskFunc, endFn) { _classCallCheck(this, TasksPool); this.array = []; this.running = 0; this.num = 1; this.func = taskFunc; this.endFn = endFn; this.max = tasksCount; this.completed = this.paused = this.stopped = false; } return _createClass(TasksPool, [{ key: "completeTasks", value: function completeTasks() { if (!this.stopped) { if (!this.array.length && this.running === 0) { this.endFn(); } else { this.completed = true; } } } }, { key: "pauseTasks", value: function pauseTasks() { this.paused = true; } }, { key: "runTask", value: function runTask(data) { if (!this.stopped) { if (this.paused || this.running === this.max) { this.array.push(data); } else { this._runTask(data); this.running++; } } } }, { key: "stopTasks", value: function stopTasks() { this.stopped = true; this.endFn(); } }, { key: "_continueTasks", value: function _continueTasks() { if (!this.stopped) { this.paused = false; if (!this.array.length) { if (this.completed) { this.endFn(); } return; } while (this.array.length && this.running !== this.max) { this._runTask(this.array.shift()); this.running++; } } } }, { key: "_endTask", value: function _endTask() { if (!this.stopped) { if (!this.paused && this.array.length) { this._runTask(this.array.shift()); return; } this.running--; if (!this.paused && this.completed && this.running === 0) { this.endFn(); } } } }, { key: "_runTask", value: function _runTask(data) { var _this3 = this; this.func(this.num++, data).then(function () { return _this3._endTask(); }, function (err) { if (err instanceof TasksPool.PauseError) { _this3.pauseTasks(); if (err.duration !== -1) { setTimeout(function () { return _this3._continueTasks(); }, err.duration); } } else { _this3._endTask(); throw err; } }); } }]); }(); TasksPool.PauseError = function (duration) { this.name = 'TasksPool.PauseError'; this.duration = duration; }; var WorkerPool = function () { function WorkerPool(mReqs, wrkFn, errFn) { var _this4 = this; _classCallCheck(this, WorkerPool); if (!nav.hasWorker) { this.runWorker = function (data, transferObjs, fn) { return fn(wrkFn(data)); }; return; } var url = deWindow.URL.createObjectURL(new Blob(["self.onmessage = function(e) {\n\t\t\tvar info = (".concat(String(wrkFn), ")(e.data);\n\t\t\tif(info.data) {\n\t\t\t\tself.postMessage(info, [info.data]);\n\t\t\t} else {\n\t\t\t\tself.postMessage(info);\n\t\t\t}\n\t\t}")], { type: 'text/javascript' })); this._pool = new TasksPool(mReqs, function (num, data) { return _this4._createWorker(num, data); }, null); this._freeWorkers = []; this._url = url; this._errFn = errFn; while (mReqs--) { this._freeWorkers.push(new Worker(url)); } } return _createClass(WorkerPool, [{ key: "clearWorkers", value: function clearWorkers() { deWindow.URL.revokeObjectURL(this._url); this._freeWorkers.forEach(function (w) { return w.terminate(); }); this._freeWorkers = []; } }, { key: "runWorker", value: function runWorker(data, transferObjs, fn) { this._pool.runTask([data, transferObjs, fn]); } }, { key: "_createWorker", value: function _createWorker(num, data) { var _this5 = this; return new Promise(function (resolve) { var worker = _this5._freeWorkers.pop(); var _data2 = _slicedToArray(data, 3), sendData = _data2[0], transferObjs = _data2[1], fn = _data2[2]; worker.onmessage = function (e) { fn(e.data); _this5._freeWorkers.push(worker); resolve(); }; worker.onerror = function (err) { resolve(); _this5._freeWorkers.push(worker); _this5._errFn(err); }; worker.postMessage(sendData, transferObjs); }); } }]); }(); var TarBuilder = function () { function TarBuilder() { _classCallCheck(this, TarBuilder); this._data = []; } return _createClass(TarBuilder, [{ key: "addFile", value: function addFile(filepath, input) { var i; var checksum = 0; var fileSize = input.length; var header = new Uint8Array(512); var nameLen = Math.min(filepath.length, 100); for (i = 0; i < nameLen; ++i) { header[i] = filepath.charCodeAt(i) & 0xFF; } TarBuilder._padSet(header, 100, '100777', 8); TarBuilder._padSet(header, 108, '0', 8); TarBuilder._padSet(header, 116, '0', 8); TarBuilder._padSet(header, 124, fileSize.toString(8), 13); TarBuilder._padSet(header, 136, Math.floor(Date.now() / 1e3).toString(8), 12); TarBuilder._padSet(header, 148, ' ', 8); header[156] = 0x30; for (i = 0; i < 157; ++i) { checksum += header[i]; } TarBuilder._padSet(header, 148, checksum.toString(8), 8); this._data.push(header, input); if ((i = Math.ceil(fileSize / 512) * 512 - fileSize) !== 0) { this._data.push(new Uint8Array(i)); } } }, { key: "addString", value: function addString(filepath, str) { var sDat = unescape(encodeURIComponent(str)); this.addFile(filepath, new Uint8Array(sDat.length).map(function (val, i) { return sDat.charCodeAt(i) & 0xFF; })); } }, { key: "get", value: function get() { this._data.push(new Uint8Array(1024)); return new Blob(this._data, { type: 'application/x-tar' }); } }], [{ key: "_padSet", value: function _padSet(data, offset, num, len) { var i = 0; var nLen = num.length; len -= 2; while (nLen < len) { data[offset++] = 0x20; len--; } while (i < nLen) { data[offset++] = num.charCodeAt(i++); } data[offset] = 0x20; } }]); }(); var WebmParser = function () { function WebmParser(data) { _classCallCheck(this, WebmParser); var offset = 0; var dv = nav.unsafeDataView(data); var len = dv.byteLength; var el = new WebmParser.Element(dv, len, 0); var voids = []; var EBMLId = 0x1A45DFA3; var segmentId = 0x18538067; var voidId = 0xEC; this.voidId = voidId; error: do { if (el.error || el.id !== EBMLId) { break; } this.EBML = el; offset += el.headSize + el.size; while (true) { var _el2 = new WebmParser.Element(dv, len, offset); if (_el2.error) { break error; } if (_el2.id === segmentId) { this.segment = _el2; break; } else if (_el2.id === voidId) { voids.push(_el2); } else { break error; } offset += _el2.headSize + _el2.size; } this.voids = voids; this.data = data; this.length = len; this.rv = [null]; this.error = false; return; } while (false); this.error = true; } return _createClass(WebmParser, [{ key: "addWebmData", value: function addWebmData(data) { if (this.error || !data) { return this; } var size = typeof data === 'string' ? data.length : data.byteLength; if (size > 127) { this.error = true; return; } this.rv.push(new Uint8Array([this.voidId, 0x80 | size]), data); return this; } }, { key: "getWebmData", value: function getWebmData() { if (this.error) { return null; } this.rv[0] = nav.unsafeUint8Array(this.data, 0, this.segment.endOffset); return this.rv; } }]); }(); WebmParser.Element = function (elData, dataLength, offset) { this.error = false; this.id = 0; if (offset + 4 >= dataLength) { return; } var num = elData.getUint32(offset); var leadZeroes = Math.clz32(num); if (leadZeroes > 3) { this.error = true; return; } offset += leadZeroes + 1; if (offset >= dataLength) { this.error = true; return; } this.id = num >>> 8 * (3 - leadZeroes); this.headSize = leadZeroes + 1; num = elData.getUint32(offset); leadZeroes = Math.clz32(num); var size = num & 0xFFFFFFFF >>> leadZeroes + 1; if (leadZeroes > 3) { var shift = 8 * (7 - leadZeroes); if (size >>> shift !== 0 || offset + 4 > dataLength) { this.error = true; return; } size = size << 32 - shift | elData.getUint32(offset + 4) >>> shift; } else { size >>>= 8 * (3 - leadZeroes); } this.headSize += leadZeroes + 1; offset += leadZeroes + 1; if (offset + size > dataLength) { this.error = true; return; } this.data = elData; this.offset = offset; this.endOffset = offset + size; this.size = size; }; function getStored(_x3) { return _getStored.apply(this, arguments); } function _getStored() { _getStored = _asyncToGenerator(_regenerator().m(function _callee49(id) { return _regenerator().w(function (_context57) { while (1) switch (_context57.n) { case 0: if (!nav.hasNewGM) { _context57.n = 2; break; } _context57.n = 1; return GM.getValue(id); case 1: return _context57.a(2, _context57.v); case 2: if (!nav.hasOldGM) { _context57.n = 3; break; } return _context57.a(2, GM_getValue(id)); case 3: if (!nav.hasWebStorage) { _context57.n = 4; break; } return _context57.a(2, new Promise(function (resolve) { return chrome.storage.local.get(id, function (obj) { if (Object.keys(obj).length) { resolve(obj[id]); } else { chrome.storage.sync.get(id, function (obj) { return resolve(obj[id]); }); } }); })); case 4: return _context57.a(2, locStorage[id]); } }, _callee49); })); return _getStored.apply(this, arguments); } function setStored(id, value) { if (nav.hasNewGM) { return GM.setValue(id, value); } else if (nav.hasOldGM) { GM_setValue(id, value); } else if (nav.hasWebStorage) { return new Promise(function (resolve) { var obj = {}; obj[id] = value; chrome.storage.sync.set(obj, function () { if (chrome.runtime.lastError) { chrome.storage.local.set(obj, Function.prototype); chrome.storage.sync.remove(id, Function.prototype); } else { chrome.storage.local.remove(id, Function.prototype); } resolve(); }); }); } else { locStorage[id] = value; } return null; } function delStored(id) { if (nav.hasNewGM) { return GM.deleteValue(id); } else if (nav.hasOldGM) { GM_deleteValue(id); } else if (nav.hasWebStorage) { chrome.storage.sync.remove(id, Function.prototype); } else { locStorage.removeItem(id); } } function getStoredObj(_x4) { return _getStoredObj.apply(this, arguments); } function _getStoredObj() { _getStoredObj = _asyncToGenerator(_regenerator().m(function _callee50(id) { var _t45, _t46, _t47; return _regenerator().w(function (_context58) { while (1) switch (_context58.n) { case 0: _t46 = JSON; _context58.n = 1; return getStored(id); case 1: _t47 = _context58.v; if (_t47) { _context58.n = 2; break; } _t47 = '{}'; case 2: _t45 = _t46.parse.call(_t46, _t47); if (_t45) { _context58.n = 3; break; } _t45 = {}; case 3: return _context58.a(2, _t45); } }, _callee50); })); return _getStoredObj.apply(this, arguments); } var CfgSaver = { save: function save() { var _arguments = arguments, _this6 = this; return _asyncToGenerator(_regenerator().m(function _callee() { var _len2, args, _key2, isChanged, i, id, val; return _regenerator().w(function (_context) { while (1) switch (_context.n) { case 0: for (_len2 = _arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = _arguments[_key2]; } isChanged = false; for (i = 0; i < args.length; i += 2) { id = args[i]; val = args[i + 1]; if (Cfg[id] !== val) { Cfg[id] = val; isChanged = true; } } if (!isChanged) { _context.n = 1; break; } _context.n = 1; return _this6.saveObj(aib.domain, function (loadedCfg) { for (var _i2 = 0; _i2 < args.length; _i2 += 2) { loadedCfg[args[_i2]] = args[_i2 + 1]; } return loadedCfg; }); case 1: return _context.a(2); } }, _callee); }))(); }, saveObj: function saveObj(domain, fn) { var _this7 = this; return _asyncToGenerator(_regenerator().m(function _callee2() { var _this7$_queue$splice, _this7$_queue$splice2, _this7$_queue$splice3, qDomain, qFn, resolve, reject, _t; return _regenerator().w(function (_context2) { while (1) switch (_context2.p = _context2.n) { case 0: if (!_this7._isBusy) { _context2.n = 2; break; } _context2.n = 1; return new Promise(function (resolve, reject) { _this7._queue.push([domain, fn, resolve, reject]); }); case 1: return _context2.a(2); case 2: _this7._isBusy = true; _context2.n = 3; return _this7.saveObjHelper(domain, fn); case 3: if (!(_this7._queue.length > 0)) { _context2.n = 9; break; } case 4: if (!(_this7._queue.length > 0)) { _context2.n = 9; break; } _this7$_queue$splice = _this7._queue.splice(0, 1), _this7$_queue$splice2 = _slicedToArray(_this7$_queue$splice, 1), _this7$_queue$splice3 = _slicedToArray(_this7$_queue$splice2[0], 4), qDomain = _this7$_queue$splice3[0], qFn = _this7$_queue$splice3[1], resolve = _this7$_queue$splice3[2], reject = _this7$_queue$splice3[3]; _context2.p = 5; _context2.n = 6; return _this7.saveObjHelper(qDomain, qFn); case 6: resolve(); _context2.n = 8; break; case 7: _context2.p = 7; _t = _context2.v; reject(_t); case 8: _context2.n = 4; break; case 9: _this7._isBusy = false; case 10: return _context2.a(2); } }, _callee2, null, [[5, 7]]); }))(); }, saveObjHelper: function saveObjHelper(domain, fn) { return _asyncToGenerator(_regenerator().m(function _callee3() { var val, res, rv; return _regenerator().w(function (_context3) { while (1) switch (_context3.n) { case 0: _context3.n = 1; return getStoredObj('DESU_Config'); case 1: val = _context3.v; res = fn(val[domain]); if (res) { val[domain] = res; } else { delete val[domain]; } rv = setStored('DESU_Config', JSON.stringify(val)); if (!(rv && !nav.isViolentmonkey)) { _context3.n = 2; break; } _context3.n = 2; return rv; case 2: return _context3.a(2); } }, _callee3); }))(); }, _isBusy: false, _queue: [] }; function toggleCfg(_x5) { return _toggleCfg.apply(this, arguments); } function _toggleCfg() { _toggleCfg = _asyncToGenerator(_regenerator().m(function _callee51(id) { return _regenerator().w(function (_context59) { while (1) switch (_context59.n) { case 0: _context59.n = 1; return CfgSaver.save(id, +!Cfg[id]); case 1: return _context59.a(2); } }, _callee51); })); return _toggleCfg.apply(this, arguments); } function readCfg() { return _readCfg.apply(this, arguments); } function _readCfg() { _readCfg = _asyncToGenerator(_regenerator().m(function _callee52() { var obj, val, isGlobal, browserLang; return _regenerator().w(function (_context60) { while (1) switch (_context60.n) { case 0: _context60.n = 1; return getStoredObj('DESU_Config'); case 1: val = _context60.v; if (!(aib.domain in val) || $isEmpty(obj = val[aib.domain])) { isGlobal = nav.hasGlobalStorage && !!val.global; obj = isGlobal ? val.global : {}; if (isGlobal) { delete obj.correctTime; delete obj.captchaLang; } } browserLang = String(navigator.language).toLowerCase(); defaultCfg.language = browserLang.startsWith('ru') ? 0 : browserLang.startsWith('en') ? 1 : browserLang.startsWith('uk') ? 2 : defaultCfg.language; Cfg = Object.assign(Object.create(defaultCfg), obj); if (!Cfg.timeOffset) { Cfg.timeOffset = '+0'; } if (!Cfg.timePattern) { Cfg.timePattern = aib.timePattern; } if (!('FormData' in deWindow)) { Cfg.ajaxPosting = 0; } if (!Cfg.ajaxPosting) { Cfg.fileInputs = 0; } if (!('Notification' in deWindow)) { Cfg.desktNotif = 0; } if (nav.isWebExtension) { Cfg.updDollchan = 0; } if (Cfg.updThrDelay < 10) { Cfg.updThrDelay = 10; } if (!Cfg.addSageBtn || !Cfg.saveSage) { Cfg.sageReply = 0; } if (!Cfg.passwValue) { Cfg.passwValue = Math.round(Math.random() * 1e12).toString(32); } if (!Cfg.stats) { Cfg.stats = { view: 0, op: 0, reply: 0 }; } lang = Cfg.language; val[aib.domain] = Cfg; if (val.commit !== commit && !localData) { if (doc.readyState === 'loading') { doc.addEventListener('DOMContentLoaded', function () { return setTimeout(showDonateMsg, 1e3); }); } else { setTimeout(showDonateMsg, 1e3); } val.commit = commit; } setStored('DESU_Config', JSON.stringify(val)); if (Cfg.updDollchan && !localData) { checkForUpdates(false, val.lastUpd).then(function (html) { if (doc.readyState === 'loading') { doc.addEventListener('DOMContentLoaded', function () { return $popup('updavail', html); }); } else { $popup('updavail', html); } }, Function.prototype); } case 2: return _context60.a(2); } }, _callee52); })); return _readCfg.apply(this, arguments); } function readPostsData(firstPost, favObj) { var _favObj$aib$host; var sVis = null; try { var str = aib.t ? sesStorage['de-hidden-' + aib.b + aib.t] : null; if (str) { var json = JSON.parse(str); if (json.hash === (Cfg.hideBySpell ? Spells.hash : 0) && pByNum.has(json.lastNum) && pByNum.get(json.lastNum).count === json.lastCount) { var _json$data; sVis = ((_json$data = json.data) === null || _json$data === void 0 ? void 0 : _json$data[0]) instanceof Array ? json.data : null; } } } catch (err) { sesStorage['de-hidden-' + aib.b + aib.t] = null; } if (!firstPost) { return; } var updatedFav = null; var favBoardObj = ((_favObj$aib$host = favObj[aib.host]) === null || _favObj$aib$host === void 0 ? void 0 : _favObj$aib$host[aib.b]) || {}; var spellsHide = Cfg.hideBySpell; var maybeSpells = new Maybe(SpellsRunner); for (var post = firstPost; post; post = post.next) { var _post2 = post, num = _post2.num; if (post.isOp && num in favBoardObj) { var newCount = 0; var youCount = 0; post.toggleFavBtn(true); var _post3 = post, thr = _post3.thr; thr.isFav = true; var isThrActive = aib.t && !doc.hidden; var entry = favBoardObj[num]; var _post = pByNum.get(+entry.last.match(/\d+/)); if (_post) { while (_post = _post.nextInThread) { if (Cfg.markNewPosts) { Post.addMark(_post.el, true); } if (!isThrActive) { newCount++; if (isPostRefToYou(_post.el)) { youCount++; } } } } else if (!aib.t) { newCount = entry["new"] + thr.postsCount - entry.cnt; _post = post; while (_post = _post.nextInThread) { if (Cfg.markNewPosts) { Post.addMark(_post.el, true); } if (isPostRefToYou(_post.el)) { youCount++; } } } if (isThrActive) { entry.last = aib.anchor + thr.last.num; } updatedFav = [aib.host, aib.b, aib.t, [entry.cnt = thr.postsCount, entry["new"] = newCount, entry.you = youCount, thr.last.num], 'update']; } if (HiddenPosts.has(num)) { HiddenPosts.hideHidden(post, num); continue; } var hideData = void 0; if (post.isOp) { if (HiddenThreads.has(num)) { hideData = [true, null]; } else if (spellsHide) { var _sVis; hideData = (_sVis = sVis) === null || _sVis === void 0 ? void 0 : _sVis[post.count]; } } else if (spellsHide) { var _sVis2; hideData = (_sVis2 = sVis) === null || _sVis2 === void 0 ? void 0 : _sVis2[post.count]; } else { continue; } if (!hideData) { maybeSpells.value.runSpells(post); } else if (hideData[0]) { if (post.isHidden) { post.spellHidden = true; } else { post.spellHide(hideData[1]); } } } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } if (aib.t && Cfg.panelCounter === 2) { $id('de-panel-info-posts').textContent = Thread.first.postsCount - Thread.first.hiddenCount; } if (updatedFav) { saveFavorites(favObj); sendStorageEvent('__de-favorites', updatedFav); } var hasFavWinKey = sesStorage['de-fav-win'] === '1'; if (hasFavWinKey || Cfg.favWinOn) { toggleWindow('fav', !!$q('#de-win-fav.de-win-active'), null, true); if (hasFavWinKey) { sesStorage.removeItem('de-fav-win'); } } var data = sesStorage['de-fav-newthr']; if (data) { data = JSON.parse(data); var isTimeOut = !data.num && Date.now() - data.date > 2e4; if (data.num === firstPost.num || !firstPost.next && !isTimeOut) { firstPost.thr.toggleFavState(true); sesStorage.removeItem('de-fav-newthr'); } else if (isTimeOut) { sesStorage.removeItem('de-fav-newthr'); } } if (Cfg.nextPageThr && DelForm.first === DelForm.last) { var hidThrLen = $Q('.de-thr-hid', firstPost.thr.form.el).length; if (hidThrLen) { Pages.addPage(hidThrLen); } } } function readFavorites() { return getStoredObj('DESU_Favorites'); } function saveFavorites(data) { setStored('DESU_Favorites', JSON.stringify(data)); } function readViewedPosts() { var _sesStorage$deViewed; if (!Cfg.markViewed) { return; } (_sesStorage$deViewed = sesStorage['de-viewed']) === null || _sesStorage$deViewed === void 0 || _sesStorage$deViewed.split(',').forEach(function (pNum) { var post = pByNum.get(+pNum); if (post) { post.el.classList.add('de-viewed'); post.isViewed = true; } }); } var PostsStorage = function () { function PostsStorage() { _classCallCheck(this, PostsStorage); this.storageName = ''; this.__cachedTime = null; this._cachedStorage = null; this._cacheTO = null; this._onReadNew = null; this._onAfterSave = null; } return _createClass(PostsStorage, [{ key: "get", value: function get(num) { var storage = this._readStorage()[aib.b]; if (storage) { var val = storage[num]; return val ? val[2] : null; } return null; } }, { key: "has", value: function has(num) { var storage = this._readStorage()[aib.b]; return storage ? $hasProp(storage, num) : false; } }, { key: "purge", value: function purge() { this._cacheTO = this.__cachedTime = this._cachedStorage = null; } }, { key: "removeStorage", value: function removeStorage(num) { var board = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : aib.b; var storage = this._readStorage(true); var bStorage = storage[board]; if (bStorage && $hasProp(bStorage, num)) { delete bStorage[num]; if ($isEmpty(bStorage)) { delete storage[board]; } this._saveStorage(); } } }, { key: "set", value: function set(num, thrNum) { var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var storage = this._readStorage(true); this._removeOldItems(storage); (storage[aib.b] || (storage[aib.b] = {}))[num] = [this._cachedTime, thrNum, data]; this._saveStorage(); } }, { key: "_removeOldItems", value: function _removeOldItems(storage) { if (storage && storage.$count > 5e3) { var minDate = Date.now() - 5 * 24 * 3600 * 1e3; for (var board in storage) { if ($hasProp(storage, board)) { var data = storage[board]; for (var key in data) { if ($hasProp(data, key) && data[key][0] < minDate) { delete data[key]; } } } } } } }, { key: "_cachedTime", get: function get() { return this.__cachedTime || (this.__cachedTime = Date.now()); } }, { key: "_readStorage", value: function _readStorage() { var ignoreCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!ignoreCache && this._cachedStorage) { return this._cachedStorage; } var data = locStorage[this.storageName]; var rv = {}; if (data) { try { rv = this._cachedStorage = JSON.parse(data); } catch (err) {} } this._cachedStorage = rv; if (this._onReadNew) { this._onReadNew(rv); } return rv; } }, { key: "_saveStorage", value: function _saveStorage() { var _this8 = this; if (this._cacheTO === null) { this._cacheTO = setTimeout(function () { var _this8$_onAfterSave; if (_this8._cachedStorage) { locStorage[_this8.storageName] = JSON.stringify(_this8._cachedStorage); } _this8.purge(); (_this8$_onAfterSave = _this8._onAfterSave) === null || _this8$_onAfterSave === void 0 || _this8$_onAfterSave.call(_this8); }, 0); } } }]); }(); var HiddenPosts = new (function (_PostsStorage) { function HiddenPostsClass() { var _this9; _classCallCheck(this, HiddenPostsClass); _this9 = _callSuper(this, HiddenPostsClass); _this9.storageName = 'de-posts'; return _this9; } _inherits(HiddenPostsClass, _PostsStorage); return _createClass(HiddenPostsClass, [{ key: "hideHidden", value: function hideHidden(post, num) { var uHideData = HiddenPosts.get(num); if (!uHideData && post.isOp && HiddenThreads.has(num)) { post.setUserVisib(true); } else { post.setUserVisib(!!uHideData, false); } } }]); }(PostsStorage))(); var HiddenThreads = new (function (_PostsStorage2) { function HiddenThreadsClass() { var _this0; _classCallCheck(this, HiddenThreadsClass); _this0 = _callSuper(this, HiddenThreadsClass); _this0.storageName = 'de-threads'; return _this0; } _inherits(HiddenThreadsClass, _PostsStorage2); return _createClass(HiddenThreadsClass, [{ key: "getCount", value: function getCount() { var storage = this._readStorage(); var rv = 0; for (var board in storage) { if ($hasProp(storage, board)) { rv += Object.keys(storage[board]).length; } } return rv; } }, { key: "getRawData", value: function getRawData() { return this._readStorage(); } }, { key: "saveRawData", value: function saveRawData(data) { locStorage[this.storageName] = JSON.stringify(data); this.purge(); } }]); }(PostsStorage))(); var MyPosts = new (function (_PostsStorage3) { function MyPostsClass() { var _this1; _classCallCheck(this, MyPostsClass); _this1 = _callSuper(this, MyPostsClass); _this1.storageName = 'de-myposts'; _this1._cachedData = null; _this1._onReadNew = function (newStorage) { _this1._cachedData = newStorage[aib.b] ? new Set(Object.keys(newStorage[aib.b]).map(function (val) { return +val; })) : new Set(); }; _this1._onAfterSave = function () { return sendStorageEvent('__de-mypost', 1); }; return _this1; } _inherits(MyPostsClass, _PostsStorage3); return _createClass(MyPostsClass, [{ key: "has", value: function has(num) { return this._cachedData.has(num); } }, { key: "update", value: function update() { this.purge(); for (var _iterator = _createForOfIteratorHelperLoose(this._cachedData), _step; !(_step = _iterator()).done;) { var _pByNum$num; var num = _step.value; (_pByNum$num = pByNum[num]) === null || _pByNum$num === void 0 || _pByNum$num.changeMyMark(true); } } }, { key: "purge", value: function purge() { _superPropGet(MyPostsClass, "purge", this, 3)([]); this._cachedData = null; this._readStorage(); } }, { key: "readStorage", value: function readStorage() { this._readStorage(); } }, { key: "set", value: function set(num, thrNum) { _superPropGet(MyPostsClass, "set", this, 3)([num, thrNum]); this._cachedData.add(+num); } }]); }(PostsStorage))(); function sendStorageEvent(name, value) { locStorage[name] = typeof value === 'string' ? value : JSON.stringify(value); locStorage.removeItem(name); } function initStorageEvent() { doc.defaultView.addEventListener('storage', function (e) { var data, temp; var val = e.newValue; if (!val) { return; } switch (e.key) { case '__de-favorites': { try { data = JSON.parse(val); } catch (err) { return; } updateFavWindow.apply(void 0, _toConsumableArray(data)); return; } case '__de-mypost': MyPosts.update(); return; case '__de-webmvolume': val = +val || 0; Cfg.webmVolume = val; temp = $q('input[info="webmVolume"]'); if (temp) { temp.value = val; } return; case '__de-post': (function () { try { data = JSON.parse(val); } catch (err) { return; } HiddenThreads.purge(); HiddenPosts.purge(); if (data.brd === aib.b) { var post = pByNum.get(data.num); if (post && post.isHidden ^ data.hide) { post.setUserVisib(data.hide, false); } else if (post = pByNum.get(data.thrNum)) { post.thr.userTouched.set(data.num, data.hide); } } toggleWindow('hid', true); })(); return; case 'de-threads': HiddenThreads.purge(); Thread.first.updateHidden(HiddenThreads.getRawData()[aib.b]); toggleWindow('hid', true); return; case '__de-spells': _asyncToGenerator(_regenerator().m(function _callee4() { var _t2; return _regenerator().w(function (_context4) { while (1) switch (_context4.p = _context4.n) { case 0: _context4.p = 0; data = JSON.parse(val); _context4.n = 2; break; case 1: _context4.p = 1; _t2 = _context4.v; return _context4.a(2); case 2: Cfg.hideBySpell = +data.hide; temp = $q('input[info="hideBySpell"]'); if (temp) { temp.checked = data.hide; } $hide(doc.body); if (!data.data) { _context4.n = 4; break; } _context4.n = 3; return Spells.setSpells(data.data, false); case 3: Cfg.spells = JSON.stringify(data.data); temp = $id('de-spell-txt'); if (temp) { temp.value = Spells.list; } _context4.n = 6; break; case 4: SpellsRunner.unhideAll(); _context4.n = 5; return Spells.disableSpells(); case 5: temp = $id('de-spell-txt'); if (temp) { temp.value = ''; } case 6: $show(doc.body); case 7: return _context4.a(2); } }, _callee4, null, [[0, 1]]); }))(); } }, false); } var Panel = Object.create({ isVidEnabled: false, initPanel: function initPanel(formEl) { var _postform, _this10 = this; var filesCount = $Q(aib.qPostImg, formEl).length; var isThr = aib.t; (((_postform = postform) === null || _postform === void 0 ? void 0 : _postform.pArea[0]) || formEl).insertAdjacentHTML('beforebegin', "
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t").concat(Cfg.disabled ? '' : '
', "\n\t\t
")); this._el = $id('de-panel'); this._el.addEventListener('click', this, true); if (!nav.isMobile) { ['mouseover', 'mouseout'].forEach(function (e) { return _this10._el.addEventListener(e, _this10); }); } this._buttons = $id('de-panel-buttons'); }, removeMain: function removeMain() { var _this11 = this; this._el.removeEventListener('click', this, true); if (!nav.isMobile) { ['mouseover', 'mouseout'].forEach(function (e) { return _this11._el.removeEventListener(e, _this11); }); } delete this._postsCountEl; delete this._filesCountEl; delete this._postersCountEl; $id('de-main').remove(); }, handleEvent: function handleEvent(e) { var _this12 = this; return _asyncToGenerator(_regenerator().m(function _callee5() { var _$q; var el, post, _iterator2, _step2, _el3, _this12$_menu, _t3, _t4, _t5; return _regenerator().w(function (_context5) { while (1) switch (_context5.n) { case 0: if (!('isTrusted' in e && !e.isTrusted)) { _context5.n = 1; break; } return _context5.a(2); case 1: el = e.target; el = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el; _t3 = e.type; _context5.n = _t3 === 'click' ? 2 : _t3 === 'mouseover' ? 26 : 38; break; case 2: if (!(el.tagName.toLowerCase() === 'a')) { _context5.n = 3; break; } return _context5.a(2); case 3: e.preventDefault(); _t4 = el.id; _context5.n = _t4 === 'de-panel-logo' ? 4 : _t4 === 'de-panel-cfg' ? 6 : _t4 === 'de-panel-hid' ? 7 : _t4 === 'de-panel-fav' ? 8 : _t4 === 'de-panel-vid' ? 9 : _t4 === 'de-panel-refresh' ? 10 : _t4 === 'de-panel-goup' ? 11 : _t4 === 'de-panel-godown' ? 12 : _t4 === 'de-panel-expimg' ? 13 : _t4 === 'de-panel-preimg' ? 14 : _t4 === 'de-panel-maskimg' ? 15 : _t4 === 'de-panel-upd-on' ? 17 : _t4 === 'de-panel-upd-warn' ? 17 : _t4 === 'de-panel-upd-off' ? 17 : _t4 === 'de-panel-audio-on' ? 18 : _t4 === 'de-panel-audio-off' ? 19 : _t4 === 'de-panel-savethr' ? 22 : _t4 === 'de-panel-enable' ? 23 : 25; break; case 4: if (Cfg.expandPanel) { if (!$q('.de-win-active')) { $hide(_this12._buttons); } } else { $show(_this12._buttons); } _context5.n = 5; return toggleCfg('expandPanel'); case 5: return _context5.a(2); case 6: toggleWindow('cfg', false); return _context5.a(2); case 7: toggleWindow('hid', false); return _context5.a(2); case 8: toggleWindow('fav', false); return _context5.a(2); case 9: _this12.isVidEnabled = !_this12.isVidEnabled; toggleWindow('vid', false); return _context5.a(2); case 10: if (nav.isMobile && !aib.t) { _this12._menuToggleClickBtn(el); } else { deWindow.location.reload(); } return _context5.a(2); case 11: scrollTo(0, 0); return _context5.a(2); case 12: scrollTo(0, doc.body.scrollHeight || doc.body.offsetHeight); return _context5.a(2); case 13: el.classList.toggle('de-panel-button-active'); isExpImg = !isExpImg; (_$q = $q('.de-fullimg-center')) === null || _$q === void 0 || _$q.remove(); for (post = Thread.first.op; post; post = post.next) { post.toggleImages(isExpImg, false); } return _context5.a(2); case 14: el.classList.toggle('de-panel-button-active'); isPreImg = !isPreImg; if (!e.ctrlKey) { for (_iterator2 = _createForOfIteratorHelperLoose(DelForm); !(_step2 = _iterator2()).done;) { _el3 = _step2.value.el; ContentLoader.preloadImages(_el3); } } return _context5.a(2); case 15: el.classList.toggle('de-panel-button-active'); _context5.n = 16; return toggleCfg('maskImgs'); case 16: updateCSS(); return _context5.a(2); case 17: updater.toggle(); return _context5.a(2); case 18: if (!nav.isMobile) { _context5.n = 19; break; } updater.toggleAudio(0); el.id = 'de-panel-audio-off'; return _context5.a(2); case 19: if (!nav.isMobile) { _context5.n = 20; break; } _this12._menuToggleClickBtn(el); return _context5.a(2); case 20: if (updater.toggleAudio(0)) { updater.enableUpdater(); el.id = 'de-panel-audio-on'; } else { el.id = 'de-panel-audio-off'; } case 21: if (_this12._menu) { _this12._menu.removeMenu(); _this12._menu = null; } return _context5.a(2); case 22: if (nav.isMobile) { _this12._menuToggleClickBtn(el); } return _context5.a(2); case 23: _context5.n = 24; return toggleCfg('disabled'); case 24: deWindow.location.reload(); return _context5.a(2); case 25: return _context5.a(2); case 26: if (!Cfg.expandPanel) { clearTimeout(_this12._hideTO); $show(_this12._buttons); } _t5 = el.id; _context5.n = _t5 === 'de-panel-cfg' ? 27 : _t5 === 'de-panel-hid' ? 28 : _t5 === 'de-panel-fav' ? 29 : _t5 === 'de-panel-vid' ? 30 : _t5 === 'de-panel-goback' ? 31 : _t5 === 'de-panel-gonext' ? 32 : _t5 === 'de-panel-maskimg' ? 33 : _t5 === 'de-panel-refresh' ? 34 : _t5 === 'de-panel-savethr' ? 35 : _t5 === 'de-panel-audio-off' ? 35 : 37; break; case 27: KeyEditListener.setTitle(el, 10); return _context5.a(3, 37); case 28: KeyEditListener.setTitle(el, 7); return _context5.a(3, 37); case 29: KeyEditListener.setTitle(el, 6); return _context5.a(3, 37); case 30: KeyEditListener.setTitle(el, 18); return _context5.a(3, 37); case 31: KeyEditListener.setTitle(el, 4); return _context5.a(3, 37); case 32: KeyEditListener.setTitle(el, 17); return _context5.a(3, 37); case 33: KeyEditListener.setTitle(el, 9); return _context5.a(3, 37); case 34: if (!aib.t) { _context5.n = 35; break; } return _context5.a(2); case 35: if (!(((_this12$_menu = _this12._menu) === null || _this12$_menu === void 0 ? void 0 : _this12$_menu.parentEl) === el)) { _context5.n = 36; break; } return _context5.a(2); case 36: _this12._menuTO = setTimeout(function () { _this12._menu = Menu.addMenu(el); _this12._menu.onover = function () { return clearTimeout(_this12._hideTO); }; _this12._menu.onout = function () { return _this12._setHideTimeout(null); }; _this12._menu.onremove = function () { return _this12._menu = null; }; }, Cfg.linksOver); case 37: return _context5.a(2); case 38: _this12._setHideTimeout(e.relatedTarget); switch (el.id) { case 'de-panel-refresh': case 'de-panel-savethr': case 'de-panel-audio-off': clearTimeout(_this12._menuTO); } case 39: return _context5.a(2); } }, _callee5); }))(); }, updateCounter: function updateCounter(postCount, filesCount, postersCount) { var _aib$updateCounters, _aib; this._postsCountEl.textContent = postCount; this._filesCountEl.textContent = filesCount; this._postersCountEl.textContent = postersCount; (_aib$updateCounters = (_aib = aib).updateCounters) === null || _aib$updateCounters === void 0 || _aib$updateCounters.call(_aib, postCount, filesCount, postersCount); }, _el: null, _hideTO: null, _menu: null, _menuTO: null, get _filesCountEl() { var value = $id('de-panel-info-files'); Object.defineProperty(this, '_filesCountEl', { value: value, configurable: true }); return value; }, get _postersCountEl() { var value = $id('de-panel-info-posters'); Object.defineProperty(this, '_postersCountEl', { value: value, configurable: true }); return value; }, get _postsCountEl() { var value = $id('de-panel-info-posts'); Object.defineProperty(this, '_postsCountEl', { value: value, configurable: true }); return value; }, _getButton: function _getButton(id) { var page, href, title, useId; var tag = 'button'; switch (id) { case 'goback': tag = 'a'; page = Math.max(aib.page - 1, 0); href = aib.getPageUrl(aib.b, page); if (!aib.t) { title = Lng.panelBtn.gonext[lang].replace('%s', page); } useId = 'arrow'; break; case 'gonext': tag = 'a'; page = aib.page + 1; href = aib.getPageUrl(aib.b, page); title = Lng.panelBtn.gonext[lang].replace('%s', page); case 'goup': case 'godown': useId = 'arrow'; break; case 'upd-on': case 'upd-off': useId = 'upd'; break; case 'catalog': tag = 'a'; href = aib.catalogUrl; } return "<".concat(tag, " id=\"de-panel-").concat(id, "\" class=\"de-abtn de-panel-button\"\n\t\t\ttitle=\"").concat(title || Lng.panelBtn[id][lang], "\" ").concat(href ? 'href="' + href + '"' : '', ">\n\t\t\t\n\t\t\t").concat(id !== 'audio-off' ? "\n\t\t\t\t") : "\n\t\t\t\t\n\t\t\t\t", "\n\t\t\t\n\t\t"); }, _menuToggleClickBtn: function _menuToggleClickBtn(buttonEl) { var _this$_menu; if ((_this$_menu = this._menu) !== null && _this$_menu !== void 0 && _this$_menu.el && this._menu.parentEl === buttonEl) { this._menu.removeMenu(); this._menu = null; return; } this._menu = Menu.addMenu(buttonEl); }, _setHideTimeout: function _setHideTimeout(targetEl) { var _this13 = this; if (!Cfg.expandPanel && !$q('.de-win-active') && !$contains(this._el, targetEl)) { this._hideTO = setTimeout(function () { return $hide(_this13._buttons); }, 500); } } }); function updateWinZ(winEl) { var style = winEl.style; if (style.zIndex < topWinZ) { style.zIndex = ++topWinZ; } } function makeDraggable(name, winEl, headEl) { headEl.addEventListener('mousedown', { _oldX: 0, _oldY: 0, _win: winEl, _wStyle: winEl.style, _X: 0, _Y: 0, _Z: 0, handleEvent: function handleEvent(e) { var _this14 = this; return _asyncToGenerator(_regenerator().m(function _callee6() { var curX, curY, maxX, maxY, cr, x, y, width, _t6; return _regenerator().w(function (_context6) { while (1) switch (_context6.n) { case 0: if (Cfg[name + 'WinDrag']) { _context6.n = 1; break; } return _context6.a(2); case 1: curX = e.clientX, curY = e.clientY; _t6 = e.type; _context6.n = _t6 === 'mousedown' ? 2 : _t6 === 'mousemove' ? 3 : _t6 === 'mouseleave' ? 4 : _t6 === 'mouseup' ? 4 : 5; break; case 2: _this14._oldX = curX; _this14._oldY = curY; _this14._X = Cfg[name + 'WinX']; _this14._Y = Cfg[name + 'WinY']; if (_this14._Z < topWinZ) { _this14._Z = _this14._wStyle.zIndex = ++topWinZ; } ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this14); }); e.preventDefault(); return _context6.a(2); case 3: maxX = Post.sizing.wWidth - _this14._win.offsetWidth; maxY = Post.sizing.wHeight - _this14._win.offsetHeight - 25; cr = _this14._win.getBoundingClientRect(); x = cr.left + curX - _this14._oldX; y = cr.top + curY - _this14._oldY; _this14._X = x >= maxX || curX > _this14._oldX && x > maxX - 20 ? 'right: 0' : x < 0 || curX < _this14._oldX && x < 20 ? 'left: 0' : "left: ".concat(x, "px"); _this14._Y = y >= maxY || curY > _this14._oldY && y > maxY - 20 ? 'bottom: 25px' : y < 0 || curY < _this14._oldY && y < 20 ? 'top: 0' : "top: ".concat(y, "px"); width = _this14._wStyle.width; _this14._win.setAttribute('style', "".concat(_this14._X, "; ").concat(_this14._Y, "; z-index: ").concat(_this14._Z).concat(width ? '; width: ' + width : '')); _this14._oldX = curX; _this14._oldY = curY; return _context6.a(2); case 4: ['mouseleave', 'mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this14); }); _context6.n = 5; return CfgSaver.save(name + 'WinX', _this14._X, name + 'WinY', _this14._Y); case 5: return _context6.a(2); } }, _callee6); }))(); } }); } var WinResizer = function () { function WinResizer(name, direction, cfgName, winEl, targetEl) { _classCallCheck(this, WinResizer); this.name = name; this.direction = direction; this.cfgName = cfgName; this.vertical = direction === 'top' || direction === 'bottom'; this.winEl = winEl; this.wStyle = this.winEl.style; this.tStyle = targetEl.style; $q('.de-resizer-' + direction, winEl).addEventListener('mousedown', this); } return _createClass(WinResizer, [{ key: "handleEvent", value: function () { var _handleEvent = _asyncToGenerator(_regenerator().m(function _callee7(e) { var _this15 = this; var val, x, y, _Post$sizing, maxX, maxY, width, cr, z, _t7, _t8; return _regenerator().w(function (_context7) { while (1) switch (_context7.n) { case 0: _Post$sizing = Post.sizing, maxX = _Post$sizing.wWidth, maxY = _Post$sizing.wHeight; width = this.wStyle.width; cr = this.winEl.getBoundingClientRect(); z = "; z-index: ".concat(this.wStyle.zIndex).concat(width ? '; width:' + width : ''); _t7 = e.type; _context7.n = _t7 === 'mousedown' ? 1 : _t7 === 'mousemove' ? 7 : 8; break; case 1: if (this.winEl.classList.contains('de-win-fixed')) { x = 'right: 0'; y = 'bottom: 25px'; } else { x = Cfg[this.name + 'WinX']; y = Cfg[this.name + 'WinY']; } _t8 = this.direction; _context7.n = _t8 === 'top' ? 2 : _t8 === 'bottom' ? 3 : _t8 === 'left' ? 4 : _t8 === 'right' ? 5 : 6; break; case 2: val = "".concat(x, "; bottom: ").concat(maxY - cr.bottom, "px").concat(z); return _context7.a(3, 6); case 3: val = "".concat(x, "; top: ").concat(cr.top, "px").concat(z); return _context7.a(3, 6); case 4: val = "right: ".concat(maxX - cr.right, "px; ").concat(y + z); return _context7.a(3, 6); case 5: val = "left: ".concat(cr.left, "px; ").concat(y + z); case 6: this.winEl.setAttribute('style', val); ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this15); }); e.preventDefault(); return _context7.a(2); case 7: if (this.vertical) { val = e.clientY; this.tStyle.setProperty('height', Math.max(parseInt(this.tStyle.height, 10) + (this.direction === 'top' ? cr.top - (val < 20 ? 0 : val) : (val > maxY - 45 ? maxY - 25 : val) - cr.bottom), 90) + 'px', 'important'); } else { val = e.clientX; this.tStyle.setProperty('width', Math.max(parseInt(this.tStyle.width, 10) + (this.direction === 'left' ? cr.left - (val < 20 ? 0 : val) : (val > maxX - 20 ? maxX : val) - cr.right), this.name === 'reply' ? 275 : 400) + 'px', 'important'); } return _context7.a(2); case 8: ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this15); }); _context7.n = 9; return CfgSaver.save(this.cfgName, parseInt(this.vertical ? this.tStyle.height : this.tStyle.width, 10)); case 9: if (!this.winEl.classList.contains('de-win-fixed')) { _context7.n = 10; break; } this.winEl.setAttribute('style', 'right: 0; bottom: 25px' + z); return _context7.a(2); case 10: if (!this.vertical) { _context7.n = 12; break; } _context7.n = 11; return CfgSaver.save(this.name + 'WinY', cr.top < 1 ? 'top: 0' : cr.bottom > maxY - 26 ? 'bottom: 25px' : "top: ".concat(cr.top, "px")); case 11: _context7.n = 13; break; case 12: _context7.n = 13; return CfgSaver.save(this.name + 'WinX', cr.left < 1 ? 'left: 0' : cr.right > maxX - 1 ? 'right: 0' : "left: ".concat(cr.left, "px")); case 13: this.winEl.setAttribute('style', Cfg[this.name + 'WinX'] + '; ' + Cfg[this.name + 'WinY'] + z); case 14: return _context7.a(2); } }, _callee7, this); })); function handleEvent(_x6) { return _handleEvent.apply(this, arguments); } return handleEvent; }() }]); }(); function toggleWindow(name, isUpdate, data, noAnim) { var _winEl; var el; var winEl = $id('de-win-' + name); var isActive = (_winEl = winEl) === null || _winEl === void 0 ? void 0 : _winEl.classList.contains('de-win-active'); if (isUpdate && !isActive) { return; } if (!winEl) { var winAttr = (Cfg[name + 'WinDrag'] ? "de-win\" style=\"".concat(Cfg[name + 'WinX'], "; ").concat(Cfg[name + 'WinY']) : 'de-win-fixed" style="right: 0; bottom: 25px') + (name !== 'fav' ? '' : "; width: ".concat(Cfg.favWinWidth, "px; ")); winEl = $aBegin($id('de-main'), "
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t").concat(name === 'cfg' ? 'Dollchan Extension Tools' : Lng.panelBtn[name][lang], "\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t").concat(name !== 'fav' ? '' : "\n\t\t\t\t
\n\t\t\t\t
", "\n\t\t
")); var _winBody = $q('.de-win-body', winEl); if (name === 'cfg') { _winBody.className = 'de-win-body ' + aib.cReply; } else { setTimeout(function () { var backColor = getComputedStyle(doc.body).getPropertyValue('background-color'); _winBody.style.backgroundColor = backColor !== 'transparent' ? backColor : '#EEE'; }, 100); } if (name === 'fav') { new WinResizer('fav', 'left', 'favWinWidth', winEl, winEl); new WinResizer('fav', 'right', 'favWinWidth', winEl, winEl); } el = $q('.de-win-buttons', winEl); el.onmouseover = function (e) { var el = e.target; switch (el.classList[0]) { case 'de-win-btn-close': el.parentNode.title = Lng.closeWindow[lang]; break; case 'de-win-btn-toggle': el.parentNode.title = Cfg[name + 'WinDrag'] ? Lng.toPanel[lang] : Lng.makeDrag[lang]; } }; el.lastElementChild.onclick = function () { return toggleWindow(name, false); }; $q('.de-win-btn-toggle', el).onclick = _asyncToGenerator(_regenerator().m(function _callee8() { var isDrag, temp, width; return _regenerator().w(function (_context8) { while (1) switch (_context8.n) { case 0: _context8.n = 1; return toggleCfg(name + 'WinDrag'); case 1: isDrag = Cfg[name + 'WinDrag']; if (!isDrag) { temp = $q('.de-win-active.de-win-fixed', winEl.parentNode); if (temp) { toggleWindow(temp.id.substr(7), false); } } winEl.classList.toggle('de-win', isDrag); winEl.classList.toggle('de-win-fixed', !isDrag); width = winEl.style.width; winEl.style.cssText = "".concat(isDrag ? "".concat(Cfg[name + 'WinX'], "; ").concat(Cfg[name + 'WinY']) : 'right: 0; bottom: 25px').concat(width ? '; width: ' + width : ''); updateWinZ(winEl); case 2: return _context8.a(2); } }, _callee8); })); makeDraggable(name, winEl, $q('.de-win-head', winEl)); } updateWinZ(winEl); var isRemove = !isUpdate && isActive; if (!isRemove && !winEl.classList.contains('de-win') && (el = $q(".de-win-active.de-win-fixed:not(#de-win-".concat(name, ")"), winEl.parentNode))) { toggleWindow(el.id.substr(7), false); } var isAnim = !noAnim && !isUpdate && Cfg.animation; var winBody = $q('.de-win-body', winEl); if (isAnim && winBody.hasChildNodes()) { winEl.addEventListener('animationend', function aEvent(e) { e.target.removeEventListener('animationend', aEvent); showWindow(winEl, winBody, name, isRemove, data, Cfg.animation); winEl = winBody = name = isRemove = data = null; }); winEl.classList.remove('de-win-open'); winEl.classList.add('de-win-close'); } else { showWindow(winEl, winBody, name, isRemove, data, isAnim); } } function showWindow(winEl, winBody, name, isRemove, data, isAnim) { winBody.innerHTML = ''; winEl.classList.toggle('de-win-active', !isRemove); if (isRemove) { winEl.classList.remove('de-win-close'); $hide(winEl); if (!Cfg.expandPanel && !$q('.de-win-active')) { $hide($id('de-panel-buttons')); } return; } if (!Cfg.expandPanel) { $show($id('de-panel-buttons')); } switch (name) { case 'fav': if (data) { showFavoritesWindow(winBody, data); break; } readFavorites().then(function (favObj) { showFavoritesWindow(winBody, favObj); $show(winEl); if (isAnim) { winEl.classList.add('de-win-open'); } }); return; case 'cfg': CfgWindow.initCfgWindow(winBody); break; case 'hid': showHiddenWindow(winBody); break; case 'vid': showVideosWindow(winBody); } $show(winEl); if (isAnim) { winEl.classList.add('de-win-open'); } } function showVideosWindow(winBody) { var els = $Q('.de-video-link'); if (!els.length) { winBody.innerHTML = "".concat(Lng.noVideoLinks[lang], ""); return; } if (!$id('de-ytube-api')) { var _script = doc.createElement('script'); _script.type = 'text/javascript'; _script.src = aib.protocol + '//www.youtube.com/player_api'; _script.id = 'de-ytube-api'; doc.head.append(_script); } winBody.innerHTML = "
\n\t
\n\t\t\n\t\t\n\t\t\n\t\t\n\t
"); var linkList = $add("
")); var script = doc.createElement('script'); script.type = 'text/javascript'; script.textContent = "(function() {\n\t\tif('YT' in window && 'Player' in window.YT) {\n\t\t\tonYouTubePlayerAPIReady();\n\t\t} else {\n\t\t\twindow.onYouTubePlayerAPIReady = onYouTubePlayerAPIReady;\n\t\t}\n\t\tfunction onYouTubePlayerAPIReady() {\n\t\t\twindow.de_addVideoEvents =\n\t\t\t\taddEvents.bind(document.querySelector('#de-win-vid > .de-win-body > .de-video-obj'));\n\t\t\twindow.de_addVideoEvents();\n\t\t}\n\t\tfunction addEvents() {\n\t\t\tvar autoplay = true;\n\t\t\tif(this.hasAttribute('de-disableautoplay')) {\n\t\t\t\tautoplay = false;\n\t\t\t\tthis.removeAttribute('de-disableautoplay');\n\t\t\t}\n\t\t\tnew YT.Player(this.firstChild, { events: {\n\t\t\t\t'onError': gotoNextVideo,\n\t\t\t\t'onReady': autoplay ? function(e) {\n\t\t\t\t\te.target.playVideo();\n\t\t\t\t} : Function.prototype,\n\t\t\t\t'onStateChange': function(e) {\n\t\t\t\t\tif(e.data === 0) {\n\t\t\t\t\t\tgotoNextVideo();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}});\n\t\t}\n\t\tfunction gotoNextVideo() {\n\t\t\tdocument.getElementById(\"de-video-btn-next\").click();\n\t\t}\n\t})();"; winBody.append(script); winBody.addEventListener('click', { linkList: linkList, currentLink: null, listHidden: false, player: winBody.firstElementChild, playerInfo: null, handleEvent: function handleEvent(e) { var el = e.target; var classList = el.classList; if (classList.contains('de-abtn')) { var node; switch (el.id) { case 'de-video-btn-hide': { var isHide = this.listHidden = !this.listHidden; $toggle(this.linkList, !isHide); el.textContent = isHide ? "\u25BC" : "\u25B2"; break; } case 'de-video-btn-prev': node = this.currentLink.parentNode; node = node.previousElementSibling || node.parentNode.lastElementChild; node.lastElementChild.click(); break; case 'de-video-btn-next': node = this.currentLink.parentNode; node = node.nextElementSibling || node.parentNode.firstElementChild; node.lastElementChild.click(); break; case 'de-video-btn-resize': { var exp = this.player.className === 'de-video-obj'; this.player.className = exp ? 'de-video-obj de-video-expanded' : 'de-video-obj'; this.linkList.style.maxWidth = "".concat(exp ? 894 : +Cfg.YTubeWidth + 40, "px"); this.linkList.style.maxHeight = "".concat(nav.viewportHeight() * 0.92 - (exp ? 562 : +Cfg.YTubeHeigh + 82), "px"); } } e.preventDefault(); return; } else if (!classList.contains('de-video-link')) { pByNum.get(+el.getAttribute('de-num')).selectAndScrollTo(); return; } var info = el.videoInfo; if (this.playerInfo !== info) { if (this.currentLink) { this.currentLink.classList.remove('de-current'); } this.currentLink = el; classList.add('de-current'); Videos.addPlayer(this, info, classList.contains('de-ytube'), true); } e.preventDefault(); } }, true); for (var i = 0, len = els.length; i < len; ++i) { updateVideoList(linkList, els[i], aib.getPostOfEl(els[i]).num); } winBody.append(linkList); $q('.de-video-link', linkList).click(); } function updateVideoList(parent, link, num) { var el = link.cloneNode(true); el.videoInfo = link.videoInfo; el.classList.remove('de-current'); el.setAttribute('onclick', 'window.de_addVideoEvents && window.de_addVideoEvents();'); $bEnd(parent, "
\n\t\t>").concat(num, "\" de-num=\"").concat(num, "\">>>\n\t
")).append(el); } function showHiddenWindow(winBody) { var boards = HiddenThreads.getRawData(); var hasThreads = !$isEmpty(boards); if (hasThreads) { var _loop = function _loop() { if (!$hasProp(boards, board)) { return 0; } var threads = boards[board]; if ($isEmpty(threads)) { return 0; } var block = $bEnd(winBody, "
/".concat(board, "
")); block.firstChild.onclick = function (e) { return $Q('.de-entry > input', block).forEach(function (el) { return el.checked = e.target.checked; }); }; for (var tNum in threads) { if ($hasProp(threads, tNum)) { block.insertAdjacentHTML('beforeend', "
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(tNum, "\n\t\t\t\t\t\t\t
- ").concat(threads[tNum][2], "
\n\t\t\t\t\t\t
")); } } }, _ret; for (var board in boards) { _ret = _loop(); if (_ret === 0) continue; } } $bEnd(winBody, (!hasThreads ? "
".concat(Lng.noHidThr[lang], "
") : '') + '
').append( getEditButton('hidden', function (fn) { return fn(HiddenThreads.getRawData(), true, function (data) { HiddenThreads.saveRawData(data); Thread.first.updateHidden(data[aib.b]); toggleWindow('hid', true); }); }), $button(Lng.clear[lang], Lng.clear404[lang], function () { var _ref3 = _asyncToGenerator(_regenerator().m(function _callee9(e) { var els, _loop2, i, len; return _regenerator().w(function (_context0) { while (1) switch (_context0.n) { case 0: els = $Q('.de-entry[info]', e.target.parentNode.parentNode); _loop2 = _regenerator().m(function _loop2() { var _els$i$getAttribute$s, _els$i$getAttribute$s2, board, tNum; return _regenerator().w(function (_context9) { while (1) switch (_context9.n) { case 0: _els$i$getAttribute$s = els[i].getAttribute('info').split(';'), _els$i$getAttribute$s2 = _slicedToArray(_els$i$getAttribute$s, 2), board = _els$i$getAttribute$s2[0], tNum = _els$i$getAttribute$s2[1]; _context9.n = 1; return $ajax(aib.getThrUrl(board, tNum))["catch"](function (err) { if (err.code === 404) { HiddenThreads.removeStorage(tNum, board); HiddenPosts.removeStorage(tNum, board); } }); case 1: return _context9.a(2); } }, _loop2); }); i = 0, len = els.length; case 1: if (!(i < len)) { _context0.n = 3; break; } return _context0.d(_regeneratorValues(_loop2()), 2); case 2: ++i; _context0.n = 1; break; case 3: toggleWindow('hid', true); case 4: return _context0.a(2); } }, _callee9); })); return function (_x7) { return _ref3.apply(this, arguments); }; }()), $button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry[info]', winBody).forEach(function (el) { if (!$q('input', el).checked) { return; } var _el$getAttribute$spli = el.getAttribute('info').split(';'), _el$getAttribute$spli2 = _slicedToArray(_el$getAttribute$spli, 2), board = _el$getAttribute$spli2[0], tNum = _el$getAttribute$spli2[1]; var num = +tNum; if (pByNum.has(num)) { pByNum.get(num).setUserVisib(false); } else { sendStorageEvent('__de-post', { brd: board, num: num, hide: false, thrNum: num }); } HiddenThreads.removeStorage(num, board); HiddenPosts.set(num, num, false); }); toggleWindow('hid', true); })); } function saveRenewFavorites(favObj) { saveFavorites(favObj); toggleWindow('fav', true, favObj); } function removeFavEntry(favObj, host, board, num) { var _favObj$host; var entry = (_favObj$host = favObj[host]) === null || _favObj$host === void 0 ? void 0 : _favObj$host[board]; if (entry !== null && entry !== void 0 && entry[num]) { delete entry[num]; if (!(Object.keys(entry).length - +$hasProp(entry, 'url') - +$hasProp(entry, 'hide'))) { delete favObj[host][board]; if ($isEmpty(favObj[host])) { delete favObj[host]; } } } } function toggleThrFavBtn(host, board, num, isEnable) { if (host === aib.host && board === aib.b && pByNum.has(num)) { var post = pByNum.get(num); post.toggleFavBtn(isEnable); post.thr.isFav = isEnable; } } function updateFavorites(num, value, mode) { readFavorites().then(function (favObj) { var _favObj$aib$host2; var entry = (_favObj$aib$host2 = favObj[aib.host]) === null || _favObj$aib$host2 === void 0 || (_favObj$aib$host2 = _favObj$aib$host2[aib.b]) === null || _favObj$aib$host2 === void 0 ? void 0 : _favObj$aib$host2[num]; if (!entry) { return; } var isUpdate = false; switch (mode) { case 'closed': case 'error': if (entry.err !== value) { entry.err = value; isUpdate = true; } break; case 'update': if (entry.last !== aib.anchor + value[3]) { if (doc.hidden) { value[1] += entry["new"]; } else { value[1] = value[2] = 0; entry.last = aib.anchor + value[3]; } if (entry.err) { delete entry.err; } var _value = _slicedToArray(value, 3); entry.cnt = _value[0]; entry["new"] = _value[1]; entry.you = _value[2]; isUpdate = true; } } if (isUpdate) { var data = [aib.host, aib.b, num, value, mode]; updateFavWindow.apply(void 0, data); saveFavorites(favObj); sendStorageEvent('__de-favorites', data); } }); } function updateFavWindow(host, board, num, value, mode) { if (mode === 'add' || mode === 'delete') { toggleThrFavBtn(host, board, num, mode === 'add'); toggleWindow('fav', true, value); return; } var winEl = $q('#de-win-fav > .de-win-body'); if (!(winEl !== null && winEl !== void 0 && winEl.hasChildNodes())) { return; } var el = $q(".de-entry[de-host=\"".concat(host, "\"][de-board=\"").concat(board, "\"][de-num=\"").concat(num, "\"] > .de-fav-inf"), winEl); if (!el) { return; } var _ref4 = _toConsumableArray(el.children), iconEl = _ref4[0], youEl = _ref4[1], newEl = _ref4[2], oldEl = _ref4[3]; if (Array.isArray(value)) { $toggle(newEl, value[1]); $toggle(youEl, value[2]); oldEl.textContent = value[0]; newEl.textContent = value[1]; youEl.textContent = value[2]; } if (mode === 'error' || mode === 'closed') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon ' + (mode === 'closed' ? 'de-fav-closed' : 'de-fav-unavail')); iconEl.title = value; return; } else if (mode === 'update') { iconEl.firstElementChild.setAttribute('class', 'de-fav-inf-icon'); iconEl.removeAttribute('title'); } } function remove404Favorites(_x8) { return _remove404Favorites.apply(this, arguments); } function _remove404Favorites() { _remove404Favorites = _asyncToGenerator(_regenerator().m(function _callee53(favObj) { var els, len, i, el, host, board, num; return _regenerator().w(function (_context61) { while (1) switch (_context61.n) { case 0: els = $Q('.de-entry[de-removed]'); len = els.length; if (len) { _context61.n = 1; break; } return _context61.a(2); case 1: if (favObj) { _context61.n = 3; break; } _context61.n = 2; return readFavorites(); case 2: favObj = _context61.v; case 3: for (i = 0; i < len; ++i) { el = els[i]; host = el.getAttribute('de-host'); board = el.getAttribute('de-board'); num = +el.getAttribute('de-num'); removeFavEntry(favObj, host, board, num); toggleThrFavBtn(host, board, num, false); Thread.removeSavedData(board, num); } saveRenewFavorites(favObj); case 4: return _context61.a(2); } }, _callee53); })); return _remove404Favorites.apply(this, arguments); } function isPostRefToYou(post, myPosts) { if (Cfg.markMyPosts && (myPosts || MyPosts)) { var isMatch = myPosts ? function (num) { return myPosts[num]; } : function (num) { return MyPosts.has(num); }; var links = $Q(aib.qPostMsg + ' a', post); for (var a = 0, linksLen = links.length; a < linksLen; ++a) { var tc = links[a].textContent; if (tc[0] === '>' && tc[1] === '>' && isMatch(parseInt(tc.substr(2), 10))) { return true; } } } return false; } function refreshFavorites(_x9) { return _refreshFavorites.apply(this, arguments); } function _refreshFavorites() { _refreshFavorites = _asyncToGenerator(_regenerator().m(function _callee54(needClear404) { var isUpdate, favObj, myPosts, parentEl, entryEls, i, len, _entry$last$match, entryEl, _ref59, titleEl, youEl, newEl, totalEl, iconEl, host, board, num, url, entry, oldClassName, oldTitle, formEl, isArchived, _yield$ajaxLoad, _yield$ajaxLoad2, newCount, youCount, lastNum, posts, postsLen, j, post, _t48, _t49; return _regenerator().w(function (_context62) { while (1) switch (_context62.p = _context62.n) { case 0: isUpdate = false; _context62.n = 1; return readFavorites(); case 1: favObj = _context62.v; myPosts = JSON.parse(locStorage['de-myposts'] || '{}'); parentEl = $q('.de-fav-table'); entryEls = $Q('.de-entry'); i = 0, len = entryEls.length; case 2: if (!(i < len)) { _context62.n = 21; break; } entryEl = entryEls[i]; _ref59 = _toConsumableArray(entryEl.lastElementChild.children), titleEl = _ref59[0], youEl = _ref59[1], newEl = _ref59[2], totalEl = _ref59[3]; iconEl = titleEl.firstElementChild; host = entryEl.getAttribute('de-host'); board = entryEl.getAttribute('de-board'); num = entryEl.getAttribute('de-num'); url = entryEl.getAttribute('de-url'); entry = favObj[host][board][num]; if (!(entry.err === 'Archived')) { _context62.n = 3; break; } return _context62.a(3, 20); case 3: if (!(host !== aib.host || entry.err === 'Closed')) { _context62.n = 8; break; } if (!needClear404) { _context62.n = 7; break; } parentEl.classList.add('de-fav-table-unfold'); oldClassName = iconEl.getAttribute('class'); oldTitle = titleEl.title; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context62.p = 4; _context62.n = 5; return $ajax(url, null, true); case 5: iconEl.setAttribute('class', oldClassName); if (oldTitle) { titleEl.title = oldTitle; } else { titleEl.removeAttribute('title'); } if (entry.err && entry.err !== 'Closed') { delete entry.err; isUpdate = true; } _context62.n = 7; break; case 6: _context62.p = 6; _t48 = _context62.v; if (!(_t48 instanceof AjaxError) || _t48.code === 0) { $popup('fav-refresh', Lng.noConnect[lang]); } else if (_t48.code === 404) { entryEl.setAttribute('de-removed', ''); } iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_t48); isUpdate = true; case 7: return _context62.a(3, 20); case 8: formEl = void 0, isArchived = void 0; iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; _context62.p = 9; if (!aib.hasArchive) { _context62.n = 11; break; } _context62.n = 10; return ajaxLoad(url, true, false, true); case 10: _yield$ajaxLoad = _context62.v; _yield$ajaxLoad2 = _slicedToArray(_yield$ajaxLoad, 2); formEl = _yield$ajaxLoad2[0]; isArchived = _yield$ajaxLoad2[1]; _context62.n = 13; break; case 11: _context62.n = 12; return ajaxLoad(url); case 12: formEl = _context62.v; case 13: _context62.n = 15; break; case 14: _context62.p = 14; _t49 = _context62.v; if (!(_t49 instanceof AjaxError) || _t49.code === 0) { $popup('fav-refresh', Lng.noConnect[lang]); } else if (_t49.code === 404) { entryEl.setAttribute('de-removed', ''); } $hide(newEl); $hide(youEl); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-unavail'); titleEl.title = entry.err = getErrorMessage(_t49); isUpdate = true; return _context62.a(3, 20); case 15: if (aib.qClosed && $q(aib.qClosed, formEl)) { iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-closed'); titleEl.title = Lng.thrClosed[lang]; entry.err = 'Closed'; isUpdate = true; } else if (isArchived) { iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-closed'); titleEl.title = Lng.thrArchived[lang]; entry.err = 'Archived'; isUpdate = true; } else { iconEl.setAttribute('class', 'de-fav-inf-icon'); titleEl.removeAttribute('title'); if (entry.err) { delete entry.err; isUpdate = true; } } newCount = 0; youCount = 0; lastNum = ((_entry$last$match = entry.last.match(/\d+$/)) === null || _entry$last$match === void 0 ? void 0 : _entry$last$match[0]) || 0; posts = $Q(aib.qPost, formEl); postsLen = posts.length; j = 0; case 16: if (!(j < postsLen)) { _context62.n = 19; break; } post = posts[j]; if (!(lastNum >= aib.getPNum(post))) { _context62.n = 17; break; } return _context62.a(3, 18); case 17: newCount++; if (isPostRefToYou(post, myPosts[board])) { youCount++; } case 18: ++j; _context62.n = 16; break; case 19: if (newCount !== entry["new"] || entry.cnt !== postsLen + 1) { isUpdate = true; } totalEl.textContent = entry.cnt = postsLen + 1; if (newCount) { newEl.textContent = entry["new"] = newCount; $show(newEl); if (youCount) { youEl.textContent = entry.you = youCount; $show(youEl); } } else { $hide(newEl); $hide(youEl); } case 20: ++i; _context62.n = 2; break; case 21: AjaxCache.clearCache(); if (needClear404) { if (isUpdate) { remove404Favorites(favObj); } parentEl.classList.remove('de-fav-table-unfold'); } else if (isUpdate) { saveFavorites(favObj); } case 22: return _context62.a(2); } }, _callee54, null, [[9, 14], [4, 6]]); })); return _refreshFavorites.apply(this, arguments); } function showFavoritesWindow(winBody, favObj) { var html = ''; for (var host in favObj) { if (!$hasProp(favObj, host)) { continue; } var boards = favObj[host]; for (var board in boards) { if (!$hasProp(boards, board)) { continue; } var threads = boards[board]; var hb = "de-host=\"".concat(host, "\" de-board=\"").concat(board, "\""); var delBtn = "\n\t\t\t\t\n\t\t\t"; var tNums = void 0; var tArr = Object.entries(threads); switch (Cfg.favThrOrder) { case 0: tNums = tArr; break; case 1: tNums = tArr.reverse(); break; case 2: tNums = tArr.sort(function (a, b) { return (a[1].time || 0) - (b[1].time || 0); }); break; case 3: tNums = tArr.sort(function (a, b) { return (b[1].time || 0) - (a[1].time || 0); }); } var innerHtml = ''; for (var i = 0, len = tNums.length; i < len; ++i) { var tNum = tNums[i][0]; if (tNum === 'url' || tNum === 'hide') { continue; } var entry = threads[tNum]; var favLinkHref = entry.url + (!entry.last ? '' : entry.last.startsWith('#') ? entry.last : host === aib.host ? aib.anchor + entry.last : ''); var favInfIwrapTitle = !entry.err ? '' : entry.err === 'Closed' ? "title=\"".concat(Lng.thrClosed[lang], "\"") : "title=\"".concat(entry.err, "\""); var favInfIconClass = !entry.err ? '' : entry.err === 'Closed' || entry.err === 'Archived' ? 'de-fav-closed' : 'de-fav-unavail'; var favInfYouDisp = entry.you ? '' : ' style="display: none;"'; var favInfNewDisp = entry["new"] ? '' : ' style="display: none;"'; innerHtml += "
\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t").concat(tNum, "\n\t\t\t\t\t
- ").concat(entry.txt, "
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(entry.you || 0, "\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t").concat(entry["new"] || 0, "\n\t\t\t\t\t\t").concat(entry.cnt, "\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
"); } if (!innerHtml) { continue; } var isHide = threads.hide === undefined ? host !== aib.host : threads.hide; html += "
\n\t\t\t\t
\n\t\t\t\t\t").concat(delBtn, "\n\t\t\t\t\t").concat(host, "/").concat(board, "\n\t\t\t\t\t".concat(isHide ? '▼' : '▲', "\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t").concat(innerHtml, "\n\t\t\t\t
\n\t\t\t
"); } } if (html) { $bEnd(winBody, "
".concat(html, "
")).addEventListener('click', function (e) { var el = e.target; var parentEl = el.parentNode; if (el.tagName.toLowerCase() === 'svg') { el = parentEl; parentEl = parentEl.parentNode; } switch (el.className) { case 'de-fav-link': sesStorage['de-fav-win'] = '1'; sesStorage.removeItem('de-scroll-' + parentEl.getAttribute('de-board') + (parentEl.getAttribute('de-num') || '')); break; case 'de-fav-del-btn': { var wasChecked = el.hasAttribute('de-checked'); var toggleFn = function toggleFn(btnEl) { return btnEl.toggleAttribute('de-checked', !wasChecked); }; toggleFn(el); if (parentEl.className === 'de-fav-header') { var entriesEl = parentEl.nextElementSibling; $Q('.de-fav-del-btn', entriesEl).forEach(toggleFn); if (!wasChecked && entriesEl.classList.contains('de-fav-entries-hide')) { entriesEl.classList.remove('de-fav-entries-hide'); } } var isShowDelBtns = !!$q('.de-entry > .de-fav-del-btn[de-checked]', winBody); $toggle($id('de-fav-buttons'), !isShowDelBtns); $toggle($id('de-fav-del-confirm'), isShowDelBtns); break; } case 'de-abtn de-fav-header-btn': { var _entriesEl = parentEl.nextElementSibling; var _isHide = !_entriesEl.classList.contains('de-fav-entries-hide'); el.innerHTML = _isHide ? '▼' : '▲'; favObj[_entriesEl.getAttribute('de-host')][_entriesEl.getAttribute('de-board')].hide = _isHide; saveFavorites(favObj); e.preventDefault(); _entriesEl.classList.toggle('de-fav-entries-hide'); } } }); } else { winBody.insertAdjacentHTML('beforeend', "
".concat(Lng.noFavThr[lang], "
")); } var btns = $bEnd(winBody, '
'); btns.append( getEditButton('favor', function (fn) { return readFavorites().then(function (favObj) { return fn(favObj, true, saveRenewFavorites); }); }), $button(Lng.refresh[lang], Lng.refreshCounters[lang], function () { return refreshFavorites(false); }), $button(Lng.clear[lang], Lng.refreshClear404[lang], function () { return refreshFavorites(true); }), $button(Lng.page[lang], Lng.infoPage[lang], _asyncToGenerator(_regenerator().m(function _callee0() { var els, len, thrInfo, _i3, el, iconEl, titleEl, endPage, infoLoaded, updateInf, page, _tNums, form, _els, _i4, _len3, _i5, inf, _i6, _inf, _t9; return _regenerator().w(function (_context1) { while (1) switch (_context1.p = _context1.n) { case 0: els = $Q('.de-fav-current > .de-fav-entries > .de-entry'); len = els.length; if (len) { _context1.n = 1; break; } return _context1.a(2); case 1: $popup('load-pages', Lng.loading[lang], true); thrInfo = []; for (_i3 = 0; _i3 < len; ++_i3) { el = els[_i3]; iconEl = $q('.de-fav-inf-icon', el); titleEl = iconEl.parentNode; thrInfo.push({ found: false, num: +el.getAttribute('de-num'), pageEl: $q('.de-fav-inf-page', el), iconClass: iconEl.getAttribute('class'), iconEl: iconEl, iconTitle: titleEl.getAttribute('title'), titleEl: titleEl }); iconEl.setAttribute('class', 'de-fav-inf-icon de-fav-wait'); titleEl.title = Lng.updating[lang]; } endPage = (aib.lastPage || 10) + 1; infoLoaded = 0; updateInf = function updateInf(inf, page) { inf.iconEl.setAttribute('class', inf.iconClass); if (inf.iconTitle) { inf.titleEl.title = inf.iconTitle; } else { inf.titleEl.removeAttribute('title'); } inf.pageEl.textContent = '@' + page; }; page = 0; case 2: if (!(page < endPage)) { _context1.n = 8; break; } _tNums = new Set(); _context1.p = 3; _context1.n = 4; return ajaxLoad(aib.getPageUrl(aib.b, page)); case 4: form = _context1.v; _els = DelForm.getThreads(form); for (_i4 = 0, _len3 = _els.length; _i4 < _len3; ++_i4) { _tNums.add(aib.getTNum(_els[_i4])); } _context1.n = 6; break; case 5: _context1.p = 5; _t9 = _context1.v; return _context1.a(3, 7); case 6: for (_i5 = 0; _i5 < len; ++_i5) { inf = thrInfo[_i5]; if (_tNums.has(inf.num)) { updateInf(inf, page); inf.found = true; infoLoaded++; } } if (!(infoLoaded === len)) { _context1.n = 7; break; } return _context1.a(3, 8); case 7: ++page; _context1.n = 2; break; case 8: for (_i6 = 0; _i6 < len; ++_i6) { _inf = thrInfo[_i6]; if (!_inf.found) { updateInf(_inf, '?'); } } closePopup('load-pages'); case 9: return _context1.a(2); } }, _callee0, null, [[3, 5]]); })))); var delBtns = $bEnd(winBody, ''); delBtns.append($button(Lng.remove[lang], Lng.delEntries[lang], function () { $Q('.de-entry > .de-fav-del-btn[de-checked]', winBody).forEach(function (el) { return el.parentNode.setAttribute('de-removed', ''); }); remove404Favorites(); $show(btns); $hide(delBtns); }), $button(Lng.cancel[lang], '', function () { $Q('.de-fav-del-btn', winBody).forEach(function (el) { return el.removeAttribute('de-checked'); }); $show(btns); $hide(delBtns); })); } var CfgWindow = { initCfgWindow: function initCfgWindow(winBody) { var _this16 = this; ['click', 'mouseover', 'mouseout', 'change', 'keyup', 'keydown', 'scroll'].forEach(function (e) { return winBody.addEventListener(e, _this16); }); var div = $bEnd(winBody, "
".concat(this._getTab('filters') + this._getTab('posts') + this._getTab('images') + this._getTab('links') + (postform.form || postform.oeForm ? this._getTab('form') : '') + this._getTab('common') + this._getTab('info'), "
").concat(this._getSel('language'), "
")); this._clickTab(Cfg.cfgTab); div.append( getEditButton('cfg', function (fn) { return fn(Cfg, true, function () { var _ref6 = _asyncToGenerator(_regenerator().m(function _callee1(data) { return _regenerator().w(function (_context10) { while (1) switch (_context10.n) { case 0: _context10.n = 1; return CfgSaver.saveObj(aib.domain, function () { return data; }); case 1: deWindow.location.reload(); case 2: return _context10.a(2); } }, _callee1); })); return function (_x0) { return _ref6.apply(this, arguments); }; }()); }), nav.hasGlobalStorage ? $button(Lng.global[lang], Lng.globalCfg[lang], function () { var el = $popup('cfg-global', "".concat(Lng.globalCfg[lang], ":")); $bEnd(el, "
").concat(Lng.loadGlobal[lang], "
")).firstElementChild.onclick = _asyncToGenerator(_regenerator().m(function _callee10() { var data; return _regenerator().w(function (_context11) { while (1) switch (_context11.n) { case 0: _context11.n = 1; return getStoredObj('DESU_Config'); case 1: data = _context11.v; if (!(data && 'global' in data && !$isEmpty(data.global))) { _context11.n = 3; break; } _context11.n = 2; return CfgSaver.saveObj(aib.domain, function () { return data.global; }); case 2: deWindow.location.reload(); _context11.n = 4; break; case 3: $popup('err-noglobalcfg', Lng.noGlobalCfg[lang]); case 4: return _context11.a(2); } }, _callee10); })); $bEnd(el, "
").concat(Lng.saveGlobal[lang], "
")).firstElementChild.onclick = _asyncToGenerator(_regenerator().m(function _callee11() { var data, obj, com, i; return _regenerator().w(function (_context12) { while (1) switch (_context12.n) { case 0: _context12.n = 1; return getStoredObj('DESU_Config'); case 1: data = _context12.v; obj = {}; com = data[aib.domain]; for (i in com) { if (i !== 'correctTime' && i !== 'timePattern' && i !== 'userCSS' && i !== 'userCSSTxt' && i !== 'stats' && com[i] !== defaultCfg[i]) { obj[i] = com[i]; } } data.global = obj; _context12.n = 2; return CfgSaver.saveObj('global', function () { return data.global; }); case 2: toggleWindow('cfg', true); case 3: return _context12.a(2); } }, _callee11); })); el.insertAdjacentHTML('beforeend', "
".concat(Lng.descrGlobal[lang], "")); }) : '', $button(Lng.file[lang], Lng.fileImpExp[lang], function () { var list = _this16._getList([Lng.panelBtn.cfg[lang] + ' ' + Lng.allDomains[lang], Lng.panelBtn.fav[lang], Lng.hidPostThr[lang] + " (".concat(aib.domain, ")"), Lng.myPosts[lang] + " (".concat(aib.domain, ")")]); $popup('cfg-file', "".concat(Lng.fileImpExp[lang], ":
").concat(Lng.fileToData[lang], ":

").concat(Lng.dataToFile[lang], ":
").concat(list, "
")); $id('de-import-file').onchange = function (e) { var file = e.target.files[0]; if (!file) { return; } readFile(file, true).then(function (_ref9) { var data = _ref9.data; var obj; try { obj = JSON.parse(data); } catch (err) { $popup('err-invaliddata', Lng.invalidData[lang]); return; } var _obj = obj, cfgObj = _obj.settings, favObj = _obj.favorites, domainObj = _obj[aib.domain]; var isOldCfg = !cfgObj && !favObj && !domainObj; if (isOldCfg) { setStored('DESU_Config', data); } if (cfgObj) { try { setStored('DESU_Config', JSON.stringify(cfgObj)); setStored('DESU_keys', JSON.stringify(obj.hotkeys)); } catch (err) {} } if (favObj) { saveRenewFavorites(favObj); } if (domainObj) { if (domainObj.posts) { locStorage['de-posts'] = JSON.stringify(domainObj.posts); } if (domainObj.threads) { locStorage['de-threads'] = JSON.stringify(domainObj.threads); } if (domainObj.myposts) { locStorage['de-myposts'] = JSON.stringify(domainObj.myposts); } } if (cfgObj || domainObj || isOldCfg) { $popup('cfg-file', Lng.updating[lang], true); deWindow.location.reload(); return; } closePopup('cfg-file'); }); }; var expFile = $id('de-export-file'); var els = $Q('input', expFile.nextElementSibling); els[0].checked = true; expFile.addEventListener('click', function () { var _ref0 = _asyncToGenerator(_regenerator().m(function _callee12(e) { var name, nameDomain, d, val, valDomain, i, len, cfgData, _t0, _t1, _t10, _t11; return _regenerator().w(function (_context13) { while (1) switch (_context13.n) { case 0: name = []; nameDomain = []; d = new Date(); val = []; valDomain = []; i = 0, len = els.length; case 1: if (!(i < len)) { _context13.n = 11; break; } if (els[i].checked) { _context13.n = 2; break; } return _context13.a(3, 10); case 2: _t0 = i; _context13.n = _t0 === 0 ? 3 : _t0 === 1 ? 5 : _t0 === 2 ? 8 : _t0 === 3 ? 9 : 10; break; case 3: name.push('Cfg'); _context13.n = 4; return Promise.all([getStored('DESU_Config'), getStored('DESU_keys')]); case 4: cfgData = _context13.v; val.push("\"settings\":".concat(cfgData[0]), "\"hotkeys\":".concat(cfgData[1] || '""')); return _context13.a(3, 10); case 5: name.push('Fav'); _t1 = val; _t10 = "\"favorites\":"; _context13.n = 6; return getStored('DESU_Favorites'); case 6: _t11 = _context13.v; if (_t11) { _context13.n = 7; break; } _t11 = '{}'; case 7: _t1.push.call(_t1, _t10.concat.call(_t10, _t11)); return _context13.a(3, 10); case 8: nameDomain.push('Hid'); valDomain.push("\"posts\":".concat(locStorage['de-posts'] || '{}'), "\"threads\":".concat(locStorage['de-threads'] || '{}')); return _context13.a(3, 10); case 9: nameDomain.push('You'); valDomain.push("\"myposts\":".concat(locStorage['de-myposts'] || '{}')); case 10: ++i; _context13.n = 1; break; case 11: if (valDomain = valDomain.join(',')) { val.push("\"".concat(aib.domain, "\":{").concat(valDomain, "}")); name.push("".concat(aib.domain, " (").concat(nameDomain.join('+'), ")")); } if (val = val.join(',')) { downloadBlob(new Blob(["{".concat(val, "}")], { type: 'application/json' }), "DE_".concat(d.getFullYear()).concat(pad2(d.getMonth() + 1)).concat(pad2(d.getDate()), "_").concat(pad2(d.getHours())).concat(pad2(d.getMinutes()), "_").concat(name.join('+'), ".json")); } e.preventDefault(); case 12: return _context13.a(2); } }, _callee12); })); return function (_x1) { return _ref0.apply(this, arguments); }; }(), true); }), $button(Lng.reset[lang] + '…', Lng.resetCfg[lang], function () { return $popup('cfg-reset', "".concat(Lng.resetData[lang], ":
") + "
".concat(aib.domain, ":").concat(_this16._getList([Lng.panelBtn.cfg[lang], Lng.hidPostThr[lang], Lng.myPosts[lang]]), "

") + "
".concat(Lng.allDomains[lang], ":").concat(_this16._getList([Lng.panelBtn.cfg[lang], Lng.panelBtn.fav[lang]]), "

")).append($button(Lng.clear[lang], '', function (e) { var els = $Q('input[type="checkbox"]', e.target.parentNode); for (var i = 1, len = els.length; i < len; ++i) { if (!els[i].checked) { continue; } switch (i) { case 1: locStorage.removeItem('de-posts'); locStorage.removeItem('de-threads'); break; case 2: locStorage.removeItem('de-myposts'); break; case 4: delStored('DESU_Favorites'); } } if (els[3].checked) { delStored('DESU_Config'); delStored('DESU_keys'); } else if (els[0].checked) { getStoredObj('DESU_Config').then(function (data) { delete data[aib.domain]; setStored('DESU_Config', JSON.stringify(data)); $popup('cfg-reset', Lng.updating[lang], true); deWindow.location.reload(); }); return; } $popup('cfg-reset', Lng.updating[lang], true); deWindow.location.reload(); })); })); }, handleEvent: function handleEvent(e) { var _this17 = this; return _asyncToGenerator(_regenerator().m(function _callee13() { var type, el, classList, tag, info, _info, isHide, post, _iterator3, _step3, _el4, _info2, _post4, img, _iterator4, _step4, _el5, perf, arr, i, len, _info3, isValidColor, color, image, val, _t12, _t13, _t14, _t15, _t16, _t17; return _regenerator().w(function (_context14) { while (1) switch (_context14.n) { case 0: type = e.type, el = e.target; classList = el.classList; tag = el.tagName.toLowerCase(); if (type === 'mouseover' && classList.contains('de-cfg-needreload') && !el.title) { el.title = Lng.cfgNeedReload[lang]; } if (!(type === 'click' && tag === 'div' && classList.contains('de-cfg-tab'))) { _context14.n = 1; break; } info = el.getAttribute('info'); _this17._clickTab(info); _context14.n = 1; return CfgSaver.save('cfgTab', info); case 1: if (!(type === 'change' && tag === 'select')) { _context14.n = 14; break; } _info = el.getAttribute('info'); _context14.n = 2; return CfgSaver.save(_info, el.selectedIndex); case 2: _this17._updateDependant(); _t12 = _info; _context14.n = _t12 === 'language' ? 3 : _t12 === 'delHiddPost' ? 4 : _t12 === 'postBtnsCSS' ? 5 : _t12 === 'thrBtns' ? 5 : _t12 === 'noSpoilers' ? 5 : _t12 === 'resizeImgs' ? 5 : _t12 === 'expandImgs' ? 6 : _t12 === 'imgNames' ? 7 : _t12 === 'fileInputs' ? 8 : _t12 === 'addPostForm' ? 9 : _t12 === 'addTextBtns' ? 10 : _t12 === 'scriptStyle' ? 11 : _t12 === 'panelCounter' ? 11 : _t12 === 'favThrOrder' ? 12 : 13; break; case 3: lang = el.selectedIndex; Panel.removeMain(); if (postform.form) { postform.addMarkupPanel(); postform.setPlaceholders(); aib.updateSubmitBtn(postform.subm); if (postform.files) { $Q('.de-file-img, .de-file-txt-input', postform.form).forEach(function (el) { return el.title = Lng.youCanDrag[lang]; }); } } _this17._updateCSS(); Panel.initPanel(DelForm.first.el); toggleWindow('cfg', false); return _context14.a(3, 13); case 4: isHide = Cfg.delHiddPost === 1 || Cfg.delHiddPost === 2; for (post = Thread.first.op; post; post = post.next) { if (post.isHidden && !post.isOp) { post.wrap.classList.toggle('de-hidden', isHide); } } updateCSS(); return _context14.a(3, 13); case 5: updateCSS(); return _context14.a(3, 13); case 6: updateCSS(); AttachedImage.closeImg(); return _context14.a(3, 13); case 7: if (Cfg.imgNames) { for (_iterator3 = _createForOfIteratorHelperLoose(DelForm); !(_step3 = _iterator3()).done;) { _el4 = _step3.value.el; processImgInfoLinks(_el4, 0, Cfg.imgNames); } } else { $Q('.de-img-name').forEach(function (el) { return el.textContent = el.getAttribute('de-img-name-old'); }); } updateCSS(); return _context14.a(3, 13); case 8: postform.files.changeMode(); postform.setPlaceholders(); updateCSS(); return _context14.a(3, 13); case 9: postform.isBottom = Cfg.addPostForm === 1; postform.setReply(false, !aib.t || Cfg.addPostForm > 1); return _context14.a(3, 13); case 10: postform.addMarkupPanel(); case 11: _this17._updateCSS(); return _context14.a(3, 13); case 12: readFavorites().then(function (favObj) { var winBody = $q('#de-win-fav > .de-win-body'); winBody.innerHTML = ''; showFavoritesWindow(winBody, favObj); }); case 13: return _context14.a(2); case 14: if (!(type === 'click' && tag === 'input' && el.type === 'checkbox')) { _context14.n = 43; break; } _info2 = el.getAttribute('info'); _context14.n = 15; return toggleCfg(_info2); case 15: _this17._updateDependant(); _t13 = _info2; _context14.n = _t13 === 'expandTrunc' ? 16 : _t13 === 'widePosts' ? 16 : _t13 === 'showHideBtn' ? 16 : _t13 === 'showRepBtn' ? 16 : _t13 === 'noPostNames' ? 16 : _t13 === 'imgNavBtns' ? 16 : _t13 === 'strikeHidd' ? 16 : _t13 === 'removeHidd' ? 16 : _t13 === 'noBoardRule' ? 16 : _t13 === 'favFolders' ? 16 : _t13 === 'userCSS' ? 16 : _t13 === 'hideBySpell' ? 17 : _t13 === 'sortSpells' ? 19 : _t13 === 'hideRefPsts' ? 21 : _t13 === 'ajaxUpdThr' ? 22 : _t13 === 'updCount' ? 23 : _t13 === 'desktNotif' ? 24 : _t13 === 'markNewPosts' ? 25 : _t13 === 'markMyPosts' ? 26 : _t13 === 'markMyLinks' ? 26 : _t13 === 'correctTime' ? 27 : _t13 === 'imgInfoLink' ? 29 : _t13 === 'imgSrcBtns' ? 30 : _t13 === 'addSageBtn' ? 31 : _t13 === 'txtBtnsLoc' ? 32 : _t13 === 'userPassw' ? 33 : _t13 === 'userName' ? 35 : _t13 === 'noPassword' ? 37 : _t13 === 'noName' ? 38 : _t13 === 'noSubj' ? 39 : _t13 === 'inftyScroll' ? 40 : _t13 === 'hotKeys' ? 41 : 42; break; case 16: updateCSS(); return _context14.a(3, 42); case 17: _context14.n = 18; return Spells.toggle(); case 18: return _context14.a(3, 42); case 19: if (!Cfg.sortSpells) { _context14.n = 20; break; } _context14.n = 20; return Spells.toggle(); case 20: return _context14.a(3, 42); case 21: for (_post4 = Thread.first.op; _post4; _post4 = _post4.next) { if (!Cfg.hideRefPsts) { _post4.ref.unhideRef(); } else if (_post4.isHidden) { _post4.ref.hideRef(); } } return _context14.a(3, 42); case 22: if (aib.t) { if (Cfg.ajaxUpdThr) { updater.enableUpdater(); } else { updater.disableUpdater(); } } return _context14.a(3, 42); case 23: updater.toggleCounter(Cfg.updCount); return _context14.a(3, 42); case 24: if (Cfg.desktNotif) { Notification.requestPermission(); } return _context14.a(3, 42); case 25: Post.clearMarks(); return _context14.a(3, 42); case 26: if (!Cfg.markMyPosts && !Cfg.markMyLinks) { locStorage.removeItem('de-myposts'); MyPosts.purge(); } updateCSS(); return _context14.a(3, 42); case 27: _context14.n = 28; return DateTime.toggleSettings(el); case 28: return _context14.a(3, 42); case 29: img = $q('.de-fullimg-wrap'); if (img) { img.click(); } updateCSS(); return _context14.a(3, 42); case 30: if (Cfg.imgSrcBtns) { for (_iterator4 = _createForOfIteratorHelperLoose(DelForm); !(_step4 = _iterator4()).done;) { _el5 = _step4.value.el; processImgInfoLinks(_el5, 1, 0); $Q('.de-img-embed').forEach(function (el) { return addImgButtons(el.parentNode.nextSibling.nextSibling); }); } } else { $delAll('.de-btn-img'); } return _context14.a(3, 42); case 31: PostForm.hideField(postform.mail.closest('label') || postform.mail); setTimeout(function () { return postform.toggleSage(); }, 0); updateCSS(); return _context14.a(3, 42); case 32: postform.addMarkupPanel(); updateCSS(); return _context14.a(3, 42); case 33: _context14.n = 34; return PostForm.setUserPassw(); case 34: return _context14.a(3, 42); case 35: _context14.n = 36; return PostForm.setUserName(); case 36: return _context14.a(3, 42); case 37: $toggle(postform.passw.closest(aib.qFormTr)); return _context14.a(3, 42); case 38: PostForm.hideField(postform.name); return _context14.a(3, 42); case 39: PostForm.hideField(postform.subj); return _context14.a(3, 42); case 40: Pages.toggleInfinityScroll(); return _context14.a(3, 42); case 41: if (Cfg.hotKeys) { HotKeys.enableHotKeys(); } else { HotKeys.disableHotKeys(); } case 42: return _context14.a(2); case 43: if (!(type === 'click' && tag === 'input' && el.type === 'button')) { _context14.n = 51; break; } _t14 = el.id; _context14.n = _t14 === 'de-cfg-button-pass' ? 44 : _t14 === 'de-cfg-button-keys' ? 46 : _t14 === 'de-cfg-button-updnow' ? 48 : _t14 === 'de-cfg-button-donate' ? 49 : _t14 === 'de-cfg-button-debug' ? 50 : 51; break; case 44: $q('input[info="passwValue"]').value = Math.round(Math.random() * 1e12).toString(32); _context14.n = 45; return PostForm.setUserPassw(); case 45: return _context14.a(3, 51); case 46: e.preventDefault(); if (!$id('de-popup-edit-hotkeys')) { _context14.n = 47; break; } return _context14.a(2); case 47: Promise.resolve(HotKeys.readKeys()).then(function (keys) { var temp = KeyEditListener.getEditMarkup(keys); var el = $popup('edit-hotkeys', temp[1]); var fn = new KeyEditListener(el, keys, temp[0]); ['focus', 'blur', 'click', 'keydown', 'keyup'].forEach(function (e) { return el.addEventListener(e, fn, true); }); }); return _context14.a(3, 51); case 48: $popup('updavail', Lng.loading[lang], true); getStoredObj('DESU_Config').then(function (data) { return checkForUpdates(true, data.lastUpd); }).then(function (html) { return $popup('updavail', html); }, Function.prototype); return _context14.a(3, 51); case 49: showDonateMsg(); return _context14.a(3, 51); case 50: perf = {}; arr = Logger.getLogData(true); for (i = 0, len = arr.length; i < len; ++i) { perf[arr[i][0]] = arr[i][1]; } $popup('cfg-debug', Lng.infoDebug[lang] + ':').lastChild.value = JSON.stringify({ version: version + '.' + commit, location: String(deWindow.location), nav: nav, Cfg: Cfg, sSpells: Spells.list.split('\n'), oSpells: sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')], perf: perf }, function (key, value) { switch (key) { case 'stats': case 'nameValue': case 'passwValue': case 'ytApiKey': return undefined; } return key in defaultCfg && value === defaultCfg[key] ? undefined : value; }, '\t'); case 51: if (!(type === 'keyup' && tag === 'input' && el.type === 'text')) { _context14.n = 81; break; } _info3 = el.getAttribute('info'); _t15 = _info3; _context14.n = _t15 === 'postBtnsBack' ? 52 : _t15 === 'limitPostMsg' ? 55 : _t15 === 'minImgSize' ? 57 : _t15 === 'maxImgSize' ? 59 : _t15 === 'zoomFactor' ? 61 : _t15 === 'webmVolume' ? 63 : _t15 === 'minWebmWidth' ? 65 : _t15 === 'maskVisib' ? 67 : _t15 === 'linksOver' ? 69 : _t15 === 'linksOut' ? 71 : _t15 === 'ytApiKey' ? 73 : _t15 === 'passwValue' ? 75 : _t15 === 'nameValue' ? 77 : 79; break; case 52: isValidColor = false; color = el.value; if (color === 'transparent') { isValidColor = true; } else if (color && color !== 'inherit' && color !== 'currentColor') { image = doc.createElement('img'); image.style.color = 'rgb(255, 255, 255)'; image.style.color = color; isValidColor = image.style.color !== 'rgb(255, 255, 255)'; } classList.toggle('de-input-error', !isValidColor); if (!isValidColor) { _context14.n = 54; break; } _context14.n = 53; return CfgSaver.save('postBtnsBack', el.value); case 53: updateCSS(); case 54: return _context14.a(3, 80); case 55: _context14.n = 56; return CfgSaver.save('limitPostMsg', Math.max(+el.value || 0, 50)); case 56: updateCSS(); return _context14.a(3, 80); case 57: _context14.n = 58; return CfgSaver.save('minImgSize', Math.min(Math.max(+el.value, 1)), Cfg.maxImgSize); case 58: return _context14.a(3, 80); case 59: _context14.n = 60; return CfgSaver.save('maxImgSize', Math.max(+el.value, Cfg.minImgSize)); case 60: return _context14.a(3, 80); case 61: _context14.n = 62; return CfgSaver.save('zoomFactor', Math.min(Math.max(+el.value, 1), 100)); case 62: return _context14.a(3, 80); case 63: val = Math.min(+el.value || 0, 100); _context14.n = 64; return CfgSaver.save('webmVolume', val); case 64: sendStorageEvent('__de-webmvolume', val); return _context14.a(3, 80); case 65: _context14.n = 66; return CfgSaver.save('minWebmWidth', Math.max(+el.value, Cfg.minImgSize)); case 66: return _context14.a(3, 80); case 67: _context14.n = 68; return CfgSaver.save('maskVisib', Math.min(+el.value || 0, 100)); case 68: updateCSS(); return _context14.a(3, 80); case 69: _context14.n = 70; return CfgSaver.save('linksOver', +el.value | 0); case 70: return _context14.a(3, 80); case 71: _context14.n = 72; return CfgSaver.save('linksOut', +el.value | 0); case 72: return _context14.a(3, 80); case 73: _context14.n = 74; return CfgSaver.save('ytApiKey', el.value.trim()); case 74: return _context14.a(3, 80); case 75: _context14.n = 76; return PostForm.setUserPassw(); case 76: return _context14.a(3, 80); case 77: _context14.n = 78; return PostForm.setUserName(); case 78: return _context14.a(3, 80); case 79: _context14.n = 80; return CfgSaver.save(_info3, el.value); case 80: return _context14.a(2); case 81: if (!(tag === 'a')) { _context14.n = 93; break; } if (!(el.id === 'de-btn-spell-add')) { _context14.n = 86; break; } _t16 = e.type; _context14.n = _t16 === 'click' ? 82 : _t16 === 'mouseover' ? 83 : _t16 === 'mouseout' ? 84 : 85; break; case 82: e.preventDefault(); return _context14.a(3, 85); case 83: el._menuTO = setTimeout(function () { return Menu.addMenu(el); }, Cfg.linksOver); return _context14.a(3, 85); case 84: clearTimeout(el._menuTO); case 85: return _context14.a(2); case 86: if (!(type === 'click')) { _context14.n = 92; break; } _t17 = el.id; _context14.n = _t17 === 'de-btn-spell-apply' ? 87 : _t17 === 'de-btn-spell-clear' ? 90 : 92; break; case 87: e.preventDefault(); _context14.n = 88; return CfgSaver.save('hideBySpell', 1); case 88: $q('input[info="hideBySpell"]').checked = true; _context14.n = 89; return Spells.toggle(); case 89: return _context14.a(3, 92); case 90: e.preventDefault(); if (confirm(Lng.clear[lang] + '?')) { _context14.n = 91; break; } return _context14.a(2); case 91: $id('de-spell-txt').value = ''; _context14.n = 92; return Spells.toggle(); case 92: return _context14.a(2); case 93: if (tag === 'textarea' && el.id === 'de-spell-txt' && (type === 'keydown' || type === 'scroll')) { _this17._updateRowMeter(el); } case 94: return _context14.a(2); } }, _callee13); }))(); }, _clickTab: function _clickTab(info) { var el = $q(".de-cfg-tab[info=\"".concat(info, "\"]")); if (el.hasAttribute('selected')) { return; } var prefTab = $q('.de-cfg-body'); if (prefTab) { prefTab.className = 'de-cfg-unvis'; $q('.de-cfg-tab[selected]').removeAttribute('selected'); } el.setAttribute('selected', ''); var id = el.getAttribute('info'); var newTab = $id('de-cfg-' + id); if (!newTab) { newTab = $aEnd($id('de-cfg-bar'), id === 'filters' ? this._getCfgFilters() : id === 'posts' ? this._getCfgPosts() : id === 'images' ? this._getCfgImages() : id === 'links' ? this._getCfgLinks() : id === 'form' ? this._getCfgForm() : id === 'common' ? this._getCfgCommon() : this._getCfgInfo()); if (id === 'filters') { this._updateRowMeter($id('de-spell-txt')); } if (id === 'common') { $q('input[info="userCSS"]').parentNode.after(getEditButton('css', function (fn) { return fn(Cfg.userCSSTxt, false, function () { var _ref1 = _asyncToGenerator(_regenerator().m(function _callee14(inputEl) { return _regenerator().w(function (_context15) { while (1) switch (_context15.n) { case 0: _context15.n = 1; return CfgSaver.save('userCSSTxt', inputEl.value); case 1: updateCSS(); toggleWindow('cfg', true); case 2: return _context15.a(2); } }, _callee14); })); return function (_x10) { return _ref1.apply(this, arguments); }; }()); }, 'de-cfg-button')); } } newTab.className = 'de-cfg-body'; if (id === 'filters') { $id('de-spell-txt').value = Spells.list; } this._updateDependant(); var els = $Q('.de-cfg-chkbox, .de-cfg-inptxt, .de-cfg-select', newTab.parentNode); for (var i = 0, len = els.length; i < len; ++i) { var _el6 = els[i]; var _info4 = _el6.getAttribute('info'); if (_el6.tagName.toLowerCase() === 'input') { if (_el6.type === 'checkbox') { _el6.checked = !!Cfg[_info4]; } else { _el6.value = Cfg[_info4]; } } else { _el6.selectedIndex = Cfg[_info4]; } } }, _getCfgFilters: function _getCfgFilters() { return "
\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t").concat(this._getBox('sortSpells'), "
\n\t\t\t").concat(this._getBox('hideRefPsts'), "
\n\t\t\t").concat(this._getBox('nextPageThr'), "
\n\t\t\t").concat(this._getSel('delHiddPost'), "\n\t\t
"); }, _getCfgPosts: function _getCfgPosts() { return "
\n\t\t\t".concat(localData ? '' : "".concat(this._getBox('ajaxUpdThr'), "\n\t\t\t\t").concat(this._getInp('updThrDelay'), "\n\t\t\t\t
\n\t\t\t\t\t").concat(this._getBox('updCount'), "
\n\t\t\t\t\t").concat(this._getBox('favIcoBlink'), "
\n\t\t\t\t\t").concat('Notification' in deWindow ? this._getBox('desktNotif') + '
' : '', "\n\t\t\t\t\t").concat(this._getBox('markNewPosts'), "\n\t\t\t\t
"), "\n\t\t\t").concat(this._getBox('markMyPosts'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('expandTrunc', true), "
") : '', "\n\t\t\t").concat(this._getBox('widePosts'), "
\n\t\t\t").concat(this._getInp('limitPostMsg', true, 5), "
\n\t\t\t").concat(this._getSel('showHideBtn'), "
\n\t\t\t").concat(!localData ? this._getSel('showRepBtn') : '', "
\n\t\t\t").concat(this._getSel('postBtnsCSS'), "\n\t\t\t").concat(this._getInp('postBtnsBack', false, 8), "
\n\t\t\t").concat(!localData ? this._getSel('thrBtns') : '', "
\n\t\t\t").concat(this._getSel('noSpoilers'), "
\n\t\t\t").concat(this._getBox('noPostNames'), "
\n\t\t\t").concat(this._getBox('correctTime', true), "\n\t\t\t").concat(this._getInp('timeOffset', true, 1), "\n\t\t\t[?]\n\t\t\t
\n\t\t\t\t").concat(this._getInp('timePattern', true, 24), "
\n\t\t\t\t").concat(this._getInp('timeRPattern', true, 24), "\n\t\t\t
\n\t\t
"); }, _getCfgImages: function _getCfgImages() { return "
\n\t\t\t".concat(this._getSel('expandImgs'), "
\n\t\t\t
\n\t\t\t\t").concat(this._getBox('imgNavBtns'), "
\n\t\t\t\t").concat(this._getBox('imgInfoLink'), "
\n\t\t\t\t").concat(this._getSel('resizeImgs'), "
\n\t\t\t\t").concat(Post.sizing.dPxRatio > 1 ? this._getBox('resizeDPI') + '
' : '', "\n\t\t\t\t").concat(this._getInp('minImgSize')).concat(this._getInp('maxImgSize'), "
\n\t\t\t\t").concat(!nav.isMobile ? this._getInp('zoomFactor') : '', "
\n\t\t\t\t").concat(this._getBox('webmControl'), "
\n\t\t\t\t").concat(this._getBox('webmTitles'), "
\n\t\t\t\t").concat(this._getInp('webmVolume'), "
\n\t\t\t\t").concat(this._getInp('minWebmWidth'), "\n\t\t\t
\n\t\t\t").concat(this._getSel('preLoadImgs', true) + '
', "\n\t\t\t").concat(aib._4chan ? '' : "
".concat(this._getBox('findImgFile', true), "
"), "\n\t\t\t").concat(this._getSel('openImgs', true), "
\n\t\t\t").concat(this._getBox('imgSrcBtns'), "
\n\t\t\t").concat(this._getSel('imgNames'), "
\n\t\t\t").concat(this._getInp('maskVisib'), "\n\t\t
"); }, _getCfgLinks: function _getCfgLinks() { return "
\n\t\t\t".concat(this._getBox('linksNavig', true), "\n\t\t\t
\n\t\t\t\t").concat(this._getInp('linksOver'), "\n\t\t\t\t").concat(this._getInp('linksOut'), "
\n\t\t\t\t").concat(this._getBox('markViewed'), "
\n\t\t\t\t").concat(this._getBox('strikeHidd'), "\n\t\t\t\t
").concat(this._getBox('removeHidd'), "
\n\t\t\t\t").concat(this._getBox('noNavigHidd'), "\n\t\t\t
\n\t\t\t").concat(this._getBox('markMyLinks'), "
\n\t\t\t").concat(this._getBox('crossLinks', true), "
\n\t\t\t").concat(this._getBox('decodeLinks', true), "
\n\t\t\t").concat(this._getBox('insertNum'), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('addOPLink'), "
\n\t\t\t\t").concat(this._getBox('addImgs', true), "
") : '', "\n\t\t\t
\n\t\t\t\t").concat(this._getBox('addMP3', true), "\n\t\t\t\t").concat(this._getBox('addVocaroo', true), "\n\t\t\t
\n\t\t\t").concat(this._getSel('embedYTube', true), "\n\t\t\t
\n\t\t\t\t").concat(this._getInp('YTubeWidth', false), "\xD7\n\t\t\t\t").concat(this._getInp('YTubeHeigh', false), "(px)
\n\t\t\t\t").concat(this._getBox('YTubeTitles', true), "
\n\t\t\t\t").concat(this._getInp('ytApiKey', true, 25), "
\n\t\t\t\t").concat(this._getBox('addVimeo', true), "\n\t\t\t
\n\t\t
"); }, _getCfgForm: function _getCfgForm() { return "
\n\t\t\t".concat(this._getBox('ajaxPosting', true), "
\n\t\t\t").concat(postform.form ? "
\n\t\t\t\t".concat(this._getBox('postSameImg'), "
\n\t\t\t\t").concat(this._getBox('removeEXIF'), "
\n\t\t\t\t").concat(this._getSel('removeFName'), "
\n\t\t\t\t").concat(this._getBox('sendErrNotif'), "
\n\t\t\t\t").concat(this._getBox('scrAfterRep'), "
\n\t\t\t\t").concat(postform.files ? this._getSel('fileInputs') : '', "\n\t\t\t
") : '', "\n\t\t\t").concat(postform.form ? this._getSel('addPostForm') + '
' : '', "\n\t\t\t").concat(postform.txta ? this._getBox('spacedQuote') + '
' : '', "\n\t\t\t").concat(this._getBox('favOnReply'), "
\n\t\t\t").concat(postform.subj ? this._getBox('warnSubjTrip') + '
' : '', "\n\t\t\t").concat(postform.mail ? "".concat(this._getBox('addSageBtn'), "\n\t\t\t\t").concat(this._getBox('saveSage'), "
") : '', "\n\t\t\t").concat(postform.captcha ? "".concat(!aib.noCapUpdTime && this._getInp('capUpdTime', true, 4), "
\n\t\t\t\t").concat(this._getSel('captchaLang'), "
") : '', "\n\t\t\t").concat(!aib.noMarkupBtns && postform.txta ? "".concat(this._getSel('addTextBtns'), "\n\t\t\t\t").concat(!aib.noMarkupBtns && !aib._4chan ? this._getBox('txtBtnsLoc') : '', "
") : '', "\n\t\t\t").concat(postform.passw ? "".concat(this._getInp('passwValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userPassw'), "
") : '', "\n\t\t\t").concat(postform.name ? "".concat(this._getInp('nameValue', false, 9), "\n\t\t\t\t").concat(this._getBox('userName'), "
") : '', "\n\t\t\t").concat(postform.rules || postform.passw || postform.name ? Lng.hide[lang] + (postform.rules ? this._getBox('noBoardRule') : '') + (postform.passw ? this._getBox('noPassword') : '') + (postform.name ? this._getBox('noName') : '') + (postform.subj ? this._getBox('noSubj') : '') : '', "\n\t\t
"); }, _getCfgCommon: function _getCfgCommon() { return "
\n\t\t\t".concat(this._getSel('scriptStyle'), "
\n\t\t\t").concat(this._getBox('userCSS'), "\n\t\t\t[?]
\n\t\t\t").concat('animation' in doc.body.style ? this._getBox('animation') + '
' : '', "\n\t\t\t").concat(this._getBox('hotKeys'), "\n\t\t\t\n\t\t\t
").concat(this._getInp('loadPages'), "
\n\t\t\t").concat(this._getSel('panelCounter'), "
\n\t\t\t").concat(this._getBox('rePageTitle', true), "
\n\t\t\t").concat(!localData ? "".concat(this._getBox('inftyScroll'), "
\n\t\t\t\t").concat(this._getBox('hideReplies', true), "
\n\t\t\t\t").concat(this._getBox('scrollToTop'), "
") : '', "\n\t\t\t").concat(this._getBox('saveScroll'), "
\n\t\t\t").concat(this._getBox('favFolders'), "
\n\t\t\t").concat(this._getSel('favThrOrder'), "
\n\t\t\t").concat(this._getBox('favWinOn'), "
\n\t\t\t").concat(this._getBox('closePopups'), "\n\t\t
"); }, _getCfgInfo: function _getCfgInfo() { var statsTable = this._getInfoTable([[Lng.thrViewed[lang], Cfg.stats.view], [Lng.thrCreated[lang], Cfg.stats.op], [Lng.thrHidden[lang], HiddenThreads.getCount()], [Lng.postsSent[lang], Cfg.stats.reply]], false); return "
\n\t\t\t
\n\t\t\t\tv").concat(version, ".").concat(commit) + "".concat(nav.isESNext ? '.es6' : '', " |\n\t\t\t\tHomepage |\n\t\t\t\tGithub |\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t
").concat(statsTable, "
\n\t\t\t\t
").concat(this._getInfoTable(Logger.getLogData(false), true), "
\n\t\t\t
\n\t\t\t").concat(!nav.hasWebStorage && !localData || nav.hasGMXHR ? "\n\t\t\t\t".concat(this._getSel('updDollchan'), "\n\t\t\t\t
>>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t<<
") : "
>>\n\t\t\t\t\t\n\t\t\t\t<<
", "\n\t\t
"); }, _getBox: function _getBox(id, needReload) { return ""); }, _getInfoTable: function _getInfoTable(data, needMs) { return data.map(function (val) { return "
\n\t\t".concat(val[0], "\n\t\t").concat(val[1] + (needMs ? 'ms' : ''), "
"); }).join(''); }, _getInp: function _getInp(id) { var addText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3; var el = doc.createElement('div'); el.append(Cfg[id]); return ""); }, _getList: function _getList(arr) { return arrTags(arr, ''); }, _getSel: function _getSel(id, needReload) { return ""); }, _getTab: function _getTab(id) { return "
").concat(Lng.cfgTab[id][lang], "
"); }, _toggleDependant: function _toggleDependant(state, arr) { var i = arr.length; var nState = !state; while (i--) { var el = $q(arr[i]); if (el) { el.disabled = nState; } } }, _updateCSS: function _updateCSS() { $delAll('#de-css, #de-css-dynamic, #de-css-user', doc.head); scriptCSS(); }, _updateDependant: function _updateDependant() { var fn = this._toggleDependant; fn(Cfg.ajaxUpdThr, ['input[info="updThrDelay"]', 'input[info="updCount"]', 'input[info="favIcoBlink"]', 'input[info="markNewPosts"]', 'input[info="desktNotif"]']); fn(Cfg.postBtnsCSS === 2, ['input[info="postBtnsBack"]']); fn(Cfg.expandImgs, ['input[info="imgNavBtns"]', 'input[info="imgInfoLink"]', 'input[info="resizeDPI"]', 'select[info="resizeImgs"]', 'input[info="minImgSize"]', 'input[info="maxImgSize"]', 'input[info="zoomFactor"]', 'input[info="webmControl"]', 'input[info="webmTitles"]', 'input[info="webmVolume"]', 'input[info="minWebmWidth"]']); fn(Cfg.preLoadImgs, ['input[info="findImgFile"]']); fn(Cfg.linksNavig, ['input[info="linksOver"]', 'input[info="linksOut"]', 'input[info="markViewed"]', 'input[info="strikeHidd"]', 'input[info="noNavigHidd"]']); fn(Cfg.strikeHidd && Cfg.linksNavig, ['input[info="removeHidd"]']); fn(Cfg.embedYTube, ['input[info="YTubeWidth"]', 'input[info="YTubeHeigh"]', 'input[info="YTubeTitles"]', 'input[info="ytApiKey"]', 'input[info="addVimeo"]']); fn(Cfg.YTubeTitles, ['input[info="ytApiKey"]']); fn(Cfg.ajaxPosting, ['input[info="postSameImg"]', 'input[info="removeEXIF"]', 'select[info="removeFName"]', 'input[info="sendErrNotif"]', 'input[info="scrAfterRep"]', 'select[info="fileInputs"]']); fn(Cfg.addSageBtn, ['input[info="saveSage"]']); fn(Cfg.addTextBtns, ['input[info="txtBtnsLoc"]']); fn(Cfg.hotKeys, ['input[info="loadPages"]']); }, _updateRowMeter: function _updateRowMeter(node) { var top = node.scrollTop; var el = node.previousElementSibling; var num = el.numLines || 1; var i = 19; if (num - i < (top / 12 | 0 + 1)) { var str = ''; while (i--) { str += "".concat(num++, "
"); } el.insertAdjacentHTML('beforeend', str); el.numLines = num; } el.scrollTop = top; } }; function closePopup(data) { var el = typeof data === 'string' ? $id('de-popup-' + data) : data; if (el) { el.closeTimeout = null; if (Cfg.animation) { $animate(el, 'de-close', true); } else { el.remove(); } } } function $popup(id, txt) { var isWait = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var el = $id('de-popup-' + id); var html = "".concat(isWait ? '' : "\u2716 ", "").concat(txt.trim()); if (el) { el.innerHTML = html; if (!isWait && Cfg.animation) { $animate(el, 'de-blink'); } } else { el = $bEnd($id('de-wrapper-popup'), "
").concat(html, "
")); el.onclick = function (e) { var el = e.target; el = el.tagName.toLowerCase() === 'svg' ? el.parentNode : el; if (el.className === 'de-popup-btn') { closePopup(el.parentNode); } }; if (Cfg.animation) { $animate(el, 'de-open'); } } if (Cfg.closePopups && !isWait && !id.includes('edit') && !id.includes('cfg')) { el.closeTimeout = setTimeout(closePopup, 6e3, el); } return el; } function getEditButton(name, getDataFn) { var className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'de-button'; return $button(Lng.edit[lang], Lng.editInTxt[lang], function () { return getDataFn(function (val, isJSON, saveFn) { var el = $popup('edit-' + name, "".concat(Lng.editor[name][lang], "")); var inputEl = el.lastChild; inputEl.value = isJSON ? JSON.stringify(val, null, '\t') : val; el.append($button(Lng.save[lang], Lng.saveChanges[lang], !isJSON ? function () { return saveFn(inputEl); } : function () { var data; try { data = JSON.parse(inputEl.value.trim().replace(/[\n\r\t]/g, '') || '{}'); } catch (err) {} if (!data) { $popup('err-invaliddata', Lng.invalidData[lang]); return; } saveFn(data); closePopup('edit-' + name); closePopup('err-invaliddata'); })); }); }, className); } var Menu = function () { function Menu(parentEl, html, clickFn) { var _this18 = this; var isFixed = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; _classCallCheck(this, Menu); this.onout = null; this.onover = null; this.onremove = null; this._closeTO = 0; var el = $bEnd(doc.body, "
").concat(html, "
")); var cr = parentEl.getBoundingClientRect(); var style = el.style, w = el.offsetWidth, h = el.offsetHeight; this.el = el; style.left = (isFixed ? 0 : deWindow.pageXOffset) + (cr.left + w < Post.sizing.wWidth || w > .8 * Post.sizing.wWidth ? cr.left : cr.right - w) + 'px'; style.top = (isFixed ? 0 : deWindow.pageYOffset) + (cr.bottom + h < Post.sizing.wHeight ? cr.bottom - 0.5 : cr.top - h + 0.5) + 'px'; style.removeProperty('visibility'); this._clickFn = clickFn; this.parentEl = parentEl; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this18, true); }); el.addEventListener('click', this); parentEl.addEventListener('mouseout', this); } return _createClass(Menu, [{ key: "handleEvent", value: function handleEvent(e) { var _this19 = this; var isOverEvent = false; switch (e.type) { case 'click': if (e.target.classList.contains('de-menu-item')) { this.removeMenu(); this._clickFn(e.target, e); if (!Cfg.expandPanel && !$q('.de-win-active')) { $hide($id('de-panel-buttons')); } } break; case 'mouseover': isOverEvent = true; case 'mouseout': { clearTimeout(this._closeTO); var targetEl = e.relatedTarget; if (!$contains(this.el, targetEl)) { if (isOverEvent) { var _this$onover; (_this$onover = this.onover) === null || _this$onover === void 0 || _this$onover.call(this); } else if (!$contains(this.parentEl, targetEl)) { var _this$onout; this._closeTO = setTimeout(function () { return _this19.removeMenu(); }, 75); (_this$onout = this.onout) === null || _this$onout === void 0 || _this$onout.call(this); } } } } } }, { key: "removeMenu", value: function removeMenu() { var _this$onremove, _this20 = this; if (!this.el) { return; } (_this$onremove = this.onremove) === null || _this$onremove === void 0 || _this$onremove.call(this); ['mouseover', 'mouseout'].forEach(function (e) { return _this20.el.removeEventListener(e, _this20, true); }); this.parentEl.removeEventListener('mouseout', this); this.el.removeEventListener('click', this); this.el.remove(); this.el = null; } }], [{ key: "addMenu", value: function addMenu(el) { var tags = function tags(a) { return arrTags(a, '', ''); }; switch (el.id) { case 'de-btn-spell-add': return new Menu(el, "
".concat(tags('#all,#exp,#exph,#ihash,#img,#imgn,#name,#num,#op,#sage'.split(',')), "
").concat(tags('#subj,#tlen,#trip,#uid,#vauthor,#video,#wipe,#words,#rep,#outrep'.split(',')), "
"), function (_ref10) { var s = _ref10.textContent; return insertText($id('de-spell-txt'), s + (!aib.t || s === '#op' || s === '#rep' || s === '#outrep' ? '' : "[".concat(aib.b, ",").concat(aib.t, "]")) + (Spells.needArg[Spells.names.indexOf(s.substr(1))] ? '(' : '')); }); case 'de-panel-refresh': return new Menu(el, tags(Lng.selAjaxPages[lang]), function (el) { return Pages.loadPages(Array.prototype.indexOf.call(el.parentNode.children, el) + 1); }); case 'de-panel-savethr': return new Menu(el, tags($q(aib.qPostImg, DelForm.first.el) ? Lng.selSaveThr[lang] : [Lng.selSaveThr[lang][0]]), function (el) { if ($id('de-popup-savethr')) { return; } var imgOnly = !!Array.prototype.indexOf.call(el.parentNode.children, el); if (ContentLoader.isLoading) { $popup('savethr', Lng.loading[lang], true); ContentLoader.afterFn = function () { return ContentLoader.downloadThread(imgOnly); }; ContentLoader.popupId = 'savethr'; } else { ContentLoader.downloadThread(imgOnly); } }); case 'de-panel-audio-off': return new Menu(el, tags(Lng.selAudioNotif[lang]), function (el) { updater.enableUpdater(); updater.toggleAudio([3e4, 6e4, 12e4, 3e5][Array.prototype.indexOf.call(el.parentNode.children, el)]); $id('de-panel-audio-off').id = 'de-panel-audio-on'; }); } } }, { key: "getMenuImg", value: function getMenuImg(data) { var isDlOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var p; var dlLinks = ''; if (typeof data === 'string') { p = encodeURIComponent(data) + '" target="_blank">' + Lng.frameSearch[lang]; } else { var _$q2; var link = data.nextSibling; var href = link.href; var origSrc = link.getAttribute('de-href') || href; p = encodeURIComponent(origSrc) + '" target="_blank">' + Lng.searchIn[lang]; var getDlLnk = function getDlLnk(href, name, title, isAddExt) { var ext; if (isAddExt) { ext = getFileExt(href); name += '.' + ext; } else { ext = getFileExt(name); } var nameShort = name; if (name.length > 20) { nameShort = name.substr(0, 20 - ext.length) + "\u2026" + ext; } var info = aib.domain !== href.match(/^(?:(?:blob:)?https?:\/\/)([^/]+)/)[1] ? ' info="img-load"' : ''; return "").concat(Lng.saveAs[lang], " "").concat(nameShort, """); }; var name = decodeURIComponent(getFileName(origSrc)); var isFullImg = link.classList.contains('de-fullimg-link'); var realName = isFullImg ? link.textContent : link.classList.contains('de-img-name') ? aib.getImgRealName(aib.getImgWrap(data)) : name; if (name !== realName) { dlLinks += getDlLnk(href, realName, Lng.origName[lang], false); } var webmTitle; if (isFullImg && (webmTitle = (_$q2 = $q('.de-webm-title', link.parentNode)) === null || _$q2 === void 0 ? void 0 : _$q2.textContent)) { dlLinks += getDlLnk(href, webmTitle, Lng.metaName[lang], true); } dlLinks += getDlLnk(href, name, Lng.boardName[lang], false); } if (aib.kohlchan) { p = p.replace('kohlchanagb7ih5g.onion', 'kohlchan.net').replace('kohlchanvwpfx6hthoti5fvqsjxgcwm3tmddvpduph5fqntv5affzfqd.onion', 'kohlchan.net'); } return dlLinks + (isDlOnly ? '' : arrTags(["de-src-google\" href=\"https://www.google.com/searchbyimage?sbisrc=dollchan&safe=off&image_url=".concat(p, "Google"), "de-src-google\" href=\"https://lens.google.com/uploadbyurl?url=".concat(p, "Google Lens"), "de-src-yandex\" href=\"https://yandex.com/images/search?rpt=imageview&url=".concat(p, "Yandex"), "de-src-tineye\" href=\"https://tineye.com/search/?url=".concat(p, "TinEye"), "de-src-saucenao\" href=\"https://saucenao.com/search.php?url=".concat(p, "SauceNAO"), "de-src-iqdb\" href=\"https://iqdb.org/?url=".concat(p, "IQDB"), "de-src-tracemoe\" href=\"https://trace.moe/?auto&url=".concat(p, "TraceMoe")], '").concat(url, "
").concat(Lng.willSavePview[lang]); $popup('err-files', Lng.loadErrors[lang] + warnings); if (imgOnly) { return _this23.getDataFromImg(img).then(function (data) { return tar.addFile(thumbName, data); }, Function.prototype); } } return imgOnly ? null : _this23.getDataFromImg(img).then(function (data) { return tar.addFile(img.src = thumbName, data); }, function () { return img.src = safeName; }); } else if (fileData !== null && fileData !== void 0 && fileData.length) { tar.addFile(img.href = img.src = 'data/' + safeName, fileData); } else { img.remove(); } }); }, _asyncToGenerator(_regenerator().m(function _callee16() { var docName, docBody, dt, html, title, _t18, _t19; return _regenerator().w(function (_context17) { while (1) switch (_context17.n) { case 0: docName = "".concat(aib.domain, "-").concat(delSymbols(aib.b), "-").concat(aib.t); if (imgOnly) { _context17.n = 4; break; } $q('head', dc).insertAdjacentHTML('beforeend', ''); docBody = $q('body', dc); docBody.classList.remove('de-runned-inpage', 'de-runned-userscript'); docBody.classList.add('de-runned-local'); $delAll('#de-css, #de-css-dynamic, #de-css-user', dc); tar.addString('data/dollscript.js', "".concat(nav.isESNext ? "(".concat(String(deMainFuncInner), ")(window, null, (x, y) => window.scrollTo(x, y), ") : "(".concat(String(deMainFuncOuter), ")(")).concat(JSON.stringify({ domain: aib.domain, b: aib.b, t: aib.t }), ");")); dt = doc.doctype; html = dc.outerHTML; if (!aib._4chan) { _context17.n = 3; break; } html = html.replace('', ""); _t18 = tar; _context17.n = 1; return _this23.loadFileData('//s.4cdn.org/image/flags.8.png', false); case 1: _t18.addFile.call(_t18, 'data/flags-country.png', _context17.v); if (!(aib.b === 'pol')) { _context17.n = 3; break; } _t19 = tar; _context17.n = 2; return _this23.loadFileData('//s.4cdn.org/image/flags/pol/flags.png?2', false); case 2: _t19.addFile.call(_t19, 'data/flags-pol.png', _context17.v); case 3: tar.addString(docName + '.html', "").concat(html)); case 4: title = delSymbols(Thread.first.op.title.trim()); downloadBlob(tar.get(), "".concat(docName).concat(imgOnly ? '-images' : '').concat(title ? ' - ' + title : '', ".tar")); closePopup('load-files'); _this23._thrPool = tar = warnings = count = current = imgOnly = progress = counter = null; case 5: return _context17.a(2); } }, _callee16); }))); els.forEach(function (el) { var parentLink = el.closest('a'); if (parentLink) { var url = parentLink.href; _this23._thrPool.runTask([url, parentLink.getAttribute('download') || getFileName(url), el, parentLink]); } }); if (!imgOnly) { $delAll('.de-btn-img, #de-main, .de-parea, .de-post-btns, .de-refmap, .de-thr-buttons, ' + '.de-video-obj, #de-win-reply, link[rel="alternate stylesheet"], script, ' + aib.qForm, dc); $Q('a', dc).forEach(function (el) { var num; var tc = el.textContent; if (tc[0] === '>' && tc[1] === '>' && (num = parseInt(tc.substr(2), 10)) && pByNum.has(num)) { el.href = aib.anchor + num; if (!el.classList.contains('de-link-postref')) { el.className = 'de-link-postref ' + el.className; } } else { el.href = aib.getAbsLink(el.href); } }); $Q(aib.qPost, dc).forEach(function (el, i) { return el.setAttribute('de-num', i ? aib.getPNum(el) : aib.t); }); var files = []; var urlRegex = new RegExp("^\\/\\/?|^https?:\\/\\/([^\\/]*\\.)?".concat(escapeRegExp(aib._4chan ? '4cdn.org' : aib.domain), "\\/"), 'i'); $Q('link, *[src]', dc).forEach(function (el) { if (els.indexOf(el) !== -1) { return; } var url = el.tagName.toLowerCase() === 'link' ? el.href : el.src; if (!urlRegex.test(url)) { el.remove(); return; } var fName = delSymbols(getFileName(url).replace(/(#|\?).*?$/, ''), '_').toLowerCase(); if (files.indexOf(fName) !== -1) { var temp = url.lastIndexOf('.'); var ext = url.substring(temp); url = url.substring(0, temp); fName = cutFileExt(fName); for (var i = 0;; ++i) { temp = "".concat(fName, "(").concat(i, ")").concat(ext); if (files.indexOf(temp) === -1) { break; } } fName = temp; } files.push(fName); _this23._thrPool.runTask([url, fName, el, null]); count++; }); } $popup('load-files', "".concat(imgOnly ? Lng.loadImage[lang] : Lng.loadFile[lang], ":
1/").concat(count), true); progress = $id('de-loadprogress'); counter = progress.nextElementSibling; this._thrPool.completeTasks(); els = null; }, getDataFromCanvas: function getDataFromCanvas(el) { return new Uint8Array(atob(el.toDataURL('image/png').split(',')[1]).split('').map(function (a) { return a.charCodeAt(); })); }, getDataFromImg: function getDataFromImg(el) { if (el.getAttribute('loading') === 'lazy') { return this.loadFileData(el.src); } try { var cnv = this._canvas || (this._canvas = doc.createElement('canvas')); cnv.width = el.width || el.videoWidth; cnv.height = el.height || el.videoHeight; cnv.getContext('2d').drawImage(el, 0, 0); return Promise.resolve(this.getDataFromCanvas(cnv)); } catch (err) { return this.loadFileData(el.src); } }, loadFileData: function loadFileData(url) { var repeatOnError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; return $ajax(url, { responseType: 'arraybuffer' }, !url.startsWith('blob')).then(function (xhr) { if ('response' in xhr) { try { return nav.unsafeUint8Array(xhr.response); } catch (err) {} } var txt = xhr.responseText; return new Uint8Array(txt.length).map(function (val, i) { return txt.charCodeAt(i) & 0xFF; }); }, function (err) { return err.code !== 404 && repeatOnError ? _this24.loadFileData(url, false) : null; }); }, preloadImages: function preloadImages(data) { var _this25 = this; if (!Cfg.preLoadImgs && !Cfg.openImgs && !isPreImg) { return; } var preloadPool; var isPost = data instanceof AbstractPost; var els = $Q(aib.qPostImg, isPost ? data.el : data); var len = els.length; if (isPreImg || Cfg.preLoadImgs) { var cImg = 1; var mReqs = isPost ? 1 : 4; var rarJpgFinder = (isPreImg || Cfg.findImgFile) && new WorkerPool(mReqs, this._detectImgFile, function (err) { return console.error('File detector error:', "line: ".concat(err.lineno, " - ").concat(err.message)); }); preloadPool = new TasksPool(mReqs, function (num, data) { return _this25.loadFileData(data[0]).then(function (fileData) { var _data4 = _slicedToArray(data, 6), url = _data4[0], parentLink = _data4[1], iType = _data4[2], isRepToOrig = _data4[3], img = _data4[4], isVideo = _data4[5]; if (fileData) { var fName = decodeURIComponent(getFileName(url)); var nameLink = aib.getImgNameLink(img); parentLink.setAttribute('download', fName); if (!Cfg.imgNames) { nameLink.setAttribute('download', fName); nameLink.setAttribute('de-href', nameLink.href); } parentLink.href = nameLink.href = deWindow.URL.createObjectURL(new Blob([fileData], { type: iType })); if (isVideo) { img.setAttribute('de-video', ''); } if (isRepToOrig) { img.src = parentLink.href; } if (rarJpgFinder) { rarJpgFinder.runWorker(fileData.buffer, [fileData.buffer], function (info) { return _this25._addImgFileIcon(nameLink, fName, info); }); } } if (_this25.popupId) { $popup(_this25.popupId, "".concat(Lng.loadImage[lang], ": ").concat(cImg, "/").concat(len), true); } cImg++; }); }, function () { _this25.isLoading = false; if (_this25.afterFn) { _this25.afterFn(); _this25.afterFn = _this25.popupId = null; } if (rarJpgFinder) { rarJpgFinder.clearWorkers(); } }); this.isLoading = true; } for (var i = 0; i < len; ++i) { var imgEl = els[i]; var parentLink = imgEl.closest('a'); if (!parentLink) { continue; } var isRepToOrig = !!Cfg.openImgs; var url = aib.getImgSrcLink(imgEl).getAttribute('href'); var type = getFileMime(url); var isVideo = type && (type === 'video/webm' || type === 'video/mp4' || type === 'video/quicktime' || type === 'video/ogv'); if (!type || isVideo && Cfg.preLoadImgs === 2) { continue; } else if ($q('img[src*="/spoiler"]', parentLink)) { isRepToOrig = false; } else if (type === 'image/gif') { isRepToOrig &= Cfg.openImgs !== 3; } else { if (isVideo) { isRepToOrig = false; } isRepToOrig &= Cfg.openImgs !== 2; } if (preloadPool) { preloadPool.runTask([url, parentLink, type, isRepToOrig, imgEl, isVideo]); } else if (isRepToOrig) { imgEl.src = url; } } if (preloadPool) { preloadPool.completeTasks(); } }, _canvas: null, _thrPool: null, _addImgFileIcon: function _addImgFileIcon(nameLink, fName, info) { var type = info.type; if (typeof type === 'undefined') { return; } var ext = ['7z', 'zip', 'rar', 'ogg', 'mp3'][type]; nameLink.insertAdjacentHTML('afterend', " 2 ? 'audio' : 'arch', "\" title=\"").concat(Lng.downloadFile[lang], "\" download=\"").concat(cutFileExt(fName), ".").concat(ext, "\">.").concat(ext, "")); }, _detectImgFile: function _detectImgFile(arrBuf) { var i, j; var dat = new Uint8Array(arrBuf); var len = dat.length; if (dat[0] === 0xFF && dat[1] === 0xD8) { for (i = 0, j = 0; i < len - 1; ++i) { if (dat[i] === 0xFF) { if (dat[i + 1] === 0xD8) { j++; } else if (dat[i + 1] === 0xD9 && --j === 0) { i += 2; break; } } } } else if (dat[0] === 0x89 && dat[1] === 0x50) { for (i = 0; i < len - 7; ++i) { if (dat[i] === 0x49 && dat[i + 1] === 0x45 && dat[i + 2] === 0x4E && dat[i + 3] === 0x44) { i += 8; break; } } } else { return {}; } if (i === len || len - i <= 60) { return {}; } for (len = i + 90; i < len; ++i) { if (dat[i] === 0x37 && dat[i + 1] === 0x7A && dat[i + 2] === 0xBC) { return { type: 0, idx: i, data: arrBuf }; } else if (dat[i] === 0x50 && dat[i + 1] === 0x4B && dat[i + 2] === 0x03) { return { type: 1, idx: i, data: arrBuf }; } else if (dat[i] === 0x52 && dat[i + 1] === 0x61 && dat[i + 2] === 0x72) { return { type: 2, idx: i, data: arrBuf }; } else if (dat[i] === 0x4F && dat[i + 1] === 0x67 && dat[i + 2] === 0x67) { return { type: 3, idx: i, data: arrBuf }; } else if (dat[i] === 0x49 && dat[i + 1] === 0x44 && dat[i + 2] === 0x33) { return { type: 4, idx: i, data: arrBuf }; } } return {}; } }; var DateTime = function () { function DateTime(pattern, rPattern, diff, dtLang, onRPat) { _classCallCheck(this, DateTime); this.pad2 = pad2; this.genDateTime = null; this.onRPat = null; if (DateTime.checkPattern(pattern)) { this.disabled = true; return; } this.regex = pattern.replace(/(?:[sihdny]\?){2,}/g, function (str) { return "(?:".concat(str.replace(/\?/g, ''), ")?"); }).replace(/-/g, '[^<]').replace(/\+/g, '[^0-9<]').replace(/([sihdny]+)/g, '($1)').replace(/[sihdny]/g, '\\d').replace(/m|w/g, '([a-zA-Zа-яА-Я]+)'); this.pattern = pattern.replace(/[?\-+]+/g, '').replace(/([a-z])\1+/g, '$1'); this.diff = parseInt(diff, 10); this.arrW = Lng.week[dtLang]; this.arrM = Lng.month[dtLang]; this.arrFM = Lng.fullMonth[dtLang]; if (rPattern) { this.genDateTime = this.genRFunc(rPattern); } else { this.onRPat = onRPat; } } return _createClass(DateTime, [{ key: "genRFunc", value: function genRFunc(rPattern) { var _this26 = this; return function (dtime) { return rPattern.replace('_o', (_this26.diff < 0 ? '' : '+') + _this26.diff).replace('_s', function () { return _this26.pad2(dtime.getSeconds()); }).replace('_i', function () { return _this26.pad2(dtime.getMinutes()); }).replace('_h', function () { return _this26.pad2(dtime.getHours()); }).replace('_d', function () { return _this26.pad2(dtime.getDate()); }).replace('_w', function () { return _this26.arrW[dtime.getDay()]; }).replace('_n', function () { return _this26.pad2(dtime.getMonth() + 1); }).replace('_m', function () { return _this26.arrM[dtime.getMonth()]; }).replace('_M', function () { return _this26.arrFM[dtime.getMonth()]; }).replace('_y', function () { return ('' + dtime.getFullYear()).substring(2); }).replace('_Y', function () { return dtime.getFullYear(); }); }; } }, { key: "getRPattern", value: function getRPattern(txt) { var _this$onRPat; var m = txt.match(new RegExp(this.regex)); if (!m) { this.disabled = true; return false; } var rPattern = ''; for (var i = 1, len = m.length, j = 0, str = m[0]; i < len;) { var a = m[i++]; if (!a) { continue; } var p = this.pattern[i - 2]; if ((p === 'm' || p === 'y') && a.length > 3) { p = p.toUpperCase(); } var k = str.indexOf(a, j); rPattern += str.substring(j, k) + '_' + p; j = k + a.length; } (_this$onRPat = this.onRPat) === null || _this$onRPat === void 0 || _this$onRPat.call(this, rPattern); this.genDateTime = this.genRFunc(rPattern); return true; } }, { key: "fix", value: function fix(txt) { var _this27 = this; if (this.disabled || !this.genDateTime && !this.getRPattern(txt)) { return txt; } return txt.replace(new RegExp(this.regex, 'g'), function (str) { var second, minute, hour, day, month, year; for (var i = 0; i < 7; ++i) { var a = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1]; switch (_this27.pattern[i]) { case 's': second = a; break; case 'i': minute = a; break; case 'h': hour = a; break; case 'd': day = a; break; case 'n': month = a - 1; break; case 'y': year = a; break; case 'm': month = Lng.monthDict[a.slice(0, 3).toLowerCase()] || 0; break; } } var dtime = new Date(year.length === 2 ? '20' + year : year, month, day, hour, minute, second || 0); dtime.setHours(dtime.getHours() + _this27.diff); return _this27.genDateTime(dtime); }); } }], [{ key: "checkPattern", value: function checkPattern(val) { return !val.includes('i') || !val.includes('h') || !val.includes('d') || !val.includes('y') || !(val.includes('n') || val.includes('m')) || /[^?\-+sihdmwny]|mm|ww|\?\?|([ihdny]\?)\1+/.test(val); } }, { key: "toggleSettings", value: function () { var _toggleSettings = _asyncToGenerator(_regenerator().m(function _callee17(el) { return _regenerator().w(function (_context18) { while (1) switch (_context18.n) { case 0: if (!(el.checked && (!/^[+-]\d{1,2}$/.test(Cfg.timeOffset) || DateTime.checkPattern(Cfg.timePattern)))) { _context18.n = 2; break; } $popup('err-correcttime', Lng.cTimeError[lang]); _context18.n = 1; return CfgSaver.save('correctTime', 0); case 1: el.checked = false; case 2: return _context18.a(2); } }, _callee17); })); function toggleSettings(_x11) { return _toggleSettings.apply(this, arguments); } return toggleSettings; }() }]); }(); var Videos = function () { function Videos(post) { var player = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var playerInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; _classCallCheck(this, Videos); this.currentLink = null; this.hasLinks = false; this.linksCount = 0; this.loadedLinksCount = 0; this.playerInfo = null; this.post = post; this.titleLoadFn = null; this.vData = [[], []]; if (player && playerInfo) { Object.defineProperty(this, 'player', { value: player }); this.playerInfo = playerInfo; } } return _createClass(Videos, [{ key: "player", get: function get() { var post = this.post; var value = $bBegin(post.msg, "
")); Object.defineProperty(this, 'player', { value: value }); return value; } }, { key: "addLink", value: function addLink(m, loader, link, isYtube) { this.hasLinks = true; this.linksCount++; if (this.playerInfo === null) { if (Cfg.embedYTube === 1) { this._addThumb(m, isYtube); } } else if (!link && $q(".de-video-link[href*=\"".concat(m[1], "\"]"), this.post.msg)) { return; } var dataObj; if (loader && (dataObj = Videos._global.vData[+!isYtube][m[1]])) { this.vData[+!isYtube].push(dataObj); } var time; var _Videos$_fixTime = Videos._fixTime(m[4], m[3], m[2]); var _Videos$_fixTime2 = _slicedToArray(_Videos$_fixTime, 4); time = _Videos$_fixTime2[0]; m[2] = _Videos$_fixTime2[1]; m[3] = _Videos$_fixTime2[2]; m[4] = _Videos$_fixTime2[3]; if (link) { link.href = link.href.replace(/^http:/, 'https:'); if (time) { link.setAttribute('de-time', time); } link.className = "de-video-link ".concat(isYtube ? 'de-ytube' : 'de-vimeo'); } else { var src = isYtube ? "".concat(aib.protocol, "//www.youtube.com/watch?v=").concat(m[1]).concat(time ? '#t=' + time : '') : "".concat(aib.protocol, "//vimeo.com/").concat(m[1]); link = $bEnd(this.post.msg, "

").concat(dataObj ? '' : src, "

")).firstChild; } if (dataObj) { Videos.setLinkData(link, dataObj); } if (this.playerInfo === null || this.playerInfo === m) { this.currentLink = link; } link.videoInfo = m; var vidListEl; if (Panel.isVidEnabled && (vidListEl = $id('de-video-list'))) { updateVideoList(vidListEl, link, this.post.num); } if (loader && !dataObj) { loader.runTask([link, isYtube, this, m[1]]); } } }, { key: "clickLink", value: function clickLink(el, mode) { var m = el.videoInfo; if (this.playerInfo !== m) { this.currentLink.classList.remove('de-current'); this.currentLink = el; var isYTube = el.classList.contains('de-ytube'); if (mode === 1) { this._addThumb(m, isYTube); } else { el.classList.add('de-current'); this.setPlayer(m, isYTube); } return; } if (mode === 1) { var _isYTube = el.classList.contains('de-ytube'); if ($q('.de-video-thumb', this.player)) { el.classList.add('de-current'); this.setPlayer(m, _isYTube); } else { el.classList.remove('de-current'); this._addThumb(m, _isYTube); } } else { el.classList.remove('de-current'); $hide(this.player); this.player.innerHTML = ''; this.playerInfo = null; } } }, { key: "setPlayer", value: function setPlayer(m, isYtube) { Videos.addPlayer(this, m, isYtube); } }, { key: "toggleFloatedThumb", value: function toggleFloatedThumb(linkEl, isOutEvent) { var el = $id('de-video-thumb-floated'); if (isOutEvent) { el.remove(); return; } if (!el) { el = $bEnd(doc.body, "")); } var cr = linkEl.getBoundingClientRect(); var pvHeight = Cfg.YTubeHeigh; var isTop = cr.top + cr.height + pvHeight < nav.viewportHeight(); el.style.cssText = "position: absolute; left: ".concat(deWindow.pageXOffset + cr.left, "px; top: ").concat(deWindow.pageYOffset + (isTop ? cr.top + cr.height : cr.top - pvHeight), "px; width: ").concat(Cfg.YTubeWidth, "px; height: ").concat(pvHeight, "px; z-index: 9999;"); } }, { key: "updatePost", value: function updatePost(oldLinks, newLinks, cloned) { var loader = !cloned && Videos._getTitlesLoader(); var j = 0; for (var i = 0, len = newLinks.length; i < len; ++i) { var el = newLinks[i]; var link = oldLinks[j]; if (link !== null && link !== void 0 && link.classList.contains('de-current')) { this.currentLink = el; } if (cloned) { el.videoInfo = link.videoInfo; j++; } else { var m = el.href.match(Videos.ytReg); if (m) { this.addLink(m, loader, el, true); j++; } } } this.currentLink = this.currentLink || newLinks[0]; if (loader) { loader.completeTasks(); } } }, { key: "_addThumb", value: function _addThumb(m, isYtube) { var el = this.player; this.playerInfo = m; el.classList.remove('de-video-expanded'); $show(el); var str = "") + ""); return; } el.innerHTML = "".concat(str, "//vimeo.com/").concat(m[1], "\" target=\"_blank\">") + ''; $ajax("".concat(aib.protocol, "//vimeo.com/api/v2/video/").concat(m[1], ".json"), null, true).then(function (xhr) { el.firstChild.firstChild.setAttribute('src', JSON.parse(xhr.responseText)[0].thumbnail_large); })["catch"](Function.prototype); } }], [{ key: "addPlayer", value: function addPlayer(obj, m, isYtube) { var enableJsapi = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var el = obj.player; obj.playerInfo = m; var txt; if (isYtube) { var list = m[0].match(/list=[^&#]+/); txt = "'; } else { var id = m[1] + (m[2] ? m[2] : ''); txt = ""); } el.innerHTML = txt + (enableJsapi ? '' : "")); $show(el); if (!enableJsapi) { el.lastChild.onclick = function (e) { return e.target.parentNode.classList.toggle('de-video-expanded'); }; } } }, { key: "setLinkData", value: function setLinkData(link, data) { var isCloned = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var _data5 = _slicedToArray(data, 5), title = _data5[0], author = _data5[1], views = _data5[2], publ = _data5[3], duration = _data5[4]; if (Panel.isVidEnabled && !isCloned) { var clonedLink = $q(".de-entry > .de-video-link[href=\"".concat(link.href, "\"]:not(title)")); if (clonedLink) { Videos.setLinkData(clonedLink, data, true); } } link.textContent = title; link.classList.add('de-video-title'); link.setAttribute('de-author', author); link.title = (duration ? Lng.duration[lang] + duration : '') + (publ ? ", ".concat(Lng.published[lang] + publ, "\n") : '') + Lng.author[lang] + author + (views ? ', ' + Lng.views[lang] + views : ''); } }, { key: "_fixTime", value: function _fixTime() { var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var minutes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var hours = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; if (seconds >= 60) { minutes += Math.floor(seconds / 60); seconds %= 60; } if (minutes >= 60) { hours += Math.floor(seconds / 60); minutes %= 60; } return [(hours ? hours + 'h' : '') + (minutes ? minutes + 'm' : '') + (seconds ? seconds + 's' : ''), hours, minutes, seconds]; } }, { key: "_getTitlesLoader", value: function _getTitlesLoader() { return Cfg.YTubeTitles && new TasksPool(4, function (num, info) { var _info5 = _slicedToArray(info, 4), isYtube = _info5[1], id = _info5[3]; if (isYtube) { return Cfg.ytApiKey ? Videos._getYTInfoAPI(info, num, id) : Videos._getYTInfoOembed(info, num, id); } return $ajax("".concat(aib.protocol, "//vimeo.com/api/v2/video/").concat(id, ".json"), null, true).then(function (xhr) { var entry = JSON.parse(xhr.responseText)[0]; return Videos._titlesLoaderHelper(info, num, entry.title, entry.user_name, entry.stats_number_of_plays, /(.*)\s(.*)?/.exec(entry.upload_date)[1], Videos._fixTime(entry.duration)[0]); })["catch"](function () { return Videos._titlesLoaderHelper(info, num); }); }, function () { return sesStorage['de-videos-data2'] = JSON.stringify(Videos._global.vData); }); } }, { key: "_getYTInfoAPI", value: function _getYTInfoAPI(info, num, id) { return $ajax("https://www.googleapis.com/youtube/v3/videos?key=".concat(Cfg.ytApiKey, "&id=").concat(id) + '&part=snippet,statistics,contentDetails&fields=items/snippet/title,items/snippet/publishedAt,' + 'items/snippet/channelTitle,items/statistics/viewCount,items/contentDetails/duration', null, true).then(function (xhr) { var items = JSON.parse(xhr.responseText).items[0]; return Videos._titlesLoaderHelper(info, num, items.snippet.title, items.snippet.channelTitle, items.statistics.viewCount, items.snippet.publishedAt.substr(0, 10), items.contentDetails.duration.substr(2).toLowerCase()); })["catch"](function () { return Videos._getYTInfoOembed(info, num, id); }); } }, { key: "_getYTInfoOembed", value: function _getYTInfoOembed(info, num, id) { var canSendCORS = nav.hasGMXHR || nav.canUseFetch; return (canSendCORS ? $ajax("https://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3D".concat(id, "&format=json"), null, true) : $ajax("https://noembed.com/embed?url=http%3A//youtube.com/watch%3Fv%3D".concat(id, "&callback=?"))).then(function (xhr) { var res = xhr.responseText; var json = JSON.parse(canSendCORS ? res : res.replace(/^[^{]+|\)$/g, '')); return Videos._titlesLoaderHelper(info, num, json.title, json.author_name, null, null, null); })["catch"](function () { return Videos._titlesLoaderHelper(info, num); }); } }, { key: "_titlesLoaderHelper", value: function _titlesLoaderHelper(_ref12, num) { var _ref13 = _slicedToArray(_ref12, 4), link = _ref13[0], isYtube = _ref13[1], videoObj = _ref13[2], id = _ref13[3]; for (var _len4 = arguments.length, data = new Array(_len4 > 2 ? _len4 - 2 : 0), _key3 = 2; _key3 < _len4; _key3++) { data[_key3 - 2] = arguments[_key3]; } if (data.length) { Videos.setLinkData(link, data); Videos._global.vData[+!isYtube][id] = data; videoObj.vData[+!isYtube].push(data); if (videoObj.titleLoadFn) { videoObj.titleLoadFn(data); } } videoObj.loadedLinksCount++; if (num % 30 === 0) { return Promise.reject(new TasksPool.PauseError(3e3)); } return new Promise(function (resolve) { return setTimeout(resolve, 250); }); } }]); }(); Videos.ytReg = /^https?:\/\/(?:www\.|m\.)?youtu(?:be\.com\/(?:watch\?.*?v=|v\/|embed\/)|\.be\/)([a-zA-Z0-9-_]+).*?(?:t(?:ime)?=(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s?)?)?$/; Videos.vimReg = /^https?:\/\/(?:www\.)?vimeo\.com\/(?:[^?]+\?clip_id=|.*?\/)?(\d+).*?(#t=\d+)?$/; Videos._global = { get vData() { var value; try { value = Cfg.YTubeTitles ? JSON.parse(sesStorage['de-videos-data2'] || '[{}, {}]') : [{}, {}]; } catch (err) { value = [{}, {}]; } Object.defineProperty(this, 'vData', { value: value }); return value; } }; var VideosParser = function () { function VideosParser() { _classCallCheck(this, VideosParser); this._loader = Videos._getTitlesLoader(); } return _createClass(VideosParser, [{ key: "endParser", value: function endParser() { var _this$_loader; (_this$_loader = this._loader) === null || _this$_loader === void 0 || _this$_loader.completeTasks(); } }, { key: "parse", value: function parse(data) { var isPost = data instanceof AbstractPost; var loader = this._loader; VideosParser._parserHelper('a[href*="youtu"]', data, loader, isPost, true, Videos.ytReg); if (Cfg.addVimeo) { VideosParser._parserHelper('a[href*="vimeo.com"]', data, loader, isPost, false, Videos.vimReg); } var vids = aib.fixVideo(isPost, data); for (var i = 0, len = vids.length; i < len; ++i) { var _vids$i = _slicedToArray(vids[i], 3), post = _vids$i[0], m = _vids$i[1], isYtube = _vids$i[2]; if (post) { post.videos.addLink(m, loader, null, isYtube); } } return this; } }], [{ key: "_parserHelper", value: function _parserHelper(qPath, data, loader, isPost, isYtube, reg) { var links = $Q(qPath, isPost ? data.el : data); for (var i = 0, len = links.length; i < len; ++i) { var link = links[i]; var m = link.href.match(reg); if (m) { var mPost = isPost ? data : aib.getPostOfEl(link); if (mPost) { mPost.videos.addLink(m, loader, link, isYtube); } } } } }]); }(); function embedAudioLinks(data) { var isPost = data instanceof AbstractPost; if (Cfg.addMP3) { var els = $Q('a[href*=".mp3"], a[href*=".opus"]', isPost ? data.el : data); for (var i = 0, len = els.length; i < len; ++i) { var link = els[i]; if (link.target !== '_blank' && link.rel !== 'nofollow' || !link.pathname.includes('.mp3') && !link.pathname.includes('.opus')) { continue; } var src = link.href; var el = (isPost ? data : aib.getPostOfEl(link)).mp3Obj; if (nav.canPlayMP3) { if (!$q("audio[src=\"".concat(src, "\"]"), el)) { el.insertAdjacentHTML('beforeend', "

")); } } else if (!$q("object[FlashVars*=\"".concat(src, "\"]"), el)) { el.insertAdjacentHTML('beforeend', '
")); } } } if (Cfg.addVocaroo) { $Q('a[href*="voca.ro"], a[href*="vocaroo.com"]', isPost ? data.el : data).forEach(function (link) { var _link$previousSibling; if (!(((_link$previousSibling = link.previousSibling) === null || _link$previousSibling === void 0 ? void 0 : _link$previousSibling.className) === 'de-vocaroo')) { link.insertAdjacentHTML('beforebegin', "")); } }); } } function $ajax(url) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var isCORS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var resolve, reject, cancelFn; var needTO = params ? params.useTimeout : false; var WAITING_TIME = 5e3; if (nav.canUseFetch && ((isCORS ? !nav.hasGMXHR : !nav.canUseNativeXHR) || aib.hasRefererErr) && !(isCORS && nav.isTampermonkey)) { if (!params) { params = {}; } params.referrer = doc.referrer.startsWith(aib.protocol + '//' + aib.host) ? doc.referrer : deWindow.location; params.referrerPolicy = 'unsafe-url'; if (params.data) { params.body = params.data; delete params.data; } if (isCORS) { params.mode = 'cors'; } var controller = new AbortController(); params.signal = controller.signal; var loadTO = needTO && setTimeout(function () { reject(AjaxError.Timeout); try { controller.abort(); } catch (err) {} }, WAITING_TIME); cancelFn = function cancelFn() { if (needTO) { clearTimeout(loadTO); } controller.abort(); }; fetch(aib.getAbsLink(url), params).then(function () { var _ref14 = _asyncToGenerator(_regenerator().m(function _callee18(res) { var _t20; return _regenerator().w(function (_context19) { while (1) switch (_context19.n) { case 0: if (aib.isAjaxStatusOK(res.status)) { _context19.n = 1; break; } reject(new AjaxError(res.status, res.statusText)); return _context19.a(2); case 1: _t20 = params.responseType; _context19.n = _t20 === 'arraybuffer' ? 2 : _t20 === 'blob' ? 4 : 6; break; case 2: _context19.n = 3; return res.arrayBuffer(); case 3: res.response = _context19.v; return _context19.a(3, 8); case 4: _context19.n = 5; return res.blob(); case 5: res.response = _context19.v; return _context19.a(3, 8); case 6: _context19.n = 7; return res.text(); case 7: res.responseText = _context19.v; case 8: resolve(res); case 9: return _context19.a(2); } }, _callee18); })); return function (_x12) { return _ref14.apply(this, arguments); }; }())["catch"](function (err) { return reject(getErrorMessage(err)); }); } else if ((isCORS || !nav.canUseNativeXHR) && nav.hasGMXHR) { var _params; var gmxhr; var timeoutFn = function timeoutFn() { reject(AjaxError.Timeout); try { gmxhr.abort(); } catch (err) {} }; var _loadTO = needTO && setTimeout(timeoutFn, WAITING_TIME); var newParams = { method: ((_params = params) === null || _params === void 0 ? void 0 : _params.method) || 'GET', url: nav.isSafari ? aib.getAbsLink(url) : url, onreadystatechange: function onreadystatechange(e) { if (needTO) { clearTimeout(_loadTO); } if (e.readyState === 4 && !( nav.isViolentmonkey && e.status === 200 && typeof e.responseText === 'undefined' && typeof e.response === 'undefined')) { if (aib.isAjaxStatusOK(e.status)) { resolve(e); } else { reject(new AjaxError(e.status, e.statusText)); } } else if (needTO) { _loadTO = setTimeout(timeoutFn, WAITING_TIME); } } }; if (params) { if (params.onprogress) { newParams.upload = { onprogress: params.onprogress }; delete params.onprogress; } delete params.method; Object.assign(newParams, params); } if (nav.hasNewGM) { GM.xmlHttpRequest(newParams); cancelFn = Function.prototype; } else { gmxhr = GM_xmlhttpRequest(newParams); cancelFn = function cancelFn() { if (needTO) { clearTimeout(_loadTO); } try { gmxhr.abort(); } catch (err) {} }; } } else if (nav.canUseNativeXHR) { var _params2; var xhr = new XMLHttpRequest(); var _timeoutFn = function _timeoutFn() { reject(AjaxError.Timeout); xhr.abort(); }; var _loadTO2 = needTO && setTimeout(_timeoutFn, WAITING_TIME); if ((_params2 = params) !== null && _params2 !== void 0 && _params2.onprogress) { xhr.upload.onprogress = params.onprogress; } if (aib._4chan) { xhr.withCredentials = true; } xhr.onreadystatechange = function (_ref15) { var target = _ref15.target; if (needTO) { clearTimeout(_loadTO2); } if (target.readyState === 4) { if (aib.isAjaxStatusOK(target.status)) { resolve(target); } else { reject(new AjaxError(target.status, target.statusText)); } } else if (needTO) { _loadTO2 = setTimeout(_timeoutFn, WAITING_TIME); } }; try { var _params3, _params5; xhr.open(((_params3 = params) === null || _params3 === void 0 ? void 0 : _params3.method) || 'GET', aib.getAbsLink(url), true); if (params) { if (params.responseType) { xhr.responseType = params.responseType; } var _params4 = params, headers = _params4.headers; if (headers) { for (var header in headers) { if ($hasProp(headers, header)) { xhr.setRequestHeader(header, headers[header]); } } } } xhr.send(((_params5 = params) === null || _params5 === void 0 ? void 0 : _params5.data) || null); cancelFn = function cancelFn() { if (needTO) { clearTimeout(_loadTO2); } xhr.abort(); }; } catch (err) { clearTimeout(_loadTO2); nav.canUseNativeXHR = false; return $ajax(url, params); } } else { reject(new AjaxError(0, 'Ajax error: Can\'t send any type of request.')); } return new CancelablePromise(function (res, rej) { resolve = res; reject = rej; }, cancelFn); } var AjaxError = function () { function AjaxError(code, message) { _classCallCheck(this, AjaxError); this.code = code; this.message = message; } return _createClass(AjaxError, [{ key: "toString", value: function toString() { return this.code <= 0 ? String(this.message || Lng.noConnect[lang]) : "HTTP [".concat(this.code, "] ").concat(this.message); } }]); }(); AjaxError.Success = new AjaxError(200, 'OK'); AjaxError.Locked = new AjaxError(-1, { toString: function toString() { return Lng.thrClosed[lang]; } }); AjaxError.Timeout = new AjaxError(0, { toString: function toString() { return Lng.noConnect[lang] + ' (timeout)'; } }); var AjaxCache = { clearCache: function clearCache() { this._data = new Map(); }, fixURL: function fixURL(url) { return "".concat(url).concat(url.includes('?') ? '&' : '?', "nocache=").concat(Math.round(Math.random() * 1e12)); }, runCachedAjax: function runCachedAjax(url, useCache) { var _this28 = this; var _ref16 = this._data.get(url) || {}, hasCacheControl = _ref16.hasCacheControl, params = _ref16.params; var ajaxURL = hasCacheControl === false ? this.fixURL(url) : url; return $ajax(ajaxURL, useCache && params || { useTimeout: true }, aib._4chan).then(function (xhr) { return _this28.saveData(url, xhr) ? xhr : $ajax(_this28.fixURL(url), useCache && params, aib._4chan); }); }, saveData: function saveData(url, xhr) { var ETag = null; var LastModified = null; var i = 0; var hasCacheControl = false; var headers = 'getAllResponseHeaders' in xhr ? xhr.getAllResponseHeaders() : xhr.responseHeaders; headers = headers ? headers.split('\r\n') : xhr.headers; for (var idx in headers) { if (!$hasProp(headers, idx)) { continue; } var header = headers[idx]; if (typeof header === 'string') { var сIdx = header.indexOf(':'); if (сIdx === -1) { continue; } var name = header.substring(0, сIdx); var value = header.substring(сIdx + 2, header.length); header = [name, value]; } var hName = header[0].toLowerCase(); var matched = true; switch (hName) { case 'cache-control': hasCacheControl = true; break; case 'last-modified': LastModified = header[1]; break; case 'etag': ETag = header[1]; break; default: matched = false; } if (matched && ++i === 3) { break; } } headers = null; if (ETag || LastModified) { headers = {}; if (ETag) { headers['If-None-Match'] = ETag; } if (LastModified) { headers['If-Modified-Since'] = LastModified; } } var hasUrl = this._data.has(url); this._data.set(url, { hasCacheControl: hasCacheControl, params: headers ? { headers: headers, useTimeout: true } : { useTimeout: true } }); return hasUrl || hasCacheControl; }, _data: new Map() }; function getAjaxResponseEl(text, needForm) { return aib.hasHtmlTag && !text.includes('') ? null : needForm ? $q(aib.qDelForm, $createDoc(text)) : $createDoc(text); } function ajaxLoad(url) { var needForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var useCache = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var checkArch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; return AjaxCache.runCachedAjax(url, useCache).then(function (xhr) { var el = getAjaxResponseEl(xhr.responseText, needForm); return !el ? CancelablePromise.reject(new AjaxError(0, Lng.errCorruptData[lang])) : checkArch ? [el, (xhr.responseURL || '').includes('/arch/')] : el; }, function (err) { return err.code === 304 ? null : CancelablePromise.reject(err); }); } function ajaxPostsLoad(board, tNum, useCache) { var useJson = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; if (useJson && aib.JsonBuilder) { return AjaxCache.runCachedAjax(aib.getJsonApiUrl(board, tNum), useCache).then(function (xhr) { try { return new aib.JsonBuilder(JSON.parse(xhr.responseText), board); } catch (err) { if (err instanceof AjaxError) { return CancelablePromise.reject(err); } console.warn("API error: ".concat(err, ". Switching to DOM parsing!")); aib.JsonBuilder = null; return ajaxPostsLoad(board, tNum, useCache); } }, function (err) { return err.code === 304 ? null : CancelablePromise.reject(err); }); } return aib.hasArchive ? ajaxLoad(aib.getThrUrl(board, tNum), true, useCache, true).then(function (data) { return data !== null && data !== void 0 && data[0] ? new DOMPostsBuilder(data[0], data[1]) : null; }) : ajaxLoad(aib.getThrUrl(board, tNum), true, useCache).then(function (form) { return form ? new DOMPostsBuilder(form) : null; }); } function infoLoadErrors(err) { var showError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var isAjax = err instanceof AjaxError; var eCode = isAjax ? err.code : 0; if (eCode === 200) { closePopup('newposts'); } else if (isAjax && eCode === 0) { $popup('newposts', err.message ? String(err.message) : "".concat(Lng.noConnect[lang], ": \n").concat(getErrorMessage(err))); } else { $popup('newposts', "".concat(Lng.thrNotFound[lang], " (\u2116").concat(aib.t, "): \n").concat(getErrorMessage(err))); if (showError) { doc.title = "{".concat(eCode, "} ").concat(doc.title); } } } var Pages = { addPage: function addPage() { var _this29 = this; var needThreads = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var pageNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DelForm.last.pageNum + 1; if (this._isAdding || pageNum > aib.lastPage || needThreads && pageNum > 4) { return; } this._isAdding = true; DelForm.last.el.insertAdjacentHTML('beforeend', "

\n\t\t\t\t".concat(Lng.loading[lang], "
")); MyPosts.purge(); this._addingPromise = ajaxLoad(aib.getPageUrl(aib.b, pageNum)).then(function () { var _ref17 = _asyncToGenerator(_regenerator().m(function _callee19(formEl) { var newForm, firstForm, thr, oldLastThr; return _regenerator().w(function (_context20) { while (1) switch (_context20.n) { case 0: newForm = _this29._addForm(formEl, pageNum); if (!newForm.firstThr) { _context20.n = 3; break; } if (needThreads) { _context20.n = 1; break; } return _context20.a(2, _this29._updateForms(DelForm.last)); case 1: $hide(newForm.el); _context20.n = 2; return _this29._updateForms(DelForm.last); case 2: firstForm = DelForm.first; thr = newForm.firstThr; do { if (thr.isHidden) { DelForm.tNums["delete"](thr.num); } else { oldLastThr = firstForm.lastThr; oldLastThr.el.after(thr.el); newForm.firstThr = thr.next; thr.prev = oldLastThr; thr.form = firstForm; firstForm.lastThr = oldLastThr.next = thr; needThreads--; } thr = thr.next; } while (needThreads && thr); DelForm.last = firstForm; firstForm.next = firstForm.lastThr.next = null; newForm.el.remove(); _this29._endAdding(); if (needThreads) { _this29.addPage(needThreads, pageNum + 1); } return _context20.a(2, CancelablePromise.reject(new CancelError())); case 3: _this29._endAdding(); _this29.addPage(); return _context20.a(2, CancelablePromise.reject(new CancelError())); } }, _callee19); })); return function (_x13) { return _ref17.apply(this, arguments); }; }()).then(function () { return _this29._endAdding(); })["catch"](function (err) { if (!(err instanceof CancelError)) { $popup('add-page', getErrorMessage(err)); _this29._endAdding(); } }); }, handleEvent: function handleEvent(e) { var needLoad = false; switch (e.type) { case 'mousewheel': needLoad = -('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta) > 0; break; case 'touchmove': needLoad = this._scrollY > e.touches[0].clientY; break; case 'touchstart': this._scrollY = e.touches[0].clientY; break; case 'wheel': needLoad = e.deltaY; break; } if (needLoad) { deWindow.requestAnimationFrame(function () { if (Thread.last.bottom - 150 < Post.sizing.wHeight) { Pages.addPage(); } }); } }, loadPages: function loadPages(count) { var _this30 = this; return _asyncToGenerator(_regenerator().m(function _callee20() { var _iterator5, _step5, form, i, len, first, _t21, _t22; return _regenerator().w(function (_context21) { while (1) switch (_context21.p = _context21.n) { case 0: $popup('load-pages', Lng.loading[lang], true); if (_this30._addingPromise) { _this30._addingPromise.cancelPromise(); _this30._endAdding(); } PviewsCache.purge(); isExpImg = false; pByEl = new Map(); pByNum = new Map(); Post.hiddenNums = new Set(); AttachedImage.closeImg(); if (postform.isQuick) { postform.clearForm(); } DelForm.tNums = new Set(); _iterator5 = _createForOfIteratorHelperLoose(DelForm); case 1: if ((_step5 = _iterator5()).done) { _context21.n = 4; break; } form = _step5.value; $Q('a[href^="blob:"]', form.el).forEach(function (el) { return URL.revokeObjectURL(el.href); }); $hide(form.el); if (!(form === DelForm.last)) { _context21.n = 2; break; } return _context21.a(3, 4); case 2: form.el.remove(); case 3: _context21.n = 1; break; case 4: DelForm.first = DelForm.last; i = aib.page, len = Math.min(aib.lastPage + 1, aib.page + count); case 5: if (!(i < len)) { _context21.n = 10; break; } _context21.p = 6; _t21 = _this30; _context21.n = 7; return ajaxLoad(aib.getPageUrl(aib.b, i)); case 7: _t21._addForm.call(_t21, _context21.v, i); _context21.n = 9; break; case 8: _context21.p = 8; _t22 = _context21.v; $popup('load-pages', getErrorMessage(_t22)); case 9: ++i; _context21.n = 5; break; case 10: first = DelForm.first; if (!(first !== DelForm.last)) { _context21.n = 12; break; } DelForm.first = first.next; first.el.remove(); _context21.n = 11; return _this30._updateForms(DelForm.first); case 11: closePopup('load-pages'); case 12: return _context21.a(2); } }, _callee20, null, [[6, 8]]); }))(); }, toggleInfinityScroll: function toggleInfinityScroll() { var _this31 = this; if (aib.t) { return; } if (nav.isMobile) { ['touchmove', 'touchstart'].forEach(function (e) { return doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener'](e, _this31); }); } else { doc.defaultView[Cfg.inftyScroll ? 'addEventListener' : 'removeEventListener']('onwheel' in doc.defaultView ? 'wheel' : 'mousewheel', this); } }, _addingPromise: null, _isAdding: false, _scrollY: 0, _addForm: function _addForm(formEl, pageNum) { formEl = doc.adoptNode(formEl); $hide(formEl = aib.fixHTML(formEl)); DelForm.last.el.after(formEl); var form = new DelForm(formEl, +pageNum, DelForm.last); DelForm.last = form; form.addStuff(); if (pageNum !== aib.page && form.firstThr) { formEl.insertAdjacentHTML('afterbegin', "
\n\t\t\t\t
".concat(Lng.page[lang], " ").concat(pageNum, "

")); } $show(formEl); return form; }, _endAdding: function _endAdding() { $q('.de-addpage-wait').remove(); this._isAdding = false; this._addingPromise = null; }, _updateForms: function _updateForms(newForm) { return _asyncToGenerator(_regenerator().m(function _callee21() { var _t23, _t24; return _regenerator().w(function (_context22) { while (1) switch (_context22.n) { case 0: _t23 = readPostsData; _t24 = newForm.firstThr.op; _context22.n = 1; return readFavorites(); case 1: _t23(_t24, _context22.v); if (!postform.passw) { _context22.n = 2; break; } _context22.n = 2; return PostForm.setUserPassw(); case 2: embedPostMsgImages(newForm.el); if (HotKeys.enabled) { HotKeys.clearCPost(); } case 3: return _context22.a(2); } }, _callee21); }))(); } }; var Spells = Object.create({ hash: null, get hiders() { this._initSpells(); return this.hiders; }, get list() { if (Cfg.spells === null) { return '#wipe(samelines,samewords,longwords,symbols,numbers,whitespace)'; } var data; try { data = JSON.parse(Cfg.spells); } catch (err) { return ''; } var _data6 = data, _data7 = _slicedToArray(_data6, 4), s = _data7[1], reps = _data7[2], oreps = _data7[3]; var str = s ? this._decompileSpells(s, '')[0].join('\n') : ''; if (reps || oreps) { if (str) { str += '\n\n'; } if (reps) { for (var _iterator6 = _createForOfIteratorHelperLoose(reps), _step6; !(_step6 = _iterator6()).done;) { var rep = _step6.value; str += this._decompileRep(rep, false) + '\n'; } } if (oreps) { for (var _iterator7 = _createForOfIteratorHelperLoose(oreps), _step7; !(_step7 = _iterator7()).done;) { var orep = _step7.value; str += this._decompileRep(orep, true) + '\n'; } } str = str.substr(0, str.length - 1); } return str; }, get names() { return ['words', 'exp', 'exph', 'imgn', 'ihash', 'subj', 'name', 'trip', 'img', 'sage', 'op', 'tlen', 'all', 'video', 'wipe', 'num', 'vauthor', '//', 'uid']; }, get needArg() { return [true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, true, true, false, true]; }, get outreps() { this._initSpells(); return this.outreps; }, get reps() { this._initSpells(); return this.reps; }, addSpell: function addSpell(type, arg, isNeg) { var _this32 = this; return _asyncToGenerator(_regenerator().m(function _callee22() { var inputEl, value, checkboxEl, spells, idx, isAdded, scope, sScope, sArg; return _regenerator().w(function (_context23) { while (1) switch (_context23.n) { case 0: inputEl = $id('de-spell-txt'); value = inputEl === null || inputEl === void 0 ? void 0 : inputEl.value; checkboxEl = $q('input[info="hideBySpell"]'); spells = value && _this32.parseText(value); if (!(!value || spells)) { _context23.n = 7; break; } if (!spells) { try { spells = JSON.parse(Cfg.spells); } catch (err) {} spells = spells || [Date.now(), [], null, null]; } isAdded = true; scope = aib.t ? [aib.b, aib.t] : null; if (spells[1]) { sScope = String(scope); sArg = String(arg); spells[1].some(scope && isNeg ? function (spell, i) { var data; if (spell[0] === 0xFF && (data = spell[1]) instanceof Array && data.length === 2 && data[0][0] === 0x20C && data[1][0] === type && data[1][2] == null && String(data[1][1]) === sArg && String(data[0][2]) === sScope) { idx = i; return true; } return (spell[0] & 0x200) !== 0; } : function (spell, i) { if (spell[0] === type && String(spell[1]) === sArg && String(spell[2]) === sScope) { idx = i; return true; } return (spell[0] & 0x200) !== 0; }); } else { spells[1] = []; } if (typeof idx === 'undefined') { if (scope && isNeg) { spells[1].unshift([0xFF, [[0x20C, '', scope], [type, arg, undefined]], undefined]); } else { spells[1].unshift([type, arg, scope]); } } else if (Cfg.hideBySpell) { if (spells[1].length === 1) { spells[1] = null; } else { spells[1].splice(idx, 1); } isAdded = false; } if (!isAdded) { _context23.n = 2; break; } _context23.n = 1; return CfgSaver.save('hideBySpell', 1); case 1: if (checkboxEl) { checkboxEl.checked = true; } _context23.n = 4; break; case 2: if (!(!spells[1] && !spells[2] && !spells[3])) { _context23.n = 4; break; } _context23.n = 3; return CfgSaver.save('hideBySpell', 0); case 3: if (checkboxEl) { checkboxEl.checked = false; } case 4: if (spells[1] && Cfg.sortSpells) { _this32._sort(spells[1]); } _context23.n = 5; return CfgSaver.save('spells', JSON.stringify(spells)); case 5: _context23.n = 6; return _this32.setSpells(spells, true); case 6: if (inputEl) { inputEl.value = _this32.list; } Pview.updatePosition(true); return _context23.a(2); case 7: if (checkboxEl) { checkboxEl.checked = false; } case 8: return _context23.a(2); } }, _callee22); }))(); }, decompileSpell: function decompileSpell(type, neg, val, scope) { var wipeMsg = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; var spell = (neg ? '!#' : '#') + this.names[type] + (scope ? "[".concat(scope[0]).concat(scope[1] ? ",".concat(scope[1] === -1 ? '' : scope[1]) : '', "]") : ''); if (!val && val !== 0) { return spell; } switch (type) { case 8: return spell + '(' + (val[0] === 2 ? '>' : val[0] === 1 ? '<' : '=') + (val[1] ? val[1][0] + (val[1][1] === val[1][0] ? '' : '-' + val[1][1]) : '') + (val[2] ? '@' + val[2][0] + (val[2][0] === val[2][1] ? '' : '-' + val[2][1]) + 'x' + val[2][2] + (val[2][2] === val[2][3] ? '' : '-' + val[2][3]) : '') + ')'; case 14: { if (val === 0x3F && !wipeMsg) { return spell; } var _ref18 = wipeMsg || [], _ref19 = _slicedToArray(_ref18, 2), msgBit = _ref19[0], msgData = _ref19[1]; var names = []; var bits = { 1: 'samelines', 2: 'samewords', 4: 'longwords', 8: 'symbols', 16: 'capslock', 32: 'numbers', 64: 'whitespace' }; for (var bit in bits) { if (+bit !== msgBit && val & +bit) { names.push(bits[bit]); } } if (msgBit) { names.push(bits[msgBit].toUpperCase() + (msgData ? ': ' + msgData : '')); } return "".concat(spell, "(").concat(names.join(','), ")"); } case 11: case 15: { var temp_; var temp = val[1].length - 1; if (temp !== -1) { for (temp_ = []; temp >= 0; --temp) { temp_.push(val[1][temp][0] + '-' + val[1][temp][1]); } temp_.reverse(); } spell += '('; if (val[0].length) { spell += val[0].join(',') + (temp_ ? ',' : ''); } if (temp_) { spell += temp_.join(','); } return spell + ')'; } case 0: case 6: case 7: case 18: case 16: return "".concat(spell, "(").concat(val.replace(/([)\\])/g, '\\$1').replace(/\n/g, '\\n'), ")"); case 17: return '//' + String(val); default: return "".concat(spell, "(").concat(String(val), ")"); } }, disableSpells: function disableSpells() { var _this33 = this; return _asyncToGenerator(_regenerator().m(function _callee23() { var value, configurable; return _regenerator().w(function (_context24) { while (1) switch (_context24.n) { case 0: value = null; configurable = true; Object.defineProperties(_this33, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); _context24.n = 1; return CfgSaver.save('hideBySpell', 0); case 1: return _context24.a(2); } }, _callee23); }))(); }, outReplace: function outReplace(txt) { for (var _iterator8 = _createForOfIteratorHelperLoose(this.outreps), _step8; !(_step8 = _iterator8()).done;) { var orep = _step8.value; txt = txt.replace(orep[0], orep[1]); } return txt; }, parseText: function parseText(text) { var codeGen = new SpellsCodegen(text); var data = codeGen.generate(); if (codeGen.hasError) { $popup('err-spell', Lng.error[lang] + ': ' + codeGen.errorSpell); } else if (data) { if (data[0] && Cfg.sortSpells) { this._sort(data[0]); } return [Date.now()].concat(_toConsumableArray(data)); } return null; }, replace: function replace(txt) { for (var _iterator9 = _createForOfIteratorHelperLoose(this.reps), _step9; !(_step9 = _iterator9()).done;) { var rep = _step9.value; txt = txt.replace(rep[0], rep[1]); } return txt; }, setSpells: function setSpells(spells, sync) { var _this34 = this; return _asyncToGenerator(_regenerator().m(function _callee24() { var sRunner, post; return _regenerator().w(function (_context25) { while (1) switch (_context25.n) { case 0: if (sync) { _this34._sync(spells); } if (Cfg.hideBySpell) { _context25.n = 2; break; } SpellsRunner.unhideAll(); _context25.n = 1; return _this34.disableSpells(); case 1: return _context25.a(2); case 2: _this34._optimize(spells); if (_this34.hiders) { _context25.n = 3; break; } SpellsRunner.unhideAll(); return _context25.a(2); case 3: sRunner = new SpellsRunner(); for (post = Thread.first.op; post; post = post.next) { sRunner.runSpells(post); } sRunner.endSpells(); case 4: return _context25.a(2); } }, _callee24); }))(); }, toggle: function toggle() { var _this35 = this; return _asyncToGenerator(_regenerator().m(function _callee25() { var spells, inputEl, value; return _regenerator().w(function (_context26) { while (1) switch (_context26.n) { case 0: inputEl = $id('de-spell-txt'); value = inputEl.value; if (!(value && (spells = _this35.parseText(value)))) { _context26.n = 3; break; } closePopup('err-spell'); _context26.n = 1; return _this35.setSpells(spells, true); case 1: _context26.n = 2; return CfgSaver.save('spells', JSON.stringify(spells)); case 2: inputEl.value = _this35.list; return _context26.a(2); case 3: if (value) { _context26.n = 6; break; } closePopup('err-spell'); SpellsRunner.unhideAll(); _context26.n = 4; return _this35.disableSpells(); case 4: _context26.n = 5; return CfgSaver.save('spells', JSON.stringify([Date.now(), null, null, null])); case 5: sendStorageEvent('__de-spells', '{ hide: false, data: null }'); case 6: $q('input[info="hideBySpell"]').checked = false; case 7: return _context26.a(2); } }, _callee25); }))(); }, _decompileRep: function _decompileRep(rep, isOrep) { return (isOrep ? '#outrep' : '#rep') + (rep[0] ? "[".concat(rep[0]).concat(rep[1] ? ",".concat(rep[1] === -1 ? '' : rep[1]) : '', "]") : '') + "(".concat(rep[2], ",").concat(rep[3].replace(/([)\\])/g, '\\$1').replace(/\n/g, '\\n'), ")"); }, _decompileSpells: function _decompileSpells(scope, indent) { var dScope = []; var hScope = false; for (var i = 0, j = 0, len = scope.length; i < len; ++i, ++j) { var spell = scope[i]; var type = spell[0] & 0xFF; if (type === 0xFF) { hScope = true; var temp = this._decompileSpells(spell[1], indent + ' '); if (temp[1]) { var str = "".concat(spell[0] & 0x100 ? '!(\n' : '(\n').concat(indent, " ") + "".concat(temp[0].join("\n".concat(indent, " ")), "\n").concat(indent, ")"); if (j === 0) { dScope[0] = str; } else { dScope[--j] += ' ' + str; } } else { dScope[j] = "".concat(spell[0] & 0x100 ? '!(' : '(').concat(temp[0].join(' '), ")"); } } else if (type === 17) { dScope[j] = '//' + spell[1]; } else { dScope[j] = this.decompileSpell(type, spell[0] & 0x100, spell[1], spell[2]); } var k = i + 1; while (k < len && (scope[k][0] & 0xFF) === 17) { k++; } if (k !== len && type !== 17) { dScope[j] += spell[0] & 0x200 ? ' &' : ' |'; } } return [dScope, dScope.length > 2 || hScope]; }, _initSpells: function _initSpells() { if (!Cfg.hideBySpell) { var value = null; var configurable = true; Object.defineProperties(this, { hiders: { configurable: configurable, value: value }, outreps: { configurable: configurable, value: value }, reps: { configurable: configurable, value: value } }); return; } var spells, data; try { spells = JSON.parse(Cfg.spells); data = JSON.parse(sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')]); } catch (err) {} if (data && spells && data[0] === spells[0]) { this.hash = data[0]; this._setData(data[1], data[2], data[3]); return; } if (spells) { this._optimize(spells); } else { this.disableSpells(); } }, _initHiders: function _initHiders(data) { if (data) { for (var _iterator0 = _createForOfIteratorHelperLoose(data), _step0; !(_step0 = _iterator0()).done;) { var item = _step0.value; var val = item[1]; if (val) { switch (item[0] & 0xFF) { case 1: case 2: case 3: case 5: case 13: item[1] = strToRegExp(val, true); break; case 0xFF: this._initHiders(val); } } } } return data; }, _initReps: function _initReps(data) { if (data) { for (var _iterator1 = _createForOfIteratorHelperLoose(data), _step1; !(_step1 = _iterator1()).done;) { var item = _step1.value; item[0] = strToRegExp(item[0], false); } } return data; }, _optimize: function _optimize(data) { var arr = [data[1] ? this._optimizeSpells(data[1]) : null, data[2] ? this._optimizeReps(data[2]) : null, data[3] ? this._optimizeReps(data[3]) : null]; sesStorage["de-spells-".concat(aib.b).concat(aib.t || '')] = JSON.stringify([data[0]].concat(arr)); this.hash = data[0]; this._setData.apply(this, arr); }, _optimizeReps: function _optimizeReps(data) { var rv = []; for (var _iterator10 = _createForOfIteratorHelperLoose(data), _step10; !(_step10 = _iterator10()).done;) { var _step10$value = _slicedToArray(_step10.value, 4), r0 = _step10$value[0], r1 = _step10$value[1], r2 = _step10$value[2], r3 = _step10$value[3]; if (!r0 || r0 === aib.b && (r1 === -1 ? !aib.t : !r1 || +r1 === aib.t)) { rv.push([r2, r3]); } } return !rv.length ? null : rv; }, _optimizeSpells: function _optimizeSpells(spells) { var neg; var lastSpell = -1; var newSpells = []; for (var i = 0, len = spells.length; i < len; ++i) { var j = void 0; var spell = spells[i]; var flags = spell[0]; var type = flags & 0xFF; neg = (flags & 0x100) !== 0; if (type === 0xFF) { var parensSpells = this._optimizeSpells(spell[1]); if (parensSpells) { if (parensSpells.length !== 1) { newSpells.push([flags, parensSpells]); lastSpell++; continue; } else if ((parensSpells[0][0] & 0xFF) !== 12) { newSpells.push([(parensSpells[0][0] | flags & 0x200) ^ flags & 0x100, parensSpells[0][1]]); lastSpell++; continue; } flags = parensSpells[0][0]; neg = !(neg ^ (flags & 0x100) !== 0); } } else { var scope = spell[2]; if (!scope || scope[0] === aib.b && (scope[1] === -1 ? !aib.t : !scope[1] || +scope[1] === aib.t)) { if (type === 12) { neg = !neg; } else { newSpells.push([flags, spell[1]]); lastSpell++; continue; } } } for (j = lastSpell; j >= 0 && (newSpells[j][0] & 0x200) !== 0 ^ neg; --j) ; if (j !== lastSpell) { newSpells = newSpells.slice(0, j + 1); lastSpell = j; } if (neg && j !== -1) { newSpells[j][0] &= 0x1FF; } if ((flags & 0x200) !== 0 ^ neg) { break; } } return lastSpell === -1 ? neg ? [[12, '']] : null : newSpells; }, _setData: function _setData(hiders, reps, outreps) { var configurable = true; Object.defineProperties(this, { hiders: { configurable: configurable, value: this._initHiders(hiders) }, outreps: { configurable: configurable, value: this._initReps(outreps) }, reps: { configurable: configurable, value: this._initReps(reps) } }); }, _sort: function _sort(sp) { for (var i = 0, len = sp.length - 1; i < len; ++i) { if (sp[i][0] > 0x200) { var temp = [0xFF, []]; do { temp[1].push(sp.splice(i, 1)[0]); len--; } while (sp[i][0] > 0x200); temp[1].push(sp.splice(i, 1)[0]); sp.splice(i, 0, temp); } } sp = sp.sort().sort(function (a, b) { return ( a[2] && !b[2] || a[2] && b[2] && (a[2][0] > b[2][0] || a[2][1] > b[2][1]) ? 1 : 0 ); }); for (var _i7 = 0, _len5 = sp.length - 1; _i7 < _len5; ++_i7) { var j = _i7 + 1; if (sp[_i7][0] === sp[j][0] && sp[_i7][1] <= sp[j][1] && sp[_i7][1] >= sp[j][1] && (sp[_i7][2] === null || sp[_i7][2] === undefined || sp[_i7][2] <= sp[j][2] && sp[_i7][2] >= sp[j][2])) { sp.splice(j, 1); _i7--; _len5--; } else if (sp[_i7][0] === 0xFF) { sp.push(sp.splice(_i7, 1)[0]); _i7--; _len5--; } } }, _sync: function _sync(data) { sendStorageEvent('__de-spells', { hide: !!Cfg.hideBySpell, data: data }); } }); var SpellsCodegen = function () { function SpellsCodegen(sList) { _classCallCheck(this, SpellsCodegen); this.TYPE_UNKNOWN = 0; this.TYPE_ANDOR = 1; this.TYPE_NOT = 2; this.TYPE_SPELL = 3; this.TYPE_PARENTHESES = 4; this.TYPE_REPLACER = 5; this.hasError = false; this._col = 1; this._errMsg = ''; this._errMsgArg = null; this._line = 1; this._sList = sList; } return _createClass(SpellsCodegen, [{ key: "errorSpell", get: function get() { return !this.hasError ? '' : (this._errMsgArg ? this._errMsg.replace('%s', this._errMsgArg) : this._errMsg) + Lng.seRow[lang] + this._line + Lng.seCol[lang] + this._col + ')'; } }, { key: "generate", value: function generate() { return this._sList ? this._generate(this._sList, false) : null; } }, { key: "_generate", value: function _generate(sList, inParens) { var spellsArr = []; var reps = []; var outreps = []; var lastType = this.TYPE_UNKNOWN; var hasReps = false; for (var i = 0, len = sList.length; i < len; i++, this._col++) { var res = void 0; switch (sList[i]) { case '\n': this._line++; this._col = 0; case '\r': case ' ': continue; case '#': { var name = ''; i++; var colStart = this._col; this._col++; while (sList[i] >= 'a' && sList[i] <= 'z' || sList[i] >= 'A' && sList[i] <= 'Z') { name += sList[i].toLowerCase(); i++; this._col++; } if (name === '') { this._setError(Lng.seUnknown[lang], sList[i].replace(/[\r\n]/, '')); return null; } else if (name === 'rep' || name === 'outrep') { if (!hasReps) { if (inParens) { this._col -= 1 + name.length; this._setError(Lng.seRepsInParens[lang], '#' + name); return null; } if (lastType === this.TYPE_ANDOR || lastType === this.TYPE_NOT) { i -= 1 + name.length; this._col -= 1 + name.length; lookBack: while (i >= 0) { switch (sList[i]) { case '\n': { i--; this._line--; var j = 0; while (j <= i && sList[i - j] !== '\n') { j++; } this._col = j; break; } case '\r': case ' ': case '#': i--; this._col--; break; default: break lookBack; } } this._setError(Lng.seOpInReps[lang], sList[i]); return null; } hasReps = true; } res = this._doRep(name, sList.substr(i)); if (!res) { return null; } (name === 'rep' ? reps : outreps).push(res[1]); i += res[0] - 1; this._col += res[0] - 1; lastType = this.TYPE_REPLACER; } else { if (lastType === this.TYPE_SPELL || lastType === this.TYPE_PARENTHESES) { this._col = colStart; this._setError(Lng.seMissOp[lang], null); return null; } res = this._doSpell(name, sList.substr(i), lastType === this.TYPE_NOT); if (!res) { return null; } i += res[0] - 1; this._col += res[0] - 1; spellsArr.push(res[1]); lastType = this.TYPE_SPELL; } break; } case '(': if (hasReps) { this._setError(Lng.seUnexpChar[lang], '('); return null; } if (lastType === this.TYPE_SPELL || lastType === this.TYPE_PARENTHESES) { this._setError(Lng.seMissOp[lang], null); return null; } res = this._generate(sList.substr(i + 1), true); if (!res) { return null; } i += res[0] + 1; spellsArr.push([lastType === this.TYPE_NOT ? 0x1FF : 0xFF, res[1]]); lastType = this.TYPE_PARENTHESES; break; case '|': case '&': if (hasReps) { this._setError(Lng.seUnexpChar[lang], sList[i]); return null; } if (lastType !== this.TYPE_SPELL && lastType !== this.TYPE_PARENTHESES) { this._setError(Lng.seMissSpell[lang], null); return null; } if (sList[i] === '&') { spellsArr[spellsArr.length - 1][0] |= 0x200; } lastType = this.TYPE_ANDOR; break; case '!': if (hasReps) { this._setError(Lng.seUnexpChar[lang], '!'); return null; } if (lastType !== this.TYPE_ANDOR && lastType !== this.TYPE_UNKNOWN) { this._setError(Lng.seMissOp[lang], null); return null; } lastType = this.TYPE_NOT; break; case '/': { i++; this._col++; if (sList[i] === '/') { var text = ''; while (i + 1 < len && sList[i + 1] !== '\n' && sList[i + 1] !== '\r') { i++; this._col++; text += sList[i]; } spellsArr.push([17, text]); } else { this._setError(Lng.seUnexpChar[lang], '/'); return null; } break; } case ')': if (hasReps) { this._setError(Lng.seUnexpChar[lang], ')'); return null; } if (lastType === this.TYPE_ANDOR || lastType === this.TYPE_NOT) { this._setError(Lng.seMissSpell[lang], null); return null; } if (inParens) { return [i, spellsArr]; } default: this._setError(Lng.seUnexpChar[lang], sList[i]); return null; } } if (inParens) { this._setError(Lng.seMissClBkt[lang], null); return null; } if (lastType !== this.TYPE_SPELL && lastType !== this.TYPE_PARENTHESES && lastType !== this.TYPE_REPLACER) { this._setError(Lng.seMissSpell[lang], null); return null; } if (!reps.length) { reps = false; } if (!outreps.length) { outreps = false; } return [spellsArr, reps, outreps]; } }, { key: "_getRegex", value: function _getRegex(str, haveComma) { var m = str.match(/^\((\/.*?[^\\]\/[igm]*)(?:\)|\s*(,))/); if (!m || haveComma !== Boolean(m[2])) { return null; } var val = m[1]; try { strToRegExp(val, true); } catch (err) { this._col++; this._setError(Lng.seErrRegex[lang], val); return null; } return [m[0].length, val]; } }, { key: "_doRep", value: function _doRep(name, str) { var scope = SpellsCodegen._getScope(str); if (scope) { str = str.substring(scope[0]); } else { scope = [0, ['', '']]; } if (str[0] !== '(' || str[1] === ')') { this._setError(Lng.seMissArg[lang], name); return null; } var regex = this._getRegex(str, true); if (regex) { str = str.substring(regex[0]); if (str[0] === ')') { return [regex[0] + scope[0] + 1, [scope[1][0], scope[1][1], regex[1], '']]; } var val = SpellsCodegen._getText(str, false); if (val) { return [val[0] + regex[0] + scope[0], [scope[1][0], scope[1][1], regex[1], val[1]]]; } } if (!this.hasError) { this._setError(Lng.seSyntaxErr[lang], name); } return null; } }, { key: "_doSpell", value: function _doSpell(name, str, isNeg) { var m; var i = 0; var spellIdx = Spells.names.indexOf(name); if (spellIdx === -1) { this._col -= name.length + 1; this._setError(Lng.seUnknown[lang], name); return null; } var scope = SpellsCodegen._getScope(str); if (scope) { i += scope[0]; str = str.substring(scope[0]); scope = scope[1]; } var spellType = isNeg ? spellIdx | 0x100 : spellIdx; if (str[0] !== '(' || str[1] === ')') { if (Spells.needArg[spellIdx]) { this._setError(Lng.seMissArg[lang], name); return null; } return [str[0] === '(' ? i + 2 : i, [spellType, spellIdx === 14 ? 0x3F : '', scope]]; } switch (spellIdx) { case 0: case 6: case 7: case 9: case 10: case 12: case 16: case 18: m = SpellsCodegen._getText(str, true); if (m) { return [i + m[0], [spellType, spellIdx === 0 ? m[1].toLowerCase() : m[1], scope]]; } break; case 1: case 2: case 3: case 5: case 13: m = this._getRegex(str, false); if (m) { return [i + m[0], [spellType, m[1], scope]]; } break; case 4: m = str.match(/^\((\d+)\)/); if (!isNaN(+m[1])) { return [i + m[0].length, [spellType, +m[1], scope]]; } break; case 8: m = str.match(/^\(([><=])(?:(\d+(?:\.\d+)?)(?:-(\d+(?:\.\d+)?))?)?(?:@(\d+)(?:-(\d+))?x(\d+)(?:-(\d+))?)?\)/); if (m && (m[2] || m[4])) { return [i + m[0].length, [spellType, [m[1] === '=' ? 0 : m[1] === '<' ? 1 : 2, m[2] && [+m[2], m[3] ? +m[3] : +m[2]], m[4] && [+m[4], m[5] ? +m[5] : +m[4], +m[6], m[7] ? +m[7] : +m[6]]], scope]]; } break; case 14: m = str.match(/^\(([a-z, ]+)\)/); if (m) { var val = 0; var arr = m[1].split(/, */); for (var _i8 = 0, len = arr.length; _i8 < len; ++_i8) { switch (arr[_i8]) { case 'samelines': val |= 1; break; case 'samewords': val |= 2; break; case 'longwords': val |= 4; break; case 'symbols': val |= 8; break; case 'capslock': val |= 16; break; case 'numbers': val |= 32; break; case 'whitespace': val |= 64; break; default: val = -1; } } if (val !== -1) { return [i + m[0].length, [spellType, val, scope]]; } } break; case 11: case 15: { m = str.match(/^\(([\d-, ]+)\)/); if (m) { var _val; m[1].split(/, */).forEach(function (v) { if (v.includes('-')) { var nums = v.split('-'); nums[0] = +nums[0]; nums[1] = +nums[1]; _val[1].push(nums); } else { _val[0].push(+v); } }, _val = [[], []]); return [i + m[0].length, [spellType, _val, scope]]; } break; } } if (!this.hasError) { this._setError(Lng.seSyntaxErr[lang], name); } return null; } }, { key: "_setError", value: function _setError(msg, arg) { this.hasError = true; this._errMsg = msg; this._errMsgArg = arg; } }], [{ key: "_getScope", value: function _getScope(str) { var m = str.match(/^\[([a-z0-9/-]+)?(?:(,)|,(\s*[0-9]+))?\]/); return m ? [m[0].length, [m[1] || '', m[3] ? +m[3] : m[2] ? -1 : false]] : null; } }, { key: "_getText", value: function _getText(str, haveBracket) { if (haveBracket && str[0] !== '(') { return [0, '']; } var rv = ''; for (var i = haveBracket ? 1 : 0, len = str.length; i < len; ++i) { var ch = str[i]; if (ch === '\\') { if (i === len - 1) { return null; } switch (str[i + 1]) { case 'n': rv += '\n'; break; case '\\': rv += '\\'; break; case ')': rv += ')'; break; default: return null; } ++i; } else if (ch === ')') { return [i + 1, rv]; } else { rv += ch; } } return null; } }]); }(); var SpellsRunner = function () { function SpellsRunner() { _classCallCheck(this, SpellsRunner); this.hasNumSpell = false; this._endPromise = null; this._spells = Spells.hiders; if (!this._spells) { this.runSpells = SpellsRunner._unhidePost; SpellsRunner.cachedData = null; } } return _createClass(SpellsRunner, [{ key: "endSpells", value: function endSpells() { var _this36 = this; if (this._endPromise) { this._endPromise.then(function () { return _this36._savePostsHelper(); }); } else { this._savePostsHelper(); } } }, { key: "runSpells", value: function runSpells(post) { var _this37 = this; var res = new SpellsInterpreter(post, this._spells).runInterpreter(); if (res instanceof Promise) { res = res.then(function (val) { return _this37._checkRes(post, val); }); this._endPromise = this._endPromise ? this._endPromise.then(function () { return res; }) : res; return 0; } return this._checkRes(post, res); } }, { key: "_checkRes", value: function _checkRes(post, _ref20) { var _ref21 = _slicedToArray(_ref20, 3), hasNumSpell = _ref21[0], val = _ref21[1], msg = _ref21[2]; this.hasNumSpell |= hasNumSpell; if (val) { post.spellHide(msg); if (SpellsRunner.cachedData && !post.isDeleted) { SpellsRunner.cachedData[post.count] = [true, msg]; } return 1; } return SpellsRunner._unhidePost(post); } }, { key: "_savePostsHelper", value: function _savePostsHelper() { if (this._spells) { if (aib.t) { var lPost = Thread.first.lastNotDeleted; var data = null; if (Spells.hiders) { if (SpellsRunner.cachedData) { data = SpellsRunner.cachedData; } else { data = []; for (var post = Thread.first.op; post; post = post.nextNotDeleted) { data.push(post.spellHidden ? [true, Post.Note.text] : [false, null]); } SpellsRunner.cachedData = data; } } sesStorage['de-hidden-' + aib.b + aib.t] = !data ? null : JSON.stringify({ hash: Cfg.hideBySpell ? Spells.hash : 0, lastCount: lPost.count, lastNum: lPost.num, data: data }); } toggleWindow('hid', true); } ImagesHashStorage.endFn(); } }], [{ key: "unhideAll", value: function unhideAll() { if (aib.t) { sesStorage['de-hidden-' + aib.b + aib.t] = null; } for (var post = Thread.first.op; post; post = post.next) { if (post.spellHidden) { post.spellUnhide(); } } } }, { key: "_unhidePost", value: function _unhidePost(post) { if (post.spellHidden) { post.spellUnhide(); if (SpellsRunner.cachedData && !post.isDeleted) { SpellsRunner.cachedData[post.count] = [false, null]; } } return 0; } }]); }(); SpellsRunner.cachedData = null; var SpellsInterpreter = function () { function SpellsInterpreter(post, spells) { _classCallCheck(this, SpellsInterpreter); this.hasNumSpell = false; this._ctx = [spells.length, spells, 0, false]; this._deep = 0; this._lastTSpells = []; this._post = post; this._triggeredSpellsStack = [this._lastTSpells]; this._wipeMsg = null; } return _createClass(SpellsInterpreter, [{ key: "runInterpreter", value: function runInterpreter() { var _this38 = this; var rv, stopCheck; var isNegScope = this._ctx.pop(); var i = this._ctx.pop(); var scope = this._ctx.pop(); var len = this._ctx.pop(); while (true) { if (i < len) { var type = scope[i][0] & 0xFF; if (type === 0xFF) { this._deep++; this._ctx.push(len, scope, i, isNegScope); isNegScope = !!((scope[i][0] & 0x100) !== 0 ^ isNegScope); scope = scope[i][1]; len = scope.length; i = 0; this._lastTSpells = []; this._triggeredSpellsStack.push(this._lastTSpells); continue; } else if (type === 17) { i++; continue; } var val = this._runSpell(type, scope[i][1]); if (val instanceof Promise) { i++; this._ctx.push(len, scope, i, isNegScope); return val.then(function (v) { return _this38._asyncContinue(v); }); } var _this$_checkRes = this._checkRes(scope[i], val, isNegScope); var _this$_checkRes2 = _slicedToArray(_this$_checkRes, 2); rv = _this$_checkRes2[0]; stopCheck = _this$_checkRes2[1]; if (!stopCheck) { i++; continue; } } if (this._deep !== 0) { this._deep--; isNegScope = this._ctx.pop(); i = this._ctx.pop(); scope = this._ctx.pop(); len = this._ctx.pop(); if ((scope[i][0] & 0x200) === 0 ^ rv) { i++; this._triggeredSpellsStack.pop(); this._lastTSpells = this._triggeredSpellsStack[this._triggeredSpellsStack.length - 1]; continue; } } return [this.hasNumSpell, rv, rv ? this._getMsg() : null]; } } }, { key: "_asyncContinue", value: function _asyncContinue(val) { var cl = this._ctx.length; var spell = this._ctx[cl - 3][this._ctx[cl - 2] - 1]; var _this$_checkRes3 = this._checkRes(spell, val, this._ctx[cl - 1]), _this$_checkRes4 = _slicedToArray(_this$_checkRes3, 2), rv = _this$_checkRes4[0], stopCheck = _this$_checkRes4[1]; return stopCheck ? [this.hasNumSpell, rv, rv ? this._getMsg() : null] : this.runInterpreter(); } }, { key: "_checkRes", value: function _checkRes(spell, val, isNegScope) { var flags = spell[0]; var isAndSpell = (flags & 0x200) !== 0 ^ isNegScope; var isNegSpell = (flags & 0x100) !== 0 ^ isNegScope; if (isNegSpell ^ val) { this._lastTSpells.push([isNegSpell, spell, (spell[0] & 0xFF) === 14 ? this._wipeMsg : null]); return [true, !isAndSpell]; } this._lastTSpells.length = 0; return [false, isAndSpell]; } }, { key: "_getMsg", value: function _getMsg() { var rv = []; for (var _iterator11 = _createForOfIteratorHelperLoose(this._triggeredSpellsStack), _step11; !(_step11 = _iterator11()).done;) { var spellEls = _step11.value; for (var _iterator12 = _createForOfIteratorHelperLoose(spellEls), _step12; !(_step12 = _iterator12()).done;) { var _step12$value = _slicedToArray(_step12.value, 3), isNeg = _step12$value[0], spell = _step12$value[1], wipeMsg = _step12$value[2]; rv.push(Spells.decompileSpell(spell[0] & 0xFF, isNeg, spell[1], spell[2], wipeMsg)); } } return rv.join(' & '); } }, { key: "_runSpell", value: function _runSpell(spellId, val) { switch (spellId) { case 0: return this._words(val); case 1: return this._exp(val); case 2: return this._exph(val); case 3: return this._imgn(val); case 4: return this._ihash(val); case 5: return this._subj(val); case 6: return this._name(val); case 7: return this._trip(val); case 8: return this._img(val); case 9: return this._sage(val); case 10: return this._op(val); case 11: return this._tlen(val); case 12: return this._all(val); case 13: return this._video(val); case 14: return this._wipe(val); case 15: this.hasNumSpell = true; return this._num(val); case 16: return this._vauthor(val); case 18: return this._uid(val); } } }, { key: "_all", value: function _all() { return true; } }, { key: "_exp", value: function _exp(val) { return val.test(this._post.text); } }, { key: "_exph", value: function _exph(val) { return val.test(this._post.html); } }, { key: "_ihash", value: function () { var _ihash2 = _asyncToGenerator(_regenerator().m(function _callee26(val) { var _iterator13, _step13, image, _t25, _t26, _t27; return _regenerator().w(function (_context27) { while (1) switch (_context27.n) { case 0: _iterator13 = _createForOfIteratorHelperLoose(this._post.images); case 1: if ((_step13 = _iterator13()).done) { _context27.n = 5; break; } image = _step13.value; _t25 = image instanceof AttachedImage; if (!_t25) { _context27.n = 3; break; } _context27.n = 2; return ImagesHashStorage.getHash(image); case 2: _t26 = _context27.v; _t27 = val; _t25 = _t26 === _t27; case 3: if (!_t25) { _context27.n = 4; break; } return _context27.a(2, true); case 4: _context27.n = 1; break; case 5: return _context27.a(2, false); } }, _callee26, this); })); function _ihash(_x14) { return _ihash2.apply(this, arguments); } return _ihash; }() }, { key: "_img", value: function _img(val) { var images = this._post.images; var _val2 = _slicedToArray(val, 3), compareRule = _val2[0], weightVals = _val2[1], sizeVals = _val2[2]; if (!val) { return images.hasAttachments; } for (var _iterator14 = _createForOfIteratorHelperLoose(images), _step14; !(_step14 = _iterator14()).done;) { var image = _step14.value; if (!(image instanceof AttachedImage)) { continue; } if (weightVals) { var w = image.weight; var isHide = void 0; switch (compareRule) { case 0: isHide = w >= weightVals[0] && w <= weightVals[1]; break; case 1: isHide = w < weightVals[0]; break; case 2: isHide = w > weightVals[0]; break; } if (!isHide) { continue; } else if (!sizeVals) { return true; } } if (sizeVals) { var h = image.height, _w = image.width; switch (compareRule) { case 0: if (_w >= sizeVals[0] && _w <= sizeVals[1] && h >= sizeVals[2] && h <= sizeVals[3]) { return true; } break; case 1: if (_w < sizeVals[0] && h < sizeVals[3]) { return true; } break; case 2: if (_w > sizeVals[0] && h > sizeVals[3]) { return true; } } } } return false; } }, { key: "_imgn", value: function _imgn(val) { for (var _iterator15 = _createForOfIteratorHelperLoose(this._post.images), _step15; !(_step15 = _iterator15()).done;) { var image = _step15.value; if (image instanceof AttachedImage && val.test(image.name)) { return true; } } return false; } }, { key: "_name", value: function _name(val) { var pName = this._post.posterName; return pName ? !val || pName.includes(val) : false; } }, { key: "_num", value: function _num(val) { return SpellsInterpreter._tlenNumHelper(val, this._post.count + 1); } }, { key: "_op", value: function _op() { return this._post.isOp; } }, { key: "_sage", value: function _sage() { return this._post.sage; } }, { key: "_subj", value: function _subj(val) { var pSubj = this._post.subj; return pSubj ? !val || val.test(pSubj) : false; } }, { key: "_tlen", value: function _tlen(val) { var text = this._post.text.replace(/\s+(?=\s)|\n/g, ''); return !val ? !!text : SpellsInterpreter._tlenNumHelper(val, text.length); } }, { key: "_trip", value: function _trip(val) { var pTrip = this._post.posterTrip; return pTrip ? !val || pTrip.includes(val) : false; } }, { key: "_uid", value: function _uid(val) { var pUid = this._post.posterUid; return pUid ? pUid.includes(val) : false; } }, { key: "_vauthor", value: function _vauthor(val) { return this._videoVauthor(val, true); } }, { key: "_video", value: function _video(val) { return this._videoVauthor(val, false); } }, { key: "_videoVauthor", value: function _videoVauthor(val, isAuthorSpell) { var videos = this._post.videos; if (!val) { return !!videos.hasLinks; } if (!videos.hasLinks || !Cfg.YTubeTitles) { return false; } for (var _iterator16 = _createForOfIteratorHelperLoose(videos.vData), _step16; !(_step16 = _iterator16()).done;) { var siteData = _step16.value; for (var _iterator17 = _createForOfIteratorHelperLoose(siteData), _step17; !(_step17 = _iterator17()).done;) { var data = _step17.value; if (isAuthorSpell ? val === data[1] : val.test(data[0])) { return true; } } } if (videos.linksCount === videos.loadedLinksCount) { return false; } return new Promise(function (resolve) { return videos.titleLoadFn = function (data) { if (isAuthorSpell ? val === data[1] : val.test(data[0])) { resolve(true); } else if (videos.linksCount === videos.loadedLinksCount) { resolve(false); } else { return; } videos.titleLoadFn = null; }; }); } }, { key: "_wipe", value: function _wipe(val) { var arr, len, x; var txt = this._post.text; if (val & 1) { arr = txt.replaceAll('>', '').split(/\s*\n\s*/); if ((len = arr.length) > 5) { arr.sort(); for (var i = 0, n = len / 4; i < len;) { x = arr[i]; var j = 0; while (arr[i++] === x) { j++; } if (j > 4 && j > n && x) { this._wipeMsg = [1, "\"".concat(x.substr(0, 20), "\" x").concat(j + 1)]; return true; } } } } if (val & 2) { arr = txt.replace(/[\s.?!,>]+/g, ' ').toUpperCase().split(' '); if ((len = arr.length) > 3) { arr.sort(); var keys = 0; var pop = 0; for (var _i9 = 0, _n = len / 4; _i9 < len; keys++) { x = arr[_i9]; var _j = 0; while (arr[_i9++] === x) { _j++; } if (len > 25) { if (_j > pop && x.length > 2) { pop = _j; } if (pop >= _n) { this._wipeMsg = [2, "same \"".concat(x.substr(0, 20), "\" x").concat(pop + 1)]; return true; } } } x = keys / len; if (x < 0.25) { this._wipeMsg = [2, "uniq ".concat((x * 100).toFixed(0), "%")]; return true; } } } if (val & 4) { arr = txt.replace(/https*:\/\/.*?(\s|$)/g, '').replace(/[\s.?!,>:;-]+/g, ' ').split(' '); if (arr[0].length > 50 || (len = arr.length) > 1 && arr.join('').length / len > 10) { this._wipeMsg = [4, null]; return true; } } if (val & 8) { var _txt = txt.replace(/\s+/g, ''); if ((len = _txt.length) > 30 && (x = _txt.replace(/[0-9a-zа-я.?!,]/ig, '').length / len) > 0.4) { this._wipeMsg = [8, "".concat((x * 100).toFixed(0), "%")]; return true; } } if (val & 16) { arr = txt.replace(/[\s.?!;,-]+/g, ' ').trim().split(' '); if ((len = arr.length) > 4) { var _n2 = 0; var capsw = 0; var casew = 0; for (var _i0 = 0; _i0 < len; ++_i0) { x = arr[_i0]; if ((x.match(/[a-zа-я]/ig) || []).length < 5) { continue; } if ((x.match(/[A-ZА-Я]/g) || []).length > 2) { casew++; } if (x === x.toUpperCase()) { capsw++; } _n2++; } if (capsw / _n2 >= 0.3 && _n2 > 4) { this._wipeMsg = [16, "CAPS ".concat(capsw / arr.length * 100, "%")]; return true; } else if (casew / _n2 >= 0.3 && _n2 > 8) { this._wipeMsg = [16, "cAsE ".concat(casew / arr.length * 100, "%")]; return true; } } } if (val & 32) { var _txt2 = txt.replace(/\s+/g, ' ').replace(/>>\d+|https*:\/\/.*?(?: |$)/g, ''); if ((len = _txt2.length) > 30 && (x = (len - _txt2.replace(/\d/g, '').length) / len) > 0.4) { this._wipeMsg = [32, "".concat(Math.round(x * 100), "%")]; return true; } } if (val & 64) { if (/(?:\n\s*){10}/i.test(txt)) { this._wipeMsg = [64, null]; return true; } } return false; } }, { key: "_words", value: function _words(val) { return this._post.text.toLowerCase().includes(val) || this._post.subj.toLowerCase().includes(val); } }], [{ key: "_tlenNumHelper", value: function _tlenNumHelper(val, num) { for (var arr = val[0], i = arr.length - 1; i >= 0; --i) { if (arr[i] === num) { return true; } } for (var _arr = val[1], _i1 = _arr.length - 1; _i1 >= 0; --_i1) { if (num >= _arr[_i1][0] && num <= _arr[_i1][1]) { return true; } } return false; } }]); }(); var PostForm = function () { function PostForm(form) { var _this39 = this; var oeForm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var ignoreForm = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; _classCallCheck(this, PostForm); this.isBottom = false; this.isHidden = false; this.isQuick = false; this.lastQuickPNum = -1; this.pArea = []; this.pForm = null; this.qArea = null; this.quotedText = ''; this._pBtn = []; var qOeForm = 'form[name="oeform"], form[action*="paint"]'; this.oeForm = oeForm || $q(qOeForm); if (!ignoreForm && !form) { if (this.oeForm) { ajaxLoad(aib.getThrUrl(aib.b, Thread.first.num), false).then(function (loadedDoc) { var form = $q(aib.qForm, loadedDoc); var oeForm = $q(qOeForm, loadedDoc); postform = new PostForm(form && doc.adoptNode(form), oeForm && doc.adoptNode(oeForm), true); }, function () { return postform = new PostForm(null, null, true); }); } else { this.form = null; } return; } this.tNum = aib.t; this.form = form; this.files = null; this.txta = $q(aib.qFormTxta, form); this.subm = $q(aib.qFormSubm, form); this.name = $q(aib.qFormName, form); this.mail = $q(aib.qFormMail, form); this.subj = $q(aib.qFormSubj, form); this.passw = $q(aib.qFormPassw, form); this.rules = $q(aib.qFormRules, form); this.video = $q('tr input[name="video"], tr input[name="embed"]', form); this._initFileInputs(); this._makeHideableContainer(); this._makeWindow(); if (!form || !this.txta) { return; } form.style.display = 'inline-block'; form.style.textAlign = 'left'; var qArea = this.qArea, txta = this.txta; new WinResizer('reply', 'top', 'textaHeight', qArea, txta); new WinResizer('reply', 'left', 'textaWidth', qArea, txta); new WinResizer('reply', 'right', 'textaWidth', qArea, txta); new WinResizer('reply', 'bottom', 'textaHeight', qArea, txta); this._initTextarea(); this.addMarkupPanel(); this.setPlaceholders(); this._initCaptcha(); this._initSubmit(); aib.updateSubmitBtn(this.subm); if (Cfg.ajaxPosting) { this._initAjaxPosting(); } if (Cfg.addSageBtn && this.mail) { PostForm.hideField(this.mail.closest('label') || this.mail); setTimeout(function () { return _this39.toggleSage(); }, 0); } if (Cfg.noPassword && this.passw) { $hide(this.passw.closest(aib.qFormTr)); } if (Cfg.noName && this.name) { PostForm.hideField(this.name); } if (Cfg.noSubj && this.subj) { PostForm.hideField(this.subj); } if (Cfg.userName && this.name) { setTimeout(PostForm.setUserName, 0); } if (this.passw) { setTimeout(PostForm.setUserPassw, 0); } } return _createClass(PostForm, [{ key: "isVisible", get: function get() { if (!this.isHidden && this.isBottom && $q(':focus', this.pForm)) { var cr = this.pForm.getBoundingClientRect(); return cr.bottom > 0 && cr.top < nav.viewportHeight(); } return false; } }, { key: "sageBtn", get: function get() { var _this40 = this; var value = $aEnd(this.subm, '' + ''); value.onclick = _asyncToGenerator(_regenerator().m(function _callee27() { return _regenerator().w(function (_context28) { while (1) switch (_context28.n) { case 0: _context28.n = 1; return toggleCfg('sageReply'); case 1: _this40.toggleSage(); case 2: return _context28.a(2); } }, _callee27); })); Object.defineProperty(this, 'sageBtn', { value: value }); return value; } }, { key: "top", get: function get() { return this.pForm.getBoundingClientRect().top; } }, { key: "addMarkupPanel", value: function addMarkupPanel() { var _this41 = this; if (aib.noMarkupBtns) { return; } var el = $id('de-txt-panel'); if (!Cfg.addTextBtns) { var _el7; (_el7 = el) === null || _el7 === void 0 || _el7.remove(); return; } if (!el) { el = $add(''); ['click', 'mouseover'].forEach(function (e) { return el.addEventListener(e, _this41); }); } el.style.cssFloat = Cfg.txtBtnsLoc ? 'none' : 'right'; (Cfg.txtBtnsLoc ? $id('de-resizer-text') || this.txta : this.subm).after(el); var id = ['bold', 'italic', 'under', 'strike', 'spoil', 'code', 'sup', 'sub']; var val = ['B', 'i', 'U', 'S', '%', 'C', "x\xB2", "x\u2082"]; var mode = Cfg.addTextBtns; var html = ''; for (var i = 0, len = aib.markupTags.length; i < len; ++i) { var tag = aib.markupTags[i]; if (tag) { html += "
").concat(mode === 2 ? "".concat(!html ? '[' : '', " ").concat(val[i], " /") : mode === 3 ? "") : ""), "
"); } } el.innerHTML = "".concat(html, "
").concat(mode === 2 ? ' > ]' : mode === 3 ? '' : '', ""); } }, { key: "clearForm", value: function clearForm() { if (this.txta) { this.txta.value = ''; } if (this.files) { this.files.clearInputs(); } if (this.video) { this.video.value = ''; } } }, { key: "closeReply", value: function closeReply() { if (this.isQuick) { this.isQuick = false; this.lastQuickPNum = -1; if (!aib.t) { this._toggleQuickReply(false); this.tNum = false; } this.setReply(false, !aib.t || Cfg.addPostForm > 1); } } }, { key: "getSelectedText", value: function getSelectedText() { this.quotedText = deWindow.getSelection().toString(); } }, { key: "handleEvent", value: function handleEvent(e) { var el = e.target; if (el.tagName.toLowerCase() !== 'div') { el = el.parentNode; } var _el8 = el, id = _el8.id; if (!id.startsWith('de-btn')) { return; } if (e.type === 'mouseover') { if (id === 'de-btn-quote') { this.getSelectedText(); } var key = -1; if (HotKeys.enabled) { switch (id.substr(7)) { case 'bold': key = 12; break; case 'italic': key = 13; break; case 'strike': key = 14; break; case 'spoil': key = 15; break; case 'code': key = 16; } } KeyEditListener.setTitle(el, key); return; } var txtaEl = postform.txta; var start = txtaEl.selectionStart, end = txtaEl.selectionEnd; var quote = Cfg.spacedQuote ? '> ' : '>'; if (id === 'de-btn-quote') { insertText(txtaEl, quote + (start === end ? this.quotedText : txtaEl.value.substring(start, end)).replace(/^[\r\n]|[\r\n]+$/g, '').replace(/\n/gm, '\n' + quote) + (this.quotedText ? '\n' : '')); this.quotedText = ''; } else { var scrtop = txtaEl.scrtop, value = txtaEl.value; var val = PostForm._wrapText(el.getAttribute('de-tag'), value.substring(start, end)); var len = start + val[0]; txtaEl.value = value.substr(0, start) + val[1] + value.substr(end); txtaEl.setSelectionRange(len, len); txtaEl.focus(); txtaEl.scrollTop = scrtop; } e.preventDefault(); e.stopPropagation(); } }, { key: "refreshCaptchaTNum", value: function refreshCaptchaTNum() { var _this$captcha; var isError = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; (_this$captcha = this.captcha) === null || _this$captcha === void 0 || _this$captcha.refreshCaptcha(isError, isError, this.tNum); } }, { key: "setPlaceholders", value: function setPlaceholders() { if (aib.formHeaders || !aib.multiFile && Cfg.fileInputs === 2) { return; } this._setPlaceholder('name'); this._setPlaceholder('subj'); this._setPlaceholder('mail'); this._setPlaceholder('video'); if (this.captcha) { this._setPlaceholder('captcha'); } } }, { key: "setReply", value: function setReply(isQuick, needToHide) { if (isQuick) { this.qArea.firstChild.after(this.pForm); } else { this.pArea[+this.isBottom].after(this.qArea); this._pBtn[+this.isBottom].after(this.pForm); } this.isHidden = needToHide; $toggle(this.qArea, isQuick); $toggle(this.pForm, !needToHide); this.updatePAreaBtns(); } }, { key: "showMainReply", value: function showMainReply(isBottom, e) { this.closeReply(); if (!aib.t) { this.tNum = false; this.refreshCaptchaTNum(); } if (this.isBottom === isBottom) { $toggle(this.pForm, this.isHidden); this.isHidden = !this.isHidden; this.updatePAreaBtns(); } else { this.isBottom = isBottom; this.setReply(false, false); } if (e) { e.preventDefault(); } } }, { key: "showQuickReply", value: function showQuickReply(post, pNum, isCloseReply, isNumClick) { var isNoLink = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; if (!this.isQuick) { this.isQuick = true; this.setReply(true, false); $q('a', this._pBtn[+this.isBottom]).className = "link-button de-parea-btn-".concat(aib.t ? 'reply' : 'thr'); } else if (isCloseReply && !this.quotedText && post.wrap.nextElementSibling === this.qArea) { this.closeReply(); return; } post.wrap.after(this.qArea); if (this.qArea.classList.contains('de-win')) { updateWinZ(this.qArea); } var qNum = post.thr.num; if (!aib.t) { this._toggleQuickReply(qNum); } if (!this.form) { return; } if (!aib.t && this.tNum !== qNum) { this.tNum = qNum; this.refreshCaptchaTNum(); } this.tNum = qNum; var txt = this.txta.value; var isOnNewLine = txt === '' || txt.slice(-1) === '\n'; var link = isNoLink || post.isOp && !Cfg.addOPLink && !aib.t && !isNumClick ? '' : isNumClick ? ">>".concat(pNum).concat(isOnNewLine ? '\n' : '') : (isOnNewLine ? '' : '\n') + (this.lastQuickPNum === pNum && txt.includes('>>' + pNum) ? '' : ">>".concat(pNum, "\n")); var quote = this.quotedText ? "".concat(this.quotedText.replace(/^[\r\n]|[\r\n]+$/g, '').replace(/(^|\n)(.)/gm, "$1>".concat(Cfg.spacedQuote ? ' ' : '', "$2")), "\n") : ''; insertText(this.txta, link + quote); var winTitle = post.thr.op.title.trim(); $q('.de-win-title', this.qArea).textContent = (winTitle.length < 28 ? winTitle : "".concat(winTitle.substr(0, 30), "\u2026")) || "#".concat(pNum); this.lastQuickPNum = pNum; } }, { key: "toggleSage", value: function toggleSage() { if (!Cfg.addSageBtn || !this.mail) { return; } var isSage = Cfg.sageReply; this.sageBtn.style.opacity = isSage ? '1' : '.3'; this.sageBtn.title = isSage ? Lng.disableSage[lang] : Lng.enableSage[lang]; if (this.mail.type === 'text') { this.mail.value = isSage ? 'sage' : aib._4chan ? 'noko' : ''; } else { this.mail.checked = isSage; } } }, { key: "updatePAreaBtns", value: function updatePAreaBtns() { var txt = 'link-button de-parea-btn-'; var rep = aib.t ? 'reply' : 'thr'; $q('a', this._pBtn[+this.isBottom]).className = txt + (!this.pForm.style.display ? 'close' : rep); $q('a', this._pBtn[+!this.isBottom]).className = txt + rep; } }, { key: "_initAjaxPosting", value: function _initAjaxPosting() { var _this42 = this; var el; if (aib.qFormRedir && (el = $q(aib.qFormRedir, this.form))) { $hide(el.closest(aib.qFormTr)); el.checked = true; } this.form.onsubmit = function () { var _ref23 = _asyncToGenerator(_regenerator().m(function _callee28(e) { var data, _t28; return _regenerator().w(function (_context29) { while (1) switch (_context29.p = _context29.n) { case 0: e.preventDefault(); $popup('upload', Lng.sending[lang], true); _context29.p = 1; _context29.n = 2; return html5Submit(_this42.form, _this42.subm, true); case 2: data = _context29.v; _context29.n = 3; return checkSubmit(data); case 3: _context29.n = 5; break; case 4: _context29.p = 4; _t28 = _context29.v; showSubmitError(_t28); case 5: return _context29.a(2); } }, _callee28, null, [[1, 4]]); })); return function (_x15) { return _ref23.apply(this, arguments); }; }(); } }, { key: "_initCaptcha", value: function _initCaptcha() { var _this43 = this; var capEl = aib.getCaptchaEl(this.form); if (!capEl) { this.captcha = null; return; } this.captcha = new Captcha(capEl, this.tNum); var updCaptchaFn = function updCaptchaFn() { _this43.captcha.addCaptcha(); _this43.captcha.updateOutdated(); }; this.txta.addEventListener('focus', updCaptchaFn); if (this.files) { this.files.onchange = updCaptchaFn; } this.form.addEventListener('click', function () { return _this43.captcha.addCaptcha(); }, true); } }, { key: "_initFileInputs", value: function _initFileInputs() { var _aib$fixFileInputs, _aib2, _this44 = this; var fileEl = $q(aib.qFormFile, this.form); if (!fileEl) { return; } (_aib$fixFileInputs = (_aib2 = aib).fixFileInputs) === null || _aib$fixFileInputs === void 0 || _aib$fixFileInputs.call(_aib2, fileEl.closest(aib.qFormTd)); this.files = new Files(this, $q(aib.qFormFile, this.form)); deWindow.addEventListener('load', function () { return setTimeout(function () { return !_this44.files.filesCount && _this44.files.clearInputs(); }, 0); }); } }, { key: "_initSubmit", value: function _initSubmit() { var _this45 = this; this.subm.addEventListener('click', function (e) { var _this45$video$value; if (Cfg.warnSubjTrip && _this45.subj && /#.|##./.test(_this45.subj.value)) { e.preventDefault(); $popup('upload', Lng.subjHasTrip[lang]); return; } var val = _this45.txta.value; if (Spells.outreps) { val = Spells.outReplace(val); } if (_this45.tNum && pByNum.get(_this45.tNum).subj === 'Dollchan Extension Tools') { var temp = "\n\n".concat(PostForm._wrapText(aib.markupTags[5], "".concat('-'.repeat(50), "\n").concat(nav.userAgent, "\nv").concat(version, ".").concat(commit).concat(nav.isESNext ? '.es6' : '', " [").concat(nav.scriptHandler, "]"))[1]); if (!val.includes(temp)) { val += temp; } } _this45.txta.value = val; _this45.toggleSage(); if (Cfg.ajaxPosting) { $popup('upload', Lng.checking[lang], true); } if (_this45.video && (val = (_this45$video$value = _this45.video.value) === null || _this45$video$value === void 0 ? void 0 : _this45$video$value.match(Videos.ytReg))) { _this45.video.value = 'http://www.youtube.com/watch?v=' + val[1]; } if (_this45.isQuick) { $hide(_this45.pForm); $hide(_this45.qArea); _this45._pBtn[+_this45.isBottom].after(_this45.pForm); } updater.pauseUpdater(); }); } }, { key: "_initTextarea", value: function _initTextarea() { var _this46 = this; var el = this.txta; el.classList.add('de-textarea'); var style = el.style; style.setProperty('width', Cfg.textaWidth + 'px', 'important'); style.setProperty('height', Cfg.textaHeight + 'px', 'important'); el.addEventListener('keypress', function (e) { var code = e.charCode || e.keyCode; if ((code === 33 || code === 34 ) && e.which === 0) { e.target.blur(); deWindow.focus(); } }); el.addEventListener('paste', function () { var _ref24 = _asyncToGenerator(_regenerator().m(function _callee29(e) { var _e$clipboardData; var files, _iterator18, _step18, file, inputs, i, len, input; return _regenerator().w(function (_context30) { while (1) switch (_context30.n) { case 0: files = e === null || e === void 0 || (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.files; _iterator18 = _createForOfIteratorHelperLoose(files || []); case 1: if ((_step18 = _iterator18()).done) { _context30.n = 6; break; } file = _step18.value; inputs = _this46.files._inputs; i = 0, len = inputs.length; case 2: if (!(i < len)) { _context30.n = 5; break; } input = inputs[i]; if (input.hasFile) { _context30.n = 4; break; } _context30.n = 3; return input.addUrlFile(URL.createObjectURL(file), file); case 3: return _context30.a(3, 5); case 4: ++i; _context30.n = 2; break; case 5: _context30.n = 1; break; case 6: return _context30.a(2); } }, _callee29); })); return function (_x16) { return _ref24.apply(this, arguments); }; }()); if (nav.isFirefox || nav.isWebkit) { el.addEventListener('mouseup', function (_ref25) { var target = _ref25.target; var s = target.style; var width = s.width, height = s.height; s.setProperty('width', width + 'px', 'important'); s.setProperty('height', height + 'px', 'important'); CfgSaver.save('textaWidth', parseInt(width, 10), 'textaHeight', parseInt(height, 10)); }); return; } $aEnd(el, '
').addEventListener('mousedown', { _el: el, _elStyle: style, handleEvent: function handleEvent(e) { var _this47 = this; switch (e.type) { case 'mousedown': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this47); }); e.preventDefault(); return; case 'mousemove': { var cr = this._el.getBoundingClientRect(); this._elStyle.setProperty('width', e.clientX - cr.left + 'px', 'important'); this._elStyle.setProperty('height', e.clientY - cr.top + 'px', 'important'); return; } default: ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this47); }); CfgSaver.save('textaWidth', parseInt(this._elStyle.width, 10), 'textaHeight', parseInt(this._elStyle.height, 10)); } } }); } }, { key: "_makeHideableContainer", value: function _makeHideableContainer() { var _this48 = this; (this.pForm = $add('
')).append(this.form || '', this.oeForm || ''); var html = '

'; this.pArea = [$bBegin(DelForm.first.el, html), $aEnd(DelForm.first.el, html)]; this._pBtn = [this.pArea[0].firstChild, this.pArea[1].firstChild]; this._pBtn[0].firstElementChild.onclick = function (e) { return _this48.showMainReply(false, e); }; this._pBtn[1].firstElementChild.onclick = function (e) { return _this48.showMainReply(true, e); }; this.qArea = $add("
")); this.isBottom = Cfg.addPostForm === 1; this.setReply(false, !aib.t || Cfg.addPostForm > 1); } }, { key: "_makeWindow", value: function _makeWindow() { var _this49 = this; makeDraggable('reply', this.qArea, $aBegin(this.qArea, "
\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
")); var buttons = $q('.de-win-buttons', this.qArea); buttons.onmouseover = function (_ref26) { var target = _ref26.target; var el = target.parentNode; switch (target.classList[0]) { case 'de-win-btn-clear': el.title = Lng.clearForm[lang]; break; case 'de-win-btn-close': el.title = Lng.closeReply[lang]; break; case 'de-win-btn-toggle': el.title = Cfg.replyWinDrag ? Lng.underPost[lang] : Lng.makeDrag[lang]; } }; var _ref27 = _toConsumableArray(buttons.children), clearBtn = _ref27[0], toggleBtn = _ref27[1], closeBtn = _ref27[2]; clearBtn.onclick = _asyncToGenerator(_regenerator().m(function _callee30() { return _regenerator().w(function (_context31) { while (1) switch (_context31.n) { case 0: _context31.n = 1; return CfgSaver.save('sageReply', 0); case 1: _this49.toggleSage(); _this49.files.clearInputs(); [_this49.txta, _this49.name, _this49.mail, _this49.subj, _this49.video, _this49.captcha && _this49.captcha.textEl].forEach(function (el) { return el && (el.value = ''); }); case 2: return _context31.a(2); } }, _callee30); })); toggleBtn.onclick = _asyncToGenerator(_regenerator().m(function _callee31() { return _regenerator().w(function (_context32) { while (1) switch (_context32.n) { case 0: _context32.n = 1; return toggleCfg('replyWinDrag'); case 1: if (Cfg.replyWinDrag) { _this49.qArea.className = aib.cReply + ' de-win'; updateWinZ(_this49.qArea); } else { _this49.qArea.className = aib.cReply + ' de-win-inpost'; _this49.txta.focus(); } case 2: return _context32.a(2); } }, _callee31); })); closeBtn.onclick = function () { return _this49.closeReply(); }; } }, { key: "_setPlaceholder", value: function _setPlaceholder(val) { var el = val === 'captcha' ? this.captcha.textEl : this[val]; if (el) { if (aib.multiFile || Cfg.fileInputs !== 2) { el.placeholder = Lng[val][lang]; } else { el.removeAttribute('placeholder'); } } } }, { key: "_toggleQuickReply", value: function _toggleQuickReply(tNum) { if (this.oeForm) { var _$q3; (_$q3 = $q('input[name="oek_parent"]', this.oeForm)) === null || _$q3 === void 0 || _$q3.remove(); if (tNum) { this.oeForm.insertAdjacentHTML('afterbegin', "")); } } if (this.form) { var _$q4; if (aib.changeReplyMode && tNum !== this.tNum) { aib.changeReplyMode(this.form, tNum); } (_$q4 = $q("input[name=\"".concat(aib.formParent, "\"]"), this.form)) === null || _$q4 === void 0 || _$q4.remove(); if (tNum) { this.form.insertAdjacentHTML('afterbegin', "")); } } } }], [{ key: "hideField", value: function hideField(el) { var els = el.parentNode.children; var hideTr = true; for (var i = 0, len = els.length; i < len; ++i) { if (els[i] !== el && els[i].style.display !== 'none') { hideTr = false; break; } } $toggle(hideTr ? el.closest(aib.qFormTr) : el); } }, { key: "setUserName", value: function () { var _setUserName = _asyncToGenerator(_regenerator().m(function _callee32() { var el; return _regenerator().w(function (_context33) { while (1) switch (_context33.n) { case 0: el = $q('input[info="nameValue"]'); if (!el) { _context33.n = 1; break; } _context33.n = 1; return CfgSaver.save('nameValue', el.value); case 1: postform.name.value = Cfg.userName ? Cfg.nameValue : ''; case 2: return _context33.a(2); } }, _callee32); })); function setUserName() { return _setUserName.apply(this, arguments); } return setUserName; }() }, { key: "setUserPassw", value: function () { var _setUserPassw = _asyncToGenerator(_regenerator().m(function _callee33() { var el, value, _iterator19, _step19, passEl; return _regenerator().w(function (_context34) { while (1) switch (_context34.n) { case 0: if (Cfg.userPassw) { _context34.n = 1; break; } return _context34.a(2); case 1: el = $q('input[info="passwValue"]'); if (!el) { _context34.n = 2; break; } _context34.n = 2; return CfgSaver.save('passwValue', el.value); case 2: value = postform.passw.value = Cfg.passwValue; for (_iterator19 = _createForOfIteratorHelperLoose(DelForm); !(_step19 = _iterator19()).done;) { passEl = _step19.value.passEl; if (passEl) { passEl.value = value; } } case 3: return _context34.a(2); } }, _callee33); })); function setUserPassw() { return _setUserPassw.apply(this, arguments); } return setUserPassw; }() }, { key: "_wrapText", value: function _wrapText(tag, text) { var isBB = aib.markupBB; if (tag.startsWith('[')) { tag = tag.substr(1); isBB = true; } if (isBB) { if (text.includes('\n')) { var _str = "[".concat(tag, "]").concat(text, "[/").concat(tag, "]"); return [_str.length, _str]; } var _m = text.match(/^(\s*)(.*?)(\s*)$/); var str = "".concat(_m[1], "[").concat(tag, "]").concat(_m[2], "[/").concat(tag, "]").concat(_m[3]); return [!_m[2].length ? _m[1].length + tag.length + 2 : str.length, str]; } var m; var rv = ''; var i = 0; var arr = text.split('\n'); for (var len = arr.length; i < len; ++i) { m = arr[i].match(/^(\s*)(.*?)(\s*)$/); rv += '\n' + m[1] + (tag === '^H' ? m[2] + '^H'.repeat(m[2].length) : tag + m[2] + tag) + m[3]; } return [i === 1 && !m[2].length && tag !== '^H' ? m[1].length + tag.length : rv.length - 1, rv.slice(1)]; } }]); }(); function getSubmitError(dc) { var _dc$body; if (!((_dc$body = dc.body) !== null && _dc$body !== void 0 && _dc$body.hasChildNodes()) || $q(aib.qDelForm, dc)) { return null; } var err = _toConsumableArray($Q(aib.qError, dc)).map(function (str) { return str.innerHTML + '\n'; }).join('').replace(/]+>Назад.+/, '') || dc.body.innerHTML; return aib.isIgnoreError(err) ? null : err; } function showSubmitError(error) { if (postform.isQuick) { postform.setReply(true, false); } if (/[cf]aptch|капч|подтвер|verifi/i.test(error)) { postform.refreshCaptchaTNum(true); } $popup('upload', error.toString()); updater.sendErrNotif(); updater.continueUpdater(); DollchanAPI.notify('submitform', { success: false, error: error }); } function checkSubmit(_x17) { return _checkSubmit.apply(this, arguments); } function _checkSubmit() { _checkSubmit = _asyncToGenerator(_regenerator().m(function _callee55(data) { var error, postNum, isDocument, _aib$captchaAfterSubm, _aib8, _data, _aib$getSubmitData, _postform2, tNum, _pByNum$get3, thr, statsParam, dForm; return _regenerator().w(function (_context63) { while (1) switch (_context63.n) { case 0: error = null; postNum = null; isDocument = data instanceof Document; if (!aib.getSubmitData) { _context63.n = 3; break; } if (!aib.jsonSubmit) { _context63.n = 2; break; } if (!((_aib$captchaAfterSubm = (_aib8 = aib).captchaAfterSubmit) !== null && _aib$captchaAfterSubm !== void 0 && _aib$captchaAfterSubm.call(_aib8, data))) { _context63.n = 1; break; } return _context63.a(2); case 1: _data = (isDocument ? data.body.textContent : data).trim(); try { data = JSON.parse(_data); } catch (err) { error = getSubmitError(isDocument ? data : $createDoc(data)); } case 2: if (!error) { _aib$getSubmitData = aib.getSubmitData(data); error = _aib$getSubmitData.error; postNum = _aib$getSubmitData.postNum; } _context63.n = 4; break; case 3: error = getSubmitError(data); case 4: if (!error) { _context63.n = 5; break; } showSubmitError(error); return _context63.a(2); case 5: _postform2 = postform, tNum = _postform2.tNum; if ((Cfg.markMyPosts || Cfg.markMyLinks) && postNum) { MyPosts.set(postNum, tNum || postNum); } if (Cfg.favOnReply && !Cfg.sageReply) { if (tNum) { _pByNum$get3 = pByNum.get(tNum), thr = _pByNum$get3.thr; if (!thr.isFav) { thr.toggleFavState(true); } } else { sesStorage['de-fav-newthr'] = JSON.stringify({ num: postNum, date: Date.now() }); } } postform.clearForm(); DollchanAPI.notify('submitform', { success: true, num: postNum }); statsParam = tNum ? 'reply' : 'op'; Cfg.stats[statsParam]++; _context63.n = 6; return CfgSaver.saveObj(aib.domain, function (loadedCfg) { loadedCfg.stats[statsParam]++; return loadedCfg; }); case 6: if (tNum) { _context63.n = 7; break; } if (postNum) { deWindow.location.assign(aib.getThrUrl(aib.b, postNum)); } else if (isDocument) { dForm = $q(aib.qDelForm, data); if (dForm) { deWindow.location.assign(aib.getThrUrl(aib.b, aib.getTNum(dForm))); } } return _context63.a(2); case 7: if (aib.t) { Post.clearMarks(); Thread.first.loadNewPosts().then(function () { return AjaxError.Success; }, function (err) { return err; }).then(function (err) { infoLoadErrors(err); if (Cfg.scrAfterRep) { scrollTo(0, deWindow.pageYOffset + Thread.first.last.el.getBoundingClientRect().top); } updater.continueUpdater(true); closePopup('upload'); }); } else { pByNum.get(tNum).thr.loadPosts('new', false, false).then(function () { return closePopup('upload'); }); } postform.closeReply(); postform.refreshCaptchaTNum(); case 8: return _context63.a(2); } }, _callee55); })); return _checkSubmit.apply(this, arguments); } function checkDelete(_x18) { return _checkDelete.apply(this, arguments); } function _checkDelete() { _checkDelete = _asyncToGenerator(_regenerator().m(function _callee56(data) { var err, els, threads, isThr, i, len, el; return _regenerator().w(function (_context64) { while (1) switch (_context64.n) { case 0: err = getSubmitError(data instanceof Document ? data : $createDoc(data)); if (!err) { _context64.n = 1; break; } $popup('delete', Lng.errDelete[lang] + ':\n' + err); updater.sendErrNotif(); return _context64.a(2); case 1: els = $Q("[de-form] ".concat(aib.qPost.split(', ').join(' input:checked, [de-form] '), " input:checked")); threads = new Set(); isThr = aib.t; for (i = 0, len = els.length; i < len; ++i) { el = els[i]; el.checked = false; if (!isThr) { threads.add(aib.getPostOfEl(el).thr); } } if (!isThr) { _context64.n = 3; break; } Post.clearMarks(); _context64.n = 2; return Thread.first.loadNewPosts()["catch"](function (err) { return infoLoadErrors(err); }); case 2: _context64.n = 4; break; case 3: _context64.n = 4; return Promise.all(_toConsumableArray(threads).map(function (thr) { return thr.loadPosts('new', false, false); })); case 4: $popup('delete', Lng.succDeleted[lang]); case 5: return _context64.a(2); } }, _callee56); })); return _checkDelete.apply(this, arguments); } function isFormElDisabled(el) { switch (el.tagName.toLowerCase()) { case 'button': case 'input': case 'select': case 'textarea': if (el.hasAttribute('disabled')) { return true; } default: if (nav.matchesSelector(el, 'fieldset[disabled] > :not(legend):not(:first-of-type) *')) { return true; } } return false; } function getFormElements(form, submitter) { var controls, fixName, i, len, field, tag, type, name, options, j, jlen, option, img, files, _j2, _jlen, dirname, _t29; return _regenerator().w(function (_context35) { while (1) switch (_context35.n) { case 0: controls = $Q('button, input, keygen, object, select, textarea', form); fixName = function fixName(name) { return name ? name.replace(/([^\r])\n|\r([^\n])/g, '$1\r\n$2') : ''; }; i = 0, len = controls.length; case 1: if (!(i < len)) { _context35.n = 23; break; } field = controls[i]; tag = field.tagName.toLowerCase(); type = field.getAttribute('type'); name = field.getAttribute('name'); if (!(field.closest('datalist') || isFormElDisabled(field) || field !== submitter && (tag === 'button' || tag === 'input' && (type === 'submit' || type === 'reset' || type === 'button')) || tag === 'input' && (type === 'checkbox' && !field.checked || type === 'radio' && !field.checked || type === 'image' && !name) || tag === 'object')) { _context35.n = 2; break; } return _context35.a(3, 22); case 2: if (!(tag === 'select')) { _context35.n = 6; break; } options = $Q('select > option, select > optgrout > option', field); j = 0, jlen = options.length; case 3: if (!(j < jlen)) { _context35.n = 5; break; } option = options[j]; if (!(option.selected && !isFormElDisabled(option))) { _context35.n = 4; break; } _context35.n = 4; return { type: type, el: field, name: fixName(name), value: option.value }; case 4: ++j; _context35.n = 3; break; case 5: _context35.n = 18; break; case 6: if (!(tag === 'input')) { _context35.n = 18; break; } _t29 = type; _context35.n = _t29 === 'image' ? 7 : _t29 === 'checkbox' ? 8 : _t29 === 'radio' ? 8 : _t29 === 'file' ? 10 : 18; break; case 7: throw new Error('input[type="image"] is not supported'); case 8: _context35.n = 9; return { type: type, el: field, name: fixName(name), value: field.value || 'on' }; case 9: return _context35.a(3, 22); case 10: img = void 0; if (!field.files.length) { _context35.n = 14; break; } files = field.files; _j2 = 0, _jlen = files.length; case 11: if (!(_j2 < _jlen)) { _context35.n = 13; break; } _context35.n = 12; return { name: name, type: type, el: field, value: files[_j2] }; case 12: ++_j2; _context35.n = 11; break; case 13: _context35.n = 17; break; case 14: if (!(field.obj && (img = field.obj.imgFile))) { _context35.n = 16; break; } _context35.n = 15; return { name: name, type: type, el: field, value: new File([img.data], img.name, { type: img.type }) }; case 15: _context35.n = 17; break; case 16: _context35.n = 17; return aib.getEmptyFile(field, fixName(name)); case 17: return _context35.a(3, 22); case 18: if (!(type === 'textarea')) { _context35.n = 20; break; } _context35.n = 19; return { type: type, el: field, name: name || '', value: field.value }; case 19: _context35.n = 21; break; case 20: _context35.n = 21; return { type: type, el: field, name: fixName(name), value: field.value }; case 21: dirname = field.getAttribute('dirname'); if (!dirname) { _context35.n = 22; break; } _context35.n = 22; return { el: field, name: fixName(dirname), type: 'direction', value: nav.matchesSelector(field, ':dir(rtl)') ? 'rtl' : 'ltr' }; case 22: ++i; _context35.n = 1; break; case 23: return _context35.a(2); } }, _marked); } function getUploadFunc() { $popup('upload', Lng.sending[lang] + '
' + ' / ()
', true); var isInited = false; var beginTime = Date.now(); var progress = $id('de-uploadprogress'); var counterWrap = progress.nextElementSibling; var _ref30 = _toConsumableArray(counterWrap.children), counterEl = _ref30[0], totalEl = _ref30[1], speedEl = _ref30[2]; return function (_ref31) { var total = _ref31.total, i = _ref31.loaded; if (!isInited) { progress.setAttribute('max', total); $show(progress); totalEl.textContent = prettifySize(total); $show(counterWrap); isInited = true; } progress.value = i; counterEl.textContent = prettifySize(i); speedEl.textContent = "".concat(prettifySize(1e3 * i / (Date.now() - beginTime)), "/").concat(Lng.second[lang]); }; } function html5Submit(_x19, _x20) { return _html5Submit.apply(this, arguments); } function _html5Submit() { _html5Submit = _asyncToGenerator(_regenerator().m(function _callee57(form, submitter) { var needProgress, data, hasFiles, _iterator34, _step34, _step34$value, name, value, type, el, val, _el$obj, fileName, newFileName, mime, cleanData, ajaxParams, _args65 = arguments, _t50; return _regenerator().w(function (_context65) { while (1) switch (_context65.n) { case 0: needProgress = _args65.length > 2 && _args65[2] !== undefined ? _args65[2] : false; data = new FormData(); hasFiles = false; _iterator34 = _createForOfIteratorHelperLoose(getFormElements(form, submitter)); case 1: if ((_step34 = _iterator34()).done) { _context65.n = 8; break; } _step34$value = _step34.value, name = _step34$value.name, value = _step34$value.value, type = _step34$value.type, el = _step34$value.el; val = value; if (!(name === 'de-file-txt')) { _context65.n = 2; break; } return _context65.a(3, 7); case 2: if (!(type === 'file')) { _context65.n = 6; break; } hasFiles = true; fileName = value.name; newFileName = !Cfg.removeFName || (_el$obj = el.obj) !== null && _el$obj !== void 0 && (_el$obj = _el$obj.imgFile) !== null && _el$obj !== void 0 && _el$obj.isCustomName ? fileName : (Cfg.removeFName === 1 ? '' : Date.now() - (Cfg.removeFName === 2 ? 0 : Math.round(Math.random() * 15768e7))) + '.' + getFileExt(fileName); mime = value.type; if (!((Cfg.postSameImg || Cfg.removeEXIF) && (mime === 'image/jpeg' || mime === 'image/png' || mime === 'image/gif' || mime === 'video/webm'))) { _context65.n = 5; break; } _t50 = cleanFile; _context65.n = 3; return readFile(value); case 3: cleanData = _t50(_context65.v.data, el.obj ? el.obj.extraFile : null); if (cleanData) { _context65.n = 4; break; } return _context65.a(2, Promise.reject(new Error(Lng.fileCorrupt[lang] + ': ' + fileName))); case 4: val = new File(cleanData, newFileName, { type: mime }); _context65.n = 6; break; case 5: if (Cfg.removeFName) { val = new File([value], newFileName, { type: mime }); } case 6: data.append(name, val); case 7: _context65.n = 1; break; case 8: if (!aib.sendHTML5Post) { _context65.n = 9; break; } return _context65.a(2, aib.sendHTML5Post(form, data, needProgress, hasFiles)); case 9: ajaxParams = { data: data, method: 'POST' }; if (needProgress && hasFiles) { ajaxParams.onprogress = getUploadFunc(); } return _context65.a(2, $ajax(form.action, ajaxParams).then(function (_ref60) { var text = _ref60.responseText; return aib.jsonSubmit ? text : $createDoc(text); })["catch"](function (err) { return Promise.reject(err); })); } }, _callee57); })); return _html5Submit.apply(this, arguments); } function cleanFile(data, extraData) { var img = nav.unsafeUint8Array(data); var rand = Cfg.postSameImg && String(Math.round(Math.random() * 1e6)); var rv = extraData ? rand ? [img, extraData, rand] : [img, extraData] : rand ? [img, rand] : [img]; var rExif = !!Cfg.removeEXIF; if (!rand && !rExif && !extraData) { return rv; } var i, len, val, lIdx, jpgDat; var subarray = function subarray(begin, end) { return nav.unsafeUint8Array(data, begin, end - begin); }; if (img[0] === 0xFF && img[1] === 0xD8) { var deep = 1; for (i = 2, len = img.length - 1, val = [null, null], lIdx = 2, jpgDat = null; i < len;) { if (img[i] === 0xFF) { if (rExif) { if (!jpgDat && deep === 1) { if (img[i + 1] === 0xE1 && img[i + 4] === 0x45) { jpgDat = readExif(data, i + 10, (img[i + 2] << 8) + img[i + 3]); } else if (img[i + 1] === 0xE0 && img[i + 7] === 0x46 && (img[i + 2] !== 0 || img[i + 3] >= 0x0E || img[i + 15] !== 0xFF)) { jpgDat = subarray(i + 11, i + 16); } } if (img[i + 1] >> 4 === 0xE && img[i + 1] !== 0xEE || img[i + 1] === 0xFE) { if (lIdx !== i) { val.push(subarray(lIdx, i)); } i += 2 + (img[i + 2] << 8) + img[i + 3]; lIdx = i; continue; } } else if (img[i + 1] === 0xD8) { deep++; i++; continue; } if (img[i + 1] === 0xD9 && --deep === 0) { break; } } i++; } i += 2; if (!extraData && len - i > 75) { i = len; } if (lIdx === 2) { if (i < len) { rv[0] = nav.unsafeUint8Array(data, 0, i); } return rv; } val[0] = new Uint8Array([0xFF, 0xD8, 0xFF, 0xE0, 0, 0x0E, 0x4A, 0x46, 0x49, 0x46, 0, 1, 1]); val[1] = jpgDat || new Uint8Array([0, 0, 1, 0, 1]); val.push(subarray(lIdx, i)); if (extraData) { val.push(extraData); } if (rand) { val.push(rand); } return val; } if (img[0] === 0x89 && img[1] === 0x50) { for (i = 0, len = img.length - 7; i < len && (img[i] !== 0x49 || img[i + 1] !== 0x45 || img[i + 2] !== 0x4E || img[i + 3] !== 0x44); ++i) ; i += 8; if (i !== len && (extraData || len - i <= 75)) { rv[0] = nav.unsafeUint8Array(data, 0, i); } return rv; } if (img[0] === 0x47 && img[1] === 0x49 && img[2] === 0x46) { i = len = img.length; while (i && img[--i - 1] !== 0x00 && img[i] !== 0x3B) ; if (++i !== len) { rv[0] = nav.unsafeUint8Array(data, 0, i); } return rv; } if (img[0] === 0x1a && img[1] === 0x45 && img[2] === 0xDF && img[3] === 0xA3) { return new WebmParser(data).addWebmData(rand).getWebmData(); } return null; } function readExif(data, offset, len) { var xRes = 0; var yRes = 0; var resT = 0; var dv = nav.unsafeDataView(data, offset); var le = String.fromCharCode(dv.getUint8(0), dv.getUint8(1)) !== 'MM'; if (dv.getUint16(2, le) !== 0x2A) { return null; } var i = dv.getUint32(4, le); if (i > len) { return null; } for (var j = 0, tgLen = dv.getUint16(i, le); j < tgLen; ++j) { var dE = i + 2 + 12 * j; var tag = dv.getUint16(dE, le); if (tag === 0x0128) { resT = dv.getUint16(dE + 8, le) - 1; } else if (tag === 0x011A || tag === 0x011B) { dE = dv.getUint32(dE + 8, le); if (dE > len) { return null; } if (tag === 0x11A) { xRes = Math.round(dv.getUint32(dE, le) / dv.getUint32(dE + 4, le)); } else { yRes = Math.round(dv.getUint32(dE, le) / dv.getUint32(dE + 4, le)); } } } xRes = xRes || yRes; yRes = yRes || xRes; return new Uint8Array([resT & 0xFF, xRes >> 8, xRes & 0xFF, yRes >> 8, yRes & 0xFF]); } var Files = function () { function Files(form, fileEl) { _classCallCheck(this, Files); this.filesCount = 0; this.fileTr = fileEl.closest(aib.qFormTr); this.onchange = null; this._form = form; this._inputs = []; var els = $Q('input[type="file"]', this.fileTr); for (var i = 0, len = els.length; i < len; ++i) { this._inputs.push(new FileInput(this, els[i])); } this._files = []; this.hideEmpty(); } return _createClass(Files, [{ key: "rarInput", get: function get() { var value = $bEnd(doc.body, ''); Object.defineProperty(this, 'rarInput', { value: value }); return value; } }, { key: "thumbsEl", get: function get() { var value; if (aib.multiFile) { value = $aEnd(this.fileTr, '
'); } else { value = this._form.txta.closest(aib.qFormTd).previousElementSibling; value.innerHTML = "
".concat(value.innerHTML, "
"); value = value.lastChild; } Object.defineProperty(this, 'thumbsEl', { value: value }); return value; } }, { key: "changeMode", value: function changeMode() { var isThumbMode = Cfg.fileInputs === 2; for (var _iterator20 = _createForOfIteratorHelperLoose(this._inputs), _step20; !(_step20 = _iterator20()).done;) { var inp = _step20.value; inp.changeMode(isThumbMode); } this.hideEmpty(); } }, { key: "clearInputs", value: function clearInputs() { var _aib$clearFileInputs, _aib3; for (var _iterator21 = _createForOfIteratorHelperLoose(this._inputs), _step21; !(_step21 = _iterator21()).done;) { var inp = _step21.value; inp.clearInp(); } this.hideEmpty(); (_aib$clearFileInputs = (_aib3 = aib).clearFileInputs) === null || _aib$clearFileInputs === void 0 || _aib$clearFileInputs.call(_aib3); } }, { key: "hideEmpty", value: function hideEmpty() { for (var els = this._inputs, i = els.length - 1; i > 0; --i) { var inp = els[i]; if (inp.hasFile) { break; } else if (els[i - 1].hasFile) { inp.showInp(); break; } inp.hideInp(); } } }]); }(); var FileInput = function () { function FileInput(parent, el) { var _el$files; _classCallCheck(this, FileInput); this.extraFile = null; this.hasFile = false; this.imgFile = null; this._input = el; this._isTxtEditable = false; this._isTxtEditName = false; this._mediaEl = null; this._parent = parent; this._rarMsg = null; this._spoilEl = $q(aib.qFormSpoiler, el.parentNode); this._thumb = null; this._utils = $add("
\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t
")); var _ref32 = _toConsumableArray(this._utils.children); this._btnRar = _ref32[0]; this._btnSpoil = _ref32[1]; this._btnTxt = _ref32[2]; this._btnRen = _ref32[3]; this._btnDel = _ref32[4]; this._utils.addEventListener('click', this); this._txtWrap = $add("\n\t\t\t\n\t\t\t")); var _ref33 = _toConsumableArray(this._txtWrap.children); this._txtInput = _ref33[0]; this._txtAddBtn = _ref33[1]; this._txtWrap.addEventListener('click', this); this._toggleDragEvents(this._txtWrap, true); el.obj = this; el.classList.add('de-file-input'); el.addEventListener('change', this); if ((_el$files = el.files) !== null && _el$files !== void 0 && _el$files[0]) { this._removeFile(); } if (Cfg.fileInputs) { $hide(el); if (aib.multiFile) { this._input.setAttribute('multiple', true); } } if (FileInput._isThumbMode) { this._initThumbs(); } else { this._initUtils(); } } return _createClass(FileInput, [{ key: "addUrlFile", value: function () { var _addUrlFile = _asyncToGenerator(_regenerator().m(function _callee34(url) { var _this50 = this; var file, _args36 = arguments; return _regenerator().w(function (_context36) { while (1) switch (_context36.n) { case 0: file = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : null; if (url) { _context36.n = 1; break; } return _context36.a(2, Promise.reject(new Error('URL is null'))); case 1: $popup('file-loading', Lng.loading[lang], true); _context36.n = 2; return ContentLoader.loadFileData(url, false).then(function (data) { var _file, _file2; if (file) { deWindow.URL.revokeObjectURL(url); } if (!data) { $popup('file-loading', Lng.cantLoad[lang] + ' URL: ' + url); return; } closePopup('file-loading'); _this50._isTxtEditable = _this50._isTxtEditName = false; var name = ((_file = file) === null || _file === void 0 ? void 0 : _file.name) || getFileName(url); var type = ((_file2 = file) === null || _file2 === void 0 ? void 0 : _file2.type) || getFileMime(name); if (!type || name.includes('?')) { var ext; switch (data[0] << 8 | data[1]) { case 0xFFD8: ext = 'jpg'; break; case 0x8950: ext = 'png'; break; case 0x4749: ext = 'gif'; break; case 0x1A45: ext = 'webm'; break; default: ext = ''; } if (ext) { name = name.split('?').shift() + '.' + ext; } } _this50.imgFile = { data: data.buffer, name: name, type: type || getFileMime(name) }; if (!file) { file = new Blob([data], { type: _this50.imgFile.type }); file.name = name; } _this50._parent._files[_this50._parent._inputs.indexOf(_this50)] = file; DollchanAPI.notify('filechange', _this50._parent._files); if (FileInput._isThumbMode) { $hide(_this50._txtWrap); } _this50._onFileChange(true); }); case 2: return _context36.a(2, _context36.v); } }, _callee34); })); function addUrlFile(_x21) { return _addUrlFile.apply(this, arguments); } return addUrlFile; }() }, { key: "changeMode", value: function changeMode(showThumbs) { var _$q5; $toggle(this._input, !Cfg.fileInputs); this._input.toggleAttribute('multiple', aib.multiFile && Cfg.fileInputs); $toggle(this._btnRen, Cfg.fileInputs && this.hasFile); if (!(showThumbs ^ !!this._thumb)) { return; } if (showThumbs) { this._initThumbs(); return; } this._initUtils(); $show(this._parent.fileTr); $show(this._txtWrap); if (this._mediaEl) { deWindow.URL.revokeObjectURL(this._mediaEl.src); } this._toggleDragEvents(this._thumb, false); (_$q5 = $q('.de-file-txt-area')) === null || _$q5 === void 0 || _$q5.remove(); this._thumb.remove(); this._thumb = this._mediaEl = null; } }, { key: "clearInp", value: function clearInp() { if (FileInput._isThumbMode) { this._thumb.classList.add('de-file-off'); if (this._mediaEl) { deWindow.URL.revokeObjectURL(this._mediaEl.src); this._mediaEl.parentNode.title = Lng.youCanDrag[lang]; this._mediaEl.remove(); this._mediaEl = null; } } if (this._btnDel) { var _this$_rarMsg; this._toggleDelBtn(false); $hide(this._btnSpoil); if (this._spoilEl) { this._spoilEl.checked = this._btnSpoil.checked = false; } $hide(this._btnRar); $hide(this._txtAddBtn); (_this$_rarMsg = this._rarMsg) === null || _this$_rarMsg === void 0 || _this$_rarMsg.remove(); if (FileInput._isThumbMode) { $hide(this._txtWrap); } this._txtInput.value = ''; this._txtInput.classList.add('de-file-txt-noedit'); this._txtInput.placeholder = Lng.dropFileHere[lang]; } this.extraFile = this.imgFile = null; this._isTxtEditable = this._isTxtEditName = false; this._changeFilesCount(-1); this._removeFile(); } }, { key: "handleEvent", value: function handleEvent(e) { var _this51 = this; var el = e.target; var thumb = this._thumb; var isThumb = el === thumb || el.className === 'de-file-img'; switch (e.type) { case 'change': { var inpArray = this._parent._inputs; var curInpIdx = inpArray.indexOf(this); var filesLen = el.files.length; if (filesLen > 1) { var allowedLen = Math.min(filesLen, inpArray.length - curInpIdx); var j = allowedLen; for (var i = 0; i < allowedLen; ++i) { FileInput._readDroppedFile(inpArray[curInpIdx + i], el.files[i]).then(function () { if (! --j) { _this51._removeFileHelper(); } }); this._parent._files[curInpIdx + i] = el.files[i]; } } else { if (filesLen > 0) { setTimeout(function () { return _this51._onFileChange(false); }, 20); this._parent._files[curInpIdx] = el.files[0]; } else { this.clearInp(); delete this._parent._files[curInpIdx]; } } DollchanAPI.notify('filechange', this._parent._files); break; } case 'click': { var parent = el.parentNode; if (isThumb) { this._input.click(); } else if (parent === this._btnDel) { this.clearInp(); this._parent.hideEmpty(); delete this._parent._files[this._parent._inputs.indexOf(this)]; DollchanAPI.notify('filechange', this._parent._files); } else if (parent === this._btnRar) { this._addRarJpeg(); } else if (parent === this._btnRen) { var isShow = this._isTxtEditName = !this._isTxtEditName; this._isTxtEditable = !this._isTxtEditable; if (FileInput._isThumbMode) { $toggle(this._txtWrap, isShow); } $toggle(this._txtAddBtn, isShow); this._txtInput.classList.toggle('de-file-txt-noedit', !isShow); if (isShow) { this._txtInput.focus(); } } else if (parent === this._btnTxt) { this._toggleDelBtn(this._isTxtEditable = true); $show(this._txtAddBtn); if (FileInput._isThumbMode) { $toggle(this._txtWrap); } this._txtInput.classList.remove('de-file-txt-noedit'); this._txtInput.placeholder = Lng.enterTheLink[lang]; this._txtInput.focus(); } else if (el === this._btnSpoil) { this._spoilEl.checked = this._btnSpoil.checked; return; } else if (el === this._txtAddBtn) { if (this._isTxtEditName) { if (FileInput._isThumbMode) { $hide(this._txtWrap); } $hide(this._txtAddBtn); this._txtInput.classList.add('de-file-txt-noedit'); this._isTxtEditable = this._isTxtEditName = false; var newName = this._txtInput.value; if (!newName) { this._txtInput.value = this.imgFile ? this.imgFile.name : this._input.files[0].name; return; } if (this.imgFile) { this.imgFile.isCustomName = true; this.imgFile.name = newName; if (FileInput._isThumbMode) { this._addThumbTitle(newName, this.imgFile.data.byteLength); } return; } var file = this._input.files[0]; readFile(file).then(function (_ref34) { var data = _ref34.data; _this51.imgFile = { data: data, name: newName, type: file.type, isCustomName: true }; _this51._removeFileHelper(); if (FileInput._isThumbMode) { _this51._addThumbTitle(newName, data.byteLength); } }); return; } else { this.addUrlFile(this._txtInput.value); } } else if (el === this._txtInput && !this._isTxtEditable) { this._input.click(); this._txtInput.blur(); } break; } case 'dragenter': if (isThumb) { thumb.classList.add('de-file-drag'); } return; case 'dragleave': if (isThumb && el.classList.contains('de-file-img')) { thumb.classList.remove('de-file-drag'); } return; case 'drop': { var dt = e.dataTransfer; if (!isThumb && el !== this._txtInput) { return; } var _filesLen = dt.files.length; if (_filesLen) { var _inpArray = this._parent._inputs; var inpLen = _inpArray.length; for (var _i10 = _inpArray.indexOf(this), _j3 = 0; _i10 < inpLen && _j3 < _filesLen; ++_i10, ++_j3) { FileInput._readDroppedFile(_inpArray[_i10], dt.files[_j3]); this._parent._files[_i10] = dt.files[_j3]; } DollchanAPI.notify('filechange', this._parent._files); } else { this.addUrlFile(dt.getData('text/plain')); } if (FileInput._isThumbMode) { setTimeout(function () { return thumb.classList.remove('de-file-drag'); }, 10); } } } e.preventDefault(); e.stopPropagation(); } }, { key: "hideInp", value: function hideInp() { if (FileInput._isThumbMode) { this._toggleDelBtn(false); $hide(this._thumb); $hide(this._txtWrap); } $hide(this._wrap); } }, { key: "showInp", value: function showInp() { if (FileInput._isThumbMode) { $show(this._thumb); } $show(this._wrap); } }, { key: "_wrap", get: function get() { return aib.multiFile ? this._input.parentNode : this._input; } }, { key: "_addNewThumb", value: function _addNewThumb(fileData, fileName, fileType, fileSize) { var el = this._thumb; el.classList.remove('de-file-off'); el = el.firstChild.firstChild; el.title = "".concat(fileName, ", ").concat((fileSize / 1024).toFixed(2), "KB"); this._mediaEl = el = $aBegin(el, fileType.startsWith('video/') ? '' : ''); el.src = deWindow.URL.createObjectURL(new Blob([fileData])); if (el = el.nextSibling) { deWindow.URL.revokeObjectURL(el.src); el.remove(); } } }, { key: "_addRarJpeg", value: function _addRarJpeg() { var _this52 = this; var el = this._parent.rarInput; el.onchange = function (e) { $hide(_this52._btnRar); var myBtn = _this52._rarMsg = $aBegin(_this52._utils, ''); var file = e.target.files[0]; readFile(file).then(function (_ref35) { var data = _ref35.data; if (_this52._rarMsg === myBtn) { myBtn.className = 'de-file-rarmsg'; var origFileName = _this52.imgFile ? _this52.imgFile.name : _this52._input.files[0].name; myBtn.title = origFileName + ' + ' + file.name; myBtn.textContent = getFileExt(origFileName) + ' + ' + getFileExt(file.name); _this52.extraFile = data; } }); }; el.click(); } }, { key: "_addThumbTitle", value: function _addThumbTitle(name, size) { this._thumb.firstChild.firstChild.title = "".concat(name, ", ").concat((size / 1024).toFixed(2), "KB"); } }, { key: "_changeFilesCount", value: function _changeFilesCount(val) { this._parent.filesCount = Math.max(this._parent.filesCount + val, 0); } }, { key: "_initThumbs", value: function _initThumbs() { var _this53 = this; var fileTr = this._parent.fileTr; $hide(fileTr); $hide(this._txtWrap); var isTr = fileTr.tagName.toLowerCase() === 'tr'; var txtArea = $q('.de-file-txt-area') || $bBegin(fileTr, isTr ? '' : '
'); (isTr ? txtArea.lastChild : txtArea).append(this._txtWrap); this._thumb = $bEnd(this._parent.thumbsEl, "
")); ['click', 'dragenter'].forEach(function (e) { return _this53._thumb.addEventListener(e, _this53); }); this._thumb.append(this._utils); this._toggleDragEvents(this._thumb, true); if (this.hasFile) { this._showFileThumb(); } } }, { key: "_initUtils", value: function _initUtils() { this._input.parentNode.classList.add('de-file-wrap'); this._input.before(this._txtWrap); this._input.after(this._utils); } }, { key: "_onFileChange", value: function _onFileChange(hasImgFile) { var _this$_parent$onchang, _this$_parent; this._txtInput.value = hasImgFile ? this.imgFile.name : this._input.files[0].name; if (!hasImgFile) { this.imgFile = null; } (_this$_parent$onchang = (_this$_parent = this._parent).onchange) === null || _this$_parent$onchang === void 0 || _this$_parent$onchang.call(_this$_parent); if (FileInput._isThumbMode) { this._showFileThumb(); } if (this.hasFile) { this.extraFile = null; } else { this.hasFile = true; this._changeFilesCount(+1); this._toggleDelBtn(true); $hide(this._txtAddBtn); if (FileInput._isThumbMode) { $hide(this._txtWrap); } if (this._spoilEl) { this._btnSpoil.checked = this._spoilEl.checked; $show(this._btnSpoil); } this._txtInput.classList.add('de-file-txt-noedit'); this._txtInput.placeholder = Lng.dropFileHere[lang]; } this._parent.hideEmpty(); if (!aib._4chan && /^image\/(?:png|jpeg)$/.test(hasImgFile ? this.imgFile.type : this._input.files[0].type)) { var _this$_rarMsg2; (_this$_rarMsg2 = this._rarMsg) === null || _this$_rarMsg2 === void 0 || _this$_rarMsg2.remove(); $show(this._btnRar); } } }, { key: "_removeFile", value: function _removeFile() { this._removeFileHelper(); this.hasFile = false; if (this._parent._files) { delete this._parent._files[this._parent._inputs.indexOf(this)]; } } }, { key: "_removeFileHelper", value: function _removeFileHelper() { var oldEl = this._input; var newEl = $aEnd(oldEl, oldEl.outerHTML); oldEl.removeEventListener('change', this); newEl.addEventListener('change', this); newEl.obj = this; this._input = newEl; oldEl.remove(); } }, { key: "_showFileThumb", value: function _showFileThumb() { var _this54 = this; var imgFile = this.imgFile; if (imgFile) { this._addNewThumb(imgFile.data, imgFile.name, imgFile.type, imgFile.data.byteLength); return; } var file = this._input.files[0]; if (file) { readFile(file).then(function (_ref36) { var data = _ref36.data; if (_this54._input.files[0] === file) { _this54._addNewThumb(data, file.name, file.type, file.size); } }); } } }, { key: "_toggleDelBtn", value: function _toggleDelBtn(isShow) { $toggle(this._btnDel, isShow); $toggle(this._btnRen, Cfg.fileInputs && isShow && this.hasFile); $toggle(this._btnTxt, !isShow); } }, { key: "_toggleDragEvents", value: function _toggleDragEvents(el, isAdd) { var _this55 = this; var name = isAdd ? 'addEventListener' : 'removeEventListener'; el[name]('dragover', function (e) { return e.preventDefault(); }); ['dragenter', 'dragleave', 'drop'].forEach(function (e) { return el[name](e, _this55); }); } }], [{ key: "_isThumbMode", get: function get() { return Cfg.fileInputs === 2; } }, { key: "_readDroppedFile", value: function _readDroppedFile(inputObj, file) { return readFile(file).then(function (_ref37) { var data = _ref37.data; inputObj.imgFile = { data: data, name: file.name, type: file.type }; inputObj.showInp(); inputObj._onFileChange(true); }); } }]); }(); var Captcha = function () { function Captcha(el, initNum) { _classCallCheck(this, Captcha); this.hasCaptcha = true; this.textEl = null; this.tNum = initNum; this.parentEl = nav.matchesSelector(el, aib.qFormTr) ? el : aib.getCaptchaParent(el); this.isAdded = false; this._isHcap = !!$q('.h-captcha', this.parentEl); this._isRecap = this._isHcap || !!$q('[id*="recaptcha"], [class*="recaptcha"]', this.parentEl); this._lastUpdate = null; this.originHTML = this.parentEl.innerHTML; $hide(this.parentEl); if (!this._isRecap) { this.parentEl.innerHTML = ''; } } return _createClass(Captcha, [{ key: "addCaptcha", value: function addCaptcha() { var _aib$captchaInit, _aib4, _this56 = this; if (this.isAdded) { return; } this.isAdded = true; if (this._isHcap) { $show(this.parentEl); } else if (this._isRecap) { var el = $q('#g-recaptcha, .g-recaptcha'); el.insertAdjacentHTML('afterend', "
")); el.remove(); } else { this.parentEl.innerHTML = this.originHTML; this.textEl = $q('input[type="text"][name*="aptcha"]', this.parentEl); } var initPromise = (_aib$captchaInit = (_aib4 = aib).captchaInit) === null || _aib$captchaInit === void 0 ? void 0 : _aib$captchaInit.call(_aib4, this); if (initPromise) { initPromise.then(function () { return _this56.showCaptcha(); }, function (err) { if (err instanceof AjaxError) { _this56._setUpdateError(err); } else { _this56.hasCaptcha = false; } }); } else if (this.hasCaptcha) { this.showCaptcha(true); } } }, { key: "handleEvent", value: function handleEvent(e) { switch (e.type) { case 'keypress': { if (!Cfg.captchaLang || e.which === 0) { return; } var ruUa = 'йцукенгшщзхъїфыівапролджэєячсмитьбюёґ'; var en = 'qwertyuiop[]]assdfghjkl;\'\'zxcvbnm,.`\\'; var code = e.charCode || e.keyCode; var i; var chr = String.fromCharCode(code).toLowerCase(); if (Cfg.captchaLang === 1) { if (code < 0x0410 || code > 0x04FF || (i = ruUa.indexOf(chr)) === -1) { return; } chr = en[i]; } else { if (code < 0x0021 || code > 0x007A || (i = en.indexOf(chr)) === -1) { return; } chr = ruUa[i]; } insertText(e.target, chr); break; } case 'focus': this.updateOutdated(); } e.preventDefault(); e.stopPropagation(); } }, { key: "initImage", value: function initImage(img) { var _this57 = this; img.title = Lng.refresh[lang]; img.alt = Lng.loading[lang]; img.style.cssText = 'vertical-align: text-bottom; border: none; cursor: pointer;'; img.onclick = function () { return _this57.refreshCaptcha(true); }; } }, { key: "initTextEl", value: function initTextEl() { var _this58 = this; this.textEl.autocomplete = 'off'; if (!aib.formHeaders && (aib.multiFile || Cfg.fileInputs !== 2)) { this.textEl.placeholder = Lng.captcha[lang]; } ['keypress', 'focus'].forEach(function (e) { return _this58.textEl.addEventListener(e, _this58); }); this.textEl.onkeypress = null; this.textEl.onfocus = null; } }, { key: "showCaptcha", value: function showCaptcha() { var isUpdateImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!this.textEl) { $show(this.parentEl); if (aib.captchaUpdate) { aib.captchaUpdate(this, false); } else if (this._isRecap) { this._updateRecaptcha(); } return; } this.initTextEl(); var img; if (this._isRecap || !(img = $q('img', this.parentEl))) { $show(this.parentEl); return; } this.initImage(img); var a = img.parentNode; if (a.tagName.toLowerCase() === 'a') { a.replaceWith(img); } if (isUpdateImage) { this.refreshCaptcha(false); } else { this._lastUpdate = Date.now(); } $show(this.parentEl); } }, { key: "refreshCaptcha", value: function refreshCaptcha(isFocus) { var _this59 = this; var isError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var tNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.tNum; if (!this.isAdded || tNum !== this.tNum) { this.tNum = tNum; this.isAdded = false; this.hasCaptcha = true; this.textEl = null; $hide(this.parentEl); this.addCaptcha(); return; } else if (!this.hasCaptcha && !isError) { return; } this._lastUpdate = Date.now(); if (aib.captchaUpdate) { var _aib$captchaUpdate; (_aib$captchaUpdate = aib.captchaUpdate(this, isError)) === null || _aib$captchaUpdate === void 0 || _aib$captchaUpdate.then(function () { return _this59._updateTextEl(isFocus); }, function (err) { return _this59._setUpdateError(err); }); } else if (this._isRecap) { this._updateRecaptcha(); } else if (this.textEl) { this._updateTextEl(isFocus); var img = $q('img', this.parentEl); if (!img) { return; } if (!aib.getCaptchaSrc) { img.click(); return; } var src = img.getAttribute('src'); if (!src) { return; } var newSrc = aib.getCaptchaSrc(src, tNum); img.src = ''; img.src = newSrc; } } }, { key: "updateHelper", value: function updateHelper(url, fn) { var _aib$captchaUpdPromis; (_aib$captchaUpdPromis = aib.captchaUpdPromise) === null || _aib$captchaUpdPromis === void 0 || _aib$captchaUpdPromis.cancelPromise(); return aib.captchaUpdPromise = $ajax(url).then(function (xhr) { aib.captchaUpdPromise = null; fn(xhr); }, function (err) { if (!(err instanceof CancelError)) { aib.captchaUpdPromise = null; return CancelablePromise.reject(err); } }); } }, { key: "updateOutdated", value: function updateOutdated() { if (!aib.noCapUpdTime && this._lastUpdate && Date.now() - this._lastUpdate > Cfg.capUpdTime * 1e3) { this.refreshCaptcha(false); } } }, { key: "_setUpdateError", value: function _setUpdateError(e) { var _this60 = this; if (e) { this.parentEl.innerHTML = e.toString(); this.isAdded = false; this.parentEl.onclick = function () { _this60.parentEl.onclick = null; _this60.addCaptcha(); }; $show(this.parentEl); } } }, { key: "_updateRecaptcha", value: function _updateRecaptcha() { var script = doc.createElement('script'); script.src = aib.protocol + (this._isHcap ? '//js.hcaptcha.com/1/api.js' : '//www.google.com/recaptcha/api.js'); doc.head.append(script); setTimeout(function () { return script.remove(); }, 1e5); } }, { key: "_updateTextEl", value: function _updateTextEl(isFocus) { if (this.textEl) { this.textEl.value = ''; if (isFocus) { this.textEl.focus(); } } } }]); }(); var AbstractPost = function () { function AbstractPost(thr, num, isOp) { _classCallCheck(this, AbstractPost); this.isOp = isOp; this.kid = null; this.num = num; this.ref = new RefMap(this); this.thr = thr; this._hasEvents = false; this._linkTO = null; this._menu = null; this._menuTO = null; } return _createClass(AbstractPost, [{ key: "btnFav", get: function get() { var value = $q('.de-btn-fav, .de-btn-fav-sel', this.btns); Object.defineProperty(this, 'btnFav', { value: value }); return value; } }, { key: "btnHide", get: function get() { var value = this.btns.firstChild; Object.defineProperty(this, 'btnHide', { value: value }); return value; } }, { key: "images", get: function get() { var value = new PostImages(this); Object.defineProperty(this, 'images', { value: value }); return value; } }, { key: "mp3Obj", get: function get() { var value = $bBegin(this.msg, '
'); Object.defineProperty(this, 'mp3Obj', { value: value }); return value; } }, { key: "refLinks", value: _regenerator().m(function refLinks() { var links, lNum, i, len, link, tc; return _regenerator().w(function (_context37) { while (1) switch (_context37.n) { case 0: links = $Q('a', this.msg); i = 0, len = links.length; case 1: if (!(i < len)) { _context37.n = 4; break; } link = links[i]; tc = link.textContent; if (!(tc[0] !== '>' || tc[1] !== '>' || !(lNum = parseInt(tc.substr(2), 10)))) { _context37.n = 2; break; } return _context37.a(3, 3); case 2: _context37.n = 3; return [link, lNum]; case 3: ++i; _context37.n = 1; break; case 4: return _context37.a(2); } }, refLinks, this); }) }, { key: "msg", get: function get() { var value = $q(aib.qPostMsg, this.el); Object.defineProperty(this, 'msg', { value: value, configurable: true }); return value; } }, { key: "trunc", get: function get() { var value = null; var el = aib.qTrunc && $q(aib.qTrunc, this.el); if (el && /long|full comment|gekürzt|слишком|длинн|мног|полн/i.test(el.textContent)) { value = el; } Object.defineProperty(this, 'trunc', { value: value, configurable: true }); return value; } }, { key: "videos", get: function get() { var value = Cfg.embedYTube ? new Videos(this) : null; Object.defineProperty(this, 'videos', { value: value }); return value; } }, { key: "addFuncs", value: function addFuncs() { RefMap.updateRefMap(this, true); embedAudioLinks(this); } }, { key: "handleEvent", value: function handleEvent(e) { var _temp, _el$textContent$match, _this61 = this; var temp; var el = e.target; var _el9 = el, classList = _el9.classList; var type = e.type; var isOutEvent = type === 'mouseout'; var isPview = this instanceof Pview; if (type === 'click') { var _aib$handlePostClick, _aib5; (_aib$handlePostClick = (_aib5 = aib).handlePostClick) === null || _aib$handlePostClick === void 0 || _aib$handlePostClick.call(_aib5, this, el, e); switch (e.button) { case 0: break; case 1: e.stopPropagation(); default: return; } if (this._menu && classList.contains('de-menu-item')) { this._menu.removeMenu(); this._menu = null; } switch (el.tagName.toLowerCase()) { case 'a': if (classList.contains('de-video-link')) { this.videos.clickLink(el, Cfg.embedYTube); e.preventDefault(); return; } if (((_temp = temp = el.firstElementChild) === null || _temp === void 0 ? void 0 : _temp.tagName.toLowerCase()) !== 'img') { temp = el.parentNode; var text = el.textContent; if (temp === this.trunc) { this._getFullMsg(temp, false); e.preventDefault(); e.stopPropagation(); } else if (Cfg.insertNum && postform.form && (this._pref === temp || this._pref === el) && !/Reply|Ответ|№/.test(text)) { e.preventDefault(); e.stopPropagation(); if (!Cfg.showRepBtn) { postform.getSelectedText(); postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); postform.quotedText = ''; } else if (postform.isQuick || aib.t && postform.isHidden) { postform.showQuickReply(isPview ? Pview.topParent : this, this.num, false, true); } else if (aib.t) { var formText = postform.txta.value; var isOnNewLine = formText === '' || formText.slice(-1) === '\n'; insertText(postform.txta, ">>".concat(this.num).concat(isOnNewLine ? '\n' : '')); } else { deWindow.location.assign(el.href); } } else if (text === '№') { var _pByNum$get; (_pByNum$get = pByNum.get(+el.href.match(/#(\d+)/)[1])) === null || _pByNum$get === void 0 || _pByNum$get.selectAndScrollTo(); } else if (nav.isMobile) { break; } else if (text[0] === '>' && text[1] === '>' && !text[2].includes('/')) { var _pByNum$get2; (_pByNum$get2 = pByNum.get(+text.match(/\d+/))) === null || _pByNum$get2 === void 0 || _pByNum$get2.selectAndScrollTo(); } return; } el = temp; var _el0 = el; classList = _el0.classList; case 'img': if (classList.contains('de-video-thumb')) { if (Cfg.embedYTube === 1) { var videos = this.videos; videos.currentLink.classList.add('de-current'); videos.setPlayer(videos.playerInfo, classList.contains('de-ytube')); e.preventDefault(); } } else if (Cfg.expandImgs !== 0) { this._clickImage(el, e); } return; case 'object': case 'video': if (Cfg.expandImgs !== 0 && !ExpandableImage.isControlClick(e)) { this._clickImage(el, e); } return; } switch (classList[0]) { case 'de-btn-expthr': if (nav.isMobile) { this._menuToggleClickBtn(el, arrTags(Lng.selExpandThr[lang], '', '')); } else { this.thr.loadPosts('all'); } return; case 'de-btn-fav': this.thr.toggleFavState(true, isPview ? this : null); return; case 'de-btn-fav-sel': this.thr.toggleFavState(false, isPview ? this : null); return; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide': case 'de-btn-unhide-user': if (nav.isMobile && Cfg.showHideBtn === 1) { this._menuToggleClickBtn(el, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } else { this.setUserVisib(!this.isHidden); } return; case 'de-btn-img': if (nav.isMobile) { this._menuToggleClickBtn(el, Menu.getMenuImg(el)); } else { postform.quotedText = aib.getImgRealName(aib.getImgWrap(el)); postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); } return; case 'de-btn-reply': if (nav.isMobile && Cfg.showRepBtn === 1) { this._menuToggleClickBtn(el, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuReply()); } else { postform.showQuickReply(isPview ? Pview.topParent : this, this.num, !isPview, false); postform.quotedText = ''; } return; case 'de-btn-sage': Spells.addSpell(9, '', false); return; case 'de-btn-stick': this.toggleSticky(true); return; case 'de-btn-stick-on': this.toggleSticky(false); return; default: if (!nav.isMobile || !Cfg.linksNavig || el.tagName.toLowerCase() !== 'a' || el.isNotRefLink) { return; } if (!el.textContent.startsWith('>>')) { el.isNotRefLink = true; return; } el.className = 'de-link-postref ' + el.className; case 'de-link-backref': case 'de-link-postref': if (!nav.isMobile || !Cfg.linksNavig) { return; } if (this.kid && this.kid.parent.num === this.num && this.kid.num === +((_el$textContent$match = el.textContent.match(/\d+/g)) === null || _el$textContent$match === void 0 ? void 0 : _el$textContent$match[0])) { this.kid.deletePview(); } else { this.kid = Pview.showPview(this, el); } e.preventDefault(); e.stopPropagation(); } return; } if (!this._hasEvents) { this._hasEvents = true; ['click', 'mouseout'].forEach(function (e) { return _this61.el.addEventListener(e, _this61, true); }); } if (Cfg.embedYTube === 2 && classList.contains('de-video-link')) { this.videos.toggleFloatedThumb(el, isOutEvent); } if (!isOutEvent && Cfg.expandImgs && el.tagName.toLowerCase() === 'img' && !classList.contains('de-fullimg') && (temp = this.images.getImageByEl(el)) && (temp.isImage || temp.isVideo)) { el.title = Cfg.expandImgs === 1 ? Lng.expImgInline[lang] : Lng.expImgFull[lang]; } switch (classList[0]) { case 'de-btn-expthr': this.btns.title = Lng.expandThr[lang]; if (!nav.isMobile) { this._menuToggleOverBtn(el, isOutEvent, arrTags(Lng.selExpandThr[lang], '', '')); } return; case 'de-btn-fav': this.btns.title = Lng.addFav[lang]; return; case 'de-btn-fav-sel': this.btns.title = Lng.delFav[lang]; return; case 'de-btn-hide': case 'de-btn-hide-user': case 'de-btn-unhide': case 'de-btn-unhide-user': this.btns.title = this.isOp ? Lng.toggleThr[lang] : Lng.togglePost[lang]; if (!nav.isMobile && Cfg.showHideBtn === 1) { this._menuToggleOverBtn(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuHide()); } return; case 'de-btn-img': if (!nav.isMobile && el.parentNode.className !== 'de-fullimg-info') { this._menuToggleOverBtn(el, isOutEvent, Menu.getMenuImg(el)); } return; case 'de-btn-reply': { if (!nav.isMobile && Cfg.showRepBtn === 1) { if (!isOutEvent) { postform.getSelectedText(); } this._menuToggleOverBtn(el, isOutEvent, (this instanceof Pview ? pByNum.get(this.num) : this)._getMenuReply()); } return; } case 'de-btn-sage': this.btns.title = 'SAGE'; return; case 'de-btn-stick': this.btns.title = Lng.attachPview[lang]; return; case 'de-post-btns': el.removeAttribute('title'); return; default: if (nav.isMobile || !Cfg.linksNavig || el.tagName.toLowerCase() !== 'a' || el.isNotRefLink) { return; } if (!el.textContent.startsWith('>>')) { el.isNotRefLink = true; return; } el.className = 'de-link-postref ' + el.className; case 'de-link-backref': case 'de-link-postref': if (!Cfg.linksNavig) { return; } if (isOutEvent) { clearTimeout(this._linkTO); if (!(aib.getPostOfEl(e.relatedTarget) instanceof Pview) && Pview.top) { Pview.top.markToDel(); } else if (this.kid) { this.kid.markToDel(); } } else { if (nav.isMobile) { return; } this._linkTO = setTimeout(function () { return _this61.kid = Pview.showPview(_this61, el); }, Cfg.linksOver); } e.preventDefault(); e.stopPropagation(); } } }, { key: "toggleFavBtn", value: function toggleFavBtn(isEnable) { var _this$btnFav, _this$thr$btnFav; var elClass = isEnable ? 'de-btn-fav-sel' : 'de-btn-fav'; (_this$btnFav = this.btnFav) === null || _this$btnFav === void 0 || _this$btnFav.setAttribute('class', elClass); (_this$thr$btnFav = this.thr.btnFav) === null || _this$thr$btnFav === void 0 || _this$thr$btnFav.setAttribute('class', elClass); } }, { key: "updateMsg", value: function updateMsg(newMsg, sRunner) { var videoExt, videoLinks; if (Cfg.embedYTube) { videoExt = $q('.de-video-ext', this.msg); videoLinks = $Q(':not(.de-video-ext) > .de-video-link', this.msg); } this.msg.replaceWith(newMsg); Object.defineProperties(this, { msg: { configurable: true, value: newMsg }, trunc: { configurable: true, value: null } }); Post.Content.removeTempData(this); if (Cfg.embedYTube) { this.videos.updatePost(videoLinks, $Q('a[href*="youtu"], a[href*="vimeo.com"]', newMsg), false); if (videoExt) { newMsg.append(videoExt); } } this.addFuncs(); sRunner.runSpells(this); embedPostMsgImages(this.el); if (this.isHidden) { this.hideContent(this.isHidden); } closePopup('load-fullmsg'); } }, { key: "changeMyMark", value: function changeMyMark(val) { var _this62 = this; this.el.classList.toggle('de-mypost', val); $Q("[de-form] ".concat(aib.qPostMsg, " a[href$=\"").concat(aib.anchor + this.num, "\"]")).forEach(function (el) { var post = aib.getPostOfEl(el); if (post.el !== _this62.el) { el.classList.toggle('de-ref-you', val); post.el.classList.toggle('de-mypost-reply', val); } }); } }, { key: "downloadImageByLink", value: function () { var _downloadImageByLink = _asyncToGenerator(_regenerator().m(function _callee35(el, e) { var url, data; return _regenerator().w(function (_context38) { while (1) switch (_context38.n) { case 0: e.preventDefault(); $popup('file-loading', Lng.loading[lang], true); url = el.href; _context38.n = 1; return ContentLoader.loadFileData(url, false); case 1: data = _context38.v; if (data) { _context38.n = 2; break; } $popup('file-loading', Lng.cantLoad[lang] + ' URL: ' + url); return _context38.a(2); case 2: closePopup('file-loading'); downloadBlob(new Blob([data], { type: getFileMime(url) }), el.getAttribute('download')); case 3: return _context38.a(2); } }, _callee35); })); function downloadImageByLink(_x22, _x23) { return _downloadImageByLink.apply(this, arguments); } return downloadImageByLink; }() }, { key: "_clickImage", value: function _clickImage(el, e) { var image = this.images.getImageByEl(el); if (!image || !image.isImage && !image.isVideo) { return; } image.expandImg(Cfg.expandImgs === 1 ^ e.ctrlKey, e); e.preventDefault(); e.stopPropagation(); } }, { key: "_getFullMsg", value: function _getFullMsg(truncEl, isInit) { var _this63 = this; if (aib.deleteTruncMsg) { aib.deleteTruncMsg(this, truncEl, isInit); return; } if (!isInit) { $popup('load-fullmsg', Lng.loading[lang], true); } ajaxLoad(aib.getThrUrl(aib.b, this.tNum)).then(function (form) { var sourceEl; var maybeSpells = new Maybe(SpellsRunner); if (_this63.isOp) { sourceEl = form; } else { var posts = $Q(aib.qPost, form); for (var i = 0, len = posts.length; i < len; ++i) { var post = posts[i]; if (_this63.num === aib.getPNum(post)) { sourceEl = post; break; } } } if (sourceEl) { _this63.updateMsg(aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, sourceEl))), maybeSpells.value); truncEl.remove(); } if (maybeSpells.hasValue) { maybeSpells.value.endSpells(); } }, Function.prototype); } }, { key: "_menuAdd", value: function _menuAdd(el, html) { var _this64 = this; return new Menu(el, html, function (el, e) { return (_this64 instanceof Pview ? pByNum.get(_this64.num) || _this64 : _this64)._menuClickOnOptions(el, e); }, false); } }, { key: "_menuClickOnOptions", value: function () { var _menuClickOnOptions2 = _asyncToGenerator(_regenerator().m(function _callee36(el, e) { var isHide, num, _this$_selRange, start, end, inMsgSel, _this$images$firstAtt, w, wi, h, hash, words, post, isAdd, isPview, task, _t30; return _regenerator().w(function (_context39) { while (1) switch (_context39.n) { case 0: isHide = !this.isHidden; num = this.num; _t30 = el.getAttribute('info'); _context39.n = _t30 === 'hide-sel' ? 1 : _t30 === 'hide-name' ? 7 : _t30 === 'hide-trip' ? 9 : _t30 === 'hide-uid' ? 11 : _t30 === 'hide-img' ? 13 : _t30 === 'hide-imgn' ? 15 : _t30 === 'hide-ihash' ? 17 : _t30 === 'hide-noimg' ? 20 : _t30 === 'hide-post' ? 22 : _t30 === 'hide-text' ? 23 : _t30 === 'hide-notext' ? 24 : _t30 === 'hide-refs' ? 26 : _t30 === 'hide-refsonly' ? 27 : _t30 === 'img-load' ? 29 : _t30 === 'post-markmy' ? 30 : _t30 === 'post-reply' ? 31 : _t30 === 'post-report' ? 32 : _t30 === 'thr-exp' ? 33 : 34; break; case 1: _this$_selRange = this._selRange, start = _this$_selRange.startContainer, end = _this$_selRange.endContainer; if (start.nodeType === 3) { start = start.parentNode; } if (end.nodeType === 3) { end = end.parentNode; } inMsgSel = "".concat(aib.qPostMsg, ", ").concat(aib.qPostMsg, " *"); if (!(nav.matchesSelector(start, inMsgSel) && nav.matchesSelector(end, inMsgSel) || nav.matchesSelector(start, aib.qPostSubj) && nav.matchesSelector(end, aib.qPostSubj))) { _context39.n = 5; break; } if (!this._selText.includes('\n')) { _context39.n = 3; break; } _context39.n = 2; return Spells.addSpell(1 , "/".concat(escapeRegExp(this._selText).replace(/\r?\n/g, '\\n'), "/"), false); case 2: _context39.n = 4; break; case 3: _context39.n = 4; return Spells.addSpell(0 , this._selText.toLowerCase(), false); case 4: _context39.n = 6; break; case 5: dummy.innerHTML = ''; dummy.append(this._selRange.cloneContents()); _context39.n = 6; return Spells.addSpell(2 , "/".concat(escapeRegExp(dummy.innerHTML.replace(/^<[^>]+>|<[^>]+>$/g, '')), "/"), false); case 6: return _context39.a(2); case 7: _context39.n = 8; return Spells.addSpell(6 , this.posterName, false); case 8: return _context39.a(2); case 9: _context39.n = 10; return Spells.addSpell(7 , this.posterTrip, false); case 10: return _context39.a(2); case 11: _context39.n = 12; return Spells.addSpell(18 , this.posterUid, false); case 12: return _context39.a(2); case 13: _this$images$firstAtt = this.images.firstAttach, w = _this$images$firstAtt.weight, wi = _this$images$firstAtt.width, h = _this$images$firstAtt.height; _context39.n = 14; return Spells.addSpell(8 , [0, [w, w], [wi, wi, h, h]], false); case 14: return _context39.a(2); case 15: _context39.n = 16; return Spells.addSpell(3 , "/".concat(escapeRegExp(this.images.firstAttach.name), "/"), false); case 16: return _context39.a(2); case 17: _context39.n = 18; return ImagesHashStorage.getHash(this.images.firstAttach); case 18: hash = _context39.v; if (!(hash !== -1)) { _context39.n = 19; break; } _context39.n = 19; return Spells.addSpell(4 , hash, false); case 19: return _context39.a(2); case 20: _context39.n = 21; return Spells.addSpell(0x108 , '', true); case 21: return _context39.a(2); case 22: this.setUserVisib(!this.isHidden); return _context39.a(3, 34); case 23: words = Post.getWrds(this.text); for (post = Thread.first.op; post; post = post.next) { Post.findSameText(num, !isHide, words, post); } return _context39.a(2); case 24: _context39.n = 25; return Spells.addSpell(0x10B , '', true); case 25: return _context39.a(2); case 26: this.ref.toggleRef(isHide, true); this.setUserVisib(isHide); return _context39.a(2); case 27: _context39.n = 28; return Spells.addSpell(0 , '>>' + num, false); case 28: return _context39.a(2); case 29: this.downloadImageByLink(el, e); return _context39.a(2); case 30: isAdd = !MyPosts.has(num); if (isAdd) { MyPosts.set(num, this.thr.num); } else { MyPosts.removeStorage(num); } this.changeMyMark(isAdd); return _context39.a(2); case 31: isPview = this instanceof Pview; postform.showQuickReply(isPview ? Pview.topParent : this, num, !isPview, false); postform.quotedText = ''; return _context39.a(2); case 32: aib.reportForm(num, this.thr.num); return _context39.a(2); case 33: task = +el.textContent.match(/\d+/); this.thr.loadPosts(!task ? 'all' : task === 10 ? 'more' : task); case 34: return _context39.a(2); } }, _callee36, this); })); function _menuClickOnOptions(_x24, _x25) { return _menuClickOnOptions2.apply(this, arguments); } return _menuClickOnOptions; }() }, { key: "_menuShowOverBtn", value: function _menuShowOverBtn(el, html) { var _this$_menu2, _this65 = this; (_this$_menu2 = this._menu) === null || _this$_menu2 === void 0 || _this$_menu2.removeMenu(); this._menu = this._menuAdd(el, html); this._menu.onremove = function () { return _this65._menu = null; }; } }, { key: "_menuToggleClickBtn", value: function _menuToggleClickBtn(el, html) { var _this$_menu3; if ((_this$_menu3 = this._menu) !== null && _this$_menu3 !== void 0 && _this$_menu3.el && this._menu.parentEl === el) { this._menu.removeMenu(); this._menu = null; return; } this._menu = this._menuAdd(el, html); } }, { key: "_menuToggleOverBtn", value: function _menuToggleOverBtn(el, isOutEvent, html) { var _this$_menu4, _this66 = this; if (((_this$_menu4 = this._menu) === null || _this$_menu4 === void 0 ? void 0 : _this$_menu4.parentEl) === el) { return; } if (isOutEvent) { clearTimeout(this._menuTO); } else { this._menuTO = setTimeout(function () { return _this66._menuShowOverBtn(el, html); }, Cfg.linksOver); } } }]); }(); var Post = function (_AbstractPost) { function Post(el, thr, num, count, isOp, prev) { var _this67; _classCallCheck(this, Post); _this67 = _callSuper(this, Post, [thr, num, isOp]); _this67.count = count; _this67.el = el; _this67.isDeleted = false; _this67.isHidden = false; _this67.isOmitted = false; _this67.isViewed = false; _this67.next = null; _this67.prev = prev; _this67.spellHidden = false; _this67.userToggled = false; _this67._selRange = null; _this67._selText = ''; if (prev) { prev.next = _this67; } pByEl.set(el, _this67); pByNum.set(num, _this67); var isMyPost = MyPosts.has(num); if (isMyPost) { _this67.el.classList.add('de-mypost'); } else if (localData && _this67.el.classList.contains('de-mypost')) { MyPosts.set(num, thr.num); isMyPost = true; } el.classList.add(isOp ? 'de-oppost' : 'de-reply'); _this67.btns = $aEnd(_this67._pref = $q(aib.qPostRef, el), '' + Post.getPostBtns(isOp, aib.t) + (_this67.sage ? '' : '') + (isOp ? '' : "".concat(count + 1, "")) + (isMyPost ? '(You)' : '') + ''); _this67.counterEl = isOp ? null : $q('.de-post-counter', _this67.btns); if (Cfg.expandTrunc && _this67.trunc) { _this67._getFullMsg(_this67.trunc, true); } el.addEventListener('mouseover', _this67, true); return _this67; } _inherits(Post, _AbstractPost); return _createClass(Post, [{ key: "banned", get: function get() { var value = aib.getBanId(this.el); Object.defineProperty(this, 'banned', { value: value, writable: true }); return value; } }, { key: "bottom", get: function get() { return (this.isOp && this.isHidden ? this.thr.el.previousElementSibling : this.el).getBoundingClientRect().bottom; } }, { key: "headerEl", get: function get() { return new Post.Content(this).headerEl; } }, { key: "html", get: function get() { return new Post.Content(this).html; } }, { key: "nextInThread", get: function get() { var post = this.next; return !post || post.count === 0 ? null : post; } }, { key: "nextNotDeleted", get: function get() { var post = this.nextInThread; while ((_post5 = post) !== null && _post5 !== void 0 && _post5.isDeleted) { var _post5; post = post.nextInThread; } return post; } }, { key: "note", get: function get() { var value = new Post.Note(this); Object.defineProperty(this, 'note', { value: value }); return value; } }, { key: "posterName", get: function get() { return new Post.Content(this).posterName; } }, { key: "posterTrip", get: function get() { return new Post.Content(this).posterTrip; } }, { key: "posterUid", get: function get() { return new Post.Content(this).posterUid; } }, { key: "sage", get: function get() { var value = aib.getSage(this.el); Object.defineProperty(this, 'sage', { value: value }); return value; } }, { key: "subj", get: function get() { return new Post.Content(this).subj; } }, { key: "text", get: function get() { return new Post.Content(this).text; } }, { key: "title", get: function get() { return new Post.Content(this).title; } }, { key: "tNum", get: function get() { return this.thr.num; } }, { key: "top", get: function get() { return (this.isOp && this.isHidden ? this.thr.el.previousElementSibling : this.el).getBoundingClientRect().top; } }, { key: "wrap", get: function get() { return new Post.Content(this).wrap; } }, { key: "addFuncs", value: function addFuncs() { _superPropGet(Post, "addFuncs", this, 3)([]); if (isExpImg) { this.toggleImages(true, false); } } }, { key: "deleteCounter", value: function deleteCounter() { this.isDeleted = true; this.counterEl.textContent = Lng.deleted[lang]; this.counterEl.classList.add('de-post-counter-deleted'); this.el.classList.add('de-post-removed'); this.wrap.classList.add('de-wrap-removed'); } }, { key: "deletePost", value: function deletePost(isRemovePost) { if (isRemovePost) { this.wrap.remove(); pByEl["delete"](this.el); pByNum["delete"](this.num); if (this.isHidden) { this.ref.unhideRef(); } RefMap.updateRefMap(this, false); if (this.prev.next = this.next) { this.next.prev = this.prev; } return; } this.deleteCounter(); ($q('input[type="checkbox"]', this.el) || {}).disabled = true; } }, { key: "getAdjacentVisPost", value: function getAdjacentVisPost(toUp) { var post = toUp ? this.prev : this.next; while (post) { if (post.thr.isHidden) { post = toUp ? post.thr.op.prev : post.thr.last.next; } else if (post.isHidden || post.isOmitted) { post = toUp ? post.prev : post.next; } else { return post; } } return null; } }, { key: "hideContent", value: function hideContent(needToHide) { if (this.isOp) { if (!aib.t) { $toggle(this.thr.el, !needToHide); $toggle(this.thr.btns, !needToHide); } } else { Post.hideContent(this.headerEl, this.btnHide, this.userToggled, needToHide); } } }, { key: "select", value: function select() { if (this.isOp) { if (this.isHidden) { this.thr.el.previousElementSibling.classList.add('de-selected'); } this.thr.el.classList.add('de-selected'); } else { this.el.classList.add('de-selected'); } } }, { key: "selectAndScrollTo", value: function selectAndScrollTo() { var scrollNode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.el; scrollTo(0, deWindow.pageYOffset + scrollNode.getBoundingClientRect().top - Post.sizing.wHeight / 2 + scrollNode.clientHeight / 2); if (HotKeys.enabled) { if (HotKeys.cPost) { HotKeys.cPost.unselect(); } HotKeys.cPost = this; HotKeys.lastPageOffset = deWindow.pageYOffset; } else { var _$q6; (_$q6 = $q('.de-selected')) === null || _$q6 === void 0 || _$q6.unselect(); } this.select(); } }, { key: "setUserVisib", value: function setUserVisib(isHide) { var isSave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; var note = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; this.userToggled = true; this.setVisib(isHide, note); if (this.isOp || this.isHidden === isHide) { var hideClass = isHide ? 'de-btn-unhide-user' : 'de-btn-hide-user'; this.btnHide.setAttribute('class', hideClass); if (this.isOp) { this.thr.btnHide.setAttribute('class', hideClass); } } if (isSave) { var num = this.num; HiddenPosts.set(num, this.thr.num, isHide); if (this.isOp) { if (isHide) { HiddenThreads.set(num, num, this.title); } else { HiddenThreads.removeStorage(num); } } sendStorageEvent('__de-post', { hide: isHide, brd: aib.b, num: num, thrNum: this.thr.num, title: this.isOp ? this.title : '' }); } this.ref.toggleRef(isHide, false); } }, { key: "setVisib", value: function setVisib(isHide) { var _this68 = this; var note = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (this.isHidden === isHide) { if (isHide && note) { this.note.set(note); } return; } if (this.isOp) { this.thr.isHidden = isHide; } else { if (Cfg.delHiddPost === 1 || Cfg.delHiddPost === 2) { this.wrap.classList.toggle('de-hidden', isHide); } else { this._pref.onmouseover = this._pref.onmouseout = !isHide ? null : function (e) { var yOffset = deWindow.pageYOffset; _this68.hideContent(e.type === 'mouseout'); scrollTo(deWindow.pageXOffset, yOffset); }; } } if (Cfg.strikeHidd) { setTimeout(function () { return _this68._strikePostNum(isHide); }, 50); } if (isHide) { this.note.set(note); } else { this.note.hideNote(); } this.hideContent(this.isHidden = isHide); } }, { key: "spellHide", value: function spellHide(note) { this.spellHidden = true; if (!this.userToggled) { this.setVisib(true, note); this.ref.hideRef(); } } }, { key: "spellUnhide", value: function spellUnhide() { this.spellHidden = false; if (!this.userToggled) { this.setVisib(false); this.ref.unhideRef(); } } }, { key: "toggleImages", value: function toggleImages() { var isExpand = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.images.expanded; var isExpandVideos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; for (var _iterator22 = _createForOfIteratorHelperLoose(this.images), _step22; !(_step22 = _iterator22()).done;) { var image = _step22.value; if ((image.isImage || isExpandVideos && image.isVideo) && image.expanded ^ isExpand) { if (isExpand) { image.expandImg(true, null); } else { image.collapseImg(null); } } } } }, { key: "unselect", value: function unselect() { if (this.isOp) { var _$id; (_$id = $id('de-thr-hid-' + this.num)) === null || _$id === void 0 || _$id.classList.remove('de-selected'); this.thr.el.classList.remove('de-selected'); } else { this.el.classList.remove('de-selected'); } } }, { key: "_getMenuHide", value: function _getMenuHide() { var item = function item(name) { return "").concat(Lng.selHiderMenu[name][lang], ""); }; var selection = deWindow.getSelection(); var selText = selection.rangeCount > 0 ? selection.toString().trim() : ''; if (selText) { this._selText = selText; this._selRange = selection.getRangeAt(0); } return "".concat(nav.isMobile ? "".concat(this.isOp ? Lng.toggleThr[lang] : Lng.togglePost[lang], "") : '').concat(selText ? item('sel') : '').concat(this.posterName ? item('name') : '').concat(this.posterTrip ? item('trip') : '').concat(this.posterUid ? item('uid') : '').concat(this.images.hasAttachments ? item('img') + item('imgn') + item('ihash') : item('noimg')).concat(this.text ? item('text') : item('notext')).concat(!Cfg.hideRefPsts && this.ref.hasMap ? item('refs') : '').concat(item('refsonly')); } }, { key: "_getMenuReply", value: function _getMenuReply() { return "".concat(this.btns.title = this.isOp ? Lng.replyToThr[lang] : Lng.replyToPost[lang], "") + (getCookies().atom_access === '1' ? "
").concat(this.isOp ? Lng.moderateThread[lang] : Lng.moderatePost[lang], "") : '') + (aib.reportForm ? "".concat(this.isOp ? Lng.reportThr[lang] : Lng.reportPost[lang], "") : '') + (Cfg.markMyPosts || Cfg.markMyLinks ? "".concat(MyPosts.has(this.num) ? Lng.deleteMyPost[lang] : Lng.markMyPost[lang], "") : ''); } }, { key: "_strikePostNum", value: function _strikePostNum(isHide) { var num = this.num; if (isHide) { Post.hiddenNums.add(+num); } else { Post.hiddenNums["delete"](+num); } $Q("[de-form] a[href$=\"".concat(aib.anchor + num, "\"]")).forEach(function (el) { el.classList.toggle('de-link-hid', isHide); if (Cfg.removeHidd && el.classList.contains('de-link-backref')) { var refMapEl = el.parentNode; if (isHide === !$q('.de-link-backref:not(.de-link-hid)', refMapEl)) { $toggle(refMapEl, !isHide); } } }); } }], [{ key: "addMark", value: function addMark(postEl, forced) { if (doc.hidden || forced) { if (!Post.hasNew) { Post.hasNew = true; doc.addEventListener('click', Post.clearMarks, true); } postEl.classList.add('de-new-post'); } else { Post.clearMarks(); } } }, { key: "clearMarks", value: function clearMarks() { if (Post.hasNew) { Post.hasNew = false; $Q('.de-new-post').forEach(function (el) { return el.classList.remove('de-new-post'); }); doc.removeEventListener('click', Post.clearMarks, true); } } }, { key: "getPostBtns", value: function getPostBtns(isOp, noExpThr) { return '' + '' + '' + (isOp ? (noExpThr ? '' : '') + '' : ''); } }, { key: "findSameText", value: function findSameText(pNum, isHidden, words, curPost) { var curWords = Post.getWrds(curPost.text); var len = curWords.length; var i = words.length; var olen = i; var _olen = i; var n = 0; if (len < olen * 0.4 || len > olen * 3) { return; } while (i--) { if (olen > 6 && words[i].length < 3) { _olen--; continue; } var j = len; while (j--) { if (curWords[j] === words[i] || words[i].match(/>>\d+/) && curWords[j].match(/>>\d+/)) { n++; } } } if (n < _olen * 0.4 || len > _olen * 3) { return; } if (isHidden) { if (curPost.spellHidden) { Post.Note.reset(); } else { curPost.setVisib(false); } if (curPost.userToggled) { HiddenPosts.removeStorage(curPost.num); curPost.userToggled = false; } } else { curPost.setUserVisib(true, true, 'similar to >>' + pNum); } return false; } }, { key: "getWrds", value: function getWrds(text) { return text.replace(/\s+/g, ' ').replace(/[^a-zа-яё ]/ig, '').trim().substring(0, 800).split(' '); } }, { key: "hideContent", value: function hideContent(headerEl, btnHide, isUser, isHide) { if (!isHide) { btnHide.setAttribute('class', isUser ? 'de-btn-hide-user' : 'de-btn-hide'); $Q('.de-post-hiddencontent', headerEl.parentNode).forEach(function (el) { return el.classList.remove('de-post-hiddencontent'); }); return; } if (aib.t) { Thread.first.hiddenCount++; } btnHide.setAttribute('class', isUser ? 'de-btn-unhide-user' : 'de-btn-unhide'); if (headerEl) { for (var el = headerEl.nextElementSibling; el; el = el.nextElementSibling) { el.classList.add('de-post-hiddencontent'); } } } }]); }(AbstractPost); Post.hasNew = false; Post.hiddenNums = new Set(); Post.Content = function (_TemporaryContent) { function PostContent(post) { var _this69; _classCallCheck(this, PostContent); _this69 = _callSuper(this, PostContent, [post]); if (_this69._isInited) { return _possibleConstructorReturn(_this69); } _this69._isInited = true; _this69.el = post.el; _this69.post = post; return _this69; } _inherits(PostContent, _TemporaryContent); return _createClass(PostContent, [{ key: "headerEl", get: function get() { var value = $q(aib.qPostHeader, this.el); Object.defineProperty(this, 'headerEl', { value: value }); return value; } }, { key: "html", get: function get() { var value = this.el.outerHTML; Object.defineProperty(this, 'html', { value: value }); return value; } }, { key: "posterName", get: function get() { var pName = $q(aib.qPostName, this.el); var value = pName ? pName.textContent.trim().replace(/\s/g, ' ') : ''; Object.defineProperty(this, 'posterName', { value: value }); return value; } }, { key: "posterTrip", get: function get() { var pTrip = $q(aib.qPostTrip, this.el); var value = pTrip ? pTrip.textContent : ''; Object.defineProperty(this, 'posterTrip', { value: value }); return value; } }, { key: "posterUid", get: function get() { var pUid = $q(aib.qPostUid, this.el); var value = pUid ? pUid.textContent : ''; Object.defineProperty(this, 'qPostUid', { value: value }); return value; } }, { key: "subj", get: function get() { var subj = $q(aib.qPostSubj, this.el); var value = subj ? subj.textContent : ''; Object.defineProperty(this, 'subj', { value: value }); return value; } }, { key: "text", get: function get() { var value = this.post.msg.innerHTML.replace(/<\/?(?:br|p|li)[^>]*?>/gi, '\n').replace(/<[^>]+?>/g, '').replaceAll('>', '>').replaceAll('<', '<').replaceAll(' ', "\xA0").trim(); Object.defineProperty(this, 'text', { value: value }); return value; } }, { key: "title", get: function get() { var value = this.subj || this.text.substring(0, 85).replace(/\s+/g, ' '); Object.defineProperty(this, 'title', { value: value }); return value; } }, { key: "wrap", get: function get() { var value = aib.getPostWrap(this.el, this.post.isOp); Object.defineProperty(this, 'wrap', { value: value }); return value; } }]); }(TemporaryContent); Post.Note = function () { function PostNote(post) { _classCallCheck(this, PostNote); this.text = null; this._post = post; this.isHideThr = this._post.isOp && !aib.t; if (!this.isHideThr) { this._noteEl = this.textEl = $bEnd(post.btns, ''); return; } this._noteEl = $bBegin(post.thr.el, "
").concat(Lng.hiddenThr[lang], ": \u2116").concat(post.num, "\n\t\t\t\n\t\t
")); this._aEl = $q('a', this._noteEl); this.textEl = this._aEl.nextElementSibling; } return _createClass(PostNote, [{ key: "hideNote", value: function hideNote() { if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = this._aEl.onclick = null; } $hide(this._noteEl); } }, { key: "reset", value: function reset() { this.text = null; if (this.isHideThr) { this.set(null); } else { this.hideNote(); } } }, { key: "set", value: function set(note) { var _this70 = this; this.text = note; var text; if (this.isHideThr) { this._aEl.onmouseover = this._aEl.onmouseout = function (e) { return _this70._post.hideContent(e.type === 'mouseout'); }; this._aEl.onclick = function (e) { e.preventDefault(); _this70._post.setUserVisib(!_this70._post.isHidden); }; text = (this._post.title ? "(".concat(this._post.title, ") ") : '') + (note ? "[autohide: ".concat(note, "]") : ''); } else { text = note ? "autohide: ".concat(note) : ''; } this.textEl.textContent = text; $show(this._noteEl); } }]); }(); Post.sizing = { get dPxRatio() { var value = deWindow.devicePixelRatio || 1; Object.defineProperty(this, 'dPxRatio', { value: value }); return value; }, get wHeight() { var value = nav.viewportHeight(); if (!this._enabled) { doc.defaultView.addEventListener('resize', this); this._enabled = true; } Object.defineProperties(this, { wHeight: { writable: true, configurable: true, value: value }, wWidth: { writable: true, configurable: true, value: nav.viewportWidth() } }); return value; }, get wWidth() { var value = nav.viewportWidth(); if (!this._enabled) { doc.defaultView.addEventListener('resize', this); this._enabled = true; } Object.defineProperties(this, { wHeight: { writable: true, configurable: true, value: nav.viewportHeight() }, wWidth: { writable: true, configurable: true, value: value } }); return value; }, handleEvent: function handleEvent() { this.wHeight = nav.viewportHeight(); this.wWidth = nav.viewportWidth(); }, _enabled: false }; var Pview = function (_AbstractPost2) { function Pview(parent, link, pNum, tNum) { var _this71; _classCallCheck(this, Pview); _this71 = _callSuper(this, Pview, [parent.thr, pNum, pNum === tNum]); _this71.isSticky = false; _this71.parent = parent; _this71.remoteThr = null; _this71.tNum = tNum; _this71._isCached = false; _this71._isLeft = false; _this71._isTop = false; _this71._link = link; _this71._newPos = null; _this71._offsetTop = 0; _this71._readDelay = 0; var post = pByNum.get(pNum); if (post && (!post.isOp || !(parent instanceof Pview) || !parent._isCached)) { _this71._buildPview(post); return _possibleConstructorReturn(_this71); } _this71._isCached = true; _this71.board = link.pathname.match(/^\/?(.+\/)/)[1].replace(aib.res, '').replace(/\/$/, ''); if (PviewsCache.has(_this71.board + tNum)) { post = PviewsCache.get(_this71.board + tNum).getPost(pNum); if (post) { _this71._buildPview(post); } else { _this71._showPview(_this71.el = $add("
\n\t\t\t\t\t").concat(Lng.postNotFound[lang], "
"))); } return _possibleConstructorReturn(_this71); } _this71._showPview(_this71.el = $add("
\n\t\t\t").concat(Lng.loading[lang], "
"))); _this71._loadPromise = ajaxPostsLoad(_this71.board, tNum, false, false).then(function (pBuilder) { return _this71._onload(pBuilder); }, function (err) { return _this71._onerror(err); }); return _this71; } _inherits(Pview, _AbstractPost2); return _createClass(Pview, [{ key: "stickBtn", get: function get() { var value = $q('.de-btn-stick', this.el); Object.defineProperty(this, 'stickBtn', { value: value }); return value; } }, { key: "deletePview", value: function deletePview() { var _AttachedImage$viewer; this.parent.kid = null; this._link.classList.remove('de-link-parent'); if (Pview.top === this) { Pview.top = null; } if (this._loadPromise) { this._loadPromise.cancelPromise(); this._loadPromise = null; } var vPost = (_AttachedImage$viewer = AttachedImage.viewer) === null || _AttachedImage$viewer === void 0 ? void 0 : _AttachedImage$viewer.data.post; var pv = this; do { clearTimeout(pv._readDelay); if (vPost === pv) { AttachedImage.closeImg(); vPost = null; } var _pv = pv, el = _pv.el; pByEl["delete"](el); if (Cfg.animation) { $animate(el, 'de-pview-anim', true); el.style.animationName = "de-post-close-".concat(this._isTop ? 't' : 'b').concat(this._isLeft ? 'l' : 'r'); } else { el.remove(); } } while (pv = pv.kid); } }, { key: "deleteNonSticky", value: function deleteNonSticky() { var lastSticky = null; var pv = this; do { if (pv.isSticky) { lastSticky = pv; } } while (pv = pv.kid); if (!lastSticky) { this.deletePview(); } else if (lastSticky.kid) { lastSticky.kid.deletePview(); } } }, { key: "handleEvent", value: function handleEvent(e) { var pv = e.target; if (e.type === 'animationend' && pv.style.animationName) { pv.classList.remove('de-pview-anim'); pv.style.cssText = this._newPos; this._newPos = null; $delAll('.de-css-move', doc.head); pv.removeEventListener('animationend', this); return; } var isOverEvent = false; checkMouse: do { switch (e.type) { case 'mouseover': isOverEvent = true; break; case 'mouseout': break; default: break checkMouse; } var el = e.relatedTarget; if (!el || isOverEvent && (el.tagName.toLowerCase() !== 'a' || el.isNotRefLink) || el !== this.el && !this.el.contains(el)) { if (isOverEvent) { this.mouseEnter(); } else if (Pview.top) { Pview.top.markToDel(); } } } while (false); if (!this.loading) { _superPropGet(Pview, "handleEvent", this, 3)([e]); } } }, { key: "markToDel", value: function markToDel() { var _this72 = this; clearTimeout(Pview._delTO); Pview._delTO = setTimeout(function () { return _this72.deleteNonSticky(); }, nav.isMobile ? 0 : Cfg.linksOut); } }, { key: "mouseEnter", value: function mouseEnter() { if (this.kid) { this.kid.markToDel(); } else { clearTimeout(Pview._delTO); } } }, { key: "setUserVisib", value: function setUserVisib() { var post = pByNum.get(this.num); var isHide = post.isHidden; post.setUserVisib(!isHide); Pview.updatePosition(true); $Q(".de-btn-pview-hide[de-num=\"".concat(this.num, "\"]")).forEach(function (el) { el.setAttribute('class', "".concat(isHide ? 'de-btn-hide-user' : 'de-btn-unhide-user', " de-btn-pview-hide")); el.parentNode.classList.toggle('de-post-hide', !isHide); }); } }, { key: "toggleSticky", value: function toggleSticky(isEnabled) { this.stickBtn.setAttribute('class', isEnabled ? 'de-btn-stick-on' : 'de-btn-stick'); this.isSticky = isEnabled; } }, { key: "_menuShowOverBtn", value: function _menuShowOverBtn(el, html) { var _this73 = this; _superPropGet(Pview, "_menuShowOverBtn", this, 3)([el, html]); this._menu.onover = function () { return _this73.mouseEnter(); }; this._menu.onout = function () { return Pview.top.markToDel(); }; } }, { key: "_buildPview", value: function () { var _buildPview2 = _asyncToGenerator(_regenerator().m(function _callee37(post) { var _this$el, _yield$readFavorites$; var isOp, num, pv, isMyPost, isFav, isCached, postsCountHtml, pText, _$q7, btnsEl, link, _t31, _t32, _t33, _t34, _t35, _t36, _t37; return _regenerator().w(function (_context40) { while (1) switch (_context40.n) { case 0: (_this$el = this.el) === null || _this$el === void 0 || _this$el.remove(); isOp = this.isOp, num = this.num; pv = this.el = post.el.cloneNode(true); pByEl.set(pv, this); isMyPost = MyPosts.has(num); pv.className = "".concat(aib.cReply, " de-pview").concat(post.isViewed ? ' de-viewed' : '').concat(isMyPost ? ' de-mypost' : '') + "".concat(post.el.classList.contains('de-mypost-reply') ? ' de-mypost-reply' : ''); $show(pv); $Q('.de-post-hiddencontent', pv).forEach(function (el) { return el.classList.remove('de-post-hiddencontent'); }); if (Cfg.linksNavig) { Pview._markLink(pv, this.parent.num); } this._pref = $q(aib.qPostRef, pv); this._link.classList.add('de-link-parent'); _t31 = isOp; if (!_t31) { _context40.n = 7; break; } _t32 = post.thr.isFav; if (_t32) { _context40.n = 6; break; } _context40.n = 1; return readFavorites(); case 1: _t35 = aib.host; _t36 = _yield$readFavorites$ = _context40.v[_t35]; _t34 = _t36 === null; if (_t34) { _context40.n = 2; break; } _t34 = _yield$readFavorites$ === void 0; case 2: _t33 = _t34; if (_t33) { _context40.n = 3; break; } _t33 = (_yield$readFavorites$ = _yield$readFavorites$[this.board]) === null || _yield$readFavorites$ === void 0; case 3: if (!_t33) { _context40.n = 4; break; } _t37 = void 0; _context40.n = 5; break; case 4: _t37 = _yield$readFavorites$[num]; case 5: _t32 = _t37; case 6: _t31 = _t32; case 7: isFav = _t31; isCached = post instanceof CacheItem; postsCountHtml = (post.isDeleted ? " de-post-counter-deleted\">".concat(Lng.deleted[lang], "") : "\">".concat(isOp ? '(OP)' : post.count + +!(aib.JsonBuilder && isCached), "")) + (isMyPost ? '(You)' : ''); pText = '' + (isOp ? "") + '' : '') + (post.sage ? '' : '') + '' + '".concat(pText, "")); embedAudioLinks(this); if (Cfg.embedYTube) { new VideosParser().parse(this).endParser(); } embedPostMsgImages(pv); processImgInfoLinks(this); } else { btnsEl = this.btns = $q('.de-post-btns', pv); (_$q7 = $q('.de-post-counter', btnsEl)) === null || _$q7 === void 0 || _$q7.remove(); if (post.isHidden) { btnsEl.classList.add('de-post-hide'); } btnsEl.innerHTML = "").concat(pText); $delAll("".concat(!aib.t && isOp ? aib.qOmitted + ', ' : '', ".de-fullimg-wrap"), pv); $Q(aib.qPostImg, pv).forEach(function (el) { return $show(el.parentNode); }); link = $q('.de-link-parent', pv); if (link) { link.classList.remove('de-link-parent'); } if (Cfg.embedYTube && post.videos.hasLinks) { if (post.videos.playerInfo !== null) { Object.defineProperty(this, 'videos', { value: new Videos(this, $q('.de-video-obj', pv), post.videos.playerInfo) }); } this.videos.updatePost($Q('.de-video-link', post.el), $Q('.de-video-link', pv), true); } if (Cfg.addImgs) { $Q('.de-img-embed', pv).forEach($show); } if (Cfg.markViewed) { this._readDelay = setTimeout(function (post) { if (!post.isViewed) { post.el.classList.add('de-viewed'); post.isViewed = true; } var arr = (sesStorage['de-viewed'] || '').split(','); arr.push(post.num); sesStorage['de-viewed'] = arr; }, post.text.length > 100 ? 2e3 : 500, post); } } pv.addEventListener('click', this, true); this._showPview(pv); case 8: return _context40.a(2); } }, _callee37, this); })); function _buildPview(_x26) { return _buildPview2.apply(this, arguments); } return _buildPview; }() }, { key: "_onerror", value: function _onerror(err) { if (!(err instanceof CancelError)) { this.el.innerHTML = err instanceof AjaxError && err.code === 404 ? Lng.postNotFound[lang] : getErrorMessage(err); } } }, { key: "_onload", value: function _onload(pBuilder) { var board = this.board; var _this$parent = this.parent, num = _this$parent.num, tNum = _this$parent.tNum; var post = new PviewsCache(pBuilder, board, this.tNum).getPost(this.num); if (post && (aib.b !== board || !post.ref.hasMap || !post.ref.has(num))) { (post.ref.hasMap ? $q('.de-refmap', post.el) : $aEnd(post.msg, '
')).insertAdjacentHTML('afterbegin', ">>").concat(aib.b === board ? '' : "/".concat(aib.b, "/")).concat(num, ", ")); } if (post) { this._buildPview(post); } else { this.el.innerHTML = Lng.postNotFound[lang]; } } }, { key: "_setPosition", value: function _setPosition(link, isAnim) { var oldCSS; var cr = link.getBoundingClientRect(); var offX = cr.left + deWindow.pageXOffset + cr.width / 2; var offY = cr.top; var bWidth = nav.viewportWidth(); var isLeft = offX < bWidth / 2; var pv = this.el; var temp = isLeft ? offX : offX - Math.min(parseInt(pv.offsetWidth, 10), offX - 10); var lmw = "max-width:".concat(bWidth - temp - 10, "px; left:").concat(temp, "px;"); var style = pv.style; if (isAnim) { oldCSS = style.cssText; } style.cssText = (isAnim ? 'opacity: 0; ' : '') + lmw; var top = pv.offsetHeight; var isTop = offY + top + cr.height < nav.viewportHeight() || offY - top < 5; top = deWindow.pageYOffset + (isTop ? offY + cr.height : offY - top); this._offsetTop = top; this._isLeft = isLeft; this._isTop = isTop; if (!isAnim) { style.top = top + 'px'; return; } var uId = 'de-movecss-' + Math.round(Math.random() * 1e12); $css("@keyframes ".concat(uId, " { to { ").concat(lmw, " top:").concat(top, "px; } }")).className = 'de-css-move'; if (this._newPos) { style.cssText = this._newPos; pv.removeEventListener('animationend', this); } else { style.cssText = oldCSS; } this._newPos = "".concat(lmw, " top:").concat(top, "px;"); pv.addEventListener('animationend', this); pv.classList.add('de-pview-anim'); style.animationName = uId; } }, { key: "_showPview", value: function _showPview(el) { var _this74 = this; ['mouseover', 'mouseout'].forEach(function (e) { return el.addEventListener(e, _this74, true); }); this.thr.form.el.append(el); this._setPosition(this._link, false); if (Cfg.animation) { el.addEventListener('animationend', function aEvent() { el.removeEventListener('animationend', aEvent); el.classList.remove('de-pview-anim'); el.style.animationName = ''; }); el.classList.add('de-pview-anim'); el.style.animationName = "de-post-open-".concat(this._isTop ? 't' : 'b').concat(this._isLeft ? 'l' : 'r'); } } }], [{ key: "topParent", get: function get() { return Pview.top ? Pview.top.parent : null; } }, { key: "showPview", value: function showPview(parent, link) { var _link$pathname$match, _link$textContent$mat; var tNum = +((_link$pathname$match = link.pathname.match(/.+?\/[^\d]*(\d+)[^\d]/)) === null || _link$pathname$match === void 0 ? void 0 : _link$pathname$match[1]) || aib.getPostOfEl(link).tNum; var pNum = +((_link$textContent$mat = link.textContent.match(/\d+/g)) === null || _link$textContent$mat === void 0 ? void 0 : _link$textContent$mat[0]) || tNum; var isTop = !(parent instanceof Pview); var pv = isTop ? Pview.top : parent.kid; clearTimeout(Pview._delTO); if (pv && pv.num === pNum) { if (pv.kid) { pv.kid.deletePview(); } if (pv._link !== link) { pv._setPosition(link, Cfg.animation); pv._link.classList.remove('de-link-parent'); link.classList.add('de-link-parent'); pv._link = link; if (pv.parent.num !== parent.num) { $Q('.de-link-pview', pv.el).forEach(function (el) { return el.classList.remove('de-link-pview'); }); Pview._markLink(pv.el, parent.num); } } pv.parent = parent; } else if (!Cfg.noNavigHidd || !pByNum.has(pNum) || !pByNum.get(pNum).hidden) { if (pv) { pv.deletePview(); } pv = new Pview(parent, link, pNum, tNum); if (isTop) { Pview.top = pv; } } else { return null; } return pv; } }, { key: "updatePosition", value: function updatePosition(scroll) { var pv = Pview.top; if (!pv) { return; } var _pv2 = pv, parent = _pv2.parent; if (parent.isOmitted) { pv.deletePview(); return; } if (parent.thr.loadCount === 1 && !parent.el.contains(pv._link)) { var el = parent.ref.getElByNum(pv.num); if (!el) { pv.deletePview(); return; } pv._link = el; } var cr = parent.isHidden ? parent : pv._link.getBoundingClientRect(); var diff = pv._isTop ? pv._offsetTop - deWindow.pageYOffset - cr.bottom : pv._offsetTop + pv.el.offsetHeight - deWindow.pageYOffset - cr.top; if (Math.abs(diff) > 1) { if (scroll) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset - diff); } do { pv._offsetTop -= diff; pv.el.style.top = Math.max(pv._offsetTop, 0) + 'px'; } while (pv = pv.kid); } } }, { key: "_markLink", value: function _markLink(el, num) { $Q("a[href*=\"".concat(num, "\"]"), el).forEach(function (el) { return el.textContent.startsWith('>>' + num) && el.classList.add('de-link-pview'); }); } }]); }(AbstractPost); Pview.top = null; Pview._delTO = null; var CacheItem = function () { function CacheItem(pBuilder, thrUrl, count) { _classCallCheck(this, CacheItem); this._pBuilder = pBuilder; this._thrUrl = thrUrl; this.count = count; this.isDeleted = false; this.isInited = false; this.isOp = count === 0; this.isViewed = false; } return _createClass(CacheItem, [{ key: "refLinks", value: _regenerator().m(function refLinks() { return _regenerator().w(function (_context41) { while (1) switch (_context41.n) { case 0: return _context41.d(_regeneratorValues(this._pBuilder.getRefLinks(this.count, this._thrUrl)), 1); case 1: return _context41.a(2); } }, refLinks, this); }) }, { key: "msg", get: function get() { var value = $q(aib.qPostMsg, this.el); Object.defineProperty(this, 'msg', { value: value }); return value; } }, { key: "ref", get: function get() { var value = new RefMap(this); Object.defineProperty(this, 'ref', { value: value }); return value; } }, { key: "sage", get: function get() { var value = aib.getSage(this.el); Object.defineProperty(this, 'sage', { value: value }); return value; } }, { key: "title", get: function get() { return new Post.Content(this).title; } }, { key: "el", get: function get() { var value = this.isOp ? this._pBuilder.getOpEl() : this._pBuilder.getPostEl(this.count - 1); Object.defineProperty(this, 'el', { value: doc.adoptNode(value) }); return value; } }, { key: "thr", get: function get() { var _this75 = this; var value = null; if (this.isOp) { var postsCount = this._pBuilder.length; value = { lastNum: this._pBuilder.getPNum(postsCount - 1), postsCount: postsCount }; Object.defineProperty(value, 'title', { get: function get() { return _this75.title; } }); } Object.defineProperty(this, 'thr', { value: value }); return value; } }]); }(); var PviewsCache = function (_TemporaryContent2) { function PviewsCache(pBuilder, board, tNum) { var _this76; _classCallCheck(this, PviewsCache); _this76 = _callSuper(this, PviewsCache, [board + tNum]); if (_this76._isInited) { return _possibleConstructorReturn(_this76); } _this76._isInited = true; var lPByNum = new Map(); var thrUrl = aib.getThrUrl(board, tNum); lPByNum.set(tNum, new CacheItem(pBuilder, thrUrl, 0)); for (var i = 0; i < pBuilder.length; ++i) { lPByNum.set(pBuilder.getPNum(i), new CacheItem(pBuilder, thrUrl, i + 1)); } DelForm.tNums.add(tNum); _this76._b = board; _this76._posts = lPByNum; if (Cfg.linksNavig) { RefMap.gen(lPByNum); } return _this76; } _inherits(PviewsCache, _TemporaryContent2); return _createClass(PviewsCache, [{ key: "getPost", value: function getPost(num) { var post = this._posts.get(num); if (post && !post.isInited) { if (this._b === aib.b && pByNum.has(num)) { post.ref.makeUnion(pByNum.get(num).ref); } if (post.ref.hasMap) { post.ref.initPostRef(post._thrUrl, Cfg.strikeHidd && Post.hiddenNums.size ? Post.hiddenNums : null); } post.isInited = true; } return post; } }]); }(TemporaryContent); PviewsCache.purgeSecs = 3e5; var ImagesNavigBtns = function () { function ImagesNavigBtns(viewerObj) { _classCallCheck(this, ImagesNavigBtns); var btns = $bEnd(doc.body, "
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t\t
")); var _ref38 = _toConsumableArray(btns.children); this.prevBtn = _ref38[0]; this.nextBtn = _ref38[1]; this.autoBtn = _ref38[2]; this._btns = btns; this._btnsStyle = btns.style; this._hideTO = null; this._isHidden = true; this._oldX = -1; this._oldY = -1; this._viewer = viewerObj; doc.defaultView.addEventListener('mousemove', this); btns.addEventListener('mouseover', this); } return _createClass(ImagesNavigBtns, [{ key: "handleEvent", value: function handleEvent(e) { var _this77 = this; switch (e.type) { case 'mousemove': { var curX = e.clientX, curY = e.clientY; if (this._oldX !== curX || this._oldY !== curY) { this._oldX = curX; this._oldY = curY; this.showBtns(); } return; } case 'mouseover': if (!this.hasEvents) { this.hasEvents = true; ['mouseout', 'click'].forEach(function (e) { return _this77._btns.addEventListener(e, _this77); }); } if (!this._isHidden) { clearTimeout(this._hideTO); KeyEditListener.setTitle(this.prevBtn, 4); KeyEditListener.setTitle(this.nextBtn, 17); } return; case 'mouseout': this._setHideTimeout(); return; case 'click': { var parent = e.target.parentNode; var viewer = this._viewer; switch (parent.id) { case 'de-img-btn-next': viewer.navigate(true); return; case 'de-img-btn-prev': viewer.navigate(false); return; case 'de-img-btn-rotate': viewer.rotateView(true); return; case 'de-img-btn-auto': viewer.isAutoPlay = !viewer.isAutoPlay; this.autoBtn.title = viewer.isAutoPlay ? Lng.autoPlayOff[lang] : Lng.autoPlayOn[lang]; viewer.toggleVideoLoop(); parent.classList.toggle('de-img-btn-auto-on'); } } } } }, { key: "hideBtns", value: function hideBtns() { this._btnsStyle.display = 'none'; this._isHidden = true; this._oldX = this._oldY = -1; } }, { key: "removeBtns", value: function removeBtns() { this._btns.remove(); doc.defaultView.removeEventListener('mousemove', this); clearTimeout(this._hideTO); } }, { key: "showBtns", value: function showBtns() { if (this._isHidden) { this._btnsStyle.removeProperty('display'); this._isHidden = false; this._setHideTimeout(); } } }, { key: "_setHideTimeout", value: function _setHideTimeout() { var _this78 = this; clearTimeout(this._hideTO); this._hideTO = setTimeout(function () { return _this78.hideBtns(); }, 2e3); } }]); }(); var ImagesViewer = function () { function ImagesViewer(data) { _classCallCheck(this, ImagesViewer); this.data = null; this.isAutoPlay = false; this._elStyle = null; this._fullEl = null; this._height = 0; this._minSize = 0; this._moved = false; this._oldL = 0; this._oldT = 0; this._oldX = 0; this._oldY = 0; this._parentEl = null; this._touchDistStart = 0; this._width = 0; this._zoomed = false; this._showFullImg(data); } return _createClass(ImagesViewer, [{ key: "closeImgViewer", value: function closeImgViewer(e) { if ($hasProp(this, '_btns')) { this._btns.removeBtns(); } this._removeFullImg(e); } }, { key: "handleEvent", value: function handleEvent(e) { var _this79 = this; switch (e.type) { case 'click': { if (this.data.isVideo && !(nav.isMobile && nav.isWebkit) && ExpandableImage.isControlClick(e)) { return; } var tag = e.target.tagName.toLowerCase(); if (tag !== 'img' && tag !== 'video') { var classList = e.target.classList; if (['de-fullimg-load', 'de-fullimg-video-hack', 'de-fullimg-wrap', 'de-fullimg-wrap-link'].every(function (c) { return !classList.contains(c); })) { return; } } if (e.button === 0) { if (this._moved && !nav.isMobile) { this._moved = false; } else { this.closeImgViewer(e); AttachedImage.viewer = null; } e.stopPropagation(); break; } return; } case 'mousedown': if (this.data.isVideo && ExpandableImage.isControlClick(e)) { return; } this._oldX = e.clientX; this._oldY = e.clientY; ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.addEventListener(e, _this79, true); }); break; case 'mousemove': this._moveFullImg(e.clientX, e.clientY); return; case 'mouseup': ['mousemove', 'mouseup'].forEach(function (e) { return doc.body.removeEventListener(e, _this79, true); }); return; case 'mousewheel': this._handleZoom(e.clientX, e.clientY, -1 / 40 * ('wheelDeltaY' in e ? e.wheelDeltaY : e.wheelDelta)); break; case 'touchend': if (e.targetTouches.length === 0) { this._zoomed = false; return; } case 'touchmove': { var touchesLen = e.targetTouches.length; if (touchesLen === 1 && !this._zoomed) { this._moveFullImg(e.touches[0].clientX, e.touches[0].clientY); } else if (touchesLen === 2 && e.changedTouches.length === 2) { var finger0X = e.touches[0].clientX; var finger1X = e.touches[1].clientX; var finger0Y = e.touches[0].clientY; var finger1Y = e.touches[1].clientY; this._handleZoom((finger0X + finger1X) / 2, (finger0Y + finger1Y) / 2, this._touchDistStart - (this._touchDistStart = Math.hypot(finger0X - finger1X, finger0Y - finger1Y))); this._zoomed = true; } break; } case 'touchstart': { var _touchesLen = e.targetTouches.length; if (_touchesLen === 1) { if (this.data.isVideo && ExpandableImage.isControlClick(e)) { return; } this._oldX = e.touches[0].clientX; this._oldY = e.touches[0].clientY; } else if (_touchesLen === 2) { this._touchDistStart = Math.hypot(e.touches[0].clientX - e.touches[1].clientX, e.touches[0].clientY - e.touches[1].clientY); } return; } case 'wheel': this._handleZoom(e.clientX, e.clientY, e.deltaY); } e.preventDefault(); } }, { key: "navigate", value: function navigate(isForward) { var isVideoOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var data = this.data; data.cancelWebmLoad(this._fullEl); do { data = data.getFollowImg(isForward); } while (data && (!data.isVideo && !data.isImage || isVideoOnly && data.isImage)); if (data) { this.updateImgViewer(data, true, null); data.post.selectAndScrollTo(data.post.images.first.el); } } }, { key: "rotateView", value: function rotateView(isNextAngle) { if (isNextAngle) { this.data.rotate += this.data.rotate === 270 ? -270 : 90; } var isVideo = this.data.isVideo; var angle = this.data.rotate; var isRotated = angle === 90 || angle === 270; var img = $q('img, video', this._fullEl); var ratio = this._height / this._width; var ratio1 = 1 / ratio; img.style.height = "".concat((isRotated ? ratio : 1) * 100, "%"); img.style.width = "".concat((isRotated ? ratio1 : 1) * 100, "%"); img.style.transform = "rotate(".concat(angle, "deg)").concat(angle === 90 ? " translate(".concat((1 - ratio) * 50, "%, ").concat(isVideo ? 0 : (ratio1 - 1) * 50, "%)") : angle === 270 ? " translate(".concat((ratio - 1) * 50, "%, ").concat(isVideo ? 0 : (1 - ratio1) * 50, "%)") : ''); img.classList.toggle('de-fullimg-rotated', isRotated); if (isVideo && nav.firefoxVer >= 59) { img.previousElementSibling.style = (isRotated ? 'width: calc(100% - 40px); height: 100%; ' : '') + (angle === 90 ? 'right: 0; ' : angle === 270 ? 'left: 0; ' : '') + (angle === 180 ? 'bottom: 0;' : ''); } if (isNextAngle || angle !== 180) { this._rotateFullImg(this._fullEl); } } }, { key: "toggleVideoLoop", value: function toggleVideoLoop() { if (this.data.isVideo) { $q('video', this._fullEl).toggleAttribute('loop', !this.isAutoPlay); } } }, { key: "updateImgViewer", value: function updateImgViewer(data, showButtons, e) { this._removeFullImg(e); this._showFullImg(data, showButtons); } }, { key: "_btns", get: function get() { var value = new ImagesNavigBtns(this); Object.defineProperty(this, '_btns', { value: value }); return value; } }, { key: "_zoomFactor", get: function get() { var value = 1 + Cfg.zoomFactor / 100; Object.defineProperty(this, '_zoomFactor', { value: value }); return value; } }, { key: "_handleZoom", value: function _handleZoom(clientX, clientY, delta) { if (delta === 0) { return; } var width, height; var oldW = this._width, oldH = this._height; if (nav.isMobile) { var wh = oldW / oldH; width = oldW - 1.5 * delta; height = width / wh; } else if (delta > 0) { width = oldW / this._zoomFactor; height = oldH / this._zoomFactor; } else { width = oldW * this._zoomFactor; height = oldH * this._zoomFactor; } if (width <= this._minSize && height <= this._minSize) { return; } this._width = width; this._height = height; this._elStyle.width = width + 'px'; this._elStyle.height = height + 'px'; this._oldL = parseInt(clientX - width / oldW * (clientX - this._oldL), 10); this._elStyle.left = this._oldL + 'px'; this._oldT = parseInt(clientY - height / oldH * (clientY - this._oldT), 10); this._elStyle.top = this._oldT + 'px'; var scale = 100 * width / this.data.width; $q('.de-fullimg-scale', this._fullEl).textContent = scale === 100 ? '' : "".concat(parseInt(scale, 10), "%"); } }, { key: "_moveFullImg", value: function _moveFullImg(curX, curY) { if (curX !== this._oldX || curY !== this._oldY) { this._oldL = parseInt(this._elStyle.left, 10) + curX - this._oldX; this._elStyle.left = this._oldL + 'px'; this._oldT = parseInt(this._elStyle.top, 10) + curY - this._oldY; this._elStyle.top = this._oldT + 'px'; this._oldX = curX; this._oldY = curY; this._moved = true; } } }, { key: "_removeFullImg", value: function _removeFullImg(e) { var data = this.data; data.cancelWebmLoad(this._fullEl); if (data.inPview && data.post.isSticky) { data.post.toggleSticky(false); } this._parentEl.remove(); if (e && data.inPview) { data.sendCloseEvent(e, false); } } }, { key: "_resizeFullImg", value: function _resizeFullImg(el) { if (el !== this._fullEl) { return; } var _this$data$computeFul = this.data.computeFullSize(), _this$data$computeFul2 = _slicedToArray(_this$data$computeFul, 3), width = _this$data$computeFul2[0], height = _this$data$computeFul2[1], minSize = _this$data$computeFul2[2]; this._minSize = minSize ? minSize / this._zoomFactor : Cfg.minImgSize; if (Post.sizing.wWidth - this._oldL - this._width < 5 || Post.sizing.wHeight - this._oldT - this._height < 5) { return; } var cPointX = this._oldL + this._width / 2; var cPointY = this._oldT + this._height / 2; var maxWidth = (Post.sizing.wWidth - cPointX - 2) * 2; var maxHeight = (Post.sizing.wHeight - cPointY - 2) * 2; if (width > maxWidth || height > maxHeight) { var ar = width / height; if (ar > maxWidth / maxHeight) { width = maxWidth; height = width / ar; } else { height = maxHeight; width = height * ar; } if (minSize && width < minSize || height < minSize) { this._minSize = Math.max(width, height); } } this._width = width; this._height = height; this._elStyle.width = width + 'px'; this._elStyle.height = height + 'px'; this._elStyle.left = "".concat(this._oldL = parseInt(cPointX - width / 2, 10), "px"); this._elStyle.top = "".concat(this._oldT = parseInt(cPointY - height / 2, 10), "px"); } }, { key: "_rotateFullImg", value: function _rotateFullImg(el) { if (el !== this._fullEl) { return; } var _width = this._width, _height = this._height; this._width = _height; this._height = _width; this._elStyle.width = _height + 'px'; this._elStyle.height = _width + 'px'; var halfWidth = _width / 2; var halfHeight = _height / 2; this._elStyle.left = "".concat(this._oldL = parseInt(this._oldL + halfWidth - halfHeight, 10), "px"); this._elStyle.top = "".concat(this._oldT = parseInt(this._oldT + halfHeight - halfWidth, 10), "px"); } }, { key: "_showFullImg", value: function _showFullImg(data) { var _this80 = this; var _data$computeFullSize = data.computeFullSize(), _data$computeFullSize2 = _slicedToArray(_data$computeFullSize, 3), width = _data$computeFullSize2[0], height = _data$computeFullSize2[1], minSize = _data$computeFullSize2[2]; this._fullEl = data.getFullImg(false, function (el) { return _this80._resizeFullImg(el); }, function (el) { return _this80._rotateFullImg(el); }); this._width = width; this._height = height; this._minSize = minSize ? minSize / this._zoomFactor : Cfg.minImgSize; this._oldL = (Post.sizing.wWidth - width) / 2 - 1; this._oldT = (Post.sizing.wHeight - height) / 2 - 1; var el = $add("
")); el.append(this._fullEl); var scale = 100 * width / data.width; $q('.de-fullimg-scale', this._fullEl).textContent = scale === 100 ? '' : "".concat(parseInt(scale, 10), "%"); if (data.isImage) { $aBegin(this._fullEl, "")).append($q('img', this._fullEl)); } this._elStyle = el.style; this.data = data; this._parentEl = el; var events = nav.isMobile ? ['click', 'touchend', 'touchmove', 'touchstart'] : ['click', 'mousedown', 'onwheel' in el ? 'wheel' : 'mousewheel']; events.forEach(function (e) { return el.addEventListener(e, _this80, true); }); data.srcBtnEvents(this); if (data.inPview && !data.post.isSticky) { data.post.toggleSticky(true); } var btns = this._btns; if (!data.inPview) { btns.showBtns(); btns.autoBtn.classList.toggle('de-img-btn-none', !data.isVideo); } else if ($hasProp(this, '_btns')) { btns.hideBtns(); } data.post.thr.form.el.append(el); this.toggleVideoLoop(); if (this.data.rotate) { this.rotateView(false); } data.checkForRedirect(this._fullEl); } }]); }(); var ExpandableImage = function () { function ExpandableImage(post, el, prev) { _classCallCheck(this, ExpandableImage); this.el = el; this.expanded = false; this.next = null; this.post = post; this.prev = prev; this.redirected = false; this.rotate = 0; this._fullEl = null; this._webmTitleLoad = null; if (prev) { prev.next = this; } } return _createClass(ExpandableImage, [{ key: "height", get: function get() { return (this._size || [-1, -1])[1]; } }, { key: "inPview", get: function get() { var value = this.post instanceof Pview; Object.defineProperty(this, 'inPview', { value: value }); return value; } }, { key: "isImage", get: function get() { var value = /(jfif|jpe?g|png|gif|avif|webp)$/i.test(this.src) || this.src.startsWith('blob:') && !this.el.hasAttribute('de-video'); Object.defineProperty(this, 'isImage', { value: value }); return value; } }, { key: "isVideo", get: function get() { var value = /(webm|mov|mp4|m4v|ogv)(&|$)/i.test(this.src) || this.src.startsWith('blob:') && this.el.hasAttribute('de-video'); Object.defineProperty(this, 'isVideo', { value: value }); return value; } }, { key: "src", get: function get() { var value = this._getImageSrc(); Object.defineProperty(this, 'src', { value: value, configurable: true }); return value; } }, { key: "width", get: function get() { return (this._size || [-1, -1])[0]; } }, { key: "cancelWebmLoad", value: function cancelWebmLoad(fullEl) { if (this.isVideo) { var videoEl = $q('video', fullEl); videoEl.pause(); videoEl.removeAttribute('src'); videoEl.load(); } if (this._webmTitleLoad) { this._webmTitleLoad.cancelPromise(); this._webmTitleLoad = null; } } }, { key: "checkForRedirect", value: function checkForRedirect(fullEl) { var _this81 = this; if (!aib.getImgRedirectSrc || this.redirected) { return; } aib.getImgRedirectSrc(this.src).then(function (newSrc) { _this81.redirected = true; Object.defineProperty(_this81, 'src', { value: newSrc }); $q('img, video', fullEl).src = _this81.el.src = _this81.el.parentNode.href = aib.getImgNameLink(_this81.el).href = newSrc; if (!_this81.isVideo) { $q('a', fullEl).href = newSrc; } }); } }, { key: "collapseImg", value: function collapseImg(e) { if (e && this.isVideo && ExpandableImage.isControlClick(e)) { return; } var fullImgTop; if (e) { fullImgTop = e.target.getBoundingClientRect().top; } this.cancelWebmLoad(this._fullEl); this.expanded = false; this._fullEl.remove(); this._fullEl = null; $show(this.el.parentNode); if (e) { e.preventDefault(); if (this.inPview) { this.sendCloseEvent(e, true); } var origImgTop = this.el.getBoundingClientRect().top; if (fullImgTop < 0 || origImgTop < 0) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + origImgTop); } } if (aib.kohlchan) { var containerEl = $q('.contentOverflow', this.post.el); if (containerEl && !$q('.de-fullimg-wrap-inpost', containerEl)) { containerEl.removeAttribute('style'); } } } }, { key: "computeFullSize", value: function computeFullSize() { if (!this._size) { if (this.isVideo) { return [0, 0, null]; } var el = new Image(); el.src = this.el.src; return [el.width, el.height, null]; } var _this$_size = _slicedToArray(this._size, 2), width = _this$_size[0], height = _this$_size[1]; if (Cfg.resizeDPI) { width /= Post.sizing.dPxRatio; height /= Post.sizing.dPxRatio; } var minSize = this.isVideo ? Math.max(Cfg.minImgSize, Cfg.minWebmWidth) : Cfg.minImgSize; if (width < minSize && height < minSize) { var ar = width / height; if (width > height) { width = minSize; height = width / ar; } else { height = minSize; width = this.isVideo ? minSize : height * ar; } } var maxWidth = Math.min(Post.sizing.wWidth - 2, Cfg.maxImgSize); var maxHeight = Math.min(Post.sizing.wHeight - 2, Cfg.maxImgSize); if (width > maxWidth || height > maxHeight) { var _ar = width / height; if (_ar > maxWidth / maxHeight) { width = maxWidth; height = width / _ar; } else { height = maxHeight; width = height * _ar; } if (width < minSize) { return [minSize, height, Math.max(width, height)]; } } return [width, height, null]; } }, { key: "expandImg", value: function expandImg(inPost, e) { var _this82 = this; if (e && !e.bubbles) { return; } if (!inPost) { var viewer = AttachedImage.viewer; if (!viewer) { AttachedImage.viewer = new ImagesViewer(this); return; } if (viewer.data === this) { viewer.closeImgViewer(e); AttachedImage.viewer = null; return; } viewer.updateImgViewer(this, e); return; } var origImgTop; if (e) { origImgTop = e.target.getBoundingClientRect().top; } this.expanded = true; var fullEl = this._fullEl = this.getFullImg(true, null, null); fullEl.addEventListener('click', function (e) { return _this82.collapseImg(e); }, true); this.srcBtnEvents(this); var parent = this.el.parentNode; $hide(parent); parent.after(fullEl); this.checkForRedirect(fullEl); if (e) { var fullImgTop = fullEl.getBoundingClientRect().top; if (fullImgTop < 0 || origImgTop < 0) { scrollTo(deWindow.pageXOffset, deWindow.pageYOffset + fullImgTop); } } if (aib.kohlchan) { if (!this.isVideo) { $q('.de-fullimg', fullEl).classList.add('imgExpanded'); } var containerEl = $q('.contentOverflow', this.post.el); if (containerEl) { containerEl.style.maxHeight = 'unset'; } } } }, { key: "getFollowImg", value: function getFollowImg(isForward) { var nImage = isForward ? this.next : this.prev; if (nImage) { return nImage; } var imgs; var post = this.post; do { post = post.getAdjacentVisPost(!isForward); if (!post) { post = isForward ? Thread.first.op : Thread.last.last; if (post.isHidden || post.thr.isHidden) { post = post.getAdjacentVisPost(!isForward); if (!post) { return null; } } } imgs = post.images; } while (imgs.first === null); return isForward ? imgs.first : imgs.last; } }, { key: "getFullImg", value: function getFullImg(inPost, onsizechange, onrotate) { var _this83 = this; var wrapEl, name, origSrc; var src = this._getImageSrc(); var parent = this._getImageParent; if (this.el.className !== 'de-img-embed') { var nameEl = $q(aib.qPostImgNameLink, parent) || $q('a', parent); origSrc = nameEl.getAttribute('de-href') || nameEl.href; name = this.name; } else { origSrc = parent.href; name = getFileName(origSrc); } var imgNameEl = (Cfg.imgSrcBtns ? '' : '') + "").concat(name); var wrapClass = "".concat(inPost ? ' de-fullimg-wrap-inpost' : " de-fullimg-wrap-center".concat(this._size ? '' : ' de-fullimg-wrap-nosize')).concat(this.isVideo ? ' de-fullimg-video' : ''); if (!this.isVideo) { var waitEl = !aib.getImgRedirectSrc && this._size ? '' : ''; wrapEl = $add("")); var imgEl = $q('.de-fullimg', wrapEl); imgEl.onload = imgEl.onerror = function (_ref39) { var img = _ref39.target; if (!(img.naturalHeight + img.naturalWidth)) { if (!img.onceLoaded) { var _src = img.src; img.src = _src; img.onceLoaded = true; } return; } var newW = img.naturalWidth, newH = img.naturalHeight, scrollWidth = img.scrollWidth; var ar = _this83._size ? _this83._size[1] / _this83._size[0] : newH / newW; var isRotated = scrollWidth ? img.scrollHeight / scrollWidth > 1 ? ar < 1 : ar > 1 : false; if (!_this83._size || isRotated) { _this83._size = isRotated ? [newH, newW] : [newW, newH]; } var parentEl = img.parentNode.parentNode; var waitEl = $q('.de-fullimg-load', parentEl); if (waitEl) { $hide(waitEl); parentEl.classList.remove('de-fullimg-wrap-nosize'); if (onsizechange) { onsizechange(parentEl); } } else if (isRotated && onrotate) { onrotate(parentEl); } }; DollchanAPI.notify('expandmedia', src); return wrapEl; } var isWebm = getFileExt(origSrc) === 'webm'; var needTitle = isWebm && Cfg.webmTitles; var inPostSize = ''; if (inPost) { var _this$computeFullSize = this.computeFullSize(), _this$computeFullSize2 = _slicedToArray(_this$computeFullSize, 2), width = _this$computeFullSize2[0], height = _this$computeFullSize2[1]; inPostSize = " style=\"width: ".concat(width, "px; height: ").concat(height, "px;\""); } var hasTitle = needTitle && this.el.hasAttribute('de-metatitle'); var title = hasTitle ? this.el.getAttribute('de-metatitle') : ''; wrapEl = $add("
").concat(nav.firefoxVer >= 59 || nav.isMobile ? "
".concat( nav.isMobile && nav.isWebkit ? "\xD7" : '', "
") : '', "\n\t\t\t\n\t\t\t
").concat(imgNameEl, " \n\t\t\t\t").concat(hasTitle && title ? title : '', "\n\t\t\t\t").concat(needTitle && !hasTitle ? "\n\t\t\t\t\t" : '', "\n\t\t\t
\n\t\t
")); var videoEl = $q('video', wrapEl); videoEl.volume = Cfg.webmVolume / 100; videoEl.addEventListener('ended', function () { return AttachedImage.viewer.navigate(true, true); }); videoEl.addEventListener('error', function (_ref40) { var el = _ref40.target; if (!el.onceLoaded) { el.load(); el.onceLoaded = true; } }); if (!this._size) { videoEl.addEventListener('loadedmetadata', function (_ref41) { var el = _ref41.target; _this83._size = [el.videoWidth, el.videoHeight]; onsizechange(wrapEl); }); } setTimeout(function () { return videoEl.dispatchEvent(new CustomEvent('volumechange')); }, 150); videoEl.addEventListener('volumechange', function () { var _ref43 = _asyncToGenerator(_regenerator().m(function _callee38(_ref42) { var el, isTrusted, val; return _regenerator().w(function (_context42) { while (1) switch (_context42.n) { case 0: el = _ref42.target, isTrusted = _ref42.isTrusted; val = el.muted ? 0 : Math.round(el.volume * 100); if (!(isTrusted && val !== Cfg.webmVolume)) { _context42.n = 2; break; } _context42.n = 1; return CfgSaver.save('webmVolume', val); case 1: sendStorageEvent('__de-webmvolume', val); case 2: return _context42.a(2); } }, _callee38); })); return function (_x27) { return _ref43.apply(this, arguments); }; }()); if (nav.isMsEdge && isWebm && !DollchanAPI.hasListener('expandmedia')) { var href = 'https://github.com/Kagami/webmify/'; $popup('err-expandmedia', "".concat(Lng.errMsEdgeWebm[lang], ":\n").concat(href, ""), false); } if (needTitle && !hasTitle) { this._webmTitleLoad = ContentLoader.loadFileData(videoEl.src, false).then(function (data) { $hide($q('.de-wait', wrapEl)); if (!data) { return; } var str = ''; var d = new WebmParser(data.buffer).getWebmData(); if (!d) { return; } d = d[0]; for (var i = 0, len = d.length; i < len; ++i) { if (d[i] === 0x7B && d[i + 1] === 0xA9) { var titleLenPos = i + 2; var muxingAppPos = titleLenPos + (d[titleLenPos] & 0x7F) + 1; if (d[muxingAppPos] === 0x4D && d[muxingAppPos + 1] === 0x80) { for (var j = titleLenPos + 1; j < muxingAppPos; ++j) { str += String.fromCharCode(d[j]); } break; } } } var loadedTitle = decodeURIComponent(escape(str)); _this83.el.setAttribute('de-metatitle', loadedTitle); if (str) { $q('.de-webm-title', wrapEl).textContent = videoEl.title = loadedTitle.replaceAll('.', ' '); } }); } DollchanAPI.notify('expandmedia', src); return wrapEl; } }, { key: "sendCloseEvent", value: function sendCloseEvent(e, inPost) { var post = this.post; var cr = post.el.getBoundingClientRect(); var x = e.pageX - deWindow.pageXOffset; var y = e.pageY - deWindow.pageYOffset; if (!inPost) { while (x > cr.right || x < cr.left || y > cr.bottom || y < cr.top) { post = post.parent; if (post && post instanceof Pview) { cr = post.el.getBoundingClientRect(); } else { if (Pview.top) { Pview.top.markToDel(); } return; } } post.mouseEnter(); } else if (x > cr.right || y > cr.bottom && Pview.top) { Pview.top.markToDel(); } } }, { key: "srcBtnEvents", value: function srcBtnEvents(_ref44) { var _this84 = this; var _fullEl = _ref44._fullEl; if (!Cfg.imgSrcBtns) { return; } var srcBtnEl = $q('.de-btn-img', _fullEl); var event = nav.isMobile ? 'click' : 'mouseover'; srcBtnEl.addEventListener(event, function () { return srcBtnEl._menuTO = setTimeout(function () { var _srcBtnEl$_menu, _srcBtnEl$_menu2; if (nav.isMobile && (_srcBtnEl$_menu = srcBtnEl._menu) !== null && _srcBtnEl$_menu !== void 0 && _srcBtnEl$_menu.el && ((_srcBtnEl$_menu2 = srcBtnEl._menu) === null || _srcBtnEl$_menu2 === void 0 ? void 0 : _srcBtnEl$_menu2.parentEl) === srcBtnEl) { srcBtnEl._menu.el.remove(); srcBtnEl._menu = null; return; } var menuHtml = !_this84.isVideo ? Menu.getMenuImg(srcBtnEl) : Menu.getMenuImg(srcBtnEl, true) + "".concat(Lng.getFrameLinks[lang], ""); srcBtnEl._menu = new Menu(srcBtnEl, menuHtml, !_this84.isVideo ? Function.prototype : function (optiontEl) { if (!optiontEl.classList.contains('de-menu-getframe')) { return; } ContentLoader.getDataFromImg($q('video', _fullEl)).then(function (arr) { $popup('upload', Lng.sending[lang], true); var name = cutFileExt(_this84.name) + '.png'; var blob = new Blob([arr], { type: 'image/png' }); var formData = new FormData(); formData.append('file', blob, name); var ajaxParams = { data: formData || { arr: arr, name: name }, method: 'POST' }; var frameLinkHtml = "").concat(Lng.saveFrame[lang], ""); $ajax('https://tmp.saucenao.com/', ajaxParams, true).then(function (xhr) { var hostUrl; var errMsg = Lng.errSaucenao[lang]; try { var obj = JSON.parse(xhr.responseText); if (obj.status === 'success') { hostUrl = obj.url ? Menu.getMenuImg(obj.url) : ''; } else { errMsg += ':
' + obj.error_message; } } catch (err) {} $popup('upload', (hostUrl || errMsg) + frameLinkHtml); }, function () { return $popup('upload', Lng.errSaucenao[lang] + frameLinkHtml); }); }, Function.prototype); }); }, Cfg.linksOver); }); srcBtnEl.addEventListener('mouseout', function (e) { return clearTimeout(e.target._menuTO); }); } }, { key: "_size", get: function get() { var value = this._getImageSize(); Object.defineProperty(this, '_size', { value: value, writable: true }); return value; } }], [{ key: "isControlClick", value: function isControlClick(e) { return Cfg.webmControl && e.clientY > e.target.getBoundingClientRect().bottom - 40; } }]); }(); var EmbeddedImage = function (_ExpandableImage) { function EmbeddedImage() { _classCallCheck(this, EmbeddedImage); return _callSuper(this, EmbeddedImage, arguments); } _inherits(EmbeddedImage, _ExpandableImage); return _createClass(EmbeddedImage, [{ key: "_getImageParent", get: function get() { var value = this.el.parentNode; Object.defineProperty(this, '_getImageParent', { value: value }); return value; } }, { key: "_getImageSize", value: function _getImageSize() { return [this.el.naturalWidth, this.el.naturalHeight]; } }, { key: "_getImageSrc", value: function _getImageSrc() { return this.el.src; } }]); }(ExpandableImage); var AttachedImage = function (_ExpandableImage2) { function AttachedImage() { _classCallCheck(this, AttachedImage); return _callSuper(this, AttachedImage, arguments); } _inherits(AttachedImage, _ExpandableImage2); return _createClass(AttachedImage, [{ key: "info", get: function get() { var value = aib.getImgInfo(this._getImageParent); Object.defineProperty(this, 'info', { value: value }); return value; } }, { key: "name", get: function get() { var value = aib.getImgRealName(this._getImageParent).trim(); Object.defineProperty(this, 'name', { value: value }); return value; } }, { key: "nameLink", get: function get() { var value = $q(aib.qPostImgNameLink, this._getImageParent); Object.defineProperty(this, 'nameLink', { value: value }); return value; } }, { key: "weight", get: function get() { var value = 0; if (this.info) { var w = this.info; if (this.nameLink) { w = w.replace(this.nameLink.innerText, ''); } w = w.match(/(\d+(?:[.,]\d+)?)\s*([mмkк])?i?[bб]/i); var w1 = w[1].replace(',', '.'); value = w[2] === 'M' ? w1 * 1e3 | 0 : !w[2] ? Math.round(w1 / 1e3) : w1; } Object.defineProperty(this, 'weight', { value: value }); return value; } }, { key: "_getImageParent", get: function get() { var value = aib.getImgWrap(this.el); Object.defineProperty(this, '_getImageParent', { value: value }); return value; } }, { key: "_getImageSize", value: function _getImageSize() { if (this.info) { var size = this.info.match(/(?:[\s(,]|^)(\d+)\s?[x\u00D7]\s?(\d+)(?:[)\s,]|$)/); return size ? [size[1], size[2]] : null; } return null; } }, { key: "_getImageSrc", value: function _getImageSrc() { return aib.getImgSrcLink(this.el).getAttribute('href'); } }], [{ key: "closeImg", value: function closeImg() { var viewer = AttachedImage.viewer; if (viewer) { viewer.closeImgViewer(null); AttachedImage.viewer = null; } } }]); }(ExpandableImage); AttachedImage.viewer = null; var PostImages = function () { function PostImages(post) { _classCallCheck(this, PostImages); var first = null; var last = null; var els = $Q(aib.qPostImg, post.el); var hasAttachments = false; var filesMap = new Map(); for (var i = 0, len = els.length; i < len; ++i) { var el = els[i]; last = new AttachedImage(post, el, last); filesMap.set(el, last); hasAttachments = true; if (!first) { first = last; } } if (Cfg.addImgs || localData) { els = $Q('.de-img-embed', post.el); for (var _i11 = 0, _len6 = els.length; _i11 < _len6; ++_i11) { var _el1 = els[_i11]; last = new EmbeddedImage(post, _el1, last); filesMap.set(_el1, last); if (!first) { first = last; } } } this.first = first; this.last = last; this.hasAttachments = hasAttachments; this._map = filesMap; } return _createClass(PostImages, [{ key: "expanded", get: function get() { for (var img = this.first; img; img = img.next) { if (img.expanded) { return true; } } return false; } }, { key: "firstAttach", get: function get() { return this.hasAttachments ? this.first : null; } }, { key: "getImageByEl", value: function getImageByEl(el) { return this._map.get(el); } }, { key: Symbol.iterator, value: function value() { return { _img: this.first, next: function next() { var value = this._img; if (value) { this._img = value.next; return { value: value, done: false }; } return { done: true }; } }; } }]); }(); var ImagesHashStorage = Object.create({ get getHash() { var value = this._getHashHelper.bind(this); Object.defineProperty(this, 'getHash', { value: value }); return value; }, endFn: function endFn() { if ($hasProp(this, '_storage')) { sesStorage['de-imageshash'] = JSON.stringify(this._storage); } if ($hasProp(this, '_workers')) { this._workers.clearWorkers(); delete this._workers; } }, get _canvas() { var value = doc.createElement('canvas'); Object.defineProperty(this, '_canvas', { value: value }); return value; }, get _storage() { var value = null; try { value = JSON.parse(sesStorage['de-imageshash']); } catch (err) {} if (!value) { value = {}; } Object.defineProperty(this, '_storage', { value: value }); return value; }, get _workers() { var value = new WorkerPool(4, this._genImgHash, Function.prototype); Object.defineProperty(this, '_workers', { value: value, configurable: true }); return value; }, _genImgHash: function _genImgHash(_ref45) { var _ref46 = _slicedToArray(_ref45, 3), arrBuf = _ref46[0], oldw = _ref46[1], oldh = _ref46[2]; var buf = new Uint8Array(arrBuf); var size = oldw * oldh; for (var i = 0, j = 0; i < size; i++, j += 4) { buf[i] = buf[j] * 0.3 + buf[j + 1] * 0.59 + buf[j + 2] * 0.11; } var newh = 8; var neww = 8; var levels = 4; var areas = 256 / levels; var values = 256 / (levels - 1); var hash = 0; for (var _i12 = 0; _i12 < newh; ++_i12) { for (var _j4 = 0; _j4 < neww; ++_j4) { var temp = _i12 / (newh - 1) * (oldh - 1); var l = Math.min(temp | 0, oldh - 2); var u = temp - l; temp = _j4 / (neww - 1) * (oldw - 1); var c = Math.min(temp | 0, oldw - 2); var t = temp - c; hash = (hash << 4) + Math.min(values * ((buf[l * oldw + c] * ((1 - t) * (1 - u)) + buf[l * oldw + c + 1] * (t * (1 - u)) + buf[(l + 1) * oldw + c + 1] * (t * u) + buf[(l + 1) * oldw + c] * ((1 - t) * u)) / areas | 0), 255); var g = hash & 0xF0000000; if (g) { hash ^= g >>> 24; } hash &= ~g; } } return { hash: hash }; }, _getHashHelper: function _getHashHelper(_ref47) { var _this85 = this; return _asyncToGenerator(_regenerator().m(function _callee39() { var el, src, data, val, w, h, cnv, ctx, buffer; return _regenerator().w(function (_context43) { while (1) switch (_context43.n) { case 0: el = _ref47.el, src = _ref47.src; if (!(src in _this85._storage)) { _context43.n = 1; break; } return _context43.a(2, _this85._storage[src]); case 1: if (el.complete) { _context43.n = 2; break; } _context43.n = 2; return new Promise(function (resolve) { return el.addEventListener('load', function () { return resolve(); }); }); case 2: el.removeAttribute('loading'); if (!(el.naturalWidth + el.naturalHeight === 0)) { _context43.n = 3; break; } return _context43.a(2, -1); case 3: val = -1; w = el.naturalWidth, h = el.naturalHeight; cnv = _this85._canvas; cnv.width = w; cnv.height = h; ctx = cnv.getContext('2d'); ctx.drawImage(el, 0, 0); buffer = ctx.getImageData(0, 0, w, h).data.buffer; if (!buffer) { _context43.n = 5; break; } _context43.n = 4; return new Promise(function (resolve) { return _this85._workers.runWorker([buffer, w, h], [buffer], function (val) { return resolve(val); }); }); case 4: data = _context43.v; if (data && 'hash' in data) { val = data.hash; } case 5: _this85._storage[src] = val; return _context43.a(2, val); } }, _callee39); }))(); } }); function addImgButtons(link) { link.insertAdjacentHTML('beforebegin', '' + ''); } function processImgInfoLinks(parent) { var addSrc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Cfg.imgSrcBtns; var imgNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Cfg.imgNames; if (addSrc || imgNames) { if (parent instanceof AbstractPost) { processPostImgInfoLinks(parent, addSrc, imgNames); } else { var posts = $Q(aib.qPost + ', ' + aib.qOPost + ', .de-oppost', parent); for (var i = 0, len = posts.length; i < len; ++i) { processPostImgInfoLinks(pByEl.get(posts[i]), addSrc, imgNames); } } } } function processPostImgInfoLinks(post, addSrc, imgNames) { if (!post) { return; } for (var _iterator23 = _createForOfIteratorHelperLoose(post.images), _step23; !(_step23 = _iterator23()).done;) { var image = _step23.value; var link = image.nameLink; if (!link) { return; } if (addSrc) { addImgButtons(link); } var name = image.name; if (!link.classList.contains('de-img-name')) { link.classList.add('de-img-name'); link.title = name; link.setAttribute('download', name); link.setAttribute('de-href', link.href); } if (imgNames) { var ext = link.getAttribute('de-img-ext'); if (!ext) { ext = getFileExt(name) || getFileExt(getFileName(link.href)); link.setAttribute('de-img-ext', ext); link.setAttribute('de-img-name-old', link.textContent); } link.textContent = imgNames === 2 ? ext : name; } } } function embedPostMsgImages(el) { if (!Cfg.addImgs || localData) { return; } var els = $Q(aib.qMsgImgLink, el); for (var i = 0, len = els.length; i < len; ++i) { var link = els[i]; var url = link.href; if (url.includes('?') || aib.getPostOfEl(link).hidden) { continue; } link.insertAdjacentHTML('beforebegin', "
")); if (Cfg.imgSrcBtns) { addImgButtons(link); } } } var DOMPostsBuilder = function () { function DOMPostsBuilder(form, isArchived) { _classCallCheck(this, DOMPostsBuilder); this._form = form; this._posts = $Q(aib.qPost, form); this.length = this._posts.length; this.postersCount = ''; this._isArchived = isArchived; } return _createClass(DOMPostsBuilder, [{ key: "isClosed", get: function get() { return aib.qClosed && !!$q(aib.qClosed, this._form) || this._isArchived; } }, { key: "getOpMessage", value: function getOpMessage() { return aib.fixHTML(doc.adoptNode($q(aib.qPostMsg, this._form))); } }, { key: "getPNum", value: function getPNum(i) { return aib.getPNum(this._posts[i]); } }, { key: "getOpEl", value: function getOpEl() { return aib.fixHTML(aib.getOp($q(aib.qThread, this._form) || this._form)); } }, { key: "getPostEl", value: function getPostEl(i) { return aib.fixHTML(this._posts[i]); } }, { key: "getRefLinks", value: _regenerator().m(function getRefLinks(i, thrUrl) { var msg, links, _i13, len, link, tc, lNum, url; return _regenerator().w(function (_context44) { while (1) switch (_context44.n) { case 0: msg = i === 0 ? $q(aib.qPostMsg, this._form) : $q(aib.qPostMsg, this._posts[i - 1]); links = $Q('a', msg); _i13 = 0, len = links.length; case 1: if (!(_i13 < len)) { _context44.n = 4; break; } link = links[_i13]; tc = link.textContent; if (!(tc[0] === '>' && tc[1] === '>')) { _context44.n = 3; break; } lNum = parseInt(tc.substr(2), 10); if (!lNum) { _context44.n = 3; break; } _context44.n = 2; return [link, lNum]; case 2: url = link.getAttribute('href'); if (url[0] === '#') { link.setAttribute('href', thrUrl + url); } case 3: ++_i13; _context44.n = 1; break; case 4: return _context44.a(2); } }, getRefLinks, this); }) }, { key: "bannedPostsData", value: _regenerator().m(function bannedPostsData() { var banEls, i, len, banEl, postEl; return _regenerator().w(function (_context45) { while (1) switch (_context45.n) { case 0: banEls = $Q(aib.qBan, this._form); i = 0, len = banEls.length; case 1: if (!(i < len)) { _context45.n = 3; break; } banEl = banEls[i]; postEl = aib.getPostElOfEl(banEl); _context45.n = 2; return [1, postEl ? aib.getPNum(postEl) : null, doc.adoptNode(banEl)]; case 2: ++i; _context45.n = 1; break; case 3: return _context45.a(2); } }, bannedPostsData, this); }) }]); }(); var _4chanPostsBuilder = function () { function _4chanPostsBuilder(json, board) { _classCallCheck(this, _4chanPostsBuilder); this._posts = json.posts; this._board = board; this.length = json.posts.length - 1; this.postersCount = this._posts[0].unique_ips; this._colorIDs = []; } return _createClass(_4chanPostsBuilder, [{ key: "isClosed", get: function get() { return !!(this._posts[0].closed || this._posts[0].archived); } }, { key: "getOpMessage", value: function getOpMessage() { var _this$_posts$ = this._posts[0], no = _this$_posts$.no, com = _this$_posts$.com; return $add(aib.fixHTML("
").concat(com, "
"))); } }, { key: "getPNum", value: function getPNum(i) { return this._posts[i + 1].no; } }, { key: "getOpEl", value: function getOpEl() { return this.getPostEl(-1); } }, { key: "getPostEl", value: function getPostEl(i) { return $add(aib.fixHTML(this.getPostHTML(i))).lastElementChild; } }, { key: "getPostHTML", value: function getPostHTML(i) { var data = this._posts[i + 1]; var num = data.no; var board = this._board; var _icon = function _icon(id) { return "//s.4cdn.org/image/".concat(id).concat(deWindow.devicePixelRatio < 2 ? '.gif' : '@2x.gif'); }; var fileHTML = ''; if (data.filedeleted) { fileHTML = "
\n\t\t\t\t\"File\n\t\t\t
"); } else if (typeof data.filename === 'string') { var _chanPostsBuilder$fi = _4chanPostsBuilder.fixFileName(data.filename, 30), _name2 = _chanPostsBuilder$fi.name, needTitle = _chanPostsBuilder$fi.isFixed; _name2 += data.ext; if (!data.tn_w && !data.tn_h && data.ext === '.gif') { data.tn_w = data.w; data.tn_h = data.h; } var isSpoiler = data.spoiler; if (isSpoiler) { _name2 = 'Spoiler Image'; data.tn_w = data.tn_h = 100; needTitle = false; } var size = prettifySize(data.fsize); var fileTextTitle = isSpoiler ? " title=\"".concat(data.filename + data.ext, "\"") : ''; var aHref = needTitle ? "title=\"".concat(data.filename + data.ext, "\"") : ''; var imgSrc = isSpoiler ? '//s.4cdn.org/image/spoiler.png' : "//i.4cdn.org/".concat(board, "/").concat(data.tim, "s.jpg"); fileHTML = "
\n\t\t\t\t
File:\n\t\t\t\t\t").concat(_name2, "\n\t\t\t\t\t(").concat(size, ", ").concat(data.ext === '.pdf' ? 'PDF' : data.w + 'x' + data.h, ")\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\"").concat(size,\n\t\t\t\t\t
\n\t\t\t\t\t\t").concat(size, " ").concat(data.ext.substr(1).toUpperCase(), "\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
"); } var highlight = ''; var ccBy = ''; var cc = data.capcode; switch (cc) { case 'admin_highlight': highlight = ' highlightPost'; cc = 'admin'; case 'admin': ccBy = 'Administrators'; break; case 'mod': ccBy = 'Moderators'; break; case 'developer': ccBy = 'Developers'; break; case 'manager': ccBy = 'Managers'; break; case 'founder': ccBy = 'Founder'; } var ccText = ''; var ccImg = ''; var ccClass = ''; if (cc) { var ccName = cc[0].toUpperCase() + cc.slice(1); ccText = "## ").concat(ccName, ""); ccImg = "\"").concat(ccName,"); ccClass = 'capcode' + (cc === 'founder' ? 'Admin' : ccName); } var id = data.id, _data$name = data.name, name = _data$name === void 0 ? '' : _data$name; var nameEl = "".concat(name, ""); var mobNameEl = name.length <= 30 ? nameEl : "".concat(name.substring(30), "(\u2026)"); var tripEl = "".concat(data.trip ? "".concat(data.trip, "") : ''); var cID = id ? this._colorIDs[id] || this._computeIDColor(id) : null; var posteruidEl = id && !data.capcode ? "(ID: ").concat(id, ")") : ''; var flagEl = (data.country ? "") : '') + (data.board_flag ? "") : ''); var emailEl = data.email ? "") : ''; var replyEl = "No.").concat(num, ""); var subjEl = "".concat(data.sub || '', ""); return "
\n\t\t\t
>>
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t").concat(mobNameEl, "\n\t\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t\t").concat(ccText, "\n\t\t\t\t\t\t").concat(ccImg, "\n\t\t\t\t\t\t").concat(posteruidEl, "\n\t\t\t\t\t\t").concat(flagEl, "
\n\t\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t
\n\t\t\t\t\t").concat(data.now, " ").concat(replyEl, "\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t").concat(subjEl, "\n\t\t\t\t\t\n\t\t\t\t\t\t").concat(emailEl, "\n\t\t\t\t\t\t\t").concat(nameEl, "\n\t\t\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t\t\t").concat(ccText, "\n\t\t\t\t\t\t").concat(data.email ? '' : '', "\n\t\t\t\t\t\t").concat(ccImg, "\n\t\t\t\t\t\t").concat(posteruidEl, "\n\t\t\t\t\t\t").concat(flagEl, "\n\t\t\t\t\t\n\t\t\t\t\t").concat(data.now, "\n\t\t\t\t\t").concat(replyEl, "\n\t\t\t\t
\n\t\t\t\t").concat(fileHTML, "\n\t\t\t\t
").concat(data.com || '', "
\n\t\t\t
\n\t\t
"); } }, { key: "bannedPostsData", value: _regenerator().m(function bannedPostsData() { return _regenerator().w(function (_context46) { while (1) switch (_context46.n) { case 0: return _context46.a(2); } }, bannedPostsData); }) }, { key: "_computeIDColor", value: function _computeIDColor(text) { var hash = 0; for (var i = 0, len = text.length; i < len; ++i) { hash = (hash << 5) - hash + text.charCodeAt(i); } var r = hash >> 24 & 255; var g = hash >> 16 & 255; var b = hash >> 8 & 255; var value = this._colorIDs[text] = [r, g, b, 0.299 * r + 0.587 * g + 0.114 * b > 125]; return value; } }], [{ key: "fixFileName", value: function fixFileName(name, maxLength) { var decodedName = name.replaceAll('&', '&').replaceAll('"', '"').replaceAll(''', '\'').replaceAll('<', '<').replaceAll('>', '>'); return decodedName.length <= maxLength ? { isFixed: false, name: name } : { isFixed: true, name: decodedName.slice(0, 25).replaceAll('&', '&').replaceAll('"', '"').replaceAll('\'', ''').replaceAll('<', '<').replaceAll('>', '>') }; } }]); }(); _4chanPostsBuilder._customSpoiler = new Map(); var MakabaPostsBuilder = function () { function MakabaPostsBuilder(json, board) { _classCallCheck(this, MakabaPostsBuilder); if (json.Error) { throw new AjaxError(0, "API error: ".concat(json.Error, " (").concat(json.Code, ")")); } this._json = json; this._board = board; this._posts = json.threads[0].posts; this.length = json.posts_count - 1; this.postersCount = json.unique_posters; } return _createClass(MakabaPostsBuilder, [{ key: "isClosed", get: function get() { return this._json.is_closed; } }, { key: "getOpMessage", value: function getOpMessage() { return $add(aib.fixHTML(this._getPostMsg(this._posts[0]))); } }, { key: "getPNum", value: function getPNum(i) { return this._posts[i + 1].num; } }, { key: "getOpEl", value: function getOpEl() { return this.getPostEl(-1); } }, { key: "getPostEl", value: function getPostEl(i) { return $add(aib.fixHTML(this.getPostHTML(i))).firstElementChild; } }, { key: "getPostHTML", value: function getPostHTML(i) { var data = this._posts[i + 1]; var files = data.files, num = data.num; var board = this._board; var _switch = function _switch(val, obj) { return val in obj ? obj[val] : obj['@@default']; }; var filesHTML = ''; if (files !== null && files !== void 0 && files.length) { filesHTML = "
"); for (var _iterator24 = _createForOfIteratorHelperLoose(files), _step24; !(_step24 = _iterator24()).done;) { var file = _step24.value; var _file$fullname = file.fullname, fullname = _file$fullname === void 0 ? file.name : _file$fullname, _file$displayname = file.displayname, dispName = _file$displayname === void 0 ? file.name : _file$displayname, type = file.type; var isVideo = type === 6 || type === 10; var imgHTML = "\"").concat(file.width,"); if (file.nsfw) { imgHTML = "
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tNSFW\n\t\t\t\t\t\t\t[ \u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C ]\n\t\t\t\t\t\t
\n\t\t\t\t\t\t".concat(imgHTML, "\n\t\t\t\t\t
"); } filesHTML += "
\n\t\t\t\t\t
\n\t\t\t\t\t\t").concat(dispName, "\n\t\t\t\t\t\t(").concat(file.size, "\u041A\u0431, ") + "".concat(file.width, "x").concat(file.height).concat(isVideo ? ', ' + file.duration : '', ")\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t").concat(imgHTML, "\n\t\t\t\t\t\n\t\t\t\t
"); } filesHTML += '
'; } var emailEl = data.email ? "").concat(data.name, "") : "".concat(data.name, ""); var tripEl = !data.trip ? '' : "## Abu ##', '!!%mod%!!': 'post__mod">## Mod ##', '!!%Inquisitor%!!': 'post__inquisitor">## Applejack ##', '!!%coder%!!': 'post__mod">## Кодер ##', '!!%curunir%!!': 'post__mod">## Curunir ##', '@@default': "".concat(data.trip_style ? data.trip_style : 'post__trip', "\">") + data.trip }), ""); var refHref = "/".concat(board, "/res/").concat(parseInt(data.parent) || num, ".html#").concat(num); var rate = ''; if (this._hasLikes) { var likes = "
\n\t\t\t\t\t\n\t\t\t\t\t\t "); var dislikes = likes.replaceAll('like', 'dislike').replace('icon__thunder', 'icon__thumbdown'); rate = "".concat(likes).concat(data.likes || 0, "
\n\t\t\t\t").concat(dislikes).concat(data.dislikes || 0, "
"); } var isOp = i === -1; var reflink = "\u2116") + "").concat(num, ""); var w = function w(el) { return "".concat(el, ""); }; return "
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t").concat(!data.subject ? '' : w('' + "".concat(data.subject + (data.tags ? " /".concat(data.tags, "/") : ''), "")), "\n\t\t\t\t").concat(w("\n\t\t\t\t\t".concat(emailEl, "\n\t\t\t\t\t").concat(data.icon ? '' + "".concat(data.icon, "") : '', "\n\t\t\t\t\t").concat(tripEl, "\n\t\t\t\t\t").concat(data.op === 1 ? '# OP ' : '', "\n\t\t\t\t")), "\n\t\t\t\t").concat(w("".concat(data.date, "")), "\n\t\t\t\t").concat(w(reflink), "\n\t\t\t\t").concat(rate, "\n\t\t\t
\n\t\t\t").concat(filesHTML, "\n\t\t\t").concat(this._getPostMsg(data), "\n\t\t
"); } }, { key: "bannedPostsData", value: _regenerator().m(function bannedPostsData() { var _iterator25, _step25, _step25$value, banned, num, _t38; return _regenerator().w(function (_context47) { while (1) switch (_context47.n) { case 0: _iterator25 = _createForOfIteratorHelperLoose(this._posts); case 1: if ((_step25 = _iterator25()).done) { _context47.n = 7; break; } _step25$value = _step25.value, banned = _step25$value.banned, num = _step25$value.num; _t38 = banned; _context47.n = _t38 === 1 ? 2 : _t38 === 2 ? 4 : 6; break; case 2: _context47.n = 3; return [1, num, $add('(Автор этого поста был забанен.)')]; case 3: return _context47.a(3, 6); case 4: _context47.n = 5; return [2, num, $add('' + '(Автор этого поста был предупрежден.)')]; case 5: return _context47.a(3, 6); case 6: _context47.n = 1; break; case 7: return _context47.a(2); } }, bannedPostsData, this); }) }, { key: "_hasLikes", get: function get() { var value = !!$q('.like-div, .post__rate'); Object.defineProperty(this, '_hasLikes', { value: value }); return value; } }, { key: "_getPostMsg", value: function _getPostMsg(data) { var _switch = function _switch(val, obj) { return val in obj ? obj[val] : obj['@@default']; }; var comment = data.comment.replace(/